@mickey-kras/hindsight-memory-router-coding-agents 0.0.0-stage → 0.8.2

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 (71) hide show
  1. package/DEVIATIONS.md +49 -0
  2. package/LICENSE +23 -0
  3. package/README.md +57 -2
  4. package/UPSTREAM.json +263 -0
  5. package/cordis.patch.yml +18 -0
  6. package/dist/antigravity-hook.js +5661 -0
  7. package/dist/antigravity-statusline.js +1329 -0
  8. package/dist/antigravity-stop-hook.js +5854 -0
  9. package/dist/claude-hook.js +5661 -0
  10. package/dist/claude-sessionstart-hook.js +6344 -0
  11. package/dist/claude-stop-hook.js +5854 -0
  12. package/dist/cline.js +24927 -0
  13. package/dist/codebuddy-hook.js +5661 -0
  14. package/dist/codebuddy-sessionstart-hook.js +6344 -0
  15. package/dist/codebuddy-stop-hook.js +5854 -0
  16. package/dist/codex-hook.js +5661 -0
  17. package/dist/codex-sessionstart-hook.js +6344 -0
  18. package/dist/codex-stop-hook.js +5854 -0
  19. package/dist/copilot-hook.js +5661 -0
  20. package/dist/copilot-sessionstart-hook.js +6344 -0
  21. package/dist/copilot-stop-hook.js +5854 -0
  22. package/dist/cursor-hook.js +5661 -0
  23. package/dist/cursor-sessionstart-hook.js +6344 -0
  24. package/dist/cursor-stop-hook.js +5854 -0
  25. package/dist/daemon-start.js +13 -0
  26. package/dist/dcode-hook.js +5661 -0
  27. package/dist/dcode-sessionstart-hook.js +6344 -0
  28. package/dist/dcode-stop-hook.js +5854 -0
  29. package/dist/deepen.js +3115 -0
  30. package/dist/devin-hook.js +5661 -0
  31. package/dist/devin-sessionstart-hook.js +6344 -0
  32. package/dist/devin-stop-hook.js +5854 -0
  33. package/dist/droid-hook.js +5661 -0
  34. package/dist/droid-sessionstart-hook.js +6344 -0
  35. package/dist/droid-stop-hook.js +5854 -0
  36. package/dist/dsh.js +25049 -0
  37. package/dist/grok-hook.js +5661 -0
  38. package/dist/grok-sessionstart-hook.js +6344 -0
  39. package/dist/grok-stop-hook.js +5854 -0
  40. package/dist/hindsight-seed.js +1131 -0
  41. package/dist/index.d.ts +5 -0
  42. package/dist/index.js +37456 -0
  43. package/dist/installer.js +9025 -0
  44. package/dist/kilo.js +37456 -0
  45. package/dist/kimi-hook.js +5661 -0
  46. package/dist/kimi-sessionstart-hook.js +6344 -0
  47. package/dist/kimi-stop-hook.js +5854 -0
  48. package/dist/mcp-server.js +39650 -0
  49. package/dist/opencode2.js +37415 -0
  50. package/dist/pi.js +24995 -0
  51. package/dist/prime-agent.js +24995 -0
  52. package/dist/qwen-hook.js +5661 -0
  53. package/dist/qwen-sessionstart-hook.js +6344 -0
  54. package/dist/qwen-stop-hook.js +5854 -0
  55. package/dist/status.js +2516 -0
  56. package/dist/survey-supervisor.js +81 -0
  57. package/dist/traecode-hook.js +5661 -0
  58. package/dist/traecode-sessionstart-hook.js +6344 -0
  59. package/dist/traecode-stop-hook.js +5854 -0
  60. package/dist/workbuddy-hook.js +5661 -0
  61. package/dist/workbuddy-sessionstart-hook.js +6344 -0
  62. package/dist/workbuddy-stop-hook.js +5854 -0
  63. package/dist/zcode-hook.js +5661 -0
  64. package/dist/zcode-sessionstart-hook.js +6344 -0
  65. package/dist/zcode-stop-hook.js +5854 -0
  66. package/hooks/hooks.json +37 -0
  67. package/index.js +10 -0
  68. package/npm-shrinkwrap.json +7354 -0
  69. package/package.json +123 -4
  70. package/plugin.json +16 -0
  71. package/skill/SKILL.md +134 -0
package/package.json CHANGED
@@ -1,6 +1,125 @@
1
1
  {
2
2
  "name": "@mickey-kras/hindsight-memory-router-coding-agents",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.8.2",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/mickey-kras/hindsight-memory-router-integrations.git",
7
+ "directory": "src/upstream/coding-agents"
8
+ },
9
+ "description": "Reflect-only Hindsight long-term memory for coding agents (harness-pluggable: opencode, …), with automatic background ingestion (no setup CLI).",
10
+ "type": "module",
11
+ "main": "dist/index.js",
12
+ "types": "dist/index.d.ts",
13
+ "bin": {
14
+ "hindsight-coding-agents": "dist/installer.js",
15
+ "hindsight-claude-hook": "dist/claude-hook.js",
16
+ "hindsight-cursor-hook": "dist/cursor-hook.js",
17
+ "hindsight-cursor-sessionstart-hook": "dist/cursor-sessionstart-hook.js",
18
+ "hindsight-cursor-stop-hook": "dist/cursor-stop-hook.js",
19
+ "hindsight-copilot-hook": "dist/copilot-hook.js",
20
+ "hindsight-copilot-sessionstart-hook": "dist/copilot-sessionstart-hook.js",
21
+ "hindsight-copilot-stop-hook": "dist/copilot-stop-hook.js",
22
+ "hindsight-grok-hook": "dist/grok-hook.js",
23
+ "hindsight-grok-sessionstart-hook": "dist/grok-sessionstart-hook.js",
24
+ "hindsight-grok-stop-hook": "dist/grok-stop-hook.js",
25
+ "hindsight-codex-hook": "dist/codex-hook.js",
26
+ "hindsight-dcode-hook": "dist/dcode-hook.js",
27
+ "hindsight-dcode-sessionstart-hook": "dist/dcode-sessionstart-hook.js",
28
+ "hindsight-dcode-stop-hook": "dist/dcode-stop-hook.js",
29
+ "hindsight-antigravity-hook": "dist/antigravity-hook.js",
30
+ "hindsight-antigravity-statusline": "dist/antigravity-statusline.js",
31
+ "hindsight-devin-hook": "dist/devin-hook.js",
32
+ "hindsight-qwen-hook": "dist/qwen-hook.js",
33
+ "hindsight-qwen-sessionstart-hook": "dist/qwen-sessionstart-hook.js",
34
+ "hindsight-qwen-stop-hook": "dist/qwen-stop-hook.js",
35
+ "hindsight-zcode-hook": "dist/zcode-hook.js",
36
+ "hindsight-zcode-sessionstart-hook": "dist/zcode-sessionstart-hook.js",
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",
41
+ "hindsight-workbuddy-hook": "dist/workbuddy-hook.js",
42
+ "hindsight-workbuddy-sessionstart-hook": "dist/workbuddy-sessionstart-hook.js",
43
+ "hindsight-workbuddy-stop-hook": "dist/workbuddy-stop-hook.js",
44
+ "hindsight-codebuddy-hook": "dist/codebuddy-hook.js",
45
+ "hindsight-codebuddy-sessionstart-hook": "dist/codebuddy-sessionstart-hook.js",
46
+ "hindsight-codebuddy-stop-hook": "dist/codebuddy-stop-hook.js",
47
+ "hindsight-droid-hook": "dist/droid-hook.js",
48
+ "hindsight-droid-sessionstart-hook": "dist/droid-sessionstart-hook.js",
49
+ "hindsight-droid-stop-hook": "dist/droid-stop-hook.js",
50
+ "hindsight-kimi-hook": "dist/kimi-hook.js",
51
+ "hindsight-kimi-sessionstart-hook": "dist/kimi-sessionstart-hook.js",
52
+ "hindsight-kimi-stop-hook": "dist/kimi-stop-hook.js"
53
+ },
54
+ "exports": {
55
+ ".": {
56
+ "types": "./dist/index.d.ts",
57
+ "default": "./dist/index.js"
58
+ },
59
+ "./dsh": "./dist/dsh.js",
60
+ "./cordis.patch.yml": "./cordis.patch.yml",
61
+ "./package.json": "./package.json",
62
+ "./dist/*": "./dist/*"
63
+ },
64
+ "files": [
65
+ "skill",
66
+ "dist",
67
+ "index.js",
68
+ "cordis.patch.yml",
69
+ "plugin.json",
70
+ "hooks",
71
+ "UPSTREAM.json",
72
+ "DEVIATIONS.md",
73
+ "npm-shrinkwrap.json"
74
+ ],
75
+ "dsh": {
76
+ "bundle": {
77
+ "patch": "./cordis.patch.yml"
78
+ }
79
+ },
80
+ "cline": {
81
+ "plugins": [
82
+ {
83
+ "paths": [
84
+ "./dist/cline.js"
85
+ ],
86
+ "capabilities": [
87
+ "hooks"
88
+ ]
89
+ }
90
+ ]
91
+ },
92
+ "scripts": {
93
+ "build": "tsup",
94
+ "test": "vitest run",
95
+ "test:upstream": "vitest run --exclude **/*.e2e.test.ts"
96
+ },
97
+ "dependencies": {
98
+ "@modelcontextprotocol/sdk": "^1.32.1",
99
+ "@napi-rs/keyring": "2.1.1",
100
+ "jsonc-parser": "^3.3.1",
101
+ "smol-toml": "^1.9.1",
102
+ "zod": "^4.6.5"
103
+ },
104
+ "devDependencies": {
105
+ "@opencode-ai/plugin": "^1.18.35",
106
+ "@opencode-ai/sdk": "^1.18.9",
107
+ "@opencode/plugin": "^2.0.26",
108
+ "@types/node": "22.20.5",
109
+ "tsup": "^8.3.0",
110
+ "typescript": "^5.6.0",
111
+ "vitest": "^5.0.3"
112
+ },
113
+ "overrides": {
114
+ "@opencode/plugin": {
115
+ "@opentelemetry/core": ">=2.8.0 <3.0.0"
116
+ },
117
+ "esbuild": ">=0.25.0 <1.0.0",
118
+ "fast-uri": ">=3.1.6 <4.0.0",
119
+ "hono": ">=4.13.7 <5.0.0",
120
+ "http-cache-semantics": "4.3.0",
121
+ "ip-address": ">=10.5.1 <11.0.0",
122
+ "postcss": ">=8.5.23 <9.0.0",
123
+ "vite": ">=6.4.3 <7.0.0"
124
+ }
125
+ }
package/plugin.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "hindsight-coding-agents",
3
+ "version": "0.8.1",
4
+ "description": "Long-term project memory for coding agents",
5
+ "skills": "./skill",
6
+ "hooks": "./hooks/hooks.json",
7
+ "mcpServers": {
8
+ "hindsight": {
9
+ "command": "node",
10
+ "args": ["${PLUGIN_ROOT}/dist/mcp-server.js"],
11
+ "env": {
12
+ "HINDSIGHT_MCP_HARNESS": "dcode"
13
+ }
14
+ }
15
+ }
16
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: hindsight-coding-agent
3
+ description: How this machine's Hindsight coding-agent memory works — the plugin behind the 🧠 banner. Use when the user says "store/remember this in hindsight", asks what the memory/knowledge pages are, needs managed project memory setup or troubleshooting, or something memory-related looks broken.
4
+ ---
5
+
6
+ <!-- GENERATED from skill-src/preamble.md + skill-src/managed-router.md.
7
+ Edit those, then run: node scripts/build-skill.mjs -->
8
+
9
+ # Hindsight Coding-Agent Memory
10
+
11
+ This machine runs the managed Memory Router coding-agent integration. All memory requests go
12
+ through the operator-provisioned HTTPS router and its per-principal bank grants. The router
13
+ applies scanning, quarantine and quotas. A client setting cannot grant access.
14
+
15
+ ## Automatic lifecycle
16
+
17
+ - The operator maps this project and harness to an explicit bank. Worktrees use their configured
18
+ project mapping; no bank is created or selected from a repository name.
19
+ - For writable principals, session-start hooks can seed and update memory from recent commits
20
+ and a read-only codebase survey, and refresh coding knowledge pages. There is no manual ingest
21
+ command needed for this background work. The operator provisions bank configuration and the
22
+ coding missions/strategies before ingestion.
23
+ - Session-start and prompt hooks inject memory according to `autoInject`: `reflect`, `pages`,
24
+ `recall`, or `none`. Follow the injected retrieval guide when no memory is injected.
25
+ - Writable sessions retain their transcripts automatically at session end; persistent harnesses
26
+ also retain during the session. Read-only principals skip ingestion and write-back, and their
27
+ write tools are unavailable. Respect `disabled` and `retainSessions` settings.
28
+ - Use the tool names exposed by this harness. Examples below show the default `hindsight_`
29
+ namespace; the installed skill and guidance use the operator's configured namespace.
30
+
31
+ ## Storing things deliberately
32
+
33
+ When the user says "store this in hindsight" / "remember this":
34
+
35
+ - With writable access and session retention enabled, the **current conversation** is captured
36
+ automatically at session end — say so; no tool needed.
37
+ - An **external document, notes, or durable findings** → `hindsight_ingest_document(title, content)`.
38
+ - A **new feature/initiative being started** → `hindsight_capture_initiative(title, summary)`,
39
+ right after the plan is agreed and before code is written.
40
+ - A **plan that materially changed** (goal, scope, or rationale — including mid-implementation) →
41
+ call `hindsight_capture_initiative` again with `relates_to_page_id` set to that initiative's page
42
+ id, summarising the _current_ intent. Same page, updated plan — never a second page. Trivial
43
+ course-corrections don't count.
44
+
45
+ ## Retrieving
46
+
47
+ - `hindsight_search_knowledge_pages(query)` — FIRST STOP for project questions (components,
48
+ conventions, past decisions, initiatives). Server-side hybrid search, fast.
49
+ - `hindsight_read_knowledge_page(page_id)` / `hindsight_list_knowledge_pages` — read pages fully.
50
+ - `hindsight_reflect(query)` — deep reasoning over the whole memory for WHY questions and exact
51
+ decided values; slower (seconds), use deliberately.
52
+ - Credit visibly whenever memory informs an answer: start that part with
53
+ `🧠 From Hindsight memory (<page>): …` — and never credit memory that didn't contribute.
54
+
55
+ ## Correcting wrong or stale memory
56
+
57
+ If you verify that something Hindsight served is wrong or outdated (the code, git, or an external
58
+ source contradicts it), FIX THE RECORD — don't just ignore it. Call
59
+ `hindsight_ingest_document` with:
60
+
61
+ - **title**: `Correction: <topic>` (e.g. `Correction: retry policy 4xx set`)
62
+ - **content**: (1) what memory claimed, (2) what is verifiably true now, (3) the evidence you
63
+ checked (file/commit/output). Quote exact values verbatim.
64
+
65
+ Include the evidence in the correction so future retrieval can resolve the conflict. With read-only
66
+ access, report the verified correction for an authorized writer; do not attempt a write or change
67
+ credentials.
68
+
69
+ ## Managed setup and updates
70
+
71
+ Use the existing operator-provisioned `HINDSIGHT_ROUTER_CONFIG` absolute path and named credential
72
+ environment variables. The operator supplies the HTTPS router URL, principal grants, project bank
73
+ mapping and optional tool namespace. `HINDSIGHT_MCP_HARNESS` selects the trusted harness identity
74
+ when needed. Launch the harness in the same provisioned environment from a mapped project.
75
+
76
+ Do not ask the user to paste JSON or credentials, edit the managed JSON, copy tokens into harness
77
+ settings, or start a memory server. Missing provisioning or ambiguous identity requires the
78
+ operator to repair the deployment. Unmapped projects and missing credentials fail closed.
79
+
80
+ Install or update only using the integration's pinned release tarball. Select the release and
81
+ package version from the same published release, verify the artifact against that release's
82
+ `PACKAGE_SHA256`, and run:
83
+
84
+ ```sh
85
+ npm exec --yes --package=/absolute/path/verified-coding-agents.tgz -- hindsight-coding-agents install
86
+ ```
87
+
88
+ The release download path is:
89
+ `https://github.com/mickey-kras/hindsight-memory-router-integrations/releases/download/v<release>/mickey-kras-hindsight-memory-router-coding-agents-<package-version>.tgz`.
90
+ Do not leave version placeholders unresolved. Explicit `install codex`, another supported harness,
91
+ or `install all` is available when the existing managed configuration supports it. The installer
92
+ checks the selected principals, credentials, project mapping and adapter prerequisites before
93
+ changing the host. For Codex, export `HINDSIGHT_ROUTER_CONFIG` before installation so the installer
94
+ can allowlist the required environment variable names without embedding their values.
95
+
96
+ After changing the operator's credential environment variable name or tool namespace, reinstall
97
+ from the verified artifact. Namespace changes require reinstalling the companion skill and tool
98
+ registration together. The managed tool prefix controls tool definitions and guidance; ordinary
99
+ per-bank settings cannot override it.
100
+
101
+ ## Checking the integration
102
+
103
+ Check the session banner and available memory tools first. Use `hindsight_sync_status` for ingestion
104
+ progress and `hindsight_diagnose` for sanitized diagnostic information when these tools are available.
105
+ If memory seems stale, inspect progress before repeating ingestion or inventing another bank.
106
+ Use the diagnostics to confirm the current project bank. Ask the operator to verify assigned bank
107
+ grants and project mappings in the managed configuration when access or bank selection is unclear.
108
+
109
+ Missing hooks or tools usually require reinstalling the selected harness from the verified artifact
110
+ with its managed environment. Review the harness's plugin/hook registration and sanitized logs;
111
+ never print credential values. A 401/403 stops requests for that credential. Ask the operator to
112
+ resolve authorization and restart with the provisioned credential; do not try another principal,
113
+ URL or bank. Rate limits and quarantine decisions are enforced by the router and are not bypassed
114
+ by local settings. Continue coding without memory when the harness fails open, and state any
115
+ material lack of memory evidence.
116
+
117
+ Operational coding-agent settings such as `autoInject`, `retainSessions`, `disabled`, git survey
118
+ limits and logging may be configured by the operator in the supported coding-agent settings.
119
+ The managed routing boundary owns bank access and transport; do not create banks, rewrite bank
120
+ configuration, provision servers or substitute a provider client. Background ingestion and hooks
121
+ use the same router boundary as interactive tools.
122
+
123
+ ### Optional branding
124
+
125
+ The operator may set `toolPrefix` in the same managed router JSON. The default `hindsight_`
126
+ keeps the upstream names. Tool, skill, registration and display names derive from that one
127
+ value. Package
128
+ names, `HINDSIGHT_*` environment variables, configuration paths, principals and bank grants
129
+ remain unchanged. Use the names registered in the current session; do not guess aliases.
130
+
131
+ A branding change requires the pinned installer (`install` or `update`) and a fresh session.
132
+ The installer migrates only managed entries and refuses unrelated name collisions. A stale
133
+ managed skill namespace fails closed until reinstall; never repair this by changing bank
134
+ assignments, credentials or the operational memory workflow above.