memorix 1.2.1 → 1.2.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 (90) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +14 -2
  3. package/README.zh-CN.md +14 -2
  4. package/dist/cli/index.js +15424 -13780
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/index.js +1337 -536
  7. package/dist/index.js.map +1 -1
  8. package/dist/maintenance-runner.d.ts +1 -1
  9. package/dist/maintenance-runner.js +8458 -8087
  10. package/dist/maintenance-runner.js.map +1 -1
  11. package/dist/memcode-runtime/CHANGELOG.md +23 -0
  12. package/dist/sdk.d.ts +7 -2
  13. package/dist/sdk.js +1365 -542
  14. package/dist/sdk.js.map +1 -1
  15. package/dist/types.d.ts +49 -1
  16. package/dist/types.js.map +1 -1
  17. package/docs/1.2.2-MEMORY-CONTROL-PLANE.md +434 -0
  18. package/docs/AGENT_OPERATOR_PLAYBOOK.md +4 -0
  19. package/docs/API_REFERENCE.md +24 -4
  20. package/docs/README.md +1 -1
  21. package/docs/dev-log/progress.txt +101 -11
  22. package/package.json +1 -1
  23. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  24. package/src/cli/command-guide.ts +192 -0
  25. package/src/cli/commands/audit.ts +9 -4
  26. package/src/cli/commands/cleanup.ts +5 -1
  27. package/src/cli/commands/codegraph.ts +15 -5
  28. package/src/cli/commands/context.ts +3 -2
  29. package/src/cli/commands/doctor.ts +4 -2
  30. package/src/cli/commands/explain.ts +9 -3
  31. package/src/cli/commands/handoff.ts +21 -7
  32. package/src/cli/commands/identity.ts +116 -0
  33. package/src/cli/commands/ingest-image.ts +5 -3
  34. package/src/cli/commands/lock.ts +11 -10
  35. package/src/cli/commands/memory.ts +58 -21
  36. package/src/cli/commands/message.ts +19 -14
  37. package/src/cli/commands/operator-shared.ts +98 -3
  38. package/src/cli/commands/poll.ts +16 -6
  39. package/src/cli/commands/reasoning.ts +17 -3
  40. package/src/cli/commands/retention.ts +9 -4
  41. package/src/cli/commands/serve-http.ts +8 -2
  42. package/src/cli/commands/session.ts +44 -10
  43. package/src/cli/commands/skills.ts +10 -5
  44. package/src/cli/commands/status.ts +4 -3
  45. package/src/cli/commands/task.ts +26 -17
  46. package/src/cli/commands/team.ts +14 -10
  47. package/src/cli/commands/transfer.ts +63 -10
  48. package/src/cli/identity.ts +89 -0
  49. package/src/cli/index.ts +96 -19
  50. package/src/cli/invocation.ts +115 -0
  51. package/src/cli/tui/chat-service.ts +41 -18
  52. package/src/cli/tui/data.ts +23 -44
  53. package/src/cli/tui/operator-context.ts +60 -0
  54. package/src/cli/tui/session-service.ts +3 -2
  55. package/src/cli/tui/views/MemoryView.tsx +10 -8
  56. package/src/codegraph/auto-context.ts +31 -2
  57. package/src/codegraph/context-pack.ts +1 -0
  58. package/src/codegraph/project-context.ts +2 -0
  59. package/src/compact/engine.ts +26 -10
  60. package/src/compact/index-format.ts +25 -2
  61. package/src/dashboard/server.ts +46 -9
  62. package/src/hooks/admission.ts +117 -0
  63. package/src/hooks/handler.ts +98 -91
  64. package/src/knowledge/context-assembly.ts +97 -0
  65. package/src/knowledge/workset.ts +179 -10
  66. package/src/memory/admission.ts +57 -0
  67. package/src/memory/consolidation.ts +13 -2
  68. package/src/memory/disclosure-policy.ts +6 -1
  69. package/src/memory/export-import.ts +11 -3
  70. package/src/memory/graph-context.ts +8 -2
  71. package/src/memory/observations.ts +162 -4
  72. package/src/memory/quality-audit.ts +2 -0
  73. package/src/memory/retention.ts +22 -2
  74. package/src/memory/session.ts +29 -11
  75. package/src/memory/visibility.ts +80 -0
  76. package/src/orchestrate/memorix-bridge.ts +38 -0
  77. package/src/runtime/control-plane-maintenance.ts +1 -0
  78. package/src/runtime/isolated-maintenance.ts +1 -0
  79. package/src/runtime/lifecycle.ts +18 -0
  80. package/src/runtime/maintenance-jobs.ts +1 -0
  81. package/src/runtime/maintenance-runner.ts +2 -0
  82. package/src/runtime/project-maintenance.ts +89 -0
  83. package/src/sdk.ts +35 -5
  84. package/src/server.ts +267 -83
  85. package/src/store/orama-store.ts +61 -6
  86. package/src/store/sqlite-db.ts +23 -1
  87. package/src/store/sqlite-store.ts +12 -2
  88. package/src/team/handoff.ts +7 -0
  89. package/src/types.ts +51 -0
  90. package/src/wiki/generator.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.2.3] - 2026-07-25
6
+
7
+ ### Fixed
8
+ - **Session context now respects observation visibility** -- Automatic session handoff and manual session-context reads in the CLI, MCP server, and Workbench apply the caller's project, team, and personal-memory reader. A new identity cannot receive another agent's personal observations through session startup.
9
+ - **Identity before handoff** -- CLI and MCP coordination sessions establish their explicit identity before assembling prior context, so an owner's own personal records remain available while a newly joined agent fails closed.
10
+ - **Graph-side disclosure guard** -- Agent-facing session handoff no longer derives graph-neighbor hints from graph relations that do not yet carry observation visibility metadata.
11
+
12
+ ## [1.2.2] - 2026-07-25
13
+
14
+ ### Added
15
+ - **Direct CLI control plane** -- Added a consistent terminal surface for memory, context, Code State, knowledge, coordination, audit, and transfer work. `--cwd` selects the Git project from any shell, `memorix workbench` explicitly opens the interactive terminal UI, and every action group now has task-oriented help.
16
+ - **Explicit local CLI identity** -- Added `memorix identity status|join|use|clear`. A user can deliberately activate one project coordination identity for personal/team memory and task, message, lock, handoff, and poll commands without needing an MCP connection.
17
+ - **Automation-friendly transfer** -- Memory exports can write directly to a file, and imports accept `--file` or `--stdin` as well as existing inline JSON.
18
+
19
+ ### Changed
20
+ - **One visibility reader across terminal surfaces** -- CLI commands, Workbench search, recents, health, graph, knowledge, and chat now resolve the same project/actor reader. An unbound terminal remains project-scoped by default.
21
+ - **CLI ergonomics** -- Root `search`, `remember`, and `recent` aliases now use the canonical memory commands; kebab-case flags are accepted alongside the existing camelCase forms.
22
+
23
+ ### Fixed
24
+ - **Private evidence cannot become public indirectly** -- Personal and team observations are rejected when promoting shared skills or generating project skills.
25
+ - **TUI visibility mismatch** -- The interactive terminal UI no longer falls back to an unbound reader after an explicit local identity has been activated.
26
+ - **Transfer visibility bypass** -- CLI and MCP exports now include only observations readable by the current caller, rather than exporting personal/team records from the same project by default.
27
+
5
28
  ## [1.2.1] - 2026-07-19
6
29
 
7
30
  ### Added
package/README.md CHANGED
@@ -317,14 +317,25 @@ npm uninstall -g memorix
317
317
  ### Work from the CLI
318
318
 
319
319
  ```bash
320
- memorix context --task "continue release blocker"
320
+ memorix --cwd /path/to/repo context --task "continue release blocker"
321
321
  memorix memory search --query "release blocker"
322
+ memorix memory --help
323
+
324
+ # Optional: activate one local agent identity for personal/team records and coordination.
325
+ memorix identity join --agent-type codex --name codex-main
326
+ memorix memory store --text "private investigation note" --visibility personal
327
+ memorix task create --description "verify the release package"
328
+
329
+ memorix transfer export --format json --out ./.memorix-export.json
330
+ memorix transfer import --file ./.memorix-export.json
322
331
  memorix reasoning search --query "why sqlite"
323
332
  memorix git-hook --force
324
333
  memorix ingest log --count 20
325
- memorix dashboard
334
+ memorix workbench
326
335
  ```
327
336
 
337
+ The CLI is direct and does not depend on an MCP session. It binds to the current Git project, or to the project supplied with `--cwd`. Without an active identity it reads, writes, and exports project-visible memory only. Use `memorix identity join` or `memorix identity use --agent-id <id>` only when you intentionally need personal/team memory or coordinated task actions; `memorix identity clear` returns the terminal to project scope. `--as <active-agent-id>` is the one-command alternative for scripts. Both camelCase and kebab-case flags are accepted.
338
+
328
339
  ### Use the bundled terminal agent
329
340
 
330
341
  ```bash
@@ -358,6 +369,7 @@ Search is project-scoped by default. `scope="global"` searches across projects.
358
369
  | Run shared HTTP MCP plus dashboard | `memorix background start` |
359
370
  | Debug HTTP MCP in the foreground | `memorix serve-http --port 3211` |
360
371
  | Inspect or manage memory directly | `memorix memory`, `memorix reasoning`, `memorix session`, `memorix ingest` |
372
+ | Use the interactive terminal memory control plane | `memorix workbench` |
361
373
  | Use the bundled terminal agent | `memorix` or `memcode` |
362
374
  | Run orchestrated subagent work | `memorix orchestrate --goal "..."` |
363
375
 
package/README.zh-CN.md CHANGED
@@ -317,14 +317,25 @@ npm uninstall -g memorix
317
317
  ### 从 CLI 管理记忆
318
318
 
319
319
  ```bash
320
- memorix context --task "continue release blocker"
320
+ memorix --cwd /path/to/repo context --task "继续处理发布阻塞问题"
321
321
  memorix memory search --query "release blocker"
322
+ memorix memory --help
323
+
324
+ # 可选:只在需要个人/团队记忆或协同时激活本地身份。
325
+ memorix identity join --agent-type codex --name codex-main
326
+ memorix memory store --text "个人排查笔记" --visibility personal
327
+ memorix task create --description "验证发布包"
328
+
329
+ memorix transfer export --format json --out ./.memorix-export.json
330
+ memorix transfer import --file ./.memorix-export.json
322
331
  memorix reasoning search --query "why sqlite"
323
332
  memorix git-hook --force
324
333
  memorix ingest log --count 20
325
- memorix dashboard
334
+ memorix workbench
326
335
  ```
327
336
 
337
+ CLI 是直接入口,不依赖 MCP 会话。它默认绑定当前 Git 项目,也可以用 `--cwd` 指定项目。没有激活身份时,只会读写和导出项目公开记忆;只有明确需要个人/团队记忆或协同任务时,才运行 `memorix identity join` 或 `memorix identity use --agent-id <id>`。`memorix identity clear` 会回到项目公开范围;脚本可用一次性的 `--as <active-agent-id>`。已有 camelCase 参数仍兼容,kebab-case 也可直接使用。
338
+
328
339
  ### 使用内置终端 Agent
329
340
 
330
341
  ```bash
@@ -358,6 +369,7 @@ memcode
358
369
  | 启动共享 HTTP MCP 和 Dashboard | `memorix background start` |
359
370
  | 前台调试 HTTP MCP | `memorix serve-http --port 3211` |
360
371
  | 直接检查或管理记忆 | `memorix memory`、`memorix reasoning`、`memorix session`、`memorix ingest` |
372
+ | 使用交互式终端记忆控制台 | `memorix workbench` |
361
373
  | 使用内置终端 Agent | `memorix` 或 `memcode` |
362
374
  | 运行编排式 subagent 工作 | `memorix orchestrate --goal "..."` |
363
375