@agentproto/adapter-mastra-agent 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -47,12 +47,13 @@ var mastraAgent = defineAgentCli({
|
|
|
47
47
|
},
|
|
48
48
|
models: {
|
|
49
49
|
// Cheap OpenRouter coder by default — this is the budget first-party arm.
|
|
50
|
+
// Anthropic models are not advertised here (this arm shouldn't be steered
|
|
51
|
+
// onto premium Anthropic spend); the free-form `model` option still
|
|
52
|
+
// accepts any Mastra-routable id.
|
|
50
53
|
default: "openrouter/z-ai/glm-5.2",
|
|
51
54
|
allowed: [
|
|
52
55
|
"openrouter/z-ai/glm-5.2",
|
|
53
56
|
"openrouter/deepseek/deepseek-v4-pro",
|
|
54
|
-
"anthropic/claude-opus-4-8",
|
|
55
|
-
"anthropic/claude-sonnet-4-6",
|
|
56
57
|
"openai/gpt-5"
|
|
57
58
|
],
|
|
58
59
|
env: {
|
|
@@ -80,7 +81,7 @@ var mastraAgent = defineAgentCli({
|
|
|
80
81
|
// string (not enum) so any Mastra-routable `provider/model` id works
|
|
81
82
|
// without a code change. Applied as a `--model <id>` spawn arg.
|
|
82
83
|
type: "string",
|
|
83
|
-
description: "Model id routed via Mastra's model gateway (e.g. '
|
|
84
|
+
description: "Model id routed via Mastra's model gateway (e.g. 'openrouter/z-ai/glm-5.2', 'openrouter/deepseek/deepseek-v4-pro'). Applied as a `--model` arg at spawn. Omit for the default.",
|
|
84
85
|
bin_args_template: ["--model", "{value}"]
|
|
85
86
|
}
|
|
86
87
|
],
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAwBA,IAAM,WAAW,aAAA,CAAc,IAAI,IAAI,WAAA,EAAa,MAAA,CA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AAAA,IACZ,OAAA,EAAS,KAAA;AAAA,IACT,UAAA,EAAY,KAAA;AAAA,IACZ,SAAA,EAAW,KAAA;AAAA,IACX,aAAA,EAAe;AAAA,GACjB;AAAA,EACA,OAAA,EAAS;AAAA,IACP;AAAA,MACE,EAAA,EAAI,OAAA;AAAA;AAAA;AAAA,MAGJ,IAAA,EAAM,QAAA;AAAA,MACN,WAAA,EACE,gLAAA;AAAA,MAGF,iBAAA,EAAmB,CAAC,SAAA,EAAW,SAAS;AAAA;AAC1C,GACF;AAAA,EACA,MAAM,CAAC,QAAA,EAAU,YAAA,EAAc,KAAA,EAAO,iBAAiB,aAAa;AACtE,CAAC;AAEM,SAAS,kBAAA,GAAsC;AACpD,EAAA,OAAO,sBAAsB,WAAW,CAAA;AAC1C","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-mastra-agent — the first-party agentproto agent.\n *\n * Unlike the codex/hermes/claude-code adapters (which wrap an external agent\n * CLI), this adapter IS the agent: an AIP-42 AGENT.md is run as a live Mastra\n * agent behind an AIP-44 ACP server (see ./acp-host.ts), shipped as a CLI bin\n * (`agentproto-mastra acp`). The daemon spawns it like any other arm; a user\n * can launch it standalone. Our loop, our models — no external CLI.\n *\n * import { mastraAgent, mastraAgentRuntime } from \"@agentproto/adapter-mastra-agent\"\n */\n\nimport { fileURLToPath } from \"node:url\"\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\n// Self-locating: the built handle spawns `node <this-dist>/cli.mjs acp`.\n// import.meta.url resolves into dist/ at runtime, where cli.mjs sits next to\n// index.mjs — so the same build works whether the daemon spawns it (resolved\n// from node_modules) or a user runs the published bin.\nconst cliEntry = fileURLToPath(new URL(\"./cli.mjs\", import.meta.url))\n\nexport const mastraAgent: AgentCliHandle = defineAgentCli({\n name: \"mastra-agent\",\n id: \"mastra-agent\",\n description:\n \"First-party agentproto agent — an AIP-42 AGENT.md run as a live Mastra agent behind an AIP-44 ACP server. No external agent CLI: our own loop, our own models (routed via Mastra's model gateway from the spawn env). Spawned as `node cli.mjs acp` over stdio JSON-RPC, or launched standalone via `agentproto-mastra acp`.\",\n version: \"0.1.0\",\n bin: \"node\",\n bin_args: [cliEntry, \"acp\"],\n install: [\n {\n method: \"npm\",\n package: \"@agentproto/adapter-mastra-agent\",\n global: true,\n },\n ],\n // No external runtime to probe — the agent runs in the spawned node process.\n // A node version gate is enough to mark the arm ready.\n version_check: {\n cmd: \"node --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=20.9.0\",\n timeout_ms: 5000,\n },\n auth: {\n ref: \"./mastra-agent.ACP.md\",\n // The chosen model's provider key is read from the spawn env by Mastra's\n // model gateway. Any one of these covers the common providers.\n state: {\n env: [\"OPENROUTER_API_KEY\", \"ANTHROPIC_API_KEY\", \"OPENAI_API_KEY\"],\n },\n },\n sandbox:\n \"In-process: the agent runs inside the spawned node process. Tool-level sandboxing is the responsibility of the tools the AGENT.md grants.\",\n protocol: \"acp\",\n acp: \"./mastra-agent.ACP.md\",\n session: {\n mode: \"persistent\",\n idle_timeout_ms: 1_800_000,\n context_carryover: true,\n },\n models: {\n // Cheap OpenRouter coder by default — this is the budget first-party arm.\n // Anthropic models are not advertised here (this arm shouldn't be steered\n // onto premium Anthropic spend); the free-form `model` option still\n // accepts any Mastra-routable id.\n default: \"openrouter/z-ai/glm-5.2\",\n allowed: [\n \"openrouter/z-ai/glm-5.2\",\n \"openrouter/deepseek/deepseek-v4-pro\",\n \"openai/gpt-5\",\n ],\n env: {\n anthropic: \"ANTHROPIC_API_KEY\",\n openrouter: \"OPENROUTER_API_KEY\",\n openai: \"OPENAI_API_KEY\",\n },\n },\n capabilities: {\n streaming: true,\n // Tool calls run inside Mastra and are relayed to the host as ACP\n // tool_call / tool_call_update session updates (see acp-host.ts +\n // tool-call-map.ts). The built-in default agent ships the workspace\n // toolset (read/edit/run), so this is on.\n tool_calls: true,\n sub_agents: false,\n file_io: false,\n multimodal: false,\n resumable: false,\n bidirectional: true,\n },\n options: [\n {\n id: \"model\",\n // string (not enum) so any Mastra-routable `provider/model` id works\n // without a code change. Applied as a `--model <id>` spawn arg.\n type: \"string\" as const,\n description:\n \"Model id routed via Mastra's model gateway (e.g. \" +\n \"'openrouter/z-ai/glm-5.2', 'openrouter/deepseek/deepseek-v4-pro'). \" +\n \"Applied as a `--model` arg at spawn. Omit for the default.\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n ],\n tags: [\"mastra\", \"agentproto\", \"acp\", \"agent-runtime\", \"first-party\"],\n})\n\nexport function mastraAgentRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(mastraAgent)\n}\n\nexport {\n makeAgentFactory,\n defaultAgentManifest,\n DEFAULT_MODEL,\n DEFAULT_TOOL_IDS,\n} from \"./default-agent.js\"\nexport { MastraAcpAgent, promptText, type MastraLike } from \"./acp-host.js\"\nexport { resolveMastraModel, modelRefToString, providerOf } from \"./model-resolver.js\"\nexport { makeWorkspaceTools, resolveInCwd } from \"./workspace-tools.js\"\nexport { buildSqliteMemory, resolveMemoryDbPath } from \"./memory.js\"\nexport {\n chunkToSessionUpdate,\n toolKindFor,\n toolCallTitle,\n type MastraStreamChunk,\n} from \"./tool-call-map.js\"\nexport { runAcpOverStdio } from \"./run.js\"\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/adapter-mastra-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "@agentproto/adapter-mastra-agent — first-party agentproto agent. An AIP-42 AGENT.md run as a live Mastra agent behind an AIP-44 ACP server, spawnable by the daemon like any other AGENT-CLI arm AND launchable standalone via `agentproto-mastra acp`. Our own loop, our own models — no external CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"@mastra/libsql": "~1.10.0",
|
|
54
54
|
"zod": "^4.4.3",
|
|
55
55
|
"@agentproto/agent": "0.2.0",
|
|
56
|
-
"@agentproto/driver-agent-cli": "0.
|
|
57
|
-
"@agentproto/mastra": "0.2.
|
|
56
|
+
"@agentproto/driver-agent-cli": "0.4.0",
|
|
57
|
+
"@agentproto/mastra": "0.2.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^25.6.2",
|