memroot 0.1.0-alpha.0 → 0.1.0-alpha.3

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 (36) hide show
  1. package/README.md +50 -3
  2. package/dist/index.js +2831 -250
  3. package/dist/plugins/claude/.claude-plugin/plugin.json +2 -2
  4. package/dist/plugins/claude/README.md +8 -4
  5. package/dist/plugins/claude/hooks/hooks.json +10 -0
  6. package/dist/plugins/claude/scripts/capture-worker.mjs +19294 -0
  7. package/dist/plugins/claude/scripts/session-end.mjs +469 -0
  8. package/dist/plugins/claude/scripts/session-start.mjs +372 -53
  9. package/dist/plugins/claude/scripts/status.mjs +152 -12
  10. package/dist/plugins/claude/skills/memroot-memory/SKILL.md +48 -0
  11. package/dist/plugins/claude/skills/memroot-memory/references/save.md +76 -0
  12. package/dist/plugins/claude/skills/memroot-status/SKILL.md +19 -0
  13. package/dist/plugins/codex/.codex-plugin/plugin.json +5 -5
  14. package/dist/plugins/codex/README.md +13 -7
  15. package/dist/plugins/codex/hooks/hooks.json +11 -0
  16. package/dist/plugins/codex/scripts/capture-worker.mjs +19294 -0
  17. package/dist/plugins/codex/scripts/session-end.mjs +469 -0
  18. package/dist/plugins/codex/scripts/session-start.mjs +372 -53
  19. package/dist/plugins/codex/scripts/status.mjs +152 -12
  20. package/dist/plugins/codex/skills/memroot-memory/SKILL.md +48 -0
  21. package/dist/plugins/codex/skills/memroot-memory/references/save.md +76 -0
  22. package/dist/plugins/codex/skills/memroot-status/SKILL.md +20 -0
  23. package/dist/plugins/grok/.claude-plugin/plugin.json +2 -2
  24. package/dist/plugins/grok/README.md +10 -4
  25. package/dist/plugins/grok/hooks/hooks.json +24 -1
  26. package/dist/plugins/grok/scripts/capture-worker.mjs +19294 -0
  27. package/dist/plugins/grok/scripts/session-end.mjs +469 -0
  28. package/dist/plugins/grok/scripts/session-reminder.mjs +275 -0
  29. package/dist/plugins/grok/scripts/status.mjs +152 -12
  30. package/dist/plugins/grok/skills/memroot-memory/SKILL.md +48 -0
  31. package/dist/plugins/grok/skills/memroot-memory/references/save.md +76 -0
  32. package/dist/plugins/grok/skills/memroot-status/SKILL.md +20 -0
  33. package/package.json +13 -4
  34. package/dist/plugins/claude/skills/status/SKILL.md +0 -18
  35. package/dist/plugins/codex/skills/status/SKILL.md +0 -18
  36. package/dist/plugins/grok/skills/status/SKILL.md +0 -18
package/README.md CHANGED
@@ -8,7 +8,7 @@ npx memroot setup
8
8
 
9
9
  Requires Node.js 22 or later on macOS or Linux and an installed agent CLI with native plugin support. The interactive setup detects agent CLIs, lets you select agents, and previews the user-scope installation. Cancel before confirming to leave your files unchanged.
10
10
 
11
- **This is an installer alpha.** The plugins provide integration status and static startup guidance. Cloud sign-in, memory retrieval, session capture, and extraction are not available in this release. Installing a plugin does not connect cloud memory. No credentials or transcripts are collected or uploaded.
11
+ **This is an alpha.** Selecting Codex installs its native plugin and configures `https://api.memroot.dev/mcp` using Codex’s native OAuth sign-in. Follow the browser consent screen to link your production account. No separate `memroot login` is needed for Codex MCP. Repeating setup reuses existing authorization; cancelled sign-in can be resumed by repeating setup. Automatic session capture is opt-in; see [Session capture](#session-capture-opt-in).
12
12
 
13
13
  For scripts:
14
14
 
@@ -17,16 +17,63 @@ npx memroot setup --agent codex --yes
17
17
  npx memroot setup --agent claude --agent grok --yes
18
18
  npx memroot setup --agent codex --yes --dry-run
19
19
  npx memroot doctor
20
+ npx memroot login # browser sign-in; --no-browser prints the URL
21
+ npx memroot status # cloud auth + agent install state
22
+ npx memroot token # fresh access token for agent adapters
23
+ npx memroot capture on # opt in to session-end memory capture
24
+ npx memroot capture status
25
+ npx memroot capture off
26
+ npx memroot logout
20
27
  ```
21
28
 
29
+ The refresh token is stored only in the OS credential store (macOS Keychain via `security`, libsecret via `secret-tool` on Linux); sign-in fails closed when neither is available. Non-secret settings live in `~/.memroot/config.json`. `MEMROOT_API_BASE` or `--api-base` override the default `https://api.memroot.dev`; `--env dev` targets a local API stub on `localhost:8787`.
30
+
22
31
  Agent values are `claude`, `codex`, and `grok`. `--agent` can be repeated. `--yes` requires explicit agents. `--dry-run` prints planned commands without running an agent CLI or writing files.
23
32
 
24
- Plugin files live under `$XDG_DATA_HOME/memroot`, defaulting to `~/.local/share/memroot`, independently of the npm cache. Setup delegates registration and installation to each agent's native plugin manager and keeps a separate success receipt for each agent. It preserves unrelated config and refuses conflicting marketplaces, modified managed files, and disabled installed plugins. Repeating setup verifies files and repairs a missing native installation. Native enablement and hook execution trust stay under the agent's control. Grok setup uses its native `--trust` flag to authorize the selected local Memroot plugin; this alpha has no Grok lifecycle hooks.
33
+ Plugin files live under `$XDG_DATA_HOME/memroot`, defaulting to `~/.local/share/memroot`, independently of the npm cache. Setup delegates registration and installation to each agent's native plugin manager and keeps a separate success receipt for each agent. It preserves unrelated config and refuses conflicting marketplaces, modified managed files, and disabled installed plugins. Repeating setup verifies files and repairs a missing native installation. Native enablement and hook execution trust stay under the agent's control. Grok setup uses its native `--trust` flag to authorize the selected local Memroot plugin; its hooks are PostToolUse (a one-time session reminder) and SessionEnd. It also registers `https://api.memroot.dev/mcp` with `grok mcp add` at user scope; authorize it once inside Grok with `/mcps` (select memroot, press `i`). Grok runs the OAuth sign-in and keeps the credentials in its own store; Memroot setup never reads or copies them, and it preserves an existing `memroot` entry that differs. `grok mcp remove memroot` removes the registration.
34
+
35
+ When upgrading Codex from a verified older Memroot release, setup replaces only its managed `memroot` marketplace through Codex's native remove/add commands, then installs the new plugin. The previous files and receipt remain available until installation succeeds; rerunning setup resumes an interrupted upgrade. Native MCP authorization is independent and is reused when already configured and authorized.
25
36
 
26
37
  `doctor` checks managed file integrity and native plugin presence. Restart your coding agent after setup. Use the installed Memroot status skill to inspect release capabilities.
27
38
 
28
39
  If an agent command fails, update that agent and inspect its `plugin --help`. Native plugin managers may partially register a marketplace before installation fails; setup writes no success receipt for that attempt. Retry after resolving the native error. Installation is serialized by a lock; after an interrupted process, verify no setup is running before removing the `.setup-lock` directory named by the error.
29
40
 
30
- To remove the integration, use the agent's native plugin manager. This release deliberately does not remove native config or managed files automatically. Windows installation is not supported in this alpha.
41
+ To remove the plugin, use the agent's native plugin manager. Codex's `memroot` MCP registration is separate: uninstalling the plugin leaves that server and its account access in place. To disconnect production access, revoke the corresponding Codex connection in [Memroot Console](https://console.memroot.dev), then deauthenticate and remove the native MCP registration:
42
+
43
+ ```sh
44
+ codex mcp logout memroot
45
+ codex mcp remove memroot
46
+ ```
47
+
48
+ `logout` deauthenticates the named MCP server; `remove` deletes its native configuration. Neither plugin removal nor local credential removal should be treated as proof that the production grant is revoked; verify its revoked state in the console. `memroot logout` removes the separate Memroot CLI credentials and does not disconnect Codex's independently stored MCP authorization. This release does not remove native config or managed files automatically. Windows installation is not supported in this alpha.
49
+
50
+ ## Session capture (opt-in)
51
+
52
+ Session capture saves durable engineering knowledge (decisions, conventions, root causes, failed approaches, procedures) after a coding session ends. It is off until you enable it; installing the plugins is not consent.
53
+
54
+ ```sh
55
+ npx memroot capture on [--agent claude --agent codex --agent grok] [--allow-cross-agent-extraction] [--yes] [--no-browser]
56
+ npx memroot capture status
57
+ npx memroot capture off
58
+ ```
59
+
60
+ `capture on` prints the disclosure and asks for confirmation (`--yes` in scripts), then authorizes a separate **Memroot CLI** capture connection in the browser (an MCP grant for the `memroot-cli` client whose refresh token is stored in the OS credential store as `<api base>#mcp`), verifies it with `connection_status`, and records your choice in `~/.memroot/capture.json` (0600). Interactive `setup` offers the same step with default **No**; `setup --capture` and `setup --no-capture` script it, and setup without either flag leaves consent unchanged.
61
+
62
+ What happens, all inside the installed plugin (no `npx`, no network from hooks):
63
+
64
+ - **SessionEnd hook** (Claude Code and Codex alongside the existing SessionStart hook; Grok alongside its PostToolUse session reminder) reads only the small stdin envelope, writes a job file under `$XDG_STATE_HOME/memroot/capture` (default `~/.local/state/memroot/capture`, directories 0700, files 0600) and starts a detached background worker. It never opens the transcript and returns in about 25 ms.
65
+ - **Worker** reads only the referenced session transcript, keeps user and assistant text plus tool names and file paths (never tool output), removes secrets, personal email addresses and home paths locally (fail closed), and runs **your own agent CLI headless with no tools** (`claude -p`, `codex exec --ephemeral`, or `grok` headless) on at most 48,000 characters to propose memories. This spends your agent subscription or API quota and sends the redacted excerpt to that agent's model provider. Another agent's CLI is used only with `--allow-cross-agent-extraction`.
66
+ - **Upload**: candidates are validated locally (exact evidence quotes, injection filter, a second redaction pass, the shared contract). Only typed memories are sent to `https://api.memroot.dev/mcp`, labeled **session-extracted (not user-attested)** with confidence at most 0.7. Each memory carries repo-relative paths and symbols it mentions, up to 3 short evidence quotes (at most 200 characters each) from the redacted transcript, your repository identity (normalized git remote), a salted hash of the session id, salted hashes of the quoted segments, and the extractor name, prompt version and model. Before extracting, the worker sends one retrieval query containing only the repository name to avoid duplicates. Raw transcripts are never uploaded. At most 3 memories per session and 10 per rolling 24 hours; each is one write against your plan quota.
67
+ - **Stopping**: `memroot capture off` disables capture and deletes queued work (an in-progress run stops before uploading); revoking "Memroot CLI" in [Memroot Console](https://console.memroot.dev) or `memroot logout` stops uploads.
68
+
69
+ Codex skips plugin hooks until you trust them: open `/hooks` in Codex and trust the Memroot SessionStart and SessionEnd hooks. `memroot capture status` reports the trust state, Claude Code's `disableAllHooks`, queued jobs, the last worker run and which agent CLIs are on PATH. Logs contain only hashes, counts, durations and error codes.
31
70
 
32
71
  [Memroot](https://memroot.dev)
72
+
73
+ Codex setup reports plugin installation, MCP configuration and OAuth authorization separately. It always reports memory verification as not verified: only a successful tool round trip can prove persistence. Restart Codex, ask it to call Memroot `connection_status`, then explicitly ask it to save a small test memory. Open a fresh Codex session and ask it to retrieve that memory. Inspect the connection and memory in [Memroot Console](https://console.memroot.dev).
74
+
75
+ Codex owns its MCP credentials; Memroot setup never reads or copies them. Setup preserves conflicting endpoints, disabled servers, unrelated MCP entries, and unknown auth states. A failed inspection does not trigger replacement authorization. Use Codex's native MCP management to resolve a conflict. `memroot status` and `doctor` inspect current native MCP status without requesting new grants.
76
+
77
+ Legacy non-secret prototype config is backed up once to `~/.memroot/config.json.legacy-backup` with owner-only permissions before an atomic reset to the current schema. Old user IDs and email addresses are not proof of identity and are never imported as authenticated accounts. Credentials and unsafe remote URLs cause migration to stop with the original intact. Unknown non-secret fields remain in the protected backup. Separate CLI sign-in retains its OS credential-store behavior described above.
78
+
79
+ Codex command support rechecked 2026-09-26 against [official MCP documentation](https://developers.openai.com/codex/mcp) and installed Codex 0.157.1. A deployment supporting these tools is required; setup alone does not verify deployment health.