@maind-dev/mcp-bridge 0.17.0 → 0.19.0
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/build/index.js +349 -154
- package/build/meta.json +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -27,9 +27,9 @@ function configDir() {
|
|
|
27
27
|
const xdg = env.XDG_CONFIG_HOME && env.XDG_CONFIG_HOME.length > 0 ? env.XDG_CONFIG_HOME : join2(home, ".config");
|
|
28
28
|
return join2(xdg, "maind");
|
|
29
29
|
}
|
|
30
|
-
function ensureDir(
|
|
31
|
-
if (existsSync(
|
|
32
|
-
mkdirSync2(
|
|
30
|
+
function ensureDir(path8) {
|
|
31
|
+
if (existsSync(path8)) return;
|
|
32
|
+
mkdirSync2(path8, { recursive: true, mode: 448 });
|
|
33
33
|
}
|
|
34
34
|
function ensureDeviceId() {
|
|
35
35
|
const dir = configDir();
|
|
@@ -97,7 +97,226 @@ var BRIDGE_VERSION;
|
|
|
97
97
|
var init_version = __esm({
|
|
98
98
|
"src/version.ts"() {
|
|
99
99
|
"use strict";
|
|
100
|
-
BRIDGE_VERSION = "0.
|
|
100
|
+
BRIDGE_VERSION = "0.19.0";
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// src/install/bridge-entry.ts
|
|
105
|
+
import path2 from "node:path";
|
|
106
|
+
import { fileURLToPath } from "node:url";
|
|
107
|
+
function isEphemeralEntry(entryPath, sep2 = path2.sep) {
|
|
108
|
+
return entryPath.split(sep2).includes("_npx");
|
|
109
|
+
}
|
|
110
|
+
function resolveBridgeLaunch(opts) {
|
|
111
|
+
const extra = opts.extraArgs ?? [];
|
|
112
|
+
const npx = (reason) => ({
|
|
113
|
+
command: "npx",
|
|
114
|
+
args: ["-y", NPX_PACKAGE, ...extra],
|
|
115
|
+
env: {},
|
|
116
|
+
fallbackReason: reason
|
|
117
|
+
});
|
|
118
|
+
if (opts.entryPath === null) {
|
|
119
|
+
return npx("bridge entry path could not be resolved");
|
|
120
|
+
}
|
|
121
|
+
if (isEphemeralEntry(opts.entryPath, opts.sep)) {
|
|
122
|
+
return npx("bridge is running from the npx cache (install it globally to pin a path)");
|
|
123
|
+
}
|
|
124
|
+
if (!opts.nodePath) {
|
|
125
|
+
return npx("node executable path unavailable");
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
command: opts.nodePath,
|
|
129
|
+
args: [opts.entryPath, ...extra],
|
|
130
|
+
env: opts.isElectron ? { ELECTRON_RUN_AS_NODE: "1" } : {},
|
|
131
|
+
fallbackReason: null
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function currentBridgeEntry() {
|
|
135
|
+
try {
|
|
136
|
+
const here = fileURLToPath(import.meta.url);
|
|
137
|
+
return here.endsWith(".js") ? here : null;
|
|
138
|
+
} catch {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function launchToShellCommand(launch) {
|
|
143
|
+
const assignments = Object.entries(launch.env).map(
|
|
144
|
+
([k, v]) => `${k}=${shellQuote(v)}`
|
|
145
|
+
);
|
|
146
|
+
return [...assignments, launch.command, ...launch.args].map((part, i) => i < assignments.length ? part : shellQuote(part)).join(" ");
|
|
147
|
+
}
|
|
148
|
+
function isNpxForm(command) {
|
|
149
|
+
return /(^|\s)npx(\s|$)/.test(command) && command.includes(NPX_PACKAGE);
|
|
150
|
+
}
|
|
151
|
+
function isLegacyHookForm(command) {
|
|
152
|
+
if (/(^|[\s/])maind-hook(\s|$)/.test(command)) return true;
|
|
153
|
+
return /claude-code-hook[/\\]build[/\\]/.test(command);
|
|
154
|
+
}
|
|
155
|
+
function shellQuote(value) {
|
|
156
|
+
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value)) return value;
|
|
157
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
158
|
+
}
|
|
159
|
+
var NPX_PACKAGE;
|
|
160
|
+
var init_bridge_entry = __esm({
|
|
161
|
+
"src/install/bridge-entry.ts"() {
|
|
162
|
+
"use strict";
|
|
163
|
+
NPX_PACKAGE = "@maind-dev/mcp-bridge";
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// src/install/hook-wiring.ts
|
|
168
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
169
|
+
import * as path6 from "node:path";
|
|
170
|
+
function inspectHookWiring(raw, deps = {}) {
|
|
171
|
+
const fileExists = deps.fileExists ?? existsSync2;
|
|
172
|
+
const expectedCommand = deps.expectedCommand ?? defaultExpectedCommand;
|
|
173
|
+
let settings = {};
|
|
174
|
+
if (raw !== null && raw.trim().length > 0) {
|
|
175
|
+
try {
|
|
176
|
+
const parsed = JSON.parse(raw);
|
|
177
|
+
if (isObject3(parsed)) settings = parsed;
|
|
178
|
+
} catch {
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return MANAGED_SUBCOMMAND_HOOKS.map((hook) => {
|
|
182
|
+
const base = { event: hook.event, subcommand: hook.subcommand };
|
|
183
|
+
const command = findCommand(settings, hook.event, hook.subcommand);
|
|
184
|
+
if (command === null) {
|
|
185
|
+
return {
|
|
186
|
+
...base,
|
|
187
|
+
status: "missing",
|
|
188
|
+
command: null,
|
|
189
|
+
remedy: "run-install",
|
|
190
|
+
detail: `${hook.label} is not wired \u2014 this bridge can run '${hook.subcommand}', but nothing calls it.`
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
const replace = ` Replace its command with: ${expectedCommand(hook.subcommand)}`;
|
|
194
|
+
if (isLegacyHookForm(command)) {
|
|
195
|
+
return {
|
|
196
|
+
...base,
|
|
197
|
+
status: "legacy",
|
|
198
|
+
command,
|
|
199
|
+
remedy: "edit-command",
|
|
200
|
+
detail: `${hook.label} still runs the retired @maind/claude-code-hook, which was folded into the bridge and is not published.` + replace
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (isNpxForm(command)) {
|
|
204
|
+
return {
|
|
205
|
+
...base,
|
|
206
|
+
status: "npx",
|
|
207
|
+
command,
|
|
208
|
+
remedy: "edit-command",
|
|
209
|
+
detail: `${hook.label} runs through 'npx' \u2014 PATH and npm's per-Node-version globals decide which bridge that is.` + replace
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
const script = extractScriptPath(command);
|
|
213
|
+
if (script !== null && !fileExists(script)) {
|
|
214
|
+
return {
|
|
215
|
+
...base,
|
|
216
|
+
status: "broken",
|
|
217
|
+
command,
|
|
218
|
+
remedy: "edit-command",
|
|
219
|
+
detail: `${hook.label} points at ${script}, which does not exist \u2014 the hook fails silently on every run.` + replace
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
...base,
|
|
224
|
+
status: "ok",
|
|
225
|
+
command,
|
|
226
|
+
remedy: "none",
|
|
227
|
+
detail: `${hook.label} is wired.`
|
|
228
|
+
};
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
function hasWiringDrift(findings) {
|
|
232
|
+
return findings.some((f) => f.status !== "ok");
|
|
233
|
+
}
|
|
234
|
+
function needsInstallRun(findings) {
|
|
235
|
+
return findings.some((f) => f.remedy === "run-install");
|
|
236
|
+
}
|
|
237
|
+
function defaultExpectedCommand(subcommand) {
|
|
238
|
+
return launchToShellCommand(
|
|
239
|
+
resolveBridgeLaunch({
|
|
240
|
+
entryPath: currentBridgeEntry(),
|
|
241
|
+
nodePath: process.execPath,
|
|
242
|
+
extraArgs: [subcommand],
|
|
243
|
+
isElectron: process.versions.electron !== void 0
|
|
244
|
+
})
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
function findCommand(settings, event, subcommand) {
|
|
248
|
+
const groups = settings.hooks?.[event];
|
|
249
|
+
if (!Array.isArray(groups)) return null;
|
|
250
|
+
for (const group of groups) {
|
|
251
|
+
if (!isObject3(group)) continue;
|
|
252
|
+
const hooks = group.hooks;
|
|
253
|
+
if (!Array.isArray(hooks)) continue;
|
|
254
|
+
for (const hook of hooks) {
|
|
255
|
+
if (!isObject3(hook)) continue;
|
|
256
|
+
const cmd = hook.command;
|
|
257
|
+
if (typeof cmd === "string" && cmd.includes(subcommand)) return cmd;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
function extractScriptPath(command) {
|
|
263
|
+
for (const token of tokenize(command)) {
|
|
264
|
+
if (token.endsWith(".js") || token.endsWith(".mjs") || token.endsWith(".cjs")) {
|
|
265
|
+
return path6.isAbsolute(token) ? token : null;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
function tokenize(command) {
|
|
271
|
+
const tokens = [];
|
|
272
|
+
let current = "";
|
|
273
|
+
let inQuote = false;
|
|
274
|
+
for (const ch of command) {
|
|
275
|
+
if (ch === "'") {
|
|
276
|
+
inQuote = !inQuote;
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
if (!inQuote && /\s/.test(ch)) {
|
|
280
|
+
if (current.length > 0) tokens.push(current);
|
|
281
|
+
current = "";
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
current += ch;
|
|
285
|
+
}
|
|
286
|
+
if (current.length > 0) tokens.push(current);
|
|
287
|
+
return tokens;
|
|
288
|
+
}
|
|
289
|
+
function isObject3(v) {
|
|
290
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
291
|
+
}
|
|
292
|
+
var MANAGED_SUBCOMMAND_HOOKS;
|
|
293
|
+
var init_hook_wiring = __esm({
|
|
294
|
+
"src/install/hook-wiring.ts"() {
|
|
295
|
+
"use strict";
|
|
296
|
+
init_bridge_entry();
|
|
297
|
+
MANAGED_SUBCOMMAND_HOOKS = [
|
|
298
|
+
{
|
|
299
|
+
event: "SessionStart",
|
|
300
|
+
subcommand: "on-session-start",
|
|
301
|
+
label: "SessionStart hook",
|
|
302
|
+
timeout: 5,
|
|
303
|
+
consentDescription: "It runs 'maind-mcp-bridge on-session-start' \u2014 opens a tracked session so duration and tool-call counts can be measured. Writes only to ~/.maind/state.json; nothing leaves the machine here."
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
event: "PreToolUse",
|
|
307
|
+
subcommand: "on-tool-use",
|
|
308
|
+
label: "PreToolUse hook",
|
|
309
|
+
timeout: 5,
|
|
310
|
+
consentDescription: "It runs 'maind-mcp-bridge on-tool-use' before every tool call \u2014 counts calls, and warns you on stderr when the session's token usage crosses your handoff thresholds (ADR-039). Only the tool NAME is read, never its arguments."
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
event: "Stop",
|
|
314
|
+
subcommand: "on-session-end",
|
|
315
|
+
label: "Stop hook",
|
|
316
|
+
timeout: 10,
|
|
317
|
+
consentDescription: "It runs 'maind-mcp-bridge on-session-end' \u2014 derives session communication analytics (momentum + reactions) from the transcript at session end, and flushes the session's Tier-3 counters. Gated by Tier-3 consent server-side."
|
|
318
|
+
}
|
|
319
|
+
];
|
|
101
320
|
}
|
|
102
321
|
});
|
|
103
322
|
|
|
@@ -109,15 +328,15 @@ var init_types = __esm({
|
|
|
109
328
|
});
|
|
110
329
|
|
|
111
330
|
// ../../packages/claude-code-telemetry/dist/transcript.js
|
|
112
|
-
import { createReadStream, existsSync as
|
|
331
|
+
import { createReadStream, existsSync as existsSync6 } from "node:fs";
|
|
113
332
|
import { stat } from "node:fs/promises";
|
|
114
333
|
import { createInterface as createInterface4 } from "node:readline";
|
|
115
|
-
async function summariseTranscript(
|
|
116
|
-
if (!
|
|
334
|
+
async function summariseTranscript(path8) {
|
|
335
|
+
if (!path8 || !existsSync6(path8))
|
|
117
336
|
return null;
|
|
118
337
|
let stats;
|
|
119
338
|
try {
|
|
120
|
-
stats = await stat(
|
|
339
|
+
stats = await stat(path8);
|
|
121
340
|
} catch {
|
|
122
341
|
return null;
|
|
123
342
|
}
|
|
@@ -125,7 +344,7 @@ async function summariseTranscript(path7) {
|
|
|
125
344
|
let output = 0;
|
|
126
345
|
let lines2 = 0;
|
|
127
346
|
return await new Promise((resolve2) => {
|
|
128
|
-
const stream = createReadStream(
|
|
347
|
+
const stream = createReadStream(path8, { encoding: "utf-8" });
|
|
129
348
|
const rl = createInterface4({ input: stream });
|
|
130
349
|
rl.on("line", (line) => {
|
|
131
350
|
const trimmed = line.trim();
|
|
@@ -198,7 +417,7 @@ var init_effort = __esm({
|
|
|
198
417
|
});
|
|
199
418
|
|
|
200
419
|
// ../../packages/claude-code-telemetry/dist/session-analysis.js
|
|
201
|
-
import { createReadStream as createReadStream2, existsSync as
|
|
420
|
+
import { createReadStream as createReadStream2, existsSync as existsSync7 } from "node:fs";
|
|
202
421
|
import { createInterface as createInterface5 } from "node:readline";
|
|
203
422
|
function num2(v) {
|
|
204
423
|
return typeof v === "number" && Number.isFinite(v) ? v : 0;
|
|
@@ -274,16 +493,16 @@ function emptyAnalysis(sessionId) {
|
|
|
274
493
|
lines_seen: 0
|
|
275
494
|
};
|
|
276
495
|
}
|
|
277
|
-
async function analyzeSession(
|
|
496
|
+
async function analyzeSession(path8) {
|
|
278
497
|
const a = emptyAnalysis("");
|
|
279
|
-
if (!
|
|
498
|
+
if (!path8 || !existsSync7(path8))
|
|
280
499
|
return a;
|
|
281
500
|
const reactions = [];
|
|
282
501
|
let effort = null;
|
|
283
502
|
let priorAssistantWorked = false;
|
|
284
503
|
let prevUserText = null;
|
|
285
504
|
await new Promise((resolve2) => {
|
|
286
|
-
const stream = createReadStream2(
|
|
505
|
+
const stream = createReadStream2(path8, { encoding: "utf-8" });
|
|
287
506
|
const rl = createInterface5({ input: stream });
|
|
288
507
|
const processLine = (line) => {
|
|
289
508
|
const trimmed = line.trim();
|
|
@@ -559,14 +778,14 @@ var init_hook_input = __esm({
|
|
|
559
778
|
|
|
560
779
|
// src/hooks/state.ts
|
|
561
780
|
import { mkdir as mkdir2, readFile as readFile2, writeFile as writeFile2, rename as rename2 } from "node:fs/promises";
|
|
562
|
-
import { existsSync as
|
|
781
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
563
782
|
import { homedir as homedir4 } from "node:os";
|
|
564
783
|
import { join as join13 } from "node:path";
|
|
565
784
|
function emptyState() {
|
|
566
785
|
return { config: null, sessions: {}, pending_metrics: [] };
|
|
567
786
|
}
|
|
568
787
|
async function loadState() {
|
|
569
|
-
if (!
|
|
788
|
+
if (!existsSync8(STATE_FILE)) return emptyState();
|
|
570
789
|
try {
|
|
571
790
|
const raw = await readFile2(STATE_FILE, "utf-8");
|
|
572
791
|
const parsed = JSON.parse(raw);
|
|
@@ -586,7 +805,7 @@ async function loadState() {
|
|
|
586
805
|
}
|
|
587
806
|
}
|
|
588
807
|
async function saveState(state) {
|
|
589
|
-
if (!
|
|
808
|
+
if (!existsSync8(STATE_DIR)) {
|
|
590
809
|
await mkdir2(STATE_DIR, { recursive: true, mode: 448 });
|
|
591
810
|
}
|
|
592
811
|
const tmp = `${STATE_FILE}.tmp`;
|
|
@@ -621,7 +840,9 @@ __export(hooks_exports, {
|
|
|
621
840
|
runSessionEndMetrics: () => runSessionEndMetrics,
|
|
622
841
|
runSyncConfig: () => runSyncConfig
|
|
623
842
|
});
|
|
843
|
+
import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:fs";
|
|
624
844
|
import { writeFile as writeFile3 } from "node:fs/promises";
|
|
845
|
+
import { homedir as homedir5 } from "node:os";
|
|
625
846
|
import { join as join14 } from "node:path";
|
|
626
847
|
function effectiveConfig(state) {
|
|
627
848
|
if (state.config) return state.config;
|
|
@@ -799,6 +1020,8 @@ async function flushPending(config, timeoutMs) {
|
|
|
799
1020
|
async function runHookStatus() {
|
|
800
1021
|
const state = await loadState();
|
|
801
1022
|
const config = effectiveConfig(state);
|
|
1023
|
+
const wiring = readHookWiring();
|
|
1024
|
+
const drift = hasWiringDrift(wiring.findings);
|
|
802
1025
|
process.stdout.write(
|
|
803
1026
|
JSON.stringify(
|
|
804
1027
|
{
|
|
@@ -809,14 +1032,43 @@ async function runHookStatus() {
|
|
|
809
1032
|
open_sessions: Object.keys(state.sessions).length,
|
|
810
1033
|
pending_metrics: state.pending_metrics.length,
|
|
811
1034
|
thresholds: resolveThresholds(state),
|
|
812
|
-
thresholds_synced_at: state.thresholds_synced_at ?? state.config?.thresholds_synced_at ?? null
|
|
1035
|
+
thresholds_synced_at: state.thresholds_synced_at ?? state.config?.thresholds_synced_at ?? null,
|
|
1036
|
+
hook_wiring: {
|
|
1037
|
+
settings_file: wiring.settingsPath,
|
|
1038
|
+
ok: !drift,
|
|
1039
|
+
hooks: wiring.findings.map((f) => ({
|
|
1040
|
+
event: f.event,
|
|
1041
|
+
subcommand: f.subcommand,
|
|
1042
|
+
status: f.status,
|
|
1043
|
+
detail: f.detail
|
|
1044
|
+
})),
|
|
1045
|
+
...needsInstallRun(wiring.findings) ? { remedy: WIRING_REMEDY } : {}
|
|
1046
|
+
}
|
|
813
1047
|
},
|
|
814
1048
|
null,
|
|
815
1049
|
2
|
|
816
1050
|
) + "\n"
|
|
817
1051
|
);
|
|
1052
|
+
if (drift) {
|
|
1053
|
+
process.stderr.write("\n[maind] Claude Code hook wiring is incomplete:\n");
|
|
1054
|
+
for (const f of wiring.findings) {
|
|
1055
|
+
if (f.status !== "ok") process.stderr.write(` \u2022 ${f.detail}
|
|
1056
|
+
`);
|
|
1057
|
+
}
|
|
1058
|
+
if (needsInstallRun(wiring.findings)) process.stderr.write(` ${WIRING_REMEDY}
|
|
1059
|
+
`);
|
|
1060
|
+
}
|
|
818
1061
|
return 0;
|
|
819
1062
|
}
|
|
1063
|
+
function readHookWiring() {
|
|
1064
|
+
const settingsPath = join14(homedir5(), ".claude", "settings.json");
|
|
1065
|
+
let raw = null;
|
|
1066
|
+
try {
|
|
1067
|
+
if (existsSync9(settingsPath)) raw = readFileSync7(settingsPath, "utf8");
|
|
1068
|
+
} catch {
|
|
1069
|
+
}
|
|
1070
|
+
return { settingsPath, findings: inspectHookWiring(raw) };
|
|
1071
|
+
}
|
|
820
1072
|
async function runSyncConfig() {
|
|
821
1073
|
const state = await loadState();
|
|
822
1074
|
const config = effectiveConfig(state);
|
|
@@ -886,18 +1138,20 @@ function sessionIdOf(input) {
|
|
|
886
1138
|
const id = typeof input.session_id === "string" ? input.session_id.trim() : "";
|
|
887
1139
|
return id.length > 0 ? id : null;
|
|
888
1140
|
}
|
|
889
|
-
var DEFAULT_THRESHOLDS_ENDPOINT, STOP_FLUSH_TIMEOUT_MS, MANUAL_FLUSH_TIMEOUT_MS;
|
|
1141
|
+
var DEFAULT_THRESHOLDS_ENDPOINT, STOP_FLUSH_TIMEOUT_MS, MANUAL_FLUSH_TIMEOUT_MS, WIRING_REMEDY;
|
|
890
1142
|
var init_hooks = __esm({
|
|
891
1143
|
"src/hooks/index.ts"() {
|
|
892
1144
|
"use strict";
|
|
893
1145
|
init_dist();
|
|
894
1146
|
init_device_id();
|
|
1147
|
+
init_hook_wiring();
|
|
895
1148
|
init_api();
|
|
896
1149
|
init_hook_input();
|
|
897
1150
|
init_state();
|
|
898
1151
|
DEFAULT_THRESHOLDS_ENDPOINT = process.env.MAIND_THRESHOLDS_ENDPOINT ?? "https://vsddmiosisvfrairepxv.supabase.co/functions/v1/get-context-thresholds";
|
|
899
1152
|
STOP_FLUSH_TIMEOUT_MS = 1500;
|
|
900
1153
|
MANUAL_FLUSH_TIMEOUT_MS = 1e4;
|
|
1154
|
+
WIRING_REMEDY = "Re-run `maind-mcp-bridge install` to add the missing hooks \u2014 it is append-only and idempotent: it adds only what is absent, asks consent per hook, and never rewrites an entry you already have.";
|
|
901
1155
|
}
|
|
902
1156
|
});
|
|
903
1157
|
|
|
@@ -2108,65 +2362,8 @@ Which one should receive the MCP config and preamble files? [1-${candidates.leng
|
|
|
2108
2362
|
}
|
|
2109
2363
|
|
|
2110
2364
|
// src/install/client-targets.ts
|
|
2365
|
+
init_bridge_entry();
|
|
2111
2366
|
import * as path3 from "node:path";
|
|
2112
|
-
|
|
2113
|
-
// src/install/bridge-entry.ts
|
|
2114
|
-
import path2 from "node:path";
|
|
2115
|
-
import { fileURLToPath } from "node:url";
|
|
2116
|
-
var NPX_PACKAGE = "@maind-dev/mcp-bridge";
|
|
2117
|
-
function isEphemeralEntry(entryPath, sep2 = path2.sep) {
|
|
2118
|
-
return entryPath.split(sep2).includes("_npx");
|
|
2119
|
-
}
|
|
2120
|
-
function resolveBridgeLaunch(opts) {
|
|
2121
|
-
const extra = opts.extraArgs ?? [];
|
|
2122
|
-
const npx = (reason) => ({
|
|
2123
|
-
command: "npx",
|
|
2124
|
-
args: ["-y", NPX_PACKAGE, ...extra],
|
|
2125
|
-
env: {},
|
|
2126
|
-
fallbackReason: reason
|
|
2127
|
-
});
|
|
2128
|
-
if (opts.entryPath === null) {
|
|
2129
|
-
return npx("bridge entry path could not be resolved");
|
|
2130
|
-
}
|
|
2131
|
-
if (isEphemeralEntry(opts.entryPath, opts.sep)) {
|
|
2132
|
-
return npx("bridge is running from the npx cache (install it globally to pin a path)");
|
|
2133
|
-
}
|
|
2134
|
-
if (!opts.nodePath) {
|
|
2135
|
-
return npx("node executable path unavailable");
|
|
2136
|
-
}
|
|
2137
|
-
return {
|
|
2138
|
-
command: opts.nodePath,
|
|
2139
|
-
args: [opts.entryPath, ...extra],
|
|
2140
|
-
env: opts.isElectron ? { ELECTRON_RUN_AS_NODE: "1" } : {},
|
|
2141
|
-
fallbackReason: null
|
|
2142
|
-
};
|
|
2143
|
-
}
|
|
2144
|
-
function currentBridgeEntry() {
|
|
2145
|
-
try {
|
|
2146
|
-
const here = fileURLToPath(import.meta.url);
|
|
2147
|
-
return here.endsWith(".js") ? here : null;
|
|
2148
|
-
} catch {
|
|
2149
|
-
return null;
|
|
2150
|
-
}
|
|
2151
|
-
}
|
|
2152
|
-
function launchToShellCommand(launch) {
|
|
2153
|
-
const assignments = Object.entries(launch.env).map(
|
|
2154
|
-
([k, v]) => `${k}=${shellQuote(v)}`
|
|
2155
|
-
);
|
|
2156
|
-
return [...assignments, launch.command, ...launch.args].map((part, i) => i < assignments.length ? part : shellQuote(part)).join(" ");
|
|
2157
|
-
}
|
|
2158
|
-
function isNpxForm(command) {
|
|
2159
|
-
return /(^|\s)npx(\s|$)/.test(command) && command.includes(NPX_PACKAGE);
|
|
2160
|
-
}
|
|
2161
|
-
function isLegacyHookForm(command) {
|
|
2162
|
-
return /(^|[\s/])maind-hook(\s|$)/.test(command);
|
|
2163
|
-
}
|
|
2164
|
-
function shellQuote(value) {
|
|
2165
|
-
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(value)) return value;
|
|
2166
|
-
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
// src/install/client-targets.ts
|
|
2170
2367
|
function buildMaindServerEntry(opts) {
|
|
2171
2368
|
const launch = opts.launch ?? resolveBridgeLaunch({
|
|
2172
2369
|
entryPath: currentBridgeEntry(),
|
|
@@ -3379,11 +3576,13 @@ function ensureTrailingBlankLine(content) {
|
|
|
3379
3576
|
}
|
|
3380
3577
|
|
|
3381
3578
|
// src/install/hook-merge.ts
|
|
3382
|
-
import * as
|
|
3579
|
+
import * as path7 from "node:path";
|
|
3383
3580
|
import * as readline2 from "node:readline";
|
|
3581
|
+
init_bridge_entry();
|
|
3582
|
+
init_hook_wiring();
|
|
3384
3583
|
var REMINDER_FILE_REL = ".claude/maind-session-start-reminder.md";
|
|
3385
3584
|
async function mergeClaudeHook(opts, spec) {
|
|
3386
|
-
const settingsPath =
|
|
3585
|
+
const settingsPath = path7.join(opts.homeDir, ".claude", "settings.json");
|
|
3387
3586
|
const targetKey = spec.targetKey;
|
|
3388
3587
|
if (opts.skip) {
|
|
3389
3588
|
return { target: targetKey, action: "skip", status: "skipped", detail: "--no-hook" };
|
|
@@ -3402,7 +3601,7 @@ async function mergeClaudeHook(opts, spec) {
|
|
|
3402
3601
|
action = "merge";
|
|
3403
3602
|
try {
|
|
3404
3603
|
const parsed = JSON.parse(raw);
|
|
3405
|
-
if (!
|
|
3604
|
+
if (!isObject4(parsed)) {
|
|
3406
3605
|
return {
|
|
3407
3606
|
target: targetKey,
|
|
3408
3607
|
action: "merge",
|
|
@@ -3480,7 +3679,7 @@ ${spec.consentDescription}
|
|
|
3480
3679
|
};
|
|
3481
3680
|
}
|
|
3482
3681
|
async function mergeSessionStartHook(opts) {
|
|
3483
|
-
const reminderPath =
|
|
3682
|
+
const reminderPath = path7.join(opts.homeDir, REMINDER_FILE_REL);
|
|
3484
3683
|
return mergeClaudeHook(opts, {
|
|
3485
3684
|
event: "SessionStart",
|
|
3486
3685
|
command: `cat ${reminderPath}`,
|
|
@@ -3491,6 +3690,10 @@ async function mergeSessionStartHook(opts) {
|
|
|
3491
3690
|
consentDescription: `It 'cat's ${REMINDER_FILE_REL} into every new Claude Code session.`
|
|
3492
3691
|
});
|
|
3493
3692
|
}
|
|
3693
|
+
function targetKeyFor(hook) {
|
|
3694
|
+
const slug = hook.event.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3695
|
+
return `hook(${slug}):~/.claude/settings.json`;
|
|
3696
|
+
}
|
|
3494
3697
|
async function mergeSubcommandHook(opts, spec) {
|
|
3495
3698
|
const launch = opts.launch ?? resolveBridgeLaunch({
|
|
3496
3699
|
entryPath: currentBridgeEntry(),
|
|
@@ -3504,11 +3707,11 @@ async function mergeSubcommandHook(opts, spec) {
|
|
|
3504
3707
|
command,
|
|
3505
3708
|
timeout: spec.timeout,
|
|
3506
3709
|
matchPattern: new RegExp(spec.subcommand),
|
|
3507
|
-
targetKey: spec
|
|
3710
|
+
targetKey: targetKeyFor(spec),
|
|
3508
3711
|
skipDetail: (existing) => {
|
|
3509
3712
|
const wired = `${spec.label} already runs maind ${spec.subcommand}`;
|
|
3510
3713
|
if (isLegacyHookForm(existing)) {
|
|
3511
|
-
return `${wired}, but via the retired
|
|
3714
|
+
return `${wired}, but via the retired @maind/claude-code-hook \u2014 the bridge now owns that subcommand and that package is not published. Replace its command with: ${command}`;
|
|
3512
3715
|
}
|
|
3513
3716
|
if (isNpxForm(existing)) {
|
|
3514
3717
|
return `${wired}, but via \`npx\` \u2014 which resolves through PATH and npm's per-Node-version globals. Replace its command with: ${command}`;
|
|
@@ -3518,45 +3721,29 @@ async function mergeSubcommandHook(opts, spec) {
|
|
|
3518
3721
|
consentDescription: spec.consentDescription
|
|
3519
3722
|
});
|
|
3520
3723
|
}
|
|
3724
|
+
function managed(subcommand) {
|
|
3725
|
+
const hook = MANAGED_SUBCOMMAND_HOOKS.find((h) => h.subcommand === subcommand);
|
|
3726
|
+
if (!hook) throw new Error(`no managed hook for subcommand ${subcommand}`);
|
|
3727
|
+
return hook;
|
|
3728
|
+
}
|
|
3521
3729
|
async function mergeStopHook(opts) {
|
|
3522
|
-
return mergeSubcommandHook(opts,
|
|
3523
|
-
event: "Stop",
|
|
3524
|
-
subcommand: "on-session-end",
|
|
3525
|
-
timeout: 10,
|
|
3526
|
-
targetKey: "hook(stop):~/.claude/settings.json",
|
|
3527
|
-
label: "Stop hook",
|
|
3528
|
-
consentDescription: "It runs 'maind-mcp-bridge on-session-end' \u2014 derives session communication analytics (momentum + reactions) from the transcript at session end, and flushes the session's Tier-3 counters. Gated by Tier-3 consent server-side."
|
|
3529
|
-
});
|
|
3730
|
+
return mergeSubcommandHook(opts, managed("on-session-end"));
|
|
3530
3731
|
}
|
|
3531
3732
|
async function mergeSessionStartMetricsHook(opts) {
|
|
3532
|
-
return mergeSubcommandHook(opts,
|
|
3533
|
-
event: "SessionStart",
|
|
3534
|
-
subcommand: "on-session-start",
|
|
3535
|
-
timeout: 5,
|
|
3536
|
-
targetKey: "hook(session-start):~/.claude/settings.json",
|
|
3537
|
-
label: "SessionStart hook",
|
|
3538
|
-
consentDescription: "It runs 'maind-mcp-bridge on-session-start' \u2014 opens a tracked session so duration and tool-call counts can be measured. Writes only to ~/.maind/state.json; nothing leaves the machine here."
|
|
3539
|
-
});
|
|
3733
|
+
return mergeSubcommandHook(opts, managed("on-session-start"));
|
|
3540
3734
|
}
|
|
3541
3735
|
async function mergeToolUseHook(opts) {
|
|
3542
|
-
return mergeSubcommandHook(opts,
|
|
3543
|
-
event: "PreToolUse",
|
|
3544
|
-
subcommand: "on-tool-use",
|
|
3545
|
-
timeout: 5,
|
|
3546
|
-
targetKey: "hook(pre-tool-use):~/.claude/settings.json",
|
|
3547
|
-
label: "PreToolUse hook",
|
|
3548
|
-
consentDescription: "It runs 'maind-mcp-bridge on-tool-use' before every tool call \u2014 counts calls, and warns you on stderr when the session's token usage crosses your handoff thresholds (ADR-039). Only the tool NAME is read, never its arguments."
|
|
3549
|
-
});
|
|
3736
|
+
return mergeSubcommandHook(opts, managed("on-tool-use"));
|
|
3550
3737
|
}
|
|
3551
3738
|
function findExistingHookCommand(settings, event, pattern) {
|
|
3552
3739
|
const groups = settings.hooks?.[event];
|
|
3553
3740
|
if (!Array.isArray(groups)) return null;
|
|
3554
3741
|
for (const group of groups) {
|
|
3555
|
-
if (!
|
|
3742
|
+
if (!isObject4(group)) continue;
|
|
3556
3743
|
const hooks = group.hooks;
|
|
3557
3744
|
if (!Array.isArray(hooks)) continue;
|
|
3558
3745
|
for (const hook of hooks) {
|
|
3559
|
-
if (!
|
|
3746
|
+
if (!isObject4(hook)) continue;
|
|
3560
3747
|
const cmd = hook.command;
|
|
3561
3748
|
if (typeof cmd === "string" && pattern.test(cmd)) return cmd;
|
|
3562
3749
|
}
|
|
@@ -3577,7 +3764,7 @@ async function promptYesNo(out, prompt) {
|
|
|
3577
3764
|
if (answer === "" || answer === "y" || answer === "yes") return true;
|
|
3578
3765
|
return false;
|
|
3579
3766
|
}
|
|
3580
|
-
function
|
|
3767
|
+
function isObject4(v) {
|
|
3581
3768
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
3582
3769
|
}
|
|
3583
3770
|
function errMessage(err) {
|
|
@@ -4501,12 +4688,12 @@ function toPosix(p) {
|
|
|
4501
4688
|
function classify(paths) {
|
|
4502
4689
|
const out = [];
|
|
4503
4690
|
for (const raw of paths) {
|
|
4504
|
-
const
|
|
4505
|
-
if (!
|
|
4691
|
+
const path8 = toPosix(raw).trim();
|
|
4692
|
+
if (!path8 || isSkippablePath(path8))
|
|
4506
4693
|
continue;
|
|
4507
|
-
const language = languageForPath(
|
|
4694
|
+
const language = languageForPath(path8);
|
|
4508
4695
|
if (language)
|
|
4509
|
-
out.push({ path:
|
|
4696
|
+
out.push({ path: path8, language });
|
|
4510
4697
|
}
|
|
4511
4698
|
return out;
|
|
4512
4699
|
}
|
|
@@ -4828,18 +5015,18 @@ function readFileHistory(repoRoot, paths, opts = {}) {
|
|
|
4828
5015
|
const cleanPaths = paths.map((p) => p.trim()).filter((p) => p.length > 0 && !p.startsWith(":"));
|
|
4829
5016
|
const scoped = cleanPaths.slice(0, MAX_HISTORY_PATHS);
|
|
4830
5017
|
const history = [];
|
|
4831
|
-
for (const
|
|
5018
|
+
for (const path8 of scoped) {
|
|
4832
5019
|
const raw = runGit(repoRoot, [
|
|
4833
5020
|
"log",
|
|
4834
5021
|
"-n",
|
|
4835
5022
|
String(window),
|
|
4836
5023
|
LOG_FORMAT,
|
|
4837
5024
|
"--",
|
|
4838
|
-
|
|
5025
|
+
path8
|
|
4839
5026
|
]);
|
|
4840
5027
|
const commits = raw === null ? [] : splitRecords(raw).map(parseHistoryRecord).filter((c) => c !== null);
|
|
4841
5028
|
history.push({
|
|
4842
|
-
path:
|
|
5029
|
+
path: path8,
|
|
4843
5030
|
lastCommits: commits.slice(0, limit),
|
|
4844
5031
|
ownership: includeOwnership ? { topAuthors: aggregateOwnership(commits), commitsInWindow: commits.length } : null
|
|
4845
5032
|
});
|
|
@@ -4892,7 +5079,7 @@ function readFileHistory(repoRoot, paths, opts = {}) {
|
|
|
4892
5079
|
|
|
4893
5080
|
// ../../packages/code-index/build/repo-health/divergence.js
|
|
4894
5081
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
4895
|
-
import { existsSync as
|
|
5082
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "node:fs";
|
|
4896
5083
|
import { posix as posix3 } from "node:path";
|
|
4897
5084
|
var DEFAULT_WORKTREE_PROBE_PATHS = [
|
|
4898
5085
|
"supabase/config.toml",
|
|
@@ -5054,12 +5241,12 @@ function detectInProgressOp(repoRoot) {
|
|
|
5054
5241
|
if (!gitDir)
|
|
5055
5242
|
return null;
|
|
5056
5243
|
const base = posix3.isAbsolute(gitDir) ? gitDir : posix3.join(repoRoot, gitDir);
|
|
5057
|
-
if (
|
|
5244
|
+
if (existsSync3(posix3.join(base, "rebase-merge")) || existsSync3(posix3.join(base, "rebase-apply"))) {
|
|
5058
5245
|
return "rebase";
|
|
5059
5246
|
}
|
|
5060
|
-
if (
|
|
5247
|
+
if (existsSync3(posix3.join(base, "MERGE_HEAD")))
|
|
5061
5248
|
return "merge";
|
|
5062
|
-
if (
|
|
5249
|
+
if (existsSync3(posix3.join(base, "CHERRY_PICK_HEAD")))
|
|
5063
5250
|
return "cherry-pick";
|
|
5064
5251
|
return null;
|
|
5065
5252
|
}
|
|
@@ -5087,7 +5274,7 @@ function parseWorktrees(raw) {
|
|
|
5087
5274
|
}
|
|
5088
5275
|
function readWorktreeRequirements(repoRoot) {
|
|
5089
5276
|
const p = posix3.join(repoRoot, WORKTREE_REQUIREMENTS_RELPATH);
|
|
5090
|
-
if (!
|
|
5277
|
+
if (!existsSync3(p))
|
|
5091
5278
|
return [];
|
|
5092
5279
|
try {
|
|
5093
5280
|
return readFileSync3(p, "utf8").split("\n").map((l) => l.trim()).filter((l) => l.length > 0 && !l.startsWith("#"));
|
|
@@ -5157,7 +5344,7 @@ async function gatherRepoHealthFacts(repoRoot, opts = {}) {
|
|
|
5157
5344
|
...readWorktreeRequirements(toplevel),
|
|
5158
5345
|
...opts.probePaths ?? []
|
|
5159
5346
|
];
|
|
5160
|
-
const missing = probes.filter((rel) =>
|
|
5347
|
+
const missing = probes.filter((rel) => existsSync3(posix3.join(mainWorktree, rel)) && !existsSync3(posix3.join(toplevel, rel)));
|
|
5161
5348
|
worktreeParity = {
|
|
5162
5349
|
mainWorktreePath: mainWorktree,
|
|
5163
5350
|
currentWorktreePath: toplevel,
|
|
@@ -5242,7 +5429,7 @@ async function checkDivergence(repoRoot, opts = {}) {
|
|
|
5242
5429
|
}
|
|
5243
5430
|
|
|
5244
5431
|
// ../../packages/code-index/build/repo-health/number-collisions.js
|
|
5245
|
-
import { existsSync as
|
|
5432
|
+
import { existsSync as existsSync4, readdirSync as readdirSync2 } from "node:fs";
|
|
5246
5433
|
import { posix as posix4 } from "node:path";
|
|
5247
5434
|
var NUMBERED_RE = /^(?<prefix>[A-Za-z][A-Za-z_.-]*?[-_])?(?<num>\d{2,})(?=[-_.])/;
|
|
5248
5435
|
var DEFAULT_MIN_FILES = 5;
|
|
@@ -5348,9 +5535,9 @@ function detectNamespaces(repoRoot, opts = {}) {
|
|
|
5348
5535
|
if (raw === null)
|
|
5349
5536
|
return [];
|
|
5350
5537
|
const candidates = /* @__PURE__ */ new Map();
|
|
5351
|
-
for (const
|
|
5352
|
-
const dir = posix4.dirname(
|
|
5353
|
-
const parsed = parseNumbered(posix4.basename(
|
|
5538
|
+
for (const path8 of raw.split("\0").filter(Boolean)) {
|
|
5539
|
+
const dir = posix4.dirname(path8);
|
|
5540
|
+
const parsed = parseNumbered(posix4.basename(path8));
|
|
5354
5541
|
if (!parsed)
|
|
5355
5542
|
continue;
|
|
5356
5543
|
const key = `${dir}#${parsed.prefix}`;
|
|
@@ -5384,9 +5571,9 @@ async function gatherNumberCollisionFacts(repoRoot, opts = {}) {
|
|
|
5384
5571
|
const nsByKey = new Map(namespaces.map((ns) => [namespaceKey(ns), ns]));
|
|
5385
5572
|
const dirs = [...new Set(namespaces.map((ns) => ns.dir))];
|
|
5386
5573
|
const sightingsByNamespace = /* @__PURE__ */ new Map();
|
|
5387
|
-
const record = (
|
|
5388
|
-
const dir = posix4.dirname(
|
|
5389
|
-
const parsed = parseNumbered(posix4.basename(
|
|
5574
|
+
const record = (path8, kind, where) => {
|
|
5575
|
+
const dir = posix4.dirname(path8);
|
|
5576
|
+
const parsed = parseNumbered(posix4.basename(path8));
|
|
5390
5577
|
if (!parsed)
|
|
5391
5578
|
return;
|
|
5392
5579
|
const key = `${dir}#${parsed.prefix}`;
|
|
@@ -5394,7 +5581,7 @@ async function gatherNumberCollisionFacts(repoRoot, opts = {}) {
|
|
|
5394
5581
|
return;
|
|
5395
5582
|
const byNumber = sightingsByNamespace.get(key) ?? /* @__PURE__ */ new Map();
|
|
5396
5583
|
const list = byNumber.get(parsed.number) ?? [];
|
|
5397
|
-
list.push({ kind, where, path:
|
|
5584
|
+
list.push({ kind, where, path: path8 });
|
|
5398
5585
|
byNumber.set(parsed.number, list);
|
|
5399
5586
|
sightingsByNamespace.set(key, byNumber);
|
|
5400
5587
|
};
|
|
@@ -5406,12 +5593,12 @@ async function gatherNumberCollisionFacts(repoRoot, opts = {}) {
|
|
|
5406
5593
|
skipped.push(`could not read ${where}`);
|
|
5407
5594
|
return;
|
|
5408
5595
|
}
|
|
5409
|
-
for (const
|
|
5410
|
-
record(
|
|
5596
|
+
for (const path8 of lines(out))
|
|
5597
|
+
record(path8, kind, where);
|
|
5411
5598
|
};
|
|
5412
5599
|
for (const dir of dirs) {
|
|
5413
5600
|
const abs = posix4.join(repoRoot, dir);
|
|
5414
|
-
if (!
|
|
5601
|
+
if (!existsSync4(abs))
|
|
5415
5602
|
continue;
|
|
5416
5603
|
try {
|
|
5417
5604
|
for (const file of readdirSync2(abs))
|
|
@@ -5438,11 +5625,11 @@ async function gatherNumberCollisionFacts(repoRoot, opts = {}) {
|
|
|
5438
5625
|
if (!line.startsWith("worktree "))
|
|
5439
5626
|
continue;
|
|
5440
5627
|
const root = line.slice("worktree ".length).trim();
|
|
5441
|
-
if (!root || root === selfRoot || !
|
|
5628
|
+
if (!root || root === selfRoot || !existsSync4(root))
|
|
5442
5629
|
continue;
|
|
5443
5630
|
for (const dir of dirs) {
|
|
5444
5631
|
const abs = posix4.join(root, dir);
|
|
5445
|
-
if (!
|
|
5632
|
+
if (!existsSync4(abs))
|
|
5446
5633
|
continue;
|
|
5447
5634
|
try {
|
|
5448
5635
|
for (const file of readdirSync2(abs)) {
|
|
@@ -5532,11 +5719,11 @@ var RISK_RULES = [
|
|
|
5532
5719
|
// ../../packages/code-index/build/review/risk-scan.js
|
|
5533
5720
|
function scanRiskFlags(input) {
|
|
5534
5721
|
const flags = /* @__PURE__ */ new Set();
|
|
5535
|
-
for (const [
|
|
5722
|
+
for (const [path8, status] of input.paths) {
|
|
5536
5723
|
for (const rule of RISK_RULES) {
|
|
5537
5724
|
if (flags.has(rule.flag))
|
|
5538
5725
|
continue;
|
|
5539
|
-
if (!rule.path.test(
|
|
5726
|
+
if (!rule.path.test(path8))
|
|
5540
5727
|
continue;
|
|
5541
5728
|
if (rule.onlyWhenAdded && status !== "added")
|
|
5542
5729
|
continue;
|
|
@@ -5544,19 +5731,19 @@ function scanRiskFlags(input) {
|
|
|
5544
5731
|
flags.add(rule.flag);
|
|
5545
5732
|
continue;
|
|
5546
5733
|
}
|
|
5547
|
-
const text = contentForPath(
|
|
5734
|
+
const text = contentForPath(path8, input);
|
|
5548
5735
|
if (text !== null && rule.content.test(text))
|
|
5549
5736
|
flags.add(rule.flag);
|
|
5550
5737
|
}
|
|
5551
5738
|
}
|
|
5552
5739
|
return [...flags].sort();
|
|
5553
5740
|
}
|
|
5554
|
-
function contentForPath(
|
|
5555
|
-
const hunks = input.hunks.get(
|
|
5741
|
+
function contentForPath(path8, input) {
|
|
5742
|
+
const hunks = input.hunks.get(path8);
|
|
5556
5743
|
if (hunks && !hunks.wholeFile && !hunks.degraded) {
|
|
5557
5744
|
return hunks.addedLines.join("\n");
|
|
5558
5745
|
}
|
|
5559
|
-
return input.readUntracked(
|
|
5746
|
+
return input.readUntracked(path8);
|
|
5560
5747
|
}
|
|
5561
5748
|
|
|
5562
5749
|
// ../../packages/code-index/build/store/schema.js
|
|
@@ -6126,8 +6313,8 @@ var NodeSqliteStore = class {
|
|
|
6126
6313
|
indexedAt: r.indexed_at
|
|
6127
6314
|
}));
|
|
6128
6315
|
}
|
|
6129
|
-
async getFile(
|
|
6130
|
-
const r = this.db.prepare("SELECT * FROM files WHERE path = ?").get(
|
|
6316
|
+
async getFile(path8) {
|
|
6317
|
+
const r = this.db.prepare("SELECT * FROM files WHERE path = ?").get(path8);
|
|
6131
6318
|
if (!r)
|
|
6132
6319
|
return null;
|
|
6133
6320
|
return {
|
|
@@ -6155,10 +6342,10 @@ var NodeSqliteStore = class {
|
|
|
6155
6342
|
});
|
|
6156
6343
|
tx();
|
|
6157
6344
|
}
|
|
6158
|
-
async deleteFile(
|
|
6345
|
+
async deleteFile(path8) {
|
|
6159
6346
|
const tx = this.db.transaction(() => {
|
|
6160
|
-
this.deleteFileGraph(
|
|
6161
|
-
this.db.prepare("DELETE FROM files WHERE path = ?").run(
|
|
6347
|
+
this.deleteFileGraph(path8);
|
|
6348
|
+
this.db.prepare("DELETE FROM files WHERE path = ?").run(path8);
|
|
6162
6349
|
});
|
|
6163
6350
|
tx();
|
|
6164
6351
|
}
|
|
@@ -6186,8 +6373,8 @@ var NodeSqliteStore = class {
|
|
|
6186
6373
|
const r = this.db.prepare("SELECT * FROM nodes WHERE node_key = ?").get(nodeKey);
|
|
6187
6374
|
return r ? toNodeRow(r) : null;
|
|
6188
6375
|
}
|
|
6189
|
-
async getNodesByFile(
|
|
6190
|
-
const rows = this.db.prepare("SELECT * FROM nodes WHERE file_path = ? ORDER BY start_line").all(
|
|
6376
|
+
async getNodesByFile(path8) {
|
|
6377
|
+
const rows = this.db.prepare("SELECT * FROM nodes WHERE file_path = ? ORDER BY start_line").all(path8);
|
|
6191
6378
|
return rows.map(toNodeRow);
|
|
6192
6379
|
}
|
|
6193
6380
|
async getNodesByKinds(kinds) {
|
|
@@ -6303,8 +6490,8 @@ var NodeSqliteStore = class {
|
|
|
6303
6490
|
}));
|
|
6304
6491
|
}
|
|
6305
6492
|
// ── internal helpers ──
|
|
6306
|
-
deleteFileGraph(
|
|
6307
|
-
const keys = this.db.prepare("SELECT node_key FROM nodes WHERE file_path = ?").all(
|
|
6493
|
+
deleteFileGraph(path8) {
|
|
6494
|
+
const keys = this.db.prepare("SELECT node_key FROM nodes WHERE file_path = ?").all(path8).map((r) => r.node_key);
|
|
6308
6495
|
const delEdge = this.db.prepare("DELETE FROM edges WHERE src_key = ?");
|
|
6309
6496
|
const delFts = this.db.prepare("DELETE FROM nodes_fts WHERE node_key = ?");
|
|
6310
6497
|
for (let i = 0; i < keys.length; i += CHUNK) {
|
|
@@ -6313,7 +6500,7 @@ var NodeSqliteStore = class {
|
|
|
6313
6500
|
delFts.run(k);
|
|
6314
6501
|
}
|
|
6315
6502
|
}
|
|
6316
|
-
this.db.prepare("DELETE FROM nodes WHERE file_path = ?").run(
|
|
6503
|
+
this.db.prepare("DELETE FROM nodes WHERE file_path = ?").run(path8);
|
|
6317
6504
|
}
|
|
6318
6505
|
_insNode = null;
|
|
6319
6506
|
insertNodeStmt() {
|
|
@@ -7059,7 +7246,7 @@ import { randomUUID as randomUUID2 } from "node:crypto";
|
|
|
7059
7246
|
|
|
7060
7247
|
// src/bridge-config.ts
|
|
7061
7248
|
init_device_id();
|
|
7062
|
-
import { existsSync as
|
|
7249
|
+
import { existsSync as existsSync5, readFileSync as readFileSync6 } from "node:fs";
|
|
7063
7250
|
import { join as join11 } from "node:path";
|
|
7064
7251
|
function bridgeConfigPath() {
|
|
7065
7252
|
return join11(configDir(), "config.json");
|
|
@@ -7067,7 +7254,7 @@ function bridgeConfigPath() {
|
|
|
7067
7254
|
function readBridgeConfig() {
|
|
7068
7255
|
try {
|
|
7069
7256
|
const file = bridgeConfigPath();
|
|
7070
|
-
if (!
|
|
7257
|
+
if (!existsSync5(file)) return null;
|
|
7071
7258
|
const raw = JSON.parse(readFileSync6(file, "utf8"));
|
|
7072
7259
|
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
7073
7260
|
return null;
|
|
@@ -7199,7 +7386,15 @@ var PresenceAnnouncer = class {
|
|
|
7199
7386
|
project_key: this.projectKey,
|
|
7200
7387
|
session_id: this.sessionId,
|
|
7201
7388
|
status,
|
|
7202
|
-
ttl_minutes: TTL_MINUTES
|
|
7389
|
+
ttl_minutes: TTL_MINUTES,
|
|
7390
|
+
// Self-declaration (migration 20260801120000). The server CANNOT derive
|
|
7391
|
+
// this: our announce rides the very same forwarder — headers included —
|
|
7392
|
+
// as an `announce_session` the agent writes itself, so the two requests
|
|
7393
|
+
// are byte-identical apart from these args. Without the marker a
|
|
7394
|
+
// skeleton row is indistinguishable from a sloppy agent session, which
|
|
7395
|
+
// is how 16 of 23 rows came to say nothing AND not say why. Display hint
|
|
7396
|
+
// only; the server keeps 'agent' once an agent has enriched the row.
|
|
7397
|
+
announce_source: "bridge"
|
|
7203
7398
|
};
|
|
7204
7399
|
if (status === "active") {
|
|
7205
7400
|
const branch = await this.gitBranch();
|
package/build/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/client-detect.ts":{"bytes":3979,"imports":[],"format":"esm"},"src/conventions-cache.ts":{"bytes":6619,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/forward.ts":{"bytes":27137,"imports":[{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:timers/promises","kind":"import-statement","external":true},{"path":"src/client-detect.ts","kind":"import-statement","original":"./client-detect.js"},{"path":"src/conventions-cache.ts","kind":"import-statement","original":"./conventions-cache.js"}],"format":"esm"},"src/device-id.ts":{"bytes":5476,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/auth.ts":{"bytes":8214,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/version.ts":{"bytes":306,"imports":[],"format":"esm"},"src/project-key.ts":{"bytes":2719,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/install/flags.ts":{"bytes":5809,"imports":[],"format":"esm"},"src/install/report.ts":{"bytes":4292,"imports":[],"format":"esm"},"src/install/project-root.ts":{"bytes":4032,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"src/install/bridge-entry.ts":{"bytes":6171,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true}],"format":"esm"},"src/install/client-targets.ts":{"bytes":6752,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/install/bridge-entry.ts","kind":"import-statement","original":"./bridge-entry.js"}],"format":"esm"},"src/install/atomic-write.ts":{"bytes":4154,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/json-merge.ts":{"bytes":5180,"imports":[{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/toml-merge.ts":{"bytes":4819,"imports":[{"path":"smol-toml","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"../../packages/integration-snippets/build/index.js":{"bytes":35437,"imports":[],"format":"esm"},"src/install/preamble.ts":{"bytes":4556,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/integration-snippets/build/index.js","kind":"import-statement","original":"@maind-dev/integration-snippets"},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/hook-merge.ts":{"bytes":13173,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"},{"path":"src/install/bridge-entry.ts","kind":"import-statement","original":"./bridge-entry.js"}],"format":"esm"},"src/install/browser-pair.ts":{"bytes":4543,"imports":[{"path":"src/auth.ts","kind":"import-statement","original":"../auth.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/install/telemetry.ts":{"bytes":3027,"imports":[],"format":"esm"},"src/install/index.ts":{"bytes":7574,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/install/flags.ts","kind":"import-statement","original":"./flags.js"},{"path":"src/install/report.ts","kind":"import-statement","original":"./report.js"},{"path":"src/install/project-root.ts","kind":"import-statement","original":"./project-root.js"},{"path":"src/install/client-targets.ts","kind":"import-statement","original":"./client-targets.js"},{"path":"src/install/json-merge.ts","kind":"import-statement","original":"./json-merge.js"},{"path":"src/install/toml-merge.ts","kind":"import-statement","original":"./toml-merge.js"},{"path":"src/install/preamble.ts","kind":"import-statement","original":"./preamble.js"},{"path":"src/install/hook-merge.ts","kind":"import-statement","original":"./hook-merge.js"},{"path":"src/install/browser-pair.ts","kind":"import-statement","original":"./browser-pair.js"},{"path":"src/install/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":8578,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/incremental/hunks.js":{"bytes":6171,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/incremental/history.js":{"bytes":7302,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/repo-health/divergence.js":{"bytes":18968,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"}],"format":"esm"},"../../packages/code-index/build/repo-health/number-collisions.js":{"bytes":15364,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"}],"format":"esm"},"../../packages/code-index/build/review/risk-rules.js":{"bytes":1958,"imports":[],"format":"esm"},"../../packages/code-index/build/review/risk-scan.js":{"bytes":1451,"imports":[{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./risk-rules.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":20772,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/incremental/hunks.js","kind":"import-statement","original":"../incremental/hunks.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"../incremental/history.js"},{"path":"../../packages/code-index/build/repo-health/divergence.js","kind":"import-statement","original":"../repo-health/divergence.js"},{"path":"../../packages/code-index/build/repo-health/number-collisions.js","kind":"import-statement","original":"../repo-health/number-collisions.js"},{"path":"../../packages/code-index/build/review/risk-scan.js","kind":"import-statement","original":"../review/risk-scan.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"src/local-tools/engine.ts":{"bytes":1138,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"}],"format":"esm"},"src/local-tools/token-estimate.ts":{"bytes":898,"imports":[],"format":"esm"},"src/local-tools/savings.ts":{"bytes":3781,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/local-tools/token-estimate.ts","kind":"import-statement","original":"./token-estimate.js"}],"format":"esm"},"../../packages/code-index/build/model/types.js":{"bytes":471,"imports":[],"format":"esm"},"../../packages/code-index/build/index.js":{"bytes":1897,"imports":[{"path":"../../packages/code-index/build/model/types.js","kind":"import-statement","original":"./model/types.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"./incremental/history.js"},{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./review/risk-rules.js"},{"path":"../../packages/code-index/build/repo-health/divergence.js","kind":"import-statement","original":"./repo-health/divergence.js"},{"path":"../../packages/code-index/build/repo-health/number-collisions.js","kind":"import-statement","original":"./repo-health/number-collisions.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"./parse/types.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"./embed/types.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./store/schema.js"}],"format":"esm"},"src/local-tools/tools.ts":{"bytes":25815,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/index.js","kind":"import-statement","original":"@maind/code-index"}],"format":"esm"},"src/local-tools/router.ts":{"bytes":5550,"imports":[{"path":"src/local-tools/engine.ts","kind":"import-statement","original":"./engine.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./savings.js"},{"path":"src/local-tools/tools.ts","kind":"import-statement","original":"./tools.js"}],"format":"esm"},"src/functions-origin.ts":{"bytes":714,"imports":[],"format":"esm"},"src/metrics-post.ts":{"bytes":2619,"imports":[{"path":"src/functions-origin.ts","kind":"import-statement","original":"./functions-origin.js"}],"format":"esm"},"src/bridge-config.ts":{"bytes":1603,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/presence.ts":{"bytes":9308,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/bridge-config.ts","kind":"import-statement","original":"./bridge-config.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/types.js":{"bytes":338,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytes":2017,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytes":6845,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/effort.js":{"bytes":1858,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytes":12237,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/parse.js":{"bytes":7254,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/windows.js":{"bytes":3963,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/projects.js":{"bytes":3166,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/index.js":{"bytes":685,"imports":[{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"},{"path":"../../packages/claude-code-telemetry/dist/transcript.js","kind":"import-statement","original":"./transcript.js"},{"path":"../../packages/claude-code-telemetry/dist/decisions.js","kind":"import-statement","original":"./decisions.js"},{"path":"../../packages/claude-code-telemetry/dist/session-analysis.js","kind":"import-statement","original":"./session-analysis.js"},{"path":"../../packages/claude-code-telemetry/dist/parse.js","kind":"import-statement","original":"./parse.js"},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/windows.js","kind":"import-statement","original":"./windows.js"},{"path":"../../packages/claude-code-telemetry/dist/projects.js","kind":"import-statement","original":"./projects.js"}],"format":"esm"},"src/hooks/api.ts":{"bytes":2311,"imports":[{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/hooks/hook-input.ts":{"bytes":1677,"imports":[],"format":"esm"},"src/hooks/state.ts":{"bytes":4970,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":15805,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/index.js","kind":"import-statement","original":"@maind/claude-code-telemetry"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"},{"path":"src/hooks/api.ts","kind":"import-statement","original":"./api.js"},{"path":"src/hooks/hook-input.ts","kind":"import-statement","original":"./hook-input.js"},{"path":"src/hooks/state.ts","kind":"import-statement","original":"./state.js"}],"format":"esm"},"src/session-end/index.ts":{"bytes":3073,"imports":[{"path":"../../packages/claude-code-telemetry/dist/index.js","kind":"import-statement","original":"@maind/claude-code-telemetry"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"},{"path":"src/hooks/api.ts","kind":"import-statement","original":"../hooks/api.js"},{"path":"src/hooks/hook-input.ts","kind":"import-statement","original":"../hooks/hook-input.js"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks/index.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/index.ts":{"bytes":13767,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/forward.ts","kind":"import-statement","original":"./forward.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/project-key.ts","kind":"import-statement","original":"./project-key.js"},{"path":"src/install/index.ts","kind":"import-statement","original":"./install/index.js"},{"path":"src/local-tools/router.ts","kind":"import-statement","original":"./local-tools/router.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./local-tools/savings.js"},{"path":"src/metrics-post.ts","kind":"import-statement","original":"./metrics-post.js"},{"path":"src/presence.ts","kind":"import-statement","original":"./presence.js"},{"path":"src/session-end/index.ts","kind":"dynamic-import","original":"./session-end/index.js"},{"path":"src/hooks/index.ts","kind":"dynamic-import","original":"./hooks/index.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"smol-toml","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/device-id.ts":{"bytesInOutput":2427},"src/version.ts":{"bytesInOutput":127},"../../packages/claude-code-telemetry/dist/types.js":{"bytesInOutput":110},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytesInOutput":1496},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytesInOutput":118},"../../packages/claude-code-telemetry/dist/effort.js":{"bytesInOutput":596},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytesInOutput":7796},"../../packages/claude-code-telemetry/dist/parse.js":{"bytesInOutput":147},"../../packages/claude-code-telemetry/dist/windows.js":{"bytesInOutput":219},"../../packages/claude-code-telemetry/dist/projects.js":{"bytesInOutput":326},"../../packages/claude-code-telemetry/dist/index.js":{"bytesInOutput":279},"src/hooks/api.ts":{"bytesInOutput":1232},"src/hooks/hook-input.ts":{"bytesInOutput":945},"src/hooks/state.ts":{"bytesInOutput":1728},"src/hooks/index.ts":{"bytesInOutput":9522},"src/session-end/index.ts":{"bytesInOutput":1707},"src/index.ts":{"bytesInOutput":8052},"src/forward.ts":{"bytesInOutput":17599},"src/client-detect.ts":{"bytesInOutput":2068},"src/conventions-cache.ts":{"bytesInOutput":3228},"src/auth.ts":{"bytesInOutput":5109},"src/project-key.ts":{"bytesInOutput":1352},"src/install/index.ts":{"bytesInOutput":5157},"src/install/flags.ts":{"bytesInOutput":4261},"src/install/report.ts":{"bytesInOutput":3096},"src/install/project-root.ts":{"bytesInOutput":2188},"src/install/client-targets.ts":{"bytesInOutput":3218},"src/install/bridge-entry.ts":{"bytesInOutput":1714},"src/install/atomic-write.ts":{"bytesInOutput":1760},"src/install/json-merge.ts":{"bytesInOutput":3341},"src/install/toml-merge.ts":{"bytesInOutput":3262},"src/install/preamble.ts":{"bytesInOutput":2812},"../../packages/integration-snippets/build/index.js":{"bytesInOutput":27539},"src/install/hook-merge.ts":{"bytesInOutput":7303},"src/install/browser-pair.ts":{"bytesInOutput":2701},"src/install/telemetry.ts":{"bytesInOutput":1798},"src/local-tools/engine.ts":{"bytesInOutput":483},"../../packages/code-index/build/node.js":{"bytesInOutput":530},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4716},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":14617},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":197},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2482},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":4835},"../../packages/code-index/build/incremental/hunks.js":{"bytesInOutput":3945},"../../packages/code-index/build/incremental/history.js":{"bytesInOutput":3435},"../../packages/code-index/build/repo-health/divergence.js":{"bytesInOutput":12934},"../../packages/code-index/build/repo-health/number-collisions.js":{"bytesInOutput":9037},"../../packages/code-index/build/review/risk-rules.js":{"bytesInOutput":876},"../../packages/code-index/build/review/risk-scan.js":{"bytesInOutput":802},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2170},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9759},"src/local-tools/savings.ts":{"bytesInOutput":1926},"src/local-tools/token-estimate.ts":{"bytesInOutput":133},"src/local-tools/tools.ts":{"bytesInOutput":22413},"../../packages/code-index/build/index.js":{"bytesInOutput":34},"src/local-tools/router.ts":{"bytesInOutput":3828},"src/functions-origin.ts":{"bytesInOutput":259},"src/metrics-post.ts":{"bytesInOutput":1285},"src/presence.ts":{"bytesInOutput":4772},"src/bridge-config.ts":{"bytesInOutput":789}},"bytes":255920}}}
|
|
1
|
+
{"inputs":{"src/client-detect.ts":{"bytes":3979,"imports":[],"format":"esm"},"src/conventions-cache.ts":{"bytes":6619,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/forward.ts":{"bytes":27137,"imports":[{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:timers/promises","kind":"import-statement","external":true},{"path":"src/client-detect.ts","kind":"import-statement","original":"./client-detect.js"},{"path":"src/conventions-cache.ts","kind":"import-statement","original":"./conventions-cache.js"}],"format":"esm"},"src/device-id.ts":{"bytes":5476,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/auth.ts":{"bytes":8214,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/version.ts":{"bytes":306,"imports":[],"format":"esm"},"src/project-key.ts":{"bytes":2719,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/install/flags.ts":{"bytes":5809,"imports":[],"format":"esm"},"src/install/report.ts":{"bytes":4292,"imports":[],"format":"esm"},"src/install/project-root.ts":{"bytes":4032,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"src/install/bridge-entry.ts":{"bytes":6836,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true}],"format":"esm"},"src/install/client-targets.ts":{"bytes":6752,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"src/install/bridge-entry.ts","kind":"import-statement","original":"./bridge-entry.js"}],"format":"esm"},"src/install/atomic-write.ts":{"bytes":4154,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/install/json-merge.ts":{"bytes":5180,"imports":[{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/toml-merge.ts":{"bytes":4819,"imports":[{"path":"smol-toml","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"../../packages/integration-snippets/build/index.js":{"bytes":35430,"imports":[],"format":"esm"},"src/install/preamble.ts":{"bytes":4556,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/integration-snippets/build/index.js","kind":"import-statement","original":"@maind-dev/integration-snippets"},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"}],"format":"esm"},"src/install/hook-wiring.ts":{"bytes":11266,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/install/bridge-entry.ts","kind":"import-statement","original":"./bridge-entry.js"}],"format":"esm"},"src/install/hook-merge.ts":{"bytes":12586,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"src/install/atomic-write.ts","kind":"import-statement","original":"./atomic-write.js"},{"path":"src/install/bridge-entry.ts","kind":"import-statement","original":"./bridge-entry.js"},{"path":"src/install/hook-wiring.ts","kind":"import-statement","original":"./hook-wiring.js"}],"format":"esm"},"src/install/browser-pair.ts":{"bytes":4543,"imports":[{"path":"src/auth.ts","kind":"import-statement","original":"../auth.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/install/telemetry.ts":{"bytes":3027,"imports":[],"format":"esm"},"src/install/index.ts":{"bytes":7574,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/install/flags.ts","kind":"import-statement","original":"./flags.js"},{"path":"src/install/report.ts","kind":"import-statement","original":"./report.js"},{"path":"src/install/project-root.ts","kind":"import-statement","original":"./project-root.js"},{"path":"src/install/client-targets.ts","kind":"import-statement","original":"./client-targets.js"},{"path":"src/install/json-merge.ts","kind":"import-statement","original":"./json-merge.js"},{"path":"src/install/toml-merge.ts","kind":"import-statement","original":"./toml-merge.js"},{"path":"src/install/preamble.ts","kind":"import-statement","original":"./preamble.js"},{"path":"src/install/hook-merge.ts","kind":"import-statement","original":"./hook-merge.js"},{"path":"src/install/browser-pair.ts","kind":"import-statement","original":"./browser-pair.js"},{"path":"src/install/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":8578,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/incremental/hunks.js":{"bytes":6171,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/incremental/history.js":{"bytes":7302,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/repo-health/divergence.js":{"bytes":18968,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"}],"format":"esm"},"../../packages/code-index/build/repo-health/number-collisions.js":{"bytes":15364,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"}],"format":"esm"},"../../packages/code-index/build/review/risk-rules.js":{"bytes":1958,"imports":[],"format":"esm"},"../../packages/code-index/build/review/risk-scan.js":{"bytes":1451,"imports":[{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./risk-rules.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":20772,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/incremental/hunks.js","kind":"import-statement","original":"../incremental/hunks.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"../incremental/history.js"},{"path":"../../packages/code-index/build/repo-health/divergence.js","kind":"import-statement","original":"../repo-health/divergence.js"},{"path":"../../packages/code-index/build/repo-health/number-collisions.js","kind":"import-statement","original":"../repo-health/number-collisions.js"},{"path":"../../packages/code-index/build/review/risk-scan.js","kind":"import-statement","original":"../review/risk-scan.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"src/local-tools/engine.ts":{"bytes":1138,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"}],"format":"esm"},"src/local-tools/token-estimate.ts":{"bytes":898,"imports":[],"format":"esm"},"src/local-tools/savings.ts":{"bytes":3781,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/local-tools/token-estimate.ts","kind":"import-statement","original":"./token-estimate.js"}],"format":"esm"},"../../packages/code-index/build/model/types.js":{"bytes":471,"imports":[],"format":"esm"},"../../packages/code-index/build/index.js":{"bytes":1897,"imports":[{"path":"../../packages/code-index/build/model/types.js","kind":"import-statement","original":"./model/types.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"./incremental/history.js"},{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./review/risk-rules.js"},{"path":"../../packages/code-index/build/repo-health/divergence.js","kind":"import-statement","original":"./repo-health/divergence.js"},{"path":"../../packages/code-index/build/repo-health/number-collisions.js","kind":"import-statement","original":"./repo-health/number-collisions.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"./parse/types.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"./embed/types.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./store/schema.js"}],"format":"esm"},"src/local-tools/tools.ts":{"bytes":25815,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/index.js","kind":"import-statement","original":"@maind/code-index"}],"format":"esm"},"src/local-tools/router.ts":{"bytes":5550,"imports":[{"path":"src/local-tools/engine.ts","kind":"import-statement","original":"./engine.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./savings.js"},{"path":"src/local-tools/tools.ts","kind":"import-statement","original":"./tools.js"}],"format":"esm"},"src/functions-origin.ts":{"bytes":714,"imports":[],"format":"esm"},"src/metrics-post.ts":{"bytes":2619,"imports":[{"path":"src/functions-origin.ts","kind":"import-statement","original":"./functions-origin.js"}],"format":"esm"},"src/bridge-config.ts":{"bytes":1603,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"}],"format":"esm"},"src/presence.ts":{"bytes":9888,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/bridge-config.ts","kind":"import-statement","original":"./bridge-config.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/types.js":{"bytes":338,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytes":2017,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytes":6845,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/effort.js":{"bytes":1858,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytes":12237,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/parse.js":{"bytes":7254,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/claude-code-telemetry/dist/windows.js":{"bytes":3963,"imports":[],"format":"esm"},"../../packages/claude-code-telemetry/dist/projects.js":{"bytes":3166,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/claude-code-telemetry/dist/index.js":{"bytes":685,"imports":[{"path":"../../packages/claude-code-telemetry/dist/types.js","kind":"import-statement","original":"./types.js"},{"path":"../../packages/claude-code-telemetry/dist/transcript.js","kind":"import-statement","original":"./transcript.js"},{"path":"../../packages/claude-code-telemetry/dist/decisions.js","kind":"import-statement","original":"./decisions.js"},{"path":"../../packages/claude-code-telemetry/dist/session-analysis.js","kind":"import-statement","original":"./session-analysis.js"},{"path":"../../packages/claude-code-telemetry/dist/parse.js","kind":"import-statement","original":"./parse.js"},{"path":"../../packages/claude-code-telemetry/dist/effort.js","kind":"import-statement","original":"./effort.js"},{"path":"../../packages/claude-code-telemetry/dist/windows.js","kind":"import-statement","original":"./windows.js"},{"path":"../../packages/claude-code-telemetry/dist/projects.js","kind":"import-statement","original":"./projects.js"}],"format":"esm"},"src/hooks/api.ts":{"bytes":2311,"imports":[{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"}],"format":"esm"},"src/hooks/hook-input.ts":{"bytes":1677,"imports":[],"format":"esm"},"src/hooks/state.ts":{"bytes":4970,"imports":[{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":18414,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/claude-code-telemetry/dist/index.js","kind":"import-statement","original":"@maind/claude-code-telemetry"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"},{"path":"src/install/hook-wiring.ts","kind":"import-statement","original":"../install/hook-wiring.js"},{"path":"src/hooks/api.ts","kind":"import-statement","original":"./api.js"},{"path":"src/hooks/hook-input.ts","kind":"import-statement","original":"./hook-input.js"},{"path":"src/hooks/state.ts","kind":"import-statement","original":"./state.js"}],"format":"esm"},"src/session-end/index.ts":{"bytes":3073,"imports":[{"path":"../../packages/claude-code-telemetry/dist/index.js","kind":"import-statement","original":"@maind/claude-code-telemetry"},{"path":"src/device-id.ts","kind":"import-statement","original":"../device-id.js"},{"path":"src/hooks/api.ts","kind":"import-statement","original":"../hooks/api.js"},{"path":"src/hooks/hook-input.ts","kind":"import-statement","original":"../hooks/hook-input.js"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"../hooks/index.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"}],"format":"esm"},"src/index.ts":{"bytes":13767,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/forward.ts","kind":"import-statement","original":"./forward.js"},{"path":"src/device-id.ts","kind":"import-statement","original":"./device-id.js"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/version.ts","kind":"import-statement","original":"./version.js"},{"path":"src/project-key.ts","kind":"import-statement","original":"./project-key.js"},{"path":"src/install/index.ts","kind":"import-statement","original":"./install/index.js"},{"path":"src/local-tools/router.ts","kind":"import-statement","original":"./local-tools/router.js"},{"path":"src/local-tools/savings.ts","kind":"import-statement","original":"./local-tools/savings.js"},{"path":"src/metrics-post.ts","kind":"import-statement","original":"./metrics-post.js"},{"path":"src/presence.ts","kind":"import-statement","original":"./presence.js"},{"path":"src/session-end/index.ts","kind":"dynamic-import","original":"./session-end/index.js"},{"path":"src/hooks/index.ts","kind":"dynamic-import","original":"./hooks/index.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"smol-toml","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:readline","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/device-id.ts":{"bytesInOutput":2427},"src/version.ts":{"bytesInOutput":127},"src/install/bridge-entry.ts":{"bytesInOutput":1893},"src/install/hook-wiring.ts":{"bytesInOutput":5107},"../../packages/claude-code-telemetry/dist/types.js":{"bytesInOutput":110},"../../packages/claude-code-telemetry/dist/transcript.js":{"bytesInOutput":1496},"../../packages/claude-code-telemetry/dist/decisions.js":{"bytesInOutput":118},"../../packages/claude-code-telemetry/dist/effort.js":{"bytesInOutput":596},"../../packages/claude-code-telemetry/dist/session-analysis.js":{"bytesInOutput":7796},"../../packages/claude-code-telemetry/dist/parse.js":{"bytesInOutput":147},"../../packages/claude-code-telemetry/dist/windows.js":{"bytesInOutput":219},"../../packages/claude-code-telemetry/dist/projects.js":{"bytesInOutput":326},"../../packages/claude-code-telemetry/dist/index.js":{"bytesInOutput":279},"src/hooks/api.ts":{"bytesInOutput":1232},"src/hooks/hook-input.ts":{"bytesInOutput":945},"src/hooks/state.ts":{"bytesInOutput":1728},"src/hooks/index.ts":{"bytesInOutput":10954},"src/session-end/index.ts":{"bytesInOutput":1707},"src/index.ts":{"bytesInOutput":8052},"src/forward.ts":{"bytesInOutput":17599},"src/client-detect.ts":{"bytesInOutput":2068},"src/conventions-cache.ts":{"bytesInOutput":3228},"src/auth.ts":{"bytesInOutput":5109},"src/project-key.ts":{"bytesInOutput":1352},"src/install/index.ts":{"bytesInOutput":5157},"src/install/flags.ts":{"bytesInOutput":4261},"src/install/report.ts":{"bytesInOutput":3096},"src/install/project-root.ts":{"bytesInOutput":2188},"src/install/client-targets.ts":{"bytesInOutput":3239},"src/install/atomic-write.ts":{"bytesInOutput":1760},"src/install/json-merge.ts":{"bytesInOutput":3341},"src/install/toml-merge.ts":{"bytesInOutput":3262},"src/install/preamble.ts":{"bytesInOutput":2812},"../../packages/integration-snippets/build/index.js":{"bytesInOutput":27539},"src/install/hook-merge.ts":{"bytesInOutput":6555},"src/install/browser-pair.ts":{"bytesInOutput":2701},"src/install/telemetry.ts":{"bytesInOutput":1798},"src/local-tools/engine.ts":{"bytesInOutput":483},"../../packages/code-index/build/node.js":{"bytesInOutput":530},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4716},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":14617},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":197},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2482},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":4835},"../../packages/code-index/build/incremental/hunks.js":{"bytesInOutput":3945},"../../packages/code-index/build/incremental/history.js":{"bytesInOutput":3435},"../../packages/code-index/build/repo-health/divergence.js":{"bytesInOutput":12934},"../../packages/code-index/build/repo-health/number-collisions.js":{"bytesInOutput":9037},"../../packages/code-index/build/review/risk-rules.js":{"bytesInOutput":876},"../../packages/code-index/build/review/risk-scan.js":{"bytesInOutput":802},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2170},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9759},"src/local-tools/savings.ts":{"bytesInOutput":1926},"src/local-tools/token-estimate.ts":{"bytesInOutput":133},"src/local-tools/tools.ts":{"bytesInOutput":22413},"../../packages/code-index/build/index.js":{"bytesInOutput":34},"src/local-tools/router.ts":{"bytesInOutput":3828},"src/functions-origin.ts":{"bytesInOutput":259},"src/metrics-post.ts":{"bytesInOutput":1285},"src/presence.ts":{"bytesInOutput":5352},"src/bridge-config.ts":{"bytesInOutput":789}},"bytes":262488}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maind-dev/mcp-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Local MCP bridge for maind.dev \u2014 wraps any MCP-compatible client (Claude Code, Cursor, Windsurf) and pins your API key to a single device via the maind device authorization flow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|