@vectorize-io/hindsight-coding-agents 0.8.5 → 0.8.6

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 +13 -12
  2. package/dist/antigravity-hook.js +1 -1
  3. package/dist/antigravity-statusline.js +1 -1
  4. package/dist/antigravity-stop-hook.js +1 -1
  5. package/dist/claude-hook.js +1 -1
  6. package/dist/claude-sessionstart-hook.js +79 -88
  7. package/dist/claude-stop-hook.js +1 -1
  8. package/dist/cline.js +79 -88
  9. package/dist/codebuddy-hook.js +1 -1
  10. package/dist/codebuddy-sessionstart-hook.js +79 -88
  11. package/dist/codebuddy-stop-hook.js +1 -1
  12. package/dist/codex-hook.js +1 -1
  13. package/dist/codex-sessionstart-hook.js +79 -88
  14. package/dist/codex-stop-hook.js +1 -1
  15. package/dist/copilot-hook.js +1 -1
  16. package/dist/copilot-sessionstart-hook.js +79 -88
  17. package/dist/copilot-stop-hook.js +1 -1
  18. package/dist/cursor-hook.js +1 -1
  19. package/dist/cursor-sessionstart-hook.js +79 -88
  20. package/dist/cursor-stop-hook.js +1 -1
  21. package/dist/daemon-start.js +1 -1
  22. package/dist/dcode-hook.js +1 -1
  23. package/dist/dcode-sessionstart-hook.js +79 -88
  24. package/dist/dcode-stop-hook.js +1 -1
  25. package/dist/deepen.js +1 -1
  26. package/dist/devin-hook.js +1 -1
  27. package/dist/devin-sessionstart-hook.js +79 -88
  28. package/dist/devin-stop-hook.js +1 -1
  29. package/dist/droid-hook.js +1 -1
  30. package/dist/droid-sessionstart-hook.js +79 -88
  31. package/dist/droid-stop-hook.js +1 -1
  32. package/dist/dsh.js +79 -88
  33. package/dist/grok-hook.js +1 -1
  34. package/dist/grok-sessionstart-hook.js +79 -88
  35. package/dist/grok-stop-hook.js +1 -1
  36. package/dist/hindsight-seed.js +1 -1
  37. package/dist/index.js +79 -88
  38. package/dist/installer.js +1 -1
  39. package/dist/kilo.js +79 -88
  40. package/dist/kimi-hook.js +1 -1
  41. package/dist/kimi-sessionstart-hook.js +79 -88
  42. package/dist/kimi-stop-hook.js +1 -1
  43. package/dist/mcp-server.js +1 -1
  44. package/dist/opencode2.js +79 -88
  45. package/dist/pi.js +79 -88
  46. package/dist/prime-agent.js +79 -88
  47. package/dist/qwen-hook.js +1 -1
  48. package/dist/qwen-sessionstart-hook.js +79 -88
  49. package/dist/qwen-stop-hook.js +1 -1
  50. package/dist/status.js +1 -1
  51. package/dist/traecode-hook.js +1 -1
  52. package/dist/traecode-sessionstart-hook.js +79 -88
  53. package/dist/traecode-stop-hook.js +1 -1
  54. package/dist/workbuddy-hook.js +1 -1
  55. package/dist/workbuddy-sessionstart-hook.js +79 -88
  56. package/dist/workbuddy-stop-hook.js +1 -1
  57. package/dist/zcode-hook.js +1 -1
  58. package/dist/zcode-sessionstart-hook.js +79 -88
  59. package/dist/zcode-stop-hook.js +1 -1
  60. package/package.json +1 -1
  61. package/plugin.json +1 -1
  62. package/skill/SKILL.md +3 -3
@@ -673,7 +673,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
673
673
  }
674
674
 
675
675
  // package.json
676
- var version = "0.8.5";
676
+ var version = "0.8.6";
677
677
 
678
678
  // src/core/util.ts
679
679
  import { accessSync, constants, statSync as statSync2 } from "fs";
@@ -2864,97 +2864,88 @@ function surveyAttempts(file, sha) {
2864
2864
  async function startCodebaseSurvey(repoDir, opts = {}) {
2865
2865
  try {
2866
2866
  const spawnFn = opts.spawn ?? realSpawn4;
2867
- const resolveBin = opts.resolveBin ?? ((bin) => binOnPath(bin, { exts: [".exe"] }));
2867
+ const resolveBin = opts.resolveBin ?? ((bin2) => binOnPath(bin2, { exts: [".exe"] }));
2868
2868
  const mcpServerPath = opts.mcpServerPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "mcp-server.js");
2869
- const preferred = opts.harness ?? "claude-code";
2870
- const order = [
2871
- preferred,
2872
- "claude-code",
2873
- "codex",
2874
- "antigravity-cli",
2875
- "opencode"
2876
- ];
2877
- const seen = /* @__PURE__ */ new Set();
2878
- for (const harness of order) {
2879
- if (seen.has(harness)) continue;
2880
- seen.add(harness);
2881
- const name = resolveAgentBin(harness, opts.claudeBin);
2882
- if (!name) continue;
2883
- const bin = resolveBin(name);
2884
- if (!bin) {
2885
- log.info("survey", `${harness}: ${name} not found, trying the next agent`);
2886
- continue;
2887
- }
2888
- if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
2889
- log.info("survey", `${harness}: ${bin} cannot define the survey agent, trying the next`);
2890
- continue;
2891
- }
2892
- const plan = buildSurveyPlan(harness, bin, repoDir, {
2893
- model: opts.model,
2894
- budgetUsd: opts.budgetUsd,
2895
- mcpServerPath
2896
- });
2897
- const { cfg, bankId } = resolveHostConfig(harness, repoDir);
2898
- if (cfg.disabled) return false;
2899
- const key = createHash4("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
2900
- const leaseDir = opts.lease?.dir ?? join13(tmpdir3(), "hindsight-coding-agent", "surveys");
2901
- const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
2902
- if (!lease) return false;
2903
- const attemptsFile = join13(
2904
- leaseDir,
2905
- `attempts-${createHash4("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
2906
- );
2907
- const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
2908
- if (attempts >= SURVEY_MAX_ATTEMPTS) {
2909
- log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
2910
- releaseLease(lease);
2911
- return false;
2912
- }
2913
- const spec = {
2914
- lease,
2915
- bin: plan.bin,
2916
- args: plan.args,
2917
- ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
2918
- };
2919
- const supervisorPath = opts.supervisorPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "survey-supervisor.js");
2920
- return await new Promise((resolve4) => {
2921
- try {
2922
- const child = spawnFn("node", [supervisorPath], {
2923
- cwd: repoDir,
2924
- detached: true,
2925
- stdio: "ignore",
2926
- windowsHide: true,
2927
- env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
2928
- });
2929
- let spawned = false;
2930
- child.on("error", (e) => {
2931
- if (spawned) return;
2932
- log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2933
- releaseLease(lease);
2934
- resolve4(false);
2935
- });
2936
- child.once("spawn", () => {
2937
- spawned = true;
2938
- child.unref();
2939
- if (opts.sha) {
2940
- try {
2941
- writeFileSync3(
2942
- attemptsFile,
2943
- JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
2944
- { mode: 384 }
2945
- );
2946
- } catch {
2947
- }
2948
- }
2949
- resolve4(true);
2950
- });
2951
- } catch (e) {
2869
+ const harness = opts.harness ?? "claude-code";
2870
+ const name = resolveAgentBin(harness, opts.claudeBin);
2871
+ if (!name) {
2872
+ log.info("survey", `${harness}: no headless survey for this agent, skipping the survey`);
2873
+ return false;
2874
+ }
2875
+ const bin = resolveBin(name);
2876
+ if (!bin) {
2877
+ log.info("survey", `${harness}: ${name} not found, skipping the survey`);
2878
+ return false;
2879
+ }
2880
+ if (harness === "opencode" && !(opts.opencodeDefinesAgent ?? opencodeCanDefineSurveyAgent)(bin)) {
2881
+ log.info("survey", `${harness}: ${bin} cannot define the survey agent, skipping the survey`);
2882
+ return false;
2883
+ }
2884
+ const plan = buildSurveyPlan(harness, bin, repoDir, {
2885
+ model: opts.model,
2886
+ budgetUsd: opts.budgetUsd,
2887
+ mcpServerPath
2888
+ });
2889
+ const { cfg, bankId } = resolveHostConfig(harness, repoDir);
2890
+ if (cfg.disabled) return false;
2891
+ const key = createHash4("sha256").update(JSON.stringify([cfg.apiUrl.replace(/\/+$/, ""), cfg.apiToken ?? "", bankId])).digest("hex");
2892
+ const leaseDir = opts.lease?.dir ?? join13(tmpdir3(), "hindsight-coding-agent", "surveys");
2893
+ const lease = acquireLease(leaseDir, key, opts.lease?.staleMs ?? LEASE_STALE_MS);
2894
+ if (!lease) return false;
2895
+ const attemptsFile = join13(
2896
+ leaseDir,
2897
+ `attempts-${createHash4("sha256").update(JSON.stringify([key, repoDir])).digest("hex")}.json`
2898
+ );
2899
+ const attempts = opts.sha ? surveyAttempts(attemptsFile, opts.sha) : 0;
2900
+ if (attempts >= SURVEY_MAX_ATTEMPTS) {
2901
+ log.info("survey", `${attempts} surveys already launched at ${opts.sha}, skipping`);
2902
+ releaseLease(lease);
2903
+ return false;
2904
+ }
2905
+ const spec = {
2906
+ lease,
2907
+ bin: plan.bin,
2908
+ args: plan.args,
2909
+ ...opts.lease?.heartbeatMs ? { heartbeatMs: opts.lease.heartbeatMs } : {}
2910
+ };
2911
+ const supervisorPath = opts.supervisorPath ?? join13(dirname8(fileURLToPath3(import.meta.url)), "survey-supervisor.js");
2912
+ return await new Promise((resolve4) => {
2913
+ try {
2914
+ const child = spawnFn("node", [supervisorPath], {
2915
+ cwd: repoDir,
2916
+ detached: true,
2917
+ stdio: "ignore",
2918
+ windowsHide: true,
2919
+ env: { ...plan.env, [SURVEY_SPEC_ENV]: JSON.stringify(spec) }
2920
+ });
2921
+ let spawned = false;
2922
+ child.on("error", (e) => {
2923
+ if (spawned) return;
2952
2924
  log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2953
2925
  releaseLease(lease);
2954
2926
  resolve4(false);
2955
- }
2956
- });
2957
- }
2927
+ });
2928
+ child.once("spawn", () => {
2929
+ spawned = true;
2930
+ child.unref();
2931
+ if (opts.sha) {
2932
+ try {
2933
+ writeFileSync3(
2934
+ attemptsFile,
2935
+ JSON.stringify({ sha: opts.sha, attempts: attempts + 1 }),
2936
+ { mode: 384 }
2937
+ );
2938
+ } catch {
2939
+ }
2940
+ }
2941
+ resolve4(true);
2942
+ });
2943
+ } catch (e) {
2944
+ log.warn("survey", `survey supervisor failed to launch: ${describeError(e)}`);
2945
+ releaseLease(lease);
2946
+ resolve4(false);
2947
+ }
2948
+ });
2958
2949
  } catch {
2959
2950
  }
2960
2951
  return false;
@@ -633,7 +633,7 @@ function codingBankManifest(overrides, mode = DEFAULT_RETAIN_EXTRACTION_MODE, de
633
633
  }
634
634
 
635
635
  // package.json
636
- var version = "0.8.5";
636
+ var version = "0.8.6";
637
637
 
638
638
  // src/core/util.ts
639
639
  import { accessSync, constants, statSync as statSync2 } from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/hindsight-coding-agents",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/vectorize-io/hindsight.git",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hindsight-coding-agents",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Long-term project memory for coding agents",
5
5
  "skills": "./skill",
6
6
  "hooks": "./hooks/hooks.json",
package/skill/SKILL.md CHANGED
@@ -227,7 +227,7 @@ hook by Codex...), so one shared config serves several agents side by side:
227
227
  | `customPages` | — | knowledge pages of your own, seeded alongside the five above and keyed by the name they get: `{"Security posture": {"source_query": "...", "tags": ["knowledge:decision"]}}`. `source_query` is required; `tags` picks which facts feed the page and is optional — omitted, the page draws on everything the bank holds. A separate setting from `pages` on purpose, so that an unknown name there stays a typo warning rather than quietly creating a page. File-only, and replaced (not merged) by a `banks.<id>` section |
228
228
  | `autoSeed` | `true` | SessionStart: auto-seed a cold repo's bank from git history |
229
229
  | `seedLimit` | `300` | git-log document size: a full write keeps the newest commits, between half of this and this many (the window moves in steps of half), and logs how many older ones it drops |
230
- | `codebaseSurvey` | `true` | SessionStart: headless survey of a cold repo's structure, run under the current harness's own CLI (claude/codex/antigravity/opencode), falling back to any available agent |
230
+ | `codebaseSurvey` | `true` | SessionStart: headless survey of a cold repo's structure, run only under the current harness's own CLI (Claude Code, Codex, Antigravity, opencode v1); other agents get no survey |
231
231
  | `surveyModel` | `haiku` | model for the survey — Claude recipe only (`claude -p --model`); other agents use their configured default |
232
232
  | `surveyBudgetUsd` | `2` | survey spend cap — Claude recipe only (`claude -p --max-budget-usd`); other agents rely on their read-only sandbox |
233
233
  | `surveyRefreshCommits` | `20` | re-run the survey at SessionStart once this many commits have accrued since the last one, so the structural pages track an architecture that keeps moving (`0` = survey a cold repo only, never again) |
@@ -708,8 +708,8 @@ that: `"synced": true` means the seeded memory is queryable. It also reports git
708
708
  far per-commit deepening has got, the codebase survey's state (`surveyBaseline` is the HEAD the last
709
709
  survey started from, `surveyDocs` counts the findings documents that have landed, 0–4 — a baseline
710
710
  with no findings retries automatically, at most three times per commit), and the extraction
711
- operations still in flight. Each survey agent that could not be found, failed to launch or exited
712
- with an error leaves one `[survey]` line in the plugin log.
711
+ operations still in flight. A survey that was skipped (no survey for this agent, or its CLI not
712
+ found), failed to launch or exited with an error leaves one `[survey]` line in the plugin log.
713
713
 
714
714
  ### Resetting a repo's memory
715
715