granttap-mcp 0.8.156 → 0.8.158
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/apps/bridge/src/codex-desktop/README.md +9 -3
- package/apps/bridge/src/codex-desktop/index.ts +4 -1
- package/apps/bridge/src/codex-desktop/question-continuation/README.md +10 -0
- package/apps/bridge/src/codex-desktop/question-continuation/index.ts +28 -0
- package/apps/bridge/src/codex-questions/README.md +9 -3
- package/apps/bridge/src/codex-questions/index.ts +1 -1
- package/apps/bridge/src/codex-questions/presentation/README.md +9 -0
- package/apps/bridge/src/codex-questions/presentation/index.ts +22 -0
- package/apps/bridge/src/mesh/admin/journal.ts +3 -2
- package/apps/bridge/src/monitor/handlers/user-message.ts +2 -2
- package/apps/bridge/src/monitor/message-delivery/index.ts +1 -1
- package/apps/bridge/src/reply/README.md +3 -0
- package/apps/bridge/src/reply/payload/attachments.ts +2 -2
- package/apps/bridge/src/reply/payload/types.ts +2 -0
- package/apps/bridge/src/reply/process/codex-headless.ts +8 -1
- package/apps/bridge/src/sessions/README.md +5 -0
- package/apps/bridge/src/sessions/native-task-titles/README.md +8 -0
- package/apps/bridge/src/sessions/native-task-titles/index.ts +15 -0
- package/apps/bridge/src/sessions/scan/codex/parse.ts +3 -2
- package/apps/bridge/src/sessions/support/codex-head.ts +2 -0
- package/cursor-plugin/README.md +1 -1
- package/cursor-plugin/mcp.json +1 -1
- package/cursor-plugin/stdio-bootstrap.cjs +1 -1
- package/package.json +4 -2
|
@@ -24,13 +24,13 @@ An uncertain or crashed dispatch is not replayed. A native receipt produces no
|
|
|
24
24
|
synthetic assistant reply or completed-run digest; the existing transcript carries
|
|
25
25
|
the actual work. Pause sends the user's stop request to the same owner. Document
|
|
26
26
|
attachments remain in private staging for up to a day after admission; the monitor
|
|
27
|
-
removes expired stages. Image-only stages
|
|
28
|
-
|
|
27
|
+
removes expired stages. Image-only stages have the same retention because
|
|
28
|
+
admission precedes attachment consumption. Tests exercise framing, socket trust, durable
|
|
29
29
|
deduplication, and refusal without launching the CLI.
|
|
30
30
|
|
|
31
31
|
License: GrantTap Commercial Source License in the repository-root `LICENSE`.
|
|
32
32
|
|
|
33
|
-
Document staging for a
|
|
33
|
+
Document staging for a correlated question keeps the file note inside its
|
|
34
34
|
original answer envelope. The host's native question and all paired controllers
|
|
35
35
|
therefore observe the same question item as answered; document paths remain
|
|
36
36
|
available to the admitted turn. Ordinary chat text is unchanged.
|
|
@@ -39,3 +39,9 @@ The bounded native admission deadline leaves time for the installed router’s
|
|
|
39
39
|
ten-second owner discovery window. A five-second client cap otherwise reports
|
|
40
40
|
healthy CLI conversations unavailable before discovery can finish. Missing-owner
|
|
41
41
|
confirmation preserves CLI continuation; uncertain dispatch remains unreplayed.
|
|
42
|
+
|
|
43
|
+
`continueCodexQuestion`, exported through `index.ts`, reserves the same durable
|
|
44
|
+
question identity for an ownerless CLI continuation. Its caller must first
|
|
45
|
+
obtain a definitive absent-owner result inside the existing per-chat queue.
|
|
46
|
+
The original native envelope is preserved, and another controller cannot retry
|
|
47
|
+
an uncertain dispatch or replace an already accepted answer.
|
|
@@ -8,6 +8,8 @@ import { DesktopConnection } from './connection';
|
|
|
8
8
|
import { DesktopReceipt } from './receipts';
|
|
9
9
|
import { desktopSocketPath } from './socket-path';
|
|
10
10
|
export { interruptCodexDesktop } from './controls';
|
|
11
|
+
export { continueCodexQuestion } from './question-continuation';
|
|
12
|
+
export { nativeQuestionAttachmentEnvelope } from './question-attachment-envelope';
|
|
11
13
|
|
|
12
14
|
const UNAVAILABLE = 'Codex desktop is not ready to receive this message. Keep the original chat open and try again.';
|
|
13
15
|
const UNCERTAIN = 'Codex has not confirmed this message. Check the original chat before sending it again.';
|
|
@@ -73,7 +75,8 @@ function turnRequest(input: { session: SessionInfo; text: string; images: string
|
|
|
73
75
|
networkAccess: false, excludeTmpdirEnvVar: false, excludeSlashTmp: false }
|
|
74
76
|
: access === 'full' ? { type: 'dangerFullAccess' } : undefined;
|
|
75
77
|
return { threadId: session.sessionId, clientUserMessageId: options.messageId ?? randomUUID(),
|
|
76
|
-
input: [{ type: 'text', text: options.nativeOnly
|
|
78
|
+
input: [{ type: 'text', text: options.nativeOnly || options.questionReply
|
|
79
|
+
? nativeQuestionAttachmentEnvelope(text) : text, text_elements: [] }, ...images.map(path => ({ type: 'localImage', path }))],
|
|
77
80
|
...(options.model ? { model: options.model } : {}), ...(effort ? { effort } : {}),
|
|
78
81
|
...(sandboxPolicy ? { sandboxPolicy } : {}) };
|
|
79
82
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Ownerless question continuation
|
|
2
|
+
|
|
3
|
+
`continueCodexQuestion`, exported by the parent `index.ts`, reserves the original
|
|
4
|
+
question's durable admission identity before a serialized CLI continuation.
|
|
5
|
+
Call only after native owner discovery returns definitive absence. Pending or
|
|
6
|
+
uncertain admissions are never retried, including from another controller.
|
|
7
|
+
Public delivery integration tests live in
|
|
8
|
+
`../../codex-questions/continuation/tests/cli-delivery.test.ts`.
|
|
9
|
+
|
|
10
|
+
License: [GrantTap Commercial Source License](../../../../../LICENSE).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DeliveryOptions, ReplyResult } from '../../reply/payload/types';
|
|
2
|
+
import { DesktopReceipt } from '../receipts';
|
|
3
|
+
|
|
4
|
+
/** Called inside the chat queue only after desktop discovery proves no owner exists. */
|
|
5
|
+
export async function continueCodexQuestion(sessionId: string, options: DeliveryOptions,
|
|
6
|
+
run: () => Promise<ReplyResult>): Promise<ReplyResult> {
|
|
7
|
+
if (!options.messageId || !options.intentDigest) {
|
|
8
|
+
return { ok: false, error: 'The question answer has no stable delivery identity.' };
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
// Share the native admission journal: neither a second controller nor a
|
|
12
|
+
// later desktop owner may submit another answer for this question.
|
|
13
|
+
const receipt = new DesktopReceipt(sessionId, options.messageId, options.intentDigest);
|
|
14
|
+
const state = receipt.begin();
|
|
15
|
+
if (state === 'accepted') return { ok: true, text: '', sessionId, delivery: 'native' };
|
|
16
|
+
if (state === 'conflict') return { ok: false, error: 'This message ID belongs to a different Codex delivery.' };
|
|
17
|
+
if (state !== 'new') return uncertain();
|
|
18
|
+
const result = await run();
|
|
19
|
+
if (!result.ok) return { ...result, delivery: 'native' };
|
|
20
|
+
receipt.accept('cli:' + sessionId);
|
|
21
|
+
return result;
|
|
22
|
+
} catch { return uncertain(); }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function uncertain(): ReplyResult {
|
|
26
|
+
return { ok: false, delivery: 'native',
|
|
27
|
+
error: 'Codex has not confirmed this answer. Check the original chat before sending it again.' };
|
|
28
|
+
}
|
|
@@ -17,9 +17,15 @@ Replies use the original host question item ID and normal scoped phone delivery,
|
|
|
17
17
|
including current provider, pause and Task policy. Native admission uses one
|
|
18
18
|
stable delivery ID per question, so concurrent controllers cannot submit two
|
|
19
19
|
different answers. The phone's own message ID still receives its receipts.
|
|
20
|
-
|
|
21
|
-
CLI
|
|
22
|
-
|
|
20
|
+
When discovery confirms there is no desktop owner, an answer resumes the same
|
|
21
|
+
CLI conversation through the existing per-chat queue. It waits for a running
|
|
22
|
+
delivery, preserves the original question envelope and attachments, and shares
|
|
23
|
+
the durable native admission identity across controllers. An uncertain native
|
|
24
|
+
or CLI dispatch is never replayed. Native transcript files remain read-only.
|
|
25
|
+
|
|
26
|
+
The public `presentation/index.ts` boundary extracts human answers for run journals
|
|
27
|
+
and Task progress before truncation. Unknown or truncated question envelopes
|
|
28
|
+
show a neutral reply label; ordinary messages and quoted examples stay intact.
|
|
23
29
|
|
|
24
30
|
Tests under `tests/` cover publication, reconnect replay, native acknowledgement,
|
|
25
31
|
scope rejection, expiry and delivery through an isolated native IPC fixture.
|
|
@@ -108,7 +108,7 @@ export async function handleCodexQuestionReply(client: RelayClient, message: Use
|
|
|
108
108
|
return deliver(client, { ...message, requestId: undefined,
|
|
109
109
|
messageId: message.messageId ?? 'codex-answer-' + record.requestId,
|
|
110
110
|
text: nativeAnswerEnvelope(record, message.text) }, publish, peerPublicKey,
|
|
111
|
-
{ messageId: record.requestId,
|
|
111
|
+
{ messageId: record.requestId, questionReply: true });
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
function resolveQuestion(client: RelayClient, record: QuestionRecord, peerPublicKey?: string, expired = false) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Question answer presentation
|
|
2
|
+
|
|
3
|
+
Public entry: `questionAnswerPresentation` in `index.ts`. Run journals and Task
|
|
4
|
+
progress show human answers before storage limits truncate them. Presentation
|
|
5
|
+
does not alter the native envelope used for delivery or transcript confirmation.
|
|
6
|
+
Malformed or truncated envelopes use a neutral label. Tests cover normal text,
|
|
7
|
+
quoted examples, multiple answers, document staging notes, and invalid envelopes.
|
|
8
|
+
|
|
9
|
+
License: [GrantTap Commercial Source License](../../../../../LICENSE).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { stripAttachmentNote } from '../../sessions/support/activity-helpers';
|
|
2
|
+
|
|
3
|
+
/** Public presentation boundary; never changes the original native delivery payload. */
|
|
4
|
+
export function questionAnswerPresentation(text: string): string {
|
|
5
|
+
const opening = '<send_user_message_question_reply>';
|
|
6
|
+
const closing = '</send_user_message_question_reply>';
|
|
7
|
+
const wrapped = text.trim();
|
|
8
|
+
if (!wrapped.startsWith(opening)) return text;
|
|
9
|
+
if (!wrapped.endsWith(closing)) return 'Question reply';
|
|
10
|
+
try {
|
|
11
|
+
const rows = JSON.parse(wrapped.slice(opening.length, -closing.length));
|
|
12
|
+
if (!Array.isArray(rows) || !rows.length || rows.length > 4) return 'Question reply';
|
|
13
|
+
const answers = rows.map(row => {
|
|
14
|
+
const id = JSON.parse(row.questionItemId);
|
|
15
|
+
if (!Array.isArray(id) || id.length !== 3 || id[0] !== 'request_user_input_async'
|
|
16
|
+
|| typeof id[1] !== 'string' || !/^[a-zA-Z0-9_-]{1,180}$/.test(id[1])
|
|
17
|
+
|| !Number.isInteger(id[2]) || id[2] < 0 || id[2] > 3 || typeof row.answer !== 'string') throw Error('Invalid reply');
|
|
18
|
+
return stripAttachmentNote(row.answer).trim();
|
|
19
|
+
});
|
|
20
|
+
return answers.filter(Boolean).join('; ') || 'Question reply';
|
|
21
|
+
} catch { return 'Question reply'; }
|
|
22
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { configDir } from "../../config/runtime/paths";
|
|
15
|
+
import { questionAnswerPresentation } from '../../codex-questions/presentation';
|
|
15
16
|
|
|
16
17
|
export type RunRecord = {
|
|
17
18
|
/** Stable id for this run. Start time is not a confirmation key. */
|
|
@@ -87,7 +88,7 @@ export function recordRun(sessionId: string, record: RunRecord): void {
|
|
|
87
88
|
const bounded: RunRecord = {
|
|
88
89
|
...record,
|
|
89
90
|
runId: record.runId || `run:${record.at}`,
|
|
90
|
-
prompt: compactText(record.prompt, MAX_PROMPT_CHARS),
|
|
91
|
+
prompt: compactText(questionAnswerPresentation(record.prompt), MAX_PROMPT_CHARS),
|
|
91
92
|
outcome: compactText(record.outcome, MAX_OUTCOME_CHARS),
|
|
92
93
|
files: record.files.slice(0, MAX_FILES),
|
|
93
94
|
};
|
|
@@ -141,7 +142,7 @@ export type RunDescriptionLimits = { files?: number; outcome?: number };
|
|
|
141
142
|
/** One line a person or a model can read: what was asked, what happened, what it touched. */
|
|
142
143
|
export function describeRun(record: RunRecord, limits: RunDescriptionLimits = {}): string {
|
|
143
144
|
const outcome = limits.outcome == null ? record.outcome : compactText(record.outcome, limits.outcome);
|
|
144
|
-
const parts = [`«${record.prompt}» → ${record.ok ? "" : "failed: "}${outcome}`];
|
|
145
|
+
const parts = [`«${questionAnswerPresentation(record.prompt)}» → ${record.ok ? "" : "failed: "}${outcome}`];
|
|
145
146
|
const files = limits.files ?? 6;
|
|
146
147
|
if (record.files.length > 0 && files > 0) {
|
|
147
148
|
const shown = record.files.slice(0, files).join(", ");
|
|
@@ -123,7 +123,7 @@ export async function handleUserMessage(
|
|
|
123
123
|
message: UserMessage,
|
|
124
124
|
onProcessing?: () => Promise<void>,
|
|
125
125
|
peerPublicKey?: string,
|
|
126
|
-
native?: { messageId: string;
|
|
126
|
+
native?: { messageId: string; questionReply: true },
|
|
127
127
|
onRefusal?: (error: string) => Promise<void>,
|
|
128
128
|
): Promise<"accepted" | "rejected"> {
|
|
129
129
|
const say = (text: string, sessionId?: string, wake = false, kind: "status" | "response" = "response") => {
|
|
@@ -176,7 +176,7 @@ export async function handleUserMessage(
|
|
|
176
176
|
const startedAt = Date.now();
|
|
177
177
|
const run = deliverToSession(target, message.text, PHONE_RUN_LIMIT_MS, attachments, {
|
|
178
178
|
messageId: native?.messageId ?? message.messageId,
|
|
179
|
-
|
|
179
|
+
questionReply: native?.questionReply,
|
|
180
180
|
onAgentActivity: () => reportMessageAgentActivity(client, message, peerPublicKey),
|
|
181
181
|
preferredMcp: message.preferredMcp,
|
|
182
182
|
skill: message.skill,
|
|
@@ -11,7 +11,7 @@ export async function handleInboundUserMessage(
|
|
|
11
11
|
client: RelayClient, payload: Extract<Payload, { type: "user.message" }>,
|
|
12
12
|
publish: (forceHistory?: boolean) => Promise<void>,
|
|
13
13
|
peerPublicKey?: string,
|
|
14
|
-
native?: { messageId: string;
|
|
14
|
+
native?: { messageId: string; questionReply: true },
|
|
15
15
|
): Promise<boolean> {
|
|
16
16
|
if (payload.requestId) return false;
|
|
17
17
|
let deliveryStarted = false;
|
|
@@ -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' &&
|
|
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
|
|
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;
|
|
@@ -9,6 +9,8 @@ export type DeliveryOptions = {
|
|
|
9
9
|
messageId?: string;
|
|
10
10
|
/** Native host questions must never fall back to a second CLI conversation. */
|
|
11
11
|
nativeOnly?: boolean;
|
|
12
|
+
/** Correlated question answer; use serialized resume only when no desktop owner exists. */
|
|
13
|
+
questionReply?: boolean;
|
|
12
14
|
/** Computer-generated identity before temporary attachment paths are inserted. */
|
|
13
15
|
intentDigest?: string;
|
|
14
16
|
preferredMcp?: string;
|
|
@@ -4,7 +4,7 @@ import { resolveCodexBinary } from "../../providers/codex-bin";
|
|
|
4
4
|
import { runProcess } from ".";
|
|
5
5
|
import { providerEffortArgs } from "./provider-effort";
|
|
6
6
|
import type { DeliveryOptions, ReplyResult } from "../payload/types";
|
|
7
|
-
import { deliverToCodexDesktop } from '../../codex-desktop';
|
|
7
|
+
import { continueCodexQuestion, deliverToCodexDesktop, nativeQuestionAttachmentEnvelope } from '../../codex-desktop';
|
|
8
8
|
|
|
9
9
|
function parseCodexJsonl(stdout: string, fallbackSessionId?: string): ReplyResult {
|
|
10
10
|
let lastMessage = "";
|
|
@@ -55,6 +55,13 @@ export async function runCodex(
|
|
|
55
55
|
const native = await deliverToCodexDesktop({ session, text, images, options, timeoutMs });
|
|
56
56
|
if (native) return native;
|
|
57
57
|
if (options.nativeOnly) return { ok: false, error: 'Open this conversation in Codex to answer its question.' };
|
|
58
|
+
if (options.questionReply) return continueCodexQuestion(session.sessionId, options,
|
|
59
|
+
() => resumeCodex(session, nativeQuestionAttachmentEnvelope(text), timeoutMs, images, options));
|
|
60
|
+
return resumeCodex(session, text, timeoutMs, images, options);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function resumeCodex(session: SessionInfo, text: string, timeoutMs: number,
|
|
64
|
+
images: string[], options: DeliveryOptions): Promise<ReplyResult> {
|
|
58
65
|
const configured = loadRuntimeConfig().sessionAccess[session.sessionId];
|
|
59
66
|
const disabledMcp = loadRuntimeConfig().sessionMcpDisabled[session.sessionId] ?? [];
|
|
60
67
|
const sandbox = configured === "read-only"
|
|
@@ -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 =
|
|
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 =
|
|
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;
|
package/cursor-plugin/README.md
CHANGED
|
@@ -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.
|
|
13
|
+
npm install -g granttap-mcp@0.8.158
|
|
14
14
|
granttap setup
|
|
15
15
|
granttap status
|
|
16
16
|
```
|
package/cursor-plugin/mcp.json
CHANGED
|
@@ -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.
|
|
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.158\";\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.
|
|
10
|
+
const PACKAGE = "granttap-mcp@0.8.158";
|
|
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.
|
|
3
|
+
"version": "0.8.158",
|
|
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
|
}
|