granttap-mcp 0.8.156 → 0.8.157

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.
@@ -41,6 +41,9 @@ owner, without a competing `exec resume` writer. The `codex-desktop` feature own
41
41
  that versioned local connection and durable admission receipt. Headless resume is
42
42
  used only when no native owner exists. Native admission carries the controller's
43
43
  message ID and returns promptly; the provider transcript supplies the answer.
44
+ Local image and document files remain available for one day after native
45
+ admission, because accepting a queued turn does not mean its files were read.
46
+ The regular attachment sweep removes expired stages without following symlinks.
44
47
 
45
48
  New and resumed headless Codex tasks both accept workspaces outside Git. The
46
49
  repository presence check is skipped consistently; configured sandbox, approval,
@@ -27,7 +27,7 @@ export async function withAttachments(
27
27
  claudePrompt: `${text || "Please inspect the attached content."}${claudeNote}`,
28
28
  images: files.filter((file) => file.image).map((file) => file.path),
29
29
  });
30
- retained = result.delivery === 'native' && documents.length > 0;
30
+ retained = result.delivery === 'native' && files.length > 0;
31
31
  return result;
32
32
  } catch (error) {
33
33
  return { ok: false, error: `Could not prepare attachment: ${(error as Error).message}` };
@@ -36,7 +36,7 @@ export async function withAttachments(
36
36
  }
37
37
  }
38
38
 
39
- /** Native admission returns before the agent reads documents. Retain those for one day. */
39
+ /** Native admission queues a turn before it reads local files. Retain images and documents for one day. */
40
40
  export function prunePreparedAttachments(now = Date.now()): number {
41
41
  const root = join(configDir(), 'message-attachments');
42
42
  if (!existsSync(root)) return 0;
@@ -20,6 +20,11 @@ walking up for `.git` without running Git; the current folder decides only
20
20
  until such a change is known. Catalog linking verifies the chosen Git root while
21
21
  preserving the existing Task and Project identities.
22
22
 
23
+ Codex host question-reply envelopes remain intact in conversation history but
24
+ cannot name a Task. A native title containing that transport JSON, including a
25
+ clipped older title, yields to the person's request from the bounded log head.
26
+ Ordinary JSON requests and quoted markup remain eligible human titles.
27
+
23
28
  A pasted Claude image appears as an attachment. The label Claude Code writes
24
29
  beside it (`[Image: source: …]`, `[Image #1]`) is dropped from the chat, title
25
30
  and child title when that block holds only labels and the message carries the
@@ -0,0 +1,8 @@
1
+ # Native Task titles
2
+
3
+ `index.ts` selects human Codex Task names without changing transcript payloads.
4
+ Host question-reply envelopes and their clipped JSON metadata yield to the
5
+ original request. Ordinary JSON requests and quoted examples stay eligible.
6
+ Scanner behavior and retained history are covered in `tests/`.
7
+
8
+ Licensed under the GrantTap Commercial Source License. See LICENSE and NOTICE.
@@ -0,0 +1,15 @@
1
+ import { visibleUserText } from '../support/activity-helpers';
2
+ import { childTitle } from '../support/child-threads';
3
+
4
+ /** A host answer envelope, including a previously clipped native title, is not a Task name. */
5
+ export function isCodexQuestionReply(text: string): boolean {
6
+ const value = text.trimStart();
7
+ return value.startsWith('<send_user_message_question_reply>')
8
+ || /^\[\s*\{\s*"questionItemId"\s*:/.test(value);
9
+ }
10
+
11
+ /** Keep transport payloads intact in history; only title selection rejects them. */
12
+ export function codexRequestTitle(value: unknown): string | undefined {
13
+ const text = visibleUserText(value);
14
+ return isCodexQuestionReply(text) ? undefined : childTitle(text);
15
+ }
@@ -18,6 +18,7 @@ import { visibleUserText } from "../../support/activity-helpers";
18
18
  import { codexHeadRequest, isProvisionalPageTitle } from "../../support/codex-head";
19
19
  import { heartbeatDisplayText } from '../../host-heartbeat';
20
20
  import { codexContextReport } from "../../context-usage";
21
+ import { codexRequestTitle } from '../../native-task-titles';
21
22
 
22
23
  type CodexParseState = {
23
24
  sessionId: string;
@@ -43,7 +44,7 @@ type CodexParseState = {
43
44
  };
44
45
 
45
46
  function adoptRequestTitle(state: CodexParseState, text: string | undefined): void {
46
- const title = childTitle(text);
47
+ const title = codexRequestTitle(text);
47
48
  if (!title) return;
48
49
  if (isProvisionalPageTitle(title)) state.provisionalTitle ??= title;
49
50
  else state.title = title;
@@ -75,7 +76,7 @@ function applyCodexLine(d: any, state: CodexParseState): void {
75
76
  if (p?.model) state.model = String(p.model);
76
77
  if (p?.git?.branch) state.branch = String(p.git.branch);
77
78
  if (typeof p?.title === "string") {
78
- const title = visibleUserText(p.title);
79
+ const title = codexRequestTitle(p.title);
79
80
  if (title && !isProvisionalPageTitle(title)) state.title = title.slice(0, 120);
80
81
  }
81
82
  state.child = codexChildSource(p);
@@ -1,6 +1,7 @@
1
1
  import { closeSync, openSync, readSync } from "node:fs";
2
2
  import { visibleUserText } from "./activity-helpers";
3
3
  import { ts } from "./common";
4
+ import { isCodexQuestionReply } from '../native-task-titles';
4
5
 
5
6
  const TITLE_HEAD_BYTES = 256 * 1024;
6
7
 
@@ -69,6 +70,7 @@ export function codexHeadRequest(path: string, preferHumanTitle = false): CodexH
69
70
  for (const line of source.split("\n")) {
70
71
  const text = visibleText(line);
71
72
  if (!text) continue;
73
+ if (preferHumanTitle && isCodexQuestionReply(text)) continue;
72
74
  const request = { text, createdAt: ts(jsonStringAfter(line, "timestamp")) };
73
75
  if (preferHumanTitle && isProvisionalPageTitle(text)) { provisional ??= request; continue; }
74
76
  return request;
@@ -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.156
13
+ npm install -g granttap-mcp@0.8.157
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.156\";\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 22.13.0+ 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.157\";\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 22.13.0+ 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.156";
10
+ const PACKAGE = "granttap-mcp@0.8.157";
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.156",
3
+ "version": "0.8.157",
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": {
@@ -83,6 +83,8 @@
83
83
  "access": "public"
84
84
  },
85
85
  "overrides": {
86
- "@hono/node-server": "2.1.3"
86
+ "@hono/node-server": "2.1.3",
87
+ "glob": "14.0.4",
88
+ "minimatch": "11.0.5"
87
89
  }
88
90
  }