@vectorize-io/hindsight-coding-agents 0.5.4 → 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 +24 -7
  2. package/dist/antigravity-hook.js +205 -81
  3. package/dist/antigravity-statusline.js +32 -22
  4. package/dist/antigravity-stop-hook.js +216 -79
  5. package/dist/claude-hook.js +205 -81
  6. package/dist/claude-sessionstart-hook.js +167 -105
  7. package/dist/claude-stop-hook.js +216 -79
  8. package/dist/cline.js +279 -86
  9. package/dist/codex-hook.js +205 -81
  10. package/dist/codex-sessionstart-hook.js +167 -105
  11. package/dist/codex-stop-hook.js +216 -79
  12. package/dist/copilot-hook.js +205 -81
  13. package/dist/copilot-sessionstart-hook.js +167 -105
  14. package/dist/copilot-stop-hook.js +216 -79
  15. package/dist/cursor-hook.js +205 -81
  16. package/dist/cursor-sessionstart-hook.js +167 -105
  17. package/dist/cursor-stop-hook.js +216 -79
  18. package/dist/daemon-start.js +28 -18
  19. package/dist/dcode-hook.js +205 -81
  20. package/dist/dcode-sessionstart-hook.js +167 -105
  21. package/dist/dcode-stop-hook.js +216 -79
  22. package/dist/deepen.js +98 -40
  23. package/dist/devin-hook.js +205 -81
  24. package/dist/devin-sessionstart-hook.js +167 -105
  25. package/dist/devin-stop-hook.js +216 -79
  26. package/dist/droid-hook.js +205 -81
  27. package/dist/droid-sessionstart-hook.js +167 -105
  28. package/dist/droid-stop-hook.js +216 -79
  29. package/dist/dsh.js +277 -85
  30. package/dist/grok-hook.js +205 -81
  31. package/dist/grok-sessionstart-hook.js +167 -105
  32. package/dist/grok-stop-hook.js +216 -79
  33. package/dist/hindsight-seed.js +32 -22
  34. package/dist/index.js +280 -88
  35. package/dist/installer.js +308 -214
  36. package/dist/kilo.js +280 -88
  37. package/dist/mcp-server.js +97 -39
  38. package/dist/opencode2.js +279 -87
  39. package/dist/pi.js +279 -87
  40. package/dist/prime-agent.js +279 -87
  41. package/dist/qwen-hook.js +205 -81
  42. package/dist/qwen-sessionstart-hook.js +167 -105
  43. package/dist/qwen-stop-hook.js +216 -79
  44. package/dist/status.js +94 -36
  45. package/dist/zcode-hook.js +205 -81
  46. package/dist/zcode-sessionstart-hook.js +167 -105
  47. package/dist/zcode-stop-hook.js +216 -79
  48. package/package.json +1 -1
  49. package/plugin.json +1 -1
  50. package/skill/SKILL.md +24 -7
@@ -301,8 +301,8 @@ var init_dist = __esm({
301
301
 
302
302
  // src/core/config.ts
303
303
  import { readFileSync as readFileSync2 } from "fs";
304
- import { homedir as homedir2 } from "os";
305
- import { join as join6 } from "path";
304
+ import { homedir as homedir3 } from "os";
305
+ import { join as join7 } from "path";
306
306
 
307
307
  // src/core/seed.ts
308
308
  import { spawn as realSpawn } from "child_process";
@@ -312,16 +312,28 @@ var DEFAULT_SEED_LIMIT = 300;
312
312
 
313
313
  // src/core/bank.ts
314
314
  import { existsSync } from "fs";
315
- import { homedir } from "os";
316
- import { basename, dirname as dirname4, join as join4, normalize, sep } from "path";
315
+ import { homedir as homedir2 } from "os";
316
+ import { basename, dirname as dirname4, join as join5, normalize, sep } from "path";
317
317
 
318
318
  // src/core/diag.ts
319
- import { appendFileSync as appendFileSync2 } from "fs";
319
+ import { join as join3 } from "path";
320
320
 
321
321
  // src/core/log.ts
322
- import { appendFileSync, mkdirSync } from "fs";
323
- import { tmpdir } from "os";
322
+ import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
323
+ import { homedir } from "os";
324
324
  import { dirname as dirname2, join as join2 } from "path";
325
+ function logsDir() {
326
+ return join2(homedir(), ".hindsight", "coding-agents-logs");
327
+ }
328
+ var LOG_MAX_BYTES = 10 * 1024 * 1024;
329
+ function appendLogLine(file, text) {
330
+ mkdirSync(dirname2(file), { recursive: true, mode: 448 });
331
+ try {
332
+ if (statSync(file).size >= LOG_MAX_BYTES) renameSync(file, `${file}.1`);
333
+ } catch {
334
+ }
335
+ appendFileSync(file, text, { mode: 384 });
336
+ }
325
337
  var WEIGHT = { debug: 10, info: 20, warn: 30, error: 40 };
326
338
  var current = ["debug", "info", "warn", "error"].find(
327
339
  (l) => l === process.env.HINDSIGHT_LOG_LEVEL
@@ -330,15 +342,13 @@ function setLogLevel(level) {
330
342
  if (!process.env.HINDSIGHT_LOG_LEVEL) current = level;
331
343
  }
332
344
  function logFilePath() {
333
- return process.env.HINDSIGHT_LOG_FILE || join2(tmpdir(), "hindsight-coding-agent", "plugin.log");
345
+ return process.env.HINDSIGHT_LOG_FILE || join2(logsDir(), "plugin.log");
334
346
  }
335
347
  function write(level, scope, msg, extra) {
336
348
  if (WEIGHT[level] < WEIGHT[current]) return;
337
349
  try {
338
- const file = logFilePath();
339
- mkdirSync(dirname2(file), { recursive: true });
340
- appendFileSync(
341
- file,
350
+ appendLogLine(
351
+ logFilePath(),
342
352
  `${(/* @__PURE__ */ new Date()).toISOString()} ${level.toUpperCase().padEnd(5)} [${scope}] ${msg}` + (extra && Object.keys(extra).length ? ` ${JSON.stringify(extra)}` : "") + "\n"
343
353
  );
344
354
  } catch {
@@ -353,12 +363,12 @@ var log = {
353
363
 
354
364
  // src/core/diag.ts
355
365
  function diagFilePath() {
356
- return process.env.HINDSIGHT_DIAG_FILE || "/tmp/hindsight-plugin.log";
366
+ return process.env.HINDSIGHT_DIAG_FILE || join3(logsDir(), "diag.jsonl");
357
367
  }
358
368
  function diag(harness, event, extra = {}) {
359
369
  log.debug(harness, `diag:${event}`, extra);
360
370
  try {
361
- appendFileSync2(
371
+ appendLogLine(
362
372
  diagFilePath(),
363
373
  JSON.stringify({ ts: (/* @__PURE__ */ new Date()).toISOString(), harness, event, ...extra }) + "\n"
364
374
  );
@@ -368,7 +378,7 @@ function diag(harness, event, extra = {}) {
368
378
 
369
379
  // src/core/git-layout.ts
370
380
  import { lstatSync, readFileSync, realpathSync } from "fs";
371
- import { dirname as dirname3, isAbsolute, join as join3, resolve } from "path";
381
+ import { dirname as dirname3, isAbsolute, join as join4, resolve } from "path";
372
382
 
373
383
  // src/core/missions.ts
374
384
  import { createHash } from "crypto";
@@ -406,7 +416,7 @@ function parseHashedCron(cron) {
406
416
 
407
417
  // src/core/util.ts
408
418
  import { accessSync, constants } from "fs";
409
- import { delimiter, join as join5 } from "path";
419
+ import { delimiter, join as join6 } from "path";
410
420
 
411
421
  // src/core/hindsight.ts
412
422
  var DEFAULT_OBSERVATION_SCOPES = "shared";
@@ -414,7 +424,7 @@ var RETRY_AFTER_FLOOR_MS = 10 * 1e3;
414
424
  var RETRY_AFTER_CEILING_MS = 60 * 1e3;
415
425
 
416
426
  // src/core/config.ts
417
- var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join6(homedir2(), ".hindsight", "coding-agent.json");
427
+ var CONFIG_PATH = process.env.HINDSIGHT_CONFIG || join7(homedir3(), ".hindsight", "coding-agent.json");
418
428
  var DEFAULT_DAEMON_PORT = 9077;
419
429
  var DEFAULT_DAEMON_PROFILE = "coding-agent";
420
430
  function resolvePageTrigger(raw) {
@@ -639,7 +649,7 @@ function loadConfig(opts = {}) {
639
649
 
640
650
  // src/core/daemon.ts
641
651
  import { execFileSync, spawn as realSpawn2 } from "child_process";
642
- import { dirname as dirname5, join as join7 } from "path";
652
+ import { dirname as dirname5, join as join8 } from "path";
643
653
  import { fileURLToPath as fileURLToPath2 } from "url";
644
654
  async function isServerHealthy(baseUrl, timeoutMs = 2e3) {
645
655
  try {