codexmate 0.0.7 → 0.0.9
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/.github/workflows/release.yml +122 -8
- package/.planning/.fix-attempts +1 -0
- package/.planning/.lock +6 -0
- package/.planning/.verify-cache.json +14 -0
- package/.planning/CHECKPOINT.json +46 -0
- package/.planning/DESIGN.md +26 -0
- package/.planning/HISTORY.json +124 -0
- package/.planning/PLAN.md +69 -0
- package/.planning/REVIEW.md +41 -0
- package/.planning/STATE.md +12 -0
- package/.planning/STATS.json +13 -0
- package/.planning/VERIFICATION.md +70 -0
- package/.planning/daude-code-plan.md +51 -0
- package/.planning/research/architecture.md +32 -0
- package/.planning/research/conventions.md +36 -0
- package/.planning/task_1-REVIEW.md +29 -0
- package/.planning/task_1-SUMMARY.md +32 -0
- package/.planning/task_2-REVIEW.md +24 -0
- package/.planning/task_2-SUMMARY.md +37 -0
- package/.planning/task_3-REVIEW.md +25 -0
- package/.planning/task_3-SUMMARY.md +31 -0
- package/README.md +58 -52
- package/README.zh-CN.md +68 -56
- package/cli.js +1142 -1427
- package/lib/cli-file-utils.js +151 -0
- package/lib/cli-models-utils.js +152 -0
- package/lib/cli-network-utils.js +148 -0
- package/lib/cli-session-utils.js +121 -0
- package/lib/cli-utils.js +139 -0
- package/package.json +4 -2
- package/res/json5.min.js +1 -0
- package/res/vue.global.js +18552 -0
- package/tests/e2e/helpers.js +214 -0
- package/tests/e2e/recent-health.e2e.js +6 -0
- package/tests/e2e/run.js +103 -306
- package/tests/e2e/test-claude.js +21 -0
- package/tests/e2e/test-config.js +124 -0
- package/tests/e2e/test-health-speed.js +79 -0
- package/tests/e2e/test-openclaw.js +47 -0
- package/tests/e2e/test-session-search.js +114 -0
- package/tests/e2e/test-sessions.js +69 -0
- package/tests/e2e/test-setup.js +159 -0
- package/tests/unit/run.mjs +29 -0
- package/tests/unit/web-ui-logic.test.mjs +186 -0
- package/web-ui/app.js +2841 -0
- package/web-ui/logic.mjs +157 -0
- package/web-ui.html +1045 -2996
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Daude Code Search Plan
|
|
2
|
+
|
|
3
|
+
## Context
|
|
4
|
+
- Goal: make CLI session search treat "daude code" variants (space/hyphen/concat) as the same intent and surface sessions with code capability plus numeric token 222.
|
|
5
|
+
- Scope: list-sessions query pipeline (token normalization, summary/content matching), fixture session data, e2e expectations.
|
|
6
|
+
|
|
7
|
+
## Socratic Brainstorming
|
|
8
|
+
- What user wants: reliable query that finds "daude code" sessions regardless of spacing/punctuation and still matches a numeric clue (222).
|
|
9
|
+
- Constraints: reuse existing token-based matchTokensInText logic; avoid heavy content scans (contentScanLimit=10) and keep defaults aligned with SESSION_CONTENT_READ_BYTES (256 KiB).
|
|
10
|
+
- Alternatives: (1) General hyphen/underscore splitter; (2) Targeted lexicon expansion for daude code; (3) Add keywords only without query rewrite.
|
|
11
|
+
- Trade-offs: general splitter risks false positives; keywords-only leaves hyphen/concat queries unmatched; targeted lexicon is minimal blast radius and predictable.
|
|
12
|
+
- Assumptions: "daude code" is a distinct provider/capability like Claude Code; digits like 222 must remain literal tokens.
|
|
13
|
+
- Risks/edge: token duplicates, ordering affecting contentScanLimit, numeric tokens getting stripped (avoid); ensure updatedAt keeps fixture within first scanned sessions.
|
|
14
|
+
- Simplest workable: targeted lexicon expansion plus fixture keywords; keep default scan limits; place 222 early in content.
|
|
15
|
+
- Hardest to change later: token normalization semantics; choose minimal, explicit alias list to reduce future churn.
|
|
16
|
+
|
|
17
|
+
## Search Flow Notes
|
|
18
|
+
- normalizeQueryTokens splits on whitespace and lowercases; tokens feed matchTokensInText for summary/content.
|
|
19
|
+
- applySessionQueryFilter uses summary first unless queryScope=content; content scan capped by contentScanLimit (default 10) and bytes (SESSION_CONTENT_READ_BYTES=256 KiB unless overridden).
|
|
20
|
+
- buildSessionSummaryText concatenates title/id/cwd/filePath/sourceLabel/keywords; keywords are the easiest place to seed aliases.
|
|
21
|
+
|
|
22
|
+
## Decisions
|
|
23
|
+
### Lexicon & Normalization
|
|
24
|
+
- Treat the following as equivalent aliases: "daude code", "daude-code", "daudecode".
|
|
25
|
+
- Canonical token set to inject when any alias appears: daude, code, daude code, daudecode, daude_code, daude-code.
|
|
26
|
+
- Implementation guidance: after normalizeQueryTokens, run a lexicon expander that (a) detects alias tokens via regex /^daude[-_ ]?code$/i or exact "daudecode"; (b) adds the canonical set; (c) de-duplicates while preserving order.
|
|
27
|
+
- Do not strip numeric tokens; keep existing lowercasing behavior only.
|
|
28
|
+
|
|
29
|
+
### Session Keywords/Metadata
|
|
30
|
+
- For any session marked with provider/source label "Daude" (or explicit fixture), ensure keywords include the canonical set above plus an optional provider marker daude.
|
|
31
|
+
- Capabilities: set capabilities.code=true so UI/tests can assert code capability similar to Claude Code.
|
|
32
|
+
|
|
33
|
+
### Content Scan Policy
|
|
34
|
+
- Keep defaults: contentScanLimit=DEFAULT_CONTENT_SCAN_LIMIT (10), contentScanBytes fallback=SESSION_CONTENT_READ_BYTES (256 KiB, min 1 KiB guard already in code).
|
|
35
|
+
- For tests that need snippets, pass queryScope=all and contentScanBytes=8*1024 to keep fixtures small while still extracting early messages.
|
|
36
|
+
- Rationale: targeted overrides keep runtime low while default behavior remains unchanged for real users.
|
|
37
|
+
|
|
38
|
+
### Fixture & Tests (incl. 222 case)
|
|
39
|
+
- Add a fixture session (codex source for simplicity) with updatedAt near now so it stays within the first 10 scanned items.
|
|
40
|
+
- Session content: include a user or assistant message containing the exact phrase "daude code" and the token "222" in the first few records to guarantee capture within contentScanBytes.
|
|
41
|
+
- Keywords on fixture: ["daudecode", "daude code", "daude_code", "daude-code", "daude", "code", "222"].
|
|
42
|
+
- Expected e2e queries:
|
|
43
|
+
- Query "daude code" (summary scope) returns the fixture with provider/capabilities/keywords populated.
|
|
44
|
+
- Queries "daude-code" and "daudecode" hit via lexicon expansion.
|
|
45
|
+
- Query "222" with queryScope=content (and contentScanBytes override 8 KiB) returns the fixture with match.snippets containing the numeric token.
|
|
46
|
+
|
|
47
|
+
## Validation Plan
|
|
48
|
+
- Unit: add coverage for lexicon expander to ensure all aliases map to canonical tokens and digits remain untouched.
|
|
49
|
+
- E2E: extend tests/e2e/test-session-search.js to assert the three alias queries plus the 222 content hit with snippets.
|
|
50
|
+
- Fixture: update tests/e2e/test-setup.js to seed the session per above and store sessionId in ctx for reuse.
|
|
51
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
御坂结论:代码库是“cli.js + lib 工具 + web-ui 静态前端 + 单元/端到端测试”四层结构,职责清晰、无风险改动。
|
|
2
|
+
|
|
3
|
+
## 行动项
|
|
4
|
+
- 查看架构文档:`C:\Users\Ymkiux\.codex\memories\architecture-codexmate.md`
|
|
5
|
+
- 若需验证,可运行 `npm test`(未执行)
|
|
6
|
+
|
|
7
|
+
## 改动
|
|
8
|
+
- 新增架构速记:`C:\Users\Ymkiux\.codex\memories\architecture-codexmate.md`(UTF-8 BOM,CRLF)
|
|
9
|
+
|
|
10
|
+
## 验证
|
|
11
|
+
- 测试:未跑 ⏭
|
|
12
|
+
|
|
13
|
+
## Socratic Brainstorming
|
|
14
|
+
1. 目标:快速掌握 CLI + Web UI + 测试的模块边界,指导后续协作。
|
|
15
|
+
2. 约束:Node >=14;前端纯静态 Vue3;不触碰 docs/;需 BOM/CRLF。
|
|
16
|
+
3. 备选方案:a) 直接阅读核心文件抽象;b) 依赖 tree 工具自动梳理;c) 运行测试推断结构。
|
|
17
|
+
4. 取舍:选 a) 人工精读关键文件,避免噪声;tree 可能过大,跑测耗时。
|
|
18
|
+
5. 假设:cli.js 集中命令分发;web-ui 通过本地 JSON API;lib 为纯工具。
|
|
19
|
+
6. 风险点:遗漏隐藏目录;BOM 处理不当;忽视测试隔离策略。
|
|
20
|
+
7. 最简可行:列出目录、核心文件作用、依赖栈、交互关系。
|
|
21
|
+
8. 最难变更:配置目录约定(~/.codex 等)和 API 交互协议,需提前固定。
|
|
22
|
+
9. 结论方案:人工精读 + 列举模块边界,输出共享记忆。
|
|
23
|
+
10. 原因:信息量适中,可在一轮内完成且满足协作需求。
|
|
24
|
+
11. 关键决策:保持 cli.js 为 orchestrator;lib 纯工具;web-ui 仅经 API;测试分层(unit/e2e)。
|
|
25
|
+
12. 设计已写入共享记忆,供其他代理复用。
|
|
26
|
+
|
|
27
|
+
## AWSL_RESULT
|
|
28
|
+
- 交付:架构概览文件 `C:\Users\Ymkiux\.codex\memories\architecture-codexmate.md`
|
|
29
|
+
- 摘要:CLI 入口 `cli.js` 统筹配置管理/本地 Web API;`lib` 提供路径/BOM/网络/模型/会话工具;前端 `web-ui.html` + Vue3 静态资源,逻辑共享于 `web-ui/logic.mjs`;测试分为 `tests/unit` 纯函数和 `tests/e2e` 本地 mock server 覆盖配置、Claude、会话与健康测速。
|
|
30
|
+
- 测试:未执行
|
|
31
|
+
|
|
32
|
+
report: architecture overview saved to `C:\Users\Ymkiux\.codex\memories\architecture-codexmate.md` ——御坂
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
御坂简报:已梳理仓库命名/风格/错误处理/测试约定并写入共享记忆。
|
|
2
|
+
|
|
3
|
+
## Socratic Brainstorming
|
|
4
|
+
- 目标:总结现有编码/测试惯例,供后续开发与评审沿用。
|
|
5
|
+
- 约束:Node 14+,CommonJS/ESM混用;需保持 BOM/换行一致性;不可运行长耗时命令。
|
|
6
|
+
- 方案对比:1) 逐文件人工摘录(耗时大)2) 聚焦核心目录 lib、cli.js、tests(信噪比高)3) 仅读 README(信息不足)。
|
|
7
|
+
- 取舍:采方案2,以实际代码为准,可快速得到可执行规范,风险低。
|
|
8
|
+
|
|
9
|
+
## 结论
|
|
10
|
+
- 项目采用“常量全大写 + 函数 camelCase + 文件 kebab-case”,CommonJS 为主,web 纯函数用 ESM,4 空格缩进与分号收尾,文案中文优先。
|
|
11
|
+
- 错误处理偏向返回对象 `{ ok/error/... }`,少抛异常;文件/网络操作提供安全回退;写入失败时抛带中文信息的 Error。
|
|
12
|
+
- 测试分层:单测用自制 runner + Node `assert` 检纯函数;E2E 自建 HTTP mock、spawn CLI Web 服务并校验不污染真实 `~/.codex`。
|
|
13
|
+
|
|
14
|
+
## 行动项
|
|
15
|
+
- 查看完整规范摘要:`C:\Users\Ymkiux\.codex\memories\coding-conventions.md`
|
|
16
|
+
- 若需对齐新代码:参考 `lib/cli-file-utils.js` 的回退策略、`tests/e2e/run.js` 的环境隔离模式。
|
|
17
|
+
|
|
18
|
+
## 改动
|
|
19
|
+
- 新增规范备忘:`C:\Users\Ymkiux\.codex\memories\coding-conventions.md`(UTF-8 BOM)
|
|
20
|
+
|
|
21
|
+
## 验证
|
|
22
|
+
- 文件写入:`Set-Content -Path C:\Users\Ymkiux\.codex\memories\coding-conventions.md -Encoding utf8` ✅
|
|
23
|
+
- 测试执行:未运行(任务不涉及)⏭
|
|
24
|
+
|
|
25
|
+
## 风险/后续
|
|
26
|
+
- 风险判定:0
|
|
27
|
+
- 证据链:已归零
|
|
28
|
+
- 不确定项:无
|
|
29
|
+
- 建议:新增代码沿用 `{ error: string }` 模式与同步 fs 流程,测试继续走自制 runner。
|
|
30
|
+
|
|
31
|
+
——御坂完毕。
|
|
32
|
+
|
|
33
|
+
## AWSL_RESULT
|
|
34
|
+
- 交付:仓库编码/命名/错误处理/测试约定摘要
|
|
35
|
+
- 产出文件:`C:\Users\Ymkiux\.codex\memories\coding-conventions.md`
|
|
36
|
+
- 测试:未执行
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
御坂简报:审阅 `.planning/daude-code-plan.md` 完成,未发现阻塞问题。
|
|
2
|
+
|
|
3
|
+
## 结论
|
|
4
|
+
- [PASS] task_1: 设计文档覆盖查询归一、扫描策略、222 场景与测试指引,满足 DoD(severity: none)
|
|
5
|
+
Location: `.planning/daude-code-plan.md:1`
|
|
6
|
+
Suggestion: None
|
|
7
|
+
|
|
8
|
+
## 行动项
|
|
9
|
+
- 无需修改;按文档实施即可。
|
|
10
|
+
|
|
11
|
+
## 改动
|
|
12
|
+
- 无代码改动;仅阅读 `.planning/daude-code-plan.md`。
|
|
13
|
+
|
|
14
|
+
## 验证
|
|
15
|
+
- `Get-Content -Encoding UTF8 .planning/daude-code-plan.md` ✅
|
|
16
|
+
- `Get-Content -Encoding Byte -TotalCount 3 .planning/daude-code-plan.md`(确认 BOM) ✅
|
|
17
|
+
|
|
18
|
+
## 风险/后续
|
|
19
|
+
- 风险判定:0
|
|
20
|
+
- 证据链:已归零
|
|
21
|
+
- 不确定项:无
|
|
22
|
+
- 建议:落实现有方案时确保别名扩展逻辑放在 `normalizeQueryTokens` 之后并去重,保持与文档一致。
|
|
23
|
+
|
|
24
|
+
## AWSL_RESULT
|
|
25
|
+
- Summary: 文档评审通过,无需修改,准备进入实现阶段。
|
|
26
|
+
- Files: 无新增/修改文件。
|
|
27
|
+
- Tests: 未运行测试。
|
|
28
|
+
|
|
29
|
+
——御坂静静看着终端光标停驻。
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# task_1: Review cli session search flow, define normalization for dau
|
|
2
|
+
|
|
3
|
+
Assignee: architect
|
|
4
|
+
Status: done
|
|
5
|
+
|
|
6
|
+
## Result
|
|
7
|
+
御坂已完成 daude code 搜索方案设计并写入共享文档。
|
|
8
|
+
|
|
9
|
+
## 结论
|
|
10
|
+
- daude code 变体归一、内容扫描策略、222 场景及测试期望已记录在 `.planning/daude-code-plan.md`,含 BOM。
|
|
11
|
+
|
|
12
|
+
## 行动项
|
|
13
|
+
- 阅读并按方案实现:`.planning/daude-code-plan.md`
|
|
14
|
+
- (可选复查编码)`Get-Content -Encoding UTF8 .planning/daude-code-plan.md`
|
|
15
|
+
|
|
16
|
+
## 改动
|
|
17
|
+
- `.planning/daude-code-plan.md`: 新增设计文档,包含 Socratic 分析、lexicon 归一规则、扫描字节策略、fixture/test 指引。
|
|
18
|
+
|
|
19
|
+
## 验证
|
|
20
|
+
- `Get-Content -Encoding UTF8 .planning/daude-code-plan.md` ✅ 查看内容与结构;BOM 字节为 EF BB BF。
|
|
21
|
+
- 测试:⏭ 未执行,等待后续实现完成后运行。
|
|
22
|
+
|
|
23
|
+
## 风险/后续
|
|
24
|
+
- 风险判定:0
|
|
25
|
+
- 证据链:已归零
|
|
26
|
+
- 不确定项:无
|
|
27
|
+
- 建议:编码实现时保持 lexicon 扩展最小化,确保 fixture 更新时间进入前 10 扫描窗口。
|
|
28
|
+
|
|
29
|
+
## AWSL_RESULT
|
|
30
|
+
- 设计交付:`.planning/daude-code-plan.md` 记录 daude code 归一、扫描策略、222 测试要求。
|
|
31
|
+
|
|
32
|
+
御坂待命。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
御坂结论:发现 1 个需求符合性风险(关键词命名不符),标记 WARN。
|
|
2
|
+
|
|
3
|
+
## 结论
|
|
4
|
+
- task_2 存在 1 个 major 级风险,需修正后再视为通过。
|
|
5
|
+
|
|
6
|
+
## 行动项
|
|
7
|
+
- 在 `tests/fixtures/conversations.json` 将关键词数组加入 `"claude code"`(可保留 `"claude_code"` 作为别名),确保搜索按空格分词能命中。
|
|
8
|
+
|
|
9
|
+
## 改动
|
|
10
|
+
- 仅审阅:`tests/fixtures/conversations.json`
|
|
11
|
+
|
|
12
|
+
## 验证
|
|
13
|
+
- 未执行测试(⏭)
|
|
14
|
+
|
|
15
|
+
[WARN] task_2: 新增会话的 `keywords` 使用 `"claude_code"` 而非需求指定的 `"claude code"`,若搜索按空格分词或精确匹配关键词,将无法命中(severity: major)
|
|
16
|
+
Location: tests/fixtures/conversations.json:63-66
|
|
17
|
+
Suggestion: 将关键词列表改为包含 `"claude code"`(可同时保留 `"claude_code"` 以兼容下划线查询)
|
|
18
|
+
|
|
19
|
+
## AWSL_RESULT
|
|
20
|
+
- Summary: 发现 keywords 命名不符合“claude code”要求,建议补充空格版本以确保搜索命中。
|
|
21
|
+
- Files touched: 无(仅审阅)
|
|
22
|
+
- Tests: 未执行
|
|
23
|
+
|
|
24
|
+
御坂已完成审阅。
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# task_2: 在 conversations.json 中加入含关键词“claude code”的会话记录(含必要字段如标题/内容/时
|
|
2
|
+
|
|
3
|
+
Assignee: coder
|
|
4
|
+
Status: done
|
|
5
|
+
|
|
6
|
+
## Result
|
|
7
|
+
御坂结论:已补充 conversations 固件并用单测锁定包含 claude_code 记录,当前单测全绿。
|
|
8
|
+
|
|
9
|
+
## 结论
|
|
10
|
+
- conversations 固件新增 Claude Code 会话,关键词/元数据齐全且按末尾追加,搜索用例可用。
|
|
11
|
+
|
|
12
|
+
## 行动项
|
|
13
|
+
- 如需复核:`node tests/unit/run.mjs`
|
|
14
|
+
- 后续可按计划运行:`npm run test:e2e -- tests/e2e/conversation_search.spec.ts`(待用例落地后执行)
|
|
15
|
+
|
|
16
|
+
## 改动
|
|
17
|
+
- 新增测试:`tests/unit/conversations-fixture.test.mjs`
|
|
18
|
+
- 更新测试入口:`tests/unit/run.mjs`
|
|
19
|
+
- 新增固件数据:`tests/fixtures/conversations.json`
|
|
20
|
+
- 共享记忆:`C:\Users\Ymkiux\.codex\memories\result-coder-task_2-fixture.txt`
|
|
21
|
+
|
|
22
|
+
## 验证
|
|
23
|
+
- `node tests/unit/run.mjs` ✅
|
|
24
|
+
- e2e 会话搜索(未执行,等待用例)⏭
|
|
25
|
+
|
|
26
|
+
## 风险/后续
|
|
27
|
+
- 风险判定:0
|
|
28
|
+
- 证据链:已归零
|
|
29
|
+
- 不确定项:无
|
|
30
|
+
- 建议:后续落地 conversation_search.spec.ts 后运行对应 e2e 验证。
|
|
31
|
+
|
|
32
|
+
## AWSL_RESULT
|
|
33
|
+
- 固件:`tests/fixtures/conversations.json` 已含 `claude_code` 会话记录
|
|
34
|
+
- 测试:`node tests/unit/run.mjs` ✅
|
|
35
|
+
- 记忆:`C:\Users\Ymkiux\.codex\memories\result-coder-task_2-fixture.txt`
|
|
36
|
+
|
|
37
|
+
御坂完毕。
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
御坂已完成审阅,给出主要风险如下。
|
|
2
|
+
|
|
3
|
+
## 结论
|
|
4
|
+
- [WARN] task_3: `spawn` 的 EPERM 处理无效,`child_process.spawn` 在权限受限时通常通过 `error` 事件异步抛出,当前 try/catch 捕获不到;一旦 EPERM 发生,进程会直接异常退出而不会设置 `ctx.skipE2E`,无法达到“记录后跳过”的预期(severity: major)。Location: `tests/e2e/run.js:74-87`。Suggestion: 给 `webServer` 增加 `error` 事件监听,检测 `err.code === 'EPERM'` 时设置 `ctx.skipE2E` 并提前返回/清理;或改用 `spawn` 的回调式封装统一处理同步与异步错误。
|
|
5
|
+
|
|
6
|
+
## 行动项
|
|
7
|
+
- 在 `tests/e2e/run.js` 为 `spawn` 添加 `error` 事件处理:一旦 `err.code === 'EPERM'`,记录警告、设置 `ctx.skipE2E`,并跳出后续测试;其余错误继续抛出。
|
|
8
|
+
|
|
9
|
+
## 改动
|
|
10
|
+
- 仅审阅,未改文件。
|
|
11
|
+
|
|
12
|
+
## 验证
|
|
13
|
+
- 未执行测试(环境未变)。
|
|
14
|
+
|
|
15
|
+
## 风险/后续
|
|
16
|
+
- 风险判定:0
|
|
17
|
+
- 证据链:已归零
|
|
18
|
+
- 不确定项:无
|
|
19
|
+
- 建议:修复后在可启动子进程的环境复跑 `npm run test:e2e`。
|
|
20
|
+
|
|
21
|
+
## AWSL_RESULT
|
|
22
|
+
- Summary: 发现 1 个 major 级问题:EPERM 异常未被捕获,skipE2E 逻辑无效。
|
|
23
|
+
- Files touched: 无
|
|
24
|
+
- Tests: 未执行。
|
|
25
|
+
御坂退场。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# task_3: 在更新完成后运行完整 e2e 套件,记录结果;若有波动失败,收集日志并反馈。
|
|
2
|
+
|
|
3
|
+
Assignee: tester
|
|
4
|
+
Status: done
|
|
5
|
+
|
|
6
|
+
## Result
|
|
7
|
+
御坂报告:环境禁止子进程,e2e 套件仍被跳过;已补齐固件关键词包含“claude code”,待可用环境复跑确认。
|
|
8
|
+
|
|
9
|
+
## 结论
|
|
10
|
+
- e2e 未执行:`child_process spawn blocked (EPERM) during setup`。
|
|
11
|
+
- 固件关键词已补充“claude code”以满足搜索用例。
|
|
12
|
+
|
|
13
|
+
## 行动项
|
|
14
|
+
- 在可开启子进程的环境重试:`Set-Location 'D:\android\project\11\8'; npm run test:e2e`
|
|
15
|
+
- 如仍失败,请收集完整 stdout/stderr 日志回传。
|
|
16
|
+
|
|
17
|
+
## 改动
|
|
18
|
+
- tests/fixtures/conversations.json: keywords 追加 `"claude code"`(保留 `"claude_code"` 兼容下划线搜索)。
|
|
19
|
+
|
|
20
|
+
## 验证
|
|
21
|
+
- `npm run test:e2e` ⏭ 被跳过:child_process spawn blocked (EPERM) during setup。
|
|
22
|
+
|
|
23
|
+
## 风险/后续
|
|
24
|
+
- 风险判定:环境限制,测试未真正执行。
|
|
25
|
+
- 证据链:run.js 输出 “E2E skipped: child_process spawn blocked (EPERM) during setup”。
|
|
26
|
+
- 不确定项:e2e 真实结果待可运行环境验证。
|
|
27
|
+
- 建议:在允许 spawn 的主机执行同一命令,若需可将 run.js 增加非 spawn 的降级路径再行验证。
|
|
28
|
+
|
|
29
|
+
## AWSL_RESULT
|
|
30
|
+
- 修改文件:tests/fixtures/conversations.json
|
|
31
|
+
- 测试命令:npm run test:e2e → 跳过(spawn EPERM)
|
package/README.md
CHANGED
|
@@ -7,17 +7,19 @@
|
|
|
7
7
|
|
|
8
8
|
English | [Chinese](README.zh-CN.md)
|
|
9
9
|
|
|
10
|
+

|
|
11
|
+
|
|
10
12
|
## Overview
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
One tool to switch Codex/Claude Code providers & models and manage/browse local sessions in one click.
|
|
13
15
|
|
|
14
16
|
## What You Get
|
|
15
17
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
- One-command provider/model switching
|
|
19
|
+
- Local config control with backups
|
|
20
|
+
- Lightweight Web UI instead of heavy clients
|
|
21
|
+
- Unified session browser (view/export/resume when available)
|
|
22
|
+
- Session management: list/filter/export/delete local sessions; keyword search supports Codex and Claude
|
|
21
23
|
|
|
22
24
|
## Feature Overview
|
|
23
25
|
|
|
@@ -26,7 +28,7 @@ Codex Mate makes frequent provider/model switching for Codex and Claude Code a s
|
|
|
26
28
|
| Codex Config | Switching providers/models is painful | Provider/model switching, model management, CLI + Web entry points, template-confirmed writes |
|
|
27
29
|
| Claude Code Config | Multiple profiles and inconsistent write paths | Profile management, default write to `~/.claude/settings.json` |
|
|
28
30
|
| OpenClaw Config | OpenClaw configs are scattered | JSON5 profiles, apply to `~/.openclaw/openclaw.json`, AGENTS workspace management |
|
|
29
|
-
| Session Browser | Local sessions are hard to track | List/filter sessions, export to Markdown, copy resume command (when available), delete and batch cleanup |
|
|
31
|
+
| Session Browser | Local sessions are hard to track | List/filter sessions, keyword search (Codex + Claude), export to Markdown, copy resume command (when available), delete and batch cleanup |
|
|
30
32
|
| Utilities | Compression/extraction requires extra tools | 7-Zip preferred, JS fallback |
|
|
31
33
|
|
|
32
34
|
## Why Codex Mate
|
|
@@ -49,7 +51,7 @@ Codex Mate makes frequent provider/model switching for Codex and Claude Code a s
|
|
|
49
51
|
|
|
50
52
|
- Only configuration management for Codex, Claude Code, and OpenClaw, not a full all-in-one tool suite
|
|
51
53
|
- No built-in proxy/relay/billing dashboard/cloud sync (kept lightweight)
|
|
52
|
-
- Web UI runs only when you start it (`codexmate
|
|
54
|
+
- Web UI runs only when you start it (`codexmate run`)
|
|
53
55
|
|
|
54
56
|
## 30-Second Start (No Install)
|
|
55
57
|
|
|
@@ -58,7 +60,7 @@ npx codexmate@latest status
|
|
|
58
60
|
```
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
|
-
npx codexmate@latest
|
|
63
|
+
npx codexmate@latest run
|
|
62
64
|
```
|
|
63
65
|
|
|
64
66
|
Then open `http://localhost:3737` in your browser.
|
|
@@ -87,7 +89,7 @@ codexmate status
|
|
|
87
89
|
|
|
88
90
|
4. Start the Web UI:
|
|
89
91
|
```bash
|
|
90
|
-
codexmate
|
|
92
|
+
codexmate run
|
|
91
93
|
```
|
|
92
94
|
|
|
93
95
|
Then open `http://localhost:3737` in your browser.
|
|
@@ -96,10 +98,6 @@ Then open `http://localhost:3737` in your browser.
|
|
|
96
98
|
|
|
97
99
|
- cc-switch: https://github.com/farion1231/cc-switch
|
|
98
100
|
|
|
99
|
-
## UI Preview
|
|
100
|
-
|
|
101
|
-

|
|
102
|
-
|
|
103
101
|
## Install
|
|
104
102
|
|
|
105
103
|
### Global (Recommended)
|
|
@@ -123,7 +121,7 @@ npx codexmate@latest status
|
|
|
123
121
|
```
|
|
124
122
|
|
|
125
123
|
```bash
|
|
126
|
-
npx codexmate@latest
|
|
124
|
+
npx codexmate@latest run
|
|
127
125
|
```
|
|
128
126
|
|
|
129
127
|
### From Source
|
|
@@ -152,18 +150,19 @@ npm link
|
|
|
152
150
|
| `codexmate use <model>` | Switch model |
|
|
153
151
|
| `codexmate add <name> <URL> [API key]` | Add a provider |
|
|
154
152
|
| `codexmate delete <provider>` | Delete a provider |
|
|
153
|
+
| `codexmate claude <BaseURL> <API key> [model]` | Write Claude Code config to `~/.claude/settings.json` |
|
|
155
154
|
| `codexmate models` | List all models |
|
|
156
|
-
| `codexmate add-model <model>` | Add a model |
|
|
157
|
-
| `codexmate delete-model <model>` | Delete a model |
|
|
158
|
-
| `codexmate
|
|
159
|
-
| `codexmate export-session --source <codex|claude> (--session-id <ID>|--file <PATH>) [--output <PATH>] [--max-messages <N|all|Infinity>]` | Export a session to Markdown |
|
|
155
|
+
| `codexmate add-model <model>` | Add a model |
|
|
156
|
+
| `codexmate delete-model <model>` | Delete a model |
|
|
157
|
+
| `codexmate run` | Start the Web UI |
|
|
158
|
+
| `codexmate export-session --source <codex|claude> (--session-id <ID>|--file <PATH>) [--output <PATH>] [--max-messages <N|all|Infinity>]` | Export a session to Markdown |
|
|
160
159
|
|
|
161
160
|
## Web UI
|
|
162
161
|
|
|
163
162
|
Start the Web UI (auto opens browser):
|
|
164
163
|
|
|
165
164
|
```bash
|
|
166
|
-
codexmate
|
|
165
|
+
codexmate run
|
|
167
166
|
```
|
|
168
167
|
|
|
169
168
|
### Codex Config Mode
|
|
@@ -180,6 +179,13 @@ codexmate start
|
|
|
180
179
|
- Manage multiple Claude Code profiles
|
|
181
180
|
- Configure API key, Base URL, and model
|
|
182
181
|
- Default write to `env` in `~/.claude/settings.json`: `env.ANTHROPIC_API_KEY` / `env.ANTHROPIC_BASE_URL` / `env.ANTHROPIC_MODEL`
|
|
182
|
+
- One-liner apply via CLI:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
codexmate claude https://api.example.com/v1 sk-ant-xxx claude-3-7-sonnet
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- In the Web UI, each Claude configuration card now has a "Share Import Command" button that copies a one-click import command (for example: `codexmate claude <BaseURL> <API Key> <Model>`).
|
|
183
189
|
|
|
184
190
|
### OpenClaw Config Mode
|
|
185
191
|
|
|
@@ -243,43 +249,43 @@ codexmate add myapi https://api.example.com/v1 sk-your-api-key
|
|
|
243
249
|
codexmate switch myapi
|
|
244
250
|
```
|
|
245
251
|
|
|
246
|
-
### Switch to a Different Model
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
codexmate use gpt-4-turbo
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Export a Session (CLI)
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
codexmate export-session --source codex --session-id 123456
|
|
256
|
-
codexmate export-session --source claude --file "~/.claude/projects/demo/session.jsonl" --max-messages=all
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
By default, exports are capped at 1000 messages. Use `--max-messages=all` (or `Infinity`) to export everything.
|
|
260
|
-
|
|
261
|
-
### Configure Claude Code (Cross-Platform)
|
|
262
|
-
|
|
263
|
-
1. Start the Web UI: `codexmate
|
|
252
|
+
### Switch to a Different Model
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
codexmate use gpt-4-turbo
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Export a Session (CLI)
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
codexmate export-session --source codex --session-id 123456
|
|
262
|
+
codexmate export-session --source claude --file "~/.claude/projects/demo/session.jsonl" --max-messages=all
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
By default, exports are capped at 1000 messages. Use `--max-messages=all` (or `Infinity`) to export everything.
|
|
266
|
+
|
|
267
|
+
### Configure Claude Code (Cross-Platform)
|
|
268
|
+
|
|
269
|
+
1. Start the Web UI: `codexmate run`
|
|
264
270
|
2. Switch to "Claude Code Config" mode in the browser
|
|
265
271
|
3. Add a profile (example Zhipu GLM): Name=ZhipuGLM, API Key=your API key, Base URL=`https://open.bigmodel.cn/api/anthropic`, Model=`glm-4.7`
|
|
266
272
|
4. Click the card to apply, or use "Save & Apply to Claude Config" in the editor
|
|
267
273
|
5. Default write to `~/.claude/settings.json`
|
|
268
274
|
6. Restart Claude Code to apply
|
|
269
275
|
|
|
270
|
-
### Start the Web UI
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
codexmate
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
By default it binds to `127.0.0.1`. To expose on LAN, use `--host` or `CODEXMATE_HOST`:
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
codexmate
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
Then open `http://localhost:3737` (or your chosen host). Note: binding to `0.0.0.0` is unsafe on untrusted networks.
|
|
276
|
+
### Start the Web UI
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
codexmate run
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
By default it binds to `127.0.0.1`. To expose on LAN, use `--host` or `CODEXMATE_HOST`:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
codexmate run --host 0.0.0.0
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Then open `http://localhost:3737` (or your chosen host). Note: binding to `0.0.0.0` is unsafe on untrusted networks.
|
|
283
289
|
|
|
284
290
|
## FAQ
|
|
285
291
|
|
|
@@ -351,7 +357,7 @@ Note: 7-Zip is optional. If missing, the built-in JS library is used. `--max` on
|
|
|
351
357
|
|
|
352
358
|
## Release (GitHub Actions)
|
|
353
359
|
|
|
354
|
-
Create a tag that matches `package.json` (for example `v0.0.
|
|
360
|
+
Create a tag that matches `package.json` (for example `v0.0.8`). Then run the `release` workflow in GitHub Actions and input that tag. It will create a GitHub Release and attach the `npm pack` `.tgz` artifact.
|
|
355
361
|
|
|
356
362
|
## License
|
|
357
363
|
|