@vectorize-io/hindsight-coding-agents 0.5.3 → 0.5.4

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.
Files changed (46) hide show
  1. package/dist/antigravity-hook.js +67 -33
  2. package/dist/antigravity-stop-hook.js +61 -31
  3. package/dist/claude-hook.js +67 -33
  4. package/dist/claude-sessionstart-hook.js +239 -71
  5. package/dist/claude-stop-hook.js +61 -31
  6. package/dist/cline.js +213 -50
  7. package/dist/codex-hook.js +67 -33
  8. package/dist/codex-sessionstart-hook.js +239 -71
  9. package/dist/codex-stop-hook.js +61 -31
  10. package/dist/copilot-hook.js +67 -33
  11. package/dist/copilot-sessionstart-hook.js +239 -71
  12. package/dist/copilot-stop-hook.js +61 -31
  13. package/dist/cursor-hook.js +67 -33
  14. package/dist/cursor-sessionstart-hook.js +239 -71
  15. package/dist/cursor-stop-hook.js +61 -31
  16. package/dist/dcode-hook.js +67 -33
  17. package/dist/dcode-sessionstart-hook.js +239 -71
  18. package/dist/dcode-stop-hook.js +61 -31
  19. package/dist/deepen.js +40 -13
  20. package/dist/devin-hook.js +67 -33
  21. package/dist/devin-sessionstart-hook.js +239 -71
  22. package/dist/devin-stop-hook.js +61 -31
  23. package/dist/droid-hook.js +67 -33
  24. package/dist/droid-sessionstart-hook.js +239 -71
  25. package/dist/droid-stop-hook.js +61 -31
  26. package/dist/dsh.js +215 -52
  27. package/dist/grok-hook.js +67 -33
  28. package/dist/grok-sessionstart-hook.js +239 -71
  29. package/dist/grok-stop-hook.js +61 -31
  30. package/dist/index.js +215 -52
  31. package/dist/installer.js +1030 -268
  32. package/dist/kilo.js +215 -52
  33. package/dist/mcp-server.js +33 -6
  34. package/dist/opencode2.js +215 -52
  35. package/dist/pi.js +214 -51
  36. package/dist/prime-agent.js +214 -51
  37. package/dist/qwen-hook.js +67 -33
  38. package/dist/qwen-sessionstart-hook.js +239 -71
  39. package/dist/qwen-stop-hook.js +61 -31
  40. package/dist/status.js +31 -4
  41. package/dist/survey-supervisor.js +81 -0
  42. package/dist/zcode-hook.js +67 -33
  43. package/dist/zcode-sessionstart-hook.js +239 -71
  44. package/dist/zcode-stop-hook.js +61 -31
  45. package/package.json +2 -1
  46. package/plugin.json +1 -1
@@ -922,9 +922,16 @@ var HindsightClient = class {
922
922
  body: JSON.stringify({ query, budget: opts.budget ?? "high" }),
923
923
  signal: ctrl.signal
924
924
  });
925
- if (!resp.ok) throw new Error(`reflect ${resp.status}${this.authHint(resp.status)}`);
925
+ if (!resp.ok)
926
+ throw new Error(
927
+ `reflect ${resp.status} ${(await resp.text()).slice(0, 1e3)}${this.authHint(resp.status)}`
928
+ );
926
929
  const data = await resp.json();
927
930
  return (data.text || "").trim();
931
+ } catch (e) {
932
+ if (ctrl.signal.aborted)
933
+ throw new Error(`reflect timed out after ${opts.timeoutMs}ms`, { cause: e });
934
+ throw e;
928
935
  } finally {
929
936
  clearTimeout(timer);
930
937
  }
@@ -2173,7 +2180,7 @@ async function runRetainHook(spec, makeClient = (o) => new HindsightClient(o)) {
2173
2180
  }
2174
2181
 
2175
2182
  // src/core/session-start.ts
2176
- import { readFileSync as readFileSync9 } from "fs";
2183
+ import { readFileSync as readFileSync10 } from "fs";
2177
2184
 
2178
2185
  // src/core/git.ts
2179
2186
  import { execFileSync as execFileSync2 } from "child_process";
@@ -2183,24 +2190,42 @@ import { resolve as resolve2 } from "path";
2183
2190
  import { execFileSync as execFileSync3 } from "child_process";
2184
2191
 
2185
2192
  // src/core/survey.ts
2186
- import { spawn as realSpawn3 } from "child_process";
2193
+ import { spawn as realSpawn4 } from "child_process";
2194
+ import { createHash as createHash4 } from "crypto";
2187
2195
  import { existsSync as existsSync3 } from "fs";
2188
- import { homedir as homedir3 } from "os";
2189
- import { dirname as dirname8, join as join10 } from "path";
2196
+ import { homedir as homedir3, tmpdir as tmpdir4 } from "os";
2197
+ import { dirname as dirname8, join as join11 } from "path";
2190
2198
  import { fileURLToPath as fileURLToPath3 } from "url";
2191
2199
 
2200
+ // src/core/survey-lease.ts
2201
+ import { spawn as realSpawn3 } from "child_process";
2202
+ import { randomUUID } from "crypto";
2203
+ import {
2204
+ mkdirSync as mkdirSync4,
2205
+ mkdtempSync,
2206
+ readdirSync,
2207
+ renameSync as renameSync2,
2208
+ rmdirSync,
2209
+ rmSync as rmSync2,
2210
+ statSync as statSync3,
2211
+ unlinkSync,
2212
+ utimesSync,
2213
+ writeFileSync as writeFileSync2
2214
+ } from "fs";
2215
+ import { join as join10 } from "path";
2216
+
2192
2217
  // src/core/auto-update.ts
2193
- import { spawn as realSpawn4 } from "child_process";
2218
+ import { spawn as realSpawn5 } from "child_process";
2194
2219
  import {
2195
2220
  existsSync as existsSync4,
2196
- mkdirSync as mkdirSync4,
2221
+ mkdirSync as mkdirSync5,
2197
2222
  readFileSync as readFileSync7,
2198
2223
  realpathSync as realpathSync2,
2199
- unlinkSync,
2200
- writeFileSync as writeFileSync2
2224
+ unlinkSync as unlinkSync2,
2225
+ writeFileSync as writeFileSync3
2201
2226
  } from "fs";
2202
- import { homedir as homedir4, tmpdir as tmpdir4 } from "os";
2203
- import { dirname as dirname9, join as join11 } from "path";
2227
+ import { homedir as homedir4, tmpdir as tmpdir5 } from "os";
2228
+ import { dirname as dirname9, join as join12 } from "path";
2204
2229
  import { fileURLToPath as fileURLToPath4 } from "url";
2205
2230
  var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
2206
2231
  var LOCK_STALE_MS = 10 * 60 * 1e3;
@@ -2208,9 +2233,14 @@ var LOCK_STALE_MS = 10 * 60 * 1e3;
2208
2233
  // src/core/skill-sync.ts
2209
2234
  import { cpSync, existsSync as existsSync5, readFileSync as readFileSync8 } from "fs";
2210
2235
  import { homedir as homedir5 } from "os";
2211
- import { dirname as dirname10, join as join12 } from "path";
2236
+ import { dirname as dirname10, join as join13 } from "path";
2212
2237
  import { fileURLToPath as fileURLToPath5 } from "url";
2213
2238
 
2239
+ // src/core/legacy.ts
2240
+ import { existsSync as existsSync6, readFileSync as readFileSync9 } from "fs";
2241
+ import { homedir as homedir6 } from "os";
2242
+ import { join as join14, relative, isAbsolute as isAbsolute2 } from "path";
2243
+
2214
2244
  // src/core/transcript-codex.ts
2215
2245
  function isSyntheticUserText(text) {
2216
2246
  const s = text.trimStart();
@@ -2341,19 +2371,19 @@ function readCopilotTranscript(path) {
2341
2371
  }
2342
2372
 
2343
2373
  // src/core/transcript-grok.ts
2344
- import { existsSync as existsSync6, readFileSync as readFileSync10, readdirSync } from "fs";
2345
- import { homedir as homedir6 } from "os";
2346
- import { join as join13 } from "path";
2374
+ import { existsSync as existsSync7, readFileSync as readFileSync11, readdirSync as readdirSync2 } from "fs";
2375
+ import { homedir as homedir7 } from "os";
2376
+ import { join as join15 } from "path";
2347
2377
  var CHAT_HISTORY = "chat_history.jsonl";
2348
- function grokTranscriptPath(cwd, sessionId, grokHome = process.env.GROK_HOME || join13(homedir6(), ".grok")) {
2349
- const sessionsDir = join13(grokHome, "sessions");
2350
- const direct = join13(sessionsDir, encodeURIComponent(cwd), sessionId, CHAT_HISTORY);
2351
- if (existsSync6(direct)) return direct;
2378
+ function grokTranscriptPath(cwd, sessionId, grokHome = process.env.GROK_HOME || join15(homedir7(), ".grok")) {
2379
+ const sessionsDir = join15(grokHome, "sessions");
2380
+ const direct = join15(sessionsDir, encodeURIComponent(cwd), sessionId, CHAT_HISTORY);
2381
+ if (existsSync7(direct)) return direct;
2352
2382
  try {
2353
- for (const candidate of readdirSync(sessionsDir)) {
2354
- const directory = join13(sessionsDir, candidate);
2355
- if (readFileSync10(join13(directory, ".cwd"), "utf8").trim() === cwd) {
2356
- return join13(directory, sessionId, CHAT_HISTORY);
2383
+ for (const candidate of readdirSync2(sessionsDir)) {
2384
+ const directory = join15(sessionsDir, candidate);
2385
+ if (readFileSync11(join15(directory, ".cwd"), "utf8").trim() === cwd) {
2386
+ return join15(directory, sessionId, CHAT_HISTORY);
2357
2387
  }
2358
2388
  }
2359
2389
  } catch {
@@ -2388,12 +2418,12 @@ function readGrokTranscript(path) {
2388
2418
  }
2389
2419
 
2390
2420
  // src/core/transcript-devin.ts
2391
- import { existsSync as existsSync7 } from "fs";
2421
+ import { existsSync as existsSync8 } from "fs";
2392
2422
  import { createRequire } from "module";
2393
- import { homedir as homedir7 } from "os";
2394
- import { join as join14 } from "path";
2395
- function devinSessionDb(home = homedir7()) {
2396
- return join14(home, ".local", "share", "devin", "cli", "sessions.db");
2423
+ import { homedir as homedir8 } from "os";
2424
+ import { join as join16 } from "path";
2425
+ function devinSessionDb(home = homedir8()) {
2426
+ return join16(home, ".local", "share", "devin", "cli", "sessions.db");
2397
2427
  }
2398
2428
  function parseDevinMessages(nodes) {
2399
2429
  const messages = /* @__PURE__ */ new Map();
@@ -2430,7 +2460,7 @@ function readDevinTranscript(sessionId, dbPath = devinSessionDb()) {
2430
2460
  diag("devin-cli", "sqlite_unavailable", { node: process.version, dbPath });
2431
2461
  return [];
2432
2462
  }
2433
- if (!existsSync7(dbPath)) {
2463
+ if (!existsSync8(dbPath)) {
2434
2464
  diag("devin-cli", "session_db_missing", { dbPath });
2435
2465
  return [];
2436
2466
  }
@@ -2703,7 +2733,7 @@ function readDroidTranscript(path) {
2703
2733
  }
2704
2734
 
2705
2735
  // src/core/transcript-zcode.ts
2706
- import { readFileSync as readFileSync11 } from "fs";
2736
+ import { readFileSync as readFileSync12 } from "fs";
2707
2737
  function messageText2(content) {
2708
2738
  if (typeof content === "string") return content.trim();
2709
2739
  if (!Array.isArray(content)) return "";
@@ -2713,7 +2743,7 @@ function readZcodeTranscript(path) {
2713
2743
  if (!path) return [];
2714
2744
  let body;
2715
2745
  try {
2716
- body = readFileSync11(path, "utf8");
2746
+ body = readFileSync12(path, "utf8");
2717
2747
  } catch {
2718
2748
  return [];
2719
2749
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-coding-agents",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vectorize-io/hindsight.git",
@@ -87,6 +87,7 @@
87
87
  "@modelcontextprotocol/sdk": "^1.29.0",
88
88
  "@vectorize-io/hindsight-all": "^0.8.6",
89
89
  "jsonc-parser": "^3.3.1",
90
+ "smol-toml": "^1.8.0",
90
91
  "zod": "^4.4.3"
91
92
  },
92
93
  "devDependencies": {
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hindsight-coding-agents",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Long-term project memory for coding agents",
5
5
  "skills": "./skill",
6
6
  "hooks": "./hooks/hooks.json",