@vectorize-io/hindsight-coding-agents 0.5.5 → 0.6.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.
Files changed (50) hide show
  1. package/README.md +19 -5
  2. package/dist/antigravity-hook.js +84 -70
  3. package/dist/antigravity-statusline.js +32 -22
  4. package/dist/antigravity-stop-hook.js +160 -71
  5. package/dist/claude-hook.js +84 -70
  6. package/dist/claude-sessionstart-hook.js +111 -97
  7. package/dist/claude-stop-hook.js +160 -71
  8. package/dist/cline.js +158 -75
  9. package/dist/codex-hook.js +84 -70
  10. package/dist/codex-sessionstart-hook.js +111 -97
  11. package/dist/codex-stop-hook.js +160 -71
  12. package/dist/copilot-hook.js +84 -70
  13. package/dist/copilot-sessionstart-hook.js +111 -97
  14. package/dist/copilot-stop-hook.js +160 -71
  15. package/dist/cursor-hook.js +84 -70
  16. package/dist/cursor-sessionstart-hook.js +111 -97
  17. package/dist/cursor-stop-hook.js +160 -71
  18. package/dist/daemon-start.js +28 -18
  19. package/dist/dcode-hook.js +84 -70
  20. package/dist/dcode-sessionstart-hook.js +111 -97
  21. package/dist/dcode-stop-hook.js +160 -71
  22. package/dist/deepen.js +42 -32
  23. package/dist/devin-hook.js +84 -70
  24. package/dist/devin-sessionstart-hook.js +111 -97
  25. package/dist/devin-stop-hook.js +160 -71
  26. package/dist/droid-hook.js +84 -70
  27. package/dist/droid-sessionstart-hook.js +111 -97
  28. package/dist/droid-stop-hook.js +160 -71
  29. package/dist/dsh.js +156 -74
  30. package/dist/grok-hook.js +84 -70
  31. package/dist/grok-sessionstart-hook.js +111 -97
  32. package/dist/grok-stop-hook.js +160 -71
  33. package/dist/hindsight-seed.js +32 -22
  34. package/dist/index.js +159 -77
  35. package/dist/installer.js +308 -214
  36. package/dist/kilo.js +159 -77
  37. package/dist/mcp-server.js +41 -31
  38. package/dist/opencode2.js +158 -76
  39. package/dist/pi.js +158 -76
  40. package/dist/prime-agent.js +158 -76
  41. package/dist/qwen-hook.js +84 -70
  42. package/dist/qwen-sessionstart-hook.js +111 -97
  43. package/dist/qwen-stop-hook.js +160 -71
  44. package/dist/status.js +38 -28
  45. package/dist/zcode-hook.js +84 -70
  46. package/dist/zcode-sessionstart-hook.js +111 -97
  47. package/dist/zcode-stop-hook.js +160 -71
  48. package/package.json +1 -1
  49. package/plugin.json +1 -1
  50. package/skill/SKILL.md +19 -5
@@ -31266,8 +31266,8 @@ var StdioServerTransport = class {
31266
31266
 
31267
31267
  // src/core/config.ts
31268
31268
  import { readFileSync as readFileSync2 } from "fs";
31269
- import { homedir as homedir2 } from "os";
31270
- import { join as join6 } from "path";
31269
+ import { homedir as homedir3 } from "os";
31270
+ import { join as join7 } from "path";
31271
31271
 
31272
31272
  // src/core/seed.ts
31273
31273
  import { spawn as realSpawn } from "child_process";
@@ -31277,30 +31277,40 @@ var DEFAULT_SEED_LIMIT = 300;
31277
31277
 
31278
31278
  // src/core/bank.ts
31279
31279
  import { existsSync } from "fs";
31280
- import { homedir } from "os";
31281
- import { basename, dirname as dirname4, join as join4, normalize, sep } from "path";
31280
+ import { homedir as homedir2 } from "os";
31281
+ import { basename, dirname as dirname4, join as join5, normalize, sep } from "path";
31282
31282
 
31283
31283
  // src/core/diag.ts
31284
- import { appendFileSync as appendFileSync2 } from "fs";
31284
+ import { join as join3 } from "path";
31285
31285
 
31286
31286
  // src/core/log.ts
31287
- import { appendFileSync, mkdirSync } from "fs";
31288
- import { tmpdir } from "os";
31287
+ import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
31288
+ import { homedir } from "os";
31289
31289
  import { dirname as dirname2, join as join2 } from "path";
31290
+ function logsDir() {
31291
+ return join2(homedir(), ".hindsight", "coding-agents-logs");
31292
+ }
31293
+ var LOG_MAX_BYTES = 10 * 1024 * 1024;
31294
+ function appendLogLine(file2, text) {
31295
+ mkdirSync(dirname2(file2), { recursive: true, mode: 448 });
31296
+ try {
31297
+ if (statSync(file2).size >= LOG_MAX_BYTES) renameSync(file2, `${file2}.1`);
31298
+ } catch {
31299
+ }
31300
+ appendFileSync(file2, text, { mode: 384 });
31301
+ }
31290
31302
  var WEIGHT = { debug: 10, info: 20, warn: 30, error: 40 };
31291
31303
  var current = ["debug", "info", "warn", "error"].find(
31292
31304
  (l) => l === process.env.HINDSIGHT_LOG_LEVEL
31293
31305
  ) ?? "info";
31294
31306
  function logFilePath() {
31295
- return process.env.HINDSIGHT_LOG_FILE || join2(tmpdir(), "hindsight-coding-agent", "plugin.log");
31307
+ return process.env.HINDSIGHT_LOG_FILE || join2(logsDir(), "plugin.log");
31296
31308
  }
31297
31309
  function write(level, scope, msg, extra) {
31298
31310
  if (WEIGHT[level] < WEIGHT[current]) return;
31299
31311
  try {
31300
- const file2 = logFilePath();
31301
- mkdirSync(dirname2(file2), { recursive: true });
31302
- appendFileSync(
31303
- file2,
31312
+ appendLogLine(
31313
+ logFilePath(),
31304
31314
  `${(/* @__PURE__ */ new Date()).toISOString()} ${level.toUpperCase().padEnd(5)} [${scope}] ${msg}` + (extra && Object.keys(extra).length ? ` ${JSON.stringify(extra)}` : "") + "\n"
31305
31315
  );
31306
31316
  } catch {
@@ -31329,12 +31339,12 @@ function describeError(value, maxChars = 200) {
31329
31339
 
31330
31340
  // src/core/diag.ts
31331
31341
  function diagFilePath() {
31332
- return process.env.HINDSIGHT_DIAG_FILE || "/tmp/hindsight-plugin.log";
31342
+ return process.env.HINDSIGHT_DIAG_FILE || join3(logsDir(), "diag.jsonl");
31333
31343
  }
31334
31344
  function diag(harness, event, extra = {}) {
31335
31345
  log.debug(harness, `diag:${event}`, extra);
31336
31346
  try {
31337
- appendFileSync2(
31347
+ appendLogLine(
31338
31348
  diagFilePath(),
31339
31349
  JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), harness, event, ...extra }) + "\n"
31340
31350
  );
@@ -31344,7 +31354,7 @@ function diag(harness, event, extra = {}) {
31344
31354
 
31345
31355
  // src/core/git-layout.ts
31346
31356
  import { lstatSync, readFileSync, realpathSync } from "fs";
31347
- import { dirname as dirname3, isAbsolute, join as join3, resolve } from "path";
31357
+ import { dirname as dirname3, isAbsolute, join as join4, resolve } from "path";
31348
31358
  var TRANSIENT = /* @__PURE__ */ new Set(["EAGAIN", "EMFILE", "ENFILE", "EBUSY", "EINTR", "EIO", "ETIMEDOUT"]);
31349
31359
  var ATTEMPTS = 3;
31350
31360
  var BACKOFF_MS = 20;
@@ -31380,16 +31390,16 @@ function gitDirFromPointer(text, holder) {
31380
31390
  return isAbsolute(target) ? target : resolve(holder, target);
31381
31391
  }
31382
31392
  function commonDirOf(gitDir) {
31383
- const pointer = entryKind(join3(gitDir, "commondir")) === "file" ? readTextOrNull(join3(gitDir, "commondir"))?.trim() : null;
31393
+ const pointer = entryKind(join4(gitDir, "commondir")) === "file" ? readTextOrNull(join4(gitDir, "commondir"))?.trim() : null;
31384
31394
  if (!pointer) return gitDir;
31385
31395
  return isAbsolute(pointer) ? pointer : resolve(gitDir, pointer);
31386
31396
  }
31387
31397
  function isBare(commonDir) {
31388
- const config2 = readTextOrNull(join3(commonDir, "config"));
31398
+ const config2 = readTextOrNull(join4(commonDir, "config"));
31389
31399
  return config2 !== null && /^\s*bare\s*=\s*true\s*$/im.test(config2);
31390
31400
  }
31391
31401
  function looksLikeBareRepository(directory) {
31392
- return entryKind(join3(directory, "HEAD")) === "file" && entryKind(join3(directory, "objects")) === "dir" && entryKind(join3(directory, "refs")) === "dir";
31402
+ return entryKind(join4(directory, "HEAD")) === "file" && entryKind(join4(directory, "objects")) === "dir" && entryKind(join4(directory, "refs")) === "dir";
31393
31403
  }
31394
31404
  function canonical(path) {
31395
31405
  try {
@@ -31406,7 +31416,7 @@ function resolved(commonDir) {
31406
31416
  function probeOnce(directory) {
31407
31417
  let current2 = resolve(directory);
31408
31418
  for (; ; ) {
31409
- const dotGit = join3(current2, ".git");
31419
+ const dotGit = join4(current2, ".git");
31410
31420
  const kind = entryKind(dotGit);
31411
31421
  if (kind === "dir") {
31412
31422
  const layout = resolved(commonDirOf(dotGit));
@@ -31520,7 +31530,7 @@ function gitProjectName(directory, resolveWorktrees, sessionRoot = "") {
31520
31530
  return dirName(sessionRoot || directory);
31521
31531
  }
31522
31532
  function configuredDir(dir) {
31523
- const expanded = dir === "~" || dir.startsWith("~/") ? join4(homedir(), dir.slice(1)) : dir;
31533
+ const expanded = dir === "~" || dir.startsWith("~/") ? join5(homedir2(), dir.slice(1)) : dir;
31524
31534
  return normalize(expanded).replace(new RegExp(`\\${sep}+$`), "");
31525
31535
  }
31526
31536
  function isWithin(directory, configured) {
@@ -31824,7 +31834,7 @@ function codingBankManifest(overrides) {
31824
31834
 
31825
31835
  // src/core/util.ts
31826
31836
  import { accessSync, constants } from "fs";
31827
- import { delimiter, join as join5 } from "path";
31837
+ import { delimiter, join as join6 } from "path";
31828
31838
  var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
31829
31839
  function semverGte(version2, min) {
31830
31840
  const parts = (v) => {
@@ -32496,7 +32506,7 @@ var HindsightClient = class {
32496
32506
  };
32497
32507
 
32498
32508
  // src/core/config.ts
32499
- var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join6(homedir2(), ".hindsight", "coding-agent.json");
32509
+ var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join7(homedir3(), ".hindsight", "coding-agent.json");
32500
32510
  var DEFAULT_DAEMON_PORT = 9077;
32501
32511
  var DEFAULT_DAEMON_PROFILE = "coding-agent";
32502
32512
  function resolvePageTrigger(raw) {
@@ -32782,8 +32792,8 @@ function resolveHostMemory(harness, directory) {
32782
32792
 
32783
32793
  // src/core/knowledge-tools.ts
32784
32794
  import { existsSync as existsSync3 } from "fs";
32785
- import { homedir as homedir4 } from "os";
32786
- import { join as join9 } from "path";
32795
+ import { homedir as homedir5 } from "os";
32796
+ import { join as join10 } from "path";
32787
32797
 
32788
32798
  // src/core/status.ts
32789
32799
  import { execFileSync as execFileSync2 } from "child_process";
@@ -32827,8 +32837,8 @@ function parsePageList(raw) {
32827
32837
  import { spawn as realSpawn3 } from "child_process";
32828
32838
  import { createHash as createHash2 } from "crypto";
32829
32839
  import { existsSync as existsSync2 } from "fs";
32830
- import { homedir as homedir3, tmpdir as tmpdir2 } from "os";
32831
- import { dirname as dirname5, join as join8 } from "path";
32840
+ import { homedir as homedir4, tmpdir } from "os";
32841
+ import { dirname as dirname5, join as join9 } from "path";
32832
32842
  import { fileURLToPath as fileURLToPath2 } from "url";
32833
32843
 
32834
32844
  // src/core/survey-lease.ts
@@ -32838,15 +32848,15 @@ import {
32838
32848
  mkdirSync as mkdirSync2,
32839
32849
  mkdtempSync,
32840
32850
  readdirSync,
32841
- renameSync,
32851
+ renameSync as renameSync2,
32842
32852
  rmdirSync,
32843
32853
  rmSync,
32844
- statSync,
32854
+ statSync as statSync2,
32845
32855
  unlinkSync,
32846
32856
  utimesSync,
32847
32857
  writeFileSync
32848
32858
  } from "fs";
32849
- import { join as join7 } from "path";
32859
+ import { join as join8 } from "path";
32850
32860
 
32851
32861
  // src/core/survey.ts
32852
32862
  var SURVEY_DOC_IDS = [
@@ -32966,7 +32976,7 @@ function buildKnowledgeTools(client, bankId, opts = {}) {
32966
32976
  inputSchema: {},
32967
32977
  annotations: READ_ONLY_ANNOTATIONS,
32968
32978
  handler: async (_args) => {
32969
- const configPath = process.env.HINDSIGHT_CONFIG || join9(homedir4(), ".hindsight", "coding-agent.json");
32979
+ const configPath = process.env.HINDSIGHT_CONFIG || join10(homedir5(), ".hindsight", "coding-agent.json");
32970
32980
  const harness = opts.harness ?? "unknown";
32971
32981
  const cfg = applyBankConfig(
32972
32982
  loadConfig({ harness: opts.harness }),
@@ -32996,7 +33006,7 @@ function buildKnowledgeTools(client, bankId, opts = {}) {
32996
33006
  config_override: Boolean(process.env.HINDSIGHT_CONFIG),
32997
33007
  hooks_disabled: Boolean(process.env.HINDSIGHT_DISABLE_HOOKS),
32998
33008
  log_level: process.env.HINDSIGHT_LOG_LEVEL ?? null,
32999
- diagnostics_file: process.env.HINDSIGHT_DIAG_FILE ?? "/tmp/hindsight-plugin.log",
33009
+ diagnostics_file: diagFilePath(),
33000
33010
  channel_id_configured: Boolean(process.env.HINDSIGHT_CHANNEL_ID),
33001
33011
  user_id_configured: Boolean(process.env.HINDSIGHT_USER_ID)
33002
33012
  }