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.
Files changed (50) hide show
  1. package/README.md +102 -100
  2. package/README.vi.md +105 -93
  3. package/README.zh.md +102 -98
  4. package/cli/skills.js +103 -4
  5. package/cli.js +5 -2
  6. package/package.json +1 -1
  7. package/web-ui/app.js +14 -0
  8. package/web-ui/logic.codex.mjs +14 -0
  9. package/web-ui/modules/app.computed.main-tabs.mjs +12 -0
  10. package/web-ui/modules/app.methods.agents.mjs +0 -3
  11. package/web-ui/modules/app.methods.claude-config.mjs +26 -5
  12. package/web-ui/modules/app.methods.install.mjs +13 -17
  13. package/web-ui/modules/app.methods.navigation.mjs +1 -1
  14. package/web-ui/modules/app.methods.openclaw-editing.mjs +29 -0
  15. package/web-ui/modules/app.methods.openclaw-persist.mjs +3 -3
  16. package/web-ui/modules/app.methods.opencode-config.mjs +34 -0
  17. package/web-ui/modules/app.methods.pi-config.mjs +14 -9
  18. package/web-ui/modules/app.methods.prompts-editor.mjs +30 -6
  19. package/web-ui/modules/app.methods.providers.mjs +11 -0
  20. package/web-ui/modules/app.methods.session-trash.mjs +4 -5
  21. package/web-ui/modules/app.methods.startup-claude.mjs +11 -5
  22. package/web-ui/modules/claude-provider-presets.mjs +23 -0
  23. package/web-ui/modules/i18n/locales/en.mjs +29 -0
  24. package/web-ui/modules/i18n/locales/ja.mjs +29 -0
  25. package/web-ui/modules/i18n/locales/vi.mjs +29 -0
  26. package/web-ui/modules/i18n/locales/zh-tw.mjs +29 -0
  27. package/web-ui/modules/i18n/locales/zh.mjs +29 -0
  28. package/web-ui/modules/pi-provider-templates.mjs +6 -1
  29. package/web-ui/modules/session-features.mjs +25 -1
  30. package/web-ui/modules/skills.methods.mjs +61 -16
  31. package/web-ui/partials/index/layout-header.html +36 -37
  32. package/web-ui/partials/index/modal-openclaw-config.html +3 -0
  33. package/web-ui/partials/index/modals-basic.html +1 -1
  34. package/web-ui/partials/index/modals-pi-provider.html +1 -1
  35. package/web-ui/partials/index/panel-config-claude.html +4 -21
  36. package/web-ui/partials/index/panel-config-codex.html +3 -1
  37. package/web-ui/partials/index/panel-config-opencode.html +4 -0
  38. package/web-ui/partials/index/panel-market.html +10 -3
  39. package/web-ui/partials/index/panel-prompts.html +40 -20
  40. package/web-ui/partials/index/panel-settings.html +45 -0
  41. package/web-ui/partials/index/session-features.html +24 -7
  42. package/web-ui/res/web-ui-render.precompiled.js +531 -271
  43. package/web-ui/styles/layout-shell.css +41 -70
  44. package/web-ui/styles/prompts-editor.css +127 -27
  45. package/web-ui/styles/session-features.css +12 -1
  46. package/web-ui/styles/settings-panel.css +4 -0
  47. package/web-ui/styles/system-prompt.css +9 -4
  48. package/web-ui/styles/theme-dark.css +0 -18
  49. package/web-ui/styles/theme-ocean.css +0 -14
  50. package/web-ui/styles/theme-violet.css +0 -23
@@ -135,6 +135,11 @@ const zhTw = Object.freeze({
135
135
  "features.indexFailures": "{count} 項讀取失敗;結果未涵蓋這些記錄",
136
136
  "features.coverage": "已查 {scanned}/{total} 個已索引會話",
137
137
  "features.partial": "結果未完整涵蓋目前範圍;最多顯示 100 條命中",
138
+ "features.resultView": "結果檢視",
139
+ "features.byMessage": "按訊息",
140
+ "features.bySession": "按會話",
141
+ "features.returnedMatches": "已傳回 {count} 筆命中",
142
+ "features.groupedTruncated": "已達結果上限;會話分組只統計已傳回的命中。",
138
143
  "features.context": "前後文",
139
144
  "features.generateDraft": "產生交接草稿({count} 條)",
140
145
  "features.draftReview": "草稿未傳送;先核對證據,再填寫或修改後續步驟。",
@@ -555,6 +560,8 @@ const zhTw = Object.freeze({
555
560
  'prompts.editor.preview': '預覽',
556
561
  'prompts.editor.previewUnavailable': '預覽元件未載入(marked / DOMPurify 缺失),請重新整理頁面',
557
562
  'prompts.editor.previewEmpty': '尚無內容可預覽',
563
+ 'prompts.editor.outline': '文件大綱',
564
+ 'prompts.editor.outlineEmpty': '暫無標題',
558
565
  'prompts.editor.changeAxis': '改動導覽軸',
559
566
  'prompts.editor.changeAxisTick': '第 {line} 行(+{added} / -{removed})',
560
567
  'prompts.tokenCount.hint': '約 {count} tokens',
@@ -1319,6 +1326,12 @@ const zhTw = Object.freeze({
1319
1326
  'opencode.summary.sourceCodexMate': 'CodexMate 庫',
1320
1327
  'opencode.summary.sourceOpenCode': 'OpenCode 生效',
1321
1328
  'config.providerTemplate.title': '預設供應商',
1329
+ 'config.providerTemplate.direct': '直連',
1330
+ 'config.providerTemplate.bridge': '本機轉換',
1331
+ 'config.providerTemplate.fillDraft': '填入草稿:{name}',
1332
+ 'config.providerTemplate.duplicate': '供應商 {name} 已存在',
1333
+ 'opencode.preset.hint': '只修改下方草稿。儲存設定不會切換預設模型。執行 OpenCode 時請設定 DEEPSEEK_API_KEY。 另存為 JSON,移除註解。',
1334
+ 'opencode.preset.invalidProviders': 'OpenCode 的 provider 必須是物件。',
1322
1335
  'config.models': '模型',
1323
1336
  'config.modelLoading': '載入中...',
1324
1337
  'config.models.unlimited': '目前無模型列表,可手填。',
@@ -1442,6 +1455,11 @@ const zhTw = Object.freeze({
1442
1455
  'settings.tab.general': '通用',
1443
1456
  'settings.tab.data': '資料',
1444
1457
  'settings.tabs.aria': '設定分類',
1458
+ 'settings.tab.about': '關於',
1459
+ 'settings.about.update': '軟體更新',
1460
+ 'settings.about.currentVersion': '目前版本:{version}',
1461
+ 'settings.about.latestVersion': '最新版本:{version}',
1462
+ 'settings.about.viewUpdate': '查看更新',
1445
1463
  'settings.quickSettings.title': '快捷設定',
1446
1464
  'settings.language.sideLabel': '語言:{language}',
1447
1465
  'announcement.providerCache.open': '功能公告',
@@ -1632,6 +1650,17 @@ const zhTw = Object.freeze({
1632
1650
 
1633
1651
  'market.backup.action': '備份目前目標',
1634
1652
  'market.backup.running': '備份中...',
1653
+ 'market.backup.export': '匯出備份',
1654
+ 'market.backup.import': '匯入備份',
1655
+ 'market.backup.targetChanged': '目標已切換,請重新選擇備份。',
1656
+ 'market.backup.tooLarge': '備份超過 20 MiB,無法匯入。',
1657
+ 'market.backup.invalid': '請選擇有效的 v1 Skills 備份。',
1658
+ 'market.backup.importFailed': '匯入備份失敗。',
1659
+ 'market.backup.result': '已還原 {restored} 項,略過 {skipped} 項,失敗 {failed} 項。',
1660
+ 'market.backup.exportFailed': '匯出備份失敗。',
1661
+ 'market.backup.exportPartial': '已匯出 {count} 項,失敗 {failed} 項。',
1662
+ 'market.backup.exportResult': '已匯出 {count} 項。',
1663
+ 'market.backup.exportLimited': '此 ZIP 可保留作離線備份,無法透過網頁匯入。',
1635
1664
  'market.export.action': '匯出選中',
1636
1665
  'market.export.running': '匯出中...',
1637
1666
  'market.selection.all': '全選',
@@ -135,6 +135,11 @@ const zh = Object.freeze({
135
135
  "features.indexFailures": "{count} 项读取失败;结果未覆盖这些记录",
136
136
  "features.coverage": "已查 {scanned}/{total} 条已索引会话",
137
137
  "features.partial": "结果未完整覆盖当前范围;最多展示 100 条命中",
138
+ "features.resultView": "结果视图",
139
+ "features.byMessage": "按消息",
140
+ "features.bySession": "按会话",
141
+ "features.returnedMatches": "已返回 {count} 条命中",
142
+ "features.groupedTruncated": "已达结果上限;会话分组只统计已返回的命中。",
138
143
  "features.context": "前后文",
139
144
  "features.generateDraft": "生成交接草稿({count} 条)",
140
145
  "features.draftReview": "草稿未发送;先核对证据,再填写或修改后续步骤。",
@@ -555,6 +560,8 @@ const zh = Object.freeze({
555
560
  'prompts.editor.preview': '预览',
556
561
  'prompts.editor.previewUnavailable': '预览组件未加载(marked / DOMPurify 缺失),请刷新页面',
557
562
  'prompts.editor.previewEmpty': '暂无内容可预览',
563
+ 'prompts.editor.outline': '文档大纲',
564
+ 'prompts.editor.outlineEmpty': '暂无标题',
558
565
  'prompts.editor.changeAxis': '改动导航轴',
559
566
  'prompts.editor.changeAxisTick': '第 {line} 行(+{added} / -{removed})',
560
567
  'prompts.tokenCount.hint': '约 {count} tokens',
@@ -1319,6 +1326,12 @@ const zh = Object.freeze({
1319
1326
  'opencode.summary.sourceCodexMate': 'CodexMate 库',
1320
1327
  'opencode.summary.sourceOpenCode': 'OpenCode 生效',
1321
1328
  'config.providerTemplate.title': '预设供应商',
1329
+ 'config.providerTemplate.direct': '直连',
1330
+ 'config.providerTemplate.bridge': '本地转换',
1331
+ 'config.providerTemplate.fillDraft': '填入草稿:{name}',
1332
+ 'config.providerTemplate.duplicate': '供应商 {name} 已存在',
1333
+ 'opencode.preset.hint': '只修改下方草稿。保存配置不会切换默认模型。运行 OpenCode 时请设置 DEEPSEEK_API_KEY。 另存为 JSON,移除注释。',
1334
+ 'opencode.preset.invalidProviders': 'OpenCode 的 provider 必须是对象。',
1322
1335
  'config.models': '模型',
1323
1336
  'config.modelLoading': '加载中...',
1324
1337
  'config.models.unlimited': '当前无模型列表,可手填。',
@@ -1442,6 +1455,11 @@ const zh = Object.freeze({
1442
1455
  'settings.tab.general': '通用',
1443
1456
  'settings.tab.data': '数据',
1444
1457
  'settings.tabs.aria': '设置分类',
1458
+ 'settings.tab.about': '关于',
1459
+ 'settings.about.update': '软件更新',
1460
+ 'settings.about.currentVersion': '当前版本:{version}',
1461
+ 'settings.about.latestVersion': '最新版本:{version}',
1462
+ 'settings.about.viewUpdate': '查看更新',
1445
1463
  'settings.quickSettings.title': '快捷设置',
1446
1464
  'settings.language.sideLabel': '语言:{language}',
1447
1465
  'announcement.providerCache.open': '功能公告',
@@ -1632,6 +1650,17 @@ const zh = Object.freeze({
1632
1650
 
1633
1651
  'market.backup.action': '备份当前目标',
1634
1652
  'market.backup.running': '备份中...',
1653
+ 'market.backup.export': '导出备份',
1654
+ 'market.backup.import': '导入备份',
1655
+ 'market.backup.targetChanged': '目标已切换,请重新选择备份。',
1656
+ 'market.backup.tooLarge': '备份超过 20 MiB,无法导入。',
1657
+ 'market.backup.invalid': '请选择有效的 v1 Skills 备份。',
1658
+ 'market.backup.importFailed': '导入备份失败。',
1659
+ 'market.backup.result': '恢复 {restored} 项,跳过 {skipped} 项,失败 {failed} 项。',
1660
+ 'market.backup.exportFailed': '导出备份失败。',
1661
+ 'market.backup.exportPartial': '已导出 {count} 项,失败 {failed} 项。',
1662
+ 'market.backup.exportResult': '已导出 {count} 项。',
1663
+ 'market.backup.exportLimited': '此 ZIP 可保留作离线备份,无法通过网页导入。',
1635
1664
  'market.export.action': '导出选中',
1636
1665
  'market.export.running': '导出中...',
1637
1666
  'market.selection.all': '全选',
@@ -11,7 +11,12 @@ export const PI_PROVIDER_TEMPLATE_GROUPS = [
11
11
  id: 'apiKey',
12
12
  i18nKey: 'pi.picker.group.apiKey',
13
13
  templates: [
14
- { id: 'openai', name: 'OpenAI', baseUrl: 'https://api.openai.com/v1', api: 'openai-responses' },
14
+ {
15
+ id: 'openai', name: 'OpenAI', baseUrl: 'https://api.openai.com/v1', api: 'openai-responses',
16
+ models: [
17
+ { id: 'gpt-5.4-mini', name: 'GPT-5.4 mini', reasoning: true, input: ['text', 'image'], contextWindow: 400000, maxTokens: 128000 }
18
+ ]
19
+ },
15
20
  { id: 'anthropic', name: 'Anthropic', baseUrl: 'https://api.anthropic.com', api: 'anthropic-messages' },
16
21
  { id: 'google-gemini', name: 'Google Gemini', baseUrl: 'https://generativelanguage.googleapis.com/v1beta', api: 'google-generative-ai' },
17
22
  { id: 'deepseek', name: 'DeepSeek', baseUrl: 'https://api.deepseek.com', api: 'openai-completions' },
@@ -3,6 +3,11 @@ import { sessionEvidenceMixin } from './session-evidence.mjs';
3
3
  import { usagePricingMixin } from './usage-pricing.mjs';
4
4
  import { sessionGitMixin } from './session-git.mjs';
5
5
  import { contextWindowReference } from '../logic.context-window.mjs';
6
+ const INDEX_RESULT_VIEW_KEY = 'codexmateSessionIndexResultView';
7
+ function readIndexResultView() {
8
+ try { return globalThis.localStorage?.getItem(INDEX_RESULT_VIEW_KEY) === 'sessions' ? 'sessions' : 'messages'; }
9
+ catch (_) { return 'messages'; }
10
+ }
6
11
  const SessionMessageActions = {
7
12
  props: { message: { type: Object, required: true } },
8
13
  render() {
@@ -29,10 +34,23 @@ export const sessionFeaturesMixin = {
29
34
  return { featureView: '', featureBusy: false, featureError: '', bookmarks: [], bookmarkRevision: '',
30
35
  bookmarkQuery: '', bookmarkTag: '', bookmarkProject: '', bookmarkEditor: null,
31
36
  selectedContextIds: [], featureFocus: null, featureRequestSeq: 0,
32
- indexReport: null, indexResults: null, indexQuery: '', indexTimer: null, handoffDraftEvidence: [], handoffUnverified: [], projectReport: null, projectSelected: '', projectAlias: '', projectPrompt: null, contextWindowInput: '', contextSelectedModel: '', contextFeatureSettings: null, contextSettingsRevision: '', diagnosticsReport: null, diagnosticsMarkdown: '', diagnosticsRemote: false,
37
+ indexReport: null, indexResults: null, indexQuery: '', indexTimer: null, indexResultView: readIndexResultView(), handoffDraftEvidence: [], handoffUnverified: [], projectReport: null, projectSelected: '', projectAlias: '', projectPrompt: null, contextWindowInput: '', contextSelectedModel: '', contextFeatureSettings: null, contextSettingsRevision: '', diagnosticsReport: null, diagnosticsMarkdown: '', diagnosticsRemote: false,
33
38
  diagnosticsTargets: [], diagnosticsSelected: [], diagnosticsTimer: null };
34
39
  },
35
40
  computed: {
41
+ indexResultRows() {
42
+ const hits = this.indexResults?.results || [];
43
+ if (this.indexResultView === 'messages') {
44
+ return hits.map(hit => ({ key: `message:${hit.session.key}:${hit.nodeId}`, session: hit.session, hits: [hit] }));
45
+ }
46
+ const sessions = new Map();
47
+ for (const hit of hits) {
48
+ const key = `session:${hit.session.key}`;
49
+ if (!sessions.has(key)) sessions.set(key, { key, session: hit.session, hits: [] });
50
+ sessions.get(key).hits.push(hit);
51
+ }
52
+ return [...sessions.values()];
53
+ },
36
54
  indexCatalogTime() {
37
55
  const timestamp = this.indexReport?.updatedAt;
38
56
  const parsed = typeof timestamp === 'string' ? Date.parse(timestamp) : NaN;
@@ -162,6 +180,12 @@ export const sessionFeaturesMixin = {
162
180
  try { await this.featureCall('session-index-cancel'); await this.pollSessionIndex(); }
163
181
  catch (error) { this.featureError = this.featureErrorText(error); }
164
182
  },
183
+ setIndexResultView(view) {
184
+ if (view !== 'messages' && view !== 'sessions') return;
185
+ this.indexResultView = view;
186
+ try { globalThis.localStorage?.setItem(INDEX_RESULT_VIEW_KEY, view); }
187
+ catch (_) { /* Keep the view usable when browser storage is disabled. */ }
188
+ },
165
189
  async searchSessionIndex() {
166
190
  if (this.featureBusy) return;
167
191
  const seq = ++this.featureRequestSeq;
@@ -7,6 +7,46 @@ function showUnsupportedSkillsTargetMessage(vm, app) {
7
7
  vm.showMessage(`不支持的 Skills 安装目标:${String(app)}`, 'error');
8
8
  }
9
9
 
10
+ const MAX_SKILLS_ZIP_SIZE = 20 * 1024 * 1024;
11
+
12
+ async function restoreSkillsFromBackup(event) {
13
+ const input = event.target;
14
+ const file = input.files?.[0];
15
+ const targetApp = input.dataset.targetApp;
16
+ delete input.dataset.targetApp;
17
+ input.value = '';
18
+ if (!file) return;
19
+ if (targetApp !== this.skillsTargetApp) {
20
+ this.showMessage(this.t('market.backup.targetChanged'), 'error');
21
+ return;
22
+ }
23
+ if (this.loading || this.initError || this.skillsMarketBusy) return;
24
+ if (file.size > MAX_SKILLS_ZIP_SIZE) {
25
+ this.showMessage(this.t('market.backup.tooLarge'), 'error');
26
+ return;
27
+ }
28
+ this.skillsZipImporting = true;
29
+ let refresh = false;
30
+ try {
31
+ const result = await this.uploadSkillsZipStream(file, { targetApp, restoreBackup: true });
32
+ if (result.error || !Array.isArray(result.imported) || !Array.isArray(result.skipped) || !Array.isArray(result.failed)) {
33
+ const key = result.backupError === 'invalid' ? 'invalid'
34
+ : result.backupError === 'tooLarge' ? 'tooLarge' : 'importFailed';
35
+ this.showMessage(this.t(`market.backup.${key}`), 'error');
36
+ return;
37
+ }
38
+ const counts = { restored: result.imported.length, skipped: result.skipped.length, failed: result.failed.length };
39
+ this.showMessage(this.t('market.backup.result', counts), counts.failed ? 'error' : counts.skipped ? 'info' : 'success');
40
+ refresh = counts.restored > 0 || counts.failed > 0;
41
+ if (refresh) await this.refreshSkillsList({ silent: true });
42
+ } catch (error) {
43
+ this.showMessage(this.t('market.backup.importFailed'), 'error');
44
+ } finally {
45
+ this.skillsZipImporting = false;
46
+ if (refresh) await this.scanImportableSkills({ silent: true });
47
+ }
48
+ }
49
+
10
50
  export function createSkillsMethods({ api }) {
11
51
  return {
12
52
  normalizeSkillsTargetApp(app) {
@@ -24,6 +64,8 @@ export function createSkillsMethods({ api }) {
24
64
  this.skillsMarketSelectedNames = [];
25
65
  this.skillsKeyword = '';
26
66
  this.skillsStatusFilter = 'all';
67
+ const backupInput = this.$refs?.skillsBackupImportInput;
68
+ if (backupInput) delete backupInput.dataset.targetApp;
27
69
  this.skillsRootPath = '';
28
70
  this.skillsList = [];
29
71
  this.skillsImportList = [];
@@ -299,15 +341,19 @@ export function createSkillsMethods({ api }) {
299
341
  }
300
342
  },
301
343
 
302
- triggerSkillsZipImport() {
303
- const input = this.$refs.skillsZipImportInput;
344
+ triggerSkillsZipImport(mode) {
345
+ const isBackup = mode === 'backup';
346
+ if (isBackup && (this.loading || this.initError || this.skillsMarketBusy)) return;
347
+ const input = isBackup ? this.$refs.skillsBackupImportInput : this.$refs.skillsZipImportInput;
304
348
  if (input) {
305
349
  input.value = '';
350
+ if (isBackup) input.dataset.targetApp = this.skillsTargetApp;
306
351
  input.click();
307
352
  }
308
353
  },
309
354
 
310
- handleSkillsZipImportChange(event) {
355
+ handleSkillsZipImportChange(event, mode) {
356
+ if (mode === 'backup') return restoreSkillsFromBackup.call(this, event);
311
357
  const file = event && event.target && event.target.files ? event.target.files[0] : null;
312
358
  if (file) {
313
359
  void this.importSkillsFromZipFile(file);
@@ -321,11 +367,12 @@ export function createSkillsMethods({ api }) {
321
367
  }
322
368
  },
323
369
 
324
- async uploadSkillsZipStream(file) {
370
+ async uploadSkillsZipStream(file, { targetApp = this.skillsTargetApp, restoreBackup = false } = {}) {
325
371
  const fileName = (file && typeof file.name === 'string' && file.name.trim())
326
372
  ? file.name.trim()
327
- : `${this.skillsTargetApp}-skills.zip`;
328
- const response = await fetch(`/api/import-skills-zip?targetApp=${encodeURIComponent(this.skillsTargetApp)}`, {
373
+ : `${targetApp}-skills.zip`;
374
+ const mode = restoreBackup ? '&mode=backup' : '';
375
+ const response = await fetch(`/api/import-skills-zip?targetApp=${encodeURIComponent(targetApp)}${mode}`, {
329
376
  method: 'POST',
330
377
  headers: authorizationHeaders({
331
378
  'x-codexmate-file-name': encodeURIComponent(fileName)
@@ -350,8 +397,7 @@ export function createSkillsMethods({ api }) {
350
397
 
351
398
  async importSkillsFromZipFile(file) {
352
399
  if (this.skillsDeleting || this.skillsScanningImports || this.skillsZipImporting || this.skillsImporting || this.skillsExporting || this.skillsBackingUp) return;
353
- const maxSize = 20 * 1024 * 1024;
354
- if (file.size > maxSize) {
400
+ if (file.size > MAX_SKILLS_ZIP_SIZE) {
355
401
  this.showMessage('ZIP 文件过大,限制 20MB', 'error');
356
402
  this.resetSkillsZipImportInput();
357
403
  return;
@@ -441,12 +487,8 @@ export function createSkillsMethods({ api }) {
441
487
  this.skillsBackingUp = true;
442
488
  try {
443
489
  const res = await api('backup-skills', { targetApp: this.skillsTargetApp });
444
- if (res && res.error) {
445
- this.showMessage(res.error, 'error');
446
- return;
447
- }
448
- if (!res || !res.fileName) {
449
- this.showMessage('备份失败:未生成压缩包', 'error');
490
+ if (res?.error || !res?.fileName) {
491
+ this.showMessage(this.t('market.backup.exportFailed'), 'error');
450
492
  return;
451
493
  }
452
494
  const link = document.createElement('a');
@@ -456,9 +498,12 @@ export function createSkillsMethods({ api }) {
456
498
  link.click();
457
499
  document.body.removeChild(link);
458
500
  const count = Array.isArray(res.exported) ? res.exported.length : 0;
459
- this.showMessage(`已备份 ${this.skillsTargetLabel} 的 ${count} 个 skill`, 'success');
501
+ const failed = Array.isArray(res.failed) ? res.failed.length : 0;
502
+ const summary = this.t(failed ? 'market.backup.exportPartial' : 'market.backup.exportResult', { count, failed });
503
+ const message = res.restoreWarning ? `${summary} ${this.t('market.backup.exportLimited')}` : summary;
504
+ this.showMessage(message, failed || res.restoreWarning ? 'error' : 'success');
460
505
  } catch (e) {
461
- this.showMessage('备份 skill 失败', 'error');
506
+ this.showMessage(this.t('market.backup.exportFailed'), 'error');
462
507
  } finally {
463
508
  this.skillsBackingUp = false;
464
509
  }
@@ -412,47 +412,46 @@
412
412
  </div>
413
413
  </div>
414
414
 
415
- <div class="side-rail-lang">
416
- <div class="side-rail-lang-actions">
417
- <div class="side-language-menu">
415
+ <div class="side-rail-footer">
416
+ <button
417
+ type="button"
418
+ class="side-rail-action side-announcement-button"
419
+ @click="openProviderCacheAnnouncementModal">
420
+ <svg class="side-rail-action-icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
421
+ <path d="M15 8.5a5 5 0 0 0-10 0c0 2.75-1 4.25-2 5.5h14c-1-1.25-2-2.75-2-5.5Z"/>
422
+ <path d="M8 16a2 2 0 0 0 4 0"/>
423
+ </svg>
424
+ <span>{{ t('announcement.providerCache.open') }}</span>
425
+ <svg class="side-rail-action-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>
426
+ </button>
427
+ <div class="side-language-menu">
428
+ <button
429
+ type="button"
430
+ class="side-rail-action"
431
+ :aria-label="t('settings.language.sideLabel', { language: currentLanguageLabel() })"
432
+ :aria-expanded="languageMenuOpen ? 'true' : 'false'"
433
+ aria-haspopup="menu"
434
+ @click="toggleLanguageMenu"
435
+ @keydown.esc.prevent="closeLanguageMenu">
436
+ <svg class="side-rail-action-icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><circle cx="10" cy="10" r="7.5"/><ellipse cx="10" cy="10" rx="3.25" ry="7.5"/><path d="M2.5 10h15"/></svg>
437
+ <span>{{ currentLanguageLabel() }}</span>
438
+ <svg class="side-rail-action-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg>
439
+ </button>
440
+ <div v-if="languageMenuOpen" class="side-language-dropdown" role="menu" @focusout="handleLanguageMenuFocusOut">
418
441
  <button
442
+ v-for="option in languageOptions()"
443
+ :key="option.code"
419
444
  type="button"
420
- class="language-settings-link"
421
- :aria-label="t('settings.language.sideLabel', { language: currentLanguageLabel() })"
422
- :aria-expanded="languageMenuOpen ? 'true' : 'false'"
423
- aria-haspopup="menu"
424
- @click="toggleLanguageMenu"
425
- @keydown.esc.prevent="closeLanguageMenu">
426
- {{ currentLanguageLabel() }}
427
- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 6l4 4 4-4"/></svg>
445
+ class="side-language-option"
446
+ :class="{ active: option.code === lang }"
447
+ role="menuitemradio"
448
+ :aria-checked="option.code === lang ? 'true' : 'false'"
449
+ @click="selectLanguage(option.code)">
450
+ <span>{{ option.nativeName }}</span>
451
+ <small>{{ option.englishName }}</small>
452
+ <svg v-if="option.code === lang" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>
428
453
  </button>
429
- <div v-if="languageMenuOpen" class="side-language-dropdown" role="menu" @focusout="handleLanguageMenuFocusOut">
430
- <button
431
- v-for="option in languageOptions()"
432
- :key="option.code"
433
- type="button"
434
- class="side-language-option"
435
- :class="{ active: option.code === lang }"
436
- role="menuitemradio"
437
- :aria-checked="option.code === lang ? 'true' : 'false'"
438
- @click="selectLanguage(option.code)">
439
- <span>{{ option.nativeName }}</span>
440
- <small>{{ option.englishName }}</small>
441
- <svg v-if="option.code === lang" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.5 8.5l3 3 6-7"/></svg>
442
- </button>
443
- </div>
444
454
  </div>
445
- <button
446
- type="button"
447
- class="side-announcement-button"
448
- :aria-label="t('announcement.providerCache.open')"
449
- :title="t('announcement.providerCache.open')"
450
- @click="openProviderCacheAnnouncementModal">
451
- <svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" width="16" height="16" aria-hidden="true">
452
- <path d="M15 8.5a5 5 0 0 0-10 0c0 2.75-1 4.25-2 5.5h14c-1-1.25-2-2.75-2-5.5Z"/>
453
- <path d="M8 16a2 2 0 0 0 4 0"/>
454
- </svg>
455
- </button>
456
455
  </div>
457
456
  </div>
458
457
  </aside>
@@ -49,6 +49,9 @@
49
49
  </svg>
50
50
  </button>
51
51
  <div class="accordion-content" v-show="openclawAccordionStep === 1">
52
+ <div class="form-group">
53
+ <button type="button" class="btn-mini" @click="fillOpenclawProviderPreset" :disabled="openclawFileLoading || openclawSaving || openclawApplying || !isToolConfigWriteAllowed('openclaw')">{{ t('config.providerTemplate.fillDraft', { name: 'OpenAI API' }) }}</button>
54
+ </div>
52
55
  <div class="form-group">
53
56
  <label class="form-label">{{ t('field.providerName') }}</label>
54
57
  <input v-model="openclawQuick.providerName" class="form-input" :placeholder="t('modal.openclaw.quick.providerNamePlaceholder')" @input="validateProviderName">
@@ -366,7 +366,7 @@
366
366
 
367
367
  <div class="btn-group">
368
368
  <button class="btn btn-cancel" @click="closeClaudeConfigModal">{{ t('common.cancel') }}</button>
369
- <button class="btn btn-confirm" @click="addClaudeConfig" :disabled="!canSubmitClaudeConfig('add')">{{ t('common.add') }}</button>
369
+ <button class="btn btn-confirm" @click="addClaudeConfig" :disabled="!canSubmitClaudeConfig('add')">{{ t(claudeAddFromPreset ? 'common.save' : 'common.add') }}</button>
370
370
  </div>
371
371
  </div>
372
372
  </div>
@@ -61,7 +61,7 @@
61
61
  <div class="card-list">
62
62
  <div class="card" v-for="(model, index) in editingPiProvider.form.models" :key="index">
63
63
  <div class="input-with-toggle">
64
- <input class="form-input" type="text" v-model="model.id" autocomplete="off" spellcheck="false" placeholder="claude-sonnet-4" :disabled="!isToolConfigWriteAllowed('pi')">
64
+ <input class="form-input" type="text" :value="model.id" @input="updatePiModelId(model, $event.target.value)" autocomplete="off" spellcheck="false" placeholder="claude-sonnet-4" :disabled="!isToolConfigWriteAllowed('pi')">
65
65
  <button type="button" class="btn-tool input-toggle-btn" @click="editingPiProvider.form.models.splice(index, 1)" :disabled="!isToolConfigWriteAllowed('pi')">{{ t('pi.providers.models.remove') }}</button>
66
66
  </div>
67
67
  </div>
@@ -55,28 +55,11 @@
55
55
 
56
56
  <div class="selector-section">
57
57
  <div class="selector-header"><span class="selector-title">{{ t('claude.presetProviders') }}</span></div>
58
- <div class="btn-group" style="flex-wrap: wrap; gap: 8px; margin-top: 0;">
59
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Claude Official'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.anthropic.com'; newClaudeConfig.model = 'claude-sonnet-4'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Claude Official</button>
60
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'DeepSeek'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.deepseek.com/anthropic'; newClaudeConfig.model = 'DeepSeek-V3.2'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">DeepSeek</button>
61
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Zhipu GLM'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://open.bigmodel.cn/api/anthropic'; newClaudeConfig.model = 'glm-5'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Zhipu GLM</button>
62
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Z.ai GLM'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.z.ai/api/anthropic'; newClaudeConfig.model = 'glm-5'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Z.ai GLM</button>
63
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Qwen Coder'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://coding.dashscope.aliyuncs.com/apps/anthropic'; newClaudeConfig.model = 'qwen3-coder'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Qwen Coder</button>
64
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Kimi k2'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.moonshot.cn/anthropic'; newClaudeConfig.model = 'kimi-k2.5'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Kimi k2</button>
65
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Kimi For Coding'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.kimi.com/coding/'; newClaudeConfig.model = 'kimi-k2.5'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Kimi For Coding</button>
66
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'KAT-Coder'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://vanchin.streamlake.ai/api/gateway/v1/endpoints/${ENDPOINT_ID}/claude-code-proxy'; newClaudeConfig.model = 'KAT-Coder-Pro V1'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">KAT-Coder</button>
67
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Longcat'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.longcat.chat/anthropic'; newClaudeConfig.model = 'LongCat-Flash-Chat'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Longcat</button>
68
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'MiniMax'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.minimaxi.com/anthropic'; newClaudeConfig.model = 'MiniMax-M2.7'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">MiniMax</button>
69
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'MiniMax en'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.minimax.io/anthropic'; newClaudeConfig.model = 'MiniMax-M2.7'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">MiniMax en</button>
70
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'DouBaoSeed'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://ark.cn-beijing.volces.com/api/coding'; newClaudeConfig.model = 'doubao-seed-2-0-code-preview-latest'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">DouBaoSeed</button>
71
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'BaiLing'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.tbox.cn/api/anthropic'; newClaudeConfig.model = 'Ling-2.5-1T'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">BaiLing</button>
72
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'ModelScope'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api-inference.modelscope.cn'; newClaudeConfig.model = 'ZhipuAI/GLM-5'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">ModelScope</button>
73
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'AiHubMix'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://aihubmix.com'; newClaudeConfig.model = 'glm-4.7'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">AiHubMix</button>
74
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'DMXAPI'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://www.dmxapi.cn'; newClaudeConfig.model = 'glm-4.7'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">DMXAPI</button>
75
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'PackyCode'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://www.packyapi.com'; newClaudeConfig.model = 'glm-4.7'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">PackyCode</button>
76
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'AnyRouter'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://anyrouter.top'; newClaudeConfig.model = 'claude-opus-4-7[1m]'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">AnyRouter</button>
77
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Xiaomi MiMo'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://api.xiaomimimo.com/anthropic'; newClaudeConfig.model = 'mimo-v2.5-pro'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Xiaomi MiMo</button>
78
- <button type="button" class="btn-mini" @click="newClaudeConfig.name = 'Xiaomi Token Plan'; newClaudeConfig.apiKey = ''; newClaudeConfig.baseUrl = 'https://token-plan-cn.xiaomimimo.com/anthropic'; newClaudeConfig.model = 'mimo-v2.5-pro'; showAddClaudeConfigKey = false; showClaudeConfigModal = true">Xiaomi Token Plan</button>
58
+ <input type="search" class="form-input" v-model="claudeProviderPresetQuery" :placeholder="t('pi.picker.searchPlaceholder')" :aria-label="t('pi.picker.searchPlaceholder')" autocomplete="off">
59
+ <div class="btn-group" style="flex-wrap: wrap; gap: 8px;">
60
+ <button v-for="preset in matchingClaudeProviderPresets()" :key="preset.name" type="button" class="btn-mini" :disabled="!isToolConfigWriteAllowed('claude')" @click="openClaudeProviderPreset(preset)">{{ preset.name }}</button>
79
61
  </div>
62
+ <div v-if="!matchingClaudeProviderPresets().length" class="config-template-hint">{{ t('pi.picker.empty') }}</div>
80
63
  </div>
81
64
 
82
65
  <div class="selector-section">
@@ -57,7 +57,9 @@
57
57
  <span class="selector-title">{{ t('config.providerTemplate.title') }}</span>
58
58
  </div>
59
59
  <div class="btn-group" style="flex-wrap: wrap; gap: 8px; margin-top: 0;">
60
- <button v-for="tpl in codexProviderTemplates" :key="tpl.name" type="button" class="btn-mini" @click="newProvider.name = tpl.name; newProvider.url = tpl.url; newProvider.model = tpl.model || ''; newProvider.useTransform = !!tpl.useTransform; showAddProviderKey = false; showAddModal = true">{{ tpl.label }}</button>
60
+ <button v-for="tpl in codexProviderTemplates" :key="tpl.name" type="button" class="btn-mini" :disabled="!isToolConfigWriteAllowed('codex')" @click="openCodexProviderPreset(tpl)">
61
+ {{ tpl.label }} · {{ t(tpl.useTransform ? 'config.providerTemplate.bridge' : 'config.providerTemplate.direct') }}
62
+ </button>
61
63
  </div>
62
64
  </div>
63
65
 
@@ -118,6 +118,10 @@
118
118
  <button type="button" class="btn-tool btn-tool-compact" @click="saveOpencodeConfig" :disabled="opencodeSaving || opencodeLoading || !isToolConfigWriteAllowed('opencode')">{{ opencodeSaving ? t('common.saving') : t('opencode.saveConfig') }}</button>
119
119
  </div>
120
120
  </div>
121
+ <div class="form-group">
122
+ <button type="button" class="btn-tool btn-tool-compact" @click="insertOpencodeProviderPreset" :disabled="opencodeLoading || opencodeSaving || opencodeApplying || !isToolConfigWriteAllowed('opencode')">{{ t('config.providerTemplate.fillDraft', { name: 'DeepSeek API' }) }}</button>
123
+ <div class="config-template-hint">{{ t('opencode.preset.hint') }}</div>
124
+ </div>
121
125
  <input ref="opencodeImportInput" class="sr-only" type="file" accept=".json,.jsonc,.opencode" @change="handleOpencodeImportChange">
122
126
  <div v-if="opencodeImportFileName" class="config-template-hint">{{ t('opencode.parsedFile', { file: opencodeImportFileName }) }}</div>
123
127
  <div v-if="opencodeError || opencodeImportError" class="config-template-hint error-text">{{ opencodeError || opencodeImportError }}</div>
@@ -50,9 +50,6 @@
50
50
  <span class="skills-flow-count">{{ skillsList.length }}</span>
51
51
  </div>
52
52
  <div class="skills-flow-actions">
53
- <button type="button" class="skills-action-btn" @click="backupCurrentSkills" :disabled="loading || !!initError || skillsMarketBusy || skillsList.length === 0">
54
- {{ skillsBackingUp ? t('market.backup.running') : t('market.backup.action') }}
55
- </button>
56
53
  <button type="button" class="skills-action-btn" @click="exportMarketSelectedSkills" :disabled="loading || !!initError || skillsMarketBusy || skillsMarketSelectedCount === 0">
57
54
  {{ skillsExporting ? t('market.export.running') : t('market.export.action') }} ({{ skillsMarketSelectedCount }})
58
55
  </button>
@@ -62,6 +59,16 @@
62
59
  </button>
63
60
  </div>
64
61
  </div>
62
+ <div class="skills-flow-actions">
63
+ <button type="button" class="skills-action-btn" @click="backupCurrentSkills" :disabled="loading || !!initError || skillsMarketBusy || skillsList.length === 0">
64
+ {{ skillsBackingUp ? t('market.backup.running') : t('market.backup.export') }}
65
+ </button>
66
+ <button type="button" class="skills-action-btn" @click="triggerSkillsZipImport('backup')" :disabled="loading || !!initError || skillsMarketBusy">
67
+ {{ skillsZipImporting ? t('modal.skills.actions.zipImporting') : t('market.backup.import') }}
68
+ </button>
69
+ <input ref="skillsBackupImportInput" type="file" accept=".zip,application/zip" hidden
70
+ @change="handleSkillsZipImportChange($event, 'backup')" @cancel="delete $event.target.dataset.targetApp">
71
+ </div>
65
72
  <div v-if="skillsList.length > 0" class="skills-market-selection-bar">
66
73
  <label class="skills-market-select-all">
67
74
  <input type="checkbox" :checked="skillsMarketAllSelected" @change="toggleAllSkillsMarketSelection" :disabled="skillsMarketBusy">