WASM Tools
Swarmie defines WASM tool configuration under [wasm_tools.<name>] in TOML (crates/core/src/config/toml_types.rs). Runtime structures are in crates/core/src/config/types.rs and execution limits are in crates/wasm/src/limits.rs.
Config Shape
[wasm_tools.echo]
path = "tools/echo.wasm"
capabilities = ["Logging", "HttpRequest"]
secrets = ["API_TOKEN"]
workspace_prefixes = ["src/", "tests/"]
endpoint_allowlist = ["https://api.example.com/*"]
[wasm_tools.echo.tool_aliases]
old_name = "new_name"
[wasm_tools.echo.limits]
max_memory_bytes = 67108864
fuel_limit = 1000000000
execution_timeout_secs = 30
max_log_entries = 1000
max_http_requests = 50
max_tool_invocations = 20
max_file_read_bytes = 10485760Fields
| Field | Type | Description |
|---|---|---|
path | string | Path to .wasm component file. |
capabilities | array(string) | Capability grants exposed to host bindings. |
secrets | array(string) | Secret names accessible via WASM secret APIs. |
workspace_prefixes | array(string) | Workspace directory prefixes permitted for file access. |
endpoint_allowlist | array(string) | Allowed endpoint patterns for outbound HTTP. |
tool_aliases | table | Alias map (alias -> real tool name) for tool invocation. |
limits.* | table | Resource limit overrides for this tool. |
Resource Limits
Default ResourceLimits (crates/wasm/src/limits.rs):
max_memory_bytes:64 MiBfuel_limit:1_000_000_000execution_timeout_secs:30max_log_entries:1000max_http_requests:50max_tool_invocations:20max_file_read_bytes:10 MiB
Hard validation includes:
- memory must be
> 0and<= 512 MiB - timeout must be
> 0and<= 300s - all counters must be
> 0
Runtime Note
[wasm_tools] is defined in TOML schema and runtime types; the current resolved runtime config path (resolve_from_toml) does not yet project wasm_tools into ResolvedConfig (crates/core/src/config/resolve.rs).