total-recall-brain 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -108
- package/bin/antigravity.mjs +81 -52
- package/bin/total-recall.mjs +32 -57
- package/extension/background.js +1 -1
- package/extension/options/options.js +9 -3
- package/extension/sidepanel/sidepanel.js +0 -2
- package/frontend/index.html +4 -3
- package/frontend/package.json +1 -0
- package/frontend/src/App.tsx +109 -152
- package/frontend/src/api.ts +605 -23
- package/frontend/src/components/BrainSelector.tsx +211 -199
- package/frontend/src/components/DocumentEditorModal.tsx +57 -0
- package/frontend/src/components/DocumentTable.tsx +47 -0
- package/frontend/src/components/Graph3D.tsx +120 -71
- package/frontend/src/components/UsageChart.tsx +3 -3
- package/frontend/src/components/brand/BrandMark.tsx +95 -0
- package/frontend/src/index.css +286 -86
- package/frontend/src/pages/ApiKeysPage.tsx +1878 -215
- package/frontend/src/pages/ChatPage.tsx +103 -45
- package/frontend/src/pages/DesignDocsPage.tsx +5 -5
- package/frontend/src/pages/FilesPage.tsx +10 -6
- package/frontend/src/pages/GraphPage.tsx +5 -3
- package/frontend/src/pages/HelpPage.tsx +2 -2
- package/frontend/src/pages/InboxPage.tsx +82 -0
- package/frontend/src/pages/InstructionsPage.tsx +1 -1
- package/frontend/src/pages/IntegrationsPage.tsx +21 -10
- package/frontend/src/pages/LoginPage.tsx +95 -77
- package/frontend/src/pages/MemoryPage.tsx +31 -8
- package/frontend/src/pages/OnboardingPage.tsx +690 -0
- package/frontend/src/pages/OpenWikiPage.tsx +412 -323
- package/frontend/src/pages/SettingsPage.tsx +825 -922
- package/frontend/src/pages/SkillsPage.tsx +272 -147
- package/frontend/src/pages/UsagePage.tsx +23 -31
- package/frontend/src/pages/VaultPage.tsx +223 -0
- package/frontend/src/types.ts +13 -0
- package/package.json +4 -4
- package/scaffold/.agent/skills/total-recall/SKILL.md +43 -4
- package/scaffold/.agent/skills/total-recall/modules/README.md +10 -0
- package/scaffold/.agent/skills/total-recall/modules/agents/README.md +5 -0
- package/scaffold/.agent/skills/total-recall/{skills/tr-cli-agents → modules/agents}/agents.yml +8 -0
- package/scaffold/.agent/skills/total-recall/modules/skill-deploy/README.md +9 -0
- package/scaffold/.agent/skills/total-recall/openwiki/README.md +10 -0
- package/scaffold/.agent/skills/total-recall/openwiki/architecture.md +5 -0
- package/scaffold/.agent/skills/total-recall/openwiki/ide.md +10 -0
- package/scaffold/.agent/skills/total-recall/openwiki/memory.md +11 -0
- package/scaffold/.agent/skills/total-recall/openwiki/secrets.md +7 -0
- package/scaffold/.agent/skills/total-recall/openwiki/skills.md +7 -0
- package/src/cli/brain.mjs +63 -5
- package/src/cli/connect.mjs +11 -19
- package/src/cli/daemon.mjs +5 -4
- package/src/cli/deploy-ui.mjs +8 -3
- package/src/cli/deploy.mjs +84 -27
- package/src/cli/ingest/index.mjs +1 -1
- package/src/cli/init.mjs +63 -34
- package/src/cli/remember.mjs +3 -3
- package/src/cli/secret.mjs +812 -0
- package/src/cli/setup.mjs +34 -7
- package/src/cli/share.mjs +2 -2
- package/src/cli/skill.mjs +396 -35
- package/src/cli/sync.mjs +4 -4
- package/src/cli/task.mjs +287 -0
- package/src/core/clarity-rewriter.mjs +5 -5
- package/src/core/config.mjs +44 -2
- package/src/core/conflict-detector.mjs +5 -5
- package/src/core/crons.mjs +54 -0
- package/src/core/daemon-loop.mjs +87 -235
- package/src/core/dream.mjs +170 -10
- package/src/core/env-import.mjs +456 -0
- package/src/core/fact-seeker.mjs +14 -14
- package/src/core/import-rules.mjs +20 -7
- package/src/core/inference-engine.mjs +3 -3
- package/src/core/migrate.mjs +14 -8
- package/src/core/okf-adapter.mjs +2 -2
- package/src/core/operation-validator.mjs +39 -331
- package/src/core/optimizer.mjs +7 -0
- package/src/core/post-mortem.mjs +2 -2
- package/src/core/project-brain.mjs +349 -0
- package/src/core/provider-catalog.mjs +296 -0
- package/src/core/quick-capture.mjs +1 -1
- package/src/core/remote-vault-sync.mjs +194 -0
- package/src/core/research-queue.mjs +7 -11
- package/src/core/runtime.mjs +33 -9
- package/src/core/scheduler.mjs +59 -5
- package/src/core/schema.mjs +14 -0
- package/src/core/search.mjs +1 -1
- package/src/core/secrets-env-export.mjs +323 -0
- package/src/core/secrets-rotate.mjs +245 -0
- package/src/core/secrets-store.mjs +645 -0
- package/src/core/semantic-index.mjs +3 -3
- package/src/core/skills-registry.mjs +1062 -0
- package/src/core/source-adapters.mjs +4 -1
- package/src/core/ssss-host-extension.mjs +94 -0
- package/src/core/ssss-kernel-bridge.mjs +530 -0
- package/src/core/surface.mjs +14 -0
- package/src/core/task-envelope.mjs +298 -0
- package/src/core/task-executors.mjs +600 -0
- package/src/core/validated-write.mjs +124 -56
- package/src/core/vault.mjs +19 -34
- package/src/core/webauthn-store.mjs +272 -0
- package/src/server/api.mjs +26 -16
- package/src/server/auth.mjs +51 -0
- package/src/server/index.mjs +3 -3
- package/src/server/keys.mjs +30 -4
- package/src/server/rest.mjs +198 -25
- package/src/server/route-manifest.json +156 -0
- package/src/server/routes/_shared.mjs +40 -1
- package/src/server/routes/docs.mjs +260 -0
- package/src/server/routes/memory.mjs +145 -32
- package/src/server/routes/research.mjs +30 -0
- package/src/server/routes/secrets.mjs +470 -0
- package/src/server/routes/share.mjs +2 -2
- package/src/server/routes/skills.mjs +452 -54
- package/src/server/routes/sync.mjs +48 -0
- package/src/server/routes/webauthn.mjs +184 -0
- package/src/server/update-route-manifest.mjs +39 -0
- package/templates/onboarding-interview.md +32 -22
- package/templates/openwiki/README.md +10 -0
- package/templates/openwiki/architecture.md +5 -0
- package/templates/openwiki/ide.md +10 -0
- package/templates/openwiki/memory.md +11 -0
- package/templates/openwiki/secrets.md +7 -0
- package/templates/openwiki/skills.md +7 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/SKILL.md +0 -121
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/references/antigravity.txt +0 -20
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/references/claude.txt +0 -58
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/references/codex.txt +0 -81
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/references/gemini.txt +0 -44
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/scripts/.gitkeep +0 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-cli-agents/subagents/.gitkeep +0 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-research/SKILL.md +0 -338
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/SKILL.md +0 -282
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/assets/skill-template/SKILL.md +0 -20
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/evals/evals.json +0 -20
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/hooks/on-skill-add.sh +0 -14
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/hooks/on-skill-delete.sh +0 -14
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/learnings/.gitkeep +0 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/references/.gitkeep +0 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/scripts/.gitkeep +0 -0
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/scripts/create-skill.sh +0 -65
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/scripts/enforce-skill-optimization.mjs +0 -135
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/scripts/skill-watcher.mjs +0 -64
- package/scaffold/.agent/skills/total-recall/skills/tr-skill/subagents/audit-all-skills.md +0 -62
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/SKILL.md +0 -298
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/evals/evals.json +0 -17
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/references/CHANGELOG.md +0 -124
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/references/ssss-spec.md +0 -1325
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/scripts/validate-schema.mjs +0 -232
- package/scaffold/.agent/skills/total-recall/skills/tr-ssss/subagents/audit-ssss-node.md +0 -9
- /package/scaffold/.agent/skills/total-recall/{skills/tr-cli-agents/evals → modules/skill-deploy/scripts}/.gitkeep +0 -0
- /package/scaffold/.agent/skills/total-recall/{skills/tr-skill → modules/skill-deploy}/scripts/find-skills.mjs +0 -0
- /package/scaffold/.agent/skills/total-recall/{skills/tr-skill → modules/skill-deploy}/scripts/install-skill.mjs +0 -0
- /package/scaffold/.agent/skills/total-recall/{skills/tr-skill → modules/skill-deploy}/scripts/scan-skill.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,173 +1,156 @@
|
|
|
1
|
-
# Total Recall
|
|
1
|
+
# Total Recall
|
|
2
2
|
|
|
3
|
-
[](package.json)
|
|
4
4
|
[](LICENSE)
|
|
5
|
-
[](.github/workflows/test.yml)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
**Portable personal memory for any IDE** — filesystem-native, database-free, open source.
|
|
8
7
|
|
|
9
|
-
Total Recall
|
|
8
|
+
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.**
|
|
10
9
|
|
|
11
10
|
```text
|
|
12
|
-
|
|
11
|
+
write → remember / session ingest
|
|
12
|
+
sleep → dream (consolidate, conflict, compile, prune)
|
|
13
|
+
read → recall + compiled surfaces
|
|
14
|
+
async → daemon task queue (agents may enqueue anything under policy)
|
|
13
15
|
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
```text
|
|
18
|
+
your brain = ~/.agent/skills/total-recall/
|
|
19
|
+
your project = <repo>/.agent/skills/total-recall/
|
|
20
|
+
```
|
|
16
21
|
|
|
17
22
|
---
|
|
18
23
|
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
### 🖥️ 1. IDE Memory Only (2 minutes)
|
|
24
|
+
## Quick start (IDE memory, ~2 minutes)
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
No always-on LLM and no research daemon required.
|
|
24
27
|
|
|
25
28
|
```bash
|
|
26
|
-
cd
|
|
27
|
-
npx total-recall init
|
|
28
|
-
npx total-recall connect claude-code
|
|
29
|
+
cd /path/to/any-project
|
|
30
|
+
npx total-recall init --project # project brain + openwiki scaffold
|
|
31
|
+
npx total-recall connect claude-code # or: cursor | codex | gemini | aider | obsidian | http-api
|
|
32
|
+
npx total-recall remember preference "Prefer clear, short answers."
|
|
33
|
+
npx total-recall recall "short answers"
|
|
34
|
+
npx total-recall compile # rebuild INSTRUCTIONS.md inject blocks
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
Injected rules sit only between:
|
|
32
38
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| `npx total-recall connect gemini` | Symlink | Symlinks `GEMINI.md` to the compiled instruction surface |
|
|
39
|
-
| `npx total-recall connect cursor` | File Projection | Writes/updates `.cursor/rules/total-recall.mdc` with frontmatter rules |
|
|
40
|
-
| `npx total-recall connect aider` | File Projection | Writes/updates `.aider.rules.md` file rules |
|
|
39
|
+
```text
|
|
40
|
+
<!-- BEGIN INJECTED MEMORY: do not edit by hand; rebuilt by total-recall surface -->
|
|
41
|
+
…
|
|
42
|
+
<!-- END INJECTED MEMORY -->
|
|
43
|
+
```
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
> **Non-Destructive Integration:**
|
|
44
|
-
> Your existing custom rules are **never overwritten**. Total Recall operates exclusively inside the clearly-marked comment bounds:
|
|
45
|
-
> `<!-- BEGIN INJECTED MEMORY: do not edit by hand; rebuilt by total-recall surface -->`
|
|
46
|
-
> `...`
|
|
47
|
-
> `<!-- END INJECTED MEMORY -->`
|
|
45
|
+
Existing local rules outside those markers are never clobbered.
|
|
48
46
|
|
|
49
47
|
---
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
## Core workflows
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
| Workflow | Commands |
|
|
52
|
+
|----------|----------|
|
|
53
|
+
| **Remember / recall** | `remember`, `forget`, `recall` |
|
|
54
|
+
| **Dream (sleep)** | `dream` — or daemon system dream on empty queue |
|
|
55
|
+
| **Defer work** | `task add "<intent>"` then `daemon start` |
|
|
56
|
+
| **Skills across repos** | `skill track <path>`, `skill deploy`, `skill sync` |
|
|
57
|
+
| **Secrets (not vault)** | `secret set\|list\|rotate\|usage\|check-surfaces` |
|
|
58
|
+
| **Connect an IDE** | `connect <client>` |
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
- A standard Linux or macOS server/workstation.
|
|
57
|
-
- Node.js ≥ 20.
|
|
58
|
-
- A primary API Key (e.g. `GOOGLE_API_KEY` for high-speed Google `gemini-embedding-2` vectors, featuring OpenAI fallback).
|
|
60
|
+
### Multi-repo skills (any path you choose)
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
|
|
62
|
-
npx total-recall
|
|
63
|
+
npx total-recall skill track /path/to/any-app
|
|
64
|
+
npx total-recall skill sync --repo /path/a --repo /path/b
|
|
65
|
+
# or: export TR_SYNC_REPOS="/path/a:/path/b"
|
|
63
66
|
```
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
Roots come only from: project registry, install map, `TR_SYNC_REPOS`, CLI `--repo`, and cwd when it looks like a project.
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
| :--- | :--- | :--- |
|
|
69
|
-
| **Local Bind** | `http://127.0.0.1:3000` | Local operations. Binds strictly to your loopback interface. |
|
|
70
|
-
| **Quick Tunnel** | `https://*.trycloudflare.com` | Spawns a background Cloudflare tunnel for zero-configuration public URL access. |
|
|
71
|
-
| **Named Tunnel** | `https://your-tunnel.domain.com` | Hooks up securely to a pre-registered Cloudflare tunnel daemon. |
|
|
72
|
-
| **Custom Domain** | `https://your-domain.com` | Hooks up to your public DNS, reverse-proxied and secured by Caddy TLS. |
|
|
70
|
+
### Secrets
|
|
73
71
|
|
|
74
|
-
To start the server daemon, run:
|
|
75
72
|
```bash
|
|
76
|
-
|
|
73
|
+
npx total-recall secret set some_api_key "$KEY" --provider example
|
|
74
|
+
npx total-recall secret list # metadata only
|
|
75
|
+
npx total-recall secret check-surfaces # fail if values leaked into surfaces
|
|
77
76
|
```
|
|
78
|
-
*Vite automatically installs and builds the beautiful Glassmorphic React SPA on first boot, serving the dashboard dynamically.*
|
|
79
|
-
|
|
80
|
-
---
|
|
81
77
|
|
|
82
|
-
|
|
78
|
+
Optional AES: `TR_SECRETS_PASSWORD`. Values never belong in vault markdown or openwiki.
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
### Optional background daemon
|
|
85
81
|
|
|
86
82
|
```bash
|
|
87
|
-
npx total-recall
|
|
83
|
+
npx total-recall daemon start # idle invent OFF unless TR_IDLE_TASKS=1
|
|
84
|
+
npx total-recall task add "Extract decisions from last session" --cap vault:write
|
|
88
85
|
```
|
|
89
|
-
*Auto-detects your vault path on macOS (or pass `--vault ~/path/to/vault` on Linux/other), symlinking your memory vault and installing interactive Dataview dashboard trackers.*
|
|
90
86
|
|
|
91
87
|
---
|
|
92
88
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
UltraChat integrates securely with your brain via our OpenAI-compatible chat API, injecting active memory instructions into system prompts on the fly:
|
|
89
|
+
## Dual-layer brain
|
|
96
90
|
|
|
97
|
-
```
|
|
98
|
-
|
|
91
|
+
```text
|
|
92
|
+
GLOBAL ~/.agent/skills/total-recall/ identity, shared preferences
|
|
93
|
+
PROJECT <repo>/.agent/skills/total-recall/ repo facts, decisions, openwiki
|
|
99
94
|
```
|
|
100
|
-
|
|
95
|
+
|
|
96
|
+
CLI flags: `--global` / `--project`. Project wins on slug conflicts when both apply.
|
|
101
97
|
|
|
102
98
|
---
|
|
103
99
|
|
|
104
|
-
##
|
|
100
|
+
## CLI inventory
|
|
105
101
|
|
|
106
|
-
|
|
102
|
+
Commands are classified as **core** (default product path), **optional** (power features), or **legacy** (still shipped, not the focus).
|
|
107
103
|
|
|
108
|
-
|
|
109
|
-
┌────────────────────────┐
|
|
110
|
-
│ GLOBAL LAYER │
|
|
111
|
-
│ ~/.agent/skills/tr/ │
|
|
112
|
-
└───────────┬────────────┘
|
|
113
|
-
│
|
|
114
|
-
▼ Overridden by
|
|
115
|
-
┌────────────────────────┐
|
|
116
|
-
│ PROJECT LAYER │
|
|
117
|
-
│ <repo>/.agent/skills/ │
|
|
118
|
-
└────────────────────────┘
|
|
119
|
-
```
|
|
104
|
+
Full table: [`docs/reference/CLI_INVENTORY.md`](docs/reference/CLI_INVENTORY.md)
|
|
120
105
|
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
| Tier | Examples |
|
|
107
|
+
|------|----------|
|
|
108
|
+
| **Core** | `init`, `connect`, `remember`, `forget`, `recall`, `compile`, `dream`, `task`, `daemon`, `skill`, `secret`, `brain`, `status`, `doctor` |
|
|
109
|
+
| **Optional** | `research`, `relay`, `deploy`, `setup`, `backup`/`restore`, `chat`, `map`, `export`/`import`, `ingest` |
|
|
110
|
+
| **Legacy / niche** | `collab`, `friction`, `upgrade`, `migrate`, `snapshot`, `command` |
|
|
123
111
|
|
|
124
|
-
|
|
112
|
+
Default install story: **init → connect → remember/recall → dream**. No LLM required.
|
|
125
113
|
|
|
126
114
|
---
|
|
127
115
|
|
|
128
|
-
##
|
|
129
|
-
|
|
130
|
-
| Command | Description |
|
|
131
|
-
| :--- | :--- |
|
|
132
|
-
| `npx total-recall init` | Initialize the global or local project VFS memory schemas. |
|
|
133
|
-
| `npx total-recall connect <client>` | Wire a local IDE, Obsidian vault, or UltraChat client to your brain. |
|
|
134
|
-
| `npx total-recall deploy` | Configure startup services, Caddy proxy servers, and platform auto-starts. |
|
|
135
|
-
| `npx total-recall compile` | Rebuild `INSTRUCTIONS.md` from merged global & project memory nodes. |
|
|
136
|
-
| `npx total-recall dream` | Trigger a manual Dream Cycle (GC, pattern extraction, decay consolidation). |
|
|
137
|
-
| `npx total-recall lint` | Validate vault nodes against the SSSS v2 frontmatter Zod schema. |
|
|
138
|
-
| `npx total-recall backup` | Create password-encrypted tarballs, push git backups, or sync Obsidian. |
|
|
139
|
-
| `npx total-recall restore <file>` | Restore your sovereign VFS from an encrypted tarball backup. |
|
|
140
|
-
| `npx total-recall status` | Show brain health summary, connected client registries, and daemon status. |
|
|
141
|
-
| `npx total-recall generate-pat` | Provision granular, label-based Personal Access Tokens (PATs) for auth. |
|
|
142
|
-
| `npx total-recall daemon` | Manage the background Dream Cycle daemon (start / stop / status). |
|
|
143
|
-
| `npx total-recall relay` | Manage background local session-sync relays watching IDE log files. |
|
|
144
|
-
| `npx total-recall config` | Read or update system settings, Allowed Origins, or USD budget caps dynamically. |
|
|
145
|
-
| `npx total-recall skill` | Search, install, security-audit, and remove packages from the skills.sh registry. |
|
|
146
|
-
| `npx total-recall uninstall` | Completely stop background services and wipe Total Recall from the system. |
|
|
147
|
-
| `npx total-recall friction` | Inspect watchdog telemetry logs to identify workflow latency bottlenecks. |
|
|
116
|
+
## Optional full server
|
|
148
117
|
|
|
149
|
-
|
|
118
|
+
For a local REST API + dashboard (not required for IDE memory):
|
|
150
119
|
|
|
151
|
-
|
|
120
|
+
```bash
|
|
121
|
+
npx total-recall start
|
|
122
|
+
# or: npm start
|
|
123
|
+
```
|
|
152
124
|
|
|
153
|
-
|
|
154
|
-
- **Cost Watchdog & Limits:** Daily and weekly maximum cost thresholds (`config/budget.yml`) are enforced dynamically via a cost supervisor in `runtime.mjs` that instantly suspends subagent dispatches if budget caps are exceeded.
|
|
155
|
-
- **OWASP-aligned scrypt Security:** Master credentials and API keys are AES-256-GCM encrypted under `secrets.enc` with OWASP-aligned scrypt key derivation.
|
|
156
|
-
- **Privacy Redactions:** Memory nodes marked with `privacy: local_only` are automatically stripped before any external API dispatches or reasoning agent calls.
|
|
125
|
+
Deploy/tunnels are optional (`deploy`, `setup`). Configure only what you need.
|
|
157
126
|
|
|
158
127
|
---
|
|
159
128
|
|
|
160
|
-
##
|
|
129
|
+
## Architecture sketch
|
|
130
|
+
|
|
131
|
+
- **SSSS vault** — Markdown + YAML frontmatter (filesystem SSOT)
|
|
132
|
+
- **Openwiki** — human/agent long-form docs (ships with init)
|
|
133
|
+
- **Surfaces** — compiled inject blocks for IDEs
|
|
134
|
+
- **Dream** — consolidation cycle (deterministic first)
|
|
135
|
+
- **Daemon tasks** — open envelope + capability policy
|
|
136
|
+
- **Secrets** — separate store from vault
|
|
161
137
|
|
|
162
|
-
|
|
138
|
+
Host apps consume TR the same way: PAT + brain URL (`connect http-api`) or local files.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Uninstall
|
|
163
143
|
|
|
164
144
|
```bash
|
|
165
145
|
npx total-recall uninstall
|
|
166
146
|
```
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
> The uninstaller automatically detects version-controlled files, **preserving** local workspace `.agent/skills/` and `.agent/memory-vault/` directories inside active git project repositories to ensure you never lose custom rules and memories.
|
|
147
|
+
|
|
148
|
+
Project brains inside git repos are preserved when possible so you do not lose custom rules and memories.
|
|
170
149
|
|
|
171
150
|
---
|
|
172
151
|
|
|
173
|
-
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT — see [LICENSE](LICENSE).
|
|
155
|
+
|
|
156
|
+
*Portable memory. Your files. Any IDE.*
|
package/bin/antigravity.mjs
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Antigravity CLI Agent Wrapper — routes through the running Antigravity IDE
|
|
3
|
-
// via agentapi, using the user's logged-in Google account.
|
|
4
2
|
|
|
5
3
|
import fs from 'node:fs';
|
|
6
4
|
import path from 'node:path';
|
|
7
5
|
import os from 'node:os';
|
|
8
|
-
import { spawnSync } from 'node:child_process';
|
|
9
6
|
|
|
10
7
|
const args = process.argv.slice(2);
|
|
11
8
|
let prompt = '';
|
|
12
9
|
let outputJson = false;
|
|
13
|
-
let requestedModel = process.env.TR_CLI_MODEL || '
|
|
10
|
+
let requestedModel = process.env.TR_CLI_MODEL || 'default';
|
|
14
11
|
|
|
15
12
|
if (args.includes('-h') || args.includes('--help')) {
|
|
16
13
|
console.log(`
|
|
17
|
-
Antigravity CLI Agent Wrapper — Headless
|
|
14
|
+
Antigravity CLI Agent Wrapper — Headless Zero-Dependency Cognitive Agent
|
|
18
15
|
|
|
19
16
|
Usage:
|
|
20
17
|
antigravity [options] [prompt]
|
|
@@ -22,15 +19,15 @@ Usage:
|
|
|
22
19
|
|
|
23
20
|
Options:
|
|
24
21
|
-p, --prompt The text prompt to generate content for
|
|
25
|
-
-m, --model
|
|
26
|
-
-o json
|
|
27
|
-
--json Output JSON response payload
|
|
22
|
+
-m, --model Gemini API model identifier or alias (default: default / gemini-3.5-flash)
|
|
23
|
+
-o, --json Output dynamic JSON response payload
|
|
24
|
+
--json Output dynamic JSON response payload
|
|
28
25
|
-h, --help Show this help information
|
|
29
26
|
`);
|
|
30
27
|
process.exit(0);
|
|
31
28
|
}
|
|
32
29
|
|
|
33
|
-
// Ignored flags for
|
|
30
|
+
// Ignored flags for compat with tr-cli-agents dispatch
|
|
34
31
|
const IGNORED = new Set(['--sandbox=false', '--yolo']);
|
|
35
32
|
|
|
36
33
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -42,7 +39,6 @@ for (let i = 0; i < args.length; i++) {
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
if (!prompt && args.length > 0) {
|
|
45
|
-
// Last non-flag arg is the prompt
|
|
46
42
|
for (let i = args.length - 1; i >= 0; i--) {
|
|
47
43
|
if (!args[i].startsWith('-') && !IGNORED.has(args[i])) { prompt = args[i]; break; }
|
|
48
44
|
}
|
|
@@ -53,50 +49,83 @@ if (!prompt) {
|
|
|
53
49
|
process.exit(1);
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
timeout: 300_000,
|
|
74
|
-
maxBuffer: 10 * 1024 * 1024,
|
|
75
|
-
env: process.env,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
if (result.status !== 0) {
|
|
79
|
-
const err = result.stderr || result.stdout || 'agentapi failed';
|
|
80
|
-
console.error('Error:', err);
|
|
81
|
-
process.exit(1);
|
|
52
|
+
// Load GOOGLE_API_KEY from env or .env files
|
|
53
|
+
if (!process.env.GOOGLE_API_KEY) {
|
|
54
|
+
try {
|
|
55
|
+
let dir = process.cwd();
|
|
56
|
+
while (dir !== path.dirname(dir)) {
|
|
57
|
+
const envPath = path.join(dir, '.env');
|
|
58
|
+
if (fs.existsSync(envPath)) {
|
|
59
|
+
const content = fs.readFileSync(envPath, 'utf8');
|
|
60
|
+
for (const line of content.split('\n')) {
|
|
61
|
+
const match = line.match(/^\s*GOOGLE_API_KEY\s*=\s*(["']?)(.*?)\1\s*$/);
|
|
62
|
+
if (match) { process.env.GOOGLE_API_KEY = match[2]; break; }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (process.env.GOOGLE_API_KEY) break;
|
|
66
|
+
dir = path.dirname(dir);
|
|
67
|
+
}
|
|
68
|
+
} catch {}
|
|
82
69
|
}
|
|
83
70
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
try {
|
|
89
|
-
const parsed = JSON.parse(raw);
|
|
90
|
-
// agentapi returns { response: { conversationId, content } }
|
|
91
|
-
if (parsed.response?.content) text = parsed.response.content;
|
|
92
|
-
else if (parsed.content) text = parsed.content;
|
|
93
|
-
else if (parsed.response) text = typeof parsed.response === 'string' ? parsed.response : JSON.stringify(parsed.response);
|
|
94
|
-
} catch {
|
|
95
|
-
// Not JSON, use raw output
|
|
71
|
+
const apiKey = process.env.GOOGLE_API_KEY || '';
|
|
72
|
+
if (!apiKey) {
|
|
73
|
+
console.error('Error: GOOGLE_API_KEY not set.');
|
|
74
|
+
process.exit(1);
|
|
96
75
|
}
|
|
97
76
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
77
|
+
// Model alias resolution
|
|
78
|
+
const aliases = {
|
|
79
|
+
gemini: 'gemini-3.5-flash', default: 'gemini-3.5-flash',
|
|
80
|
+
flash: 'gemini-3.5-flash', 'gemini-flash': 'gemini-3.5-flash', '3.5-flash': 'gemini-3.5-flash',
|
|
81
|
+
pro: 'gemini-3.1-pro-preview', 'gemini-pro': 'gemini-3.1-pro-preview', '3.1-pro': 'gemini-3.1-pro-preview',
|
|
82
|
+
};
|
|
83
|
+
const resolvedModel = aliases[requestedModel] || requestedModel;
|
|
84
|
+
|
|
85
|
+
async function main() {
|
|
86
|
+
try {
|
|
87
|
+
const url = `https://generativelanguage.googleapis.com/v1beta/models/${resolvedModel}:generateContent?key=${apiKey}`;
|
|
88
|
+
|
|
89
|
+
const res = await fetch(url, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: { 'Content-Type': 'application/json' },
|
|
92
|
+
body: JSON.stringify({
|
|
93
|
+
contents: [{ parts: [{ text: prompt }] }]
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (!res.ok) {
|
|
98
|
+
const errText = await res.text();
|
|
99
|
+
throw new Error(`Gemini API returned status ${res.status}: ${errText}`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const data = await res.json();
|
|
103
|
+
const text = data.candidates?.[0]?.content?.parts?.[0]?.text || '';
|
|
104
|
+
|
|
105
|
+
// Save usage data for budget safety
|
|
106
|
+
try {
|
|
107
|
+
const promptTokens = data.usageMetadata?.promptTokenCount || 0;
|
|
108
|
+
const candidatesTokens = data.usageMetadata?.candidatesTokenCount || 0;
|
|
109
|
+
if (promptTokens > 0 || candidatesTokens > 0) {
|
|
110
|
+
const tmpDir = path.join(os.homedir(), '.gemini', 'tmp', 'antigravity', 'chats');
|
|
111
|
+
if (!fs.existsSync(tmpDir)) fs.mkdirSync(tmpDir, { recursive: true });
|
|
112
|
+
const usageLine = JSON.stringify({
|
|
113
|
+
timestamp: new Date().toISOString(),
|
|
114
|
+
tokens: { input: promptTokens, output: candidatesTokens }
|
|
115
|
+
});
|
|
116
|
+
fs.appendFileSync(path.join(tmpDir, 'usage.jsonl'), usageLine + '\n', 'utf8');
|
|
117
|
+
}
|
|
118
|
+
} catch {}
|
|
119
|
+
|
|
120
|
+
if (outputJson) {
|
|
121
|
+
console.log(JSON.stringify({ response: text }));
|
|
122
|
+
} else {
|
|
123
|
+
console.log(text);
|
|
124
|
+
}
|
|
125
|
+
} catch (err) {
|
|
126
|
+
console.error('Error calling Gemini API:', err.message);
|
|
127
|
+
process.exit(1);
|
|
128
|
+
}
|
|
102
129
|
}
|
|
130
|
+
|
|
131
|
+
main();
|
package/bin/total-recall.mjs
CHANGED
|
@@ -59,6 +59,7 @@ const COMMANDS = {
|
|
|
59
59
|
recall: 'recall.mjs',
|
|
60
60
|
search: 'recall.mjs',
|
|
61
61
|
research: 'research.mjs',
|
|
62
|
+
task: 'task.mjs',
|
|
62
63
|
share: 'share.mjs',
|
|
63
64
|
'generate-pat': 'generate-pat.mjs',
|
|
64
65
|
'hash-password': 'hash-password.mjs',
|
|
@@ -77,6 +78,8 @@ const COMMANDS = {
|
|
|
77
78
|
brain: 'brain.mjs',
|
|
78
79
|
config: 'config.mjs',
|
|
79
80
|
skill: 'skill.mjs',
|
|
81
|
+
secret: 'secret.mjs',
|
|
82
|
+
secrets: 'secret.mjs',
|
|
80
83
|
help: 'help.mjs',
|
|
81
84
|
collab: 'collab.mjs',
|
|
82
85
|
command: 'command.mjs',
|
|
@@ -84,70 +87,42 @@ const COMMANDS = {
|
|
|
84
87
|
};
|
|
85
88
|
function printHelp() {
|
|
86
89
|
console.log(`
|
|
87
|
-
total-recall —
|
|
90
|
+
total-recall — Portable personal memory for any IDE
|
|
88
91
|
|
|
89
92
|
Usage: total-recall <command> [options]
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
init
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
dream
|
|
98
|
-
|
|
99
|
-
daemon <start|stop|status
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
research <command> Manage/query ongoing autonomous research agenda (list, add, show, report, cancel)
|
|
112
|
-
share [url] Share a URL or text snippet to the brain (auto-routes to remember or research)
|
|
113
|
-
config <get|set> Read, write, and toggle UI, security, and budget settings
|
|
114
|
-
skill <command> Manage AI agent skills: find, install, scan, list, remove
|
|
115
|
-
generate-pat Issue a PAT; stores only a hash in keys.jsonl
|
|
116
|
-
hash-password Generate a bcrypt dashboard password hash
|
|
117
|
-
reset-password Reset the dashboard admin password and force a change on login
|
|
118
|
-
compile Alias for rebuild: deterministically rebuild projections
|
|
119
|
-
rebuild [--check] Detect index drift and deterministically rebuild projections
|
|
120
|
-
snapshot Manage fast point-in-time VFS snapshots and rollbacks
|
|
121
|
-
migrate Run backwards-incompatible SSSS schema migrations
|
|
122
|
-
import [--dir <path>] [--force] Import existing AGENTS.md, .cursorrules, CLAUDE.md, etc.
|
|
123
|
-
into the vault (run before compile on first install)
|
|
124
|
-
ingest [--watch] Ingest IDE conversation logs (Claude Code, Codex, Gemini, etc.)
|
|
125
|
-
ingest google-takeout <path> Ingest Google Takeout export data
|
|
126
|
-
export <path> --okf Export memory vault as an OKF-compliant bundle
|
|
127
|
-
connect <client> Configure Cursor, Claude Code, Codex, UltraChat, Gemini, etc.
|
|
128
|
-
sync [--watch] Pull remote brain instructions into the current workspace
|
|
129
|
-
relay <cmd> Local background relay: ship IDE sessions to remote brain
|
|
130
|
-
Commands: start | stop | status | once | install | uninstall
|
|
131
|
-
uninstall Completely uninstall all services, launchd agents, VFS, and shims
|
|
132
|
-
help <topic> Interactive offline documentation, SSSS reference, and system help
|
|
133
|
-
collab Start Express/WebSockets backend & React collab sandbox dev server
|
|
134
|
-
command <create|read|update|remove|list> Manage custom project-local CLI commands
|
|
94
|
+
Core (default product path):
|
|
95
|
+
init [--project] Bootstrap global or project brain + openwiki
|
|
96
|
+
connect <client> Wire IDE / Obsidian / http-api host
|
|
97
|
+
remember / forget Write-path memory (SSSS vault)
|
|
98
|
+
recall Read-path hybrid search
|
|
99
|
+
compile Rebuild instruction surfaces
|
|
100
|
+
dream Memory consolidation cycle
|
|
101
|
+
task <cmd> Enqueue daemon work (open envelope)
|
|
102
|
+
daemon <cmd> Background worker (start|stop|status)
|
|
103
|
+
skill <cmd> Skills registry, deploy, multi-repo sync
|
|
104
|
+
secret <cmd> Secrets store + usage (not the vault)
|
|
105
|
+
brain <cmd> Register / ensure any project brain
|
|
106
|
+
status / doctor Health and diagnostics
|
|
107
|
+
|
|
108
|
+
Optional:
|
|
109
|
+
research, share, ingest, import, export, relay, setup, deploy,
|
|
110
|
+
start, backup, restore, config, map, generate-pat, lint, sync, …
|
|
111
|
+
|
|
112
|
+
Full inventory: docs/reference/CLI_INVENTORY.md
|
|
113
|
+
Default story: init → connect → remember/recall → dream (no LLM required)
|
|
135
114
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
115
|
+
Examples:
|
|
116
|
+
npx total-recall init --project
|
|
117
|
+
npx total-recall connect claude-code
|
|
118
|
+
npx total-recall remember fact "The API uses port 3000."
|
|
119
|
+
npx total-recall dream
|
|
120
|
+
npx total-recall skill track .
|
|
121
|
+
npx total-recall secret list
|
|
142
122
|
|
|
143
123
|
Options:
|
|
144
|
-
--help, -h Show this help
|
|
124
|
+
--help, -h Show this help
|
|
145
125
|
--version, -v Show version
|
|
146
|
-
|
|
147
|
-
Examples:
|
|
148
|
-
npx total-recall deploy
|
|
149
|
-
npx total-recall dream
|
|
150
|
-
npx total-recall daemon status
|
|
151
126
|
`);
|
|
152
127
|
}
|
|
153
128
|
|
package/extension/background.js
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
chrome.storage.local.get(['brainUrl', 'pat']),
|
|
18
18
|
chrome.storage.sync.get([
|
|
19
19
|
'blocklist',
|
|
20
|
-
'captureGranularity'
|
|
20
|
+
'captureGranularity',
|
|
21
|
+
'passiveTracking'
|
|
21
22
|
])
|
|
22
23
|
]);
|
|
23
24
|
const settings = { ...syncSettings, ...localSettings };
|
|
@@ -32,7 +33,10 @@
|
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
// Granularity radio
|
|
35
|
-
|
|
36
|
+
let granularity = settings.captureGranularity || 'minimal';
|
|
37
|
+
if (settings.passiveTracking === false) {
|
|
38
|
+
granularity = 'off';
|
|
39
|
+
}
|
|
36
40
|
const radio = document.querySelector(`input[name="granularity"][value="${granularity}"]`);
|
|
37
41
|
if (radio) radio.checked = true;
|
|
38
42
|
}
|
|
@@ -49,6 +53,7 @@
|
|
|
49
53
|
// Get selected granularity
|
|
50
54
|
const granularityRadio = document.querySelector('input[name="granularity"]:checked');
|
|
51
55
|
const captureGranularity = granularityRadio ? granularityRadio.value : 'minimal';
|
|
56
|
+
const passiveTracking = captureGranularity !== 'off';
|
|
52
57
|
|
|
53
58
|
await chrome.storage.local.set({
|
|
54
59
|
brainUrl: brainUrlInput.value.trim() || 'http://127.0.0.1:3000',
|
|
@@ -57,7 +62,8 @@
|
|
|
57
62
|
await chrome.storage.sync.remove('pat');
|
|
58
63
|
await chrome.storage.sync.set({
|
|
59
64
|
blocklist,
|
|
60
|
-
captureGranularity
|
|
65
|
+
captureGranularity,
|
|
66
|
+
passiveTracking
|
|
61
67
|
});
|
|
62
68
|
|
|
63
69
|
showSaveStatus('Settings saved!', false);
|
|
@@ -558,8 +558,6 @@ Provide helpful analysis grounded on both the user's brain memory and this page
|
|
|
558
558
|
settingsTrackingToggle.addEventListener('change', async () => {
|
|
559
559
|
const passiveTracking = settingsTrackingToggle.checked;
|
|
560
560
|
await chrome.storage.sync.set({ passiveTracking });
|
|
561
|
-
// Signal active preference back to service worker
|
|
562
|
-
chrome.runtime.sendMessage({ type: 'UPDATE_PREFERENCES', passiveTracking });
|
|
563
561
|
showToast(`Passive tracking ${passiveTracking ? 'enabled' : 'disabled'}`);
|
|
564
562
|
});
|
|
565
563
|
|
package/frontend/index.html
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<meta name="description" content="Total Recall —
|
|
7
|
-
<meta name="theme-color" content="#
|
|
6
|
+
<meta name="description" content="Total Recall — portable personal memory for any IDE. Memory explorer, chat, dream consolidation, and system health." />
|
|
7
|
+
<meta name="theme-color" content="#070b14" />
|
|
8
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
9
|
<link rel="manifest" href="/manifest.json" />
|
|
9
10
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
11
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
12
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
12
|
-
<title>Total Recall —
|
|
13
|
+
<title>Total Recall — Portable Memory</title>
|
|
13
14
|
</head>
|
|
14
15
|
<body>
|
|
15
16
|
<div id="root"></div>
|