@martinloop/mcp 0.6.1 → 0.6.3

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.
@@ -1 +1 @@
1
- export declare const MARTIN_MCP_PACKAGE_VERSION = "0.6.1";
1
+ export declare const MARTIN_MCP_PACKAGE_VERSION = "0.6.3";
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by build — do not edit by hand.
2
2
  // Source of truth: packages/mcp/package.json#version
3
- export const MARTIN_MCP_PACKAGE_VERSION = "0.6.1";
3
+ export const MARTIN_MCP_PACKAGE_VERSION = "0.6.3";
@@ -55,6 +55,8 @@ export interface CodexExecArgsOptions {
55
55
  autonomyResolution?: CodexAutonomyResolution;
56
56
  }
57
57
  type SpawnSyncLike = typeof spawnSync;
58
+ export declare function markCodexAutonomyResolutionVerifiedByLaunchProbe(resolution: CodexAutonomyResolution): CodexAutonomyResolution;
59
+ export declare function isCodexAutonomyResolutionVerifiedByLaunchProbe(resolution: CodexAutonomyResolution): boolean;
58
60
  export declare function clearCodexCapabilityCacheForTests(): void;
59
61
  export declare function cacheCodexCapabilityProfile(profile: CodexCapabilityProfile, platform?: NodeJS.Platform): CodexCapabilityProfile;
60
62
  export declare function probeCodexCapabilities(binaryPath: string, options?: {
@@ -3,6 +3,14 @@ import { extname } from "node:path";
3
3
  import { createSpawnPlan, resolveNpmShimScript } from "./cli-bridge.js";
4
4
  import { DEFAULT_AGENT_EXECUTION_INTENT } from "../contracts/index.js";
5
5
  const capabilityCache = new Map();
6
+ const launchProbeVerifiedAutonomyResolutions = new WeakSet();
7
+ export function markCodexAutonomyResolutionVerifiedByLaunchProbe(resolution) {
8
+ launchProbeVerifiedAutonomyResolutions.add(resolution);
9
+ return resolution;
10
+ }
11
+ export function isCodexAutonomyResolutionVerifiedByLaunchProbe(resolution) {
12
+ return launchProbeVerifiedAutonomyResolutions.has(resolution);
13
+ }
6
14
  function escapeRegex(value) {
7
15
  return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
8
16
  }
@@ -197,6 +205,20 @@ export function codexWriteStrategies(profile) {
197
205
  }
198
206
  export function resolveCodexAutonomyCandidates(profile, intent = DEFAULT_AGENT_EXECUTION_INTENT) {
199
207
  const candidates = [];
208
+ // Prefer the least-privileged advertised workspace-write mode. The launch
209
+ // probe still has final authority: it must prove an in-workspace write and
210
+ // prove the paired outside-workspace marker was denied before this
211
+ // resolution can be selected for a governed run.
212
+ if (profile.sandbox?.values.includes("workspace-write")) {
213
+ candidates.push({
214
+ binaryPath: profile.binaryPath,
215
+ intent,
216
+ strategy: "sandbox+approval",
217
+ sandboxValue: "workspace-write"
218
+ });
219
+ }
220
+ // Keep provider automation as a compatibility fallback. It is never trusted
221
+ // merely because it is advertised; the same boundary probe must prove it.
200
222
  if (profile.automation) {
201
223
  candidates.push({
202
224
  binaryPath: profile.binaryPath,
@@ -1,6 +1,6 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { createAgentCliAdapter } from "./claude-cli.js";
3
- import { buildCodexExecArgs, buildCodexStdin, probeCodexCapabilities } from "./codex-launcher.js";
3
+ import { buildCodexExecArgs, buildCodexStdin, isCodexAutonomyResolutionVerifiedByLaunchProbe, probeCodexCapabilities } from "./codex-launcher.js";
4
4
  import { createSpawnPlan } from "./cli-bridge.js";
5
5
  function createCodexSpawnRouter(input) {
6
6
  if (input.injectedSpawn) {
@@ -33,6 +33,9 @@ export function createCodexCliAdapter(options = {}) {
33
33
  if (autonomyResolution && autonomyResolution.binaryPath !== selectedBinary) {
34
34
  throw new Error("Codex exact binary autonomy resolution mismatch.");
35
35
  }
36
+ if (autonomyResolution && !isCodexAutonomyResolutionVerifiedByLaunchProbe(autonomyResolution)) {
37
+ throw new Error("Codex autonomy resolution was not verified by the launch probe.");
38
+ }
36
39
  const sandbox = options.sandbox ?? "workspace-write";
37
40
  const extraArgs = options.extraArgs ?? [];
38
41
  const launchModel = options.model;
@@ -1,4 +1,5 @@
1
1
  import { type CodexExecArgsOptions } from "./codex-capabilities.js";
2
+ import { probeCodexLaunch as probeCodexLaunchHost, type CodexLaunchProbeResult } from "./codex-host.js";
2
3
  /**
3
4
  * Compatibility facade for callers that still populate the original
4
5
  * `approval` profile field. Internally automation modes and approval policies
@@ -6,5 +7,11 @@ import { type CodexExecArgsOptions } from "./codex-capabilities.js";
6
7
  * builder without restoring any hard-coded flag assumption.
7
8
  */
8
9
  export declare function buildCodexExecArgs(options: CodexExecArgsOptions): string[];
9
- export { buildCodexStdin, cacheCodexCapabilityProfile, clearCodexCapabilityCacheForTests, codexWriteStrategies, probeCodexCapabilities, resolveCodexAutonomyCandidates, type CodexAutonomyResolution, type CodexApprovalCapability, type CodexCapabilityFlag, type CodexCapabilityProfile, type CodexExecArgsOptions, type CodexFlagScope, type CodexPromptTransport, type CodexSandboxCapability, type CodexWriteStrategy } from "./codex-capabilities.js";
10
- export { checkCodexSandboxPreflight, detectCodexHostPlatform, diagnoseCodexHost, probeCodexLaunch, probeFilesystemWriteCapability, resolveCliCommandAvailability, type CliCommandAvailability, type CodexHostDiagnosis, type CodexHostPlatform, type CodexInstallKind, type CodexInvocationMode, type CodexLaunchProbeResult, type CodexProbeCandidateResult, type CodexSandboxPreflightOk, type CodexSandboxPreflightOutcome, type CodexSandboxPreflightReadOnly } from "./codex-host.js";
10
+ /**
11
+ * Public launch-probe facade. Only a successful probe may brand an autonomy
12
+ * resolution as safe for adapter execution; structurally similar objects
13
+ * supplied directly by callers remain untrusted.
14
+ */
15
+ export declare function probeCodexLaunch(input: Parameters<typeof probeCodexLaunchHost>[0]): CodexLaunchProbeResult;
16
+ export { buildCodexStdin, cacheCodexCapabilityProfile, clearCodexCapabilityCacheForTests, codexWriteStrategies, isCodexAutonomyResolutionVerifiedByLaunchProbe, probeCodexCapabilities, resolveCodexAutonomyCandidates, type CodexAutonomyResolution, type CodexApprovalCapability, type CodexCapabilityFlag, type CodexCapabilityProfile, type CodexExecArgsOptions, type CodexFlagScope, type CodexPromptTransport, type CodexSandboxCapability, type CodexWriteStrategy } from "./codex-capabilities.js";
17
+ export { checkCodexSandboxPreflight, detectCodexHostPlatform, diagnoseCodexHost, probeFilesystemWriteCapability, resolveCliCommandAvailability, type CliCommandAvailability, type CodexHostDiagnosis, type CodexHostPlatform, type CodexInstallKind, type CodexInvocationMode, type CodexLaunchProbeResult, type CodexProbeCandidateResult, type CodexSandboxPreflightOk, type CodexSandboxPreflightOutcome, type CodexSandboxPreflightReadOnly } from "./codex-host.js";
@@ -1,4 +1,5 @@
1
- import { buildCodexExecArgs as buildCapabilityDrivenCodexExecArgs } from "./codex-capabilities.js";
1
+ import { buildCodexExecArgs as buildCapabilityDrivenCodexExecArgs, markCodexAutonomyResolutionVerifiedByLaunchProbe } from "./codex-capabilities.js";
2
+ import { probeCodexLaunch as probeCodexLaunchHost } from "./codex-host.js";
2
3
  /**
3
4
  * Compatibility facade for callers that still populate the original
4
5
  * `approval` profile field. Internally automation modes and approval policies
@@ -18,5 +19,17 @@ export function buildCodexExecArgs(options) {
18
19
  capabilityProfile: normalizedProfile
19
20
  });
20
21
  }
21
- export { buildCodexStdin, cacheCodexCapabilityProfile, clearCodexCapabilityCacheForTests, codexWriteStrategies, probeCodexCapabilities, resolveCodexAutonomyCandidates } from "./codex-capabilities.js";
22
- export { checkCodexSandboxPreflight, detectCodexHostPlatform, diagnoseCodexHost, probeCodexLaunch, probeFilesystemWriteCapability, resolveCliCommandAvailability } from "./codex-host.js";
22
+ /**
23
+ * Public launch-probe facade. Only a successful probe may brand an autonomy
24
+ * resolution as safe for adapter execution; structurally similar objects
25
+ * supplied directly by callers remain untrusted.
26
+ */
27
+ export function probeCodexLaunch(input) {
28
+ const result = probeCodexLaunchHost(input);
29
+ if (result.ok && result.autonomyResolution) {
30
+ markCodexAutonomyResolutionVerifiedByLaunchProbe(result.autonomyResolution);
31
+ }
32
+ return result;
33
+ }
34
+ export { buildCodexStdin, cacheCodexCapabilityProfile, clearCodexCapabilityCacheForTests, codexWriteStrategies, isCodexAutonomyResolutionVerifiedByLaunchProbe, probeCodexCapabilities, resolveCodexAutonomyCandidates } from "./codex-capabilities.js";
35
+ export { checkCodexSandboxPreflight, detectCodexHostPlatform, diagnoseCodexHost, probeFilesystemWriteCapability, resolveCliCommandAvailability } from "./codex-host.js";
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@martinloop/mcp",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "mcpName": "io.github.Keesan12/martin-loop",
5
5
  "private": false,
6
6
  "type": "module",
7
- "description": "MCP server for AI coding agents — verifier gates, stop limits, and Verified Handoffs.",
7
+ "description": "MCP server for AI coding agents — verifier gates, stop limits, and Verified Handoffs.",
8
8
  "license": "Apache-2.0",
9
9
  "author": "MartinLoop contributors",
10
10
  "homepage": "https://martinloop.com/",
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/Keesan12/martin-loop.git",
13
+ "url": "https://github.com/Keesan12/martin-loop",
14
14
  "directory": "packages/mcp"
15
15
  },
16
16
  "bugs": {
@@ -41,11 +41,6 @@
41
41
  "martin-loop-mcp": "./dist/server.js"
42
42
  },
43
43
  "exports": {
44
- ".": {
45
- "types": "./dist/server.d.ts",
46
- "import": "./dist/server.js",
47
- "default": "./dist/server.js"
48
- },
49
44
  "./server.json": "./server.json",
50
45
  "./package.json": "./package.json"
51
46
  },
@@ -79,12 +74,12 @@
79
74
  "mcpb:smoke": "node ./mcpb/smoke-mcpb.mjs"
80
75
  },
81
76
  "dependencies": {
82
- "@modelcontextprotocol/sdk": "1.29.0",
77
+ "@modelcontextprotocol/sdk": "^1.29.0",
83
78
  "@open-policy-agent/opa-wasm": "^1.10.0",
84
- "@opentelemetry/api-logs": "^0.221.0",
85
- "@opentelemetry/exporter-logs-otlp-http": "^0.221.0",
86
- "@opentelemetry/resources": "^2.10.0",
87
- "@opentelemetry/sdk-logs": "^0.221.0",
79
+ "@opentelemetry/api-logs": "^0.214.0",
80
+ "@opentelemetry/exporter-logs-otlp-http": "^0.214.0",
81
+ "@opentelemetry/resources": "^2.6.1",
82
+ "@opentelemetry/sdk-logs": "^0.214.0",
88
83
  "ts-morph": "^21.0.0"
89
84
  },
90
85
  "devDependencies": {
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/Keesan12/martin-loop",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.6.1",
10
+ "version": "0.6.3",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "@martinloop/mcp",
15
- "version": "0.6.1",
15
+ "version": "0.6.3",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }