@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
package/README.md CHANGED
@@ -9,9 +9,14 @@ bank in the background as you work.
9
9
  The premise: most of a real fix is derivable from the code, but the _last mile_ often hinges on a
10
10
  project-specific decision that isn't in the code at all — a rounding rule, a retry allowlist, a
11
11
  tie-break policy. Those decisions live in git history and past conversations. This package puts them
12
- in front of the agent at the moment it starts working, and keeps a curated set of **knowledge pages**
12
+ in front of the agent at the moment it starts working, and keeps a curated set of **pages**
13
13
  (architecture, conventions, in-flight initiatives) that future sessions start from.
14
14
 
15
+ The agent reads those pages through the `hindsight_search_pages`, `hindsight_list_pages` and
16
+ `hindsight_read_page` tools. Before the rename they were `hindsight_search_knowledge_pages`,
17
+ `hindsight_list_knowledge_pages` and `hindsight_read_knowledge_page`: a permission rule in your
18
+ agent's own settings that names an old tool needs the new name.
19
+
15
20
  <!-- figure: coding-agents -->
16
21
 
17
22
  [View Changelog →](https://hindsight.vectorize.io/changelog/integrations/coding-agents)
@@ -62,9 +67,11 @@ command again** — it re-copies the runtime in place.
62
67
 
63
68
  Day to day you should not have to: once a day, a session start checks npm and re-stages a newer
64
69
  runtime in the background (`autoUpdate`, on by default — set it to `false` to pin the version you
65
- have). That is the `update` command above, which refreshes the copy every wired agent already
66
- points at and deliberately touches no host config; re-run `install` yourself after a release that
67
- adds a new hook, or to wire another agent.
70
+ have). It only replaces a runtime that `npx` installed: a copy from `npm i -g`, a project dependency
71
+ or a local checkout is left alone. Running `update` or `install` yourself is different — it re-stages
72
+ the published release over whatever is installed, a local build included. `update` refreshes the copy
73
+ every wired agent already points at and deliberately touches no host config; re-run `install`
74
+ yourself after a release that adds a new hook, or to wire another agent.
68
75
 
69
76
  <!-- skill:end -->
70
77
 
@@ -360,7 +367,7 @@ resolved per session workspace rather than once per process; and dsh has no plug
360
367
  channel, so the seed line goes to the plugin log rather than the UI. A **forked** session saves only
361
368
  the turns it adds after the fork — the part it inherited is already in the parent's conversation.
362
369
  Everything model-facing —
363
- recalled memory, the knowledge preamble, the `hindsight_*` tools — is unaffected. If you prefer the
370
+ recalled memory, the pages preamble, the `hindsight_*` tools — is unaffected. If you prefer the
364
371
  published-package route, `dsh plugin --profile web add @vectorize-io/hindsight-coding-agents` works
365
372
  too: the package ships the profile patch layer, so nothing else needs editing. Either route gets the
366
373
  companion skill — a plugin wired by the host's own plugin manager installs it itself on the first
@@ -595,7 +602,7 @@ what reads it:
595
602
  authentication or rotating the key is picked up on the next call with nothing to restart —
596
603
  otherwise a rotation would leave a long-running agent failing every memory call until it was
597
604
  restarted. Everything else follows the table: `apiUrl`, `disabled`, bank routing, `gitIngest`, and
598
- the survey and knowledge-page settings.
605
+ the survey and page settings.
599
606
 
600
607
  `hindsight_diagnose` reports both sides of that gap — what the file says now, and what the running
601
608
  client is actually using.
@@ -663,20 +670,20 @@ hook by Codex...), so one shared config serves several agents side by side:
663
670
  | `defaultBankConfig` | — | bank-config fields of your own for the banks the plugin shapes, e.g. `{"enable_observations": false, "enable_auto_consolidation": false, "mental_model_min_refresh_interval_seconds": 21600}`. Keys are the bank-config API's own field names. Written under the same additive rule as the rest: only where the bank does not define the field, so a bank the plugin creates is born with these instead of the server's defaults and a value you set in the control plane is never overwritten. Wins over the template on a key both name (`enable_observations`); `retain_strategies`, `entity_labels` and `retain_extraction_mode` are refused, since the plugin governs them itself. Ignored with `manageBankConfig: false` — see **A bank you shape yourself** below. File-only, like `recallOptions`; in a `banks.<id>` section it replaces the global map rather than merging into it |
664
671
  | `observationScopes` | `"shared"` | how consolidation groups observations: `"shared"` (default) = ONE global scope per bank, so every agent on a repo builds one set of beliefs; also `"combined"` (the server default), `"per_tag"`, `"all_combinations"`, `[["t"]]`; `"per_source"` adds a scope per `source:` kind alongside the global one, so commit knowledge and conversation knowledge consolidate apart |
665
672
  | `disabled` | `false` | hard off-switch (inert plugin/hook — a no-memory baseline) |
666
- | `reflectTimeoutMs` | `20000` | **automatic** session-reflect timeout; on hook harnesses the installer registers a 30s prompt-hook timeout, so going above ~20s also means raising that hook's `timeout` in the host's config, or the host kills the hook mid-reflect; on timeout or a 5xx the hook falls back to knowledge-page search, then to a raw recall of observations (recorded) |
673
+ | `reflectTimeoutMs` | `20000` | **automatic** session-reflect timeout; on hook harnesses the installer registers a 30s prompt-hook timeout, so going above ~20s also means raising that hook's `timeout` in the host's config, or the host kills the hook mid-reflect; on timeout or a 5xx the hook falls back to page search, then to a raw recall of observations (recorded) |
667
674
  | `reflectToolTimeoutMs` | `330000` | timeout for the agent-invoked `hindsight_reflect` tool — a call the agent waits on, whose high-budget synthesis on a populated bank runs for minutes. Defaults above the server's own reflect wall timeout (`HINDSIGHT_API_REFLECT_WALL_TIMEOUT`, 300s) so the server decides when to give up. Unset, it inherits an explicitly raised `reflectTimeoutMs`, but a short one never lowers it |
668
675
  | `injectTimeoutMs` | `7000` | retrieval timeout in milliseconds for `autoInject: "pages"` and `autoInject: "recall"`; also the **shared** budget for page search then recall after a reflect timeout/5xx (recall gets only the time left after page search). Set e.g. `2000` to limit turn latency or `15000` for a slower self-hosted bank. Environment fallback: `HINDSIGHT_INJECT_TIMEOUT_MS`. On hook harnesses, injection must fit the host's prompt-hook timeout (30s by default); for reflect with fallback, allow for **`reflectTimeoutMs` + `injectTimeoutMs`**, and raise the host hook's `timeout` when needed |
669
676
  | `reflectBudget` | `"high"` | reflect budget for the `hindsight_reflect` tool: `"low"`, `"mid"` or `"high"`. Drop it on a large bank where high-budget synthesis exceeds the server's wall timeout. The automatic session-start reflect always uses `"low"` to fit its hook window and is unaffected |
670
- | `autoInject` | `"reflect"` | what to inject once, on the session's **first prompt**: `"reflect"` = a low-budget reflect synthesis (on timeout/5xx it falls back to page search, then recall); `"pages"` = the knowledge pages matching the prompt by search; `"recall"` = the bank's memories recalled for the prompt (what it asks for is `recallOptions`, observations by default); `"none"` = nothing — the agent searches knowledge pages first and reflects only when they are too shallow. `"pages"` and `"recall"` are retrieval only (no LLM), their time budget is `injectTimeoutMs`, and when one finds nothing for the prompt it tries again on the next one, up to 5 prompts |
677
+ | `autoInject` | `"reflect"` | what to inject once, on the session's **first prompt**: `"reflect"` = a low-budget reflect synthesis (on timeout/5xx it falls back to page search, then recall); `"pages"` = the pages matching the prompt by search; `"recall"` = the bank's memories recalled for the prompt (what it asks for is `recallOptions`, observations by default); `"none"` = nothing — the agent searches pages first and reflects only when they are too shallow. `"pages"` and `"recall"` are retrieval only (no LLM), their time budget is `injectTimeoutMs`, and when one finds nothing for the prompt it tries again on the next one, up to 5 prompts |
671
678
  | `autoReflect` | `true` | **deprecated** — use `autoInject`. Still honoured (`false` = `autoInject: "none"`), ignored when `autoInject` is set, and logs a deprecation warning |
672
- | `pageSearchLimit` | `3` | knowledge pages ONE search returns. Applies to every search of the bank — the `autoInject: "pages"` injection, the reflect fallback, and the agent's own `hindsight_search_knowledge_pages` tool — because the limit lives on the client they all share |
679
+ | `pageSearchLimit` | `3` | pages ONE search returns. Applies to every search of the bank — the `autoInject: "pages"` injection, the reflect fallback, and the agent's own `hindsight_search_pages` tool — because the limit lives on the client they all share |
673
680
  | `recallOptions` | see description | overrides merged key-by-key into the body of every recall — the `autoInject: "recall"` source and the reflect fallback. Keys are the API's own recall parameters, passed straight through, so anything recall accepts is settable without a new option here; `query` is the one field it cannot replace. The default body is `{"types": ["observation"], "budget": "low", "max_tokens": 2000, "include": {"entities": null}}`, and what you set is merged over it one key at a time — `{"max_tokens": 4000}` changes the budget and leaves the rest alone. Observations are the consolidated layer, so they answer best per token, but a bank with **consolidation disabled never grows any** and the default recall comes back empty on it: set `{"types": ["world", "experience"]}` there, or `{"types": null}` for every type. File-only, like `retainMetadata` — an object does not flatten into an env var |
674
- | `toolGuideExtra` | — | your own guidance on how the agent should treat memory, added **after** the built-in tool guide (at session start and on every refresh) and after the crediting note returned with `hindsight_search_knowledge_pages` results. It adds to the built-in text, never replaces it. Set it per harness or per bank like any other key, e.g. `"Memory is a past record, not current state: verify any claim against the code before acting on it."` |
675
- | `pageRefreshEveryTurns` | `1` | refetch the knowledge pages and re-inject the page roster + tool guide every N user turns (`0` also means 1) |
676
- | `pageTriggerType` | `"cron"` | when NEW knowledge pages refresh, i.e. what keeping them current costs — `"cron"` (default) on `pageTriggerCron` only and only when actually stale, `"auto-refresh"` after every consolidation that produced new material, `"manual"` never on their own. Auto-refresh is the most current and by far the most expensive: one synthesis per page per consolidation. Maps to the page's `trigger.refresh_cron`, or `trigger.refresh_after_consolidation` in the Hindsight API (`true` for auto-refresh, `false` for manual) |
681
+ | `toolGuideExtra` | — | your own guidance on how the agent should treat memory, added **after** the built-in tool guide (at session start and on every refresh) and after the crediting note returned with `hindsight_search_pages` results. It adds to the built-in text, never replaces it. Set it per harness or per bank like any other key, e.g. `"Memory is a past record, not current state: verify any claim against the code before acting on it."` |
682
+ | `pageRefreshEveryTurns` | `1` | refetch the pages and re-inject the page roster + tool guide every N user turns (`0` also means 1) |
683
+ | `pageTriggerType` | `"cron"` | when NEW pages refresh, i.e. what keeping them current costs — `"cron"` (default) on `pageTriggerCron` only and only when actually stale, `"auto-refresh"` after every consolidation that produced new material, `"manual"` never on their own. Auto-refresh is the most current and by far the most expensive: one synthesis per page per consolidation. Maps to the page's `trigger.refresh_cron`, or `trigger.refresh_after_consolidation` in the Hindsight API (`true` for auto-refresh, `false` for manual) |
677
684
  | `pageTriggerCron` | `"H * * * *"` | schedule for `pageTriggerType: "cron"` — UTC, standard 5-field cron, e.g. `"0 3 * * *"`. The default is hourly, each page on its own hashed minute. Sets the page's `trigger.refresh_cron`, which the API treats as mutually exclusive with `refresh_after_consolidation`; a scheduled refresh is skipped when nothing changed. Write a field as `H` to give each page its own value there — see **Spreading refreshes with `H`** below |
678
- | `pages` | every page | per-page configuration for the seeded knowledge pages, keyed by page name (case-insensitive): `false` skips a page entirely, `{"source_query": "..."}` seeds it with your question instead of the built-in one. Omitted, all five pages are seeded with their built-in queries. This is the supported way to own a page's wording — the plugin re-syncs a page whose live query differs from the one it is configured to have, so a query edited through the API or the control plane is replaced on the next session. A skipped page is **not deleted**: one already seeded keeps its content and stops being re-synced. The scoping clause is appended to your query too, so a reworded page cannot start reporting a dependency's decisions as this project's. File-only, like `recallOptions`; in a `banks.<id>` section it replaces the global map rather than merging into it |
679
- | `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 |
685
+ | `pages` | every page | per-page configuration for the seeded pages, keyed by page name (case-insensitive): `false` skips a page entirely, `{"source_query": "..."}` seeds it with your question instead of the built-in one. Omitted, all five pages are seeded with their built-in queries. This is the supported way to own a page's wording — the plugin re-syncs a page whose live query differs from the one it is configured to have, so a query edited through the API or the control plane is replaced on the next session. A skipped page is **not deleted**: one already seeded keeps its content and stops being re-synced. The scoping clause is appended to your query too, so a reworded page cannot start reporting a dependency's decisions as this project's. File-only, like `recallOptions`; in a `banks.<id>` section it replaces the global map rather than merging into it |
686
+ | `customPages` | — | 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 |
680
687
  | `autoSeed` | `true` | SessionStart: auto-seed a cold repo's bank from git history |
681
688
  | `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 |
682
689
  | `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 |
@@ -698,7 +705,7 @@ LLM synthesis per page per consolidation, on a repo that consolidates all day. S
698
705
  `pageTriggerType: "auto-refresh"` to go back to refreshing on every consolidation.
699
706
 
700
707
  `pageTriggerType`/`pageTriggerCron` decide only **when** a page refreshes. **How** it refreshes
701
- belongs to the server: Hindsight creates a knowledge page with a delta refresh (each pass edits the
708
+ belongs to the server: Hindsight creates a page with a delta refresh (each pass edits the
702
709
  page instead of rebuilding it) that doesn't reflect over sibling pages, and these settings merge
703
710
  over those defaults rather than replacing them.
704
711
 
@@ -736,7 +743,7 @@ file is the source of truth for these pages: to give one a different schedule, c
736
743
  page. Only the fields this plugin states are touched — a page's `mode`, its excluded siblings and
737
744
  its minimum refresh interval are left exactly as they are.
738
745
 
739
- ### Customize Knowledge Pages — `pages`
746
+ ### Customize Pages — `pages`
740
747
 
741
748
  Every repo gets the same five pages. They are a **taxonomy**, not a summary of your source: each one
742
749
  is synthesized from what the bank ingested — commit history and past conversations — and each is
@@ -857,7 +864,7 @@ it: the seed pass only visits the pages it is configured to own.
857
864
 
858
865
  Pointed at a bank, this plugin gives it the shape its ingestion needs: retain strategies for the
859
866
  kinds of document it writes (`git`, `gitlog`, `conversation`, `document`, `survey`), a `knowledge`
860
- entity-label group that routes facts to the knowledge pages, and — on a bank that has no missions of
867
+ entity-label group that routes facts to the pages, and — on a bank that has no missions of
861
868
  its own — the coding missions.
862
869
 
863
870
  **It only ever adds what is missing.** A strategy you defined, an edit you made to one of the
@@ -906,7 +913,7 @@ you configure yourself. That bank should then define the five strategies above i
906
913
  miss is **silent**: the server does not reject a retain naming a strategy the bank lacks, it logs a
907
914
  warning and extracts with the bank's own configuration — so a commit diff, a session transcript and
908
915
  a survey marker would all get the same generic treatment instead of the extraction each needs.
909
- Knowledge pages are seeded either way; `pageTriggerType` governs what they cost.
916
+ Pages are seeded either way; `pageTriggerType` governs what they cost.
910
917
 
911
918
  Like every field here it can be set per bank, which is usually where it belongs:
912
919
 
@@ -1097,7 +1104,7 @@ scope fills with beliefs built from chat transcripts. Only a per-document decisi
1097
1104
 
1098
1105
  It costs one extra consolidation pass per document, and it reads only `source:`, so a volatile
1099
1106
  provenance tag never becomes a scope. The global scope is still written first and unchanged, so the
1100
- untagged observations knowledge pages read are unaffected.
1107
+ untagged observations pages read are unaffected.
1101
1108
 
1102
1109
  `"per_tag"` and `"all_combinations"` split further still, and an explicit `[["project:demo"], …]`
1103
1110
  declares the scopes literally. `HINDSIGHT_OBSERVATION_SCOPES` sets the scalar modes; a scope list is
@@ -1111,7 +1118,7 @@ they stay where they were built, and new work accrues under the new setting.
1111
1118
  There is no user-facing ingest command — the deepen engine (`dist/deepen.js`) is spawned by every
1112
1119
  session start and does only the missing work: bank configuration, conversation import (dedup by
1113
1120
  document id), the one-time gitlog seed, the next per-commit diff batch (newest first, bounded per
1114
- run), then knowledge pages once extraction has drained. Harnesses that need deterministic ingestion
1121
+ run), then pages once extraction has drained. Harnesses that need deterministic ingestion
1115
1122
  (benchmarks, e2e suites) run the same engine directly and poll `dist/status.js` until
1116
1123
  `"synced": true` — the exact readiness contract the `hindsight_sync_status` agent tool reports.
1117
1124
 
@@ -1177,7 +1184,7 @@ as a JSON line to `~/.hindsight/coding-agents-logs/diag.jsonl` (override with
1177
1184
 
1178
1185
  `reflect_failed` / `pages_failed` record the error; if you're comparing memory-on vs memory-off,
1179
1186
  check this file — a run whose reflects failed is a no-memory run. When the failure was a timeout or
1180
- a 5xx, the hook falls back to knowledge-page search and, if no page matches, to a raw recall of the
1187
+ a 5xx, the hook falls back to page search and, if no page matches, to a raw recall of the
1181
1188
  bank's memories: `reflect_fallback_pages` / `reflect_fallback_observations` record what each
1182
1189
  step returned (`*_failed` when it errored). Seed starts are logged as
1183
1190
  `seed_started`.
@@ -1214,6 +1221,9 @@ Delete its bank on the server. The bank is the **only** state this integration k
1214
1221
  session in that repo is a true first open — seed and survey run again from scratch. There are no
1215
1222
  client-side files to clean up.
1216
1223
 
1224
+ Deleting a bank cannot be undone, so an agent never does it on its own: it names the repo and what
1225
+ would be lost, and the owner deletes the bank themselves from the control plane.
1226
+
1217
1227
  ### Marker documents you may notice
1218
1228
 
1219
1229
  Two document ids exist for the machinery's own bookkeeping. Both are safe to ignore and safe to