@vectorize-io/hindsight-coding-agents 0.8.1 → 0.8.3
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 +19 -5
- package/dist/antigravity-hook.js +98 -42
- package/dist/antigravity-statusline.js +6 -6
- package/dist/antigravity-stop-hook.js +135 -51
- package/dist/claude-hook.js +98 -42
- package/dist/claude-sessionstart-hook.js +386 -99
- package/dist/claude-stop-hook.js +135 -51
- package/dist/cline.js +433 -118
- package/dist/codebuddy-hook.js +98 -42
- package/dist/codebuddy-sessionstart-hook.js +386 -99
- package/dist/codebuddy-stop-hook.js +135 -51
- package/dist/codex-hook.js +98 -42
- package/dist/codex-sessionstart-hook.js +386 -99
- package/dist/codex-stop-hook.js +135 -51
- package/dist/copilot-hook.js +98 -42
- package/dist/copilot-sessionstart-hook.js +386 -99
- package/dist/copilot-stop-hook.js +135 -51
- package/dist/cursor-hook.js +98 -42
- package/dist/cursor-sessionstart-hook.js +386 -99
- package/dist/cursor-stop-hook.js +135 -51
- package/dist/daemon-start.js +10 -10
- package/dist/dcode-hook.js +98 -42
- package/dist/dcode-sessionstart-hook.js +386 -99
- package/dist/dcode-stop-hook.js +135 -51
- package/dist/deepen.js +193 -52
- package/dist/devin-hook.js +98 -42
- package/dist/devin-sessionstart-hook.js +386 -99
- package/dist/devin-stop-hook.js +135 -51
- package/dist/droid-hook.js +98 -42
- package/dist/droid-sessionstart-hook.js +386 -99
- package/dist/droid-stop-hook.js +135 -51
- package/dist/dsh.js +452 -125
- package/dist/grok-hook.js +98 -42
- package/dist/grok-sessionstart-hook.js +386 -99
- package/dist/grok-stop-hook.js +135 -51
- package/dist/hindsight-seed.js +6 -6
- package/dist/index.js +457 -137
- package/dist/installer.js +92 -80
- package/dist/kilo.js +457 -137
- package/dist/kimi-hook.js +98 -42
- package/dist/kimi-sessionstart-hook.js +386 -99
- package/dist/kimi-stop-hook.js +135 -51
- package/dist/mcp-server.js +180 -65
- package/dist/opencode2.js +613 -131
- package/dist/pi.js +433 -125
- package/dist/prime-agent.js +433 -125
- package/dist/qwen-hook.js +98 -42
- package/dist/qwen-sessionstart-hook.js +386 -99
- package/dist/qwen-stop-hook.js +135 -51
- package/dist/status.js +76 -18
- package/dist/survey-supervisor.js +73 -9
- package/dist/traecode-hook.js +98 -42
- package/dist/traecode-sessionstart-hook.js +386 -99
- package/dist/traecode-stop-hook.js +135 -51
- package/dist/workbuddy-hook.js +98 -42
- package/dist/workbuddy-sessionstart-hook.js +386 -99
- package/dist/workbuddy-stop-hook.js +135 -51
- package/dist/zcode-hook.js +98 -42
- package/dist/zcode-sessionstart-hook.js +386 -99
- package/dist/zcode-stop-hook.js +135 -51
- package/index.js +4 -1
- package/package.json +6 -4
- package/plugin.json +1 -1
- package/skill/SKILL.md +16 -4
package/dist/droid-hook.js
CHANGED
|
@@ -207,14 +207,14 @@ function probeGitLayout(directory) {
|
|
|
207
207
|
var PLACEHOLDER = /\{([a-zA-Z_]+)\}/g;
|
|
208
208
|
function applyTemplate(template, resolvers, what) {
|
|
209
209
|
return template.replace(PLACEHOLDER, (_, name) => {
|
|
210
|
-
const
|
|
211
|
-
if (!
|
|
210
|
+
const resolve4 = resolvers[name];
|
|
211
|
+
if (!resolve4) {
|
|
212
212
|
console.error(
|
|
213
213
|
`hindsight: unknown ${what} placeholder "{${name}}" \u2014 valid: ` + Object.keys(resolvers).sort().map((k) => `{${k}}`).join(", ")
|
|
214
214
|
);
|
|
215
215
|
return "unknown";
|
|
216
216
|
}
|
|
217
|
-
return
|
|
217
|
+
return resolve4();
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
|
|
@@ -657,11 +657,11 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
// package.json
|
|
660
|
-
var version = "0.8.
|
|
660
|
+
var version = "0.8.3";
|
|
661
661
|
|
|
662
662
|
// src/core/util.ts
|
|
663
|
-
import { accessSync, constants } from "fs";
|
|
664
|
-
import { delimiter, join as join6 } from "path";
|
|
663
|
+
import { accessSync, constants, statSync as statSync2 } from "fs";
|
|
664
|
+
import { delimiter, extname, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "path";
|
|
665
665
|
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
666
666
|
function semverGte(version2, min) {
|
|
667
667
|
const parts = (v) => {
|
|
@@ -939,15 +939,19 @@ var HindsightClient = class {
|
|
|
939
939
|
}
|
|
940
940
|
/**
|
|
941
941
|
* Whether this server honours `operation_id` on an async retain, and can therefore be appended to
|
|
942
|
-
* safely (see MIN_IDEMPOTENT_RETAIN_VERSION). Probed
|
|
942
|
+
* safely (see MIN_IDEMPOTENT_RETAIN_VERSION). Probed via the version endpoint; anything
|
|
943
943
|
* unreachable, unparseable or older answers "no", which costs efficiency, never correctness.
|
|
944
|
+
* Only a "yes" is cached: a long-lived plugin client would otherwise keep replacing for the rest
|
|
945
|
+
* of the process after one probe that hit a restarting server (#5735).
|
|
944
946
|
*/
|
|
945
947
|
async supportsIdempotentRetain() {
|
|
946
|
-
if (this.idempotentRetain
|
|
947
|
-
|
|
948
|
-
|
|
948
|
+
if (this.idempotentRetain) return true;
|
|
949
|
+
const supported = await this.probeIdempotentRetain();
|
|
950
|
+
if (supported || this.idempotentRetain === void 0) {
|
|
951
|
+
this.log(`server retain idempotency: ${supported ? "supported" : "unavailable"}`);
|
|
949
952
|
}
|
|
950
|
-
|
|
953
|
+
this.idempotentRetain = supported;
|
|
954
|
+
return supported;
|
|
951
955
|
}
|
|
952
956
|
/** `/v1/version` first: an ingress that routes only `/v1` to the API (the Helm chart's default)
|
|
953
957
|
* hands a bare `/version` to the control plane, whose HTML 404 or login redirect read as "no",
|
|
@@ -2082,7 +2086,7 @@ function sessionRootDir(harness, sessionId, cwd) {
|
|
|
2082
2086
|
}
|
|
2083
2087
|
|
|
2084
2088
|
// src/core/turn-journal.ts
|
|
2085
|
-
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync5, statSync as
|
|
2089
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync3, readFileSync as readFileSync5, statSync as statSync3 } from "fs";
|
|
2086
2090
|
import { tmpdir as tmpdir2 } from "os";
|
|
2087
2091
|
import { dirname as dirname6, join as join9 } from "path";
|
|
2088
2092
|
|
|
@@ -2130,7 +2134,7 @@ function appendJournalTurn(path, turn) {
|
|
|
2130
2134
|
const content = stripInjectedMemory(turn.content ?? "").trim();
|
|
2131
2135
|
if (!content) return;
|
|
2132
2136
|
try {
|
|
2133
|
-
if (
|
|
2137
|
+
if (statSync3(path).size >= JOURNAL_MAX_BYTES) return;
|
|
2134
2138
|
} catch {
|
|
2135
2139
|
}
|
|
2136
2140
|
const last = readJournalTranscript(path).at(-1);
|
|
@@ -2471,7 +2475,10 @@ import { join as join11 } from "path";
|
|
|
2471
2475
|
|
|
2472
2476
|
// src/core/git.ts
|
|
2473
2477
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
2474
|
-
import { resolve as
|
|
2478
|
+
import { resolve as resolve3 } from "path";
|
|
2479
|
+
var US = "";
|
|
2480
|
+
var RS = "";
|
|
2481
|
+
var GITLOG_FORMAT = `--format=%h${US}%ad${US}%an${US}%s${US}%b${RS}`;
|
|
2475
2482
|
|
|
2476
2483
|
// src/core/status.ts
|
|
2477
2484
|
import { execFileSync as execFileSync4 } from "child_process";
|
|
@@ -2479,11 +2486,14 @@ import { execFileSync as execFileSync4 } from "child_process";
|
|
|
2479
2486
|
// src/core/survey.ts
|
|
2480
2487
|
import { execFileSync as execFileSync3, spawn as realSpawn4 } from "child_process";
|
|
2481
2488
|
import { createHash as createHash4 } from "crypto";
|
|
2482
|
-
import { existsSync as existsSync3 } from "fs";
|
|
2489
|
+
import { existsSync as existsSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync3 } from "fs";
|
|
2483
2490
|
import { homedir as homedir4, tmpdir as tmpdir3 } from "os";
|
|
2484
2491
|
import { dirname as dirname8, join as join13 } from "path";
|
|
2485
2492
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
2486
2493
|
|
|
2494
|
+
// node_modules/smol-toml/dist/stringify.js
|
|
2495
|
+
var HAS_WELLFORMED = !!"".isWellFormed;
|
|
2496
|
+
|
|
2487
2497
|
// src/core/survey-lease.ts
|
|
2488
2498
|
import { spawn as realSpawn3 } from "child_process";
|
|
2489
2499
|
import { randomUUID } from "crypto";
|
|
@@ -2494,7 +2504,7 @@ import {
|
|
|
2494
2504
|
renameSync as renameSync3,
|
|
2495
2505
|
rmdirSync,
|
|
2496
2506
|
rmSync as rmSync2,
|
|
2497
|
-
statSync as
|
|
2507
|
+
statSync as statSync4,
|
|
2498
2508
|
unlinkSync,
|
|
2499
2509
|
utimesSync,
|
|
2500
2510
|
writeFileSync as writeFileSync2
|
|
@@ -2506,10 +2516,10 @@ import { spawn as realSpawn5 } from "child_process";
|
|
|
2506
2516
|
import {
|
|
2507
2517
|
existsSync as existsSync4,
|
|
2508
2518
|
mkdirSync as mkdirSync5,
|
|
2509
|
-
readFileSync as
|
|
2519
|
+
readFileSync as readFileSync8,
|
|
2510
2520
|
realpathSync as realpathSync2,
|
|
2511
2521
|
unlinkSync as unlinkSync2,
|
|
2512
|
-
writeFileSync as
|
|
2522
|
+
writeFileSync as writeFileSync4
|
|
2513
2523
|
} from "fs";
|
|
2514
2524
|
import { homedir as homedir5, tmpdir as tmpdir4 } from "os";
|
|
2515
2525
|
import { dirname as dirname9, join as join14 } from "path";
|
|
@@ -2520,7 +2530,7 @@ var NPM_VIEW_HARD_DEADLINE_MS = NPM_VIEW_TIMEOUT_MS + 1e3;
|
|
|
2520
2530
|
var LOCK_STALE_MS = 10 * 60 * 1e3;
|
|
2521
2531
|
|
|
2522
2532
|
// src/core/skill-sync.ts
|
|
2523
|
-
import { cpSync, existsSync as existsSync6, readFileSync as
|
|
2533
|
+
import { cpSync, existsSync as existsSync6, readFileSync as readFileSync9 } from "fs";
|
|
2524
2534
|
import { homedir as homedir6 } from "os";
|
|
2525
2535
|
import { dirname as dirname10, join as join16 } from "path";
|
|
2526
2536
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
@@ -2530,15 +2540,15 @@ import { existsSync as existsSync5 } from "fs";
|
|
|
2530
2540
|
import { join as join15 } from "path";
|
|
2531
2541
|
|
|
2532
2542
|
// src/core/legacy.ts
|
|
2533
|
-
import { existsSync as existsSync7, readFileSync as
|
|
2543
|
+
import { existsSync as existsSync7, readFileSync as readFileSync10 } from "fs";
|
|
2534
2544
|
import { homedir as homedir7 } from "os";
|
|
2535
|
-
import { join as join17, relative, isAbsolute as
|
|
2545
|
+
import { join as join17, relative, isAbsolute as isAbsolute3 } from "path";
|
|
2536
2546
|
|
|
2537
2547
|
// src/core/traecode-mcp.ts
|
|
2538
2548
|
import { execFileSync as execFileSync5 } from "child_process";
|
|
2539
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as
|
|
2549
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync11, readdirSync as readdirSync2, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "fs";
|
|
2540
2550
|
import { homedir as homedir8 } from "os";
|
|
2541
|
-
import { dirname as dirname11, isAbsolute as
|
|
2551
|
+
import { dirname as dirname11, isAbsolute as isAbsolute4, join as join18 } from "path";
|
|
2542
2552
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
2543
2553
|
var MCP_SERVER_NAME = "hindsight";
|
|
2544
2554
|
var MCP_FILE_REL = join18(".trae", "mcp.json");
|
|
@@ -2573,7 +2583,7 @@ function gateStateFile() {
|
|
|
2573
2583
|
}
|
|
2574
2584
|
function readGateState(opts = {}) {
|
|
2575
2585
|
try {
|
|
2576
|
-
return JSON.parse(
|
|
2586
|
+
return JSON.parse(readFileSync11(opts.stateFile ?? gateStateFile(), "utf8"));
|
|
2577
2587
|
} catch {
|
|
2578
2588
|
return {};
|
|
2579
2589
|
}
|
|
@@ -2581,7 +2591,7 @@ function readGateState(opts = {}) {
|
|
|
2581
2591
|
function workspaceMcpGateState(settingsPath) {
|
|
2582
2592
|
let raw;
|
|
2583
2593
|
try {
|
|
2584
|
-
raw =
|
|
2594
|
+
raw = readFileSync11(settingsPath, "utf8");
|
|
2585
2595
|
} catch {
|
|
2586
2596
|
return "unknown";
|
|
2587
2597
|
}
|
|
@@ -2603,7 +2613,7 @@ function workspaceMcpHint(opts = {}) {
|
|
|
2603
2613
|
if (typeof state.lastHint === "number" && now - state.lastHint < HINT_MIN_INTERVAL_MS) {
|
|
2604
2614
|
return void 0;
|
|
2605
2615
|
}
|
|
2606
|
-
|
|
2616
|
+
writeFileSync5(
|
|
2607
2617
|
opts.stateFile ?? gateStateFile(),
|
|
2608
2618
|
JSON.stringify({ ...state, lastHint: now }, null, 2) + "\n"
|
|
2609
2619
|
);
|
|
@@ -2621,10 +2631,10 @@ function gitignoreCovers(lines) {
|
|
|
2621
2631
|
function ensureGitignored(repo) {
|
|
2622
2632
|
const gitignore = join18(repo, ".gitignore");
|
|
2623
2633
|
if (!existsSync8(gitignore)) return;
|
|
2624
|
-
const current2 =
|
|
2634
|
+
const current2 = readFileSync11(gitignore, "utf8");
|
|
2625
2635
|
if (gitignoreCovers(current2.split("\n"))) return;
|
|
2626
2636
|
const addition = (current2.endsWith("\n") || current2 === "" ? "" : "\n") + "# hindsight MCP registration (machine-specific)\n.trae/mcp.json\n";
|
|
2627
|
-
|
|
2637
|
+
writeFileSync5(gitignore, current2 + addition);
|
|
2628
2638
|
}
|
|
2629
2639
|
function ensureTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
2630
2640
|
registerTraecodeWorkspaceMcp(cwd, opts);
|
|
@@ -2634,7 +2644,7 @@ function ensureTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
|
2634
2644
|
function registerTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
2635
2645
|
try {
|
|
2636
2646
|
const home = opts.home ?? homedir8();
|
|
2637
|
-
if (!cwd || !
|
|
2647
|
+
if (!cwd || !isAbsolute4(cwd) || dirname11(cwd) === cwd || cwd === home) return "skipped";
|
|
2638
2648
|
const dist = opts.dist ?? bundledDistDir();
|
|
2639
2649
|
const script = join18(dist, "mcp-server.js");
|
|
2640
2650
|
if (!existsSync8(script)) return "skipped";
|
|
@@ -2642,7 +2652,7 @@ function registerTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
|
2642
2652
|
let doc = {};
|
|
2643
2653
|
let exists = false;
|
|
2644
2654
|
try {
|
|
2645
|
-
doc = JSON.parse(
|
|
2655
|
+
doc = JSON.parse(readFileSync11(file, "utf8"));
|
|
2646
2656
|
exists = true;
|
|
2647
2657
|
} catch {
|
|
2648
2658
|
if (existsSync8(file)) return "skipped";
|
|
@@ -2672,7 +2682,7 @@ function registerTraecodeWorkspaceMcp(cwd, opts = {}) {
|
|
|
2672
2682
|
if (existing !== void 0 && canon(merged) === canon(existing)) return "current";
|
|
2673
2683
|
servers[MCP_SERVER_NAME] = merged;
|
|
2674
2684
|
mkdirSync6(dirname11(file), { recursive: true });
|
|
2675
|
-
|
|
2685
|
+
writeFileSync5(file, JSON.stringify(doc, null, 2) + "\n");
|
|
2676
2686
|
if (!exists) ensureGitignored(cwd);
|
|
2677
2687
|
diag("traecode", "workspace_mcp_registered", { cwd, file });
|
|
2678
2688
|
return "registered";
|
|
@@ -2698,7 +2708,7 @@ function findWorkspaceStorageDir(storage, repo) {
|
|
|
2698
2708
|
}
|
|
2699
2709
|
for (const name of entries) {
|
|
2700
2710
|
try {
|
|
2701
|
-
const doc = JSON.parse(
|
|
2711
|
+
const doc = JSON.parse(readFileSync11(join18(storage, name, "workspace.json"), "utf8"));
|
|
2702
2712
|
if (typeof doc.folder !== "string") continue;
|
|
2703
2713
|
let folder;
|
|
2704
2714
|
try {
|
|
@@ -2716,7 +2726,7 @@ function findWorkspaceStorageDir(storage, repo) {
|
|
|
2716
2726
|
function ensureWorkspaceMcpEnabled(cwd, opts = {}) {
|
|
2717
2727
|
try {
|
|
2718
2728
|
const home = opts.home ?? homedir8();
|
|
2719
|
-
if (!cwd || !
|
|
2729
|
+
if (!cwd || !isAbsolute4(cwd) || dirname11(cwd) === cwd || cwd === home) return "failed";
|
|
2720
2730
|
const dir = findWorkspaceStorageDir(traecodeWorkspaceStorageDir(home), cwd);
|
|
2721
2731
|
if (!dir) return "failed";
|
|
2722
2732
|
const db = join18(dir, "state.vscdb");
|
|
@@ -2751,7 +2761,7 @@ function workspaceEnableHint(opts = {}) {
|
|
|
2751
2761
|
if (typeof state.lastEnableHint === "number" && now - state.lastEnableHint < HINT_MIN_INTERVAL_MS) {
|
|
2752
2762
|
return void 0;
|
|
2753
2763
|
}
|
|
2754
|
-
|
|
2764
|
+
writeFileSync5(
|
|
2755
2765
|
opts.stateFile ?? gateStateFile(),
|
|
2756
2766
|
JSON.stringify({ ...state, lastEnableHint: now }, null, 2) + "\n"
|
|
2757
2767
|
);
|
|
@@ -2933,6 +2943,10 @@ function readCursorTranscript(path) {
|
|
|
2933
2943
|
}
|
|
2934
2944
|
|
|
2935
2945
|
// src/core/transcript-antigravity.ts
|
|
2946
|
+
function unwrapUserRequest(text) {
|
|
2947
|
+
const request = /<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/.exec(text);
|
|
2948
|
+
return request ? request[1] : text.replace(/<ADDITIONAL_METADATA>[\s\S]*?<\/ADDITIONAL_METADATA>/g, "");
|
|
2949
|
+
}
|
|
2936
2950
|
function readAntigravityTranscript(path) {
|
|
2937
2951
|
if (!path) return [];
|
|
2938
2952
|
const turns = [];
|
|
@@ -2942,7 +2956,8 @@ function readAntigravityTranscript(path) {
|
|
|
2942
2956
|
const role = event.role ?? event.message?.role ?? event.type;
|
|
2943
2957
|
const normalizedRole = role === "user" || role === "USER_INPUT" ? "user" : role === "assistant" || role === "model" || role === "PLANNER_RESPONSE" ? "assistant" : void 0;
|
|
2944
2958
|
const content = event.content ?? event.text ?? event.message?.content ?? event.message?.text;
|
|
2945
|
-
const
|
|
2959
|
+
const text = typeof content === "string" ? stripInjectedMemory(content) : "";
|
|
2960
|
+
const clean = (normalizedRole === "user" ? unwrapUserRequest(text) : text).trim();
|
|
2946
2961
|
if (normalizedRole && clean) {
|
|
2947
2962
|
turns.push({
|
|
2948
2963
|
role: normalizedRole,
|
|
@@ -2973,7 +2988,7 @@ function readCopilotTranscript(path) {
|
|
|
2973
2988
|
}
|
|
2974
2989
|
|
|
2975
2990
|
// src/core/transcript-grok.ts
|
|
2976
|
-
import { existsSync as existsSync9, readFileSync as
|
|
2991
|
+
import { existsSync as existsSync9, readFileSync as readFileSync12, readdirSync as readdirSync3 } from "fs";
|
|
2977
2992
|
import { homedir as homedir9 } from "os";
|
|
2978
2993
|
import { join as join19 } from "path";
|
|
2979
2994
|
var CHAT_HISTORY = "chat_history.jsonl";
|
|
@@ -2984,7 +2999,7 @@ function grokTranscriptPath(cwd, sessionId, grokHome = process.env.GROK_HOME ||
|
|
|
2984
2999
|
try {
|
|
2985
3000
|
for (const candidate of readdirSync3(sessionsDir)) {
|
|
2986
3001
|
const directory = join19(sessionsDir, candidate);
|
|
2987
|
-
if (
|
|
3002
|
+
if (readFileSync12(join19(directory, ".cwd"), "utf8").trim() === cwd) {
|
|
2988
3003
|
return join19(directory, sessionId, CHAT_HISTORY);
|
|
2989
3004
|
}
|
|
2990
3005
|
}
|
|
@@ -3335,7 +3350,7 @@ function readDroidTranscript(path) {
|
|
|
3335
3350
|
}
|
|
3336
3351
|
|
|
3337
3352
|
// src/core/transcript-zcode.ts
|
|
3338
|
-
import { readFileSync as
|
|
3353
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
3339
3354
|
function messageText(content) {
|
|
3340
3355
|
if (typeof content === "string") return content.trim();
|
|
3341
3356
|
if (!Array.isArray(content)) return "";
|
|
@@ -3345,7 +3360,7 @@ function readZcodeTranscript(path) {
|
|
|
3345
3360
|
if (!path) return [];
|
|
3346
3361
|
let body;
|
|
3347
3362
|
try {
|
|
3348
|
-
body =
|
|
3363
|
+
body = readFileSync13(path, "utf8");
|
|
3349
3364
|
} catch {
|
|
3350
3365
|
return [];
|
|
3351
3366
|
}
|
|
@@ -3566,12 +3581,12 @@ function readWorkbuddyTranscript(path) {
|
|
|
3566
3581
|
}
|
|
3567
3582
|
|
|
3568
3583
|
// src/core/transcript-codebuddy-ide.ts
|
|
3569
|
-
import { readFileSync as
|
|
3584
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
3570
3585
|
import { basename as basename3, dirname as dirname12, join as join22 } from "path";
|
|
3571
3586
|
var IDE_CONTEXT_RE = /<(user_info|git_status|additional_data|system_reminder)\b[\s\S]*?<\/\1>/g;
|
|
3572
3587
|
function readJson(path) {
|
|
3573
3588
|
try {
|
|
3574
|
-
return JSON.parse(
|
|
3589
|
+
return JSON.parse(readFileSync14(path, "utf8"));
|
|
3575
3590
|
} catch {
|
|
3576
3591
|
return void 0;
|
|
3577
3592
|
}
|
|
@@ -3785,7 +3800,9 @@ var HOOK_HARNESSES = {
|
|
|
3785
3800
|
parse: (ev) => ({
|
|
3786
3801
|
sessionId: ev.session_id,
|
|
3787
3802
|
transcriptPath: ev.transcript_path,
|
|
3788
|
-
cwd: ev.cwd
|
|
3803
|
+
cwd: ev.cwd,
|
|
3804
|
+
// The transcript may not hold the final reply yet when Stop fires after a tool call (#5790).
|
|
3805
|
+
lastAssistantMessage: ev.last_assistant_message
|
|
3789
3806
|
})
|
|
3790
3807
|
}
|
|
3791
3808
|
},
|
|
@@ -4268,3 +4285,42 @@ var runHarnessPrompt = (harness) => runHook(HOOK_HARNESSES[harness].prompt);
|
|
|
4268
4285
|
|
|
4269
4286
|
// src/droid-hook.ts
|
|
4270
4287
|
void runHarnessPrompt("factory-droid");
|
|
4288
|
+
/*! Bundled license information:
|
|
4289
|
+
|
|
4290
|
+
smol-toml/dist/error.js:
|
|
4291
|
+
smol-toml/dist/primitive.js:
|
|
4292
|
+
smol-toml/dist/date.js:
|
|
4293
|
+
smol-toml/dist/extract.js:
|
|
4294
|
+
smol-toml/dist/util.js:
|
|
4295
|
+
smol-toml/dist/struct.js:
|
|
4296
|
+
smol-toml/dist/parse.js:
|
|
4297
|
+
smol-toml/dist/stringify.js:
|
|
4298
|
+
smol-toml/dist/index.js:
|
|
4299
|
+
(*!
|
|
4300
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
4301
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4302
|
+
*
|
|
4303
|
+
* Redistribution and use in source and binary forms, with or without
|
|
4304
|
+
* modification, are permitted provided that the following conditions are met:
|
|
4305
|
+
*
|
|
4306
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
4307
|
+
* list of conditions and the following disclaimer.
|
|
4308
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
4309
|
+
* this list of conditions and the following disclaimer in the
|
|
4310
|
+
* documentation and/or other materials provided with the distribution.
|
|
4311
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
4312
|
+
* may be used to endorse or promote products derived from this software without
|
|
4313
|
+
* specific prior written permission.
|
|
4314
|
+
*
|
|
4315
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
4316
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
4317
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
4318
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
4319
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
4320
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
4321
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
4322
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
4323
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
4324
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
4325
|
+
*)
|
|
4326
|
+
*/
|