codexmate 0.1.32 → 0.1.34

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 (109) hide show
  1. package/README.md +18 -2
  2. package/README.vi.md +18 -2
  3. package/README.zh.md +18 -2
  4. package/cli/claude-proxy.js +2 -2
  5. package/cli/local-bridge.js +10 -6
  6. package/cli/openai-chat-routing.js +38 -0
  7. package/cli/prompt-history.js +2 -0
  8. package/cli/routing-bridge.js +143 -0
  9. package/cli/system-prompt-files.js +75 -53
  10. package/cli.js +325 -215
  11. package/lib/cli-config-engine.js +6 -1
  12. package/lib/cli-file-utils.js +6 -1
  13. package/lib/config-change-fs.js +132 -0
  14. package/lib/config-changes.js +293 -0
  15. package/lib/file-sharing-lan.js +111 -0
  16. package/lib/file-sharing.js +196 -0
  17. package/lib/handoff-mcp.js +18 -2
  18. package/lib/local-feature-store.js +39 -0
  19. package/lib/model-test-client.js +61 -0
  20. package/lib/model-test.js +126 -0
  21. package/lib/routing-groups.js +161 -0
  22. package/lib/session-bookmarks.js +72 -0
  23. package/lib/session-context-health.js +23 -3
  24. package/lib/session-diagnostics.js +75 -0
  25. package/lib/session-feature-settings.js +21 -0
  26. package/lib/session-features.js +63 -0
  27. package/lib/session-handoff-draft.js +43 -0
  28. package/lib/session-projects.js +76 -0
  29. package/lib/session-search-index.js +188 -0
  30. package/lib/thread-handoff.js +8 -0
  31. package/lib/web-server.js +216 -0
  32. package/package.json +1 -1
  33. package/plugins/file-sharing/manifest.mjs +10 -0
  34. package/plugins/file-sharing/methods.mjs +101 -0
  35. package/plugins/file-sharing/overview.mjs +3 -0
  36. package/plugins/file-sharing/ownership.mjs +5 -0
  37. package/plugins/registry.mjs +3 -0
  38. package/web-ui/app.js +22 -3
  39. package/web-ui/index.html +4 -2
  40. package/web-ui/logic.context-window.mjs +15 -0
  41. package/web-ui/modules/api.mjs +72 -39
  42. package/web-ui/modules/app.computed.main-tabs.mjs +3 -0
  43. package/web-ui/modules/app.methods.agents.mjs +17 -0
  44. package/web-ui/modules/app.methods.claude-config.mjs +2 -0
  45. package/web-ui/modules/app.methods.codex-config.mjs +9 -0
  46. package/web-ui/modules/app.methods.config-changes.mjs +124 -0
  47. package/web-ui/modules/app.methods.install.mjs +23 -3
  48. package/web-ui/modules/app.methods.kilocode-config.mjs +2 -0
  49. package/web-ui/modules/app.methods.navigation.mjs +2 -0
  50. package/web-ui/modules/app.methods.openclaw-persist.mjs +2 -0
  51. package/web-ui/modules/app.methods.opencode-config.mjs +2 -0
  52. package/web-ui/modules/app.methods.pi-config.mjs +12 -3
  53. package/web-ui/modules/app.methods.prompts-editor.mjs +7 -4
  54. package/web-ui/modules/app.methods.provider-cache.mjs +9 -3
  55. package/web-ui/modules/app.methods.providers.mjs +6 -0
  56. package/web-ui/modules/app.methods.session-actions.mjs +2 -2
  57. package/web-ui/modules/app.methods.startup-claude.mjs +8 -47
  58. package/web-ui/modules/app.methods.system-prompt.mjs +88 -17
  59. package/web-ui/modules/app.methods.theme.mjs +4 -3
  60. package/web-ui/modules/app.methods.web-ui-preferences.mjs +7 -0
  61. package/web-ui/modules/config-change-actions.mjs +9 -0
  62. package/web-ui/modules/i18n/locales/en.mjs +254 -8
  63. package/web-ui/modules/i18n/locales/ja.mjs +254 -8
  64. package/web-ui/modules/i18n/locales/vi.mjs +254 -8
  65. package/web-ui/modules/i18n/locales/zh-tw.mjs +254 -8
  66. package/web-ui/modules/i18n/locales/zh.mjs +254 -8
  67. package/web-ui/modules/model-test.mjs +82 -0
  68. package/web-ui/modules/plugins.methods.mjs +3 -1
  69. package/web-ui/modules/prompt-ecosystem.methods.mjs +4 -3
  70. package/web-ui/modules/request-deadline.mjs +33 -0
  71. package/web-ui/modules/routing.mjs +206 -0
  72. package/web-ui/modules/session-features.mjs +279 -0
  73. package/web-ui/modules/thread-handoff.mjs +1 -1
  74. package/web-ui/partials/index/config-changes.html +25 -0
  75. package/web-ui/partials/index/context-window-reference.html +17 -0
  76. package/web-ui/partials/index/layout-header.html +40 -42
  77. package/web-ui/partials/index/modal-openclaw-config.html +0 -2
  78. package/web-ui/partials/index/modal-skills.html +0 -1
  79. package/web-ui/partials/index/modals-basic.html +15 -8
  80. package/web-ui/partials/index/modals-pi-provider.html +0 -1
  81. package/web-ui/partials/index/panel-config-codex.html +0 -3
  82. package/web-ui/partials/index/panel-config-openclaw.html +16 -13
  83. package/web-ui/partials/index/panel-dashboard.html +0 -2
  84. package/web-ui/partials/index/panel-plugins.html +3 -10
  85. package/web-ui/partials/index/panel-prompts.html +13 -8
  86. package/web-ui/partials/index/panel-routing.html +3 -0
  87. package/web-ui/partials/index/panel-sessions.html +9 -0
  88. package/web-ui/partials/index/panel-settings.html +12 -13
  89. package/web-ui/partials/index/panel-trash.html +0 -1
  90. package/web-ui/partials/index/plugin-file-sharing.html +47 -0
  91. package/web-ui/partials/index/routing-model-test.html +53 -0
  92. package/web-ui/partials/index/session-diagnostics.html +32 -0
  93. package/web-ui/partials/index/session-features.html +107 -0
  94. package/web-ui/partials/index/thread-handoff.html +6 -3
  95. package/web-ui/res/web-ui-render.precompiled.js +1689 -246
  96. package/web-ui/styles/base-theme.css +1 -1
  97. package/web-ui/styles/config-changes.css +30 -0
  98. package/web-ui/styles/modals-core.css +6 -5
  99. package/web-ui/styles/navigation-panels.css +4 -0
  100. package/web-ui/styles/openclaw-structured.css +205 -189
  101. package/web-ui/styles/plugins-panel.css +40 -1
  102. package/web-ui/styles/responsive.css +10 -5
  103. package/web-ui/styles/routing.css +78 -0
  104. package/web-ui/styles/session-features.css +258 -0
  105. package/web-ui/styles/settings-panel.css +30 -0
  106. package/web-ui/styles/system-prompt.css +8 -7
  107. package/web-ui/styles/theme-violet-tokens.css +52 -0
  108. package/web-ui/styles/theme-violet.css +1736 -0
  109. package/web-ui/styles.css +5 -1
@@ -1,4 +1,234 @@
1
1
  const zh = Object.freeze({
2
+ "modelTest.title": "真实测试",
3
+ "modelTest.selection": "选择测试模型",
4
+ "modelTest.source": "配置来源",
5
+ "modelTest.selectModel": "选择模型",
6
+ "modelTest.prompt": "测试内容",
7
+ "modelTest.run": "发送测试",
8
+ "modelTest.running": "测试中…",
9
+ "modelTest.completed": "已回复",
10
+ "modelTest.failed": "测试失败",
11
+ "modelTest.seconds": "{seconds} 秒",
12
+ "modelTest.loading": "读取已有模型…",
13
+ "modelTest.empty": "暂无可选模型。",
14
+ "modelTest.required": "填写测试内容,选择已有模型。",
15
+ "modelTest.incomplete": "回复达到长度限制,内容未完整生成。",
16
+
17
+ "routing.openai.purpose": "给 OpenAI 兼容客户端提供模型分配 API,按组设置主力与备用。",
18
+ "routing.openai.active": "OpenAI Chat 已选择「{name}」。",
19
+ "routing.openai.off": "API 未启用。创建模型组后点「启用此组」。",
20
+ "routing.openai.bindingHint": "启用组即开放此 API;取消组即停用,不回退到 Codex 或 Claude。",
21
+ "routing.openai.disable": "停用接入",
22
+ "routing.openai.providers": "复用 Codex 配置页管理的供应商,只调用 Chat Completions 接口。无需安装 Codex;不会修改 Codex 或 Claude 的连接配置。",
23
+ "routing.openai.baseUrl": "客户端 Base URL",
24
+ "routing.openai.model": "客户端模型 ID",
25
+ "routing.openai.auth": "客户端 API Key 填 CODEXMATE_HTTP_TOKEN 的访问令牌,不填供应商密钥。此令牌也可访问管理 API。",
26
+ "routing.openai.localOnly": "未配置访问令牌,仅允许本机调用。客户端需要 API Key 时可填 local,服务器不向上游转发此值。",
27
+ "routing.openai.alias": "routing 是固定入口别名;实际模型由组内主力、备用或轮流规则决定。",
28
+ "routing.openai.permission": "组管理沿用 Codex 供应商的写权限。开启后允许修改 Codex 本机配置;启用此组仅写路由选择,不接管工具。",
29
+ "routing.openai.use": "把下方地址与模型 ID 填入 OpenAI 兼容客户端。",
30
+ "routing.purpose": "给 {agent} 设置模型使用顺序:先选主力,需要时再加备用。",
31
+ "routing.help.title": "工作方式与限制",
32
+ "routing.help.scope": "这里只分配模型请求,不启动工具,不执行任务,也不让多个模型一起回答。已启用仅表示配置已接入,供应商是否可用要看真实请求结果。",
33
+ "routing.help.errors": "仅在回复开始前遇到 HTTP 408(超时)、429(限流)、5xx(服务异常)时尝试下一个组内模型。其他 4xx 不切换,开始回复后也不切换。",
34
+ "routing.help.model": "供应商是提供模型的服务。组名可以自定义;组内模型栏填写供应商支持的模型 ID,不是昵称。已有配置会自动带入,未知值留空。",
35
+ "routing.start.create": "创建模型组:主力必选,备用可选。",
36
+ "routing.start.save": "保存这组设置。",
37
+ "routing.start.enable": "点击「启用此组」。",
38
+ "routing.start.use": "首次启用后,重启所选工具再提问。",
39
+ "routing.role.primary": "主力",
40
+ "routing.role.backup": "备用 {index}",
41
+ "routing.role.member": "模型 {index}",
42
+ "routing.editActive": "正在编辑已启用的组。保存后影响后续请求,当前请求不会重放。",
43
+ "routing.defaultName": "{target} 模型组 {index}",
44
+ "routing.nameRequired": "填写模型组名称。",
45
+ "routing.memberRequired": "为成员 {index} 选择供应商并填写模型。",
46
+ "routing.memberMissing": "成员 {index} 的供应商不可用,请更换或移除。",
47
+ "routing.memberDuplicate": "成员 {index} 与其他成员重复,请更换模型或移除。",
48
+ "routing.notActive": "当前配置未使用此组,请刷新核对。",
49
+ "routing.activationUnconfirmed": "绑定已完成;启用状态未确认。请刷新核对:{message}",
50
+ "routing.groupActivated": "已配置「{name}」。首次使用请重启所选工具,再提问。",
51
+ "routing.noProviders": "本页还没有可选供应商。先到配置页添加或检查。",
52
+ "routing.modelHint": "输入供应商支持的模型 ID",
53
+ "routing.inUse": "已启用",
54
+ "routing.awaitingEnable": "待启用",
55
+ "routing.working": "处理中…",
56
+ "routing.restorePool": "取消此组",
57
+ "routing.useGroup": "启用此组",
58
+ "routing.bindEnable": "启用此组",
59
+ "tab.routing": "模型测试",
60
+ "kicker.routing": "",
61
+ "title.routing": "模型测试",
62
+ "subtitle.routing": "",
63
+ "routing.target": "接入目标",
64
+ "routing.refresh": "刷新",
65
+ "routing.create": "新建模型组",
66
+ "routing.failed": "模型分配设置未完成。",
67
+ "routing.updated": "模型分配设置已保存。",
68
+ "routing.loading": "读取模型分配设置",
69
+ "routing.bindingHint": "新建组不会自动启用。首次使用,请点「启用此组」。",
70
+ "routing.readOnly": "当前只查看。开启写权限后允许修改此工具的本机配置。",
71
+ "routing.edit": "编辑模型组",
72
+ "routing.name": "组名称",
73
+ "routing.strategy": "使用方式",
74
+ "routing.strategy.order": "主力优先",
75
+ "routing.strategy.rotate": "轮流使用",
76
+ "routing.strategy.order.hint": "先用主力;超时、限流或服务异常时,在开始回复前按顺序尝试备用。",
77
+ "routing.strategy.rotate.hint": "按请求轮流换首选模型,不是让多个模型一起回答。",
78
+ "routing.provider": "供应商",
79
+ "routing.model": "模型",
80
+ "routing.selectProvider": "选择供应商",
81
+ "routing.unavailable": "不存在或已排除",
82
+ "routing.moveUp": "上移成员",
83
+ "routing.moveDown": "下移成员",
84
+ "routing.removeMember": "移除成员",
85
+ "routing.addMember": "添加成员",
86
+ "routing.save": "保存",
87
+ "routing.empty": "还没有模型组,按下面步骤设置。",
88
+ "routing.openConfig": "前往配置",
89
+ "routing.bound": "已绑定",
90
+ "routing.memberCount": "查看 {count} 项模型配置",
91
+ "routing.unbind": "解除绑定",
92
+ "routing.bind": "仅绑定",
93
+ "routing.delete": "删除",
94
+ "routing.deleteConfirm": "删除路由组「{name}」?此操作无法撤销。",
95
+ "routing.bridge.disable": "恢复工具配置",
96
+ "routing.bridge.enable": "接入模型分配",
97
+ "routing.state.group": "工具配置已使用「{name}」。",
98
+ "routing.state.legacy": "配置已接入,但尚未选模型组。",
99
+ "routing.state.pending": "已开启,但工具配置尚未接入。",
100
+ "routing.state.off": "尚未启用。选好模型组后点「启用此组」。",
101
+ "features.searchScope": "检索范围",
102
+ "features.moreFilters": "更多筛选",
103
+ "features.bookmarkHint": "点击消息旁的收藏图标,保留有用的片段。",
104
+ "features.localCheck": "本地配置",
105
+ "features.providerCheck": "当前 Codex 路由",
106
+ "features.technicalDetails": "技术详情",
107
+ "features.windowReference": "模型窗口参考",
108
+ "features.windowSettings": "设置模型窗口",
109
+ "features.rebuildIndex": "重建索引",
110
+ "features.title": "会话工具",
111
+ "features.bookmarks": "收藏",
112
+ "features.bookmark": "收藏消息",
113
+ "features.unbookmark": "取消收藏",
114
+ "features.search": "搜索",
115
+ "features.tag": "筛选标签",
116
+ "features.tags": "标签(逗号分隔)",
117
+ "features.projectPath": "项目绝对路径",
118
+ "features.loading": "正在读取…",
119
+ "features.empty": "当前范围没有结果",
120
+ "features.source": "查看原文",
121
+ "features.edit": "编辑备注",
122
+ "features.note": "备注",
123
+ "features.save": "保存",
124
+ "features.cancel": "取消",
125
+ "features.close": "关闭",
126
+ "features.selectMessage": "选择交接消息",
127
+ "features.index": "全文索引",
128
+ "features.refreshIndex": "更新索引",
129
+ "features.indexStatus": "已索引 {count} 条会话;本轮 {processed}/{total}",
130
+ "features.indexScope": "仅覆盖已发现候选;沿用上方来源、项目与角色筛选。新消息需更新索引。",
131
+ "features.indexFailures": "{count} 项读取失败;结果未覆盖这些记录",
132
+ "features.coverage": "已查 {scanned}/{total} 条已索引会话",
133
+ "features.partial": "结果未完整覆盖当前范围;最多展示 100 条命中",
134
+ "features.context": "前后文",
135
+ "features.generateDraft": "生成交接草稿({count} 条)",
136
+ "features.draftReview": "草稿未发送;先核对证据,再填写或修改后续步骤。",
137
+ "features.unverified": "待确认内容({count} 条)",
138
+ "features.projects": "项目工作台",
139
+ "features.projectHistory": "展示候选范围内的历史记录,不代表当前文件或测试状态。",
140
+ "features.readAt": "读取时间:{time}",
141
+ "features.unassigned": "未归属项目",
142
+ "features.prompts": "提示词文件(只读)",
143
+ "features.handoffs": "会话交接",
144
+ "features.projectMapping": "关联迁移前后的路径",
145
+ "features.saveMapping": "保存映射;空路径解除映射",
146
+ "features.contextWindow": "模型窗口(正整数;留空使用记录)",
147
+ "features.model": "模型",
148
+ "features.chooseModel": "选择比较模型",
149
+ "features.contextEstimate": "历史文本 / 模型窗口(估算):{percent}% / {window};不是实际请求占用",
150
+ "features.dismiss": "关闭本会话提醒",
151
+ "features.diagnostics": "统一故障诊断",
152
+ "features.diagnosticScope": "默认只检查本地。勾选后才探测当前 Codex 路由或启动选中的 MCP;不修配置,不调用写工具。",
153
+ "features.remoteProbe": "探测当前 Codex 路由(联网)",
154
+ "features.check": "开始检查",
155
+ "features.exportJson": "导出脱敏 JSON",
156
+ "features.exportMarkdown": "导出脱敏 Markdown",
157
+ "features.status.idle": "未开始",
158
+ "features.status.running": "正在执行",
159
+ "features.status.success": "完成",
160
+ "features.status.partial": "部分失败或未覆盖",
161
+ "features.status.failed": "失败",
162
+ "features.status.cancelled": "已取消",
163
+ "features.status.pending": "等待执行",
164
+ "features.status.not_checked": "未检查",
165
+ "features.status.passed": "通过",
166
+ "features.status.timeout": "超时",
167
+ "features.evidence.passed": "工具日志通过",
168
+ "features.evidence.failed": "工具日志失败",
169
+ "features.evidence.unverified": "待确认",
170
+ "features.windowSource.manual": "用户填写",
171
+ "features.windowSource.record": "会话记录",
172
+ "features.windowStatus.unknown": "窗口未知;先选择模型或填写窗口",
173
+ "features.windowStatus.invalid": "窗口必须是正整数",
174
+ "features.windowStatus.warning": "文本体量达到窗口的 80%;可准备交接",
175
+ "features.windowStatus.high": "文本体量达到窗口的 95%;核对交接需求",
176
+ "features.error.bookmark-excerpt-too-large": "记录超过存储容量;先导出或缩小范围",
177
+ "features.error.bookmark-input-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
178
+ "features.error.bookmark-not-found": "原消息不存在、已变更或无法唯一定位;摘录仍保留",
179
+ "features.error.bookmark-source-unavailable": "原消息不存在、已变更或无法唯一定位;摘录仍保留",
180
+ "features.error.context-window-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
181
+ "features.error.diagnostic-busy": "已有操作正在执行;等待完成或取消",
182
+ "features.error.diagnostic-input-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
183
+ "features.error.diagnostic-timeout": "读取或写入失败;检查文件与索引后刷新",
184
+ "features.error.feature-action-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
185
+ "features.error.feature-read-failed": "读取或写入失败;检查文件与索引后刷新",
186
+ "features.error.feature-store-conflict": "记录被其他操作修改;刷新后重试",
187
+ "features.error.feature-store-full": "记录超过存储容量;先导出或缩小范围",
188
+ "features.error.feature-store-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
189
+ "features.error.handoff-selection-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
190
+ "features.error.index-busy": "已有操作正在执行;等待完成或取消",
191
+ "features.error.index-cancelled": "读取或写入失败;检查文件与索引后刷新",
192
+ "features.error.index-input-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
193
+ "features.error.index-query-empty": "输入无效;检查窗口、标签、路径或选中的消息",
194
+ "features.error.index-refresh-failed": "读取或写入失败;检查文件与索引后刷新",
195
+ "features.error.index-shard-unavailable": "读取或写入失败;检查文件与索引后刷新",
196
+ "features.error.index-source-changed": "读取或写入失败;检查文件与索引后刷新",
197
+ "features.error.index-source-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
198
+ "features.error.project-mapping-invalid": "输入无效;检查窗口、标签、路径或选中的消息",
199
+ "changes.preview": "配置变更预览",
200
+ "changes.hint": "对比规范化字段;密钥已隐藏。确认后写入以下文件。",
201
+ "changes.files": "受影响文件",
202
+ "changes.last": "最近一次配置变更",
203
+ "changes.undo": "撤销最近一次",
204
+ "changes.undoConfirm": "恢复以下文件的原内容;本次新建文件将删除。外部修改后拒绝撤销。\n{paths}",
205
+ "changes.apply": "确认写入",
206
+ "changes.saving": "正在写入…",
207
+ "changes.cancelled": "已取消配置变更",
208
+ "changes.busy": "已有配置变更正在执行",
209
+ "changes.failed": "配置变更失败,请检查文件与输入。",
210
+ "changes.undone": "已撤销最近一次配置变更",
211
+ "changes.refreshFailed": "撤销已完成,界面刷新失败,请重新加载。",
212
+ "changes.restoreFailed": "以下路径恢复失败,请核对备份:{paths}",
213
+ "changes.hidden": "内容无法安全解析,已隐藏;原始文件仍将按预览提交。",
214
+ "changes.maskedOnly": "文件字节已变化;差异仅涉及隐藏字段或格式。",
215
+ "changes.operation.create": "新建",
216
+ "changes.operation.modify": "修改",
217
+ "changes.operation.delete": "删除",
218
+ "changes.error.config-change-conflict": "文件在读取或预览后已变更;重新加载配置后再预览。",
219
+ "changes.error.config-change-expired": "预览或撤销记录已失效,请重新加载。",
220
+ "changes.error.config-change-busy": "已有配置变更正在执行。",
221
+ "changes.error.config-change-invalid": "无法预览配置,请检查文件、格式与必填字段。",
222
+ "changes.error.config-change-unsupported": "该操作不支持配置预览。",
223
+ "changes.error.config-change-too-large": "配置变更超过预览容量。",
224
+ "changes.error.config-change-write-failed": "配置写入失败,已尝试恢复原内容。",
225
+ "changes.error.config-change-undo-failed": "撤销失败,已保留当前配置。",
226
+ "changes.error.config-change-history-invalid": "无法读取变更记录,请核对备份文件。",
227
+ "changes.error.tool-config-write-disabled": "先开启对应工具的配置写入权限。",
228
+ "settings.templateConfirm.title": "配置写入预览",
229
+ "settings.templateConfirm.meta": "统一预览六种工具的配置变更",
230
+ "settings.templateConfirm.toggle": "写入前显示变更预览",
231
+ "settings.templateConfirm.hint": "关闭后直接写入;保留冲突检查与最近一次撤销。",
2
232
  'contextHealth.title': "上下文体检",
3
233
  'contextHealth.loading': "扫描完整会话…",
4
234
  'contextHealth.composition': "上下文构成比例",
@@ -232,6 +462,7 @@ const zh = Object.freeze({
232
462
  'side.update.availableWithVersion': '有新版本 v{version}',
233
463
  'side.update.meta': '点击查看更新命令',
234
464
  'side.update.metaVersions': '当前 v{current} → 最新 v{latest}',
465
+ 'side.update.commandHint': '在运行 Codex Mate 的主机终端执行。更新成功后重启服务。',
235
466
  'side.update.checkFailed': '检查最新版本失败',
236
467
  'side.update.check': '检查更新',
237
468
  'side.update.checking': '正在检查更新…',
@@ -352,7 +583,6 @@ const zh = Object.freeze({
352
583
  'prompts.project.pathLabel': '项目路径(可选)',
353
584
  'prompts.project.selectPlaceholder': '-- 全局 (~/.claude/CLAUDE.md) --',
354
585
  'prompts.project.manualPlaceholder': '或手动输入项目根路径...',
355
- 'prompts.project.detected': '正在编辑: {path}',
356
586
  'dashboard.doctor.title': 'Doctor',
357
587
  'dashboard.doctor.runChecks': '运行检查',
358
588
  'dashboard.doctor.checking': '检查中...',
@@ -451,11 +681,28 @@ const zh = Object.freeze({
451
681
 
452
682
  // Plugins panel
453
683
  'plugins.sidebar.title': 'Plugins',
454
- 'plugins.sidebar.note': '可复用的标准化工具。未来自定义插件应遵循相同结构。',
455
684
  'plugins.sidebar.ariaList': '插件列表',
456
685
  'plugins.catalog.promptTemplates.title': '提示词模板',
457
686
  'plugins.catalog.promptTemplates.description': '标准化、模板驱动的提示词工具,支持变量、复制与导出。',
458
687
  'plugins.status.standard': '标准',
688
+ 'plugins.fileSharing.title': '文件共享',
689
+ 'plugins.fileSharing.chooseFiles': '选择文件',
690
+ 'plugins.fileSharing.chooseFolder': '选择文件夹',
691
+ 'plugins.fileSharing.confirm': '仅上传以下文件。所有有权访问此 Web 实例的用户均可下载。',
692
+ 'plugins.fileSharing.upload': '上传',
693
+ 'plugins.fileSharing.empty': '暂无共享文件',
694
+ 'plugins.fileSharing.files': '{count} 个文件',
695
+ 'plugins.fileSharing.remove': '移除共享',
696
+ 'plugins.fileSharing.bytes': '{size} 字节',
697
+ 'plugins.fileSharing.download': '下载',
698
+ 'plugins.fileSharing.copyLink': '复制局域网下载链接',
699
+ 'plugins.fileSharing.copyManually': '请手动复制此下载链接。',
700
+ 'plugins.fileSharing.lanUnavailable': '没有可用的私有 IPv4 网卡,或无法打开下载端口。',
701
+ 'plugins.fileSharing.emptyFolder': '请选择至少包含一个文件的文件夹。',
702
+ 'plugins.fileSharing.invalid': '上传内容或路径无效。',
703
+ 'plugins.fileSharing.busy': '另一批文件正在上传,请稍后重试。',
704
+ 'plugins.fileSharing.notFound': '该共享已不存在,请刷新列表。',
705
+ 'plugins.fileSharing.failed': '文件共享请求失败,请重试。',
459
706
  'plugins.catalog.textTools.title': '文本工具',
460
707
  'plugins.catalog.textTools.description': '一组轻量纯文本小工具,首个工具可将多行文本压缩为单行。',
461
708
  'plugins.textTools.title': '文本工具',
@@ -480,12 +727,10 @@ const zh = Object.freeze({
480
727
  'plugins.promptTemplates.compose.chooseTemplateHint': '请选择一个模板开始生成。',
481
728
  'plugins.promptTemplates.compose.builtinSuffix': '(内置)',
482
729
  'plugins.promptTemplates.compose.empty': '暂无可用模板。',
483
- 'plugins.promptTemplates.compose.varsHint': '变量填写与新增请在「管理」中进行。',
484
730
  'plugins.promptTemplates.compose.missingCount': '未填 {count} 项',
485
731
  'plugins.promptTemplates.compose.jumpToMissing': '跳到未填',
486
732
  'plugins.promptTemplates.compose.goManage': '去管理填写变量',
487
733
  'plugins.promptTemplates.compose.outputTitle': '生成结果',
488
- 'plugins.promptTemplates.compose.outputHint': '点“复制”后直接粘贴到 Codex/Claude 输入框。',
489
734
  'plugins.promptTemplates.compose.outputAria': '生成结果(提示词)',
490
735
  'plugins.promptTemplates.compose.copy': '复制',
491
736
  'plugins.promptTemplates.manage.searchAria': '搜索模板',
@@ -1222,6 +1467,7 @@ const zh = Object.freeze({
1222
1467
  'settings.theme.light': '浅色',
1223
1468
  'settings.theme.dark': '深色',
1224
1469
  'settings.theme.ocean': '海洋蓝',
1470
+ 'settings.theme.violet': '柔紫',
1225
1471
  'settings.theme.hint': '主题偏好会自动保存,刷新后保持不变。',
1226
1472
  'settings.sharePrefix.title': '分享命令前缀',
1227
1473
  'settings.sharePrefix.meta': '影响 Web UI 里“复制分享命令”的前缀',
@@ -1330,10 +1576,6 @@ const zh = Object.freeze({
1330
1576
  'settings.webhook.enableToggle': '启用 Webhook',
1331
1577
  'settings.webhook.urlLabel': 'Webhook URL',
1332
1578
  'settings.webhook.eventsLabel': '事件',
1333
- 'settings.templateConfirm.title': '配置模板二次确认',
1334
- 'settings.templateConfirm.meta': '降低误写入风险',
1335
- 'settings.templateConfirm.toggle': '应用模板前先预览差异(两步:确认 → 应用)',
1336
- 'settings.templateConfirm.hint': '开启后:先展示差异预览,再确认写入。',
1337
1579
 
1338
1580
  'settings.timeline.style.title': '时间线样式',
1339
1581
  'settings.timeline.style.meta': '选择会话预览中的时间线导航样式',
@@ -1607,6 +1849,10 @@ const zh = Object.freeze({
1607
1849
  'kilocode.writeRequired': '请先打开 KiloCode 写入开关',
1608
1850
  'kilocode.saved': 'KiloCode 配置已保存',
1609
1851
  'kilocode.autoSaved': 'KiloCode 配置已同步',
1852
+ 'sysPrompt.fileLabel': '文件',
1853
+ 'sysPrompt.filesLoading': '读取文件列表…',
1854
+ 'sysPrompt.fileMissing': '文件已移除或无法读取,请刷新文件列表',
1855
+ 'sysPrompt.fileUnsaved': '请先保存或取消当前改动,再切换文件',
1610
1856
  'sysPrompt.scope.label': '作用域',
1611
1857
  'sysPrompt.scope.global': '全局 (~/.pi/agent/)',
1612
1858
  'sysPrompt.scope.project': '项目 (<cwd>/.pi/)',
@@ -0,0 +1,82 @@
1
+ import { api } from './api.mjs';
2
+ import { buildMarkdownPreviewHtml } from '../logic.markdown-editor.mjs';
3
+
4
+ const MAX_PROMPT_LENGTH = 8000;
5
+
6
+ export function modelTestData() {
7
+ return {
8
+ modelTestTarget: 'codex', modelTestCatalogs: { codex: [], pi: [] }, modelTestProvider: '', modelTestModel: '',
9
+ modelTestPrompt: '', modelTestLoading: false, modelTestRunning: false, modelTestError: '', modelTestResult: null
10
+ };
11
+ }
12
+
13
+ export function createModelTestMethods({ request }) {
14
+ return {
15
+ async loadModelTestCatalog() {
16
+ if (this.modelTestLoading || this.modelTestRunning) return;
17
+ this.modelTestLoading = true;
18
+ this.modelTestError = '';
19
+ try {
20
+ const state = await request('model-test-catalog');
21
+ if (state.error) throw new Error(typeof state.error === 'string' ? state.error : state.error.message);
22
+ this.modelTestCatalogs = state.catalogs;
23
+ this.selectModelTestProvider();
24
+ } catch (error) { this.modelTestError = error.message; }
25
+ finally { this.modelTestLoading = false; }
26
+ },
27
+ modelTestProviders() { return this.modelTestCatalogs[this.modelTestTarget]; },
28
+ modelTestModels() { return this.modelTestProviders().find(entry => entry.name === this.modelTestProvider)?.models || []; },
29
+ selectModelTestProvider() {
30
+ const providers = this.modelTestProviders();
31
+ const current = this.modelTestTarget === 'codex' ? this.currentProvider : this.piActiveProvider;
32
+ if (!providers.some(entry => entry.name === this.modelTestProvider)) {
33
+ this.modelTestProvider = providers.find(entry => entry.name === current)?.name || providers[0]?.name || '';
34
+ }
35
+ const models = this.modelTestModels();
36
+ const currentModel = this.modelTestTarget === 'codex' ? this.currentModels?.[this.modelTestProvider] || this.currentModel : this.piActiveModel;
37
+ if (!models.includes(this.modelTestModel)) this.modelTestModel = models.includes(currentModel) ? currentModel : models[0] || '';
38
+ },
39
+ setModelTestTarget(target) {
40
+ if (this.modelTestRunning) return;
41
+ this.modelTestTarget = target;
42
+ this.modelTestProvider = '';
43
+ this.modelTestModel = '';
44
+ this.selectModelTestProvider();
45
+ if (!this.__webUiPreferencesApplying && typeof this.persistWebUiPreferences === 'function') {
46
+ this.persistWebUiPreferences({ navigation: { modelTestTarget: target } });
47
+ }
48
+ },
49
+ modelTestDuration(result = this.modelTestResult) {
50
+ return this.t('modelTest.seconds', { seconds: (result.durationMs / 1000).toFixed(2) });
51
+ },
52
+ modelTestPreview() {
53
+ return buildMarkdownPreviewHtml(this.modelTestResult?.text, globalThis.marked, globalThis.DOMPurify);
54
+ },
55
+ async runModelTest() {
56
+ if (this.modelTestRunning || this.modelTestLoading) return;
57
+ const prompt = this.modelTestPrompt.trim();
58
+ if (!prompt || this.modelTestPrompt.length > MAX_PROMPT_LENGTH || !this.modelTestModels().includes(this.modelTestModel)) {
59
+ this.modelTestError = this.t('modelTest.required'); return;
60
+ }
61
+ this.modelTestRunning = true;
62
+ this.modelTestError = '';
63
+ this.modelTestResult = { target: this.modelTestTarget, provider: this.modelTestProvider, model: this.modelTestModel, prompt };
64
+ const started = Date.now();
65
+ try {
66
+ const result = await request('model-test-run', {
67
+ target: this.modelTestTarget, provider: this.modelTestProvider, model: this.modelTestModel, prompt
68
+ });
69
+ this.modelTestResult = { ...this.modelTestResult, durationMs: Date.now() - started, ...result };
70
+ } catch (error) {
71
+ this.modelTestResult = { ...this.modelTestResult, ok: false, error: error.message, durationMs: Date.now() - started };
72
+ } finally { this.modelTestRunning = false; }
73
+ }
74
+ };
75
+ }
76
+
77
+ export const modelTestMixin = {
78
+ data: modelTestData,
79
+ computed: { modelTestRenderedResponse() { return this.modelTestPreview(); } },
80
+ watch: { mainTab(tab) { if (tab === 'routing') this.loadModelTestCatalog(); } },
81
+ methods: createModelTestMethods({ request: api })
82
+ };
@@ -1,4 +1,5 @@
1
1
  import { createPromptTemplatesMethods } from '../../plugins/prompt-templates/methods.mjs';
2
+ import { createFileSharingMethods } from '../../plugins/file-sharing/methods.mjs';
2
3
  import { createTextToolsMethods } from '../../plugins/text-tools/methods.mjs';
3
4
  import { createPromptInvocationMethods } from '../../plugins/prompt-templates/invocation.mjs';
4
5
 
@@ -6,6 +7,7 @@ export function createPluginsMethods() {
6
7
  return {
7
8
  ...createPromptTemplatesMethods(),
8
9
  ...createPromptInvocationMethods(),
9
- ...createTextToolsMethods()
10
+ ...createTextToolsMethods(),
11
+ ...createFileSharingMethods()
10
12
  };
11
13
  }
@@ -5,11 +5,12 @@ export function createPromptEcosystemMethods({ api }) {
5
5
  return {
6
6
  promptHistoryTarget(kind) {
7
7
  if (kind === 'sys') return {
8
- key: `${this.sysPromptScope}:${this.sysPromptMode}:${this.sysHistoryPreviewId}`,
9
- busy: this.sysPromptLoading || this.sysPromptSaving || this.sysPromptDiffVisible,
8
+ key: `${this.sysPromptScope}:${this.sysPromptMode}:${this.sysPromptFileName || ''}:${this.sysHistoryPreviewId}`,
9
+ busy: this.sysPromptFileMissing || this.sysPromptLoading || this.sysPromptSaving || this.sysPromptDiffVisible,
10
10
  id: this.sysHistoryPreviewId, content: this.sysHistoryPreviewContent,
11
11
  action: 'apply-system-prompt', saving: 'sysPromptSaving',
12
- params: { scope: this.sysPromptScope, mode: this.sysPromptMode, baseHash: this.sysPromptHash },
12
+ params: { scope: this.sysPromptScope, mode: this.sysPromptMode, baseHash: this.sysPromptHash,
13
+ ...(this.sysPromptFileName ? { fileName: this.sysPromptFileName } : {}) },
13
14
  load: 'loadSystemPrompt', history: 'loadSysHistory', bucket: this.sysHistoryBucket
14
15
  };
15
16
  const context = this.agentsContext || 'codex';
@@ -0,0 +1,33 @@
1
+ export async function withRequestDeadline(run, options = {}) {
2
+ const { timeoutMs, signal } = options;
3
+ if (timeoutMs !== undefined && (!Number.isFinite(timeoutMs) || timeoutMs < 0)) {
4
+ throw new TypeError('timeoutMs must be a non-negative finite number');
5
+ }
6
+ if (signal && signal.aborted) throw signal.reason || new Error('请求已取消');
7
+ if (timeoutMs === undefined && !signal) return await run();
8
+
9
+ const controller = new AbortController();
10
+ let timer = null;
11
+ let rejectCanceled;
12
+ const canceled = new Promise((_resolve, reject) => { rejectCanceled = reject; });
13
+ const cancel = (reason) => {
14
+ controller.abort(reason);
15
+ rejectCanceled(reason);
16
+ };
17
+ const onAbort = () => cancel(signal.reason || new Error('请求已取消'));
18
+ if (signal) signal.addEventListener('abort', onAbort, { once: true });
19
+ try {
20
+ const request = run(controller.signal);
21
+ if (timeoutMs !== undefined) {
22
+ timer = setTimeout(() => {
23
+ const error = new Error('timeout');
24
+ error.name = 'TimeoutError';
25
+ cancel(error);
26
+ }, timeoutMs);
27
+ }
28
+ return await Promise.race([request, canceled]);
29
+ } finally {
30
+ if (timer !== null) clearTimeout(timer);
31
+ if (signal) signal.removeEventListener('abort', onAbort);
32
+ }
33
+ }