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.
Files changed (65) hide show
  1. package/bin/total-recall.mjs +31 -1
  2. package/docs/ARCHITECTURE.md +76 -9
  3. package/frontend/dist/assets/index-U7o-qU99.js +5742 -0
  4. package/frontend/dist/index.html +1 -1
  5. package/frontend/src/App.tsx +39 -1
  6. package/frontend/src/api/index.ts +1 -0
  7. package/frontend/src/api/plugins.ts +167 -0
  8. package/frontend/src/pages/ChatPage.tsx +44 -17
  9. package/frontend/src/pages/IntegrationsPage.tsx +7 -0
  10. package/frontend/src/pages/PluginsPage.spec.tsx +17 -0
  11. package/frontend/src/pages/PluginsPage.tsx +1331 -0
  12. package/package.json +1 -1
  13. package/scaffold/.agent/plugins/.gitkeep +0 -0
  14. package/scaffold/.agent/plugins/code-quality/README.md +16 -0
  15. package/scaffold/.agent/plugins/code-quality/cli.mjs +15 -0
  16. package/scaffold/.agent/plugins/code-quality/plugin.json +34 -0
  17. package/scaffold/.agent/plugins/git-sentinel/README.md +16 -0
  18. package/scaffold/.agent/plugins/git-sentinel/cli.mjs +86 -0
  19. package/scaffold/.agent/plugins/git-sentinel/plugin.json +34 -0
  20. package/scaffold/.agent/plugins/meta-harness/README.md +16 -0
  21. package/scaffold/.agent/plugins/meta-harness/cli.mjs +34 -0
  22. package/scaffold/.agent/plugins/meta-harness/plugin.json +34 -0
  23. package/scaffold/.agent/plugins/system-monitor/README.md +16 -0
  24. package/scaffold/.agent/plugins/system-monitor/cli.mjs +79 -0
  25. package/scaffold/.agent/plugins/system-monitor/generator.mjs +20 -0
  26. package/scaffold/.agent/plugins/system-monitor/plugin.json +38 -0
  27. package/scaffold/.agent/skills/meta-harness/SKILL.md +113 -0
  28. package/scaffold/.agent/skills/total-recall/references/cli-reference.md +23 -0
  29. package/src/cli/agent.mjs +173 -0
  30. package/src/cli/connect.mjs +89 -4
  31. package/src/cli/deploy-ui.mjs +6 -0
  32. package/src/cli/harness.mjs +135 -0
  33. package/src/cli/ingest-openwiki.mjs +71 -2
  34. package/src/cli/init.mjs +1 -0
  35. package/src/cli/lint.mjs +47 -3
  36. package/src/cli/mesh.mjs +286 -0
  37. package/src/cli/plugin/create.mjs +186 -0
  38. package/src/cli/plugin/index.mjs +139 -0
  39. package/src/cli/plugin/install.mjs +141 -0
  40. package/src/cli/plugin/list.mjs +83 -0
  41. package/src/cli/plugin/remove.mjs +51 -0
  42. package/src/cli/plugin/search.mjs +37 -0
  43. package/src/cli/skill-projection.mjs +14 -0
  44. package/src/cli/wizard.html +9 -0
  45. package/src/core/agent-manager.mjs +290 -0
  46. package/src/core/cache-prune.mjs +341 -0
  47. package/src/core/context-cache.mjs +130 -0
  48. package/src/core/daemon-loop.mjs +47 -1
  49. package/src/core/evolving-context.mjs +171 -0
  50. package/src/core/mesh-activity.mjs +140 -0
  51. package/src/core/mesh.mjs +174 -1
  52. package/src/core/meta-harness.mjs +251 -0
  53. package/src/core/plugin-context.mjs +206 -0
  54. package/src/core/plugin-loader.mjs +210 -0
  55. package/src/core/runtime.mjs +65 -13
  56. package/src/core/surface.mjs +32 -10
  57. package/src/server/api.mjs +18 -2
  58. package/src/server/index.mjs +8 -2
  59. package/src/server/rest.mjs +4 -0
  60. package/src/server/routes/integrations.mjs +5 -1
  61. package/src/server/routes/mesh-presence.mjs +143 -0
  62. package/src/server/routes/models.mjs +42 -30
  63. package/src/server/routes/plugins.mjs +517 -0
  64. package/src/server/tools.mjs +266 -0
  65. package/frontend/dist/assets/index-Bl3I11B0.js +0 -5742
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "total-recall-brain",
3
- "version": "3.26.0",
3
+ "version": "3.28.0",
4
4
  "description": "Personal AI system — database-free, SSSS-powered intelligence engine deployable to any POSIX host.",
5
5
  "type": "module",
6
6
  "workspaces": [
File without changes
@@ -0,0 +1,16 @@
1
+ # Code Quality & SSSS Conformance
2
+
3
+ > Local-first code quality gates, SSSS schema verification, and invariant enforcement
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx total-recall plugin install ./.agent/plugins/code-quality --link
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **Identifier**: `code-quality`
14
+ - **Version**: 1.0.0
15
+ - **SSSS Category**: `quality-gates`
16
+ - **CLI Command**: `npx total-recall code-quality`
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from 'node:child_process';
3
+ import path from 'node:path';
4
+
5
+ export async function run(argv = []) {
6
+ const scriptPath = path.resolve(process.cwd(), '.agent/skills/code-quality/scripts/report.mjs');
7
+ try {
8
+ const out = execFileSync('node', [scriptPath], { encoding: 'utf8' });
9
+ console.log(out);
10
+ } catch (err) {
11
+ console.error('Failed to run code-quality report:', err.message);
12
+ }
13
+ }
14
+
15
+ export default run;
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://github.com/total-recall/total-recall/blob/main/metadata.plugin.schema.json",
3
+ "id": "code-quality",
4
+ "name": "Code Quality & SSSS Conformance",
5
+ "version": "1.0.0",
6
+ "description": "Local-first code quality gates, SSSS schema verification, and invariant enforcement",
7
+ "author": "Total Recall Ecosystem",
8
+ "license": "MIT",
9
+ "ssss_schemas": {
10
+ "categories": [
11
+ {
12
+ "name": "quality-gates",
13
+ "description": "Custom quality-gates memory nodes for Code Quality & SSSS Conformance",
14
+ "node_type": "memory"
15
+ }
16
+ ]
17
+ },
18
+ "cli": {
19
+ "command": "code-quality",
20
+ "handler": "./cli.mjs",
21
+ "subcommands": [
22
+ {
23
+ "name": "status",
24
+ "description": "Show Code Quality & SSSS Conformance status"
25
+ }
26
+ ]
27
+ },
28
+ "tasks": [
29
+ {
30
+ "intent": "Periodic health verification for code-quality",
31
+ "schedule": "0 * * * *"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,16 @@
1
+ # Git Sentinel & Repo Watchdog
2
+
3
+ > Continuous repository auditor checking dirty worktrees, unpushed commits, and stale branches
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx total-recall plugin install ./.agent/plugins/git-sentinel --link
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **Identifier**: `git-sentinel`
14
+ - **Version**: 1.0.0
15
+ - **SSSS Category**: `repo-audits`
16
+ - **CLI Command**: `npx total-recall git-sentinel`
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync } from 'node:child_process';
3
+ import path from 'node:path';
4
+
5
+ function git(args, cwd = process.cwd()) {
6
+ try {
7
+ return execFileSync('git', args, {
8
+ cwd,
9
+ encoding: 'utf8',
10
+ stdio: ['ignore', 'pipe', 'pipe']
11
+ }).trim();
12
+ } catch (err) {
13
+ return null;
14
+ }
15
+ }
16
+
17
+ export async function run(argv = []) {
18
+ const args = Array.isArray(argv) ? argv.slice(2) : [];
19
+ const clean = args.filter(a => a !== 'git-sentinel' && a !== 'sentinel');
20
+ const isJson = clean.includes('--json');
21
+ const action = clean.find(a => !a.startsWith('--')) || 'audit';
22
+
23
+ const cwd = process.cwd();
24
+ const isInsideWorkTree = git(['rev-parse', '--is-inside-work-tree'], cwd) === 'true';
25
+
26
+ if (!isInsideWorkTree) {
27
+ console.error('❌ Current directory is not a Git repository.');
28
+ process.exit(1);
29
+ }
30
+
31
+ const branch = git(['rev-parse', '--abbrev-ref', 'HEAD'], cwd) || 'unknown';
32
+ const statusOutput = git(['status', '--porcelain'], cwd) || '';
33
+ const lines = statusOutput.split('\n').filter(Boolean);
34
+
35
+ const staged = lines.filter(l => l.match(/^[MADRC]/)).length;
36
+ const unstaged = lines.filter(l => l.match(/^.[MADRCU?]/) && !l.startsWith('??')).length;
37
+ const untracked = lines.filter(l => l.startsWith('??')).length;
38
+ const isClean = lines.length === 0;
39
+
40
+ const unpushedOutput = git(['log', '@{u}..HEAD', '--oneline'], cwd);
41
+ const unpushedCount = unpushedOutput ? unpushedOutput.split('\n').filter(Boolean).length : 0;
42
+
43
+ const stashOutput = git(['stash', 'list'], cwd);
44
+ const stashCount = stashOutput ? stashOutput.split('\n').filter(Boolean).length : 0;
45
+
46
+ const lastCommit = git(['log', '-1', '--format=%h — %s (%cr)'], cwd) || 'No commits yet';
47
+
48
+ const auditReport = {
49
+ branch,
50
+ isClean,
51
+ unpushedCommits: unpushedCount,
52
+ stagedFiles: staged,
53
+ unstagedFiles: unstaged,
54
+ untrackedFiles: untracked,
55
+ totalDirty: lines.length,
56
+ stashCount,
57
+ lastCommit,
58
+ timestamp: new Date().toISOString()
59
+ };
60
+
61
+ if (isJson) {
62
+ console.log(JSON.stringify(auditReport, null, 2));
63
+ return;
64
+ }
65
+
66
+ if (action === 'diff') {
67
+ const diffStat = git(['diff', '--stat'], cwd);
68
+ console.log('\n🔍 Git Sentinel — Working Tree Changes:\n');
69
+ console.log(diffStat || ' No unstaged changes.\n');
70
+ return;
71
+ }
72
+
73
+ console.log('\n🛡️ Total Recall — Git Sentinel Repository Health\n');
74
+ console.log(` Active Branch: \x1b[36m${branch}\x1b[0m`);
75
+ console.log(` Worktree State: ${isClean ? '\x1b[32mClean ✅\x1b[0m' : `\x1b[33mDirty (${lines.length} modified/untracked files) ⚠️\x1b[0m`}`);
76
+ if (!isClean) {
77
+ console.log(` - Staged files: ${staged}`);
78
+ console.log(` - Unstaged files: ${unstaged}`);
79
+ console.log(` - Untracked: ${untracked}`);
80
+ }
81
+ console.log(` Unpushed Commits: ${unpushedCount === 0 ? 'Up to date with upstream ✅' : `\x1b[33m${unpushedCount} commit(s) ahead ⬆️\x1b[0m`}`);
82
+ console.log(` Stash Stack: ${stashCount} saved stashes`);
83
+ console.log(` Head Commit: ${lastCommit}\n`);
84
+ }
85
+
86
+ export default run;
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://github.com/total-recall/total-recall/blob/main/metadata.plugin.schema.json",
3
+ "id": "git-sentinel",
4
+ "name": "Git Sentinel & Repo Watchdog",
5
+ "version": "1.0.0",
6
+ "description": "Continuous repository auditor checking dirty worktrees, unpushed commits, and stale branches",
7
+ "author": "Total Recall Ecosystem",
8
+ "license": "MIT",
9
+ "ssss_schemas": {
10
+ "categories": [
11
+ {
12
+ "name": "repo-audits",
13
+ "description": "Custom repo-audits memory nodes for Git Sentinel & Repo Watchdog",
14
+ "node_type": "memory"
15
+ }
16
+ ]
17
+ },
18
+ "cli": {
19
+ "command": "git-sentinel",
20
+ "handler": "./cli.mjs",
21
+ "subcommands": [
22
+ {
23
+ "name": "status",
24
+ "description": "Show Git Sentinel & Repo Watchdog status"
25
+ }
26
+ ]
27
+ },
28
+ "tasks": [
29
+ {
30
+ "intent": "Periodic health verification for git-sentinel",
31
+ "schedule": "0 * * * *"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,16 @@
1
+ # Meta Harness & Agent Orchestrator
2
+
3
+ > Orchestrates and delegates tasks across connected AI harnesses (Antigravity, Claude Code, Codex, Ollama)
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx total-recall plugin install ./.agent/plugins/meta-harness --link
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **Identifier**: `meta-harness`
14
+ - **Version**: 1.0.0
15
+ - **SSSS Category**: `mesh-delegations`
16
+ - **CLI Command**: `npx total-recall meta-harness`
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import { auditClusterCapabilities, HARNESS_SPECS } from '../../../src/core/meta-harness.mjs';
3
+
4
+ export async function run(argv = []) {
5
+ const args = Array.isArray(argv) ? argv.slice(2) : [];
6
+ const clean = args.filter(a => a !== 'meta-harness' && a !== 'harness');
7
+ const isJson = clean.includes('--json');
8
+ const sub = clean.find(a => !a.startsWith('--')) || 'status';
9
+
10
+ if (sub === 'status' || sub === 'audit' || sub === 'list') {
11
+ const report = auditClusterCapabilities();
12
+ if (isJson) {
13
+ console.log(JSON.stringify(report, null, 2));
14
+ return;
15
+ }
16
+
17
+ console.log('\n🤖 Total Recall — Meta Harness Runtimes & Agent Ecosystem\n');
18
+ console.log(` Local Host Architecture: ${report.local.arch}`);
19
+ console.log(` Total Harnesses Known: ${report.local.harnesses.length}\n`);
20
+
21
+ for (const h of report.local.harnesses) {
22
+ const icon = h.available ? '✅ Available ' : '❌ Not Found ';
23
+ const pathStr = h.binaryPath ? `(${h.binaryPath})` : '';
24
+ console.log(` ${icon} \x1b[1;36m${h.id.padEnd(8)}\x1b[0m ${h.name} ${pathStr}`);
25
+ console.log(` Role: ${h.category} | ${h.description}`);
26
+ }
27
+ console.log('\n Run dispatch: npx total-recall harness dispatch <harness> "<prompt>"\n');
28
+ return;
29
+ }
30
+
31
+ console.log('\nUsage: npx total-recall harness [status|audit]\n');
32
+ }
33
+
34
+ export default run;
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://github.com/total-recall/total-recall/blob/main/metadata.plugin.schema.json",
3
+ "id": "meta-harness",
4
+ "name": "Meta Harness & Agent Orchestrator",
5
+ "version": "1.0.0",
6
+ "description": "Orchestrates and delegates tasks across connected AI harnesses (Antigravity, Claude Code, Codex, Ollama)",
7
+ "author": "Total Recall Ecosystem",
8
+ "license": "MIT",
9
+ "ssss_schemas": {
10
+ "categories": [
11
+ {
12
+ "name": "mesh-delegations",
13
+ "description": "Custom mesh-delegations memory nodes for Meta Harness & Agent Orchestrator",
14
+ "node_type": "memory"
15
+ }
16
+ ]
17
+ },
18
+ "cli": {
19
+ "command": "meta-harness",
20
+ "handler": "./cli.mjs",
21
+ "subcommands": [
22
+ {
23
+ "name": "status",
24
+ "description": "Show Meta Harness & Agent Orchestrator status"
25
+ }
26
+ ]
27
+ },
28
+ "tasks": [
29
+ {
30
+ "intent": "Periodic health verification for meta-harness",
31
+ "schedule": "0 * * * *"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,16 @@
1
+ # System Monitor & Telemetry
2
+
3
+ > Real-time host resource metrics, memory watchdog, and dynamic system telemetry context generator
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npx total-recall plugin install ./.agent/plugins/system-monitor --link
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **Identifier**: `system-monitor`
14
+ - **Version**: 1.0.0
15
+ - **SSSS Category**: `system-metrics`
16
+ - **CLI Command**: `npx total-recall system-monitor`
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ import os from 'node:os';
3
+ import process from 'node:process';
4
+
5
+ function formatBytes(bytes) {
6
+ if (bytes === 0) return '0 B';
7
+ const k = 1024;
8
+ const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
9
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
10
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
11
+ }
12
+
13
+ function formatUptime(seconds) {
14
+ const d = Math.floor(seconds / (3600 * 24));
15
+ const h = Math.floor((seconds % (3600 * 24)) / 3600);
16
+ const m = Math.floor((seconds % 3600) / 60);
17
+ const s = Math.floor(seconds % 60);
18
+ const parts = [];
19
+ if (d > 0) parts.push(`${d}d`);
20
+ if (h > 0) parts.push(`${h}h`);
21
+ if (m > 0) parts.push(`${m}m`);
22
+ parts.push(`${s}s`);
23
+ return parts.join(' ');
24
+ }
25
+
26
+ export async function run(argv = []) {
27
+ const args = Array.isArray(argv) ? argv.slice(2) : [];
28
+ const sub = (args[0] === 'system-monitor' || args[0] === 'monitor') ? (args[1] || 'status') : (args[0] || 'status');
29
+
30
+ if (sub === 'status' || sub === 'stats' || sub === 'info') {
31
+ const totalMem = os.totalmem();
32
+ const freeMem = os.freemem();
33
+ const usedMem = totalMem - freeMem;
34
+ const memPercent = ((usedMem / totalMem) * 100).toFixed(1);
35
+ const load = os.loadavg().map(l => l.toFixed(2)).join(', ');
36
+ const cpus = os.cpus();
37
+ const memUsage = process.memoryUsage();
38
+
39
+ console.log('\n📊 Total Recall — System Monitor Telemetry\n');
40
+ console.log(` Host OS: ${os.type()} ${os.release()} (${os.arch()})`);
41
+ console.log(` Hostname: ${os.hostname()}`);
42
+ console.log(` CPU Cores: ${cpus.length} cores (${cpus[0]?.model || 'Unknown CPU'})`);
43
+ console.log(` Load Average: ${load} (1m, 5m, 15m)`);
44
+ console.log(` System Uptime: ${formatUptime(os.uptime())}`);
45
+ console.log(` RAM Usage: ${formatBytes(usedMem)} / ${formatBytes(totalMem)} (${memPercent}% used)`);
46
+ console.log(` Free RAM: ${formatBytes(freeMem)}`);
47
+ console.log(` Process RSS: ${formatBytes(memUsage.rss)} (Heap: ${formatBytes(memUsage.heapUsed)} / ${formatBytes(memUsage.heapTotal)})`);
48
+ console.log(` Node.js: ${process.version}\n`);
49
+ return;
50
+ }
51
+
52
+ if (sub === 'sample' || sub === 'record' || sub === '--json') {
53
+ const totalMem = os.totalmem();
54
+ const freeMem = os.freemem();
55
+ const usedMem = totalMem - freeMem;
56
+ const memPercent = ((usedMem / totalMem) * 100).toFixed(1);
57
+ const load = os.loadavg();
58
+
59
+ const sample = {
60
+ timestamp: new Date().toISOString(),
61
+ hostname: os.hostname(),
62
+ platform: os.platform(),
63
+ uptimeSeconds: os.uptime(),
64
+ loadAvg: load,
65
+ memory: {
66
+ total: totalMem,
67
+ free: freeMem,
68
+ usedPercent: Number(memPercent)
69
+ }
70
+ };
71
+
72
+ console.log(JSON.stringify(sample, null, 2));
73
+ return;
74
+ }
75
+
76
+ console.log(`\nUsage: npx total-recall system-monitor [status|sample]\n`);
77
+ }
78
+
79
+ export default run;
@@ -0,0 +1,20 @@
1
+ import os from 'node:os';
2
+
3
+ /**
4
+ * Context generator for System Monitor & Telemetry.
5
+ * Invoked during evolving context compilation.
6
+ */
7
+ export async function generateContext({ projectRoot, nodes = [] }) {
8
+ const load = os.loadavg().map(l => l.toFixed(2)).join(', ');
9
+ const freeMb = Math.round(os.freemem() / (1024 * 1024));
10
+ const totalMb = Math.round(os.totalmem() / (1024 * 1024));
11
+ const usedPercent = Math.round(((totalMb - freeMb) / totalMb) * 100);
12
+
13
+ return `#### System Telemetry & Resource Status
14
+ - Host Platform: ${os.type()} ${os.arch()} (${os.cpus().length} vCPUs)
15
+ - CPU Load Avg: ${load} (1m, 5m, 15m)
16
+ - Host Memory: ${freeMb} MB free / ${totalMb} MB total (${usedPercent}% utilized)
17
+ - Monitored SSSS Metrics Nodes: ${nodes.length}
18
+ `;
19
+ }
20
+ export default generateContext;
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://github.com/total-recall/total-recall/blob/main/metadata.plugin.schema.json",
3
+ "id": "system-monitor",
4
+ "name": "System Monitor & Telemetry",
5
+ "version": "1.0.0",
6
+ "description": "Real-time host resource metrics, memory watchdog, and dynamic system telemetry context generator",
7
+ "author": "Total Recall Ecosystem",
8
+ "license": "MIT",
9
+ "ssss_schemas": {
10
+ "categories": [
11
+ {
12
+ "name": "system-metrics",
13
+ "description": "Custom system-metrics memory nodes for System Monitor & Telemetry",
14
+ "node_type": "memory"
15
+ }
16
+ ]
17
+ },
18
+ "cli": {
19
+ "command": "system-monitor",
20
+ "handler": "./cli.mjs",
21
+ "subcommands": [
22
+ {
23
+ "name": "status",
24
+ "description": "Show System Monitor & Telemetry status"
25
+ }
26
+ ]
27
+ },
28
+ "compile": {
29
+ "generator": "./generator.mjs",
30
+ "auto": true
31
+ },
32
+ "tasks": [
33
+ {
34
+ "intent": "Periodic health verification for system-monitor",
35
+ "schedule": "0 * * * *"
36
+ }
37
+ ]
38
+ }
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: meta-harness
3
+ description: Meta Harness & Agent Management Layer to orchestrate and delegate tasks across all connected IDE harnesses (Antigravity, Claude Code, Codex, Gemini, Ollama) and the computer generally.
4
+ ---
5
+
6
+ # Meta Harness & Agent Management Layer
7
+
8
+ The **Meta Harness** provides a unified agent management layer across all connected developer environments, CLI runtimes, and the computer generally.
9
+
10
+ ## 🎯 Architectural Concept
11
+
12
+ Total Recall connects to every major IDE, CLI harness, and local neural runtime:
13
+ - **Google Antigravity (`agy`)**: Frontier multi-step reasoning, web grounding, and deep research on AI Ultra.
14
+ - **Claude Code (`claude`)**: Direct terminal codebase refactoring, bash tool execution, and complex Unix tasks.
15
+ - **OpenAI Codex (`codex`)**: Program synthesis, sandboxed workspace mutations, and isolated code generation.
16
+ - **Google Gemini CLI (`gemini`)**: Fast utility completions and lightweight tool chaining.
17
+ - **Ollama Local LLM (`ollama`)**: Zero-token-cost local neural reasoning (e.g. `gemma4:latest`) running non-interactively via standard input piping (`pipe_stdin`).
18
+ - **IDE Surfaces**: Cursor (`.cursorrules`), Cline (`.clinerules`), VS Code (`copilot-instructions.md`), DeepSeek Harness (`dsh`).
19
+
20
+ ### The Shared Brain Principle
21
+ Because all harnesses operate over the **same portable brain**:
22
+ - Every harness reads the same auto-compiled instruction surface (`AGENTS.md`, `GEMINI.md`, `CLAUDE.md`).
23
+ - Every harness writes directly into the shared SSSS memory vault (`memory-vault/`).
24
+ - Knowledge or solutions learned by one agent in one harness are immediately accessible to every other harness across the computer and mesh.
25
+
26
+ ---
27
+
28
+ ## 🛠️ CLI Operations
29
+
30
+ ### 1. Inspect Active Harnesses
31
+ Inspect all available developer harnesses and their local binary paths:
32
+ ```bash
33
+ npx total-recall harness list
34
+ ```
35
+
36
+ ### 2. Headless Task Dispatch
37
+ Dispatch a specific coding or research task to any external harness (locally or remotely over the mesh):
38
+ ```bash
39
+ # Local dispatches
40
+ npx total-recall harness dispatch claude "Inspect src/core/surface.mjs and run lint checks"
41
+ npx total-recall harness dispatch agy "Analyze latest preprints on room temperature diamond NV registers"
42
+ npx total-recall harness dispatch codex "Generate unit tests for src/core/context-cache.mjs"
43
+ npx total-recall harness dispatch ollama "Summarize the core invariants of SSSS"
44
+
45
+ # Cross-mesh remote dispatches
46
+ npx total-recall harness dispatch ollama --node macmini "What is test-time compute scaling?"
47
+ npx total-recall harness dispatch claude --node macmini "Run git status and lint tests"
48
+ ```
49
+
50
+ ### 3. Multi-Harness Council
51
+ Run a task across multiple harnesses concurrently to obtain comparative solutions and consensus:
52
+ ```bash
53
+ npx total-recall harness council "Propose architecture for decentralized research mesh"
54
+ ```
55
+
56
+ ---
57
+
58
+ ## 🤖 Agent Process Management
59
+
60
+ Manage background subagent tasks across the local machine and remote mesh nodes:
61
+
62
+ ### 1. Spawn a Background Agent
63
+ ```bash
64
+ # Local background agent
65
+ npx total-recall agent spawn claude "Refactor error handling in src/cli/harness.mjs" --name "Refactor Worker"
66
+
67
+ # Remote background agent on a mesh node
68
+ npx total-recall agent spawn agy --node macmini "Crawl recent preprints on quantum shuttling" --name "Quantum Scout"
69
+ ```
70
+
71
+ ### 2. Inspect Running Agents
72
+ ```bash
73
+ npx total-recall agent list
74
+ npx total-recall agent list --json
75
+ ```
76
+
77
+ ### 3. Stream Agent Logs
78
+ ```bash
79
+ npx total-recall agent logs <agent-id> --tail 100
80
+ ```
81
+
82
+ ### 4. Terminate an Agent
83
+ ```bash
84
+ npx total-recall agent kill <agent-id>
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 🌐 Headscale Mesh Diagnostics & Remote Execution
90
+
91
+ The Meta Harness integrates directly with your private Headscale WireGuard mesh network:
92
+
93
+ ### 1. Cluster Capability Audit (`mesh doctor`)
94
+ Concurrently audit reachability, developer runtimes (`node`, `docker`, `git`), and AI harnesses (`agy`, `claude`, `codex`, `gemini`, `ollama`) across all cluster nodes:
95
+ ```bash
96
+ npx total-recall mesh doctor
97
+ npx total-recall mesh doctor --json
98
+ ```
99
+
100
+ ### 2. Non-Interactive Remote Command Execution (`mesh exec`)
101
+ Execute commands on remote nodes with automatic `$PATH` sanitization and structured outputs:
102
+ ```bash
103
+ npx total-recall mesh exec macmini uname -m
104
+ npx total-recall mesh exec cloud docker ps
105
+ ```
106
+
107
+ ---
108
+
109
+ ## 💻 General Computer & OS Management
110
+ The Meta Harness controls the computer generally:
111
+ - **Activity Monitoring ("Follow the User")**: Tracks interaction timestamps and routes dispatches to the active device across the Headscale WireGuard mesh.
112
+ - **Process Orchestration**: Spawns background worker loops, monitors task completion, and terminates runaway processes.
113
+ - **Surface Sync**: Recompiles instruction surfaces across all IDE directories automatically upon graph updates.
@@ -38,6 +38,29 @@ Run system diagnostic suites and heal environment inconsistencies.
38
38
  Manually resolve quarantined memory conflicts.
39
39
  * **Syntax**: `npx total-recall resolve --supersede <node-slug> | --keep <node-slug>`
40
40
 
41
+ ### 1.6 `mesh`
42
+ Control-server (Headscale) mesh administration, cluster capability auditing, and remote execution.
43
+ * **Syntax**: `npx total-recall mesh <status|doctor|nodes|ssh|exec|access|preauthkey|policy> [options]`
44
+ * **Key Subcommands**:
45
+ * `mesh doctor [--json]`: Audit SSH reachability, runtimes (`node`, `docker`, `git`), and AI harnesses across all mesh nodes.
46
+ * `mesh exec <node> [--json] <cmd…>`: Non-interactive remote command execution over WireGuard SSH.
47
+ * `mesh ssh <node> [cmd…]`: Interactive or one-shot SSH session using recorded node credentials.
48
+
49
+ ### 1.7 `harness`
50
+ Meta-harness orchestration layer across connected IDEs, CLI agents, and local neural runtimes.
51
+ * **Syntax**: `npx total-recall harness <list|dispatch|council> [options]`
52
+ * **Supported Harnesses**: `agy` (Google Antigravity), `claude` (Claude Code), `codex` (OpenAI Codex), `gemini` (Google Gemini), `ollama` (Local Neural Models via `pipe_stdin`).
53
+ * **Options**:
54
+ * `--node <node>`: Route harness execution remotely to a target mesh node.
55
+
56
+ ### 1.8 `agent`
57
+ Process controller for background agent tasks across the local machine and remote mesh nodes.
58
+ * **Syntax**: `npx total-recall agent <list|spawn|status|logs|kill> [options]`
59
+ * **Key Subcommands**:
60
+ * `agent spawn <harness> [--node <node>] [--name <label>] "<task>"`: Spawn a background subagent task.
61
+ * `agent logs <id> [--tail <n>]`: Stream agent execution logs locally or over mesh SSH.
62
+ * `agent kill <id|pid>`: Terminate an active agent process locally or across the mesh.
63
+
41
64
  ---
42
65
 
43
66
  ## 2. REST API Specification