@agentproto/adapter-mastracode 0.2.0 → 0.2.1
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/MASTRACODE.md +21 -0
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/MASTRACODE.md
CHANGED
|
@@ -30,3 +30,24 @@ npx -y mastracode --prompt "Fix the bug" --output jsonl
|
|
|
30
30
|
|
|
31
31
|
As of 2026-06-30, `mastracode acp --help` prints the top-level CLI help rather
|
|
32
32
|
than ACP-specific usage, so this adapter is intentionally not marked as ACP.
|
|
33
|
+
|
|
34
|
+
## No `lean` mode (yet)
|
|
35
|
+
|
|
36
|
+
Investigated declaring a `lean` mode (drop skill/memory/subagent scaffolding
|
|
37
|
+
to cut input-token overhead) but found no lever that actually reaches this
|
|
38
|
+
adapter's headless invocation:
|
|
39
|
+
|
|
40
|
+
- The headless CLI (`--prompt ...`, what `protocol: print` drives here) has
|
|
41
|
+
no flag for it — `mastracode --help` lists only
|
|
42
|
+
`--continue/--thread/--title/--clone-thread/--resource-id/--timeout/
|
|
43
|
+
--max-turns/--permission-mode/--output/--model/--mode/--thinking-level/
|
|
44
|
+
--settings`.
|
|
45
|
+
- `MASTRACODE_DISABLE_MCP` / `MASTRACODE_DISABLE_HOOKS` /
|
|
46
|
+
`MASTRACODE_DISABLE_MEMORY` exist in the installed package but are only
|
|
47
|
+
read by the interactive TUI entrypoint (`tuiMain`); the headless entrypoint
|
|
48
|
+
(`runMCCli`) this adapter spawns never reads them, so declaring them as
|
|
49
|
+
`env` here would silently do nothing.
|
|
50
|
+
- `--settings <path>` can point at a leaner `settings.json` (fewer model
|
|
51
|
+
packs / no subagents / OM off), but that requires shipping and maintaining
|
|
52
|
+
an actual settings file alongside the adapter, not just a manifest flag —
|
|
53
|
+
out of scope here. Revisit if that's worth doing.
|
package/dist/index.mjs
CHANGED
|
@@ -46,13 +46,15 @@ var mastracode = defineAgentCli({
|
|
|
46
46
|
},
|
|
47
47
|
models: {
|
|
48
48
|
default: "anthropic/claude-sonnet-4-5",
|
|
49
|
+
// Anthropic is no longer advertised as a pickable escalation — only the
|
|
50
|
+
// adapter's own default Claude model stays listed (repointing the default
|
|
51
|
+
// is out of scope). The extra Sonnet + gateway dupe are dropped from the
|
|
52
|
+
// menu; the free-form `model` option still accepts any id.
|
|
49
53
|
allowed: [
|
|
50
54
|
"anthropic/claude-sonnet-4-5",
|
|
51
|
-
"anthropic/claude-sonnet-4-6",
|
|
52
55
|
"openai/gpt-5.1",
|
|
53
56
|
"openai/gpt-5.1-mini",
|
|
54
|
-
"google/gemini-2.5-flash"
|
|
55
|
-
"openrouter/anthropic/claude-sonnet-4-6"
|
|
57
|
+
"google/gemini-2.5-flash"
|
|
56
58
|
],
|
|
57
59
|
env: {
|
|
58
60
|
anthropic: "ANTHROPIC_API_KEY",
|
|
@@ -125,6 +127,10 @@ var mastracode = defineAgentCli({
|
|
|
125
127
|
acp: {
|
|
126
128
|
checked: "2026-06-30",
|
|
127
129
|
result: "`mastracode acp --help` prints top-level Mastra Code help; no ACP subcommand is currently discoverable."
|
|
130
|
+
},
|
|
131
|
+
lean: {
|
|
132
|
+
checked: "2026-07-03",
|
|
133
|
+
result: "No `lean` mode declared. The headless entrypoint this adapter spawns (runMCCli, driven by `--prompt`) has no flag to drop skill/subagent/OM scaffolding, and does not read the MASTRACODE_DISABLE_MCP / MASTRACODE_DISABLE_HOOKS / MASTRACODE_DISABLE_MEMORY env vars \u2014 those are wired only into the interactive TUI entrypoint (tuiMain), so declaring them here would silently do nothing. `--settings <path>` could point at a leaner packaged settings.json, but that means shipping and maintaining an actual settings file, not just a manifest patch \u2014 revisit if worth doing."
|
|
128
134
|
}
|
|
129
135
|
},
|
|
130
136
|
tags: ["mastracode", "mastra", "print", "agent-runtime", "coding"]
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],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AAO,QAAA,EAAU,QAAQ,OAAO,CAAA;AAAA,MAC9C,WAAA,EAAa,uCAAA;AAAA,MACb,iBAAA,EAAmB,CAAC,kBAAA,EAAoB,SAAS;AAAA,KACnD;AAAA,IACA;AAAA,MACE,EAAA,EAAI,SAAA;AAAA,MACJ,IAAA,EAAM,SAAA;AAAA,MACN,GAAA,EAAK,CAAA;AAAA,MACL,GAAA,EAAK,KAAA;AAAA,MACL,WAAA,EAAa,2CAAA;AAAA,MACb,iBAAA,EAAmB,CAAC,WAAA,EAAa,SAAS;AAAA;AAC5C,GACF;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,OAAA,EAAS,MAAA;AAAA,IACT,SAAA,EAAW,CAAC,MAAA,EAAQ,YAAA,EAAc,eAAe;AAAA,GACnD;AAAA,EACA,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA,MACH,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA,KACJ;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA;AAQJ,GACF;AAAA,EACA,MAAM,CAAC,YAAA,EAAc,QAAA,EAAU,OAAA,EAAS,iBAAiB,QAAQ;AACnE,CAAC;AAEM,SAAS,iBAAA,GAAqC;AACnD,EAAA,OAAO,sBAAsB,UAAU,CAAA;AACzC","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-mastracode — AIP-45 adapter for Mastra Code.\n *\n * Mastra Code does not currently expose a discoverable ACP subcommand\n * (`mastracode acp --help` prints the top-level CLI help). We spawn\n * its documented headless CLI via `npx -y mastracode` and mark this\n * adapter as a print/headless protocol arm rather than claiming ACP.\n *\n * import { mastracode, mastracodeRuntime } from \"@agentproto/adapter-mastracode\"\n * const session = await mastracodeRuntime().start()\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\n\nexport const mastracode: AgentCliHandle = defineAgentCli({\n name: \"mastracode\",\n id: \"mastracode\",\n description:\n \"Mastra Code — terminal-based AI coding agent with persistent threads, tools, modes, and multi-provider model support. Current CLI exposes TUI/headless operation, not ACP; spawned via `npx -y mastracode`.\",\n version: \"0.1.0\",\n bin: \"npx\",\n bin_args: [\"-y\", \"mastracode\"],\n install: [{ method: \"npm\", package: \"mastracode\", global: true }],\n version_check: {\n cmd: \"npm view mastracode version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.26.0\",\n timeout_ms: 15_000,\n },\n auth: {\n ref: \"./SECRETS.md\",\n state: {\n env: [\n \"ANTHROPIC_API_KEY\",\n \"OPENAI_API_KEY\",\n \"OPENROUTER_API_KEY\",\n \"GOOGLE_GENERATIVE_AI_API_KEY\",\n ],\n },\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"print\",\n print: {\n prompt_flag: \"--prompt\",\n output_format: [\"--output\", \"jsonl\"],\n pre_prompt: [],\n resume: { flag: \"--thread\", kind: \"value\" },\n event_schema: \"mastra-jsonl\",\n },\n session: {\n mode: \"ephemeral\",\n idle_timeout_ms: 1_800_000,\n context_carryover: false,\n },\n models: {\n default: \"anthropic/claude-sonnet-4-5\",\n // Anthropic is no longer advertised as a pickable escalation — only the\n // adapter's own default Claude model stays listed (repointing the default\n // is out of scope). The extra Sonnet + gateway dupe are dropped from the\n // menu; the free-form `model` option still accepts any id.\n allowed: [\n \"anthropic/claude-sonnet-4-5\",\n \"openai/gpt-5.1\",\n \"openai/gpt-5.1-mini\",\n \"google/gemini-2.5-flash\",\n ],\n env: {\n anthropic: \"ANTHROPIC_API_KEY\",\n openai: \"OPENAI_API_KEY\",\n openrouter: \"OPENROUTER_API_KEY\",\n google: \"GOOGLE_GENERATIVE_AI_API_KEY\",\n },\n },\n capabilities: {\n streaming: true,\n tool_calls: true,\n sub_agents: true,\n file_io: true,\n multimodal: false,\n // `mastracode --thread <id>` reattaches to a prior thread with real\n // persisted memory (confirmed cross-process: separate spawn, same\n // thread id, correct continuity). `print.resume` below drives this.\n resumable: true,\n bidirectional: false,\n },\n modes: [\n {\n id: \"default\",\n description:\n \"Default headless mode. Mastra Code defaults to build mode when omitted.\",\n },\n {\n id: \"plan\",\n description:\n \"Plan-only mode — analyze architecture and propose implementation plans before writing code.\",\n bin_args_append: [\"--mode\", \"plan\"],\n },\n {\n id: \"build\",\n description:\n \"Build mode — file edits and shell commands use Mastra Code's configured permissions.\",\n bin_args_append: [\"--mode\", \"build\"],\n },\n {\n id: \"fast\",\n description: \"Fast mode — lower-latency answers and small edits.\",\n bin_args_append: [\"--mode\", \"fast\"],\n },\n ],\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Provider/model override for this operator binding (e.g. `anthropic/claude-sonnet-4-5`).\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n {\n id: \"thinking_level\",\n type: \"enum\",\n enum: [\"off\", \"low\", \"medium\", \"high\", \"xhigh\"],\n description: \"Thinking level passed to Mastra Code.\",\n bin_args_template: [\"--thinking-level\", \"{value}\"],\n },\n {\n id: \"timeout\",\n type: \"integer\",\n min: 1,\n max: 86_400,\n description: \"Maximum headless run duration in seconds.\",\n bin_args_template: [\"--timeout\", \"{value}\"],\n },\n ],\n continuation: {\n default: \"none\",\n supported: [\"none\", \"transcript\", \"native-resume\"],\n },\n metadata: {\n acp: {\n checked: \"2026-06-30\",\n result:\n \"`mastracode acp --help` prints top-level Mastra Code help; no ACP subcommand is currently discoverable.\",\n },\n lean: {\n checked: \"2026-07-03\",\n result:\n \"No `lean` mode declared. The headless entrypoint this adapter spawns \" +\n \"(runMCCli, driven by `--prompt`) has no flag to drop skill/subagent/OM \" +\n \"scaffolding, and does not read the MASTRACODE_DISABLE_MCP / \" +\n \"MASTRACODE_DISABLE_HOOKS / MASTRACODE_DISABLE_MEMORY env vars — those \" +\n \"are wired only into the interactive TUI entrypoint (tuiMain), so declaring \" +\n \"them here would silently do nothing. `--settings <path>` could point at a \" +\n \"leaner packaged settings.json, but that means shipping and maintaining an \" +\n \"actual settings file, not just a manifest patch — revisit if worth doing.\",\n },\n },\n tags: [\"mastracode\", \"mastra\", \"print\", \"agent-runtime\", \"coding\"],\n})\n\nexport function mastracodeRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(mastracode)\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/adapter-mastracode",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "@agentproto/adapter-mastracode — AIP-45 AGENT-CLI adapter for Mastra Code. Spawns the documented headless CLI via `npx -y mastracode`; current Mastra Code does not expose a discoverable ACP subcommand.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@agentproto/driver-agent-cli": "0.
|
|
44
|
+
"@agentproto/driver-agent-cli": "0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^25.6.2",
|