codexmate 0.0.56 → 0.1.1

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 (42) hide show
  1. package/README.md +2 -2
  2. package/README.vi.md +1 -0
  3. package/README.zh.md +2 -2
  4. package/cli/openai-bridge-retry.js +62 -0
  5. package/cli/openai-bridge-runtime.js +1819 -0
  6. package/cli/openai-bridge.js +137 -2048
  7. package/cli.js +749 -133
  8. package/lib/task-orchestrator.js +90 -21
  9. package/lib/task-workspace-chat.js +292 -0
  10. package/package.json +2 -2
  11. package/web-ui/app.js +67 -131
  12. package/web-ui/modules/app.computed.main-tabs.mjs +304 -7
  13. package/web-ui/modules/app.methods.agents.mjs +192 -1
  14. package/web-ui/modules/app.methods.claude-config.mjs +65 -25
  15. package/web-ui/modules/app.methods.navigation.mjs +67 -83
  16. package/web-ui/modules/app.methods.openclaw-editing.mjs +3 -6
  17. package/web-ui/modules/app.methods.providers.mjs +40 -10
  18. package/web-ui/modules/app.methods.session-actions.mjs +1 -12
  19. package/web-ui/modules/app.methods.session-browser.mjs +23 -54
  20. package/web-ui/modules/app.methods.session-trash.mjs +0 -1
  21. package/web-ui/modules/app.methods.startup-claude.mjs +16 -31
  22. package/web-ui/modules/app.methods.task-orchestration.mjs +347 -8
  23. package/web-ui/modules/app.methods.tool-config-permissions.mjs +0 -3
  24. package/web-ui/modules/app.methods.web-ui-preferences.mjs +442 -68
  25. package/web-ui/modules/config-template-confirm-pref.mjs +2 -3
  26. package/web-ui/modules/i18n/locales/en.mjs +181 -30
  27. package/web-ui/modules/i18n/locales/ja.mjs +178 -27
  28. package/web-ui/modules/i18n/locales/vi.mjs +180 -29
  29. package/web-ui/modules/i18n/locales/zh-tw.mjs +181 -30
  30. package/web-ui/modules/i18n/locales/zh.mjs +183 -32
  31. package/web-ui/modules/i18n.mjs +5 -12
  32. package/web-ui/modules/sessions-filters-url.mjs +1 -2
  33. package/web-ui/partials/index/layout-header.html +44 -38
  34. package/web-ui/partials/index/modals-basic.html +26 -0
  35. package/web-ui/partials/index/panel-orchestration.html +489 -282
  36. package/web-ui/partials/index/panel-prompts.html +66 -3
  37. package/web-ui/res/web-ui-render.precompiled.js +1181 -604
  38. package/web-ui/styles/layout-shell.css +157 -1
  39. package/web-ui/styles/modals-core.css +173 -0
  40. package/web-ui/styles/navigation-panels.css +11 -0
  41. package/web-ui/styles/responsive.css +32 -0
  42. package/web-ui/styles/task-orchestration.css +2161 -4
package/README.md CHANGED
@@ -60,7 +60,7 @@ Unlike simple wrappers, Codex Mate acts as a **Local Agent Bridge**:
60
60
  - **OpenCode Provider Control**: Manage OpenCode provider/model selection with a CodexMate-owned provider store under `~/.codexmate`, projecting only the active provider into native OpenCode config to avoid polluting or deleting user-owned settings.
61
61
  - **Provider Health Cleanup**: Probe local Codex and Claude provider routes, surface failed configs in one modal, and bulk-clean selected broken providers without touching healthy or protected entries.
62
62
  - **Skills Marketplace**: A local-first market to share and import skills between different agent apps.
63
- - **Prompt File Editor**: Unified editor for global and project-level `CLAUDE.md` and `AGENTS.md` with auto-detection of project paths.
63
+ - **Prompt File Editor**: Unified editor for global and project-level `CLAUDE.md` and `AGENTS.md` with auto-detection of project paths, plus a shared preset pool for reusable prompts.
64
64
  - **Task Orchestrator**: Plan and execute complex tasks with dependency tracking.
65
65
 
66
66
  ---
@@ -80,7 +80,7 @@ Unlike simple wrappers, Codex Mate acts as a **Local Agent Bridge**:
80
80
  | **OpenCode Provider Store** | ✅ | Keep multiple OpenCode providers in `~/.codexmate` while projecting only the selected provider to native OpenCode config |
81
81
  | **Provider Health Check** | ✅ | Probe local Codex/Claude provider routes, highlight failed configs, and bulk-remove selected broken providers safely |
82
82
  | **Prompt Templates** | ✅ | Reusable prompt plugins with variables |
83
- | **Prompt File Editor** | ✅ | Edit global and project-level CLAUDE.md / AGENTS.md with auto-detect and path switching |
83
+ | **Prompt File Editor** | ✅ | Edit global and project-level CLAUDE.md / AGENTS.md with auto-detect, path switching, and a shared preset pool. Applying a preset only updates the editor; save manually to write the file. |
84
84
  | **MCP Integration** | ✅ | Expose local tools and resources via MCP stdio |
85
85
  | **Auto Update** | ✅ | Quick update CLI via `codexmate update` |
86
86
 
package/README.vi.md CHANGED
@@ -67,6 +67,7 @@ Khác với các wrapper đơn giản, Codex Mate hoạt động như một **Ag
67
67
  | **Bridge OpenAI** | ✅ | Chuyển đổi Codex Responses API sang định dạng OpenAI chuẩn |
68
68
  | **Kiểm tra sức khỏe Provider** | ✅ | Kiểm tra route provider Codex/Claude, đánh dấu cấu hình lỗi và xóa hàng loạt các provider hỏng đã chọn một cách an toàn |
69
69
  | **Mẫu Prompt** | ✅ | Plugin prompt tái sử dụng được với hỗ trợ biến |
70
+ | **Trình sửa tệp prompt** | ✅ | Chỉnh sửa CLAUDE.md / AGENTS.md và dùng kho preset chung. Áp dụng preset chỉ cập nhật editor; cần lưu thủ công để ghi vào tệp. |
70
71
  | **Tích hợp MCP** | ✅ | Expose tool và resource cục bộ qua MCP stdio |
71
72
  | **Tự động cập nhật** | ✅ | Cập nhật nhanh qua `codexmate update` |
72
73
 
package/README.zh.md CHANGED
@@ -59,7 +59,7 @@
59
59
  - **OpenCode Provider 控制**:在 `~/.codexmate` 下维护 CodexMate 自有的 OpenCode 多 provider 存储,只将当前选中的 provider 投影到 OpenCode 原生配置,避免污染或误删用户已有配置。
60
60
  - **Provider 健康清理**:探测本地 Codex 与 Claude provider 路由,在同一个弹窗里集中展示失败配置,并批量清理已选坏配置,不影响正常或受保护项。
61
61
  - **Skills 市场**:本地优先的市场,支持在不同的智能体应用之间共享和导入 Skills。
62
- - **提示词文件编辑器**:统一编辑全局和项目级 `CLAUDE.md` 与 `AGENTS.md`,支持项目路径自动检测。
62
+ - **提示词文件编辑器**:统一编辑全局和项目级 `CLAUDE.md` 与 `AGENTS.md`,支持项目路径自动检测,并提供通用预设池复用 prompt。
63
63
  - **任务编排器**:支持带有依赖跟踪的复杂任务规划与执行。
64
64
 
65
65
  ---
@@ -79,7 +79,7 @@
79
79
  | **OpenCode Provider 存储** | ✅ | 在 `~/.codexmate` 中保留多个 OpenCode provider,只将当前选中的 provider 投影到 OpenCode 原生配置 |
80
80
  | **Provider 健康检查** | ✅ | 探测本地 Codex/Claude provider 路由,标记失败配置,并安全批量移除已选坏配置 |
81
81
  | **提示词模板** | ✅ | 支持变量的可复用提示词插件 |
82
- | **提示词文件编辑器** | ✅ | 编辑全局和项目级 CLAUDE.md / AGENTS.md,支持自动检测与路径切换 |
82
+ | **提示词文件编辑器** | ✅ | 编辑全局和项目级 CLAUDE.md / AGENTS.md,支持自动检测、路径切换与通用预设池。应用预设只更新编辑器,需手动保存才会写入文件。 |
83
83
  | **MCP 集成** | ✅ | 通过 MCP stdio 暴露本地工具与资源 |
84
84
  | **自动更新** | ✅ | 通过 `codexmate update` 快速更新 CLI |
85
85
 
@@ -0,0 +1,62 @@
1
+ const DEFAULT_BRIDGE_MAX_RETRIES = 2;
2
+ const MIN_BRIDGE_MAX_RETRIES = 2;
3
+ const MAX_BRIDGE_MAX_RETRIES = 10;
4
+ const BASE_TRANSIENT_RETRY_DELAY_MS = 200;
5
+ const MAX_TRANSIENT_RETRY_DELAY_MS = 5000;
6
+
7
+ function normalizeBridgeMaxRetries(value, fallback = DEFAULT_BRIDGE_MAX_RETRIES) {
8
+ const raw = Number(value);
9
+ const fallbackRaw = Number(fallback);
10
+ const base = Number.isFinite(raw) ? raw : (Number.isFinite(fallbackRaw) ? fallbackRaw : DEFAULT_BRIDGE_MAX_RETRIES);
11
+ return Math.min(MAX_BRIDGE_MAX_RETRIES, Math.max(MIN_BRIDGE_MAX_RETRIES, Math.floor(base)));
12
+ }
13
+
14
+ function isTransientNetworkError(error) {
15
+ const text = String(error || '').trim();
16
+ if (!text) return false;
17
+ if (/socket hang up/i.test(text)) return true;
18
+ if (/ECONNRESET|ECONNREFUSED|EPIPE|EPROTO|ETIMEDOUT/i.test(text)) return true;
19
+ if (/EAI_AGAIN/i.test(text)) return true;
20
+ if (/UND_ERR_SOCKET/i.test(text)) return true;
21
+ if (/disconnected before|secure tls|tls handshake/i.test(text)) return true;
22
+ return false;
23
+ }
24
+
25
+ function getTransientRetryDelayMs(attempt) {
26
+ const index = Math.max(0, Number(attempt) - 1);
27
+ return Math.min(MAX_TRANSIENT_RETRY_DELAY_MS, BASE_TRANSIENT_RETRY_DELAY_MS * Math.pow(3, index));
28
+ }
29
+
30
+ async function retryTransientRequest(executor, options = {}) {
31
+ const maxRetries = normalizeBridgeMaxRetries(options && options.maxRetries);
32
+ let lastResult = null;
33
+ for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
34
+ if (attempt > 0) {
35
+ const delay = getTransientRetryDelayMs(attempt);
36
+ // eslint-disable-next-line no-await-in-loop
37
+ await new Promise((r) => {
38
+ const t = setTimeout(r, delay);
39
+ if (typeof t.unref === 'function') t.unref();
40
+ });
41
+ }
42
+ // eslint-disable-next-line no-await-in-loop
43
+ const result = await executor(attempt);
44
+ lastResult = result;
45
+ if (!result) return result;
46
+ if (result.ok) return result;
47
+ if (result.retry) return result;
48
+ if (result.status && result.status > 0) return result;
49
+ if (!isTransientNetworkError(result.error)) return result;
50
+ }
51
+ return lastResult;
52
+ }
53
+
54
+ module.exports = {
55
+ DEFAULT_BRIDGE_MAX_RETRIES,
56
+ MIN_BRIDGE_MAX_RETRIES,
57
+ MAX_BRIDGE_MAX_RETRIES,
58
+ normalizeBridgeMaxRetries,
59
+ isTransientNetworkError,
60
+ getTransientRetryDelayMs,
61
+ retryTransientRequest
62
+ };