granttap-mcp 0.8.123 → 0.8.125
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-questions/README.md +7 -0
- package/apps/bridge/src/codex-questions/records.ts +20 -6
- package/apps/bridge/src/sessions/catalog.ts +1 -50
- package/apps/bridge/src/sessions/provider-discovery/README.md +13 -0
- package/apps/bridge/src/sessions/provider-discovery/index.ts +67 -0
- package/apps/bridge/src/sessions/scan/codex/README.md +5 -0
- package/apps/bridge/src/sessions/scan/codex/rollout-identity/README.md +16 -0
- package/apps/bridge/src/sessions/scan/codex/rollout-identity/index.ts +36 -0
- package/apps/bridge/src/sessions/scan/codex/shared.ts +9 -15
- 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 +1 -1
|
@@ -43,3 +43,10 @@ Question publication reads the private record collection once per batch, then
|
|
|
43
43
|
validates each matching question freshly before sending. Targeted notification
|
|
44
44
|
replay reads the requested identity directly. This keeps multiple chats from
|
|
45
45
|
repeatedly parsing the same collection.
|
|
46
|
+
|
|
47
|
+
Question polling reuses at most 512 validated, unchanged private records. Inode,
|
|
48
|
+
size and nanosecond modification/change times invalidate an observation;
|
|
49
|
+
`saveQuestion` invalidates it immediately. Reads return detached copies, and
|
|
50
|
+
invalid, replaced or deleted files cannot return an earlier cached question.
|
|
51
|
+
`tests/record-observation.test.ts` covers durable updates, external replacement,
|
|
52
|
+
caller mutation, malformed data, bounded retention and actual file-read counts.
|
|
@@ -11,21 +11,35 @@ const Record = z.object({ requestId: z.string(), sessionId: z.string(), callId:
|
|
|
11
11
|
announced: z.boolean().optional(), answered: z.boolean().optional(), resolvedSent: z.boolean().optional() });
|
|
12
12
|
export type QuestionRecord = z.infer<typeof Record>;
|
|
13
13
|
const directory = () => join(configDir(), 'codex-question-records');
|
|
14
|
+
const observations = new Map<string, { revision: string; record: QuestionRecord }>();
|
|
15
|
+
|
|
16
|
+
function revision(path: string): string {
|
|
17
|
+
const stat = statSync(path, { bigint: true });
|
|
18
|
+
if (!stat.isFile() || stat.size > 16_384n) throw Error('Invalid native question record');
|
|
19
|
+
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(':');
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
export function readQuestion(requestId: string): QuestionRecord | undefined {
|
|
16
23
|
if (!/^codex-question-[a-f0-9]{32}$/.test(requestId)) return undefined;
|
|
24
|
+
const path = join(directory(), requestId + '.json');
|
|
17
25
|
try {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
26
|
+
const before = revision(path), cached = observations.get(path);
|
|
27
|
+
if (cached?.revision === before) return structuredClone(cached.record);
|
|
20
28
|
const record = Record.parse(JSON.parse(readFileSync(path, 'utf8')));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
if (record.requestId !== requestId || questionId(record.sessionId, record.callId, record.index) !== requestId
|
|
30
|
+
|| revision(path) !== before) { observations.delete(path); return undefined; }
|
|
31
|
+
observations.delete(path);
|
|
32
|
+
if (observations.size >= 512) observations.delete(observations.keys().next().value!);
|
|
33
|
+
observations.set(path, { revision: before, record });
|
|
34
|
+
return structuredClone(record);
|
|
35
|
+
} catch { observations.delete(path); return undefined; }
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
export function saveQuestion(record: QuestionRecord): void {
|
|
27
39
|
if (!/^codex-question-[a-f0-9]{32}$/.test(record.requestId)) throw new Error('Invalid native question identity');
|
|
28
|
-
|
|
40
|
+
const path = join(directory(), record.requestId + '.json');
|
|
41
|
+
writePrivateFile(path, JSON.stringify(record));
|
|
42
|
+
observations.delete(path);
|
|
29
43
|
}
|
|
30
44
|
|
|
31
45
|
export function storedQuestions(): QuestionRecord[] {
|
|
@@ -1,61 +1,12 @@
|
|
|
1
1
|
import type { SessionInfo } from "../../../../packages/protocol/schema";
|
|
2
2
|
import { localTaskTransfers, localTransferContinuations } from "../task-transfer";
|
|
3
|
-
import { loadRuntimeConfig } from "../config";
|
|
4
|
-
import { timedProviderScan, timedProviderScanAsync } from "../machine-load/mcp/scan-cost";
|
|
5
|
-
import { scanClaude, scanClaudeCooperatively } from "./scan/claude";
|
|
6
|
-
import { scanCodex, scanCodexCooperatively } from "./scan/codex";
|
|
7
|
-
import { scanCursor } from "./cursor";
|
|
8
|
-
import { scanGrok } from "./scan/grok";
|
|
9
3
|
import { MAX_FILES, MAX_HISTORY, MAX_LIVE, TOKEN_WINDOW_MS } from "./support/common";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
type ProviderScan = ReturnType<typeof scanClaude>;
|
|
4
|
+
import { providerScans, cooperativeProviderScans, type ProviderScan } from "./provider-discovery";
|
|
13
5
|
|
|
14
6
|
function sessionKey(session: SessionInfo): string {
|
|
15
7
|
return `${session.agent}\0${session.sessionId}`;
|
|
16
8
|
}
|
|
17
9
|
|
|
18
|
-
function emptyScan(): ProviderScan {
|
|
19
|
-
return { sessions: [], tokensRecent: 0 };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Explicit provider roots isolate fixtures and diagnostics from real user logs.
|
|
24
|
-
* In normal operation (no overrides) every installed provider is scanned.
|
|
25
|
-
*/
|
|
26
|
-
function providerReaders(maxFiles: number) {
|
|
27
|
-
const enabled = loadRuntimeConfig().providerSettings;
|
|
28
|
-
const explicit = {
|
|
29
|
-
claude: Boolean(process.env.GRANTTAP_CLAUDE_PROJECTS_DIR || process.env.NODVOX_CLAUDE_PROJECTS_DIR),
|
|
30
|
-
codex: Boolean(process.env.GRANTTAP_CODEX_SESSIONS_DIR || process.env.NODVOX_CODEX_SESSIONS_DIR),
|
|
31
|
-
cursor: Boolean(process.env.GRANTTAP_CURSOR_TRANSCRIPTS_DIR || process.env.GRANTTAP_CURSOR_STATE_DB),
|
|
32
|
-
grok: Boolean(process.env.GRANTTAP_GROK_SESSIONS_DIR || process.env.GROK_HOME),
|
|
33
|
-
};
|
|
34
|
-
const isolated = Object.values(explicit).some(Boolean);
|
|
35
|
-
const cooperative = { claude: scanClaudeCooperatively, codex: scanCodexCooperatively,
|
|
36
|
-
cursor: async (limit: number) => scanCursor(limit), grok: async (limit: number) => scanGrok(limit) };
|
|
37
|
-
return Object.entries({ claude: scanClaude, codex: scanCodex, cursor: scanCursor, grok: scanGrok })
|
|
38
|
-
.map(([agent, read]) => {
|
|
39
|
-
const key = agent as keyof typeof explicit;
|
|
40
|
-
return { agent, read: () => read(maxFiles), cooperative: () => cooperative[key](maxFiles),
|
|
41
|
-
enabled: enabled[key] && (!isolated || explicit[key]) };
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function providerScans(maxFiles = MAX_FILES): ProviderScan[] {
|
|
46
|
-
return providerReaders(maxFiles).map(reader => reader.enabled
|
|
47
|
-
? timedProviderScan(reader.agent, reader.read) : emptyScan());
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async function cooperativeProviderScans(maxFiles = MAX_FILES): Promise<ProviderScan[]> {
|
|
51
|
-
const scans: ProviderScan[] = [];
|
|
52
|
-
for (const reader of providerReaders(maxFiles)) {
|
|
53
|
-
await setImmediate();
|
|
54
|
-
scans.push(reader.enabled ? await timedProviderScanAsync(reader.agent, reader.cooperative) : emptyScan());
|
|
55
|
-
}
|
|
56
|
-
return scans;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
10
|
function sortedUniqueSessions(sessions: SessionInfo[]): SessionInfo[] {
|
|
60
11
|
const merged = new Map<string, SessionInfo>();
|
|
61
12
|
for (const session of sessions) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Native provider discovery batch
|
|
2
|
+
|
|
3
|
+
Public entry: `index.ts`. Live catalogs and history share an identical pending
|
|
4
|
+
native provider read on this computer. The read is scoped to provider settings,
|
|
5
|
+
file budget and a digest of the complete process environment. No environment
|
|
6
|
+
values are retained in the key or published. Completion or failure removes the
|
|
7
|
+
pending entry; the next refresh reads current state. Each consumer still applies
|
|
8
|
+
its own current Task-transfer mappings after the native read.
|
|
9
|
+
|
|
10
|
+
`tests/scan-batch.test.ts` witnesses real directory discovery and Git checkout
|
|
11
|
+
verification, both shared concurrent reads and a fresh subsequent scan.
|
|
12
|
+
|
|
13
|
+
Licensed under the GrantTap Commercial Source License. See LICENSE and NOTICE.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { setImmediate } from 'node:timers/promises';
|
|
3
|
+
import { loadRuntimeConfig } from '../../config';
|
|
4
|
+
import { timedProviderScan, timedProviderScanAsync } from '../../machine-load/mcp/scan-cost';
|
|
5
|
+
import { scanClaude, scanClaudeCooperatively } from '../scan/claude';
|
|
6
|
+
import { scanCodex, scanCodexCooperatively } from '../scan/codex';
|
|
7
|
+
import { scanCursor } from '../cursor';
|
|
8
|
+
import { scanGrok } from '../scan/grok';
|
|
9
|
+
import { MAX_FILES } from '../support/common';
|
|
10
|
+
|
|
11
|
+
export type ProviderScan = ReturnType<typeof scanClaude>;
|
|
12
|
+
|
|
13
|
+
function emptyScan(): ProviderScan {
|
|
14
|
+
return { sessions: [], tokensRecent: 0 };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Explicit provider roots isolate fixtures and diagnostics from real user logs.
|
|
19
|
+
* In normal operation (no overrides) every installed provider is scanned.
|
|
20
|
+
*/
|
|
21
|
+
function providerReaders(maxFiles: number) {
|
|
22
|
+
const enabled = loadRuntimeConfig().providerSettings;
|
|
23
|
+
const explicit = {
|
|
24
|
+
claude: Boolean(process.env.GRANTTAP_CLAUDE_PROJECTS_DIR || process.env.NODVOX_CLAUDE_PROJECTS_DIR),
|
|
25
|
+
codex: Boolean(process.env.GRANTTAP_CODEX_SESSIONS_DIR || process.env.NODVOX_CODEX_SESSIONS_DIR),
|
|
26
|
+
cursor: Boolean(process.env.GRANTTAP_CURSOR_TRANSCRIPTS_DIR || process.env.GRANTTAP_CURSOR_STATE_DB),
|
|
27
|
+
grok: Boolean(process.env.GRANTTAP_GROK_SESSIONS_DIR || process.env.GROK_HOME),
|
|
28
|
+
};
|
|
29
|
+
const isolated = Object.values(explicit).some(Boolean);
|
|
30
|
+
const cooperative = { claude: scanClaudeCooperatively, codex: scanCodexCooperatively,
|
|
31
|
+
cursor: async (limit: number) => scanCursor(limit), grok: async (limit: number) => scanGrok(limit) };
|
|
32
|
+
return Object.entries({ claude: scanClaude, codex: scanCodex, cursor: scanCursor, grok: scanGrok })
|
|
33
|
+
.map(([agent, read]) => {
|
|
34
|
+
const key = agent as keyof typeof explicit;
|
|
35
|
+
return { agent, read: () => read(maxFiles), cooperative: () => cooperative[key](maxFiles),
|
|
36
|
+
enabled: enabled[key] && (!isolated || explicit[key]) };
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function providerScans(maxFiles = MAX_FILES): ProviderScan[] {
|
|
41
|
+
return providerReaders(maxFiles).map(reader => reader.enabled
|
|
42
|
+
? timedProviderScan(reader.agent, reader.read) : emptyScan());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const pending = new Map<string, Promise<ProviderScan[]>>();
|
|
46
|
+
|
|
47
|
+
/** Share one native read only while it is running; subsequent refreshes stay fresh. */
|
|
48
|
+
export function cooperativeProviderScans(maxFiles = MAX_FILES): Promise<ProviderScan[]> {
|
|
49
|
+
const readers = providerReaders(maxFiles);
|
|
50
|
+
// Hash the complete process scope rather than retaining environment values.
|
|
51
|
+
const scope = [maxFiles, readers.map(({ agent, enabled }) => [agent, enabled]),
|
|
52
|
+
Object.entries(process.env).sort(([left], [right]) => left.localeCompare(right))];
|
|
53
|
+
const key = createHash('sha256').update(JSON.stringify(scope)).digest('hex');
|
|
54
|
+
const active = pending.get(key);
|
|
55
|
+
if (active) return active;
|
|
56
|
+
const next = (async () => {
|
|
57
|
+
const scans: ProviderScan[] = [];
|
|
58
|
+
for (const reader of readers) {
|
|
59
|
+
await setImmediate();
|
|
60
|
+
scans.push(reader.enabled ? await timedProviderScanAsync(reader.agent, reader.cooperative) : emptyScan());
|
|
61
|
+
}
|
|
62
|
+
return scans;
|
|
63
|
+
})().finally(() => { if (pending.get(key) === next) pending.delete(key); });
|
|
64
|
+
pending.set(key, next);
|
|
65
|
+
return next;
|
|
66
|
+
}
|
|
67
|
+
|
|
@@ -20,3 +20,8 @@ nested conversations through the public catalog and activity readers.
|
|
|
20
20
|
|
|
21
21
|
Tests live in [`tests/`](tests/). The selected-Page regression covers the public
|
|
22
22
|
catalog, cached rescans, live activity, and paginated transcript history.
|
|
23
|
+
|
|
24
|
+
Missing rollout lookups use the bounded [rollout identity index](rollout-identity/README.md).
|
|
25
|
+
They do not read unrelated large activity tails. Unchanged file identities are
|
|
26
|
+
reused; file changes invalidate them, and the selected chat keeps its existing
|
|
27
|
+
activity window. `tests/rollout-lookup-cost.test.ts` measures the actual read budget.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Codex rollout identity lookup
|
|
2
|
+
|
|
3
|
+
Public entry: `index.ts`. Missing native-path lookups inspect the existing bounded
|
|
4
|
+
summary window, not every candidate's 16 MiB activity tail. Only the matching
|
|
5
|
+
rollout is opened with the activity budget. Fork ownership keeps the existing
|
|
6
|
+
`ownCodexLines` boundary. The cache retains at most 256 path/identity signatures,
|
|
7
|
+
never conversation text. Device, inode, size, modification and change times
|
|
8
|
+
invalidate it; a file changed during the metadata read is retried on the next
|
|
9
|
+
lookup. Read failures and deleted paths do not retain an identity.
|
|
10
|
+
|
|
11
|
+
Local tests cover unchanged observations, replacement with preserved timestamps,
|
|
12
|
+
concurrent changes, retry and bounded retention. The Codex public-reader cost
|
|
13
|
+
regression measures bytes actually read from a large foreign rollout, followed
|
|
14
|
+
by a successful full read of that rollout when it is explicitly requested.
|
|
15
|
+
|
|
16
|
+
Licensed under the GrantTap Commercial Source License. See LICENSE and NOTICE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { safeParse } from '../../../support/common';
|
|
3
|
+
|
|
4
|
+
type Identity = { signature: string; sessionId: string };
|
|
5
|
+
|
|
6
|
+
function signature(file: string): string {
|
|
7
|
+
const stat = statSync(file, { bigint: true });
|
|
8
|
+
if (!stat.isFile()) throw Error('A rollout must be a regular file');
|
|
9
|
+
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(':');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Index bounded metadata, never another conversation's large activity window. */
|
|
13
|
+
export function createCodexRolloutIdentityLookup(readMetadata: (file: string) => string[]) {
|
|
14
|
+
const cache = new Map<string, Identity>();
|
|
15
|
+
return (sessionId: string, files: string[]): string | undefined => {
|
|
16
|
+
for (const file of files) {
|
|
17
|
+
try {
|
|
18
|
+
const before = signature(file);
|
|
19
|
+
let identity = cache.get(file);
|
|
20
|
+
if (!identity || identity.signature !== before) {
|
|
21
|
+
const line = readMetadata(file).find(row => safeParse(row)?.type === 'session_meta');
|
|
22
|
+
const meta = line ? safeParse(line) : undefined;
|
|
23
|
+
if (signature(file) !== before) { cache.delete(file); continue; }
|
|
24
|
+
identity = { signature: before, sessionId: String(meta?.payload?.id ?? meta?.id ?? '') };
|
|
25
|
+
cache.delete(file);
|
|
26
|
+
if (cache.size >= 256) cache.delete(cache.keys().next().value!);
|
|
27
|
+
cache.set(file, identity);
|
|
28
|
+
}
|
|
29
|
+
if (identity.sessionId && identity.sessionId === sessionId) return file;
|
|
30
|
+
} catch {
|
|
31
|
+
cache.delete(file);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -3,6 +3,7 @@ import { diffPreviewFromInput, sensitivePath, statsFromInput } from "../../suppo
|
|
|
3
3
|
import { redactSecrets } from "../../telemetry/command-preview";
|
|
4
4
|
import { recordObservedWrite, writtenPaths } from "../../../mesh/observed/writes";
|
|
5
5
|
import { ownCodexLines } from './lineage';
|
|
6
|
+
import { createCodexRolloutIdentityLookup } from './rollout-identity';
|
|
6
7
|
/**
|
|
7
8
|
* Codex session logs:
|
|
8
9
|
* ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl
|
|
@@ -198,22 +199,15 @@ export function codexLogLines(sessionId: string): string[] | undefined {
|
|
|
198
199
|
codexLogPathBySession.delete(sessionId);
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
+
const file = findCodexRolloutIdentity(sessionId, recentLogs(codexSessionsRoot(), 5));
|
|
203
|
+
if (file) {
|
|
202
204
|
try {
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const row = safeParse(line);
|
|
208
|
-
return row?.type === "session_meta" &&
|
|
209
|
-
String(row.payload?.id ?? row.id ?? "") === sessionId;
|
|
210
|
-
})) {
|
|
211
|
-
codexLogPathBySession.set(sessionId, file);
|
|
212
|
-
return candidate;
|
|
213
|
-
}
|
|
214
|
-
} catch {
|
|
215
|
-
// Keep looking through the bounded recent-file set.
|
|
216
|
-
}
|
|
205
|
+
const lines = readCodexLogWindow(file, CODEX_ACTIVITY_HEAD_BYTES, CODEX_ACTIVITY_TAIL_BYTES);
|
|
206
|
+
codexLogPathBySession.set(sessionId, file);
|
|
207
|
+
return lines;
|
|
208
|
+
} catch { /* The matching rollout may have disappeared. */ }
|
|
217
209
|
}
|
|
218
210
|
return undefined;
|
|
219
211
|
}
|
|
212
|
+
|
|
213
|
+
const findCodexRolloutIdentity = createCodexRolloutIdentityLookup(file => readCodexLogWindow(file));
|
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.125
|
|
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.125\";\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.125";
|
|
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;
|