memorix 1.1.11 → 1.1.13

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.
@@ -236,7 +236,7 @@ memorix setup --agent omp --global
236
236
  What this installs depends on the target agent:
237
237
 
238
238
  - Claude Code: local `memorix-local` marketplace plugin, best-effort `claude plugin install memorix@memorix-local`, plugin-bundled stdio MCP, hooks, skills, plus `CLAUDE.md` guidance.
239
- - Codex: local Personal marketplace plugin under `~/.codex/plugins/memorix`, marketplace entry at `~/.agents/plugins/marketplace.json`, best-effort `codex plugin add memorix@personal`, plugin-bundled stdio MCP, hooks, skills, plus `AGENTS.md` guidance.
239
+ - Codex: local Personal marketplace plugin under `~/.codex/plugins/memorix`, marketplace entry at `~/.agents/plugins/marketplace.json`, best-effort `codex plugin add memorix@personal`, plugin-bundled stdio MCP, skills, and `SessionStart` / `UserPromptSubmit` / `PostToolUse` / `PreCompact` / `Stop` hooks, plus `AGENTS.md` guidance. Codex asks the user to review plugin hooks once in `/hooks` before non-managed hooks run.
240
240
  - GitHub Copilot CLI: local plugin package under `~/.copilot/plugins/local/memorix`, best-effort `copilot plugin install <local-path>`, plugin-bundled stdio MCP, hooks, and skills.
241
241
  - Cursor: Cursor MCP config, `.cursor/rules/memorix.mdc`, skills, and hook guidance through Cursor's project config surfaces.
242
242
  - Pi: user Pi package with extension-based hook capture and a Memorix skill, registered through `pi install <path> --approve`; project-local setup uses `-l`.
@@ -661,7 +661,7 @@ If it reports stale MCP command paths, missing `memorix` MCP entries, missing Cl
661
661
  memorix repair agents --agent <agent>
662
662
  ```
663
663
 
664
- Repair only rewrites Memorix-owned MCP entries and Memorix-owned guidance blocks. It should not edit unrelated user config.
664
+ Repair only rewrites Memorix-owned MCP entries, Memorix-owned guidance blocks, and an explicitly targeted Codex Memorix plugin bundle. It does not edit unrelated user config or turn on a user-disabled Codex plugin; enable that one from `/plugins`.
665
665
 
666
666
  ### 1. Is the workspace a Git repo?
667
667
 
@@ -300,32 +300,25 @@ is intentional after reviewing the diff, rerun with
300
300
  - dashboard
301
301
  - Git Memory
302
302
  - config diagnostics
303
+ - `memorix setup --agent codex --global` followed by `memorix doctor agents --agent codex --scope global --json` in an isolated home, when changing the Codex integration
303
304
 
304
305
  4. inspect package contents:
305
306
 
306
307
  ```bash
307
308
  npm pack --dry-run --json
308
- npm pack --workspace @memorix/ai --dry-run --json
309
- npm pack --workspace @memorix/agent-core --dry-run --json
310
- npm pack --workspace @memorix/tui --dry-run --json
311
- npm pack --workspace @memorix/memcode --dry-run --json
312
309
  ```
313
310
 
314
311
  5. commit and push
315
- 6. publish manually when ready, in dependency order:
312
+ 6. publish the supported public package manually when ready:
316
313
 
317
314
  ```bash
318
- npm publish --workspace @memorix/ai --access public
319
- npm publish --workspace @memorix/agent-core --access public
320
- npm publish --workspace @memorix/tui --access public
321
- npm publish --workspace @memorix/memcode --access public
322
315
  npm publish --access public
323
316
  ```
324
317
 
325
318
  Notes:
326
319
 
327
320
  - `prepublishOnly` runs build + test, but does not contact live model catalog APIs
328
- - `memorix` depends on `@memorix/memcode`; `@memorix/memcode` depends on `@memorix/ai`, `@memorix/agent-core`, and `@memorix/tui`, so publish workspaces before the root package
321
+ - `@memorix/ai`, `@memorix/agent-core`, `@memorix/tui`, and `@memorix/memcode` are internal workspaces. Their code is bundled into the root `memorix` distribution and they must stay `private` unless the project deliberately establishes an owned npm scope and a separate package-support contract.
329
322
  - npm publish is usually manual, especially when 2FA is enabled
330
323
  - GitHub release automation should not be treated as a substitute for manual runtime validation
331
324
 
@@ -49,7 +49,7 @@ Generated guidance also has scope:
49
49
  | Agent | Recommended install | Official entry | What gets installed | Notes |
50
50
  | --- | --- | --- | --- | --- |
51
51
  | Claude Code | `memorix setup --agent claude --global` | Claude Code plugin marketplace | Local `memorix-local` marketplace, plugin-bundled stdio MCP, skills, hooks, plus `CLAUDE.md` guidance | Setup attempts `claude plugin marketplace add` and `claude plugin install memorix@memorix-local`. |
52
- | Codex | `memorix setup --agent codex --global` | Codex Personal marketplace plugin | Local plugin under `~/.codex/plugins/memorix`, Personal marketplace entry, plugin-bundled stdio MCP, skills, hooks, plus `AGENTS.md` guidance | Setup attempts `codex plugin add memorix@personal`. |
52
+ | Codex | `memorix setup --agent codex --global` | Codex Personal marketplace plugin | Local plugin under `~/.codex/plugins/memorix`, Personal marketplace entry, plugin-bundled stdio MCP, skills, hooks, plus `AGENTS.md` guidance | Setup attempts `codex plugin add memorix@personal`. Run `memorix doctor agents --agent codex --scope global` to verify the bundle, marketplace, enabled state, and five declared/trusted hooks; start a new thread after setup. |
53
53
  | GitHub Copilot CLI | `memorix setup --agent copilot --global` | Copilot CLI plugin package | Local plugin under `~/.copilot/plugins/local/memorix` with MCP, skills, and hooks | Setup attempts `copilot plugin install <local-path>` when Copilot CLI is available. |
54
54
  | Cursor | `memorix setup --agent cursor --global` | Cursor MCP and rules config | Cursor MCP config, `.cursor/rules/memorix.mdc`, skills, and hook guidance | Reload Cursor after setup so it can pick up project config changes. |
55
55
  | Gemini CLI | `memorix setup --agent gemini-cli --global` | Gemini CLI extension | Extension under `~/.gemini/extensions/memorix` with MCP, `GEMINI.md` context, hooks, commands, and skills | Antigravity CLI has an official Gemini CLI migration path, but Gemini CLI remains an active standalone Google CLI target. |
package/docs/SETUP.md CHANGED
@@ -132,7 +132,9 @@ memorix doctor agents --agent <agent>
132
132
  memorix repair agents --agent <agent>
133
133
  ```
134
134
 
135
- The doctor checks Memorix-owned MCP entries and guidance files for stale command paths, missing `memorix` MCP servers, missing Claude `alwaysLoad`, and outdated Memory Autopilot rules.
135
+ The doctor checks Memorix-owned MCP entries and guidance files for stale command paths, missing `memorix` MCP servers, missing Claude `alwaysLoad`, and outdated Memory Autopilot rules. For `codex --scope global`, it also checks the local plugin bundle, Personal marketplace entry, five declared lifecycle hooks, Codex's trusted hook state, and the installed/enabled state reported by `codex plugin list`.
136
+
137
+ After Codex setup, start a new thread so enabled plugins can load. Codex does not expose a command that proves hooks are already active inside the current thread. If doctor reports `codex-plugin-disabled`, open `/plugins` and turn Memorix on there; repair does not toggle a user-disabled plugin.
136
138
 
137
139
  ### Option B: manual stdio MCP
138
140
 
@@ -4,62 +4,43 @@
4
4
  > older notes when they conflict.
5
5
 
6
6
  ## Current State
7
- - Phase: 1.1.11 runtime integrity, release-ready pending branch promotion
8
- - Branch: `codex/1.1.11-runtime-integrity`
9
- - Last updated: 2026-07-16
10
- - Goal: make normal memory writes, first-turn context, Code Memory refresh,
11
- lifecycle maintenance, and operator diagnostics predictable as data grows.
7
+ - Phase: 1.1.13 ready to publish
8
+ - Branch: `codex/1.1.13-release-contract`
9
+ - Last updated: 2026-07-17
10
+ - Goal: make Codex global setup diagnosable end to end, remove the accidental
11
+ workspace publish lane, restore the Star History chart, then publish a clean
12
+ 1.1.13 before beginning 1.2 work.
12
13
 
13
14
  ## Completed Recently
14
- - Replaced normal observation write/cleanup full-table persistence with targeted
15
- SQLite mutations while preserving topic-key and generation safety.
16
- - Made retention and consolidation project-scoped, bounded, cursor-resumable
17
- maintenance jobs.
18
- - Added a durable SQLite maintenance queue with leases, retries, heartbeat
19
- renewal, credential-redacted failure records, and completed-history pruning.
20
- - Added a real compiled child-process runner for retention, consolidation, and
21
- Code Memory refresh; vector recovery remains in the owning Orama process.
22
- - Made CodeGraph Lite incremental, multi-language, dependency-aware, and safe
23
- against oversized generated files. `codegraph.max_file_bytes` / TOML
24
- `max_file_bytes` controls the per-file limit.
25
- - Let the project context, context pack, graph context, and Code Memory status
26
- tools answer directly from project-scoped SQLite before full Orama hydration.
27
- - Added control-plane maintenance target registration and dashboard maintenance
28
- diagnostics without crossing HTTP session runtime state.
29
- - Removed the obsolete JSON file watcher; SQLite generation checks now own
30
- cross-process freshness.
31
- - Unified behavior settings with resolved TOML/YAML configuration so injection,
32
- formation, auto-cleanup, and sync advisory do not silently fall back to a
33
- separate legacy JSON path.
34
- - Updated dashboard System Status with maintenance state and made dashboard
35
- navigation/content work on a 390px mobile viewport.
36
- - Added a non-root Docker regression check.
37
- - Made completed-job pruning part of the enqueue transaction, so a failed
38
- enqueue cannot leave partially-pruned operator history behind.
15
+ - Released `memorix@1.1.12`, tagged `v1.1.12`, with native Codex lifecycle
16
+ hooks, Windows-safe OpenCode hook resolution, scope-isolated setup, and
17
+ cache-first semantic-vector hydration.
18
+ - `memorix setup --agent codex --global` now stamps the copied plugin manifest
19
+ with the running Memorix version instead of leaving the template version.
20
+ - `memorix doctor agents --agent codex --scope global` now reports four
21
+ independently useful facts: the local bundle and declared hook contract, the
22
+ Personal marketplace entry, Codex's installed/enabled plugin state, and the
23
+ trusted state for each Codex lifecycle hook.
24
+ - Repair only refreshes Memorix-owned files. A disabled plugin or untrusted
25
+ hook remains an explicit user action in Codex's plugin/hook UI.
26
+ - `@memorix/ai`, `@memorix/agent-core`, `@memorix/tui`, and
27
+ `@memorix/memcode` are explicitly internal workspaces. The public release
28
+ contract is the bundled root `memorix` package.
29
+ - Restored the AVIDS2/memorix Star History chart at the bottom of both READMEs.
39
30
 
40
31
  ## Verification Snapshot
41
- - The full test suite passes, including runtime, CodeGraph, configuration,
42
- server, dashboard, Docker, and cross-process freshness coverage.
43
- - `npm run lint` passes.
44
- - `npm run build` passes and emits `dist/maintenance-runner.js`.
45
- - Built runner smoke completed a real retention job through stdin/stdout.
46
- - Built stdio MCP smoke connected in about one second, listed 17 lite tools,
47
- and called project context, context pack, graph context, and Code Memory
48
- status successfully in a fresh temporary Git project.
49
- - Dashboard was checked in a real browser at 1440x900 and 390x844; maintenance
50
- status is visible and no text is clipped by the mobile layout.
51
- - `npm pack --dry-run`, an actual `npm pack`, a clean temporary install, and a
52
- built stdio MCP smoke all pass. Production dependency audit reports zero
53
- vulnerabilities.
54
- - A read-only local Claude Code release review found no P0 issues; its one
55
- confirmed queue transaction finding has a regression test and is fixed.
56
-
57
- ## Known Boundary
58
- - Orama remains process-local. Search and stateful write/session tools still
59
- wait for full runtime hydration; bootstrap-safe context tools do not.
60
- - CodeGraph Lite is an incremental local structural map, not a replacement for
61
- an AST/language-server intelligence product.
32
+ - Focused Codex setup, hook, doctor, and release-contract regressions pass.
33
+ - `npm run lint`, `npm run build`, and the full serial `npm test` suite pass.
34
+ - `npm pack --dry-run` includes the root runtime, plugin templates, hooks,
35
+ READMEs, and docs at `memorix@1.1.13`.
36
+ - A clean normal npm installation of the tarball completed a real stdio MCP
37
+ store/search call against an isolated Git repository and exposed the expected
38
+ seven-tool micro profile.
39
+ - An isolated real Codex CLI setup installed and enabled `memorix@personal`,
40
+ stamped the manifest at `1.1.13`, and let doctor verify the bundle,
41
+ marketplace, runtime state, and pending first-use hook trust separately.
42
+ - The Star History embed uses Star History's current `/image` README endpoint.
62
43
 
63
44
  ## Next Steps
64
- - Commit the verified 1.1.11 change set, promote it through the normal `main`
65
- branch flow, tag `v1.1.11`, and publish the already-verified npm package.
45
+ - Push/merge/tag/publish `v1.1.13`, then create the 1.2 development baseline
46
+ from the released main branch.
@@ -9,17 +9,17 @@
9
9
 
10
10
  ### 事件映射表
11
11
 
12
- | 语义 | VS Code Copilot | Claude Code | Windsurf | Cursor (Beta) | Kiro |
13
- |------|----------------|-------------|----------|---------------|------|
14
- | 会话开始 | SessionStart | SessionStart | — | — | — |
15
- | 用户输入 | UserPromptSubmit | UserPromptSubmit | pre_user_prompt | beforeSubmitPrompt | user prompt |
16
- | 工具调用前 | PreToolUse | PreToolUse | pre_mcp_tool_use | beforeMCPExecution | — |
17
- | 工具调用后 | PostToolUse | PostToolUse | post_mcp_tool_use | — | — |
18
- | 文件编辑后 | PostToolUse(write) | PostToolUse(write) | post_write_code | afterFileEdit | file save |
19
- | 命令执行后 | PostToolUse(cmd) | PostToolUse(cmd) | post_run_command | — | — |
20
- | AI 回复后 | — | — | post_cascade_response | — | agent turn |
21
- | 上下文压缩前 | PreCompact | PreCompact | — | — | — |
22
- | 会话结束 | Stop | Stop | — | stop | — |
12
+ | 语义 | VS Code Copilot | Claude Code | Codex | Windsurf | Cursor (Beta) | Kiro |
13
+ |------|----------------|-------------|-------|----------|---------------|------|
14
+ | 会话开始 | SessionStart | SessionStart | SessionStart | — | — | — |
15
+ | 用户输入 | UserPromptSubmit | UserPromptSubmit | UserPromptSubmit | pre_user_prompt | beforeSubmitPrompt | user prompt |
16
+ | 工具调用前 | PreToolUse | PreToolUse | — | pre_mcp_tool_use | beforeMCPExecution | — |
17
+ | 工具调用后 | PostToolUse | PostToolUse | PostToolUse | post_mcp_tool_use | — | — |
18
+ | 文件编辑后 | PostToolUse(write) | PostToolUse(write) | PostToolUse(apply_patch) | post_write_code | afterFileEdit | file save |
19
+ | 命令执行后 | PostToolUse(cmd) | PostToolUse(cmd) | PostToolUse(Bash) | post_run_command | — | — |
20
+ | AI 回复后 | — | — | Stop | post_cascade_response | — | agent turn |
21
+ | 上下文压缩前 | PreCompact | PreCompact | PreCompact | — | — | — |
22
+ | 会话结束 | Stop | Stop | Stop | — | stop | — |
23
23
 
24
24
  ### 配置文件位置
25
25
 
@@ -27,6 +27,7 @@
27
27
  |-------|---------|------|
28
28
  | VS Code Copilot | `.github/hooks/*.json` | Claude Code 兼容 |
29
29
  | Claude Code | `.claude/settings.json` | 原生 |
30
+ | Codex | Memorix 插件内 `hooks/hooks.json` | Codex plugin hooks;通过 `memorix setup --agent codex` 安装 |
30
31
  | Windsurf | `.windsurf/cascade.json` | Windsurf 格式 |
31
32
  | Cursor | `.cursor/hooks.json` | Cursor 格式 |
32
33
  | Kiro | `.kiro/hooks/*.hook.md` | Markdown + YAML |
@@ -39,6 +40,9 @@
39
40
  // VS Code / Claude Code
40
41
  { "hookEventName": "PostToolUse", "sessionId": "...", "cwd": "...", "tool_name": "write", ... }
41
42
 
43
+ // Codex
44
+ { "hook_event_name": "PostToolUse", "session_id": "...", "cwd": "...", "tool_name": "apply_patch", ... }
45
+
42
46
  // Windsurf
43
47
  { "agent_action_name": "post_write_code", "trajectory_id": "...", "tool_info": { "file_path": "..." } }
44
48
 
@@ -80,10 +84,18 @@ memorix hook <normalized_event> [--agent <agent_name>]
80
84
  ```bash
81
85
  memorix hooks install
82
86
  # 自动检测已安装的 Agent → 生成对应配置文件
83
- # 支持: --agent cursor|windsurf|claude|copilot|kiro|codex
87
+ # 支持: --agent cursor|windsurf|claude|copilot|kiro
84
88
  # 支持: --project (仅当前项目) | --global (全局)
85
89
  ```
86
90
 
91
+ Codex 使用插件入口而不是 fallback 配置文件:
92
+
93
+ ```bash
94
+ memorix setup --agent codex --global
95
+ ```
96
+
97
+ 安装后,Codex 首次要求时在 `/hooks` 中审核 Memorix 插件的 hook 定义。
98
+
87
99
  ## 文件结构
88
100
 
89
101
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "Local-first shared memory layer for AI coding agents across MCP clients, Git history, reasoning context, and project sessions.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memorix",
3
- "version": "1.1.0",
3
+ "version": "1.1.13",
4
4
  "description": "Shared workspace memory for Codex and other AI coding agents.",
5
5
  "author": {
6
6
  "name": "AVIDS2",
@@ -17,6 +17,7 @@
17
17
  ],
18
18
  "skills": "./skills/",
19
19
  "mcpServers": "./.mcp.json",
20
+ "hooks": "./hooks/hooks.json",
20
21
  "interface": {
21
22
  "displayName": "Memorix",
22
23
  "shortDescription": "Shared local memory for coding agents.",
@@ -2,10 +2,12 @@
2
2
  "hooks": {
3
3
  "SessionStart": [
4
4
  {
5
+ "matcher": "startup|resume|clear|compact",
5
6
  "hooks": [
6
7
  {
7
8
  "type": "command",
8
9
  "command": "memorix hook --agent codex",
10
+ "commandWindows": "memorix.cmd hook --agent codex",
9
11
  "timeout": 10
10
12
  }
11
13
  ]
@@ -13,10 +15,12 @@
13
15
  ],
14
16
  "PostToolUse": [
15
17
  {
18
+ "matcher": "*",
16
19
  "hooks": [
17
20
  {
18
21
  "type": "command",
19
22
  "command": "memorix hook --agent codex",
23
+ "commandWindows": "memorix.cmd hook --agent codex",
20
24
  "timeout": 10
21
25
  }
22
26
  ]
@@ -28,6 +32,32 @@
28
32
  {
29
33
  "type": "command",
30
34
  "command": "memorix hook --agent codex",
35
+ "commandWindows": "memorix.cmd hook --agent codex",
36
+ "timeout": 10
37
+ }
38
+ ]
39
+ }
40
+ ],
41
+ "PreCompact": [
42
+ {
43
+ "matcher": "manual|auto",
44
+ "hooks": [
45
+ {
46
+ "type": "command",
47
+ "command": "memorix hook --agent codex",
48
+ "commandWindows": "memorix.cmd hook --agent codex",
49
+ "timeout": 10
50
+ }
51
+ ]
52
+ }
53
+ ],
54
+ "Stop": [
55
+ {
56
+ "hooks": [
57
+ {
58
+ "type": "command",
59
+ "command": "memorix hook --agent codex",
60
+ "commandWindows": "memorix.cmd hook --agent codex",
31
61
  "timeout": 10
32
62
  }
33
63
  ]