granttap-mcp 0.8.22 → 0.8.24
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/README.md +5 -0
- package/apps/bridge/src/bin/cli/connect.ts +2 -1
- package/apps/bridge/src/bin/cli/phone.ts +54 -0
- package/apps/bridge/src/sessions/cursor/scan.ts +6 -0
- package/apps/bridge/src/sessions/cursor/transcripts.ts +6 -0
- package/apps/bridge/src/sessions/scan/claude/parse.ts +15 -1
- package/apps/bridge/src/sessions/scan/codex/parse.ts +12 -1
- package/apps/bridge/src/sessions/scan/grok.ts +10 -2
- package/apps/mcp/src/connection-center/bridge.js +7 -0
- package/apps/mcp/src/connection-center/widget.html +1 -1
- package/apps/mcp/src/mcp-tools/connect/widget.ts +1 -1
- package/bin/granttap-mcp.mjs +6 -2
- package/cursor-plugin/.cursor-plugin/plugin.json +2 -2
- package/cursor-plugin/README.md +7 -4
- package/cursor-plugin/commands/connect.md +4 -3
- package/cursor-plugin/mcp.json +1 -1
- package/cursor-plugin/skills/connect/SKILL.md +8 -7
- package/cursor-plugin/stdio-bootstrap.cjs +1 -1
- package/package.json +1 -1
- package/packages/protocol/messages/sessions/index.ts +2 -0
package/README.md
CHANGED
|
@@ -43,6 +43,11 @@ hosted service is governed by its own terms.
|
|
|
43
43
|
GrantTap reports the depth each provider actually exposes. Visibility does not
|
|
44
44
|
imply deterministic remote blocking or full mobile continuation.
|
|
45
45
|
|
|
46
|
+
Session catalogs report `lastMessageAt` only when a provider transcript has a
|
|
47
|
+
timestamped user or assistant message. `lastActivityAt` remains the separate
|
|
48
|
+
runtime activity timestamp and can include metadata or file updates. Clients
|
|
49
|
+
label that fallback as activity rather than presenting it as a message time.
|
|
50
|
+
|
|
46
51
|
## Project Mesh and task handoff
|
|
47
52
|
|
|
48
53
|
Project Mesh adds stable Project and Task identity above provider-native
|
|
@@ -28,7 +28,8 @@ async function connect(relayUrl: string): Promise<void> {
|
|
|
28
28
|
"Background helper Run granttap setup to verify",
|
|
29
29
|
"",
|
|
30
30
|
"Existing pairing reused. No QR or key rotation was needed.",
|
|
31
|
-
"
|
|
31
|
+
"To link another iPhone or iPad, open the GrantTap connection card in your coding app and choose Add another device.",
|
|
32
|
+
"To repair the same phone, choose Reconnect in that card. Do not reset the computer pairing for either action.",
|
|
32
33
|
"",
|
|
33
34
|
].join("\n"));
|
|
34
35
|
return;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import QRCode from "qrcode";
|
|
2
|
+
import { loadConfig } from "../../config";
|
|
3
|
+
import { reloadPairingHelper } from "../../install";
|
|
4
|
+
import { createOneTimePairing, DEFAULT_RELAY, PAIRING_CODE_TTL_MINUTES } from "../../pairing";
|
|
5
|
+
import { isMachineConfigured, readOnlyMachineConfigPath } from "../../../../mcp/src/status/pairing-status";
|
|
6
|
+
import { installHttpMcpService } from "../../../../mcp/src/http-service";
|
|
7
|
+
|
|
8
|
+
const mode = process.argv[2];
|
|
9
|
+
|
|
10
|
+
async function main(): Promise<void> {
|
|
11
|
+
if (mode !== "add" && mode !== "reconnect") {
|
|
12
|
+
process.stderr.write("Usage: granttap phone add|reconnect\n");
|
|
13
|
+
process.exitCode = 1;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!process.stdout.isTTY) {
|
|
17
|
+
process.stderr.write("Open an interactive terminal and run this command yourself; the private pairing QR is never written to agent logs.\n");
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const paired = isMachineConfigured();
|
|
22
|
+
if (!paired && mode === "reconnect") {
|
|
23
|
+
process.stderr.write("This computer has no saved pairing. Run granttap phone add instead.\n");
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const relay = paired ? loadConfig(readOnlyMachineConfigPath()).relayUrl : DEFAULT_RELAY;
|
|
28
|
+
const result = await createOneTimePairing(relay, {
|
|
29
|
+
addController: paired && mode === "add",
|
|
30
|
+
installHooks: false,
|
|
31
|
+
});
|
|
32
|
+
const helper = reloadPairingHelper({ firstPairing: !paired });
|
|
33
|
+
const mcp = installHttpMcpService({ forceReload: true });
|
|
34
|
+
const qr = await QRCode.toString(result.qrPayload, {
|
|
35
|
+
type: "terminal", small: true, errorCorrectionLevel: "L",
|
|
36
|
+
});
|
|
37
|
+
process.stdout.write([
|
|
38
|
+
"",
|
|
39
|
+
mode === "add" ? "Add a controller iPhone or iPad" : "Reconnect the same controller phone",
|
|
40
|
+
"Open GrantTap on the phone → Settings → Connections → Add a device (Scan QR).",
|
|
41
|
+
"",
|
|
42
|
+
qr,
|
|
43
|
+
"",
|
|
44
|
+
`The QR expires in ${PAIRING_CODE_TTL_MINUTES} minutes. Never paste it into chat.`,
|
|
45
|
+
...(helper?.status === "manual" || mcp.status === "manual"
|
|
46
|
+
? ["Background connection needs attention. Run granttap setup after scanning."] : []),
|
|
47
|
+
"",
|
|
48
|
+
].join("\n"));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
void main().catch((error: unknown) => {
|
|
52
|
+
process.stderr.write(`GrantTap could not issue a phone QR: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
53
|
+
process.exitCode = 1;
|
|
54
|
+
});
|
|
@@ -137,6 +137,8 @@ function addComposerSession(context: ScanContext, composer: ComposerRow): void {
|
|
|
137
137
|
sessionId: composer.id, files, cwd: composer.cwd, composers: context.composers, descendants,
|
|
138
138
|
});
|
|
139
139
|
const childLast = child.children.reduce((latest, item) => Math.max(latest, item.lastActivityAt), 0);
|
|
140
|
+
const lastMessageAt = Math.max(root.lastMessageAt ?? 0,
|
|
141
|
+
...child.summaries.map((item) => item.lastMessageAt ?? 0));
|
|
140
142
|
const lastActivityAt = Math.max(
|
|
141
143
|
composerActivityAt(composer), root.lastActivityAt, childLast,
|
|
142
144
|
);
|
|
@@ -153,6 +155,7 @@ function addComposerSession(context: ScanContext, composer: ComposerRow): void {
|
|
|
153
155
|
root.startedAt || lastActivityAt || context.now,
|
|
154
156
|
),
|
|
155
157
|
lastActivityAt: lastActivityAt || composer.createdAt,
|
|
158
|
+
...(lastMessageAt ? { lastMessageAt } : {}),
|
|
156
159
|
tokensSession,
|
|
157
160
|
tokensLastTurn: root.files.length ? root.tokensLastTurn : 0,
|
|
158
161
|
contextTokensUsed: composer.contextTokensUsed ?? root.contextTokensUsed ?? tokensSession,
|
|
@@ -175,6 +178,8 @@ function addOrphanSession(context: ScanContext, file: CursorLogFile): void {
|
|
|
175
178
|
const root = transcriptSummary(sessionId, files.filter((item) => !item.isSubagent), sessionId, cwd);
|
|
176
179
|
const child = childSummaries({ sessionId, files, cwd, composers: context.composers });
|
|
177
180
|
const childLast = child.children.reduce((latest, item) => Math.max(latest, item.lastActivityAt), 0);
|
|
181
|
+
const lastMessageAt = Math.max(root.lastMessageAt ?? 0,
|
|
182
|
+
...child.summaries.map((item) => item.lastMessageAt ?? 0));
|
|
178
183
|
const lastActivityAt = Math.max(file.mtimeMs, root.lastActivityAt, childLast);
|
|
179
184
|
const title = childTitle(context.sidebar.get(sessionId) || root.titleFromUser);
|
|
180
185
|
const session = aggregateChildThreads({
|
|
@@ -185,6 +190,7 @@ function addOrphanSession(context: ScanContext, file: CursorLogFile): void {
|
|
|
185
190
|
state: stateFor(lastActivityAt),
|
|
186
191
|
startedAt: Math.min(file.birthtimeMs || lastActivityAt, root.startedAt || lastActivityAt),
|
|
187
192
|
lastActivityAt,
|
|
193
|
+
...(lastMessageAt ? { lastMessageAt } : {}),
|
|
188
194
|
tokensSession: root.tokensSession,
|
|
189
195
|
tokensLastTurn: root.tokensLastTurn,
|
|
190
196
|
contextTokensUsed: root.contextTokensUsed,
|
|
@@ -25,6 +25,7 @@ export type CursorLogFile = {
|
|
|
25
25
|
|
|
26
26
|
export type CursorTranscriptSummary = {
|
|
27
27
|
lastActivityAt: number;
|
|
28
|
+
lastMessageAt?: number;
|
|
28
29
|
startedAt: number;
|
|
29
30
|
files: string[];
|
|
30
31
|
model?: string;
|
|
@@ -196,6 +197,11 @@ function summarizeFile(
|
|
|
196
197
|
const item = safeParse(line);
|
|
197
198
|
if (!item) continue;
|
|
198
199
|
observeBlocks({ item, file, lineIndex, rootSessionId, cwd, acc });
|
|
200
|
+
if (["user", "assistant"].includes(item.role)
|
|
201
|
+
&& textBlocks(item.message?.content).some((text) => !!text.trim())) {
|
|
202
|
+
const at = ts(item.timestamp ?? item.message?.timestamp);
|
|
203
|
+
if (at) acc.lastMessageAt = Math.max(acc.lastMessageAt ?? 0, at);
|
|
204
|
+
}
|
|
199
205
|
if (!file.isSubagent) {
|
|
200
206
|
if (!acc.titleFromUser && item.role === "user") {
|
|
201
207
|
acc.titleFromUser = titleFrom(textBlocks(item.message?.content).join("\n"));
|
|
@@ -24,6 +24,7 @@ type ClaudeParseState = {
|
|
|
24
24
|
summary?: string;
|
|
25
25
|
startedAt: number;
|
|
26
26
|
lastActivityAt: number;
|
|
27
|
+
lastMessageAt: number;
|
|
27
28
|
tokensSession: number;
|
|
28
29
|
tokensLastTurn: number;
|
|
29
30
|
contextTokensUsed?: number;
|
|
@@ -53,6 +54,15 @@ function applyClaudeLine(d: any, state: ClaudeParseState): void {
|
|
|
53
54
|
if (t) {
|
|
54
55
|
if (!state.startedAt || t < state.startedAt) state.startedAt = t;
|
|
55
56
|
if (t > state.lastActivityAt) state.lastActivityAt = t;
|
|
57
|
+
const role = d.message?.role ?? d.type;
|
|
58
|
+
const content = d.message?.content ?? d.content;
|
|
59
|
+
const visible = typeof content === "string" ? content.trim().length > 0
|
|
60
|
+
: Array.isArray(content) && content.some((block: any) =>
|
|
61
|
+
["text", "image", "image_url", "input_image"].includes(block?.type)
|
|
62
|
+
&& (block.type !== "text" || typeof block.text === "string" && !!block.text.trim()));
|
|
63
|
+
if (["user", "assistant"].includes(role) && visible) {
|
|
64
|
+
state.lastMessageAt = Math.max(state.lastMessageAt, t);
|
|
65
|
+
}
|
|
56
66
|
}
|
|
57
67
|
const usage = d?.message?.usage;
|
|
58
68
|
if (usage) {
|
|
@@ -117,7 +127,10 @@ export function parseClaudeFile(file: string): {
|
|
|
117
127
|
return undefined;
|
|
118
128
|
}
|
|
119
129
|
const lines = text.split("\n");
|
|
120
|
-
const state: ClaudeParseState = {
|
|
130
|
+
const state: ClaudeParseState = {
|
|
131
|
+
sessionId: "", startedAt: 0, lastActivityAt: 0, lastMessageAt: 0,
|
|
132
|
+
tokensSession: 0, tokensLastTurn: 0,
|
|
133
|
+
};
|
|
121
134
|
for (const line of lines) {
|
|
122
135
|
if (!line) continue;
|
|
123
136
|
const d = safeParse(line);
|
|
@@ -135,6 +148,7 @@ export function parseClaudeFile(file: string): {
|
|
|
135
148
|
state: stateFor(state.lastActivityAt),
|
|
136
149
|
startedAt: state.startedAt || state.lastActivityAt,
|
|
137
150
|
lastActivityAt: state.lastActivityAt,
|
|
151
|
+
...(state.lastMessageAt ? { lastMessageAt: state.lastMessageAt } : {}),
|
|
138
152
|
tokensSession: state.tokensSession,
|
|
139
153
|
tokensLastTurn: state.tokensLastTurn,
|
|
140
154
|
contextTokensUsed: state.contextTokensUsed,
|
|
@@ -27,6 +27,7 @@ type CodexParseState = {
|
|
|
27
27
|
child?: CodexChildSource;
|
|
28
28
|
startedAt: number;
|
|
29
29
|
lastActivityAt: number;
|
|
30
|
+
lastMessageAt: number;
|
|
30
31
|
tokensSession: number;
|
|
31
32
|
tokensLastTurn: number;
|
|
32
33
|
contextTokensUsed?: number;
|
|
@@ -40,6 +41,15 @@ function applyCodexLine(d: any, state: CodexParseState): void {
|
|
|
40
41
|
if (t) {
|
|
41
42
|
if (!state.startedAt || t < state.startedAt) state.startedAt = t;
|
|
42
43
|
if (t > state.lastActivityAt) state.lastActivityAt = t;
|
|
44
|
+
const eventMessage = d.type === "event_msg"
|
|
45
|
+
&& ["user_message", "agent_message"].includes(d.payload?.type);
|
|
46
|
+
const responseMessage = d.type === "response_item"
|
|
47
|
+
&& d.payload?.type === "message"
|
|
48
|
+
&& ["user", "assistant"].includes(d.payload?.role)
|
|
49
|
+
&& Array.isArray(d.payload?.content) && d.payload.content.length > 0;
|
|
50
|
+
if (eventMessage || responseMessage) {
|
|
51
|
+
state.lastMessageAt = Math.max(state.lastMessageAt, t);
|
|
52
|
+
}
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
if (d.type === "session_meta") {
|
|
@@ -130,7 +140,7 @@ export function parseCodexFile(file: string): CodexCandidate | undefined {
|
|
|
130
140
|
return undefined;
|
|
131
141
|
}
|
|
132
142
|
const state: CodexParseState = {
|
|
133
|
-
sessionId: "", startedAt: 0, lastActivityAt: 0,
|
|
143
|
+
sessionId: "", startedAt: 0, lastActivityAt: 0, lastMessageAt: 0,
|
|
134
144
|
tokensSession: 0, tokensLastTurn: 0, workdirs: [],
|
|
135
145
|
};
|
|
136
146
|
for (const line of lines) {
|
|
@@ -155,6 +165,7 @@ export function parseCodexFile(file: string): CodexCandidate | undefined {
|
|
|
155
165
|
state: stateFor(state.lastActivityAt),
|
|
156
166
|
startedAt: state.startedAt || state.lastActivityAt,
|
|
157
167
|
lastActivityAt: state.lastActivityAt,
|
|
168
|
+
...(state.lastMessageAt ? { lastMessageAt: state.lastMessageAt } : {}),
|
|
158
169
|
tokensSession: state.tokensSession,
|
|
159
170
|
tokensLastTurn: state.tokensLastTurn,
|
|
160
171
|
contextTokensUsed: state.contextTokensUsed,
|
|
@@ -32,6 +32,7 @@ type ParsedLog = {
|
|
|
32
32
|
entries: ActivityEntry[];
|
|
33
33
|
usage: CapabilityObservation[];
|
|
34
34
|
firstUser?: string;
|
|
35
|
+
lastMessageAt?: number;
|
|
35
36
|
tokens: number;
|
|
36
37
|
lastTurn: number;
|
|
37
38
|
};
|
|
@@ -78,6 +79,7 @@ function parseLog(path: string, sessionId: string, fallbackTime: number): Parsed
|
|
|
78
79
|
const usage: CapabilityObservation[] = [];
|
|
79
80
|
const seen = new Set<string>();
|
|
80
81
|
let firstUser: string | undefined;
|
|
82
|
+
let lastMessageAt = 0;
|
|
81
83
|
let tokens = 0;
|
|
82
84
|
let lastTurn = 0;
|
|
83
85
|
lines.forEach((line, index) => {
|
|
@@ -86,11 +88,13 @@ function parseLog(path: string, sessionId: string, fallbackTime: number): Parsed
|
|
|
86
88
|
const message = row.message && typeof row.message === "object" ? row.message : row;
|
|
87
89
|
const role = String(message.role ?? row.role ?? "");
|
|
88
90
|
if (role === "reasoning" || role === "system") return;
|
|
89
|
-
const
|
|
91
|
+
const messageAt = ts(row.timestamp ?? message.timestamp);
|
|
92
|
+
const createdAt = messageAt || fallbackTime + index;
|
|
90
93
|
const texts = textBlocks(message.content);
|
|
91
94
|
if (role === "user") {
|
|
92
95
|
const text = texts.join("\n").trim();
|
|
93
96
|
if (text) {
|
|
97
|
+
if (messageAt) lastMessageAt = Math.max(lastMessageAt, messageAt);
|
|
94
98
|
firstUser ??= text;
|
|
95
99
|
pushEntry({ out: entries, seen: seen, sessionId: sessionId, kind: "user", text: text, createdAt: createdAt, ordinal: index });
|
|
96
100
|
tokens += estimateTokens(text);
|
|
@@ -103,6 +107,9 @@ function parseLog(path: string, sessionId: string, fallbackTime: number): Parsed
|
|
|
103
107
|
pushEntry({ out: entries, seen: seen, sessionId: sessionId, kind: "message", text: text, createdAt: createdAt, ordinal: index * 100 + block });
|
|
104
108
|
turnTokens += estimateTokens(text);
|
|
105
109
|
});
|
|
110
|
+
if (texts.some((text) => !!text.trim()) && messageAt) {
|
|
111
|
+
lastMessageAt = Math.max(lastMessageAt, messageAt);
|
|
112
|
+
}
|
|
106
113
|
const blocks = Array.isArray(message.content) ? message.content : [];
|
|
107
114
|
blocks.forEach((block: Record<string, unknown>, blockIndex: number) => {
|
|
108
115
|
if (block?.type !== "tool_use") return;
|
|
@@ -122,7 +129,7 @@ function parseLog(path: string, sessionId: string, fallbackTime: number): Parsed
|
|
|
122
129
|
tokens += turnTokens;
|
|
123
130
|
if (turnTokens > 0) lastTurn = turnTokens;
|
|
124
131
|
});
|
|
125
|
-
return { entries, usage, firstUser, tokens, lastTurn };
|
|
132
|
+
return { entries, usage, firstUser, lastMessageAt: lastMessageAt || undefined, tokens, lastTurn };
|
|
126
133
|
}
|
|
127
134
|
|
|
128
135
|
function parseSummary(path: string): Summary | null {
|
|
@@ -156,6 +163,7 @@ export function scanGrok(maxFiles = MAX_FILES): Scan {
|
|
|
156
163
|
sessionId, agent: "grok", title: title?.trim().slice(0, 120), cwd,
|
|
157
164
|
model: typeof summary.current_model_id === "string" ? summary.current_model_id : undefined,
|
|
158
165
|
state: stateFor(updatedAt), startedAt, lastActivityAt: updatedAt,
|
|
166
|
+
...(parsed.lastMessageAt ? { lastMessageAt: parsed.lastMessageAt } : {}),
|
|
159
167
|
tokensSession: parsed.tokens, tokensLastTurn: parsed.lastTurn,
|
|
160
168
|
contextTokensUsed: parsed.tokens,
|
|
161
169
|
});
|
|
@@ -43,6 +43,13 @@ async function initializeBridge() {
|
|
|
43
43
|
});
|
|
44
44
|
if (initialized?.protocolVersion !== "2026-01-26") throw new Error("Unsupported UI protocol");
|
|
45
45
|
post({ method: "ui/notifications/initialized" });
|
|
46
|
+
// The compatibility API is an explicit tool-call capability. In Codex it
|
|
47
|
+
// avoids an iframe proxy that can initialize but time out on tools/call.
|
|
48
|
+
legacyBridge = typeof window.openai?.callTool === "function";
|
|
49
|
+
if (!legacyBridge && !initialized.hostCapabilities?.serverTools) {
|
|
50
|
+
message("This host cannot call GrantTap tools from the card. Ask the agent to open connection status or add a device.");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
46
53
|
bridgeReady = true;
|
|
47
54
|
} catch {
|
|
48
55
|
if (!window.openai?.callTool) {
|
|
@@ -38,7 +38,7 @@ details{border-top:1px solid #8884;padding-top:14px}summary{cursor:pointer;font-
|
|
|
38
38
|
<h3>Provider readiness</h3><ul id="providers"></ul>
|
|
39
39
|
<p>No GrantTap account or password is required. Pair using GrantTap on iPhone → Settings → Connections.
|
|
40
40
|
Provider sign-in is separate.</p>
|
|
41
|
-
<p>Missing hooks or background sync? Run <code>npm install -g granttap-mcp@0.8.
|
|
41
|
+
<p>Missing hooks or background sync? Run <code>npm install -g granttap-mcp@0.8.23</code> and <code>granttap setup</code> locally.
|
|
42
42
|
A saved pairing alone does not prove your phone or the background helper is online.</p>
|
|
43
43
|
<p><a href="https://granttap.com" target="_blank" rel="noopener noreferrer">Website</a> ·
|
|
44
44
|
<a href="https://granttap.com/privacy" target="_blank" rel="noopener noreferrer">Privacy</a> ·
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
|
|
3
|
-
export const CONNECTION_WIDGET_URI = "ui://granttap/connection/
|
|
3
|
+
export const CONNECTION_WIDGET_URI = "ui://granttap/connection/v3.html";
|
|
4
4
|
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
|
package/bin/granttap-mcp.mjs
CHANGED
|
@@ -16,6 +16,8 @@ const usage = [
|
|
|
16
16
|
" granttap setup Detect agents and install or repair GrantTap",
|
|
17
17
|
" granttap status [--json] Show pairing, helper, and provider readiness",
|
|
18
18
|
" granttap connect [--relay <url>] Pair this computer with iPhone/Apple Watch",
|
|
19
|
+
" granttap phone add Show a QR for another controller phone",
|
|
20
|
+
" granttap phone reconnect Show a QR to restore the same phone",
|
|
19
21
|
" granttap reset [--yes] Reset this computer's phone pairing",
|
|
20
22
|
" granttap mesh connect <invite> Redeem a one-time Grok Bot Mesh invite",
|
|
21
23
|
" granttap restrictions check [dir] Check files against Mesh / .granttap restrictions",
|
|
@@ -36,6 +38,8 @@ if (command === "mcp") {
|
|
|
36
38
|
entry = join(root, "apps", "bridge", "src", "bin", "cli", "setup.ts");
|
|
37
39
|
} else if (command === "connect") {
|
|
38
40
|
entry = join(root, "apps", "bridge", "src", "bin", "cli", "connect.ts");
|
|
41
|
+
} else if (command === "phone" && ["add", "reconnect"].includes(argument)) {
|
|
42
|
+
entry = join(root, "apps", "bridge", "src", "bin", "cli", "phone.ts");
|
|
39
43
|
} else if (command === "status") {
|
|
40
44
|
entry = join(root, "apps", "mcp", "src", "bin", "status.ts");
|
|
41
45
|
} else if (command === "reset") {
|
|
@@ -100,8 +104,8 @@ if (!preflight || !loader) {
|
|
|
100
104
|
process.exit(1);
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
const forwardedArgs = ["connect", "status", "reset", "mesh", "setup", "restrictions"].includes(command)
|
|
104
|
-
? (command === "mesh" || command === "restrictions" ? commandArgs.slice(1) : commandArgs)
|
|
107
|
+
const forwardedArgs = ["connect", "status", "reset", "mesh", "setup", "restrictions", "phone"].includes(command)
|
|
108
|
+
? (command === "mesh" || command === "restrictions" || command === "phone" ? commandArgs.slice(1) : commandArgs)
|
|
105
109
|
: [];
|
|
106
110
|
const child = spawn(
|
|
107
111
|
process.execPath,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "granttap",
|
|
3
3
|
"displayName": "GrantTap",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.1.17",
|
|
5
|
+
"description": "GrantTap pairs this computer with iPhone. The connection card shows a one-time QR when Cursor supports interactive MCP Apps; an interactive terminal command is available if it does not. The website approves the coding app.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "GrantTap",
|
|
8
8
|
"email": "support@granttap.com",
|
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.24
|
|
14
14
|
granttap setup
|
|
15
15
|
granttap status
|
|
16
16
|
```
|
|
@@ -22,9 +22,12 @@ The commands have separate jobs:
|
|
|
22
22
|
2. `granttap setup` also installs the background task-sync helper.
|
|
23
23
|
3. `granttap status` performs a read-only readiness check.
|
|
24
24
|
|
|
25
|
-
After `granttap setup`,
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
After `granttap setup`, open the GrantTap connection card in Cursor for **Add a
|
|
26
|
+
device**, **Add another device**, or **Reconnect**. Scan its QR in the phone
|
|
27
|
+
app. If Cursor does not render or operate the card, run `granttap phone add`
|
|
28
|
+
in your own interactive terminal; it never prints the QR to an agent log.
|
|
29
|
+
`granttap.com/connect` approves the coding app and shows phone observations.
|
|
30
|
+
Cloud **Error · fetch
|
|
28
31
|
failed** is a leftover HTTP MCP at `http://127.0.0.1:17342/mcp` — either a
|
|
29
32
|
user Customize → MCPs row or an old plugin `mcp.json`. The current plugin is
|
|
30
33
|
stdio (`node -e`) so Cloud never fetches loopback.
|
|
@@ -7,6 +7,7 @@ Call GrantTap tools yourself. Do not ask the person to pair in this chat.
|
|
|
7
7
|
1. Call `connection_status`.
|
|
8
8
|
2. If this computer is not paired, call `connect`.
|
|
9
9
|
3. Do not print a pairing URI, token, or QR in chat.
|
|
10
|
-
4.
|
|
11
|
-
granttap.com/connect
|
|
12
|
-
app
|
|
10
|
+
4. The GrantTap connection card shows the device list and one-time QR when
|
|
11
|
+
Cursor supports interactive MCP Apps. `granttap.com/connect` approves the
|
|
12
|
+
coding app but does not display a pairing QR. If the card cannot call tools,
|
|
13
|
+
tell the person to run `granttap phone add` in their own terminal.
|
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.24\";\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
|
}
|
|
@@ -12,19 +12,20 @@ The person does not pair in chat. You connect this computer by calling tools.
|
|
|
12
12
|
1. Call `connection_status`.
|
|
13
13
|
2. If this computer is not paired, call `connect`.
|
|
14
14
|
3. Never print a pairing URI, manual token, or QR in chat.
|
|
15
|
-
4. Never
|
|
16
|
-
|
|
15
|
+
4. Never put a private pairing QR in this conversation. If the host cannot
|
|
16
|
+
call tools from the connection card, explain the local interactive-terminal
|
|
17
|
+
fallback: `granttap phone add` or `granttap phone reconnect`.
|
|
17
18
|
|
|
18
19
|
A saved pairing is reused. Do not call `reconnect` unless they confirmed
|
|
19
20
|
Add another device or Reconnect in plugin settings.
|
|
20
21
|
|
|
21
22
|
## Settings (the person)
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
computer.
|
|
24
|
+
The GrantTap connection card in this host shows the device list and one-time
|
|
25
|
+
QR under Add a device, Add another device, or Reconnect when the host supports
|
|
26
|
+
interactive MCP Apps. GrantTap on iPhone scans it in Settings → Connections.
|
|
27
|
+
granttap.com/connect handles coding-app approval and phone observations, but
|
|
28
|
+
does not display a pairing QR. All coding apps on this computer share one room.
|
|
28
29
|
|
|
29
30
|
For an interactive question, send the same complete prompt to Cursor and
|
|
30
31
|
GrantTap under one exact correlation. The first answer with that correlation
|
|
@@ -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.24";
|
|
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
|
@@ -74,6 +74,8 @@ export const SessionInfo = z.object({
|
|
|
74
74
|
state: SessionState,
|
|
75
75
|
startedAt: z.number(),
|
|
76
76
|
lastActivityAt: z.number(),
|
|
77
|
+
/** Timestamp of a visible user or assistant message; absent when no message timestamp is known. */
|
|
78
|
+
lastMessageAt: z.number().optional(),
|
|
77
79
|
tokensSession: z.number(),
|
|
78
80
|
tokensLastTurn: z.number(),
|
|
79
81
|
contextTokensUsed: z.number().optional(),
|