total-recall-brain 3.26.0 → 3.28.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/bin/total-recall.mjs +31 -1
- package/docs/ARCHITECTURE.md +76 -9
- package/frontend/dist/assets/index-U7o-qU99.js +5742 -0
- package/frontend/dist/index.html +1 -1
- package/frontend/src/App.tsx +39 -1
- package/frontend/src/api/index.ts +1 -0
- package/frontend/src/api/plugins.ts +167 -0
- package/frontend/src/pages/ChatPage.tsx +44 -17
- package/frontend/src/pages/IntegrationsPage.tsx +7 -0
- package/frontend/src/pages/PluginsPage.spec.tsx +17 -0
- package/frontend/src/pages/PluginsPage.tsx +1331 -0
- package/package.json +1 -1
- package/scaffold/.agent/plugins/.gitkeep +0 -0
- package/scaffold/.agent/plugins/code-quality/README.md +16 -0
- package/scaffold/.agent/plugins/code-quality/cli.mjs +15 -0
- package/scaffold/.agent/plugins/code-quality/plugin.json +34 -0
- package/scaffold/.agent/plugins/git-sentinel/README.md +16 -0
- package/scaffold/.agent/plugins/git-sentinel/cli.mjs +86 -0
- package/scaffold/.agent/plugins/git-sentinel/plugin.json +34 -0
- package/scaffold/.agent/plugins/meta-harness/README.md +16 -0
- package/scaffold/.agent/plugins/meta-harness/cli.mjs +34 -0
- package/scaffold/.agent/plugins/meta-harness/plugin.json +34 -0
- package/scaffold/.agent/plugins/system-monitor/README.md +16 -0
- package/scaffold/.agent/plugins/system-monitor/cli.mjs +79 -0
- package/scaffold/.agent/plugins/system-monitor/generator.mjs +20 -0
- package/scaffold/.agent/plugins/system-monitor/plugin.json +38 -0
- package/scaffold/.agent/skills/meta-harness/SKILL.md +113 -0
- package/scaffold/.agent/skills/total-recall/references/cli-reference.md +23 -0
- package/src/cli/agent.mjs +173 -0
- package/src/cli/connect.mjs +89 -4
- package/src/cli/deploy-ui.mjs +6 -0
- package/src/cli/harness.mjs +135 -0
- package/src/cli/ingest-openwiki.mjs +71 -2
- package/src/cli/init.mjs +1 -0
- package/src/cli/lint.mjs +47 -3
- package/src/cli/mesh.mjs +286 -0
- package/src/cli/plugin/create.mjs +186 -0
- package/src/cli/plugin/index.mjs +139 -0
- package/src/cli/plugin/install.mjs +141 -0
- package/src/cli/plugin/list.mjs +83 -0
- package/src/cli/plugin/remove.mjs +51 -0
- package/src/cli/plugin/search.mjs +37 -0
- package/src/cli/skill-projection.mjs +14 -0
- package/src/cli/wizard.html +9 -0
- package/src/core/agent-manager.mjs +290 -0
- package/src/core/cache-prune.mjs +341 -0
- package/src/core/context-cache.mjs +130 -0
- package/src/core/daemon-loop.mjs +47 -1
- package/src/core/evolving-context.mjs +171 -0
- package/src/core/mesh-activity.mjs +140 -0
- package/src/core/mesh.mjs +174 -1
- package/src/core/meta-harness.mjs +251 -0
- package/src/core/plugin-context.mjs +206 -0
- package/src/core/plugin-loader.mjs +210 -0
- package/src/core/runtime.mjs +65 -13
- package/src/core/surface.mjs +32 -10
- package/src/server/api.mjs +18 -2
- package/src/server/index.mjs +8 -2
- package/src/server/rest.mjs +4 -0
- package/src/server/routes/integrations.mjs +5 -1
- package/src/server/routes/mesh-presence.mjs +143 -0
- package/src/server/routes/models.mjs +42 -30
- package/src/server/routes/plugins.mjs +517 -0
- package/src/server/tools.mjs +266 -0
- package/frontend/dist/assets/index-Bl3I11B0.js +0 -5742
package/bin/total-recall.mjs
CHANGED
|
@@ -92,6 +92,12 @@ const COMMANDS = {
|
|
|
92
92
|
collab: 'collab.mjs',
|
|
93
93
|
command: 'command.mjs',
|
|
94
94
|
export: 'export.mjs',
|
|
95
|
+
harness: 'harness.mjs',
|
|
96
|
+
watch: 'rebuild.mjs',
|
|
97
|
+
agent: 'agent.mjs',
|
|
98
|
+
agents: 'agent.mjs',
|
|
99
|
+
plugin: 'plugin/index.mjs',
|
|
100
|
+
plugins: 'plugin/index.mjs',
|
|
95
101
|
};
|
|
96
102
|
function printHelp() {
|
|
97
103
|
console.log(`
|
|
@@ -110,8 +116,11 @@ function printHelp() {
|
|
|
110
116
|
task <cmd> Enqueue daemon work (open envelope)
|
|
111
117
|
daemon <cmd> Background worker (start|stop|status)
|
|
112
118
|
skill <cmd> Skills registry, deploy, multi-repo sync
|
|
119
|
+
plugin <cmd> Plugin manager: list, install, remove, info
|
|
113
120
|
secret <cmd> Secrets store + usage (not the vault)
|
|
114
121
|
mesh <cmd> Control-server mesh: nodes, ACL policy, Tailscale SSH
|
|
122
|
+
harness <cmd> Meta-harness orchestration & council across IDEs & local LLMs
|
|
123
|
+
agent <cmd> Process controller: spawn, list, logs, kill across mesh
|
|
115
124
|
brain <cmd> Register / ensure any project brain
|
|
116
125
|
status / doctor Health and diagnostics
|
|
117
126
|
|
|
@@ -210,8 +219,29 @@ async function main() {
|
|
|
210
219
|
console.log(typeof result === 'object' ? JSON.stringify(result, null, 2) : result);
|
|
211
220
|
process.exit(0);
|
|
212
221
|
}
|
|
222
|
+
|
|
223
|
+
// Check installed plugins for custom CLI commands declared in manifest
|
|
224
|
+
const { discoverPlugins } = await import('../src/core/plugin-loader.mjs');
|
|
225
|
+
const plugins = discoverPlugins(process.cwd());
|
|
226
|
+
for (const p of plugins) {
|
|
227
|
+
if (p.valid && p.manifest.cli?.command === command) {
|
|
228
|
+
const handlerRel = p.manifest.cli.handler;
|
|
229
|
+
if (handlerRel) {
|
|
230
|
+
const absHandler = path.resolve(p.dir, handlerRel);
|
|
231
|
+
if (fs.existsSync(absHandler)) {
|
|
232
|
+
const handler = await import(absHandler);
|
|
233
|
+
if (handler.run) {
|
|
234
|
+
await handler.run(process.argv);
|
|
235
|
+
} else if (handler.default) {
|
|
236
|
+
await handler.default(process.argv.slice(3));
|
|
237
|
+
}
|
|
238
|
+
process.exit(0);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
213
243
|
} catch (err) {
|
|
214
|
-
console.error(`Error executing
|
|
244
|
+
console.error(`Error executing dynamic command: ${err.message}`);
|
|
215
245
|
process.exit(1);
|
|
216
246
|
}
|
|
217
247
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -58,7 +58,7 @@ The session relay is a silent Node.js daemon that:
|
|
|
58
58
|
|
|
59
59
|
---
|
|
60
60
|
|
|
61
|
-
### Component 2: The
|
|
61
|
+
### Component 2: The Central Brain Server
|
|
62
62
|
|
|
63
63
|
The brain server runs the primary REST API, compiles instructions, runs the background daemons, and maintains the Virtual File System (VFS).
|
|
64
64
|
|
|
@@ -81,14 +81,16 @@ The Setup Web Wizard is served by a local Express instance during installation/d
|
|
|
81
81
|
- **File-Native Indexes**: Vector indexes are written directly to plain JSONL (`embeddings.jsonl`) under the meta-skill's `memory-derived/` directory, backed by a high-speed cosine memory cache (`embeddings-cache.json`) for <50ms lookup times.
|
|
82
82
|
- **Auto-Healing Dimension Mismatch Purging**: If you switch embedding models (e.g. from a 384-dim Ollama model to the 768-dim Google API), the engine detects the dimension length mismatch, automatically clears out the obsolete cache files, and indexes the entire vault cleanly from scratch.
|
|
83
83
|
|
|
84
|
-
#### 2. 🤖 Headless CLI Agent Dispatch
|
|
85
|
-
Total Recall
|
|
84
|
+
#### 2. 🤖 Meta Harness & Headless CLI Agent Dispatch
|
|
85
|
+
Total Recall executes background cognitive tasks (post-mortems, web research crawls, dream cycle updates, and multi-agent councils) through headlessly spawned CLI agent harnesses and local neural models:
|
|
86
86
|
|
|
87
|
-
- **Antigravity CLI** (`
|
|
88
|
-
- **Claude Code** (`claude`): Resolves complex logical rules, verifies integration tests, and performs
|
|
89
|
-
- **Codex CLI** (`codex`): Executes sandboxed test suites and automated
|
|
87
|
+
- **Antigravity CLI** (`agy`): Ingests massive token context bounds for broad log post-mortems, complex reasoning, and repository-wide gap discovery.
|
|
88
|
+
- **Claude Code** (`claude`): Resolves complex logical rules, verifies integration tests, and performs terminal-native codebase refactoring.
|
|
89
|
+
- **Codex CLI** (`codex`): Executes sandboxed test suites and automated program synthesis.
|
|
90
|
+
- **Gemini CLI** (`gemini`): Fast utility completions and lightweight tool chaining.
|
|
91
|
+
- **Ollama Local LLM** (`ollama`): Zero-token-cost local neural inference (e.g. `gemma4:latest`) executing non-interactively via standard input piping (`pipe_stdin`).
|
|
90
92
|
|
|
91
|
-
All dispatches are configured via the prioritized execution registry in `~/.agent/skills/total-recall/skills/cli-agents/agents.yml`
|
|
93
|
+
All dispatches can run locally or route remotely across the Headscale mesh (`--node <target>`). Multi-agent consensus deliberations can be executed concurrently using `total-recall harness council "<task>"`. Dispatches are also configured via the prioritized execution registry in `~/.agent/skills/total-recall/skills/cli-agents/agents.yml` utilizing the **Dynamic Model Selector (`resolveGenerativeModel`)**.
|
|
92
94
|
|
|
93
95
|
#### 3. 📂 Progressive Disclosure Surface Compiler
|
|
94
96
|
- Avoids prompt bloat by keeping active system prompts under 1,000 tokens.
|
|
@@ -104,7 +106,7 @@ All dispatches are configured via the prioritized execution registry in `~/.agen
|
|
|
104
106
|
|
|
105
107
|
## 🧠 The Dual-Layer Brain Cascade
|
|
106
108
|
|
|
107
|
-
Total Recall partitions your
|
|
109
|
+
Total Recall partitions your brain memory into two virtual directories:
|
|
108
110
|
|
|
109
111
|
```
|
|
110
112
|
~ (User Home)
|
|
@@ -232,9 +234,74 @@ Total Recall features a native terminal-based chat REPL (`npx total-recall chat`
|
|
|
232
234
|
|
|
233
235
|
---
|
|
234
236
|
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 🧩 Plugin System & Extension Architecture
|
|
240
|
+
|
|
241
|
+
Total Recall features a decentralized, filesystem-native plugin system that allows modular capability suites, background scholarly daemons, and custom SSSS graph schemas to extend the memory kernel without modifying core packages.
|
|
242
|
+
|
|
243
|
+
### 1. Plugin Manifest Specification (`plugin.json`)
|
|
244
|
+
Every plugin is a self-contained directory under `.agent/plugins/<id>/` (or global `~/.agent/plugins/<id>/`) containing a validated `plugin.json` conforming to `metadata.plugin.schema.json`:
|
|
245
|
+
- **Metadata**: Unique lowercase kebab-case `id`, semantic `version`, `name`, and `description`.
|
|
246
|
+
- **Custom SSSS Categories**: Declares domain-specific memory node categories (`ssss_schemas.categories`) with schemas and templates automatically registered during vault builds.
|
|
247
|
+
- **Surface Compilation Hook**: Defines a custom context generator script (`compile.generator`) and watch triggers that assemble prioritized evolving context surfaces (up to 500k tokens).
|
|
248
|
+
- **Background Tasks & Daemons**: Registers recurring cron envelopes (`tasks`) and execution entrypoints (`entrypoint`) automatically picked up by the daemon loop.
|
|
249
|
+
- **Pure Unix CLI Commands**: Exposes first-class CLI commands (`cli.command` and `cli.handler`) seamlessly routed under `total-recall <command>`.
|
|
250
|
+
|
|
251
|
+
### 2. Plugin Discovery & Lifecycle (`src/core/plugin-loader.mjs`)
|
|
252
|
+
- **Layered Discovery**: Scans project-level (`.agent/plugins/`) and global-level (`~/.agent/plugins/`) directories. Project plugins take precedence over global plugins with identical IDs.
|
|
253
|
+
- **Strict Schema Validation**: Validates all manifests against the plugin schema prior to runtime execution, flagging errors without breaking host brain stability.
|
|
254
|
+
- **Symlink & Development Linking**: Developers can link in-progress plugins using `total-recall plugin install <path> --link` (or via the web UI) to enable real-time edits without reinstallation.
|
|
255
|
+
|
|
256
|
+
### 3. Web Dashboard & Rating System (`frontend/src/pages/PluginsPage.tsx`)
|
|
257
|
+
- **Plugin Management UI**: Dedicated `/plugins` dashboard view for browsing installed extensions, inspecting raw manifests, exploring documentation, and one-click uninstallation.
|
|
258
|
+
- **Curated Discovery Catalog**: Browsable catalog of ecosystem plugins (Scientific Frontiers Engine, Meta-Harness, Code Quality & SSSS Conformance, Chrome DevTools) with single-click installation.
|
|
259
|
+
- **Interactive 5-Star Rating System**: Persistent local ratings and reviews (`.agent/config/plugin-ratings.json`), verified badges, and sorting by rating, reviews, or alphabetical order.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 🌐 Mesh Compute Topology & Meta-Harness Layer
|
|
264
|
+
|
|
265
|
+
Total Recall unifies developer machines, remote compute nodes, and cloud servers across a private **Headscale WireGuard mesh network** (tailnet `100.64.0.0/10`), providing zero-configuration cross-host execution without third-party cloud dependencies or open incoming firewall ports.
|
|
266
|
+
|
|
267
|
+
### 1. Mesh Compute Topology & Diagnostics
|
|
268
|
+
|
|
269
|
+
Each machine on the network is tracked as an SSSS `mesh_node` entity in the vault (`memory-vault/system/mesh-nodes/<slug>.md`). Remote execution is mediated by the mesh runtime:
|
|
270
|
+
|
|
271
|
+
- **Non-Interactive Command Execution (`total-recall mesh exec <node> <cmd…>`)**: Executes commands remotely over SSH with sanitized `$PATH` exports (`/opt/homebrew/bin`, `/usr/local/bin`, `$HOME/.local/bin`) directly prepended, eliminating subshell quoting fragility on Darwin and Linux.
|
|
272
|
+
- **Cluster Diagnostics (`total-recall mesh doctor`)**: Concurrently audits reachability, development runtimes (`node`, `docker`, `git`), and AI harnesses (`agy`, `claude`, `codex`, `gemini`, `ollama`) across all cluster nodes, formatting the results into character-aligned terminal tables or structured JSON (`--json`).
|
|
273
|
+
- **Cryptographic SSH Access Resolution**: Automatically resolves SSH user, port, and key path from the local `mesh_node` entity or `~/.ssh/config` using `IdentitiesOnly=yes` pinning.
|
|
274
|
+
|
|
275
|
+
### 2. Meta-Harness Layer (`src/core/meta-harness.mjs`)
|
|
276
|
+
|
|
277
|
+
The Meta-Harness treats external AI CLI tools and local neural models as pluggable execution engines:
|
|
278
|
+
|
|
279
|
+
| Harness ID | Engine | Execution Mode | Role |
|
|
280
|
+
| :--- | :--- | :--- | :--- |
|
|
281
|
+
| `agy` | Google Antigravity | CLI arguments | Frontier reasoning, broad context analysis |
|
|
282
|
+
| `claude` | Anthropic Claude Code | CLI arguments (`-p`) | Codebase refactoring, terminal tasks |
|
|
283
|
+
| `codex` | OpenAI Codex | CLI arguments (`exec`) | Program synthesis, sandboxed mutation |
|
|
284
|
+
| `gemini` | Google Gemini CLI | CLI arguments | Lightweight utilities, tool chaining |
|
|
285
|
+
| `ollama` | Ollama Local LLM | `pipe_stdin` | Zero-token-cost local neural inference |
|
|
286
|
+
|
|
287
|
+
- **Multi-Harness Council (`total-recall harness council "<task>"`)**: Runs concurrent deliberative queries across all available local harnesses, compiling multiple perspectives into a structured comparative report.
|
|
288
|
+
- **Cross-Node Harness Dispatch (`total-recall harness dispatch <id> --node <node> "<task>"`)**: Dispatches tasks to a specific harness located on another mesh node (e.g. running `ollama` models on a dedicated local machine like `macmini`).
|
|
289
|
+
|
|
290
|
+
### 3. Agent Process Management (`src/core/agent-manager.mjs`)
|
|
291
|
+
|
|
292
|
+
The agent management layer provides process supervision for background subagents across the cluster:
|
|
293
|
+
|
|
294
|
+
- **Lifecycle Tracking (`sessions/agents.json`)**: Tracks running agent processes with unique IDs, PIDs, harnesses, target nodes, and execution statuses (`running`, `completed`, `failed`, `stopped`).
|
|
295
|
+
- **Detached Execution**: Spawns subagents in the background (`total-recall agent spawn <harness> "<task>"`) with stdout/stderr automatically streamed to session logs (`sessions/logs/`).
|
|
296
|
+
- **Remote Observability & Control**:
|
|
297
|
+
- `total-recall agent logs <id>`: Tails logs in real time from local files or over mesh SSH.
|
|
298
|
+
- `total-recall agent kill <id>`: Sends termination signals (`SIGTERM` or remote `kill`) to shut down runaway processes.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
235
302
|
## 🔒 Session Security & Token Management
|
|
236
303
|
|
|
237
|
-
Total Recall implements role-based granular authorization schemas to protect your
|
|
304
|
+
Total Recall implements role-based granular authorization schemas to protect your brain while maintaining 100% database-free isolation.
|
|
238
305
|
|
|
239
306
|
### 1. Local Dashboard Session Management (JWT-based)
|
|
240
307
|
For web dashboard access, Total Recall strictly avoids external third-party OAuth provider dependencies (e.g. Google, GitHub, Auth0) to protect your privacy and ensure standalone local operation:
|