~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/atlibs-code-mode

0
0
main
13 lines · 816 B Raw History
// node examples/compose.ts > examples/composition.json
import { composition } from "@publicdomainrelay/atlibs/compose/build.js";
import spec from "./modules/stub-agent.json" with { type: "json" };

// the stub agent's binding: its module.json under its key (code mode compiles it; no cargo, so no atlibs compose bindings)
const stubAgent = { key: "stub-agent", ...spec };

const c = composition({ name: "Code mode", description: "An agent writes AssemblyScript and runs it sandboxed through code mode's MCP server." });
const agent = c.instance("agent", stubAgent);
const mcp = c.handler("mcp", "atlibs-code-mode: js/index.js codeMode().handler, or js/cli.mjs as an exec handler");
c.route(agent, "com.fedfork.exec.mcp.message", mcp, "the agent runs code through code mode");

process.stdout.write(await c.json());