granttap-mcp 0.8.81 → 0.8.82

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.
@@ -324,8 +324,8 @@ hasown 2.0.4 — MIT
324
324
  Source: https://www.npmjs.com/package/hasown/v/2.0.4
325
325
  Notices: bf9b0d665be2a689851eea667ca9f42066ea1d903b38349c51e6a44b2577680a
326
326
 
327
- hono 4.13.7 — MIT
328
- Source: https://www.npmjs.com/package/hono/v/4.13.7
327
+ hono 4.13.13 — MIT
328
+ Source: https://www.npmjs.com/package/hono/v/4.13.13
329
329
  Notices: a6ab98e5c77b9070c443eaff2ff81034a6f8cc05a7524d5098eb0f24defa0115
330
330
 
331
331
  http-errors 2.0.1 — MIT
@@ -0,0 +1,20 @@
1
+ # Repository graph delivery
2
+
3
+ [Runtime entry point](../engine-projects.ts) · [Wire fitting](fit.ts)
4
+
5
+ The encrypted Mesh snapshot carries bounded, observed repository metadata.
6
+ `fitRepositoryGraph` preserves file identities, measured LOC and source sections.
7
+ When directed file links dominate the wire budget, it reduces those links before
8
+ discarding source sections. The bounded sample keeps links reaching previously
9
+ unrepresented files and external services, then fills in original report order.
10
+ It never invents links, reverses their direction, or edits the engine report.
11
+
12
+ Remaining reductions retain the existing wire limit and mark partial evidence.
13
+ The persistent cache keeps a last successful bounded report through an MCP
14
+ restart while the normal observation refresh obtains current engine evidence.
15
+
16
+ Behavior tests live in `tests/`; runtime and cache integration scenarios remain
17
+ under the repository's `tests/engine` harness.
18
+
19
+ License: this module is distributed under the GrantTap Commercial Source License
20
+ in the repository-root `LICENSE` file.
@@ -16,7 +16,12 @@ export function fitRepositoryGraph(
16
16
  }
17
17
  while (bytes() > maxBytes) {
18
18
  const map = bounded.codeMap;
19
- if (map?.files.some((file) => file.symbols.length > 0)) {
19
+ // Dense import graphs must not consume the source-section budget. Keep
20
+ // observed directed links across the inventory before reducing symbols.
21
+ if (map && map.roads.length > 16
22
+ && Buffer.byteLength(JSON.stringify(map.roads), "utf8") > maxBytes / 3) {
23
+ bounded = { ...bounded, codeMap: trimRoads(map) };
24
+ } else if (map?.files.some((file) => file.symbols.length > 0)) {
20
25
  bounded = { ...bounded, codeMap: trimSymbols(map) };
21
26
  } else if (bounded.relations.length > 8) {
22
27
  bounded = { ...bounded, relations: strongestRelations(bounded.relations,
@@ -27,8 +32,7 @@ export function fitRepositoryGraph(
27
32
  bounded = { ...bounded, nodes, relations: bounded.relations.filter((edge) =>
28
33
  ids.has(edge.source) && ids.has(edge.target)), truncated: true };
29
34
  } else if (map && map.roads.length > 16) {
30
- bounded = { ...bounded, codeMap: { ...map, truncated: true,
31
- roads: map.roads.slice(0, Math.ceil(map.roads.length / 2)) } };
35
+ bounded = { ...bounded, codeMap: trimRoads(map) };
32
36
  } else if (map && map.files.length > 8) {
33
37
  bounded = { ...bounded, codeMap: trimFiles(map) };
34
38
  } else if (map) {
@@ -40,6 +44,20 @@ export function fitRepositoryGraph(
40
44
  return bounded;
41
45
  }
42
46
 
47
+ function trimRoads(map: CodeMap): CodeMap {
48
+ const limit = Math.max(16, Math.ceil(map.roads.length / 2));
49
+ const kept = new Set<number>(), endpoints = new Set<string>();
50
+ for (const [index, road] of map.roads.entries()) {
51
+ if (kept.size === limit) break;
52
+ if (endpoints.has(road.source) && endpoints.has(road.target)) continue;
53
+ kept.add(index);
54
+ endpoints.add(road.source);
55
+ endpoints.add(road.target);
56
+ }
57
+ for (let index = 0; kept.size < limit; index++) kept.add(index);
58
+ return { ...map, truncated: true, roads: map.roads.filter((_, index) => kept.has(index)) };
59
+ }
60
+
43
61
  function strongestRelations(relations: Relation[], limit: number): Relation[] {
44
62
  return relations.map((edge, index) => ({ edge, index }))
45
63
  .sort((left, right) => (right.edge.evidenceCount ?? 0) - (left.edge.evidenceCount ?? 0)
@@ -10,7 +10,7 @@ keeps each phone response tied to the exact originating chat and prompt.
10
10
  Install the supported CLI on this computer, then run:
11
11
 
12
12
  ```bash
13
- npm install -g granttap-mcp@0.8.81
13
+ npm install -g granttap-mcp@0.8.82
14
14
  granttap setup
15
15
  granttap status
16
16
  ```
@@ -4,7 +4,7 @@
4
4
  "command": "node",
5
5
  "args": [
6
6
  "-e",
7
- "\"use strict\";\n\n// Cursor may start this MCP from any cwd. Execute JavaScript entry points with\n// Node itself: Windows batch shims require shell quoting that differs by host.\nconst { spawn } = require(\"node:child_process\");\nconst { existsSync } = require(\"node:fs\");\nconst { delimiter, dirname, join } = require(\"node:path\");\n\nconst PACKAGE = \"granttap-mcp@0.8.81\";\nconst dryRun = process.env.GRANTTAP_BOOTSTRAP_DRY_RUN === \"1\";\nconst platform = dryRun && process.env.GRANTTAP_BOOTSTRAP_PLATFORM\n ? process.env.GRANTTAP_BOOTSTRAP_PLATFORM : process.platform;\nconst nodeRoot = dryRun && process.env.GRANTTAP_BOOTSTRAP_NODE_ROOT\n ? process.env.GRANTTAP_BOOTSTRAP_NODE_ROOT : dirname(process.execPath);\nconst pathRoots = (process.env.PATH || \"\").split(delimiter).filter(Boolean);\nconst appData = process.env.APPDATA;\nconst roots = [nodeRoot, ...pathRoots, ...(appData ? [join(appData, \"npm\")] : [])];\nconst first = (paths) => paths.find((path) => existsSync(path));\n\nfunction launch() {\n if (platform !== \"win32\") {\n const installed = first(roots.map((root) => join(root, \"granttap-mcp\")));\n if (installed) return { command: installed, args: [] };\n const npx = first(roots.map((root) => join(root, \"npx\"))) || \"npx\";\n return { command: npx, args: [\"-y\", PACKAGE] };\n }\n const installed = first(roots.map((root) =>\n join(root, \"node_modules\", \"granttap-mcp\", \"bin\", \"granttap-mcp.mjs\")));\n if (installed) return { command: process.execPath, args: [installed] };\n const npx = first(roots.map((root) =>\n join(root, \"node_modules\", \"npm\", \"bin\", \"npx-cli.js\")));\n if (npx) return { command: process.execPath, args: [npx, \"-y\", PACKAGE] };\n throw new Error(\"Node.js/npm 20+ is required on this Windows device. Install npm and retry GrantTap.\");\n}\n\nlet target;\ntry { target = launch(); }\ncatch (error) {\n process.stderr.write(`[granttap] ${error.message}\\n`);\n process.exit(1);\n}\n\nif (dryRun) {\n process.stdout.write(JSON.stringify(target));\n process.exit(0);\n}\n\nconst child = spawn(target.command, target.args, { stdio: \"inherit\", windowsHide: true });\nchild.on(\"error\", (error) => {\n process.stderr.write(`[granttap] ${error.message}\\n`);\n process.exit(1);\n});\nchild.on(\"exit\", (code, signal) => {\n if (signal && platform !== \"win32\") {\n try { process.kill(process.pid, signal); } catch { process.exit(code ?? 1); }\n return;\n }\n process.exit(code ?? 1);\n});\n"
7
+ "\"use strict\";\n\n// Cursor may start this MCP from any cwd. Execute JavaScript entry points with\n// Node itself: Windows batch shims require shell quoting that differs by host.\nconst { spawn } = require(\"node:child_process\");\nconst { existsSync } = require(\"node:fs\");\nconst { delimiter, dirname, join } = require(\"node:path\");\n\nconst PACKAGE = \"granttap-mcp@0.8.82\";\nconst dryRun = process.env.GRANTTAP_BOOTSTRAP_DRY_RUN === \"1\";\nconst platform = dryRun && process.env.GRANTTAP_BOOTSTRAP_PLATFORM\n ? process.env.GRANTTAP_BOOTSTRAP_PLATFORM : process.platform;\nconst nodeRoot = dryRun && process.env.GRANTTAP_BOOTSTRAP_NODE_ROOT\n ? process.env.GRANTTAP_BOOTSTRAP_NODE_ROOT : dirname(process.execPath);\nconst pathRoots = (process.env.PATH || \"\").split(delimiter).filter(Boolean);\nconst appData = process.env.APPDATA;\nconst roots = [nodeRoot, ...pathRoots, ...(appData ? [join(appData, \"npm\")] : [])];\nconst first = (paths) => paths.find((path) => existsSync(path));\n\nfunction launch() {\n if (platform !== \"win32\") {\n const installed = first(roots.map((root) => join(root, \"granttap-mcp\")));\n if (installed) return { command: installed, args: [] };\n const npx = first(roots.map((root) => join(root, \"npx\"))) || \"npx\";\n return { command: npx, args: [\"-y\", PACKAGE] };\n }\n const installed = first(roots.map((root) =>\n join(root, \"node_modules\", \"granttap-mcp\", \"bin\", \"granttap-mcp.mjs\")));\n if (installed) return { command: process.execPath, args: [installed] };\n const npx = first(roots.map((root) =>\n join(root, \"node_modules\", \"npm\", \"bin\", \"npx-cli.js\")));\n if (npx) return { command: process.execPath, args: [npx, \"-y\", PACKAGE] };\n throw new Error(\"Node.js/npm 20+ is required on this Windows device. Install npm and retry GrantTap.\");\n}\n\nlet target;\ntry { target = launch(); }\ncatch (error) {\n process.stderr.write(`[granttap] ${error.message}\\n`);\n process.exit(1);\n}\n\nif (dryRun) {\n process.stdout.write(JSON.stringify(target));\n process.exit(0);\n}\n\nconst child = spawn(target.command, target.args, { stdio: \"inherit\", windowsHide: true });\nchild.on(\"error\", (error) => {\n process.stderr.write(`[granttap] ${error.message}\\n`);\n process.exit(1);\n});\nchild.on(\"exit\", (code, signal) => {\n if (signal && platform !== \"win32\") {\n try { process.kill(process.pid, signal); } catch { process.exit(code ?? 1); }\n return;\n }\n process.exit(code ?? 1);\n});\n"
8
8
  ]
9
9
  }
10
10
  }
@@ -7,7 +7,7 @@ const { spawn } = require("node:child_process");
7
7
  const { existsSync } = require("node:fs");
8
8
  const { delimiter, dirname, join } = require("node:path");
9
9
 
10
- const PACKAGE = "granttap-mcp@0.8.81";
10
+ const PACKAGE = "granttap-mcp@0.8.82";
11
11
  const dryRun = process.env.GRANTTAP_BOOTSTRAP_DRY_RUN === "1";
12
12
  const platform = dryRun && process.env.GRANTTAP_BOOTSTRAP_PLATFORM
13
13
  ? process.env.GRANTTAP_BOOTSTRAP_PLATFORM : process.platform;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "granttap-mcp",
3
- "version": "0.8.81",
3
+ "version": "0.8.82",
4
4
  "description": "Commercial computer runtime connecting local coding agents to GrantTap on Mac, iPhone, iPad and Apple Watch.",
5
5
  "type": "module",
6
6
  "bin": {