@vectorize-io/hindsight-coding-agents 0.7.0 → 0.8.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.
- package/README.md +137 -13
- package/dist/antigravity-hook.js +711 -55
- package/dist/antigravity-statusline.js +68 -7
- package/dist/antigravity-stop-hook.js +771 -57
- package/dist/claude-hook.js +711 -55
- package/dist/claude-sessionstart-hook.js +789 -68
- package/dist/claude-stop-hook.js +771 -57
- package/dist/cline.js +295 -75
- package/dist/codex-hook.js +711 -55
- package/dist/codex-sessionstart-hook.js +789 -68
- package/dist/codex-stop-hook.js +771 -57
- package/dist/copilot-hook.js +711 -55
- package/dist/copilot-sessionstart-hook.js +789 -68
- package/dist/copilot-stop-hook.js +771 -57
- package/dist/cursor-hook.js +711 -55
- package/dist/cursor-sessionstart-hook.js +789 -68
- package/dist/cursor-stop-hook.js +771 -57
- package/dist/daemon-start.js +38 -1
- package/dist/dcode-hook.js +711 -55
- package/dist/dcode-sessionstart-hook.js +789 -68
- package/dist/dcode-stop-hook.js +771 -57
- package/dist/deepen.js +236 -61
- package/dist/devin-hook.js +711 -55
- package/dist/devin-sessionstart-hook.js +789 -68
- package/dist/devin-stop-hook.js +771 -57
- package/dist/droid-hook.js +711 -55
- package/dist/droid-sessionstart-hook.js +789 -68
- package/dist/droid-stop-hook.js +771 -57
- package/dist/dsh.js +296 -76
- package/dist/grok-hook.js +711 -55
- package/dist/grok-sessionstart-hook.js +789 -68
- package/dist/grok-stop-hook.js +771 -57
- package/dist/hindsight-seed.js +41 -4
- package/dist/index.js +295 -75
- package/dist/installer.js +1148 -303
- package/dist/kilo.js +295 -75
- package/dist/kimi-hook.js +3909 -0
- package/dist/kimi-sessionstart-hook.js +4650 -0
- package/dist/kimi-stop-hook.js +4218 -0
- package/dist/mcp-server.js +162 -33
- package/dist/opencode2.js +298 -76
- package/dist/pi.js +299 -75
- package/dist/prime-agent.js +299 -75
- package/dist/qwen-hook.js +711 -55
- package/dist/qwen-sessionstart-hook.js +789 -68
- package/dist/qwen-stop-hook.js +771 -57
- package/dist/status.js +132 -14
- package/dist/traecode-hook.js +3909 -0
- package/dist/traecode-sessionstart-hook.js +4650 -0
- package/dist/traecode-stop-hook.js +4218 -0
- package/dist/zcode-hook.js +711 -55
- package/dist/zcode-sessionstart-hook.js +789 -68
- package/dist/zcode-stop-hook.js +771 -57
- package/package.json +15 -11
- package/plugin.json +1 -1
- package/skill/SKILL.md +70 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vectorize-io/hindsight-coding-agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/vectorize-io/hindsight.git",
|
|
@@ -35,9 +35,15 @@
|
|
|
35
35
|
"hindsight-zcode-hook": "dist/zcode-hook.js",
|
|
36
36
|
"hindsight-zcode-sessionstart-hook": "dist/zcode-sessionstart-hook.js",
|
|
37
37
|
"hindsight-zcode-stop-hook": "dist/zcode-stop-hook.js",
|
|
38
|
+
"hindsight-traecode-hook": "dist/traecode-hook.js",
|
|
39
|
+
"hindsight-traecode-sessionstart-hook": "dist/traecode-sessionstart-hook.js",
|
|
40
|
+
"hindsight-traecode-stop-hook": "dist/traecode-stop-hook.js",
|
|
38
41
|
"hindsight-droid-hook": "dist/droid-hook.js",
|
|
39
42
|
"hindsight-droid-sessionstart-hook": "dist/droid-sessionstart-hook.js",
|
|
40
|
-
"hindsight-droid-stop-hook": "dist/droid-stop-hook.js"
|
|
43
|
+
"hindsight-droid-stop-hook": "dist/droid-stop-hook.js",
|
|
44
|
+
"hindsight-kimi-hook": "dist/kimi-hook.js",
|
|
45
|
+
"hindsight-kimi-sessionstart-hook": "dist/kimi-sessionstart-hook.js",
|
|
46
|
+
"hindsight-kimi-stop-hook": "dist/kimi-stop-hook.js"
|
|
41
47
|
},
|
|
42
48
|
"exports": {
|
|
43
49
|
".": {
|
|
@@ -83,21 +89,19 @@
|
|
|
83
89
|
"test:dcode-e2e": "npm run build && HINDSIGHT_DCODE_E2E=1 vitest run src/dcode-plugin.e2e.test.ts",
|
|
84
90
|
"test:harness-e2e": "npm run build && HINDSIGHT_HARNESS_E2E=1 vitest run src/harness.e2e.test.ts"
|
|
85
91
|
},
|
|
86
|
-
"dependencies": {
|
|
87
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
88
|
-
"@vectorize-io/hindsight-all": "^0.8.6",
|
|
89
|
-
"jsonc-parser": "^3.3.1",
|
|
90
|
-
"smol-toml": "^1.8.0",
|
|
91
|
-
"zod": "^4.4.3"
|
|
92
|
-
},
|
|
93
92
|
"devDependencies": {
|
|
93
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
94
94
|
"@opencode-ai/plugin": "^1.18.9",
|
|
95
|
-
"@opencode/plugin": "^2.0.3",
|
|
96
95
|
"@opencode-ai/sdk": "^1.18.9",
|
|
96
|
+
"@opencode/plugin": "^2.0.3",
|
|
97
97
|
"@types/node": "^26.1.0",
|
|
98
|
+
"@vectorize-io/hindsight-all": "^0.8.6",
|
|
99
|
+
"jsonc-parser": "^3.3.1",
|
|
100
|
+
"smol-toml": "^1.8.0",
|
|
98
101
|
"tsup": "^8.3.0",
|
|
99
102
|
"typescript": "^5.6.0",
|
|
100
|
-
"vitest": "^4.1.11"
|
|
103
|
+
"vitest": "^4.1.11",
|
|
104
|
+
"zod": "^4.4.3"
|
|
101
105
|
},
|
|
102
106
|
"overrides": {
|
|
103
107
|
"esbuild": ">=0.25.0 <1.0.0",
|
package/plugin.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -110,14 +110,16 @@ Configuration is **one JSON file**: `~/.hindsight/coding-agent.json`. Layering,
|
|
|
110
110
|
(`HINDSIGHT_<FIELD_IN_CAPS>`), for containers and CI that inject config rather than write a file
|
|
111
111
|
3. the file's top level
|
|
112
112
|
4. its `harnesses.<name>` section — per-agent override
|
|
113
|
-
5. its `
|
|
113
|
+
5. its `paths.<prefix>` section — per-directory override, applied after the bank is resolved
|
|
114
|
+
(see [Per-directory overrides](#per-directory-overrides--pathsprefix))
|
|
115
|
+
6. its `banks.<resolvedBankId>` section — per-repo override, applied after the bank is resolved
|
|
114
116
|
(see [Per-repo opt-in/out](#per-repo-opt-inout--banksbankid))
|
|
115
117
|
|
|
116
118
|
Environment variables are a **fallback**: the file wins wherever it sets a value, so adding env to
|
|
117
119
|
an existing setup changes nothing. The two list-valued settings, `retainTags` and `optInPaths`, take
|
|
118
120
|
a comma-separated value (`HINDSIGHT_RETAIN_TAGS="project:{gitProject},env:work"`); entries are
|
|
119
121
|
trimmed and blanks dropped.
|
|
120
|
-
The map-valued settings (`mapPathToBank`, `harnesses`, `banks`, `retainMetadata`) are file-only —
|
|
122
|
+
The map-valued settings (`mapPathToBank`, `harnesses`, `paths`, `banks`, `retainMetadata`) are file-only —
|
|
121
123
|
per-key branching doesn't survive flattening into one variable. `maxParallelRetains` is available
|
|
122
124
|
as `HINDSIGHT_MAX_PARALLEL_RETAINS` for containers and CI.
|
|
123
125
|
|
|
@@ -203,17 +205,21 @@ hook by Codex...), so one shared config serves several agents side by side:
|
|
|
203
205
|
| `resolveWorktrees` | `true` | linked worktrees inherit the main checkout's bank identity, path approval, and mapping |
|
|
204
206
|
| `retainTags` | — | extra tags on every document written by the integration, e.g. `["project:{gitProject}"]` — see **Recording where a memory came from** below |
|
|
205
207
|
| `retainMetadata` | — | extra metadata on every document written by the integration, e.g. `{"repo": "{gitProject}"}` |
|
|
208
|
+
| `retainContext` | see description | the `context` sent with every session write-back. Extraction reads it to decide whose claim a sentence is, so the default names both speakers, and asks for an agent's own "fixed" or "passes" to be stored as its claim rather than as fact. Accepts the same `{placeholder}` templates as `retainTags` |
|
|
206
209
|
| `manageBankConfig` | `true` | let the plugin shape the bank's own configuration — the retain strategies it writes under, the `knowledge` entity-label group, and, on a bank that has none, the missions. Writing is **additive**: it adds what the bank does not define and never overwrites what is there, so your control-plane edits survive — the one exception is the extraction mode of its own strategies, which follows `retainExtractionMode`. Set `false` to keep it out of the bank config entirely — see **A bank you shape yourself** below |
|
|
207
210
|
| `retainExtractionMode` | `"concise"` | how the server extracts memories from sessions, commits and documents: `"concise"`, `"verbose"`, `"verbatim"` or `"chunks"` (store the text, no extraction). Every Stop writes the session back, so this is what each turn costs — `"verbose"` pulls more detail for several times the tokens. Kept in sync on the plugin's own retain strategies every session, so a change reaches existing banks too (not with `manageBankConfig: false`) |
|
|
211
|
+
| `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 |
|
|
208
212
|
| `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 |
|
|
209
213
|
| `disabled` | `false` | hard off-switch (inert plugin/hook — a no-memory baseline) |
|
|
210
214
|
| `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) |
|
|
211
215
|
| `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 |
|
|
216
|
+
| `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 |
|
|
212
217
|
| `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 |
|
|
213
|
-
| `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),
|
|
218
|
+
| `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` |
|
|
214
219
|
| `autoReflect` | `true` | **deprecated** — use `autoInject`. Still honoured (`false` = `autoInject: "none"`), ignored when `autoInject` is set, and logs a deprecation warning |
|
|
215
220
|
| `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 |
|
|
216
221
|
| `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 |
|
|
222
|
+
| `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."` |
|
|
217
223
|
| `pageRefreshEveryTurns` | `10` | refetch the knowledge pages and re-inject the page roster + tool guide every N user turns |
|
|
218
224
|
| `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) |
|
|
219
225
|
| `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 |
|
|
@@ -229,7 +235,7 @@ hook by Codex...), so one shared config serves several agents side by side:
|
|
|
229
235
|
| `maxParallelRetains` | `10` | cap on concurrent retain-related requests: drain()'s per-op polls plus deepen's chat/git retain pools. The API rate-limits bursts, not single requests — if you see 429s, lower this rather than raising it |
|
|
230
236
|
| `logLevel` | `"info"` | plugin-log verbosity (`"debug"` \| `"info"` \| `"warn"` \| `"error"`); `HINDSIGHT_LOG_LEVEL` env overrides |
|
|
231
237
|
| `autoUpdate` | `true` | keep the installed runtime current by itself: once a day a session start asks npm for the published version and, when it is newer, re-stages `~/.hindsight/coding-agents` in the background. It rewires no host config, so a release adding a **new** hook entry point still needs a manual `install`. Set `false` to pin the installed version; `disabled` stops it too, since an inert plugin should stay inert. Only ever replaces a runtime installed the documented way, via `npx` — a copy installed with `npm i -g`, vendored as a project dependency, or built from a checkout is left to whoever manages it (update those the way you installed them), and it needs `npx` and `npm` on `PATH` |
|
|
232
|
-
| `gitIngest` | `"message"` | git depth for seeding AND staying current (same engine): `"message"` = commit messages only (one doc, re-upserted when HEAD
|
|
238
|
+
| `gitIngest` | `"message"` | git depth for seeding AND staying current (same engine): `"message"` = commit messages only (one doc, re-upserted when HEAD has a commit it lacks); `"full"` = messages + per-commit full diffs (progressive, newest first); `"none"` = git off |
|
|
233
239
|
| `harnesses.<name>` | — | per-harness override of any field above |
|
|
234
240
|
| `harness` | `opencode` | **deepen engine only**: which session format `--conversations` is read as |
|
|
235
241
|
|
|
@@ -415,13 +421,40 @@ One field is the exception: the extraction mode of the plugin's own four strateg
|
|
|
415
421
|
if it drifts — the same way a seeded page's query is. Change it in `coding-agent.json`, not in the
|
|
416
422
|
control plane. The strategies' other fields, and your own strategies, are still left alone.
|
|
417
423
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
the
|
|
424
|
-
|
|
424
|
+
**Your own defaults for new banks — `defaultBankConfig`.** Everything the template does not name, a
|
|
425
|
+
bank the plugin creates gets from the server: auto-consolidation on, observations on, a 60s floor
|
|
426
|
+
between mental-model refreshes. With one bank per repo those are the settings that cost money, and
|
|
427
|
+
a new repo an agent touches spawns a new bank with all of them switched on — while every bank you had
|
|
428
|
+
hand-tuned in the control plane sits at a cheaper baseline. `defaultBankConfig` names the baseline
|
|
429
|
+
once, in the plugin's config, and it travels in the same import that creates the bank:
|
|
430
|
+
|
|
431
|
+
```json
|
|
432
|
+
{
|
|
433
|
+
"defaultBankConfig": {
|
|
434
|
+
"enable_observations": false,
|
|
435
|
+
"enable_auto_consolidation": false,
|
|
436
|
+
"mental_model_min_refresh_interval_seconds": 21600
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
The keys are the bank-config API's own field names, passed straight through, so anything the
|
|
442
|
+
bank-config accepts can go here. They follow the same additive rule as the template: written only
|
|
443
|
+
where the bank is silent, so an existing bank picks them up on its next session **except** for the
|
|
444
|
+
fields it already sets — a value you chose in the control plane stays, even one equal to the server
|
|
445
|
+
default, and so does a value an earlier plugin release seeded (the template writes
|
|
446
|
+
`enable_observations: true` alongside the missions; clear that override on the bank to let your
|
|
447
|
+
default in). On a key the template also names, your default wins. The three fields the plugin
|
|
448
|
+
governs itself — `retain_strategies`, `entity_labels` and `retain_extraction_mode` — are refused
|
|
449
|
+
with a warning: the first two are merged entry by entry, the last is `retainExtractionMode`'s.
|
|
450
|
+
|
|
451
|
+
Set `manageBankConfig: false` to keep the plugin out of the bank's configuration altogether,
|
|
452
|
+
`defaultBankConfig` included — the right setting for a bank you share with non-coding work, or one
|
|
453
|
+
you configure yourself. That bank should then define the five strategies above itself. Note that the
|
|
454
|
+
miss is **silent**: the server does not reject a retain naming a strategy the bank lacks, it logs a
|
|
455
|
+
warning and extracts with the bank's own configuration — so a commit diff, a session transcript and
|
|
456
|
+
a survey marker would all get the same generic treatment instead of the extraction each needs.
|
|
457
|
+
Knowledge pages are seeded either way; `pageTriggerType` governs what they cost.
|
|
425
458
|
|
|
426
459
|
Like every field here it can be set per bank, which is usually where it belongs:
|
|
427
460
|
|
|
@@ -481,6 +514,32 @@ every repo (present and future) beneath it:
|
|
|
481
514
|
Rule of thumb: converge by **id** for a hand-picked set of repos; map by **path** when a folder is
|
|
482
515
|
the boundary ("everything I clone under `work/client-x` shares memory").
|
|
483
516
|
|
|
517
|
+
### Per-directory overrides — `paths.<prefix>`
|
|
518
|
+
|
|
519
|
+
When a folder is the boundary for something other than the bank — typically a different server
|
|
520
|
+
or tenant for client work — key the override by directory instead of by bank id:
|
|
521
|
+
|
|
522
|
+
```jsonc
|
|
523
|
+
{
|
|
524
|
+
"apiToken": "personal-key",
|
|
525
|
+
"paths": {
|
|
526
|
+
"~/work/client-x": { "apiToken": "client-x-key" },
|
|
527
|
+
"~/work/acme": { "apiUrl": "https://hindsight.acme.internal", "apiToken": "acme-key" },
|
|
528
|
+
"~/oss": { "serverMode": "daemon" },
|
|
529
|
+
},
|
|
530
|
+
}
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Every repo under the prefix, present and future, keeps its own bank but uses the entry's
|
|
534
|
+
settings. The longest matching prefix wins, and a linked worktree outside the tree uses its main
|
|
535
|
+
checkout's entry, as with `mapPathToBank`. The section applies after bank resolution and before
|
|
536
|
+
`banks.<bankId>`, so a bank section still wins for its one repo. Bank-resolution and approval
|
|
537
|
+
fields (`bankId`, `mapPathToBank`, `bank`, `optInOnly`, `optInPaths`, ...) are ignored inside a
|
|
538
|
+
path section. Any connection setting can be overridden — `serverMode`, `apiUrl`, `apiPort`,
|
|
539
|
+
`apiToken` — so one directory can use a local daemon while another uses Cloud or a self-hosted
|
|
540
|
+
server. The token is re-read on a rejected request, like the top-level `apiToken`, but only while
|
|
541
|
+
the directory still points at the same server.
|
|
542
|
+
|
|
484
543
|
### Bank resolution
|
|
485
544
|
|
|
486
545
|
Coding memory is **per repository**. Resolution order for the working directory:
|