golem-scala-base-image

Regenerates Golem Scala SDK QuickJS guest runtime WASMs from WIT world definitions.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-scala-base-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-scala-base-image
Source: https://github.com/golemcloud/golem/tree/main/.agents/skills/golem-scala-base-image
Command: npx skills add https://github.com/golemcloud/golem --skill golem-scala-base-image

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires wasm-rquickjs-cli, wasm-tools.

What problem does it solve?

Keeping the Golem Scala SDK's three embedded QuickJS guest runtime WASMs in sync with WIT world definitions, guest roles, and the pinned wasm-rquickjs toolchain is error-prone when done manually. This Skill documents the exact contract and regeneration pipeline so the artifacts stay consistent across sbt and Mill plugins.

Core Features & Use Cases

  • WIT world contract reference: Explains the three Preview 3 worlds (agent-guest, tool-middleware-guest, agent-tool-middleware-guest) defined in sdks/scala/wit/main.wit and their embedded WASM artifacts.
  • Deterministic regeneration: Runs the checked-in generate-agent-guest-wasm.sh script with the pinned wasm-rquickjs-cli 0.4.2 toolchain and wasm32-wasip2 target to rebuild all three WASMs into both plugin resource directories.
  • Verification workflow: Validates the export contract and role matrix with the test scripts, checks tracked d.ts drift, and confirms sbt and Mill package identical bytes.
  • Use Case: After editing wit/main.wit or bumping synced WIT dependencies, run cargo make wit at the repository root and then regenerate and verify the guest runtime WASMs so CI's generated-file checks pass.

Quick Start

Regenerate the Golem Scala guest runtime WASMs by syncing WIT dependencies with cargo make wit and then running the generate-agent-guest-wasm.sh script from the sdks/scala directory.

Frequently Asked Questions about golem-scala-base-image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I regenerate the Golem Scala guest runtime WASMs?

Run cargo make wit at the repository root to sync WIT dependencies, then execute ./scripts/generate-agent-guest-wasm.sh from the sdks/scala directory. The script builds all three worlds and installs the WASMs into both the sbt and Mill plugin resource directories.

What toolchain is required to build the Scala guest runtime WASMs?

You need Rust stable with the wasm32-wasip2 target and wasm-rquickjs-cli version 0.4.2, matching the repository's CI setting. The build uses ordinary cargo build on generated wrapper crates, not cargo-component.

What are the three WIT worlds in the Golem Scala SDK?

The worlds are agent-guest for ordinary agent and tool guests, tool-middleware-guest for pure tool middleware, and agent-tool-middleware-guest for the combined role. Each maps to an embedded WASM artifact defined in sdks/scala/wit/main.wit.

Can I hand-edit the files in sdks/scala/wit/deps?

No, wit/deps is a generated mirror of the root WIT dependencies and must never be hand-edited. Sync it by running cargo make wit from the repository root instead.

Why does CI fail after changing WIT definitions in the Scala SDK?

CI validates tracked d.ts files for drift and rejects accidentally tracked WASMs. After changing wit/main.wit or dependencies, regenerate the artifacts and verify with the export-contract and role-contract scripts, then check git diff on wit/dts.