@vectorize-io/hindsight-coding-agents 0.8.7 → 0.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/antigravity-hook.js +150 -57
- package/dist/antigravity-statusline.js +30 -24
- package/dist/antigravity-stop-hook.js +160 -57
- package/dist/claude-hook.js +150 -57
- package/dist/claude-sessionstart-hook.js +176 -86
- package/dist/claude-stop-hook.js +160 -57
- package/dist/cline.js +132 -92
- package/dist/codebuddy-hook.js +150 -57
- package/dist/codebuddy-sessionstart-hook.js +176 -86
- package/dist/codebuddy-stop-hook.js +160 -57
- package/dist/codex-hook.js +150 -57
- package/dist/codex-sessionstart-hook.js +176 -86
- package/dist/codex-stop-hook.js +160 -57
- package/dist/copilot-hook.js +150 -57
- package/dist/copilot-sessionstart-hook.js +176 -86
- package/dist/copilot-stop-hook.js +160 -57
- package/dist/cursor-hook.js +150 -57
- package/dist/cursor-sessionstart-hook.js +176 -86
- package/dist/cursor-stop-hook.js +160 -57
- package/dist/daemon-start.js +20 -16
- package/dist/dcode-hook.js +150 -57
- package/dist/dcode-sessionstart-hook.js +176 -86
- package/dist/dcode-stop-hook.js +160 -57
- package/dist/deepen.js +19 -5
- package/dist/devin-hook.js +150 -57
- package/dist/devin-sessionstart-hook.js +176 -86
- package/dist/devin-stop-hook.js +160 -57
- package/dist/droid-hook.js +150 -57
- package/dist/droid-sessionstart-hook.js +176 -86
- package/dist/droid-stop-hook.js +160 -57
- package/dist/dsh.js +155 -93
- package/dist/grok-hook.js +150 -57
- package/dist/grok-sessionstart-hook.js +176 -86
- package/dist/grok-stop-hook.js +160 -57
- package/dist/hindsight-seed.js +35 -26
- package/dist/index.js +155 -93
- package/dist/installer.js +143 -41
- package/dist/kilo.js +155 -93
- package/dist/kimi-hook.js +150 -57
- package/dist/kimi-sessionstart-hook.js +176 -86
- package/dist/kimi-stop-hook.js +160 -57
- package/dist/mcp-server.js +73 -57
- package/dist/opencode2.js +155 -93
- package/dist/pi.js +155 -93
- package/dist/prime-agent.js +155 -93
- package/dist/qwen-hook.js +150 -57
- package/dist/qwen-sessionstart-hook.js +176 -86
- package/dist/qwen-stop-hook.js +160 -57
- package/dist/status.js +55 -39
- package/dist/traecode-hook.js +150 -57
- package/dist/traecode-sessionstart-hook.js +176 -86
- package/dist/traecode-stop-hook.js +160 -57
- package/dist/workbuddy-hook.js +150 -57
- package/dist/workbuddy-sessionstart-hook.js +176 -86
- package/dist/workbuddy-stop-hook.js +160 -57
- package/dist/zcode-hook.js +150 -57
- package/dist/zcode-sessionstart-hook.js +176 -86
- package/dist/zcode-stop-hook.js +160 -57
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skill/SKILL.md +8 -3
package/dist/installer.js
CHANGED
|
@@ -2182,9 +2182,59 @@ import { join as join7 } from "path";
|
|
|
2182
2182
|
|
|
2183
2183
|
// src/core/seed.ts
|
|
2184
2184
|
import { spawn as realSpawn } from "child_process";
|
|
2185
|
-
import { dirname as dirname4, join as
|
|
2185
|
+
import { dirname as dirname4, join as join6 } from "path";
|
|
2186
2186
|
import { fileURLToPath } from "url";
|
|
2187
2187
|
|
|
2188
|
+
// src/core/util.ts
|
|
2189
|
+
import { accessSync, constants, statSync as statSync2 } from "fs";
|
|
2190
|
+
import { delimiter, extname, isAbsolute as isAbsolute2, join as join5, resolve as resolve2 } from "path";
|
|
2191
|
+
function binOnPath(bin, opts = {}) {
|
|
2192
|
+
const platform = opts.platform ?? process.platform;
|
|
2193
|
+
const env = opts.env ?? process.env;
|
|
2194
|
+
const runnable = (file) => {
|
|
2195
|
+
try {
|
|
2196
|
+
if (!statSync2(file).isFile()) return false;
|
|
2197
|
+
if (platform !== "win32") accessSync(file, constants.X_OK);
|
|
2198
|
+
return true;
|
|
2199
|
+
} catch {
|
|
2200
|
+
return false;
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
if (isAbsolute2(bin) || /[\\/]/.test(bin)) return runnable(bin) ? resolve2(bin) : void 0;
|
|
2204
|
+
const names = platform !== "win32" || extname(bin) ? [bin] : (opts.exts ?? (env.PATHEXT || ".COM;.EXE;.BAT;.CMD").split(";")).filter(Boolean).map((ext) => bin + ext.toLowerCase());
|
|
2205
|
+
for (const dir of (env.PATH || "").split(delimiter)) {
|
|
2206
|
+
if (!dir) continue;
|
|
2207
|
+
for (const name of names) {
|
|
2208
|
+
const file = join5(dir, name);
|
|
2209
|
+
if (runnable(file)) return resolve2(file);
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
return void 0;
|
|
2213
|
+
}
|
|
2214
|
+
function nodeBinary() {
|
|
2215
|
+
return process.versions.bun || process.versions.electron ? "node" : process.execPath;
|
|
2216
|
+
}
|
|
2217
|
+
function hookNode(opts = {}) {
|
|
2218
|
+
const platform = opts.platform ?? process.platform;
|
|
2219
|
+
if (platform === "win32" || binOnPath("node", opts)) return "node";
|
|
2220
|
+
return nodeBinary();
|
|
2221
|
+
}
|
|
2222
|
+
function hookNodeShell() {
|
|
2223
|
+
const node = hookNode();
|
|
2224
|
+
return node.includes(" ") ? `"${node}"` : node;
|
|
2225
|
+
}
|
|
2226
|
+
function isOurMcpEntry(entry) {
|
|
2227
|
+
if (!entry || typeof entry !== "object") return false;
|
|
2228
|
+
const candidate = entry;
|
|
2229
|
+
const command = typeof candidate.command === "string" ? candidate.command : "";
|
|
2230
|
+
const bin = command.replaceAll("\\", "/").split("/").at(-1);
|
|
2231
|
+
if (bin !== "node" && bin !== "node.exe" || !Array.isArray(candidate.args)) return false;
|
|
2232
|
+
const script = candidate.args[0];
|
|
2233
|
+
if (typeof script !== "string") return false;
|
|
2234
|
+
const parts = script.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
2235
|
+
return parts.at(-1) === "mcp-server.js" && parts.at(-2) === "dist" && (parts.at(-3) === "coding-agents" || parts.at(-3) === "hindsight-coding-agents");
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2188
2238
|
// src/core/missions.ts
|
|
2189
2239
|
import { createHash } from "crypto";
|
|
2190
2240
|
var PAGE_TAXONOMY = [
|
|
@@ -2217,20 +2267,7 @@ var PAGE_TAXONOMY = [
|
|
|
2217
2267
|
var PAGE_NAMES = PAGE_TAXONOMY.map((page) => page.name);
|
|
2218
2268
|
|
|
2219
2269
|
// package.json
|
|
2220
|
-
var version = "0.8.
|
|
2221
|
-
|
|
2222
|
-
// src/core/util.ts
|
|
2223
|
-
import { accessSync, constants, statSync as statSync2 } from "fs";
|
|
2224
|
-
import { delimiter, extname, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "path";
|
|
2225
|
-
function isOurMcpEntry(entry) {
|
|
2226
|
-
if (!entry || typeof entry !== "object") return false;
|
|
2227
|
-
const candidate = entry;
|
|
2228
|
-
if (candidate.command !== "node" || !Array.isArray(candidate.args)) return false;
|
|
2229
|
-
const script = candidate.args[0];
|
|
2230
|
-
if (typeof script !== "string") return false;
|
|
2231
|
-
const parts = script.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
2232
|
-
return parts.at(-1) === "mcp-server.js" && parts.at(-2) === "dist" && (parts.at(-3) === "coding-agents" || parts.at(-3) === "hindsight-coding-agents");
|
|
2233
|
-
}
|
|
2270
|
+
var version = "0.8.8";
|
|
2234
2271
|
|
|
2235
2272
|
// src/core/hindsight.ts
|
|
2236
2273
|
var USER_AGENT = `hindsight-coding-agents/${version}`;
|
|
@@ -2242,10 +2279,14 @@ var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join7(homedir3(), ".hindsight"
|
|
|
2242
2279
|
var DEFAULT_DAEMON_PORT = 9077;
|
|
2243
2280
|
|
|
2244
2281
|
// src/core/transcript-util.ts
|
|
2282
|
+
var TOOL_TEXT_CAP = 2e3;
|
|
2245
2283
|
var MEMORY_TAG_RE = /<(hook_prompt|task-notification|system-reminder|hindsight_memory|hindsight_memories|hindsight_bank|relevant_memories|user_feedback|hindsight_pages|hindsight_page_refresh|hindsight_knowledge|hindsight_knowledge_refresh)\b[\s\S]*?<\/\1>/g;
|
|
2246
2284
|
function stripInjectedMemory(s) {
|
|
2247
2285
|
return s.replace(MEMORY_TAG_RE, "");
|
|
2248
2286
|
}
|
|
2287
|
+
function truncate(s, max = TOOL_TEXT_CAP) {
|
|
2288
|
+
return s.length > max ? `${s.slice(0, max)}\u2026 (truncated)` : s;
|
|
2289
|
+
}
|
|
2249
2290
|
var TARGET_KEYS = [
|
|
2250
2291
|
"file_path",
|
|
2251
2292
|
"path",
|
|
@@ -2273,7 +2314,25 @@ function actionLine(tool, input) {
|
|
|
2273
2314
|
target = input.trim().split("\n")[0];
|
|
2274
2315
|
}
|
|
2275
2316
|
if (target.length > ACTION_TARGET_CAP) target = `${target.slice(0, ACTION_TARGET_CAP)}\u2026`;
|
|
2276
|
-
|
|
2317
|
+
const line = target ? `${tool} ${target}` : tool;
|
|
2318
|
+
const note = memoryNoteText(input);
|
|
2319
|
+
return note ? `${line}
|
|
2320
|
+
${truncate(note, MEMORY_NOTE_CAP)}` : line;
|
|
2321
|
+
}
|
|
2322
|
+
var MEMORY_NOTE_CAP = 8e3;
|
|
2323
|
+
var MEMORY_NOTE_PATH_RE = /(^|[\\/])(memory|memories)[\\/]|(^|[\\/])MEMORY\.md$/i;
|
|
2324
|
+
var MEMORY_SHELL_WRITE_RE = /[\\/](memory|memories)([\\/\s"']|$)|MEMORY\.md/i;
|
|
2325
|
+
var SHELL_WRITE_RE = /(^|[^0-9&>])>>?(?!&)|\btee\b/;
|
|
2326
|
+
function memoryNoteText(input) {
|
|
2327
|
+
if (!input || typeof input !== "object") return "";
|
|
2328
|
+
const rec = input;
|
|
2329
|
+
const cmd = rec.command;
|
|
2330
|
+
if (typeof cmd === "string")
|
|
2331
|
+
return MEMORY_SHELL_WRITE_RE.test(cmd) && SHELL_WRITE_RE.test(cmd) ? cmd.trim() : "";
|
|
2332
|
+
const path = rec.file_path ?? rec.path;
|
|
2333
|
+
if (typeof path !== "string" || !MEMORY_NOTE_PATH_RE.test(path)) return "";
|
|
2334
|
+
const text = rec.content ?? rec.new_string;
|
|
2335
|
+
return typeof text === "string" ? text.trim() : "";
|
|
2277
2336
|
}
|
|
2278
2337
|
|
|
2279
2338
|
// src/core/brand.ts
|
|
@@ -2413,7 +2472,7 @@ function* readJsonl(path) {
|
|
|
2413
2472
|
}
|
|
2414
2473
|
|
|
2415
2474
|
// src/core/transcript.ts
|
|
2416
|
-
function renderLine(content, type) {
|
|
2475
|
+
function renderLine(content, type, questionIds) {
|
|
2417
2476
|
if (typeof content === "string") {
|
|
2418
2477
|
const text = stripInjectedMemory(content).trim();
|
|
2419
2478
|
return text ? [{ role: type, content: text }] : [];
|
|
@@ -2427,7 +2486,11 @@ function renderLine(content, type) {
|
|
|
2427
2486
|
const t = stripInjectedMemory(b.text).trim();
|
|
2428
2487
|
if (t) texts.push(t);
|
|
2429
2488
|
} else if (b.type === "tool_use" && typeof b.name === "string") {
|
|
2489
|
+
if (b.name === "AskUserQuestion" && typeof b.id === "string") questionIds.add(b.id);
|
|
2430
2490
|
actions.push({ role: "action", content: actionLine(b.name, b.input) });
|
|
2491
|
+
} else if (b.type === "tool_result" && b.tool_use_id && questionIds.has(b.tool_use_id)) {
|
|
2492
|
+
const answer = renderLine(b.content, type, questionIds).map((r) => r.content).join("\n");
|
|
2493
|
+
if (answer) texts.push(answer);
|
|
2431
2494
|
}
|
|
2432
2495
|
}
|
|
2433
2496
|
const out = [];
|
|
@@ -2438,6 +2501,7 @@ function renderLine(content, type) {
|
|
|
2438
2501
|
}
|
|
2439
2502
|
function readClaudeTranscript(path) {
|
|
2440
2503
|
const turns = [];
|
|
2504
|
+
const questionIds = /* @__PURE__ */ new Set();
|
|
2441
2505
|
for (const rawLine of readJsonl(path)) {
|
|
2442
2506
|
const trimmed = rawLine.trim();
|
|
2443
2507
|
if (!trimmed) continue;
|
|
@@ -2454,7 +2518,7 @@ function readClaudeTranscript(path) {
|
|
|
2454
2518
|
if (line.isSidechain === true) continue;
|
|
2455
2519
|
if (line.isCompactSummary === true) continue;
|
|
2456
2520
|
if (typeof line.message !== "object" || line.message === null) continue;
|
|
2457
|
-
for (const rendered of renderLine(line.message.content, line.type)) {
|
|
2521
|
+
for (const rendered of renderLine(line.message.content, line.type, questionIds)) {
|
|
2458
2522
|
const turn = { role: rendered.role, content: rendered.content };
|
|
2459
2523
|
if (typeof line.timestamp === "string") turn.timestamp = line.timestamp;
|
|
2460
2524
|
turns.push(turn);
|
|
@@ -2851,7 +2915,7 @@ function registerTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
|
2851
2915
|
}
|
|
2852
2916
|
const servers = doc.mcpServers && typeof doc.mcpServers === "object" && !Array.isArray(doc.mcpServers) ? doc.mcpServers : doc.mcpServers = {};
|
|
2853
2917
|
const entry = {
|
|
2854
|
-
command:
|
|
2918
|
+
command: hookNode(),
|
|
2855
2919
|
args: [script],
|
|
2856
2920
|
env: { HINDSIGHT_MCP_HARNESS: "traecode", HINDSIGHT_MCP_PROJECT_CWD: cwd }
|
|
2857
2921
|
};
|
|
@@ -3215,6 +3279,27 @@ function readAntigravityTranscript(path) {
|
|
|
3215
3279
|
}
|
|
3216
3280
|
return turns;
|
|
3217
3281
|
}
|
|
3282
|
+
function readAntigravityPromptTurn(path) {
|
|
3283
|
+
if (!path) return void 0;
|
|
3284
|
+
let lastRole;
|
|
3285
|
+
let lastUserPrompt;
|
|
3286
|
+
for (const line of readJsonl(path)) {
|
|
3287
|
+
try {
|
|
3288
|
+
const event = JSON.parse(line);
|
|
3289
|
+
const role = event.role ?? event.message?.role ?? event.type;
|
|
3290
|
+
if (!role || role === "CHECKPOINT" || role === "EPHEMERAL_MESSAGE") continue;
|
|
3291
|
+
lastRole = role;
|
|
3292
|
+
if (role === "user" || role === "USER_INPUT") {
|
|
3293
|
+
const content = event.content ?? event.text ?? event.message?.content ?? event.message?.text;
|
|
3294
|
+
const text = typeof content === "string" ? stripInjectedMemory(content) : "";
|
|
3295
|
+
const clean = unwrapUserRequest(text).trim();
|
|
3296
|
+
lastUserPrompt = clean || void 0;
|
|
3297
|
+
}
|
|
3298
|
+
} catch {
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3301
|
+
return lastRole === "user" || lastRole === "USER_INPUT" ? lastUserPrompt : void 0;
|
|
3302
|
+
}
|
|
3218
3303
|
|
|
3219
3304
|
// src/core/transcript-copilot.ts
|
|
3220
3305
|
function readCopilotTranscript(path) {
|
|
@@ -3939,9 +4024,10 @@ var antigravityPrompt = {
|
|
|
3939
4024
|
harness: "antigravity-cli",
|
|
3940
4025
|
requireCwd: true,
|
|
3941
4026
|
parse: (ev) => ({
|
|
3942
|
-
// Antigravity's PreInvocation payload
|
|
3943
|
-
//
|
|
3944
|
-
prompt
|
|
4027
|
+
// Antigravity's PreInvocation payload omits the prompt and fires before EVERY planner step in
|
|
4028
|
+
// the agent loop (including after every tool call). Read the transcript's trailing record so
|
|
4029
|
+
// only a genuine user submission returns a prompt and tool-result continuations are suppressed.
|
|
4030
|
+
prompt: readAntigravityPromptTurn(ev.transcriptPath),
|
|
3945
4031
|
cwd: antigravityCwd(ev),
|
|
3946
4032
|
sessionId: ev.conversationId
|
|
3947
4033
|
}),
|
|
@@ -5244,14 +5330,14 @@ function setOrDelete(obj, key, arr) {
|
|
|
5244
5330
|
else delete obj[key];
|
|
5245
5331
|
}
|
|
5246
5332
|
var cmdHook = (dist, file, timeout) => ({
|
|
5247
|
-
hooks: [{ type: "command", command:
|
|
5333
|
+
hooks: [{ type: "command", command: `${hookNodeShell()} "${join24(dist, file)}"`, timeout }]
|
|
5248
5334
|
});
|
|
5249
|
-
var nodeCommand = (script) => script.includes(" ") ?
|
|
5335
|
+
var nodeCommand = (script) => script.includes(" ") ? `${hookNodeShell()} "${script}"` : `${hookNodeShell()} ${script}`;
|
|
5250
5336
|
var processHook = (dist, file, timeoutMs) => ({
|
|
5251
|
-
hooks: [{ type: "process", command:
|
|
5337
|
+
hooks: [{ type: "process", command: hookNode(), args: [join24(dist, file)], timeoutMs }]
|
|
5252
5338
|
});
|
|
5253
5339
|
var mcpServerEntry = (dist, harness, extraArgs = []) => ({
|
|
5254
|
-
command:
|
|
5340
|
+
command: hookNode(),
|
|
5255
5341
|
args: [join24(dist, "mcp-server.js"), ...extraArgs],
|
|
5256
5342
|
env: { HINDSIGHT_MCP_HARNESS: harness }
|
|
5257
5343
|
});
|
|
@@ -5342,16 +5428,28 @@ function registerOpencodePlugin(c, name) {
|
|
|
5342
5428
|
}
|
|
5343
5429
|
const plugins = Array.isArray(cfg.plugin) ? cfg.plugin : [];
|
|
5344
5430
|
writeJsonc(path, "plugin", [...plugins.filter((p) => !String(p).includes(MARKER)), c.pkgRoot]);
|
|
5431
|
+
dropOursFromV2Plugins(path, cfg);
|
|
5345
5432
|
c.log?.(`${name}: plugin registered in ${path}`);
|
|
5346
5433
|
}
|
|
5434
|
+
function dropOursFromV2Plugins(path, cfg) {
|
|
5435
|
+
if (!Array.isArray(cfg.plugins)) return false;
|
|
5436
|
+
const kept = cfg.plugins.filter((p) => !String(p).includes(MARKER));
|
|
5437
|
+
if (kept.length === cfg.plugins.length) return false;
|
|
5438
|
+
writeJsonc(path, "plugins", kept.length ? kept : void 0);
|
|
5439
|
+
return true;
|
|
5440
|
+
}
|
|
5347
5441
|
function unregisterOpencodePlugin(c, name) {
|
|
5348
5442
|
const path = opencodeConfigPath(c);
|
|
5349
5443
|
if (!existsSync13(path)) return;
|
|
5350
5444
|
const cfg = parseJsonc(readFileSync16(path, "utf8"));
|
|
5351
|
-
if (!cfg
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5445
|
+
if (!cfg) return;
|
|
5446
|
+
let removed = dropOursFromV2Plugins(path, cfg);
|
|
5447
|
+
if (Array.isArray(cfg.plugin)) {
|
|
5448
|
+
const kept = cfg.plugin.filter((p) => !String(p).includes(MARKER));
|
|
5449
|
+
writeJsonc(path, "plugin", kept.length ? kept : void 0);
|
|
5450
|
+
removed = true;
|
|
5451
|
+
}
|
|
5452
|
+
if (removed) c.log?.(`${name}: plugin entry removed`);
|
|
5355
5453
|
}
|
|
5356
5454
|
var opencode = {
|
|
5357
5455
|
name: "opencode",
|
|
@@ -5455,14 +5553,14 @@ var claudeCode = {
|
|
|
5455
5553
|
"--env",
|
|
5456
5554
|
"HINDSIGHT_MCP_HARNESS=claude-code",
|
|
5457
5555
|
"--",
|
|
5458
|
-
|
|
5556
|
+
hookNode(),
|
|
5459
5557
|
join24(c.dist, "mcp-server.js")
|
|
5460
5558
|
])) {
|
|
5461
5559
|
c.log?.("claude-code: MCP server registered (claude mcp add, user scope)");
|
|
5462
5560
|
} else {
|
|
5463
5561
|
c.log?.(
|
|
5464
5562
|
`claude-code: could not run \`claude mcp add\` \u2014 register the tools manually:
|
|
5465
|
-
claude mcp add --scope user hindsight --env HINDSIGHT_MCP_HARNESS=claude-code --
|
|
5563
|
+
claude mcp add --scope user hindsight --env HINDSIGHT_MCP_HARNESS=claude-code -- ${hookNodeShell()} "${join24(c.dist, "mcp-server.js")}"`
|
|
5466
5564
|
);
|
|
5467
5565
|
}
|
|
5468
5566
|
},
|
|
@@ -5492,7 +5590,7 @@ function defaultClaudeMcp(args) {
|
|
|
5492
5590
|
}
|
|
5493
5591
|
var CODEX_MCP_BLOCK_RE = /^\[mcp_servers\.hindsight(?:\.[^\]]+)?\][^\n]*\n(?:(?!\[)[^\n]*\n?)*/gm;
|
|
5494
5592
|
var codexMcpBlock = (dist) => `[mcp_servers.hindsight]
|
|
5495
|
-
command =
|
|
5593
|
+
command = ${JSON.stringify(hookNode())}
|
|
5496
5594
|
args = [${JSON.stringify(join24(dist, "mcp-server.js"))}]
|
|
5497
5595
|
env = { HINDSIGHT_MCP_HARNESS = "codex" }`;
|
|
5498
5596
|
var codex = {
|
|
@@ -5635,7 +5733,7 @@ var antigravity = {
|
|
|
5635
5733
|
};
|
|
5636
5734
|
function pathNodeHasSqlite() {
|
|
5637
5735
|
try {
|
|
5638
|
-
execFileSync8(
|
|
5736
|
+
execFileSync8(hookNode(), ["-e", "require('node:sqlite')"], { stdio: "pipe", timeout: 1e4 });
|
|
5639
5737
|
return true;
|
|
5640
5738
|
} catch {
|
|
5641
5739
|
return false;
|
|
@@ -5643,7 +5741,7 @@ function pathNodeHasSqlite() {
|
|
|
5643
5741
|
}
|
|
5644
5742
|
function pathNodeVersion() {
|
|
5645
5743
|
try {
|
|
5646
|
-
return execFileSync8(
|
|
5744
|
+
return execFileSync8(hookNode(), ["-v"], { encoding: "utf8", stdio: "pipe" }).trim();
|
|
5647
5745
|
} catch {
|
|
5648
5746
|
return "not found";
|
|
5649
5747
|
}
|
|
@@ -6109,7 +6207,7 @@ var kimi = {
|
|
|
6109
6207
|
const entries = Object.values(spec.install).map(
|
|
6110
6208
|
(h) => `[[hooks]]
|
|
6111
6209
|
event = ${JSON.stringify(h.event)}
|
|
6112
|
-
command = ${JSON.stringify(
|
|
6210
|
+
command = ${JSON.stringify(`${hookNodeShell()} "${join24(c.dist, h.entry)}"`)}
|
|
6113
6211
|
timeout = ${h.timeout}
|
|
6114
6212
|
`
|
|
6115
6213
|
).join("\n");
|
|
@@ -6355,14 +6453,14 @@ var qwen = {
|
|
|
6355
6453
|
"-e",
|
|
6356
6454
|
"HINDSIGHT_MCP_HARNESS=qwen-code",
|
|
6357
6455
|
"hindsight",
|
|
6358
|
-
|
|
6456
|
+
hookNode(),
|
|
6359
6457
|
join24(c.dist, "mcp-server.js")
|
|
6360
6458
|
])) {
|
|
6361
6459
|
c.log?.("qwen-code: MCP server registered (qwen mcp add, user scope)");
|
|
6362
6460
|
} else {
|
|
6363
6461
|
c.log?.(
|
|
6364
6462
|
`qwen-code: could not run \`qwen mcp add\` \u2014 register the tools manually:
|
|
6365
|
-
qwen mcp add -s user -e HINDSIGHT_MCP_HARNESS=qwen-code hindsight
|
|
6463
|
+
qwen mcp add -s user -e HINDSIGHT_MCP_HARNESS=qwen-code hindsight ${hookNodeShell()} "${join24(c.dist, "mcp-server.js")}"`
|
|
6366
6464
|
);
|
|
6367
6465
|
}
|
|
6368
6466
|
},
|
|
@@ -6736,9 +6834,13 @@ function importConversations(harness, ctx) {
|
|
|
6736
6834
|
`${harness}: importing ${found.sessions.length} past sessions (${turns} turns) from ${repo} \u2014 this runs extraction and may take a while`
|
|
6737
6835
|
);
|
|
6738
6836
|
try {
|
|
6739
|
-
execFileSync8(
|
|
6740
|
-
|
|
6741
|
-
|
|
6837
|
+
execFileSync8(
|
|
6838
|
+
nodeBinary(),
|
|
6839
|
+
[join24(ctx.dist, "deepen.js"), "--repo", repo, "--conversations", file],
|
|
6840
|
+
{
|
|
6841
|
+
stdio: "inherit"
|
|
6842
|
+
}
|
|
6843
|
+
);
|
|
6742
6844
|
} catch {
|
|
6743
6845
|
ctx.log?.(`${harness}: conversation import did not finish \u2014 re-run it any time with:`);
|
|
6744
6846
|
ctx.log?.(` node "${join24(ctx.dist, "deepen.js")}" --repo "${repo}" --conversations "${file}"`);
|