total-recall-brain 3.37.0 → 3.39.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 (236) hide show
  1. package/README.md +40 -127
  2. package/bin/total-recall-memory.mjs +4 -0
  3. package/bin/total-recall.mjs +9 -17
  4. package/docs/ARCHITECTURE.md +3 -1
  5. package/docs/reference/cli-reference.md +14 -4
  6. package/frontend/dist/assets/index-D3Y3J5MC.js +5815 -0
  7. package/frontend/dist/index.html +1 -1
  8. package/frontend/src/App.tsx +1 -1
  9. package/frontend/src/api/plugins.ts +1 -0
  10. package/frontend/src/api/update.ts +8 -0
  11. package/frontend/src/components/plugins/PluginPanel.tsx +80 -0
  12. package/frontend/src/components/plugins/PluginSettings.tsx +83 -0
  13. package/frontend/src/components/plugins/plugin-frame.ts +45 -0
  14. package/frontend/src/pages/HealthPage.tsx +5 -3
  15. package/frontend/src/pages/PluginsPage.tsx +434 -57
  16. package/frontend/src/pages/SettingsPage.tsx +17 -6
  17. package/frontend/src/types.ts +4 -1
  18. package/frontend/vite.config.ts +3 -0
  19. package/metadata.plugin.schema.json +395 -0
  20. package/package.json +28 -14
  21. package/scaffold/.agent/skills/meta-harness/SKILL.md +1 -1
  22. package/scaffold/.agent/skills/meta-harness/references/optimized/manifest.json +2 -2
  23. package/scaffold/.agent/skills/meta-harness/references/optimized/original.md +27 -5
  24. package/scaffold/.agent/skills/meta-harness/references/optimized/section-02.md +11 -4
  25. package/scaffold/.agent/skills/meta-harness/references/optimized/section-09.md +11 -0
  26. package/scaffold/.agent/skills/project-management/SKILL.md +31 -3
  27. package/scaffold/.agent/skills/project-management/evals/evals.json +9 -0
  28. package/scaffold/.agent/skills/project-management/evals/project-management.test.mjs +55 -0
  29. package/scaffold/.agent/skills/project-management/hooks/on-issue-update.sh +10 -0
  30. package/scaffold/.agent/skills/project-management/hooks/on-pr-review.sh +5 -0
  31. package/scaffold/.agent/skills/project-management/references/github_issue_mapping.md +8 -0
  32. package/scaffold/.agent/skills/project-management/references/optimized/index.md +40 -0
  33. package/scaffold/.agent/skills/project-management/references/optimized/manifest.json +159 -0
  34. package/scaffold/.agent/skills/project-management/references/optimized/original.md +489 -0
  35. package/scaffold/.agent/skills/project-management/references/optimized/section-01.md +3 -0
  36. package/scaffold/.agent/skills/project-management/references/optimized/section-02.md +6 -0
  37. package/scaffold/.agent/skills/project-management/references/optimized/section-03.md +4 -0
  38. package/scaffold/.agent/skills/project-management/references/optimized/section-04.md +14 -0
  39. package/scaffold/.agent/skills/project-management/references/optimized/section-05.md +14 -0
  40. package/scaffold/.agent/skills/project-management/references/optimized/section-06.md +9 -0
  41. package/scaffold/.agent/skills/project-management/references/optimized/section-07.md +13 -0
  42. package/scaffold/.agent/skills/project-management/references/optimized/section-08.md +22 -0
  43. package/scaffold/.agent/skills/project-management/references/optimized/section-09.md +28 -0
  44. package/scaffold/.agent/skills/project-management/references/optimized/section-10.md +12 -0
  45. package/scaffold/.agent/skills/project-management/references/optimized/section-11.md +19 -0
  46. package/scaffold/.agent/skills/project-management/references/optimized/section-12.md +30 -0
  47. package/scaffold/.agent/skills/project-management/references/optimized/section-13.md +8 -0
  48. package/scaffold/.agent/skills/project-management/references/optimized/section-14.md +11 -0
  49. package/scaffold/.agent/skills/project-management/references/optimized/section-15.md +7 -0
  50. package/scaffold/.agent/skills/project-management/references/optimized/section-16.md +4 -0
  51. package/scaffold/.agent/skills/project-management/references/optimized/section-17.md +2 -0
  52. package/scaffold/.agent/skills/project-management/references/optimized/section-18.md +26 -0
  53. package/scaffold/.agent/skills/project-management/references/optimized/section-19.md +31 -0
  54. package/scaffold/.agent/skills/project-management/references/optimized/section-20.md +4 -0
  55. package/scaffold/.agent/skills/project-management/references/optimized/section-21.md +22 -0
  56. package/scaffold/.agent/skills/project-management/references/optimized/section-22.md +32 -0
  57. package/scaffold/.agent/skills/project-management/references/optimized/section-23.md +20 -0
  58. package/scaffold/.agent/skills/project-management/references/optimized/section-24.md +9 -0
  59. package/scaffold/.agent/skills/project-management/references/optimized/section-25.md +2 -0
  60. package/scaffold/.agent/skills/project-management/references/optimized/section-26.md +4 -0
  61. package/scaffold/.agent/skills/project-management/references/optimized/section-27.md +4 -0
  62. package/scaffold/.agent/skills/project-management/references/optimized/section-28.md +4 -0
  63. package/scaffold/.agent/skills/project-management/references/optimized/section-29.md +4 -0
  64. package/scaffold/.agent/skills/project-management/references/optimized/section-30.md +4 -0
  65. package/scaffold/.agent/skills/project-management/references/optimized/section-31.md +12 -0
  66. package/scaffold/.agent/skills/project-management/references/optimized/section-32.md +8 -0
  67. package/scaffold/.agent/skills/project-management/references/optimized/section-33.md +39 -0
  68. package/scaffold/.agent/skills/project-management/references/optimized/section-34.md +12 -0
  69. package/scaffold/.agent/skills/project-management/references/optimized/section-35.md +12 -0
  70. package/scaffold/.agent/skills/project-management/references/optimized/section-36.md +29 -0
  71. package/scaffold/.agent/skills/project-management/scripts/next-task.mjs +136 -0
  72. package/scaffold/.agent/skills/project-management/scripts/triage-projects.mjs +194 -0
  73. package/scaffold/.agent/skills/project-management/scripts/verify-issues.mjs +31 -0
  74. package/scaffold/.agent/skills/project-management/subagents/pm-assistant.md +7 -0
  75. package/scaffold/.agent/skills/start/SKILL.md +1 -1
  76. package/scaffold/.agent/skills/start/evals/evals.json +1 -25
  77. package/scaffold/.agent/skills/total-recall/SKILL.md +1 -0
  78. package/scaffold/.agent/skills/total-recall/derived/embeddings.db +0 -0
  79. package/scaffold/.agent/skills/total-recall/memory-vault/invariants/operating-instructions.md +7 -36
  80. package/src/cli/agent-dir.mjs +5 -5
  81. package/src/cli/brief.mjs +27 -0
  82. package/src/cli/connect.mjs +49 -0
  83. package/src/cli/context.mjs +1 -1
  84. package/src/cli/edit.mjs +9 -10
  85. package/src/cli/forget.mjs +25 -45
  86. package/src/cli/harness.mjs +32 -14
  87. package/src/cli/import-rules.mjs +8 -2
  88. package/src/cli/init.mjs +12 -26
  89. package/src/cli/integration-dispatcher.mjs +1 -1
  90. package/src/cli/lint.mjs +4 -11
  91. package/src/cli/memory-entry.mjs +86 -0
  92. package/src/cli/memory-init.mjs +45 -0
  93. package/src/cli/memory-plugin.mjs +31 -0
  94. package/src/cli/plugin/create.mjs +1 -1
  95. package/src/cli/plugin/index.mjs +5 -0
  96. package/src/cli/plugin/install.mjs +1 -1
  97. package/src/cli/plugin/remove.mjs +1 -1
  98. package/src/cli/recall.mjs +3 -1
  99. package/src/cli/remember.mjs +29 -84
  100. package/src/cli/rules.mjs +263 -0
  101. package/src/cli/skill-projection.mjs +28 -0
  102. package/src/cli/startup.mjs +9 -2
  103. package/src/cli/sync.mjs +1 -1
  104. package/src/cli/update.mjs +3 -0
  105. package/src/core/app-deploy/runtime-cli.mjs +2 -185
  106. package/src/core/app-deploy/ui-elements.mjs +2 -157
  107. package/src/core/auth-guard.mjs +56 -0
  108. package/src/core/brain-registry.mjs +1 -1
  109. package/src/core/clarity-rewriter.mjs +1 -1
  110. package/src/core/claude-hooks.mjs +70 -0
  111. package/src/core/conclusion-writer.mjs +1 -1
  112. package/src/core/config.mjs +11 -6
  113. package/src/core/conflict-detector.mjs +1 -1
  114. package/src/core/context-policy.mjs +9 -2
  115. package/src/core/daemon-loop.mjs +48 -0
  116. package/src/core/dream.mjs +1 -1
  117. package/src/core/embeddings.mjs +3 -0
  118. package/src/core/fact-seeker.mjs +1 -1
  119. package/src/core/fast-recall.mjs +1 -1
  120. package/src/core/frontmatter.mjs +40 -0
  121. package/src/core/host-type-catalog.mjs +14 -0
  122. package/src/core/inference-engine.mjs +1 -1
  123. package/src/core/legacy-init-secrets.mjs +32 -0
  124. package/src/core/memory-brain.mjs +72 -0
  125. package/src/core/memory-schema.mjs +138 -0
  126. package/src/core/mesh-access-sync.mjs +1 -1
  127. package/src/core/meta-harness.mjs +340 -0
  128. package/src/core/okf-adapter.mjs +1 -1
  129. package/src/core/ollama-embeddings.mjs +5 -28
  130. package/src/core/optimizer.mjs +1 -1
  131. package/src/core/package-auto-update.mjs +5 -15
  132. package/src/core/package-version.mjs +42 -0
  133. package/src/core/plugin-context.mjs +10 -65
  134. package/src/core/plugin-contracts/app-cli.mjs +187 -0
  135. package/src/core/plugin-contracts/configuration.mjs +45 -0
  136. package/src/core/plugin-contracts/ui.mjs +159 -0
  137. package/src/core/plugin-distribution.mjs +140 -0
  138. package/src/core/plugin-loader.mjs +18 -2
  139. package/src/core/plugin-runner-child.mjs +17 -5
  140. package/src/core/plugin-runner.mjs +11 -10
  141. package/src/core/plugin-store.mjs +26 -138
  142. package/src/core/post-mortem.mjs +1 -1
  143. package/src/core/project-brain.mjs +2 -72
  144. package/src/core/proposal-applier.mjs +1 -1
  145. package/src/core/research-queue.mjs +1 -1
  146. package/src/core/research.mjs +1 -1
  147. package/src/core/scheduler.mjs +1 -1
  148. package/src/core/schema.mjs +2 -119
  149. package/src/core/secrets-gateway.mjs +336 -0
  150. package/src/core/secrets-store.mjs +4 -344
  151. package/src/core/skills-registry.mjs +1 -1
  152. package/src/core/ssss-host-extension.mjs +5 -5
  153. package/src/core/ssss-kernel-bridge.mjs +5 -3
  154. package/src/core/ssss-operation-service.mjs +1 -1
  155. package/src/core/surface.mjs +22 -51
  156. package/src/core/task-envelope.mjs +1 -1
  157. package/src/core/total-recall-memory-validator.mjs +2 -2
  158. package/src/core/validated-write.mjs +1 -1
  159. package/src/core/vault-backfill.mjs +1 -1
  160. package/src/core/vault-watcher.mjs +37 -0
  161. package/src/core/vault.mjs +1 -1
  162. package/src/core/vfs-documents.mjs +1 -1
  163. package/src/core/watchdog.mjs +3 -51
  164. package/src/server/api.mjs +1 -1
  165. package/src/server/auth.mjs +16 -8
  166. package/src/server/index.mjs +2 -0
  167. package/src/server/memory-app.mjs +49 -0
  168. package/src/server/memory-server.mjs +19 -0
  169. package/src/server/rest.mjs +1 -1
  170. package/src/server/route-manifest.json +8 -0
  171. package/src/server/routes/_shared.mjs +3 -4
  172. package/src/server/routes/auth.mjs +16 -1
  173. package/src/server/routes/context.mjs +2 -2
  174. package/src/server/routes/docs.mjs +1 -1
  175. package/src/server/routes/graph.mjs +1 -1
  176. package/src/server/routes/memory.mjs +36 -134
  177. package/src/server/routes/models.mjs +1 -1
  178. package/src/server/routes/plugins-mesh.mjs +1 -1
  179. package/src/server/routes/plugins.mjs +25 -4
  180. package/src/server/routes/rules.mjs +4 -2
  181. package/src/server/routes/skills.mjs +1 -1
  182. package/src/server/routes/tasks.mjs +1 -1
  183. package/src/server/routes/update.mjs +10 -2
  184. package/templates/claude-hooks/total-recall-gate.mjs +40 -0
  185. package/templates/memory/SKILL.md +21 -0
  186. package/frontend/dist/assets/index-CpvEw3iA.js +0 -5786
  187. package/frontend/src/App.spec.tsx +0 -87
  188. package/frontend/src/api/api.spec.ts +0 -298
  189. package/frontend/src/api/mesh.spec.ts +0 -84
  190. package/frontend/src/api/network.spec.ts +0 -55
  191. package/frontend/src/api/secrets.spec.ts +0 -62
  192. package/frontend/src/api/webhooks.spec.ts +0 -61
  193. package/frontend/src/components/BrainSelector.spec.tsx +0 -97
  194. package/frontend/src/components/ContextualHelp.spec.tsx +0 -62
  195. package/frontend/src/components/DaemonLogsTab.spec.tsx +0 -21
  196. package/frontend/src/components/DocumentEditorModal.spec.tsx +0 -80
  197. package/frontend/src/components/DocumentTable.spec.tsx +0 -45
  198. package/frontend/src/components/EmbeddingProviderPanel.spec.tsx +0 -127
  199. package/frontend/src/components/Graph3D.spec.tsx +0 -82
  200. package/frontend/src/components/LatencySparkline.spec.tsx +0 -16
  201. package/frontend/src/components/MarkdownUtils.spec.tsx +0 -82
  202. package/frontend/src/components/MobilePairing.spec.tsx +0 -153
  203. package/frontend/src/components/ResearchAgendaTab.spec.tsx +0 -138
  204. package/frontend/src/components/TailnetEnroll.spec.tsx +0 -181
  205. package/frontend/src/components/TaskQueueTab.spec.tsx +0 -70
  206. package/frontend/src/components/UsageChart.spec.tsx +0 -89
  207. package/frontend/src/components/VoiceInput.spec.tsx +0 -38
  208. package/frontend/src/components/brand/BrandMark.spec.tsx +0 -72
  209. package/frontend/src/pages/ChatPage.spec.tsx +0 -37
  210. package/frontend/src/pages/CollabPage.spec.tsx +0 -64
  211. package/frontend/src/pages/DesignDocsPage.spec.tsx +0 -43
  212. package/frontend/src/pages/FilesPage.spec.tsx +0 -46
  213. package/frontend/src/pages/GraphPage.spec.tsx +0 -23
  214. package/frontend/src/pages/HealthPage.spec.tsx +0 -31
  215. package/frontend/src/pages/HelpPage.spec.tsx +0 -63
  216. package/frontend/src/pages/InboxPage.spec.tsx +0 -55
  217. package/frontend/src/pages/InstructionsPage.spec.tsx +0 -53
  218. package/frontend/src/pages/IntegrationsPage.spec.tsx +0 -54
  219. package/frontend/src/pages/LoginPage.spec.tsx +0 -73
  220. package/frontend/src/pages/MemoryPage.spec.tsx +0 -51
  221. package/frontend/src/pages/MeshPage.spec.tsx +0 -450
  222. package/frontend/src/pages/NetworkPage.spec.tsx +0 -78
  223. package/frontend/src/pages/NotificationsPage.spec.tsx +0 -62
  224. package/frontend/src/pages/OkfPage.spec.tsx +0 -46
  225. package/frontend/src/pages/OnboardingPage.spec.tsx +0 -71
  226. package/frontend/src/pages/OpenWikiPage.spec.tsx +0 -25
  227. package/frontend/src/pages/PluginsPage.spec.tsx +0 -96
  228. package/frontend/src/pages/RulesPage.spec.tsx +0 -54
  229. package/frontend/src/pages/SandboxPage.spec.tsx +0 -33
  230. package/frontend/src/pages/SecretsPage.spec.tsx +0 -33
  231. package/frontend/src/pages/SettingsPage.spec.tsx +0 -88
  232. package/frontend/src/pages/SkillsPage.spec.tsx +0 -20
  233. package/frontend/src/pages/TasksPage.spec.tsx +0 -20
  234. package/frontend/src/pages/UsagePage.spec.tsx +0 -30
  235. package/frontend/src/pages/WebhooksPage.spec.tsx +0 -139
  236. package/scaffold/.agent/skills/project-management/references/project-documents.md +0 -23
package/README.md CHANGED
@@ -1,158 +1,71 @@
1
1
  # Total Recall
2
2
 
3
- [![Version](https://img.shields.io/badge/version-3.32.4-indigo.svg)](package.json)
4
- [![License](https://img.shields.io/badge/license-MIT-emerald.svg)](LICENSE)
3
+ **Portable personal memory for any IDE** — open source, with canonical SSSS Markdown and disposable search indexes.
5
4
 
6
- **Portable personal memory for any IDE** — filesystem-native, database-free, open source.
5
+ Total Recall stores rules, preferences, facts and project knowledge. The portable runtime provides validated memory operations, local retrieval, task context and instruction surfaces. Optional capabilities run through explicitly installed plugins. Initialization creates an empty brain.
7
6
 
8
- Plugin status (September 30, 2026): the tree contains five bundled plugins; standalone plugin repos retain their own documents. Current review found incomplete operations, fabricated preview data and unsupported readiness claims. The [audit](docs/projects/in-progress/PLUGIN_IMPLEMENTATION_CORRECTIONS/PLUGIN_IMPLEMENTATION_CORRECTIONS_AUDIT.md) and [correction tracker](docs/projects/in-progress/PLUGIN_IMPLEMENTATION_CORRECTIONS/PLUGIN_IMPLEMENTATION_CORRECTIONS_PROJECT_TRACKER.md) record evidence, owners and acceptance. Findings remain open. The version badge reflects the local manifest, not publication verification.
7
+ ## Memory CLI
9
8
 
10
- Total Recall stores your rules, preferences, facts, and project knowledge as plain Markdown (SSSS). It compiles them into IDE instruction surfaces, runs a dream consolidation cycle, and lets agents enqueue background tasks. Host apps and product repos are equal implementations: **nothing is hard-coded to a specific codebase.**
11
-
12
- ```text
13
- write → remember / session ingest
14
- sleep → dream (consolidate, conflict, compile, prune)
15
- read → recall + compiled surfaces
16
- async → daemon task queue (agents may enqueue anything under policy)
17
- ```
18
-
19
- ```text
20
- your brain = ~/.agent/skills/total-recall/
21
- your project = <repo>/.agent/skills/total-recall/
22
- ```
23
-
24
- ---
25
-
26
- ## Quick start (IDE memory, ~2 minutes)
27
-
28
- No always-on LLM and no research daemon required.
29
-
30
- ```bash
31
- cd /path/to/any-project
32
- npx total-recall init --project # project brain + openwiki scaffold
33
- npx total-recall connect claude-code # or: cursor | codex | gemini | aider | obsidian | http-api
34
- npx total-recall remember preference "Prefer clear, short answers."
35
- npx total-recall recall "short answers"
36
- npx total-recall compile # rebuild INSTRUCTIONS.md inject blocks
9
+ ```sh
10
+ npm install total-recall-brain
11
+ npx total-recall-memory init --project
12
+ npx total-recall-memory remember preference "Prefer clear, short answers." --project
13
+ npx total-recall-memory recall "short answers" --local --project
14
+ npx total-recall-memory context "Implement a memory change" --action edit,test --project
15
+ npx total-recall-memory compile --project
37
16
  ```
38
17
 
39
- Injected rules sit only between:
18
+ The package preserves the `total-recall` executable, dashboard and plugin scaffold during migration. The isolated memory CLI is available as `total-recall-memory`. Use `npx --package total-recall-brain total-recall-memory <command>` without a local installation.
40
19
 
41
- ```text
42
- <!-- BEGIN INJECTED MEMORY: do not edit by hand; rebuilt by total-recall surface -->
43
- …
44
- <!-- END INJECTED MEMORY -->
45
- ```
46
-
47
- Existing local rules outside those markers are never clobbered.
48
-
49
- ---
50
-
51
- ## Core workflows
20
+ `context` includes required rules before ranked knowledge. Check `ready: true`; exit 2 means the required rules exceed the selected budget. Increase the explicit budget or curate applicability before continuing.
52
21
 
53
- | Workflow | Commands |
54
- |----------|----------|
55
- | **Remember / recall** | `remember`, `forget`, `recall` |
56
- | **Dream (sleep)** | `dream` — or daemon system dream on empty queue |
57
- | **Defer work** | `task add "<intent>"` then `daemon start` |
58
- | **Skills across repos** | `skill track <path>`, `skill deploy`, `skill sync` |
59
- | **Secrets (not vault)** | `secret set\|list\|rotate\|usage\|check-surfaces` |
60
- | **Connect an IDE** | `connect <client>` |
22
+ Project memory lives at `<repo>/.agent/skills/total-recall/`; global memory lives at `<home>/.agent/skills/total-recall/`. `--project` and `--global` select the layer. `AGENT_DIR` explicitly pins all layer operations to one agent root. Canonical memory remains separate between roots.
61
23
 
62
- ### Multi-repo skills (any path you choose)
24
+ Local retrieval needs no server or embedding provider. Set `TR_EMBEDDINGS_DISABLED=1` for provider-free operation. Semantic search requires a configured provider. Compilation preserves existing embeddings; mutation commands await local indexing.
63
25
 
64
- ```bash
65
- npx total-recall skill track /path/to/any-app
66
- npx total-recall skill sync --repo /path/a --repo /path/b
67
- # or: export TR_SYNC_REPOS="/path/a:/path/b"
68
- ```
69
-
70
- Roots come only from: project registry, install map, `TR_SYNC_REPOS`, CLI `--repo`, and cwd when it looks like a project.
26
+ Run `total-recall --help` for the current commands. `import` preserves authored rule files and imports validated memory. `lint` validates memory and can validate installed manifests with `--plugins`; feature records require their owning validator.
71
27
 
72
- ### Secrets
28
+ ## Optional capabilities
73
29
 
74
- ```bash
75
- npx total-recall secret set some_api_key "$KEY" --provider example
76
- npx total-recall secret list # metadata only
77
- npx total-recall secret check-surfaces # fail if values leaked into surfaces
30
+ ```sh
31
+ total-recall plugin install /path/to/capability --global
32
+ total-recall plugin list
33
+ total-recall plugin info capability-id
34
+ total-recall capability-command --help
35
+ total-recall plugin remove capability-id --global
78
36
  ```
79
37
 
80
- Optional AES: `TR_SECRETS_PASSWORD`. Values never belong in vault markdown or openwiki.
38
+ Local directories and Git sources use the same manifest validation, canonical installation records and artifact digest. Installed `cli` and `commands` declarations use an isolated child process with bounded output and timeout. Removal disables dispatch and preserves memory and recorded installation history; reinstalling the same artifact restores its digest.
81
39
 
82
- ### Optional background daemon
40
+ Plugins are trusted code with the operator's OS permissions. A child process protects the host from handler exits and output interference; it provides no OS sandbox. Background jobs, services, interfaces, distribution and feature-specific validation belong to the capability owner.
83
41
 
84
- ```bash
85
- npx total-recall daemon start # idle invent OFF unless TR_IDLE_TASKS=1
86
- npx total-recall task add "Extract decisions from last session" --cap vault:write
87
- ```
42
+ Dashboard plugin interfaces run in scripts-only frames with an opaque origin. They cannot access dashboard DOM/storage or fetch services directly. Self-contained owner modules receive themed variables and a `host.run(subcommand, args)` bridge restricted to manifest-declared commands and server authorization. Native command handlers retain the trust boundary described above. Never embed secret values in generated interface code.
88
43
 
89
- ---
44
+ ## Memory HTTP service
90
45
 
91
- ## Dual-layer brain
46
+ After installing the package locally:
92
47
 
93
- ```text
94
- GLOBAL ~/.agent/skills/total-recall/ identity, shared preferences
95
- PROJECT <repo>/.agent/skills/total-recall/ repo facts, decisions, openwiki
48
+ ```sh
49
+ AGENT_DIR=/path/to/agent TR_EMBEDDINGS_DISABLED=1 total-recall-memory init
50
+ AGENT_DIR=/path/to/agent HOST=127.0.0.1 PORT=3900 node node_modules/total-recall-brain/src/server/memory-server.mjs
96
51
  ```
97
52
 
98
- CLI flags: `--global` / `--project`. Project wins on slug conflicts when both apply.
99
-
100
- ---
53
+ In the source checkout, `npm run start:memory` selects the memory server. `npm start` preserves the existing dashboard service.
101
54
 
102
- ## CLI inventory
55
+ The service exposes memory, context, instructions, rules, scoped keys and authentication. `/health` reports initialization, node count, runtime and package version. Health requires authentication except direct local access. `/.well-known/total-recall.json` lists available memory endpoints. Configure a scoped credential with `total-recall key --help` or `generate-pat --help` before remote use.
103
56
 
104
- Commands are classified as **core** (default product path), **optional** (power features), or **legacy** (still shipped, not the focus).
57
+ The `total-recall-brain/memory` export provides `createMemoryApp()`. Existing package and secret-store exports remain available for installed consumers.
105
58
 
106
- Full table: [`docs/reference/CLI_INVENTORY.md`](docs/reference/CLI_INVENTORY.md)
59
+ ## Source and migration
107
60
 
108
- | Tier | Examples |
109
- |------|----------|
110
- | **Core** | `init`, `connect`, `remember`, `forget`, `recall`, `compile`, `dream`, `task`, `daemon`, `skill`, `secret`, `brain`, `status`, `doctor` |
111
- | **Optional** | `research`, `relay`, `deploy`, `setup`, `backup`/`restore`, `chat`, `map`, `export`/`import`, `ingest` |
112
- | **Legacy / niche** | `collab`, `friction`, `upgrade`, `migrate`, `snapshot`, `command` |
113
-
114
- Default install story: **init → connect → remember/recall → dream**. No LLM required.
115
-
116
- ---
117
-
118
- ## Optional full server
119
-
120
- For a local REST API + dashboard (not required for IDE memory):
121
-
122
- ```bash
123
- npx total-recall start
124
- # or: npm start
125
- ```
126
-
127
- Deploy/tunnels are optional (`deploy`, `setup`). Configure only what you need.
128
-
129
- ---
130
-
131
- ## Architecture sketch
132
-
133
- - **SSSS vault** — Markdown + YAML frontmatter (filesystem SSOT)
134
- - **Openwiki** — human/agent long-form docs (ships with init)
135
- - **Surfaces** — compiled inject blocks for IDEs
136
- - **Dream** — consolidation cycle (deterministic first)
137
- - **Daemon tasks** — open envelope + capability policy
138
- - **Secrets** — separate store from vault
139
-
140
- Host apps consume TR the same way: PAT + brain URL (`connect http-api`) or local files.
141
-
142
- ---
143
-
144
- ## Uninstall
145
-
146
- ```bash
147
- npx total-recall uninstall
148
- ```
61
+ The source checkout and this compatible npm release retain existing product implementations during migration, including the dashboard, update command and plugin creation scaffold. The package gate verifies the complete memory file inventory alongside these compatibility surfaces and excludes private brain state. The isolated memory entrypoint does not load the product worker or dashboard. A default memory-only package requires a breaking release and completed capability migration.
149
62
 
150
- Project brains inside git repos are preserved when possible so you do not lose custom rules and memories.
63
+ Versions ahead of the public npm release display **Preview features**. Host updates and older registered projects are reported separately; updating projects never downgrades a preview installation.
151
64
 
152
- ---
65
+ The [prior product README](docs/reference/legacy-product-readme.md) preserves the original documentation. The [active core/plugin project](docs/projects/in-progress/TR_CORE_PLUGIN_SPLIT/TR_CORE_PLUGIN_SPLIT_PROJECT_TRACKER.md) records implementation and verification; its unfinished acceptance items are not release claims.
153
66
 
154
- ## License
67
+ ## Development
155
68
 
156
- MIT — see [LICENSE](LICENSE).
69
+ The source uses Node ESM and Vitest. Run the repository's configured background gates on its sanctioned test host. `npm run check:package` inspects npm's actual file inventory; `npm run check:ssss-registry` verifies the composed registry lock. Clean installed-artifact and native service checks complement the source suite.
157
70
 
158
- *Portable memory. Your files. Any IDE.*
71
+ MIT license. See [LICENSE](LICENSE).
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli/memory-entry.mjs';
3
+ try { await main(process.argv.slice(2)); }
4
+ catch (err) { console.error(`Error: ${err.message}`); process.exitCode = 1; }
@@ -62,6 +62,7 @@ const COMMANDS = {
62
62
  edit: 'edit.mjs',
63
63
  recall: 'recall.mjs',
64
64
  context: 'context.mjs',
65
+ rules: 'rules.mjs',
65
66
  search: 'recall.mjs',
66
67
  research: 'research.mjs',
67
68
  proposals: 'proposals.mjs',
@@ -131,7 +132,7 @@ async function printHelp() {
131
132
 
132
133
  Core (default product path):
133
134
  init [--project] Bootstrap global or project brain + openwiki
134
- connect <client> Wire IDE / Obsidian / http-api host
135
+ connect <client> Wire IDE surface (Cursor, Claude, Codex, Grok, Replit, Lovable)
135
136
  remember / forget / edit Write-path memory (SSSS vault)
136
137
  recall Read-path hybrid search
137
138
  compile Rebuild instruction surfaces
@@ -143,10 +144,11 @@ async function printHelp() {
143
144
  plugin <cmd> Plugin manager: list, install, search, remove, info
144
145
  secret <cmd> Secrets store + usage (not the vault)
145
146
  mesh <cmd> Control-server mesh: nodes, ACL policy, Tailscale SSH
146
- harness <cmd> Meta-harness orchestration & council across IDEs & local LLMs
147
+ harness <cmd> Meta-harness manager: list, usage (5h/weekly quotas), dispatch, council
147
148
  agent <cmd> Process controller: spawn, list, logs, kill across mesh
148
149
  brain <cmd> Register / ensure any project brain
149
150
  status / doctor Health and diagnostics
151
+ brief Session-start brief: state, runtime, rules, harnesses, trackers
150
152
  startup check|ensure Readiness checks / missing managed local runtime start
151
153
  ${pluginsSection}
152
154
  Optional:
@@ -279,26 +281,16 @@ async function main() {
279
281
  }
280
282
 
281
283
  // Check installed plugins for custom CLI commands declared in manifest
282
- const { discoverPlugins, PACKAGE_ROOT } = await import('../src/core/plugin-loader.mjs');
284
+ const { discoverPlugins } = await import('../src/core/plugin-loader.mjs');
283
285
  const plugins = discoverPlugins(process.cwd());
284
286
  for (const p of plugins) {
285
287
  if (p.valid && p.manifest.cli?.command === command) {
286
288
  const handlerRel = p.manifest.cli.handler;
287
289
  if (handlerRel) {
288
- const absHandler = path.resolve(p.dir, handlerRel);
289
- if (fs.existsSync(absHandler)) {
290
- // Match the host context supplied to dashboard/daemon handlers.
291
- process.env.TR_PACKAGE_ROOT = PACKAGE_ROOT;
292
- process.env.TR_PLUGIN_ID = p.id;
293
- process.env.TR_PLUGIN_DIR = p.dir;
294
- const handler = await import(absHandler);
295
- if (handler.run) {
296
- await handler.run(process.argv);
297
- } else if (handler.default) {
298
- await handler.default(process.argv.slice(3));
299
- }
300
- process.exit(process.exitCode ?? 0);
301
- }
290
+ const { runPluginCommand } = await import('../src/core/plugin-runner.mjs');
291
+ const result = await runPluginCommand(p, { args: args.slice(1), stdin: 'inherit' });
292
+ if (result.output) process.stdout.write(result.output);
293
+ process.exit(result.ok ? 0 : (result.exitCode || 1));
302
294
  }
303
295
  }
304
296
  }
@@ -1,6 +1,8 @@
1
1
  # Total Recall — System Architecture
2
2
 
3
- > September 30, 2026: the older narrative below is historical background. The [current plugin correction architecture](projects/in-progress/PLUGIN_IMPLEMENTATION_CORRECTIONS/PLUGIN_IMPLEMENTATION_CORRECTIONS_ARCHITECTURE.md) records reviewed boundaries/gaps. Core-only portable memory remains an extraction target; five plugin directories are still bundled. Reviews fail the actual SSSS contract; DSH/search generators do not satisfy host consumption/UI generation. Declared previews do not establish operational UI. Earlier provider/model examples and readiness claims have not been recertified by this review. Resolve endpoints/models from configuration and verify official contracts before integration changes.
3
+ > October 7, 2026: [TR_CORE_PLUGIN_SPLIT](projects/in-progress/TR_CORE_PLUGIN_SPLIT/TR_CORE_PLUGIN_SPLIT_ARCHITECTURE.md) is the current architecture and single active implementation project. The target is portable memory with minimal safe plugin interfaces; feature implementations belong to their plugin owners. Current source still embeds feature routes, tools and daemon behavior. The npm files list already excludes the old bundled plugin directory. Older topology, counts, ownership and readiness statements below are historical and require current source evidence.
4
+
5
+ > September 30, 2026: the older narrative below is historical background. The [current plugin correction architecture](projects/archived/consolidated-into-tr-core-plugin-split/PLUGIN_IMPLEMENTATION_CORRECTIONS/PLUGIN_IMPLEMENTATION_CORRECTIONS_ARCHITECTURE.md) records reviewed boundaries/gaps. Core-only portable memory remains an extraction target; five plugin directories are still bundled. Reviews fail the actual SSSS contract; DSH/search generators do not satisfy host consumption/UI generation. Declared previews do not establish operational UI. Earlier provider/model examples and readiness claims have not been recertified by this review. Resolve endpoints/models from configuration and verify official contracts before integration changes.
4
6
 
5
7
  > Verified against codebase: `relay.mjs`, `session-watcher.mjs`, `daemon-loop.mjs`, `surface.mjs`, `scheduler.mjs`, `embeddings.mjs`, `dispatch.mjs`, `vault-cache.mjs`, `config.mjs`, `sandbox.mjs`.
6
8
  > Last Updated: May 25, 2026
@@ -56,14 +56,14 @@ Wire an IDE editor or client application to your remote brain.
56
56
  ```bash
57
57
  npx total-recall connect <client> [options]
58
58
  ```
59
- - **Clients**: `claude-code`, `cursor`, `codex`, `antigravity`, `gemini`, `aider`, `pi`, `hermes`, `dsh`, `openclaw`, `http-api`, `obsidian`, `generic`
59
+ - **Clients**: `claude-code`, `cursor`, `codex`, `antigravity`, `gemini`, `grok`, `replit`, `lovable`, `windsurf`, `devin`, `trae`, `goose`, `aider`, `pi`, `hermes`, `dsh`, `openclaw`, `http-api`, `obsidian`, `generic`
60
60
  - **Options**:
61
61
  - `--brain <url>`: remote brain API base URL.
62
62
  - `--token <pat>`: Personal Access Token to embed in generated config targets.
63
63
  - `--vault <path>`: Obsidian vault target directory path.
64
64
  - `--force`: Overwrite existing projection and rules files.
65
65
 
66
- *Symlink clients (`claude-code`, `codex`, `antigravity`, `gemini`, `pi`, `dsh`, `openclaw`) create a platform symlink linking editor shims (like `CLAUDE.md`, `AGENTS.md`, or `GEMINI.md`) to the compiled rules. File-based clients (`cursor`, `cline`, `hermes`, `aider`) write standard rule and memory files directly.*
66
+ *Symlink clients (`claude-code`, `codex`, `antigravity`, `gemini`, `grok`, `replit`, `lovable`, `windsurf`, `devin`, `pi`, `dsh`, `openclaw`) create a platform symlink linking editor shims (such as `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, or `replit.md`) to the compiled rules. File-based clients (`cursor`, `cline`, `hermes`, `aider`) write standard rule and memory files directly.*
67
67
 
68
68
  ---
69
69
 
@@ -123,6 +123,15 @@ Malformed, conflicting, expired or source-mismatched curation falls back to the
123
123
  canonical rule. Never generate applicability from semantic ranking. Curation
124
124
  is private runtime state and must not be included in scaffolds or releases.
125
125
 
126
+ Shorten rules per repo with `total-recall rules`: `audit` shows capsule tokens per
127
+ action and the largest rules; `draft --out policy.json` scaffolds the policy with
128
+ each rule's original text; shorten the directives by hand (keep every operative
129
+ constraint), narrow `actions`, or exclude locally with `enabled:false` plus a
130
+ `reason`; `apply policy.json` validates hashes and merges into the single
131
+ `context:policy` decision; `verify` exits 1 on stale or orphan curation or an
132
+ action capsule over budget; `prune [--apply] [--archive]` drops stale entries and
133
+ lists expired, superseded or duplicate rules. Originals are never modified.
134
+
126
135
  ### `recall`
127
136
  Search local metadata and indexed full text across enabled memory layers.
128
137
  - **What it does**: Searches a disposable local index and reads only selected Markdown documents. Semantic enrichment is opt-in and exact hits bypass providers.
@@ -325,8 +334,9 @@ Meta-Harness orchestration across connected external IDEs, CLI tools, and local
325
334
  npx total-recall harness <command> [options]
326
335
  ```
327
336
  - **Commands**:
328
- - `list`: Inspect all supported developer harnesses (`agy`, `claude`, `codex`, `gemini`, `ollama`) with availability and binary locations.
329
- - `dispatch <id> [--node <node>] "<task>"`: Headlessly invoke a specific harness with task instructions. Supports cross-mesh execution via `--node` and non-interactive `pipe_stdin` for Ollama models (e.g. `gemma4:latest`).
337
+ - `list`: Inspect all supported developer harnesses (`agy`, `claude`, `codex`, `grok`, `gemini`, `ollama`) with availability, versions, currency, and authentication status.
338
+ - `usage [--json]`: Query harness account APIs for remaining 5-hour rolling session window and weekly quota percentages, version currency against upstream registries, and authentication freshness.
339
+ - `dispatch <id> [--node <node>] "<task>"`: Headlessly invoke a specific harness with task instructions. Supports cross-mesh execution via `--node` and non-interactive `pipe_stdin` for Ollama models (such as `gemma4:latest`).
330
340
  - `council "<task>"`: Execute multi-harness consensus deliberations concurrently across all available engines and compare responses.
331
341
 
332
342
  ---