codexmate 0.1.35 → 0.1.37
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 +102 -100
- package/README.vi.md +105 -93
- package/README.zh.md +102 -98
- package/cli/skills.js +103 -4
- package/cli.js +5 -2
- package/package.json +1 -1
- package/web-ui/app.js +14 -0
- package/web-ui/logic.codex.mjs +14 -0
- package/web-ui/modules/app.computed.main-tabs.mjs +12 -0
- package/web-ui/modules/app.methods.agents.mjs +0 -3
- package/web-ui/modules/app.methods.claude-config.mjs +26 -5
- package/web-ui/modules/app.methods.install.mjs +13 -17
- package/web-ui/modules/app.methods.navigation.mjs +1 -1
- package/web-ui/modules/app.methods.openclaw-editing.mjs +29 -0
- package/web-ui/modules/app.methods.openclaw-persist.mjs +3 -3
- package/web-ui/modules/app.methods.opencode-config.mjs +34 -0
- package/web-ui/modules/app.methods.pi-config.mjs +14 -9
- package/web-ui/modules/app.methods.prompts-editor.mjs +30 -6
- package/web-ui/modules/app.methods.providers.mjs +11 -0
- package/web-ui/modules/app.methods.session-trash.mjs +4 -5
- package/web-ui/modules/app.methods.startup-claude.mjs +11 -5
- package/web-ui/modules/claude-provider-presets.mjs +23 -0
- package/web-ui/modules/i18n/locales/en.mjs +29 -0
- package/web-ui/modules/i18n/locales/ja.mjs +29 -0
- package/web-ui/modules/i18n/locales/vi.mjs +29 -0
- package/web-ui/modules/i18n/locales/zh-tw.mjs +29 -0
- package/web-ui/modules/i18n/locales/zh.mjs +29 -0
- package/web-ui/modules/pi-provider-templates.mjs +6 -1
- package/web-ui/modules/session-features.mjs +25 -1
- package/web-ui/modules/skills.methods.mjs +61 -16
- package/web-ui/partials/index/layout-header.html +36 -37
- package/web-ui/partials/index/modal-openclaw-config.html +3 -0
- package/web-ui/partials/index/modals-basic.html +1 -1
- package/web-ui/partials/index/modals-pi-provider.html +1 -1
- package/web-ui/partials/index/panel-config-claude.html +4 -21
- package/web-ui/partials/index/panel-config-codex.html +3 -1
- package/web-ui/partials/index/panel-config-opencode.html +4 -0
- package/web-ui/partials/index/panel-market.html +10 -3
- package/web-ui/partials/index/panel-prompts.html +40 -20
- package/web-ui/partials/index/panel-settings.html +45 -0
- package/web-ui/partials/index/session-features.html +24 -7
- package/web-ui/res/web-ui-render.precompiled.js +531 -271
- package/web-ui/styles/layout-shell.css +41 -70
- package/web-ui/styles/prompts-editor.css +127 -27
- package/web-ui/styles/session-features.css +12 -1
- package/web-ui/styles/settings-panel.css +4 -0
- package/web-ui/styles/system-prompt.css +9 -4
- package/web-ui/styles/theme-dark.css +0 -18
- package/web-ui/styles/theme-ocean.css +0 -14
- package/web-ui/styles/theme-violet.css +0 -23
package/README.zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="site/.vitepress/public/images/logo.png" alt="Codex Mate logo" width="
|
|
3
|
+
<img src="site/.vitepress/public/images/logo.png" alt="Codex Mate logo" width="96" />
|
|
4
4
|
|
|
5
5
|
# Codex Mate
|
|
6
6
|
|
|
@@ -9,83 +9,34 @@
|
|
|
9
9
|
Codex Mate 是本地运行的 CLI + Web 管理工具,在一个界面查看、筛选和导出已有会话,也能集中管理 Provider、Skills 与任务。
|
|
10
10
|
|
|
11
11
|
<p>
|
|
12
|
-
<a href="https://sakurabytecore.github.io/codexmate/"
|
|
13
|
-
<a href="#快速开始"
|
|
14
|
-
<a href="README.md">
|
|
15
|
-
<a href="README.vi.md">
|
|
12
|
+
<a href="https://sakurabytecore.github.io/codexmate/">项目文档</a>
|
|
13
|
+
<a href="#快速开始">快速开始</a>
|
|
14
|
+
<a href="README.md">English</a>
|
|
15
|
+
<a href="README.vi.md">Tiếng Việt</a>
|
|
16
16
|
</p>
|
|
17
17
|
|
|
18
18
|
[](https://www.npmjs.com/package/codexmate)
|
|
19
19
|
[](https://github.com/SakuraByteCore/codexmate/actions/workflows/release.yml)
|
|
20
20
|
[](https://www.npmjs.com/package/codexmate)
|
|
21
|
-
[](#homebrew-安装macos--linux)
|
|
22
|
-
[](#快速开始)
|
|
23
|
-
[](https://nodejs.org/)
|
|
24
21
|
[](LICENSE)
|
|
25
22
|
[](https://github.com/SakuraByteCore/codexmate/stargazers)
|
|
26
|
-
[](https://github.com/SakuraByteCore/codexmate/issues)
|
|
27
|
-
[](https://stackmap.shipwithai.xyz/repos/SakuraByteCore/codexmate?utm_source=badge)
|
|
28
|
-
|
|
29
|
-
<br />
|
|
30
23
|
|
|
31
24
|
</div>
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
在 Usage 页按需展开 UTC 记录明细,区分记录 Token、缓存分项与完整文本估算。当前适配 Codex、Claude、Pi 与 Gemini JSON 会话;旧图表和默认导出保持原口径,不计算费用。CLI 使用 `codexmate analytics export --attribution records`。详见[用量指南](https://sakurabytecore.github.io/codexmate/guide/sessions#用量记录明细)。
|
|
36
|
-
|
|
37
|
-
### 文件共享
|
|
38
|
-
|
|
39
|
-
选择文件或文件夹后手动上传,下载副本或复制 60 分钟有效的局域网文件链接。下载使用独立端口,不授权管理 API;移除批次或停止服务后链接失效,原文件保留。详见[文件共享指南](https://sakurabytecore.github.io/codexmate/guide/web-ui#文件共享)。
|
|
40
|
-
|
|
41
|
-
### 外观主题
|
|
42
|
-
|
|
43
|
-
在设置中选择浅色、深色、海洋蓝或柔紫。柔紫参考 [Catppuccin Latte](https://github.com/catppuccin/palette),使用浅底与紫色强调。主题自动保存,刷新后恢复。
|
|
44
|
-
|
|
45
|
-
<a id="路由组"></a>
|
|
46
|
-
### 模型测试
|
|
47
|
-
|
|
48
|
-
Codex/Pi 子页签选择会保存,刷新后恢复。选择已有配置中的供应商与模型,手动输入问题后发送。查看 Markdown 回复、返回模型 ID 与耗时秒数。测试消耗 API 额度;不启动 CLI、不改配置、不保存测试记录。单次只发一个请求,不自动重试,不设本地响应超时,输出上限 2048 Token。支持配置中的 Responses、Chat Completions、Completions 与 Anthropic Messages;原生登录与命令式凭据暂不接入。Web 已移除模型组设置入口,已有后端分配与 OpenAI Chat API 保持原行为。详见 [Web UI 指南](https://sakurabytecore.github.io/codexmate/guide/web-ui)。
|
|
49
|
-
|
|
50
|
-
测试请求使用 Codex UA/Originator 或 Pi 的 SDK 请求头,已有自定义 UA 优先。读取 Codex 的推理/输出配置及 Pi 模型的 Token 上限与兼容参数。无法读取客户端版本时使用带版本的 CodexMate 测试标识,不伪造客户端版本。
|
|
51
|
-
|
|
52
|
-
### 会话工作台
|
|
26
|
+
## 把 AI 编程记录放在同一入口
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
- **找回对话** — 集中浏览 Codex、Claude Code、Gemini CLI、Pi、OpenCode 等工具的记录,按来源、项目或时间缩小范围。
|
|
29
|
+
- **留下有用内容** — 打开会话核对内容,导出 Markdown 用于项目记录或交接。检索与导出能力因来源而异。
|
|
30
|
+
- **管理配套工具** — 切换 Provider 和模型,复用 Skills 与提示词,推进已有任务工作流,不必更换原来的编程助手。
|
|
55
31
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
证据专题夹可显式保存命名材料引用,刷新后手动打开并复核原文;临时材料篮仍清空,不备份会话全文。Git 提交详情新增开发故事线,手工关联会话与改动原因,保留跨项目隔离;仅写本机元数据,不改 Git,不证明因果或测试通过。详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。
|
|
59
|
-
|
|
60
|
-
材料篮新增开发小票与多 Agent 接力包:选择输出格式,填写目标与可选说明,复核原文后下载 Markdown。只整理历史材料;不调用模型、不执行命令、不自动发送,当前版本仍待验收。说明不保存到专题,打开专题会清空。
|
|
32
|
+
[快速开始](#快速开始) · [会话使用方法](https://sakurabytecore.github.io/codexmate/guide/sessions) · [线程交接](#线程交接)
|
|
61
33
|
|
|
62
34
|
---
|
|
63
35
|
|
|
64
36
|
> [!TIP]
|
|
65
37
|
> **本地优先**:读取本机已有会话、管理本地配置,无需 Codex Mate 云端账户,不收遥测。模型调用仍由所配置的 Provider 处理,本地运行不等于模型离线运行。
|
|
66
38
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
上周讨论过的方案,忘了是在 Codex 还是 Claude Code?先在会话浏览器按来源、项目或时间缩小范围,打开记录确认内容,再导出为 Markdown 留作参考。
|
|
70
|
-
|
|
71
|
-
Codex Mate 管理已有工具和本地记录,不是新的 AI 模型,也不替代原来的编程助手。第一次使用不必配置全部工具;先找回一段对话即可。
|
|
72
|
-
|
|
73
|
-
[开始使用](#快速开始) · [查看会话使用方法](https://sakurabytecore.github.io/codexmate/guide/sessions) · [线程交接](#线程交接)
|
|
74
|
-
|
|
75
|
-
## 与同类工具对比
|
|
76
|
-
|
|
77
|
-
按主要用途选择工具,而非将下表视为互斥功能清单。各项目存在功能重叠,也可以搭配使用。
|
|
78
|
-
|
|
79
|
-
| 工具 | 主要定位 | 适合的需求 |
|
|
80
|
-
| --- | --- | --- |
|
|
81
|
-
| **Codex Mate** | 本地优先的跨工具会话与配置管理,提供 CLI + Web 和桌面入口 | 在一个界面找回、筛选和导出不同工具的历史对话,集中管理 Provider、Skills 与任务工作流 |
|
|
82
|
-
| [CC Switch](https://github.com/farion1231/cc-switch) | 多种 AI 编程工具的桌面配置管理器,集中管理 Provider、MCP、Skills 与提示词 | 主要需要切换 API Provider,减少手工编辑各工具的配置文件 |
|
|
83
|
-
| [CloudCLI(Claude Code UI)](https://github.com/siteboon/claudecodeui) | 面向 Claude Code、Cursor CLI 和 Codex 的桌面与移动端 Web 界面 | 主要需要在浏览器或手机上使用编程助手,访问本地或远程项目与会话 |
|
|
84
|
-
| [ccusage](https://github.com/ryoppippi/ccusage) | 从本地编程智能体记录分析 Token 用量与费用的 CLI | 主要需要按日、周、月或会话查看用量与费用报表 |
|
|
85
|
-
|
|
86
|
-
**选择 Codex Mate 的理由**:将跨工具历史会话查阅、Markdown 归档与日常配置、Skills、任务管理放在同一入口,不必更换原来的编程助手。
|
|
87
|
-
|
|
88
|
-
对比依据为上方链接中的官方项目说明;不代表其他工具缺少未列出的功能,也不是性能或价格排名。Codex Mate 的会话操作能力因来源而异,详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions);导出与交接不等于无损迁移完整会话状态,本地运行也不等于模型离线运行。
|
|
39
|
+
---
|
|
89
40
|
|
|
90
41
|
## 快速开始
|
|
91
42
|
|
|
@@ -145,6 +96,95 @@ curl -fsSL https://raw.githubusercontent.com/SakuraByteCore/codexmate/main/scrip
|
|
|
145
96
|
|
|
146
97
|
---
|
|
147
98
|
|
|
99
|
+
## 什么是 Codex Mate?
|
|
100
|
+
|
|
101
|
+
上周讨论过的方案,忘了是在 Codex 还是 Claude Code?先在会话浏览器按来源、项目或时间缩小范围,打开记录确认内容,再导出为 Markdown 留作参考。
|
|
102
|
+
|
|
103
|
+
Codex Mate 管理已有工具和本地记录,不是新的 AI 模型,也不替代原来的编程助手。第一次使用不必配置全部工具;先找回一段对话即可。
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 需要时,再管理其他工具
|
|
108
|
+
|
|
109
|
+
<a id="有什么独特之处"></a>
|
|
110
|
+
<a id="当前进展"></a>
|
|
111
|
+
|
|
112
|
+
<details>
|
|
113
|
+
<summary>Provider、Skills、提示词与集成能力</summary>
|
|
114
|
+
|
|
115
|
+
- **统一会话浏览器**: 集中浏览 Codex、Claude Code、Gemini CLI、CodeBuddy Code、WorkBuddy、Pi、OpenCode 与 Zed 的本地会话;检索、导出和删除的来源限制见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。会话详情默认显示五类预估 Token、构成条与健康评级,无需展开。
|
|
116
|
+
- **OpenAI 兼容桥接**: 通过归一化 Responses API,让 Codex 能够与任何支持 OpenAI 格式的 UI 配合使用;内建 Codex 转换会补齐并规范化 `User-Agent`、`Version`、`OpenAI-Beta`、`Originator` 等 Codex 指纹,对上游伪装为官方 Codex CLI 请求。
|
|
117
|
+
- **Claude Provider 桥接**: 通过内建本地 Claude 兼容代理,让 Claude Code 接入 OpenAI Chat Completions 兼容 provider 与 Ollama。
|
|
118
|
+
- **OpenCode Provider 控制**: 在 `~/.codexmate` 下维护 CodexMate 自有的 OpenCode 多 provider 存储,只将当前选中的 provider 投影到 OpenCode 原生配置,避免污染或误删用户已有配置。
|
|
119
|
+
- **Pi Provider 配置**: 在 Web UI 中管理 Pi 供应商,写入 `~/.pi/agent/models.json` 时无损保留未知字段,支持自动拉取远端模型列表,并可一键切换 `~/.pi/agent/settings.json` 中的默认供应商/模型。
|
|
120
|
+
- **Provider 健康清理**: 探测本地 Codex 与 Claude provider 路由,在同一个弹窗里集中展示失败配置,并批量清理已选坏配置,不影响正常或受保护项。
|
|
121
|
+
- **配置变更预览与撤销**: 六种工具写入前统一展示文件路径与脱敏字段差异;检测读取后及预览后的外部修改,支持撤销各工具最近一次变更,重启服务后仍可恢复。沿用设置中的预览开关,关闭后保留冲突检查与撤销。
|
|
122
|
+
- **Skills 市场**: 本地优先的市场,支持在不同的智能体应用之间共享和导入 Skills。
|
|
123
|
+
- **提示词文件编辑器**: 编辑全局及项目级 CLAUDE.md / AGENTS.md,支持通用预设池。应用预设先填写变量,只更新编辑器,需手动保存。历史支持版本 Diff;确认回滚后写入所选版本,保留原子备份,校验外部修改。页签和编辑目标选择会保存,刷新后恢复。Pi 文件仍在列表时保留选择;选项失效且无未保存草稿时才回到首项。Pi 页签动态列出 `~/.pi/agent/` 或 `<cwd>/.pi/` 直属 `.md`,进入页签或展开文件列表时更新;不自动加载提示词。 提示词页不显示配置加载占位,避免加载完成后页面缩短导致滚动回跳。 自动检测项目路径;OpenCode 的全局提示词文件位于 `~/.config/opencode/AGENTS.md`。
|
|
124
|
+
- **任务编排器**: 复用工作流定义自动推进任务,持久保存进度与结果,仅在阻塞时请求介入。
|
|
125
|
+
- **Provider 管理**: 切换 Codex、Claude、OpenCode、KiloCode、OpenClaw 与 Pi 的 provider/model
|
|
126
|
+
- **状态实时同步**: 实时感知 Codex/Claude 的配置与运行状态变更
|
|
127
|
+
- **Usage 统计**: 可视化消息趋势与热门项目统计
|
|
128
|
+
- **提示词模板**: 调用时弹窗填写变量,支持单模板 JSON 分享、插件模板配置历史 Diff 与回滚。`git_diff` 需粘贴差异文本,不执行命令。
|
|
129
|
+
- **MCP 集成**: 通过 MCP stdio 暴露本地工具与资源
|
|
130
|
+
- **自动更新**: 点击 Web UI 的新版本提示,弹窗查看版本与复制 `codexmate update`;在服务主机终端执行,更新成功后重启服务。点击与复制不执行更新
|
|
131
|
+
- **KiloCode 配置桥接**: 在 CLI 或 Web UI 配置 KiloCode Provider,写入 `~/.config/kilo/kilo.jsonc`,保留已存储的 API key。
|
|
132
|
+
|
|
133
|
+
</details>
|
|
134
|
+
|
|
135
|
+
<details>
|
|
136
|
+
<summary>会话工作台、用量、共享与外观说明</summary>
|
|
137
|
+
|
|
138
|
+
### 用量记录明细
|
|
139
|
+
|
|
140
|
+
在 Usage 页按需展开 UTC 记录明细,区分记录 Token、缓存分项与完整文本估算。当前适配 Codex、Claude、Pi 与 Gemini JSON 会话;旧图表和默认导出保持原口径,不计算费用。CLI 使用 `codexmate analytics export --attribution records`。详见[用量指南](https://sakurabytecore.github.io/codexmate/guide/sessions#用量记录明细)。
|
|
141
|
+
|
|
142
|
+
### 文件共享
|
|
143
|
+
|
|
144
|
+
选择文件或文件夹后手动上传,下载副本或复制 60 分钟有效的局域网文件链接。下载使用独立端口,不授权管理 API;移除批次或停止服务后链接失效,原文件保留。详见[文件共享指南](https://sakurabytecore.github.io/codexmate/guide/web-ui#文件共享)。
|
|
145
|
+
|
|
146
|
+
### 外观主题
|
|
147
|
+
|
|
148
|
+
在设置中选择浅色、深色、海洋蓝或柔紫。柔紫参考 [Catppuccin Latte](https://github.com/catppuccin/palette),使用浅底与紫色强调。主题自动保存,刷新后恢复。
|
|
149
|
+
|
|
150
|
+
<a id="路由组"></a>
|
|
151
|
+
### 模型测试
|
|
152
|
+
|
|
153
|
+
Codex/Pi 子页签选择会保存,刷新后恢复。选择已有配置中的供应商与模型,手动输入问题后发送。查看 Markdown 回复、返回模型 ID 与耗时秒数。测试消耗 API 额度;不启动 CLI、不改配置、不保存测试记录。单次只发一个请求,不自动重试,不设本地响应超时,输出上限 2048 Token。支持配置中的 Responses、Chat Completions、Completions 与 Anthropic Messages;原生登录与命令式凭据暂不接入。Web 已移除模型组设置入口,已有后端分配与 OpenAI Chat API 保持原行为。详见 [Web UI 指南](https://sakurabytecore.github.io/codexmate/guide/web-ui)。
|
|
154
|
+
|
|
155
|
+
测试请求使用 Codex UA/Originator 或 Pi 的 SDK 请求头,已有自定义 UA 优先。读取 Codex 的推理/输出配置及 Pi 模型的 Token 上限与兼容参数。无法读取客户端版本时使用带版本的 CodexMate 测试标识,不伪造客户端版本。
|
|
156
|
+
|
|
157
|
+
### 会话工作台
|
|
158
|
+
|
|
159
|
+
会话页新增消息收藏、备注与标签、本地增量全文索引、带来源证据的交接草稿、只读项目聚合与模型窗口参考。收藏保存在本机,不改原会话;索引仅覆盖已发现候选,新增消息需更新索引;历史文本占比不是实际请求窗口占用。设置页提供本地诊断与脱敏 JSON/Markdown 导出,勾选后才探测当前 Codex 路由或启动选定 MCP,不调用写工具。详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。
|
|
160
|
+
|
|
161
|
+
跨会话证据包支持从索引结果累计材料,生成前核对原文哈希,下载 Markdown;刷新只清空新材料篮。Usage 可单独展开费用参考,使用 [Wei-Shaw/model-price-repo](https://github.com/Wei-Shaw/model-price-repo) 的内置版本快照,未知与已知小计分开,不是账单,不自动联网更新。项目工作台新增只读 Git 状态与提交文件统计;前后 24 小时关联仅为时间候选,不证明因果。三项功能不调用模型、不自动发送会话;价格不包含阶梯、服务层、缓存时长或工具及多模态附加费。
|
|
162
|
+
|
|
163
|
+
证据专题夹可显式保存命名材料引用,刷新后手动打开并复核原文;临时材料篮仍清空,不备份会话全文。Git 提交详情新增开发故事线,手工关联会话与改动原因,保留跨项目隔离;仅写本机元数据,不改 Git,不证明因果或测试通过。详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。
|
|
164
|
+
|
|
165
|
+
材料篮新增开发小票与多 Agent 接力包:选择输出格式,填写目标与可选说明,复核原文后下载 Markdown。只整理历史材料;不调用模型、不执行命令、不自动发送,当前版本仍待验收。说明不保存到专题,打开专题会清空。
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 与同类工具对比
|
|
172
|
+
|
|
173
|
+
按主要用途选择工具,而非将下表视为互斥功能清单。各项目存在功能重叠,也可以搭配使用。
|
|
174
|
+
|
|
175
|
+
| 工具 | 主要定位 | 适合的需求 |
|
|
176
|
+
| --- | --- | --- |
|
|
177
|
+
| **Codex Mate** | 本地优先的跨工具会话与配置管理,提供 CLI + Web 和桌面入口 | 在一个界面找回、筛选和导出不同工具的历史对话,集中管理 Provider、Skills 与任务工作流 |
|
|
178
|
+
| [CC Switch](https://github.com/farion1231/cc-switch) | 多种 AI 编程工具的桌面配置管理器,集中管理 Provider、MCP、Skills 与提示词 | 主要需要切换 API Provider,减少手工编辑各工具的配置文件 |
|
|
179
|
+
| [CloudCLI(Claude Code UI)](https://github.com/siteboon/claudecodeui) | 面向 Claude Code、Cursor CLI 和 Codex 的桌面与移动端 Web 界面 | 主要需要在浏览器或手机上使用编程助手,访问本地或远程项目与会话 |
|
|
180
|
+
| [ccusage](https://github.com/ryoppippi/ccusage) | 从本地编程智能体记录分析 Token 用量与费用的 CLI | 主要需要按日、周、月或会话查看用量与费用报表 |
|
|
181
|
+
|
|
182
|
+
**选择 Codex Mate 的理由**:将跨工具历史会话查阅、Markdown 归档与日常配置、Skills、任务管理放在同一入口,不必更换原来的编程助手。
|
|
183
|
+
|
|
184
|
+
对比依据为上方链接中的官方项目说明;不代表其他工具缺少未列出的功能,也不是性能或价格排名。Codex Mate 的会话操作能力因来源而异,详见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions);导出与交接不等于无损迁移完整会话状态,本地运行也不等于模型离线运行。
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
148
188
|
## 线程交接
|
|
149
189
|
|
|
150
190
|
通过共享记忆 MCP 向目标智能体交接结构化卡片,不等于恢复完整会话状态。先保存 `card.json`:`goal` 为字符串,`completed`、`blockers`、`nextSteps`、`files` 均为字符串数组。
|
|
@@ -177,44 +217,6 @@ node cli.js thread ack <thread-id> --handoff <id> --agent <target> --evidence <s
|
|
|
177
217
|
|
|
178
218
|
---
|
|
179
219
|
|
|
180
|
-
## 有什么独特之处?
|
|
181
|
-
|
|
182
|
-
找回对话之后,还可以继续管理日常工作所需的配置、Skills 与任务:
|
|
183
|
-
- **统一会话浏览器**:集中浏览 Codex、Claude Code、Gemini CLI、CodeBuddy Code、WorkBuddy、Pi、OpenCode 与 Zed 的本地会话;检索、导出和删除的来源限制见[会话指南](https://sakurabytecore.github.io/codexmate/guide/sessions)。会话详情默认显示五类预估 Token、构成条与健康评级,无需展开。
|
|
184
|
-
- **OpenAI 兼容桥接**:通过归一化 Responses API,让 Codex 能够与任何支持 OpenAI 格式的 UI 配合使用;内建 Codex 转换会补齐并规范化 `User-Agent`、`Version`、`OpenAI-Beta`、`Originator` 等 Codex 指纹,对上游伪装为官方 Codex CLI 请求。
|
|
185
|
-
- **Claude Provider 桥接**:通过内建本地 Claude 兼容代理,让 Claude Code 接入 OpenAI Chat Completions 兼容 provider 与 Ollama。
|
|
186
|
-
- **OpenCode Provider 控制**:在 `~/.codexmate` 下维护 CodexMate 自有的 OpenCode 多 provider 存储,只将当前选中的 provider 投影到 OpenCode 原生配置,避免污染或误删用户已有配置。
|
|
187
|
-
- **Pi Provider 配置**:在 Web UI 中管理 Pi 供应商,写入 `~/.pi/agent/models.json` 时无损保留未知字段,支持自动拉取远端模型列表,并可一键切换 `~/.pi/agent/settings.json` 中的默认供应商/模型。
|
|
188
|
-
- **Provider 健康清理**:探测本地 Codex 与 Claude provider 路由,在同一个弹窗里集中展示失败配置,并批量清理已选坏配置,不影响正常或受保护项。
|
|
189
|
-
- **配置变更预览与撤销**:六种工具写入前统一展示文件路径与脱敏字段差异;检测读取后及预览后的外部修改,支持撤销各工具最近一次变更,重启服务后仍可恢复。沿用设置中的预览开关,关闭后保留冲突检查与撤销。
|
|
190
|
-
- **Skills 市场**:本地优先的市场,支持在不同的智能体应用之间共享和导入 Skills。
|
|
191
|
-
- **提示词文件编辑器**:统一编辑全局和项目级 `CLAUDE.md` 与 `AGENTS.md`(含 OpenCode 的 `~/.config/opencode/AGENTS.md`),支持项目路径自动检测,并提供通用预设池复用 prompt。
|
|
192
|
-
- **任务编排器**:复用工作流定义自动推进任务,持久保存进度与结果,仅在阻塞时请求介入。
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## 当前进展
|
|
197
|
-
|
|
198
|
-
| 特性 | 状态 | 描述 |
|
|
199
|
-
| --- | --- | --- |
|
|
200
|
-
| **Provider 管理** | ✅ | 切换 Codex、Claude、OpenCode、KiloCode、OpenClaw 与 Pi 的 provider/model |
|
|
201
|
-
| **状态实时同步** | ✅ | 实时感知 Codex/Claude 的配置与运行状态变更 |
|
|
202
|
-
| **会话浏览器** | ✅ | 集中浏览与筛选本地会话,按来源提供检索、Markdown 导出等操作;详见会话指南 |
|
|
203
|
-
| **Usage 统计** | ✅ | 可视化消息趋势与热门项目统计 |
|
|
204
|
-
| **本地 Skills 市场** | ✅ | 跨应用的智能体 Skills 导入与导出 |
|
|
205
|
-
| **任务队列** | ✅ | 支持依赖的自动工作流、持久进度、安全恢复与结果汇总 |
|
|
206
|
-
| **OpenAI 桥接** | ✅ | 将 Codex Responses API 转换为标准 OpenAI 格式,并在内建转换中附加/规范化 Codex 指纹 |
|
|
207
|
-
| **Claude Provider 桥接** | ✅ | 通过内建 Claude 兼容代理,让 Claude Code 接入 OpenAI Chat Completions 兼容 provider 与 Ollama |
|
|
208
|
-
| **OpenCode Provider 存储** | ✅ | 在 `~/.codexmate` 中保留多个 OpenCode provider,只将当前选中的 provider 投影到 OpenCode 原生配置 |
|
|
209
|
-
| **Pi Provider 配置** | ✅ | 在 Web UI 中管理 Pi 供应商,写入 `~/.pi/agent/models.json`(未知字段无损保留),并切换 `~/.pi/agent/settings.json` 中的默认供应商/模型 |
|
|
210
|
-
| **Provider 健康检查** | ✅ | 探测本地 Codex/Claude provider 路由,标记失败配置,并安全批量移除已选坏配置 |
|
|
211
|
-
| **提示词模板** | ✅ | 调用时弹窗填写变量,支持单模板 JSON 分享、插件模板配置历史 Diff 与回滚。`git_diff` 需粘贴差异文本,不执行命令。 |
|
|
212
|
-
| **提示词文件编辑器** | ✅ | 编辑全局及项目级 CLAUDE.md / AGENTS.md,支持通用预设池。应用预设先填写变量,只更新编辑器,需手动保存。历史支持版本 Diff;确认回滚后写入所选版本,保留原子备份,校验外部修改。页签和编辑目标选择会保存,刷新后恢复。Pi 文件仍在列表时保留选择;选项失效且无未保存草稿时才回到首项。Pi 页签动态列出 `~/.pi/agent/` 或 `<cwd>/.pi/` 直属 `.md`,进入页签或展开文件列表时更新;不自动加载提示词。 提示词页不显示配置加载占位,避免加载完成后页面缩短导致滚动回跳。 |
|
|
213
|
-
| **MCP 集成** | ✅ | 通过 MCP stdio 暴露本地工具与资源 |
|
|
214
|
-
| **自动更新** | ✅ | 点击 Web UI 的新版本提示,弹窗查看版本与复制 `codexmate update`;在服务主机终端执行,更新成功后重启服务。点击与复制不执行更新 |
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
220
|
## 自动工作流:提交后无需持续看守
|
|
219
221
|
|
|
220
222
|
复用现有工作流定义,提交一次后由后端自动推进。首页“自动工作流”提供提交、结果查询、补充输入后继续、取消后续执行。关闭页面不影响任务;服务停止期间不执行任务。
|
|
@@ -305,6 +307,8 @@ flowchart TD
|
|
|
305
307
|
<img src="https://contrib.rocks/image?repo=SakuraByteCore/codexmate" />
|
|
306
308
|
</a>
|
|
307
309
|
|
|
310
|
+
---
|
|
311
|
+
|
|
308
312
|
## 开源协议
|
|
309
313
|
|
|
310
314
|
Apache-2.0
|
package/cli/skills.js
CHANGED
|
@@ -30,6 +30,9 @@ const MAX_UPLOAD_SIZE = 200 * 1024 * 1024;
|
|
|
30
30
|
const MAX_SKILLS_ZIP_UPLOAD_SIZE = 20 * 1024 * 1024;
|
|
31
31
|
const MAX_SKILLS_ZIP_ENTRY_COUNT = 2000;
|
|
32
32
|
const MAX_SKILLS_ZIP_UNCOMPRESSED_BYTES = 512 * 1024 * 1024;
|
|
33
|
+
const SKILLS_BACKUP_FORMAT = 'codexmate-skills-backup';
|
|
34
|
+
const SKILLS_BACKUP_MANIFEST = `${SKILLS_BACKUP_FORMAT}.json`;
|
|
35
|
+
const MAX_SKILLS_BACKUP_MANIFEST_BYTES = 2 * 1024 * 1024;
|
|
33
36
|
|
|
34
37
|
function getCodexSkillsDir() {
|
|
35
38
|
const joinPath = (basePath, ...segments) => {
|
|
@@ -753,6 +756,83 @@ function resolveSkillNameFromImportedDirectory(skillDir, extractionRoot, fallbac
|
|
|
753
756
|
return normalizeCodexSkillName(candidate);
|
|
754
757
|
}
|
|
755
758
|
|
|
759
|
+
function readSkillsBackupEntries(extractionRoot) {
|
|
760
|
+
const topLevel = fs.readdirSync(extractionRoot, { withFileTypes: true });
|
|
761
|
+
if (!topLevel.some((entry) => entry.name === SKILLS_BACKUP_MANIFEST && entry.isFile())) return null;
|
|
762
|
+
const manifestPath = path.join(extractionRoot, SKILLS_BACKUP_MANIFEST);
|
|
763
|
+
if (fs.statSync(manifestPath).size > MAX_SKILLS_BACKUP_MANIFEST_BYTES) return null;
|
|
764
|
+
let manifest;
|
|
765
|
+
try {
|
|
766
|
+
manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
767
|
+
} catch (error) {
|
|
768
|
+
if (error instanceof SyntaxError) return null;
|
|
769
|
+
throw error;
|
|
770
|
+
}
|
|
771
|
+
if (manifest?.format !== SKILLS_BACKUP_FORMAT || manifest.version !== 1
|
|
772
|
+
|| !Array.isArray(manifest.skills) || !manifest.skills.length) return null;
|
|
773
|
+
|
|
774
|
+
const directories = new Set(topLevel.filter((entry) => entry.isDirectory()).map((entry) => entry.name));
|
|
775
|
+
const names = new Set();
|
|
776
|
+
for (const item of manifest.skills) {
|
|
777
|
+
const { name } = normalizeCodexSkillName(item?.name);
|
|
778
|
+
if (!name || name !== item.name || names.has(name) || !directories.has(name)
|
|
779
|
+
|| typeof item.hasSkillFile !== 'boolean') return null;
|
|
780
|
+
const sourcePath = path.join(extractionRoot, name);
|
|
781
|
+
if (path.relative(extractionRoot, sourcePath) !== name) return null;
|
|
782
|
+
const entries = fs.readdirSync(sourcePath, { withFileTypes: true });
|
|
783
|
+
// v1 export copies regular contents, never archived links. Validate before touching the target.
|
|
784
|
+
const pending = entries.map((entry) => ({ entry, parent: sourcePath }));
|
|
785
|
+
while (pending.length) {
|
|
786
|
+
const { entry, parent } = pending.pop();
|
|
787
|
+
if (entry.isFile()) continue;
|
|
788
|
+
if (!entry.isDirectory()) return null;
|
|
789
|
+
const directory = path.join(parent, entry.name);
|
|
790
|
+
for (const child of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
791
|
+
pending.push({ entry: child, parent: directory });
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
names.add(name);
|
|
795
|
+
}
|
|
796
|
+
return names;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
function restoreSkillsBackup(extractionRoot, target, targetRoot) {
|
|
800
|
+
const names = readSkillsBackupEntries(extractionRoot);
|
|
801
|
+
if (!names) return { error: '不是有效的 v1 Skills 备份', backupError: 'invalid' };
|
|
802
|
+
if (isPathInside(targetRoot, extractionRoot)) return { error: '目标路径不能位于备份解压目录内' };
|
|
803
|
+
|
|
804
|
+
const imported = [];
|
|
805
|
+
const skipped = [];
|
|
806
|
+
const failed = [];
|
|
807
|
+
ensureDir(targetRoot);
|
|
808
|
+
for (const name of names) {
|
|
809
|
+
const destination = path.join(targetRoot, name);
|
|
810
|
+
let created = false;
|
|
811
|
+
try {
|
|
812
|
+
// Reserve the name without replacing an existing directory, file or symlink.
|
|
813
|
+
fs.mkdirSync(destination, { mode: 0o700 });
|
|
814
|
+
created = true;
|
|
815
|
+
copyDirRecursive(path.join(extractionRoot, name), destination, { dereferenceSymlinks: false });
|
|
816
|
+
imported.push({ name, path: destination });
|
|
817
|
+
} catch (error) {
|
|
818
|
+
if (!created && error.code === 'EEXIST') {
|
|
819
|
+
skipped.push({ name });
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
let message = error.message;
|
|
823
|
+
if (created) {
|
|
824
|
+
try {
|
|
825
|
+
removeDirectoryRecursive(destination);
|
|
826
|
+
} catch (cleanupError) {
|
|
827
|
+
message += `;清理未完成:${cleanupError.message}`;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
failed.push({ name, error: message });
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return { success: failed.length === 0, imported, skipped, failed, targetApp: target.app, targetLabel: target.label, root: targetRoot };
|
|
834
|
+
}
|
|
835
|
+
|
|
756
836
|
async function importSkillsFromZipFile(zipPath, options = {}) {
|
|
757
837
|
const getPathApi = (basePath) => {
|
|
758
838
|
const base = typeof basePath === 'string' ? basePath.trim() : '';
|
|
@@ -776,12 +856,16 @@ async function importSkillsFromZipFile(zipPath, options = {}) {
|
|
|
776
856
|
}
|
|
777
857
|
targetRoot = resolveCopyTargetRoot(target.dir);
|
|
778
858
|
const targetPathApi = getPathApi(targetRoot);
|
|
859
|
+
if (options.restoreBackup === true && fs.statSync(zipPath).size > MAX_SKILLS_ZIP_UPLOAD_SIZE) {
|
|
860
|
+
return { error: '备份文件过大(>20MB)', backupError: 'tooLarge' };
|
|
861
|
+
}
|
|
779
862
|
await inspectZipArchiveLimits(zipPath, {
|
|
780
863
|
maxEntryCount: MAX_SKILLS_ZIP_ENTRY_COUNT,
|
|
781
864
|
maxUncompressedBytes: MAX_SKILLS_ZIP_UNCOMPRESSED_BYTES
|
|
782
865
|
});
|
|
783
866
|
|
|
784
867
|
await extractUploadZip(zipPath, extractionRoot);
|
|
868
|
+
if (options.restoreBackup === true) return restoreSkillsBackup(extractionRoot, target, targetRoot);
|
|
785
869
|
const discovery = collectSkillDirectoriesFromRoot(extractionRoot, MAX_SKILLS_ZIP_ENTRY_COUNT);
|
|
786
870
|
const discoveredDirs = discovery.results;
|
|
787
871
|
if (discoveredDirs.length === 0) {
|
|
@@ -951,7 +1035,7 @@ async function exportSkills(params = {}) {
|
|
|
951
1035
|
const exported = [];
|
|
952
1036
|
const failed = [];
|
|
953
1037
|
const manifest = {
|
|
954
|
-
format:
|
|
1038
|
+
format: SKILLS_BACKUP_FORMAT,
|
|
955
1039
|
version: 1,
|
|
956
1040
|
createdAt: new Date().toISOString(),
|
|
957
1041
|
targetApp: target.app,
|
|
@@ -980,6 +1064,7 @@ async function exportSkills(params = {}) {
|
|
|
980
1064
|
continue;
|
|
981
1065
|
}
|
|
982
1066
|
|
|
1067
|
+
const targetPath = path.join(stagingRoot, normalizedName.name);
|
|
983
1068
|
try {
|
|
984
1069
|
const lstat = fs.lstatSync(sourcePath);
|
|
985
1070
|
if (!lstat.isDirectory() && !lstat.isSymbolicLink()) {
|
|
@@ -992,7 +1077,6 @@ async function exportSkills(params = {}) {
|
|
|
992
1077
|
failed.push({ name: normalizedName.name, error: '来源 skill 无法读取' });
|
|
993
1078
|
continue;
|
|
994
1079
|
}
|
|
995
|
-
const targetPath = path.join(stagingRoot, normalizedName.name);
|
|
996
1080
|
const visitedRealPaths = new Set([sourceDirForCopy]);
|
|
997
1081
|
copyDirRecursive(sourceDirForCopy, targetPath, {
|
|
998
1082
|
dereferenceSymlinks: true,
|
|
@@ -1009,6 +1093,7 @@ async function exportSkills(params = {}) {
|
|
|
1009
1093
|
hasSkillFile: fs.existsSync(path.join(targetPath, 'SKILL.md'))
|
|
1010
1094
|
});
|
|
1011
1095
|
} catch (e) {
|
|
1096
|
+
if (includeAll) fs.rmSync(targetPath, { recursive: true, force: true });
|
|
1012
1097
|
failed.push({
|
|
1013
1098
|
name: normalizedName.name,
|
|
1014
1099
|
error: e && e.message ? e.message : '导出失败'
|
|
@@ -1038,9 +1123,22 @@ async function exportSkills(params = {}) {
|
|
|
1038
1123
|
} catch (_) {}
|
|
1039
1124
|
}
|
|
1040
1125
|
if (includeAll) {
|
|
1041
|
-
fs.writeFileSync(path.join(stagingRoot,
|
|
1126
|
+
fs.writeFileSync(path.join(stagingRoot, SKILLS_BACKUP_MANIFEST), JSON.stringify(manifest, null, 2), 'utf8');
|
|
1042
1127
|
}
|
|
1043
1128
|
await zipLib.archiveFolder(stagingRoot, zipFilePath);
|
|
1129
|
+
let restoreWarning = '';
|
|
1130
|
+
if (includeAll) {
|
|
1131
|
+
try {
|
|
1132
|
+
if (fs.statSync(zipFilePath).size > MAX_SKILLS_ZIP_UPLOAD_SIZE
|
|
1133
|
+
|| fs.statSync(path.join(stagingRoot, SKILLS_BACKUP_MANIFEST)).size > MAX_SKILLS_BACKUP_MANIFEST_BYTES) {
|
|
1134
|
+
restoreWarning = '备份超过网页导入限制';
|
|
1135
|
+
} else {
|
|
1136
|
+
await inspectZipArchiveLimits(zipFilePath);
|
|
1137
|
+
}
|
|
1138
|
+
} catch (error) {
|
|
1139
|
+
restoreWarning = error.message;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1044
1142
|
const artifact = registerDownloadArtifact(zipFilePath, {
|
|
1045
1143
|
fileName: zipFileName,
|
|
1046
1144
|
deleteAfterDownload: true
|
|
@@ -1055,7 +1153,8 @@ async function exportSkills(params = {}) {
|
|
|
1055
1153
|
targetApp: target.app,
|
|
1056
1154
|
targetLabel: target.label,
|
|
1057
1155
|
root: target.dir,
|
|
1058
|
-
backup: includeAll ? manifest : null
|
|
1156
|
+
backup: includeAll ? manifest : null,
|
|
1157
|
+
...(restoreWarning ? { restoreWarning } : {})
|
|
1059
1158
|
};
|
|
1060
1159
|
} catch (e) {
|
|
1061
1160
|
return {
|
package/cli.js
CHANGED
|
@@ -1166,7 +1166,7 @@ function normalizeSessionTimelineStylePreference(value) {
|
|
|
1166
1166
|
|
|
1167
1167
|
function normalizeSettingsTabPreference(value) {
|
|
1168
1168
|
const normalized = typeof value === 'string' ? value.trim().toLowerCase() : '';
|
|
1169
|
-
return normalized === 'data'
|
|
1169
|
+
return normalized === 'data' || normalized === 'about' ? normalized : 'general';
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
1172
|
function normalizeMainTabPreference(value) {
|
|
@@ -14389,6 +14389,8 @@ async function handleImportSkillsZipUpload(req, res, options = {}) {
|
|
|
14389
14389
|
writeJsonResponse(res, 400, { error: '目标宿主不支持' });
|
|
14390
14390
|
return;
|
|
14391
14391
|
}
|
|
14392
|
+
const restoreBackup = !forcedTargetApp
|
|
14393
|
+
&& new URL(req.url || '/', 'http://localhost').searchParams.get('mode') === 'backup';
|
|
14392
14394
|
const fileName = resolveUploadFileNameFromRequest(req, `${targetApp}-skills.zip`);
|
|
14393
14395
|
const upload = await writeUploadZipStream(
|
|
14394
14396
|
req,
|
|
@@ -14399,7 +14401,8 @@ async function handleImportSkillsZipUpload(req, res, options = {}) {
|
|
|
14399
14401
|
const result = await importSkillsFromZipFile(upload.zipPath, {
|
|
14400
14402
|
tempDir: upload.tempDir,
|
|
14401
14403
|
fallbackName: fileName,
|
|
14402
|
-
targetApp
|
|
14404
|
+
targetApp,
|
|
14405
|
+
...(restoreBackup ? { restoreBackup: true } : {})
|
|
14403
14406
|
});
|
|
14404
14407
|
writeJsonResponse(res, 200, result || {});
|
|
14405
14408
|
} catch (e) {
|
package/package.json
CHANGED
package/web-ui/app.js
CHANGED
|
@@ -114,6 +114,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
114
114
|
promptsSubTab: 'codex',
|
|
115
115
|
promptsPreviewEnabled: true,
|
|
116
116
|
promptsPreviewCollapsed: true,
|
|
117
|
+
promptsOutlineCollapsed: false,
|
|
117
118
|
agentsChangeAxis: { mode: 'edit', ticks: [], truncated: false, totalLines: 0, added: 0, removed: 0 },
|
|
118
119
|
sysChangeAxis: { mode: 'edit', ticks: [], truncated: false, totalLines: 0, added: 0, removed: 0 },
|
|
119
120
|
promptsMobileView: 'edit',
|
|
@@ -123,6 +124,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
123
124
|
promptsPathReferenceCacheKey: '',
|
|
124
125
|
agentsPreviewHtml: '',
|
|
125
126
|
sysPromptPreviewHtml: '',
|
|
127
|
+
agentsPreviewHeadings: [],
|
|
128
|
+
sysPreviewHeadings: [],
|
|
126
129
|
projectClaudeMdPath: '',
|
|
127
130
|
promptHistoryVisible: false,
|
|
128
131
|
promptHistoryLoading: false,
|
|
@@ -471,6 +474,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
471
474
|
currentClaudeConfig: '',
|
|
472
475
|
currentClaudeModel: '',
|
|
473
476
|
claudeCustomModelDraft: '',
|
|
477
|
+
claudeProviderPresetQuery: '',
|
|
478
|
+
claudeAddFromPreset: false,
|
|
474
479
|
editingConfig: { name: '', apiKey: '', baseUrl: '', model: '', targetApi: 'responses' },
|
|
475
480
|
claudeConfigs: {
|
|
476
481
|
'智谱GLM': {
|
|
@@ -891,6 +896,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
891
896
|
},
|
|
892
897
|
|
|
893
898
|
watch: {
|
|
899
|
+
mainPanelTabKey: {
|
|
900
|
+
flush: 'post',
|
|
901
|
+
handler() {
|
|
902
|
+
const root = document.getElementById('app');
|
|
903
|
+
root?.querySelector('.main-panel')?.scrollTo({ top: 0, left: 0, behavior: 'instant' });
|
|
904
|
+
// The outer app container owns vertical scroll in the narrow touch layout.
|
|
905
|
+
if (root?.scrollTop) root.scrollTo({ top: 0, behavior: 'instant' });
|
|
906
|
+
}
|
|
907
|
+
},
|
|
894
908
|
mainTab(newTab) {
|
|
895
909
|
if (typeof this.isMainTabDisabled === 'function' && this.isMainTabDisabled(newTab)) {
|
|
896
910
|
const fallbackTab = typeof this.getFirstSelectableMainTab === 'function'
|
package/web-ui/logic.codex.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// 所以 catalog 仅按 baseUrl 的 host/path 命中。
|
|
4
4
|
|
|
5
5
|
const DEFAULT_OPENAI_CODEX_CATALOG = Object.freeze([
|
|
6
|
+
'gpt-5.4-mini',
|
|
6
7
|
'gpt-5-codex',
|
|
7
8
|
'gpt-5',
|
|
8
9
|
'gpt-5-mini',
|
|
@@ -46,6 +47,19 @@ export function getCodexModelCatalogForProvider(provider) {
|
|
|
46
47
|
// model 字段为可选首选项(添加后由前端写入内存字典 currentModels[name])。
|
|
47
48
|
// useTransform=true 表示该服务需通过内建 OpenAI bridge 转发。
|
|
48
49
|
export const CODEX_PROVIDER_TEMPLATES = Object.freeze([
|
|
50
|
+
{
|
|
51
|
+
label: 'OpenAI API',
|
|
52
|
+
name: 'openai-api',
|
|
53
|
+
url: 'https://api.openai.com/v1',
|
|
54
|
+
model: 'gpt-5.4-mini'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'Groq',
|
|
58
|
+
name: 'groq',
|
|
59
|
+
url: 'https://api.groq.com/openai/v1',
|
|
60
|
+
model: 'openai/gpt-oss-120b',
|
|
61
|
+
useTransform: true
|
|
62
|
+
},
|
|
49
63
|
{
|
|
50
64
|
label: 'MuAPI',
|
|
51
65
|
name: 'muapi',
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export function createMainTabsComputed() {
|
|
2
2
|
return {
|
|
3
|
+
mainPanelTabKey() {
|
|
4
|
+
switch (this.mainTab) {
|
|
5
|
+
case 'config': return `config:${this.configMode}`;
|
|
6
|
+
case 'settings': return `settings:${this.settingsTab}`;
|
|
7
|
+
case 'prompts': return `prompts:${this.promptsSubTab}`;
|
|
8
|
+
case 'plugins':
|
|
9
|
+
if (this.pluginsActiveId === 'prompt-templates') return `plugins:prompt-templates:${this.promptTemplatesMode}`;
|
|
10
|
+
if (this.pluginsActiveId === 'text-tools') return `plugins:text-tools:${this.textToolsActiveToolId}`;
|
|
11
|
+
return `plugins:${this.pluginsActiveId}`;
|
|
12
|
+
default: return this.mainTab;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
3
15
|
mainTabKicker() {
|
|
4
16
|
if (this.mainTab === 'dashboard') return this.t('kicker.dashboard');
|
|
5
17
|
if (this.mainTab === 'config') return this.t('kicker.config');
|
|
@@ -1082,9 +1082,6 @@ export function createAgentsMethods(options = {}) {
|
|
|
1082
1082
|
this.__skipNextPromptsSubTabLoad = true;
|
|
1083
1083
|
this.promptsSubTab = normalized;
|
|
1084
1084
|
if (typeof this.loadPromptsTabContent === 'function') this.loadPromptsTabContent();
|
|
1085
|
-
this.$nextTick(() => {
|
|
1086
|
-
document.querySelector('.main-panel')?.scrollTo({ top: 0, left: 0, behavior: 'auto' });
|
|
1087
|
-
});
|
|
1088
1085
|
},
|
|
1089
1086
|
|
|
1090
1087
|
async loadPromptsTabContent() {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CLAUDE_PROVIDER_PRESETS } from './claude-provider-presets.mjs';
|
|
1
2
|
import { nextClaudeConfigName } from './provider-default-names.mjs';
|
|
2
3
|
|
|
3
4
|
function normalizeClaudeText(value) {
|
|
@@ -152,8 +153,8 @@ export function createClaudeConfigMethods(options = {}) {
|
|
|
152
153
|
this.onClaudeModelChange();
|
|
153
154
|
},
|
|
154
155
|
|
|
155
|
-
saveClaudeConfigs() {
|
|
156
|
-
if (typeof this.normalizeStoredClaudeConfigs === 'function') {
|
|
156
|
+
saveClaudeConfigs({ syncBridge = true } = {}) {
|
|
157
|
+
if (syncBridge && typeof this.normalizeStoredClaudeConfigs === 'function') {
|
|
157
158
|
this.normalizeStoredClaudeConfigs();
|
|
158
159
|
}
|
|
159
160
|
if (typeof this.persistWebUiPreferences === 'function') {
|
|
@@ -162,7 +163,7 @@ export function createClaudeConfigMethods(options = {}) {
|
|
|
162
163
|
currentClaudeConfig: this.currentClaudeConfig || ''
|
|
163
164
|
});
|
|
164
165
|
}
|
|
165
|
-
this.syncClaudeBridgeProviders();
|
|
166
|
+
if (syncBridge) this.syncClaudeBridgeProviders();
|
|
166
167
|
},
|
|
167
168
|
|
|
168
169
|
rememberDeletedClaudeSettingsImport(config) {
|
|
@@ -288,6 +289,7 @@ export function createClaudeConfigMethods(options = {}) {
|
|
|
288
289
|
},
|
|
289
290
|
|
|
290
291
|
openCloneClaudeConfigModal(name, config) {
|
|
292
|
+
this.claudeAddFromPreset = false;
|
|
291
293
|
this.newClaudeConfig = {
|
|
292
294
|
name: '',
|
|
293
295
|
apiKey: config.apiKey || '',
|
|
@@ -429,9 +431,14 @@ export function createClaudeConfigMethods(options = {}) {
|
|
|
429
431
|
|
|
430
432
|
this.claudeConfigs[name] = this.mergeClaudeConfig({}, this.newClaudeConfig);
|
|
431
433
|
|
|
432
|
-
|
|
433
|
-
this.
|
|
434
|
+
const saveOnly = this.claudeAddFromPreset;
|
|
435
|
+
if (!saveOnly) this.currentClaudeConfig = name;
|
|
436
|
+
this.saveClaudeConfigs({ syncBridge: !saveOnly });
|
|
434
437
|
this.closeClaudeConfigModal();
|
|
438
|
+
if (saveOnly) {
|
|
439
|
+
this.showMessage(this.t('toast.operation.success'), 'success');
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
435
442
|
await this.applyClaudeConfig(name);
|
|
436
443
|
},
|
|
437
444
|
|
|
@@ -530,7 +537,21 @@ export function createClaudeConfigMethods(options = {}) {
|
|
|
530
537
|
}
|
|
531
538
|
},
|
|
532
539
|
|
|
540
|
+
matchingClaudeProviderPresets() {
|
|
541
|
+
const query = (this.claudeProviderPresetQuery || '').trim().toLowerCase();
|
|
542
|
+
return CLAUDE_PROVIDER_PRESETS.filter(({ name, baseUrl, model }) =>
|
|
543
|
+
[name, baseUrl, model].some(value => value.toLowerCase().includes(query)));
|
|
544
|
+
},
|
|
545
|
+
|
|
546
|
+
openClaudeProviderPreset(preset) {
|
|
547
|
+
if (!this.isToolConfigWriteAllowed('claude')) return;
|
|
548
|
+
this.openClaudeConfigModal();
|
|
549
|
+
Object.assign(this.newClaudeConfig, preset);
|
|
550
|
+
this.claudeAddFromPreset = true;
|
|
551
|
+
},
|
|
552
|
+
|
|
533
553
|
closeClaudeConfigModal() {
|
|
554
|
+
this.claudeAddFromPreset = false;
|
|
534
555
|
this.showClaudeConfigModal = false;
|
|
535
556
|
this.showAddClaudeConfigKey = false;
|
|
536
557
|
this.newClaudeConfig = {
|