Repository navigation
wasm_call: call one function of a .wasm file from the command line (ADR 0014) - #455
Merged
Merged
Conversation
A developer can now check a component or core module without a shell or a device: the example loads the file with the wasm service's runtime and limits, takes the JSON a script would pass (components) or the input text (core modules), and prints the answer. --storage DIR gives a component a storage folder; its octosense:host calls fail without a shell. Docs in docs/wasm.md (English and Chinese), with the commands run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote
force-pushed
the
feat/wasm-shared-components
branch
from
October 10, 2026 05:24
740e1f6 to
5dc972b
Compare
Contributor
Author
|
Merged as part of a train (#452 → #454 → #455) on one local CI pass at the train's top head ddc3bd3. The run was 🤖 Generated with Claude Code |
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of the developer path for ADR 0014: checking an app's component or core module without a shell or a device. It is stacked on #454, which is stacked on #452. The three merge as a train on one local CI run.
crates/wasm-host/examples/wasm_call.rsloads the file with thewasmservice's runtime and limits:wasm.<function>(a bare value, an object by name, or an array in order), and its answer prints as JSON.--storage DIRgives a component a storage folder.octosense:hostcalls fail withno host services in wasm_call: <service> needs a shell.Run (macOS):
wasm_call crates/wasm-host/tests/fixtures/notes.component.wasm to-html '"# Hi"'→"<h1>Hi</h1>\n"… analyze '["# One\n\ntwo words"]'→{"headings": ["One"], "lines": 3, "words": 4}… to_html 'not json'→the arguments are not JSON: …, exit 1hostcall.component.wasm call '["notes.get", "{}"]'→no host services in wasm_call: notes.get needs a shell, exit 1apps/wasmlab/bundle/fns/wasmlab.wasm md_to_html '# Hello *core*'→<h1>Hello <em>core</em></h1>… fuzzy_rank '{"query":"oct","items":["octos","sense","octopus"]}'→{"ranked":[{"item":"octos","score":0.99},{"item":"octopus","score":0.98}]}Docs:
docs/wasm.mdanddocs/wasm.zh-CN.md, section "Calling a function from the command line".🤖 Generated with Claude Code