@vectorize-io/hindsight-coding-agents 0.8.6 → 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.
Files changed (62) hide show
  1. package/README.md +31 -21
  2. package/dist/antigravity-hook.js +278 -190
  3. package/dist/antigravity-statusline.js +30 -24
  4. package/dist/antigravity-stop-hook.js +271 -169
  5. package/dist/claude-hook.js +278 -190
  6. package/dist/claude-sessionstart-hook.js +301 -212
  7. package/dist/claude-stop-hook.js +271 -169
  8. package/dist/cline.js +258 -214
  9. package/dist/codebuddy-hook.js +278 -190
  10. package/dist/codebuddy-sessionstart-hook.js +301 -212
  11. package/dist/codebuddy-stop-hook.js +271 -169
  12. package/dist/codex-hook.js +278 -190
  13. package/dist/codex-sessionstart-hook.js +301 -212
  14. package/dist/codex-stop-hook.js +271 -169
  15. package/dist/copilot-hook.js +278 -190
  16. package/dist/copilot-sessionstart-hook.js +301 -212
  17. package/dist/copilot-stop-hook.js +271 -169
  18. package/dist/cursor-hook.js +278 -190
  19. package/dist/cursor-sessionstart-hook.js +301 -212
  20. package/dist/cursor-stop-hook.js +271 -169
  21. package/dist/daemon-start.js +20 -16
  22. package/dist/dcode-hook.js +278 -190
  23. package/dist/dcode-sessionstart-hook.js +301 -212
  24. package/dist/dcode-stop-hook.js +271 -169
  25. package/dist/deepen.js +98 -83
  26. package/dist/devin-hook.js +278 -190
  27. package/dist/devin-sessionstart-hook.js +301 -212
  28. package/dist/devin-stop-hook.js +271 -169
  29. package/dist/droid-hook.js +278 -190
  30. package/dist/droid-sessionstart-hook.js +301 -212
  31. package/dist/droid-stop-hook.js +271 -169
  32. package/dist/dsh.js +309 -251
  33. package/dist/grok-hook.js +278 -190
  34. package/dist/grok-sessionstart-hook.js +301 -212
  35. package/dist/grok-stop-hook.js +271 -169
  36. package/dist/hindsight-seed.js +35 -26
  37. package/dist/index.js +310 -252
  38. package/dist/installer.js +172 -68
  39. package/dist/kilo.js +310 -252
  40. package/dist/kimi-hook.js +278 -190
  41. package/dist/kimi-sessionstart-hook.js +301 -212
  42. package/dist/kimi-stop-hook.js +271 -169
  43. package/dist/mcp-server.js +165 -148
  44. package/dist/opencode2.js +310 -252
  45. package/dist/pi.js +309 -251
  46. package/dist/prime-agent.js +309 -251
  47. package/dist/qwen-hook.js +278 -190
  48. package/dist/qwen-sessionstart-hook.js +301 -212
  49. package/dist/qwen-stop-hook.js +271 -169
  50. package/dist/status.js +134 -117
  51. package/dist/traecode-hook.js +278 -190
  52. package/dist/traecode-sessionstart-hook.js +301 -212
  53. package/dist/traecode-stop-hook.js +271 -169
  54. package/dist/workbuddy-hook.js +278 -190
  55. package/dist/workbuddy-sessionstart-hook.js +301 -212
  56. package/dist/workbuddy-stop-hook.js +271 -169
  57. package/dist/zcode-hook.js +278 -190
  58. package/dist/zcode-sessionstart-hook.js +301 -212
  59. package/dist/zcode-stop-hook.js +271 -169
  60. package/package.json +2 -1
  61. package/plugin.json +1 -1
  62. package/skill/SKILL.md +31 -26
@@ -7,16 +7,25 @@ import { join as join7 } from "path";
7
7
 
8
8
  // src/core/seed.ts
9
9
  import { spawn as realSpawn } from "child_process";
10
- import { dirname, join } from "path";
10
+ import { dirname, join as join2 } from "path";
11
11
  import { fileURLToPath } from "url";
12
+
13
+ // src/core/util.ts
14
+ import { accessSync, constants, statSync } from "fs";
15
+ import { delimiter, extname, isAbsolute, join, resolve } from "path";
16
+ function nodeBinary() {
17
+ return process.versions.bun || process.versions.electron ? "node" : process.execPath;
18
+ }
19
+
20
+ // src/core/seed.ts
12
21
  var DEFAULT_SEED_LIMIT = 300;
13
22
  function startBackgroundSeed(repoDir, opts = {}) {
14
23
  try {
15
24
  const spawnFn = opts.spawn ?? realSpawn;
16
- const enginePath = opts.enginePath ?? join(dirname(fileURLToPath(import.meta.url)), "deepen.js");
25
+ const enginePath = opts.enginePath ?? join2(dirname(fileURLToPath(import.meta.url)), "deepen.js");
17
26
  const limit = opts.limit ?? DEFAULT_SEED_LIMIT;
18
27
  const child = spawnFn(
19
- "node",
28
+ nodeBinary(),
20
29
  [
21
30
  enginePath,
22
31
  "--repo",
@@ -51,24 +60,24 @@ function seedControl(command2, args) {
51
60
  // src/core/bank.ts
52
61
  import { existsSync } from "fs";
53
62
  import { homedir as homedir2 } from "os";
54
- import { basename, dirname as dirname4, join as join5, normalize, sep } from "path";
63
+ import { basename, dirname as dirname4, join as join6, normalize, sep } from "path";
55
64
 
56
65
  // src/core/diag.ts
57
66
  import { readFileSync } from "fs";
58
- import { join as join3 } from "path";
67
+ import { join as join4 } from "path";
59
68
 
60
69
  // src/core/log.ts
61
- import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
70
+ import { appendFileSync, mkdirSync, renameSync, statSync as statSync2 } from "fs";
62
71
  import { homedir } from "os";
63
- import { dirname as dirname2, join as join2 } from "path";
72
+ import { dirname as dirname2, join as join3 } from "path";
64
73
  function logsDir() {
65
- return join2(homedir(), ".hindsight", "coding-agents-logs");
74
+ return join3(homedir(), ".hindsight", "coding-agents-logs");
66
75
  }
67
76
  var LOG_MAX_BYTES = 10 * 1024 * 1024;
68
77
  function appendLogLine(file, text) {
69
78
  mkdirSync(dirname2(file), { recursive: true, mode: 448 });
70
79
  try {
71
- if (statSync(file).size >= LOG_MAX_BYTES) renameSync(file, `${file}.1`);
80
+ if (statSync2(file).size >= LOG_MAX_BYTES) renameSync(file, `${file}.1`);
72
81
  } catch {
73
82
  }
74
83
  appendFileSync(file, text, { mode: 384 });
@@ -78,7 +87,7 @@ var current = ["debug", "info", "warn", "error"].find(
78
87
  (l) => l === process.env.HINDSIGHT_LOG_LEVEL
79
88
  ) ?? "info";
80
89
  function logFilePath() {
81
- return process.env.HINDSIGHT_LOG_FILE || join2(logsDir(), "plugin.log");
90
+ return process.env.HINDSIGHT_LOG_FILE || join3(logsDir(), "plugin.log");
82
91
  }
83
92
  function write(level, scope, msg, extra) {
84
93
  if (WEIGHT[level] < WEIGHT[current]) return;
@@ -99,7 +108,7 @@ var log = {
99
108
 
100
109
  // src/core/diag.ts
101
110
  function diagFilePath() {
102
- return process.env.HINDSIGHT_DIAG_FILE || join3(logsDir(), "diag.jsonl");
111
+ return process.env.HINDSIGHT_DIAG_FILE || join4(logsDir(), "diag.jsonl");
103
112
  }
104
113
  function diag(harness, event, extra = {}) {
105
114
  log.debug(harness, `diag:${event}`, extra);
@@ -114,7 +123,7 @@ function diag(harness, event, extra = {}) {
114
123
 
115
124
  // src/core/git-layout.ts
116
125
  import { lstatSync, readFileSync as readFileSync2, realpathSync } from "fs";
117
- import { dirname as dirname3, isAbsolute, join as join4, resolve } from "path";
126
+ import { dirname as dirname3, isAbsolute as isAbsolute2, join as join5, resolve as resolve2 } from "path";
118
127
  var TRANSIENT = /* @__PURE__ */ new Set(["EAGAIN", "EMFILE", "ENFILE", "EBUSY", "EINTR", "EIO", "ETIMEDOUT"]);
119
128
  var ATTEMPTS = 3;
120
129
  var BACKOFF_MS = 20;
@@ -147,19 +156,19 @@ function gitDirFromPointer(text, holder) {
147
156
  const match = /^\s*gitdir:\s*(.+?)\s*$/m.exec(text);
148
157
  if (!match) return null;
149
158
  const target = match[1];
150
- return isAbsolute(target) ? target : resolve(holder, target);
159
+ return isAbsolute2(target) ? target : resolve2(holder, target);
151
160
  }
152
161
  function commonDirOf(gitDir) {
153
- const pointer = entryKind(join4(gitDir, "commondir")) === "file" ? readTextOrNull(join4(gitDir, "commondir"))?.trim() : null;
162
+ const pointer = entryKind(join5(gitDir, "commondir")) === "file" ? readTextOrNull(join5(gitDir, "commondir"))?.trim() : null;
154
163
  if (!pointer) return gitDir;
155
- return isAbsolute(pointer) ? pointer : resolve(gitDir, pointer);
164
+ return isAbsolute2(pointer) ? pointer : resolve2(gitDir, pointer);
156
165
  }
157
166
  function isBare(commonDir) {
158
- const config = readTextOrNull(join4(commonDir, "config"));
167
+ const config = readTextOrNull(join5(commonDir, "config"));
159
168
  return config !== null && /^\s*bare\s*=\s*true\s*$/im.test(config);
160
169
  }
161
170
  function looksLikeBareRepository(directory) {
162
- return entryKind(join4(directory, "HEAD")) === "file" && entryKind(join4(directory, "objects")) === "dir" && entryKind(join4(directory, "refs")) === "dir";
171
+ return entryKind(join5(directory, "HEAD")) === "file" && entryKind(join5(directory, "objects")) === "dir" && entryKind(join5(directory, "refs")) === "dir";
163
172
  }
164
173
  function canonical(path) {
165
174
  try {
@@ -174,9 +183,9 @@ function resolved(commonDir) {
174
183
  return { status: "resolved", commonDir: canonicalDir, bare: isBare(canonicalDir) };
175
184
  }
176
185
  function probeOnce(directory) {
177
- let current2 = resolve(directory);
186
+ let current2 = resolve2(directory);
178
187
  for (; ; ) {
179
- const dotGit = join4(current2, ".git");
188
+ const dotGit = join5(current2, ".git");
180
189
  const kind = entryKind(dotGit);
181
190
  if (kind === "dir") {
182
191
  const layout = resolved(commonDirOf(dotGit));
@@ -287,10 +296,14 @@ function gitProjectName(directory, resolveWorktrees, sessionRoot = "") {
287
296
  return dirName(sessionRoot || directory);
288
297
  }
289
298
  function configuredDir(dir) {
290
- const expanded = dir === "~" || dir.startsWith("~/") ? join5(homedir2(), dir.slice(1)) : dir;
299
+ const expanded = dir === "~" || dir.startsWith("~/") ? join6(homedir2(), dir.slice(1)) : dir;
291
300
  return normalize(expanded).replace(new RegExp(`\\${sep}+$`), "");
292
301
  }
293
- function isWithin(directory, configured) {
302
+ function isWithin(directory, configured, platform = process.platform) {
303
+ if (platform === "win32") {
304
+ directory = directory.toLowerCase();
305
+ configured = configured.toLowerCase();
306
+ }
294
307
  return directory === configured || directory.startsWith(configured + sep);
295
308
  }
296
309
  function mapLookup(map, directory) {
@@ -416,11 +429,7 @@ var PLUGIN_GOVERNED_BANK_FIELDS = [
416
429
  ];
417
430
 
418
431
  // package.json
419
- var version = "0.8.6";
420
-
421
- // src/core/util.ts
422
- import { accessSync, constants, statSync as statSync2 } from "fs";
423
- import { delimiter, extname, isAbsolute as isAbsolute2, join as join6, resolve as resolve2 } from "path";
432
+ var version = "0.8.8";
424
433
 
425
434
  // src/core/hindsight.ts
426
435
  var USER_AGENT = `hindsight-coding-agents/${version}`;