@martinloop/mcp 0.5.5 → 0.5.6

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/README.md CHANGED
@@ -1,175 +1,175 @@
1
- # @martinloop/mcp
2
-
3
- You give an AI agent a coding task. It runs. You get a bill.
4
-
5
- But did it actually work? Did it pass your tests? How much did it spend? What files did it touch? Did it loop 47 times trying the same broken approach?
6
-
7
- You don't know. And that's the problem.
8
-
9
- ## One system around the coding agent
10
-
11
- MartinLoop is the execution-control system around coding agents. The coding agent still performs the software work. MartinLoop connects the run from Definition of Done through preflight, control, verification, recovery evidence, receipts, and post-run analysis.
12
-
13
- ```text
14
- DEFINE -> PREFLIGHT -> CONTROL -> VERIFY -> RECOVER -> PROVE -> ANALYZE
15
- ```
16
-
17
- The product-level flow is **Definition of Done -> Controlled Run -> Verified Handoff**.
18
-
19
- Through MCP, compatible hosts can use the same MartinLoop lifecycle without giving up the host's own model selection. MartinLoop does not inject a hidden fallback model.
20
-
21
- For agent-readable product context see [`../../llms.txt`](../../llms.txt), [`../../llms-full.txt`](../../llms-full.txt), and [`../../docs/for-agents.md`](../../docs/for-agents.md).
22
-
23
- ## What This Does
24
-
25
- MartinLoop governs AI coding-agent execution. You define what the run needs to accomplish, set execution boundaries such as budget and verifier checks, and let the configured coding agent do the work inside that contract.
26
-
27
- When it's done, you get a receipt — not a vague summary, but a structured record: dollars spent when available, attempts made, verification results, files changed, recovery state, and what the available evidence established.
28
-
29
- The final governed outcome is one of:
30
-
31
- - `VERIFIED` when the configured evidence supports the Definition of Done
32
- - `STOPPED` when a configured hard boundary ends the run
33
- - `NEEDS REVIEW` when completion cannot be established from the available evidence
34
-
35
- **One line to connect it:**
36
-
37
- ```sh
38
- claude mcp add martin-loop -- npx -y @martinloop/mcp
39
- ```
40
-
41
- That's it. Your host can now use MartinLoop's governed run and evidence surfaces.
42
-
43
- ## Real Numbers From Real Runs
44
-
45
- We tested this against live repos with real API spend:
46
-
47
- | What happened | Without MartinLoop | With MartinLoop |
48
- |---|---|---|
49
- | Budget: $1.50 task | Agent spent **$28.42** | Agent stopped at **$1.20** |
50
- | Failing verifier | Retried indefinitely | Stopped after 3 attempts with diagnosis |
51
- | CLI not on PATH | "not available on PATH" (dead stop) | Auto-discovered in AppData, kept running |
52
- | `bun run lint && bun run test` | Passed `&&` as a literal arg (always fails) | Routed through shell, worked |
53
-
54
- These aren't hypotheticals. The $28 overshoot happened in production testing. We fixed the circuit breaker in `0.3.8`.
55
-
56
- ## Install
57
-
58
- ### Claude Code
59
- ```sh
60
- claude mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
61
- ```
62
-
63
- Windows:
64
- ```sh
65
- claude mcp add --transport stdio --scope user martin-loop -- cmd /c npx -y @martinloop/mcp@0.5.5
66
- ```
67
-
68
- ### Codex
69
- ```sh
70
- codex mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
71
- ```
72
-
73
- ### Gemini CLI
74
- ```sh
75
- gemini mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
76
- ```
77
-
78
- ### Any MCP Host
79
- ```sh
80
- npx -y @martinloop/mcp@0.5.5
81
- ```
82
-
83
- ## How a Governed Run Works
84
-
85
- ```
86
- You: "Fix the auth bug. Budget $3. Verify: npm test"
87
-
88
- martin_doctor → checks CLI, auth, environment
89
- martin_plan → scopes the task, sets constraints
90
- martin_preflight → validates before any spend
91
- martin_run → agent works inside budget + verifier gates
92
- martin_dossier → receipt: spend, attempts, verifier evidence, final outcome
93
- ```
94
-
95
- Every attempt can be checked by your configured verifier. Budget and policy controls stay attached to the run. If the agent drifts off-task, the scope contract can block the change. If a hard spend boundary is reached, the run stops according to policy instead of silently retrying forever.
96
-
97
- ## What Your Agent Gets
98
-
99
- ### MCP Tools
100
-
101
- The exact tool set is discoverable from the running MCP server with `tools/list`; do not rely on a hard-coded count in documentation.
102
-
103
- **Run the loop:**
104
- `martin_doctor` `martin_plan` `martin_preflight` `martin_run` `martin_pause` `martin_continue` `martin_cancel`
105
-
106
- **Inspect results:**
107
- `martin_status` `martin_logs` `martin_dossier` `martin_eval` `martin_inspect` `martin_list_runs` `martin_get_run` `martin_get_attempt` `martin_get_verification_results` `martin_triage_runs`
108
-
109
- **Ship the work:**
110
- `martin_pr_summary` `martin_create_pr` `martin_review_pr`
111
-
112
- ### Read-Only Resources
113
-
114
- The exact resource set is discoverable from the running MCP server; this documentation names the primary public resources without treating a count as a release invariant.
115
-
116
- Your agent can pull context without side effects:
117
-
118
- `martin://runs/latest` · `martin://runs/latest/proof-card` · `martin://runs/latest/budget-status` · `martin://runs/latest/verifier-evidence` · `martin://runs/recent` · `martin://server/health` · `martin://policies/current` · `martin://agent/next-step` · `martin://guides/mcp-usage` · `martin://guides/agent-start` · `martin://repo/risk-map`
119
-
120
- ### Configuration Profiles
121
-
122
- Generate host config tuned to your workflow:
123
-
124
- ```sh
125
- npx martin-loop mcp print-config --host claude --profile minimal # run + inspect
126
- npx martin-loop mcp print-config --host claude --profile diagnostic # + doctor + triage
127
- npx martin-loop mcp print-config --host claude --profile full-local # all local tools
128
- npx martin-loop mcp print-config --host claude --profile github-review # + PR workflow
129
- ```
130
-
131
- ## What Happens When Things Go Wrong
132
-
133
- MartinLoop does not round failure into success. It preserves the evidence and follows the configured recovery path while budget and policy still allow useful work.
134
-
135
- | Failure | Old behavior | Now |
136
- |---|---|---|
137
- | CLI not on PATH | Error message, dead stop | Searches npm global, homebrew, nvm, scoop — uses what it finds |
138
- | Verifier says "command not found" | Generic "verification failed" | Carries specific failure context into the next allowed attempt |
139
- | `git restore` fails mid-rollback | Throws, leaves dirty state | Retries once, falls back to `git checkout`, cleans up |
140
- | Invalid `--profile` flag | Crashes | Warns, falls back to `minimal`, keeps running |
141
-
142
- ## Codex compatibility in 0.5.5
143
-
144
- MartinLoop no longer assumes one Codex host or one fixed Codex flag set. The CLI resolves the exact Codex executable, reads its advertised capabilities, negotiates a supported write strategy, proves that strategy before reporting launch readiness, and reuses the same contract for the governed run.
145
-
146
- That means MCP hosts can point MartinLoop at different Codex installations without requiring a documentation-specific approval or sandbox flag to exist everywhere.
147
-
148
- ## Presentation and evidence
149
-
150
- MCP responses are Markdown-first for humans while retaining structured content for agents and automation. The presentation layer does not rewrite governed truth.
151
-
152
- MartinLoop Arcade is a terminal-only experience. It does not run inside MCP and cannot influence MCP evidence, budgets, verification, or final outcomes.
153
-
154
- ## Who Uses This
155
-
156
- - **Engineers running overnight agent loops** — you need a kill switch that actually works, and a receipt in the morning
157
- - **Teams with shared API budgets** — you need per-task spend caps, not org-wide prayer
158
- - **Anyone reviewing agent-generated PRs** — the dossier shows what the agent tried, what passed, and what didn't
159
- - **Teams tired of stitching together point tools** — you want one execution-control lifecycle around coding-agent work from preflight through post-run analysis
160
-
161
- ## Requirements
162
-
163
- - Node.js 20+
164
- - One AI coding CLI: [Claude Code](https://docs.anthropic.com/claude-code), [Codex](https://github.com/openai/codex), or [Gemini CLI](https://github.com/google/gemini-cli)
165
-
166
- ## Links
167
-
168
- - [martin-loop](https://www.npmjs.com/package/martin-loop) — the standalone CLI
169
- - [MartinLoop for AI Agents](../../docs/for-agents.md)
170
- - [GitHub](https://github.com/Keesan12/martin-loop) — source and issues
171
- - [martinloop.com](https://martinloop.com)
172
-
173
- ## License
174
-
175
- Apache-2.0
1
+ # @martinloop/mcp
2
+
3
+ You give an AI agent a coding task. It runs. You get a bill.
4
+
5
+ But did it actually work? Did it pass your tests? How much did it spend? What files did it touch? Did it loop 47 times trying the same broken approach?
6
+
7
+ You don't know. And that's the problem.
8
+
9
+ ## One system around the coding agent
10
+
11
+ MartinLoop is the execution-control system around coding agents. The coding agent still performs the software work. MartinLoop connects the run from Definition of Done through preflight, control, verification, recovery evidence, receipts, and post-run analysis.
12
+
13
+ ```text
14
+ DEFINE -> PREFLIGHT -> CONTROL -> VERIFY -> RECOVER -> PROVE -> ANALYZE
15
+ ```
16
+
17
+ The product-level flow is **Definition of Done -> Controlled Run -> Verified Handoff**.
18
+
19
+ Through MCP, compatible hosts can use the same MartinLoop lifecycle without giving up the host's own model selection. MartinLoop does not inject a hidden fallback model.
20
+
21
+ For agent-readable product context see [`../../llms.txt`](../../llms.txt), [`../../llms-full.txt`](../../llms-full.txt), and [`../../docs/for-agents.md`](../../docs/for-agents.md).
22
+
23
+ ## What This Does
24
+
25
+ MartinLoop governs AI coding-agent execution. You define what the run needs to accomplish, set execution boundaries such as budget and verifier checks, and let the configured coding agent do the work inside that contract.
26
+
27
+ When it's done, you get a receipt — not a vague summary, but a structured record: dollars spent when available, attempts made, verification results, files changed, recovery state, and what the available evidence established.
28
+
29
+ The final governed outcome is one of:
30
+
31
+ - `VERIFIED` when the configured evidence supports the Definition of Done
32
+ - `STOPPED` when a configured hard boundary ends the run
33
+ - `NEEDS REVIEW` when completion cannot be established from the available evidence
34
+
35
+ **One line to connect it:**
36
+
37
+ ```sh
38
+ claude mcp add martin-loop -- npx -y @martinloop/mcp
39
+ ```
40
+
41
+ That's it. Your host can now use MartinLoop's governed run and evidence surfaces.
42
+
43
+ ## Real Numbers From Real Runs
44
+
45
+ We tested this against live repos with real API spend:
46
+
47
+ | What happened | Without MartinLoop | With MartinLoop |
48
+ |---|---|---|
49
+ | Budget: $1.50 task | Agent spent **$28.42** | Agent stopped at **$1.20** |
50
+ | Failing verifier | Retried indefinitely | Stopped after 3 attempts with diagnosis |
51
+ | CLI not on PATH | "not available on PATH" (dead stop) | Auto-discovered in AppData, kept running |
52
+ | `bun run lint && bun run test` | Passed `&&` as a literal arg (always fails) | Routed through shell, worked |
53
+
54
+ These aren't hypotheticals. The $28 overshoot happened in production testing. We fixed the circuit breaker in `0.3.8`.
55
+
56
+ ## Install
57
+
58
+ ### Claude Code
59
+ ```sh
60
+ claude mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
61
+ ```
62
+
63
+ Windows:
64
+ ```sh
65
+ claude mcp add --transport stdio --scope user martin-loop -- cmd /c npx -y @martinloop/mcp@0.5.5
66
+ ```
67
+
68
+ ### Codex
69
+ ```sh
70
+ codex mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
71
+ ```
72
+
73
+ ### Gemini CLI
74
+ ```sh
75
+ gemini mcp add martin-loop -- npx -y @martinloop/mcp@0.5.5
76
+ ```
77
+
78
+ ### Any MCP Host
79
+ ```sh
80
+ npx -y @martinloop/mcp@0.5.5
81
+ ```
82
+
83
+ ## How a Governed Run Works
84
+
85
+ ```
86
+ You: "Fix the auth bug. Budget $3. Verify: npm test"
87
+
88
+ martin_doctor → checks CLI, auth, environment
89
+ martin_plan → scopes the task, sets constraints
90
+ martin_preflight → validates before any spend
91
+ martin_run → agent works inside budget + verifier gates
92
+ martin_dossier → receipt: spend, attempts, verifier evidence, final outcome
93
+ ```
94
+
95
+ Every attempt can be checked by your configured verifier. Budget and policy controls stay attached to the run. If the agent drifts off-task, the scope contract can block the change. If a hard spend boundary is reached, the run stops according to policy instead of silently retrying forever.
96
+
97
+ ## What Your Agent Gets
98
+
99
+ ### MCP Tools
100
+
101
+ The exact tool set is discoverable from the running MCP server with `tools/list`; do not rely on a hard-coded count in documentation.
102
+
103
+ **Run the loop:**
104
+ `martin_doctor` `martin_plan` `martin_preflight` `martin_run` `martin_pause` `martin_continue` `martin_cancel`
105
+
106
+ **Inspect results:**
107
+ `martin_status` `martin_logs` `martin_dossier` `martin_eval` `martin_inspect` `martin_list_runs` `martin_get_run` `martin_get_attempt` `martin_get_verification_results` `martin_triage_runs`
108
+
109
+ **Ship the work:**
110
+ `martin_pr_summary` `martin_create_pr` `martin_review_pr`
111
+
112
+ ### Read-Only Resources
113
+
114
+ The exact resource set is discoverable from the running MCP server; this documentation names the primary public resources without treating a count as a release invariant.
115
+
116
+ Your agent can pull context without side effects:
117
+
118
+ `martin://runs/latest` · `martin://runs/latest/proof-card` · `martin://runs/latest/budget-status` · `martin://runs/latest/verifier-evidence` · `martin://runs/recent` · `martin://server/health` · `martin://policies/current` · `martin://agent/next-step` · `martin://guides/mcp-usage` · `martin://guides/agent-start` · `martin://repo/risk-map`
119
+
120
+ ### Configuration Profiles
121
+
122
+ Generate host config tuned to your workflow:
123
+
124
+ ```sh
125
+ npx martin-loop mcp print-config --host claude --profile minimal # run + inspect
126
+ npx martin-loop mcp print-config --host claude --profile diagnostic # + doctor + triage
127
+ npx martin-loop mcp print-config --host claude --profile full-local # all local tools
128
+ npx martin-loop mcp print-config --host claude --profile github-review # + PR workflow
129
+ ```
130
+
131
+ ## What Happens When Things Go Wrong
132
+
133
+ MartinLoop does not round failure into success. It preserves the evidence and follows the configured recovery path while budget and policy still allow useful work.
134
+
135
+ | Failure | Old behavior | Now |
136
+ |---|---|---|
137
+ | CLI not on PATH | Error message, dead stop | Searches npm global, homebrew, nvm, scoop — uses what it finds |
138
+ | Verifier says "command not found" | Generic "verification failed" | Carries specific failure context into the next allowed attempt |
139
+ | `git restore` fails mid-rollback | Throws, leaves dirty state | Retries once, falls back to `git checkout`, cleans up |
140
+ | Invalid `--profile` flag | Crashes | Warns, falls back to `minimal`, keeps running |
141
+
142
+ ## Codex compatibility in 0.5.5
143
+
144
+ MartinLoop no longer assumes one Codex host or one fixed Codex flag set. The CLI resolves the exact Codex executable, reads its advertised capabilities, negotiates a supported write strategy, proves that strategy before reporting launch readiness, and reuses the same contract for the governed run.
145
+
146
+ That means MCP hosts can point MartinLoop at different Codex installations without requiring a documentation-specific approval or sandbox flag to exist everywhere.
147
+
148
+ ## Presentation and evidence
149
+
150
+ MCP responses are Markdown-first for humans while retaining structured content for agents and automation. The presentation layer does not rewrite governed truth.
151
+
152
+ MartinLoop Arcade is a terminal-only experience. It does not run inside MCP and cannot influence MCP evidence, budgets, verification, or final outcomes.
153
+
154
+ ## Who Uses This
155
+
156
+ - **Engineers running overnight agent loops** — you need a kill switch that actually works, and a receipt in the morning
157
+ - **Teams with shared API budgets** — you need per-task spend caps, not org-wide prayer
158
+ - **Anyone reviewing agent-generated PRs** — the dossier shows what the agent tried, what passed, and what didn't
159
+ - **Teams tired of stitching together point tools** — you want one execution-control lifecycle around coding-agent work from preflight through post-run analysis
160
+
161
+ ## Requirements
162
+
163
+ - Node.js 20+
164
+ - One AI coding CLI: [Claude Code](https://docs.anthropic.com/claude-code), [Codex](https://github.com/openai/codex), or [Gemini CLI](https://github.com/google/gemini-cli)
165
+
166
+ ## Links
167
+
168
+ - [martin-loop](https://www.npmjs.com/package/martin-loop) — the standalone CLI
169
+ - [MartinLoop for AI Agents](../../docs/for-agents.md)
170
+ - [GitHub](https://github.com/Keesan12/martin-loop) — source and issues
171
+ - [martinloop.com](https://martinloop.com)
172
+
173
+ ## License
174
+
175
+ Apache-2.0
@@ -0,0 +1,36 @@
1
+ export declare const MARTIN_ARCADE_UI_EXTENSION_ID = "io.modelcontextprotocol/ui";
2
+ export declare const MARTIN_ARCADE_MIME_TYPE = "text/html;profile=mcp-app";
3
+ export declare const MARTIN_ARCADE_RESOURCE_URI = "ui://martinloop/arcade/index.html";
4
+ export declare const MARTIN_ARCADE_FALLBACK_TEXT = "MartinLoop Arcade is available in an interactive terminal with --arcade.";
5
+ export declare function supportsMartinArcadeApp(capabilities: unknown): boolean;
6
+ export declare function buildArcadeToolDefinitions(capabilities: unknown): readonly [{
7
+ readonly _meta?: {
8
+ ui: {
9
+ resourceUri: string;
10
+ };
11
+ } | undefined;
12
+ readonly name: "martin_arcade";
13
+ readonly description: "Open the presentation-only MartinLoop Arcade when the host supports MCP Apps. The Arcade cannot change governed execution or evidence.";
14
+ readonly inputSchema: {
15
+ readonly type: "object";
16
+ readonly additionalProperties: false;
17
+ readonly properties: {};
18
+ };
19
+ }, {
20
+ readonly name: "martin_arcade_status";
21
+ readonly description: "Read authoritative MartinLoop evidence for the Arcade view without changing run state.";
22
+ readonly inputSchema: {
23
+ readonly type: "object";
24
+ readonly additionalProperties: false;
25
+ readonly properties: {
26
+ readonly loopId: {
27
+ readonly type: "string";
28
+ };
29
+ };
30
+ };
31
+ readonly _meta: {
32
+ readonly ui: {
33
+ readonly visibility: readonly ["app"];
34
+ };
35
+ };
36
+ }];
@@ -0,0 +1,37 @@
1
+ export const MARTIN_ARCADE_UI_EXTENSION_ID = "io.modelcontextprotocol/ui";
2
+ export const MARTIN_ARCADE_MIME_TYPE = "text/html;profile=mcp-app";
3
+ export const MARTIN_ARCADE_RESOURCE_URI = "ui://martinloop/arcade/index.html";
4
+ export const MARTIN_ARCADE_FALLBACK_TEXT = "MartinLoop Arcade is available in an interactive terminal with --arcade.";
5
+ export function supportsMartinArcadeApp(capabilities) {
6
+ if (!capabilities || typeof capabilities !== "object")
7
+ return false;
8
+ const extension = capabilities.extensions?.[MARTIN_ARCADE_UI_EXTENSION_ID];
9
+ return Array.isArray(extension?.mimeTypes) && extension.mimeTypes.includes(MARTIN_ARCADE_MIME_TYPE);
10
+ }
11
+ export function buildArcadeToolDefinitions(capabilities) {
12
+ const arcadeMeta = supportsMartinArcadeApp(capabilities)
13
+ ? { ui: { resourceUri: MARTIN_ARCADE_RESOURCE_URI } }
14
+ : undefined;
15
+ return [
16
+ {
17
+ name: "martin_arcade",
18
+ description: "Open the presentation-only MartinLoop Arcade when the host supports MCP Apps. The Arcade cannot change governed execution or evidence.",
19
+ inputSchema: {
20
+ type: "object",
21
+ additionalProperties: false,
22
+ properties: {}
23
+ },
24
+ ...(arcadeMeta ? { _meta: arcadeMeta } : {})
25
+ },
26
+ {
27
+ name: "martin_arcade_status",
28
+ description: "Read authoritative MartinLoop evidence for the Arcade view without changing run state.",
29
+ inputSchema: {
30
+ type: "object",
31
+ additionalProperties: false,
32
+ properties: { loopId: { type: "string" } }
33
+ },
34
+ _meta: { ui: { visibility: ["app"] } }
35
+ }
36
+ ];
37
+ }
@@ -0,0 +1,31 @@
1
+ export declare function listArcadeResources(capabilities: unknown): {
2
+ resources: {
3
+ uri: string;
4
+ name: string;
5
+ description: string;
6
+ mimeType: string;
7
+ _meta: {
8
+ ui: {
9
+ csp: {
10
+ connectDomains: never[];
11
+ resourceDomains: never[];
12
+ };
13
+ };
14
+ };
15
+ }[];
16
+ };
17
+ export declare function readArcadeResource(uri: string): Promise<{
18
+ contents: {
19
+ uri: string;
20
+ mimeType: string;
21
+ text: string;
22
+ _meta: {
23
+ ui: {
24
+ csp: {
25
+ connectDomains: never[];
26
+ resourceDomains: never[];
27
+ };
28
+ };
29
+ };
30
+ }[];
31
+ }>;
@@ -0,0 +1,52 @@
1
+ import { MARTIN_ARCADE_MIME_TYPE, MARTIN_ARCADE_RESOURCE_URI, supportsMartinArcadeApp } from "./capabilities.js";
2
+ const ARCADE_APP_HTML = `<!doctype html>
3
+ <html lang="en" data-martin-arcade-app>
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <meta name="viewport" content="width=device-width,initial-scale=1">
7
+ <title>MartinLoop Arcade</title>
8
+ <style>
9
+ :root { color-scheme: light dark; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
10
+ body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: Canvas; color: CanvasText; }
11
+ main { width: min(42rem, calc(100% - 2rem)); border: 1px solid currentColor; padding: 1.25rem; }
12
+ p { line-height: 1.5; }
13
+ </style>
14
+ </head>
15
+ <body>
16
+ <main aria-labelledby="arcade-title">
17
+ <h1 id="arcade-title">MartinLoop Arcade</h1>
18
+ <p>Presentation only. Governed run status and outcomes remain authoritative in MartinLoop.</p>
19
+ <p aria-live="polite" data-run-status>Waiting for authoritative run evidence.</p>
20
+ </main>
21
+ </body>
22
+ </html>`;
23
+ export function listArcadeResources(capabilities) {
24
+ return {
25
+ resources: supportsMartinArcadeApp(capabilities)
26
+ ? [
27
+ {
28
+ uri: MARTIN_ARCADE_RESOURCE_URI,
29
+ name: "MartinLoop Arcade",
30
+ description: "Presentation-only Arcade view for a governed MartinLoop run.",
31
+ mimeType: MARTIN_ARCADE_MIME_TYPE,
32
+ _meta: { ui: { csp: { connectDomains: [], resourceDomains: [] } } }
33
+ }
34
+ ]
35
+ : []
36
+ };
37
+ }
38
+ export async function readArcadeResource(uri) {
39
+ if (uri !== MARTIN_ARCADE_RESOURCE_URI) {
40
+ throw new Error(`Unknown Arcade resource: ${uri}`);
41
+ }
42
+ return {
43
+ contents: [
44
+ {
45
+ uri: MARTIN_ARCADE_RESOURCE_URI,
46
+ mimeType: MARTIN_ARCADE_MIME_TYPE,
47
+ text: ARCADE_APP_HTML,
48
+ _meta: { ui: { csp: { connectDomains: [], resourceDomains: [] } } }
49
+ }
50
+ ]
51
+ };
52
+ }
@@ -0,0 +1,23 @@
1
+ import { type MartinRunDossierInput, type MartinRunDossierOutput } from "../tools/run-dossier.js";
2
+ export interface ArcadeStatusInput {
3
+ loopId?: string;
4
+ }
5
+ export type ArcadeDossierReader = (input: MartinRunDossierInput) => Promise<MartinRunDossierOutput>;
6
+ export declare function readArcadeStatus(input: ArcadeStatusInput, readDossier?: ArcadeDossierReader): Promise<{
7
+ loopId: string;
8
+ lifecycleState: string;
9
+ completed: boolean;
10
+ displayOutcome: "NEEDS_REVIEW" | "VERIFIED" | "STOPPED" | null;
11
+ verification: import("../tools/tool-support.js").VerificationSummary;
12
+ receiptIntegrity: import("../vendor/contracts/index.js").ReceiptIntegritySummary;
13
+ attempts: number;
14
+ cost: {
15
+ actualUsd: number;
16
+ provenance: import("../vendor/contracts/index.js").CostProvenance | undefined;
17
+ };
18
+ budget: {
19
+ maxUsd: number;
20
+ remainingUsd: number;
21
+ };
22
+ warnings: string[];
23
+ }>;
@@ -0,0 +1,25 @@
1
+ import { martinRunDossierTool } from "../tools/run-dossier.js";
2
+ const ACTIVE_LIFECYCLES = new Set(["created", "running", "verifying"]);
3
+ export async function readArcadeStatus(input, readDossier = martinRunDossierTool) {
4
+ const dossier = await readDossier(input.loopId ? { loopId: input.loopId } : { latest: true });
5
+ const lifecycleState = dossier.loop.lifecycleState;
6
+ const completed = !ACTIVE_LIFECYCLES.has(lifecycleState);
7
+ return {
8
+ loopId: dossier.loop.loopId,
9
+ lifecycleState,
10
+ completed,
11
+ displayOutcome: completed ? dossier.verifiedHandoff.outcome : null,
12
+ verification: dossier.verification,
13
+ receiptIntegrity: dossier.receiptIntegrity,
14
+ attempts: dossier.attempts.length,
15
+ cost: {
16
+ actualUsd: dossier.cost.actualUsd,
17
+ provenance: dossier.cost.provenance
18
+ },
19
+ budget: {
20
+ maxUsd: dossier.budget.maxUsd,
21
+ remainingUsd: dossier.loop.remainingBudgetUsd
22
+ },
23
+ warnings: dossier.warnings
24
+ };
25
+ }
@@ -1 +1 @@
1
- export declare const MARTIN_MCP_PACKAGE_VERSION = "0.3.2";
1
+ export declare const MARTIN_MCP_PACKAGE_VERSION = "0.5.6";
@@ -1,3 +1,3 @@
1
- // Keep this aligned with packages/mcp/package.json during version bumps so the
2
- // runtime does not depend on package.json being present in every hosted bundle.
3
- export const MARTIN_MCP_PACKAGE_VERSION = "0.3.2";
1
+ // Auto-generated by build — do not edit by hand.
2
+ // Source of truth: packages/mcp/package.json#version
3
+ export const MARTIN_MCP_PACKAGE_VERSION = "0.5.6";