fetchsandbox-mcp 0.4.7 → 0.4.8

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.
@@ -16,6 +16,9 @@
16
16
  */
17
17
  export interface GuideInput {
18
18
  intent: string;
19
+ /** Repo signals. Filled in automatically from the project the MCP server is
20
+ * running in; a caller may override to force the disambiguation. */
21
+ context?: Record<string, unknown>;
19
22
  hints?: {
20
23
  spec?: string;
21
24
  workflow?: string;
@@ -1,4 +1,5 @@
1
1
  import { postJson } from "../client.js";
2
+ import { scanRepoSignals } from "./repo_signals.js";
2
3
  export const guideTool = {
3
4
  name: "guide",
4
5
  description: "ROUTE a symptom to the provider behaviour that explains it. Use this when " +
@@ -37,6 +38,39 @@ export const guideTool = {
37
38
  },
38
39
  };
39
40
  export async function runGuide(input) {
40
- return postJson("/api/mcp/route", input);
41
+ // SEND WHAT THE REPO ACTUALLY INTEGRATES. The router has a `context` field
42
+ // for exactly this — "repo signals (dependencies / detected_specs / imports)
43
+ // so the router can disambiguate an ambiguous symptom by the provider the
44
+ // repo actually integrates — the funnel intersect, a fact rather than a
45
+ // guess" — and guide never sent it. coach did; guide, the tool an agent is
46
+ // told to start with, did not.
47
+ //
48
+ // Measured 2026-09-07 against a Paddle + Resend app, on a symptom naming
49
+ // neither provider: guide returned spec "stripe", workflow "accept_payment",
50
+ // confidence 0.95. A confident route to the wrong provider is worse than no
51
+ // route — everything downstream inherits it.
52
+ //
53
+ // The scan reads the manifest in the MCP server's own cwd, which IS the
54
+ // user's project. Best-effort: a repo it cannot read sends nothing and the
55
+ // router behaves exactly as before.
56
+ const body = { ...input };
57
+ try {
58
+ const sig = scanRepoSignals();
59
+ const ctx = {};
60
+ if (sig.detected_specs?.length)
61
+ ctx.detected_specs = sig.detected_specs;
62
+ // code_probe is the tie-breaker the scanner computes when several providers
63
+ // survive: whose handler the repo actually implements, not merely imports.
64
+ if (sig.code_probe)
65
+ ctx.code_probe = sig.code_probe;
66
+ if (Object.keys(ctx).length) {
67
+ // A caller-supplied context wins — an explicit hint is not a guess.
68
+ body.context = { ...ctx, ...(input.context ?? {}) };
69
+ }
70
+ }
71
+ catch {
72
+ /* a repo we cannot read is not an error; route without the signal */
73
+ }
74
+ return postJson("/api/mcp/route", body);
41
75
  }
42
76
  //# sourceMappingURL=guide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"guide.js","sourceRoot":"","sources":["../../src/tools/guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAgDxC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,WAAW,EACT,4EAA4E;QAC5E,qEAAqE;QACrE,yEAAyE;QACzE,uEAAuE;QACvE,oBAAoB;QACpB,wEAAwE;QACxE,2EAA2E;QAC3E,wEAAwE;QACxE,6DAA6D;QAC7D,iEAAiE;QACjE,oEAAoE;QACpE,8DAA8D;IAChE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,2DAA2D;oBAC3D,6DAA6D;oBAC7D,6DAA6D;aAChE;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gEAAgE;oBAChE,mCAAmC;gBACrC,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;oBACpE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;oBAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;iBACrF;aACF;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,KAAiB;IAC9C,OAAO,QA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E;IAC7E,4EAA4E;IAC5E,6CAA6C;IAC7C,EAAE;IACF,wEAAwE;IACxE,2EAA2E;IAC3E,oCAAoC;IACpC,MAAM,IAAI,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;QAC9B,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,IAAI,GAAG,CAAC,cAAc,EAAE,MAAM;YAAE,GAAG,CAAC,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;QACxE,4EAA4E;QAC5E,2EAA2E;QAC3E,IAAI,GAAG,CAAC,UAAU;YAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QACpD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YAC5B,oEAAoE;YACpE,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,OAAiB,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,qEAAqE;IACvE,CAAC;IACD,OAAO,QAAQ,CAAgB,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC"}
@@ -25,6 +25,36 @@ const EXCLUDES = [
25
25
  "build",
26
26
  "coverage",
27
27
  ".DS_Store",
28
+ // AGENT INSTRUCTION FILES ARE NEVER SHIPPED.
29
+ //
30
+ // The analysis runtime runs its agent with cwd set to the unpacked
31
+ // workspace, and Claude Code auto-loads CLAUDE.md from cwd. Any instruction
32
+ // file in a repo therefore becomes instructions to an agent with a different
33
+ // toolset and a different job.
34
+ //
35
+ // Measured 2026-09-07: a CLAUDE.md reading "bug fixes go through
36
+ // FetchSandbox — guide → find_bugs → ..." made the find_bugs agent try to
37
+ // call tools it does not have, report them as denied, ask the USER to edit
38
+ // .claude/settings.local.json, and fall back to a static read; the fix_bug
39
+ // agent read "do not hand-write a fix" and produced no changes. Two tools
40
+ // down, from one file, and both looked like independent breakage.
41
+ //
42
+ // THIS LIST IS THE ONE THAT MATTERS for an agent-initiated call: the client
43
+ // builds the tar on the user's machine, so excluding it server-side would
44
+ // not have helped. A repo's instructions are not source under analysis.
45
+ "CLAUDE.md",
46
+ "CLAUDE.local.md",
47
+ "AGENTS.md",
48
+ "AGENT.md",
49
+ "GEMINI.md",
50
+ ".cursorrules",
51
+ ".windsurfrules",
52
+ ".clinerules",
53
+ ".aiderrules",
54
+ ".claude",
55
+ ".cursor",
56
+ ".windsurf",
57
+ "copilot-instructions.md",
28
58
  ];
29
59
  // nginx allows 50m on the probe endpoints; stay under with headroom.
30
60
  const MAX_TAR_BYTES = 40 * 1024 * 1024;
@@ -1 +1 @@
1
- {"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/tools/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,oEAAoE;AACpE,MAAM,QAAQ,GAAG;IACf,MAAM;IACN,cAAc;IACd,aAAa;IACb,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;IACV,WAAW;CACZ,CAAC;AAEF,qEAAqE;AACrE,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC,+EAA+E;AAC/E,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD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E,GAAG,CAAC,MAAM,EAAE,CAAC;IAC5D,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fetchsandbox-mcp",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "mcpName": "io.github.fetchsandbox/mcp",
5
5
  "description": "Turn any OpenAPI spec into a working sandbox your AI agent can use. MCP server for Claude Code, Cursor, and any other MCP-compatible LLM IDE.",
6
6
  "license": "MIT",