@anna-ai/app-runtime
v0.2.0
Published
Anna App browser runtime SDK. Loaded by every Anna App iframe; provides typed proxy over the postMessage RPC bridge to the host (Anna dashboard / `anna-app dev` harness).
Maintainers
Readme
@anna-ai/app-runtime
Browser runtime SDK for Anna Apps. Loaded as a <script> inside every Anna
App iframe; exposes a global AnnaAppRuntime that proxies RPC calls over
postMessage to the host page (Anna dashboard in production, the
anna-app dev harness in local development).
Use inside an Anna App bundle
<!-- index.html -->
<script src="/static/anna-apps/_sdk/0.1.0/index.js" defer></script>
<script src="./app.js" type="module" defer></script>// app.js
const anna = await AnnaAppRuntime.connect();
await anna.window.set_title({ title: "My App" });
const out = await anna.tools.invoke({
tool_id: "tool-twitter-handle-twitter-tool-abcd1234",
method: "post_tweet",
args: { text: "hi" },
});
anna.on("entry_payload", (p) => console.log(p));Wire envelope
{ kind: "req"|"res"|"event", id, ns, method, args | result | error }The host validates every call against the app's manifest ACL before forwarding to the backend.
Where the script comes from
| Environment | Source |
| --- | --- |
| Production (Anna dashboard) | matrix-nexus static server, path /static/anna-apps/_sdk/<version>/index.js |
| Local dev (anna-app dev) | @anna-ai/cli harness server resolves this package from its node_modules and serves the same path |
The bundle author writes the same <script src="/static/anna-apps/_sdk/...">
either way; the URL is part of the host contract.
Versioning
This package's version tracks dispatcher_version (wire protocol). See
packages/VERSIONS.md for the full pin matrix and bump
procedure.
Contents
Single file dist/index.js (~8 KB). Plain ES5 IIFE, no build step, runs
directly in any modern browser.
