codexmate 0.1.29 → 0.1.31

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 (72) hide show
  1. package/README.md +95 -4
  2. package/README.vi.md +95 -4
  3. package/README.zh.md +96 -4
  4. package/cli/config-bootstrap.js +25 -11
  5. package/cli/skills.js +33 -8
  6. package/cli.js +364 -42
  7. package/lib/cli-config-engine.js +260 -0
  8. package/lib/cli-utils.js +2 -1
  9. package/lib/cli-webhook.js +1 -1
  10. package/lib/handoff-mcp.js +282 -0
  11. package/lib/http-access-control.js +335 -0
  12. package/lib/thread-handoff.js +130 -0
  13. package/lib/web-startup-auth.js +49 -0
  14. package/lib/workflow-engine.js +92 -21
  15. package/lib/workflow-runner.js +261 -0
  16. package/package.json +6 -1
  17. package/web-ui/app.js +33 -4
  18. package/web-ui/logic.sessions.mjs +24 -0
  19. package/web-ui/modules/access-token.mjs +33 -0
  20. package/web-ui/modules/api.mjs +2 -1
  21. package/web-ui/modules/app.computed.dashboard.mjs +1 -1
  22. package/web-ui/modules/app.methods.codex-config.mjs +1 -1
  23. package/web-ui/modules/app.methods.index.mjs +2 -0
  24. package/web-ui/modules/app.methods.navigation.mjs +17 -3
  25. package/web-ui/modules/app.methods.prompts-editor.mjs +7 -0
  26. package/web-ui/modules/app.methods.providers.mjs +2 -2
  27. package/web-ui/modules/app.methods.runtime.mjs +3 -2
  28. package/web-ui/modules/app.methods.session-actions.mjs +3 -0
  29. package/web-ui/modules/app.methods.session-browser.mjs +11 -3
  30. package/web-ui/modules/app.methods.system-prompt.mjs +1 -8
  31. package/web-ui/modules/app.methods.workflows.mjs +41 -0
  32. package/web-ui/modules/i18n/locales/en.mjs +43 -2
  33. package/web-ui/modules/i18n/locales/ja.mjs +43 -2
  34. package/web-ui/modules/i18n/locales/vi.mjs +43 -2
  35. package/web-ui/modules/i18n/locales/zh-tw.mjs +43 -2
  36. package/web-ui/modules/i18n/locales/zh.mjs +43 -2
  37. package/web-ui/modules/i18n.mjs +16 -0
  38. package/web-ui/modules/sessions-filters-url.mjs +3 -0
  39. package/web-ui/modules/skills.computed.mjs +11 -0
  40. package/web-ui/modules/skills.methods.mjs +63 -12
  41. package/web-ui/modules/thread-handoff.mjs +142 -0
  42. package/web-ui/partials/index/layout-footer.html +1 -1
  43. package/web-ui/partials/index/layout-header.html +32 -12
  44. package/web-ui/partials/index/panel-config-claude.html +2 -0
  45. package/web-ui/partials/index/panel-config-codex.html +2 -0
  46. package/web-ui/partials/index/panel-config-kilocode.html +3 -1
  47. package/web-ui/partials/index/panel-config-openclaw.html +2 -0
  48. package/web-ui/partials/index/panel-config-opencode.html +3 -1
  49. package/web-ui/partials/index/panel-config-pi.html +2 -0
  50. package/web-ui/partials/index/panel-dashboard.html +59 -0
  51. package/web-ui/partials/index/panel-market.html +23 -5
  52. package/web-ui/partials/index/panel-prompts.html +28 -16
  53. package/web-ui/partials/index/panel-sessions.html +51 -70
  54. package/web-ui/partials/index/panel-trash.html +3 -0
  55. package/web-ui/partials/index/thread-handoff.html +59 -0
  56. package/web-ui/res/web-ui-render.precompiled.js +1020 -493
  57. package/web-ui/styles/controls-forms.css +9 -0
  58. package/web-ui/styles/dashboard.css +51 -0
  59. package/web-ui/styles/feedback.css +26 -0
  60. package/web-ui/styles/layout-shell.css +66 -2
  61. package/web-ui/styles/modals-core.css +87 -0
  62. package/web-ui/styles/navigation-panels.css +5 -11
  63. package/web-ui/styles/plugins-panel.css +62 -0
  64. package/web-ui/styles/prompts-editor.css +11 -4
  65. package/web-ui/styles/responsive.css +19 -10
  66. package/web-ui/styles/sessions-list.css +19 -1
  67. package/web-ui/styles/sessions-preview.css +224 -140
  68. package/web-ui/styles/sessions-toolbar-trash.css +2 -2
  69. package/web-ui/styles/settings-panel.css +1 -1
  70. package/web-ui/styles/skills-market.css +47 -0
  71. package/web-ui/styles/titles-cards.css +1 -1
  72. package/web-ui/styles/trash-panel.css +43 -6
@@ -184,7 +184,7 @@ export function createDashboardComputed() {
184
184
  if (this.codexModelsLoading || this.claudeModelsLoading) tasks.push(this.t('dashboard.busy.models'));
185
185
  if (this.codexApplying || this.configTemplateApplying || this.openclawApplying) tasks.push(this.t('dashboard.busy.configApply'));
186
186
  if (this.agentsSaving) tasks.push(this.t('dashboard.busy.agents'));
187
- if (this.skillsLoading || this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting) tasks.push(this.t('dashboard.busy.skills'));
187
+ if (this.skillsLoading || this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting || this.skillsBackingUp) tasks.push(this.t('dashboard.busy.skills'));
188
188
  return tasks.length ? tasks.join(' / ') : this.t('dashboard.busy.idle');
189
189
  },
190
190
  inspectorMessageSummary() {
@@ -76,7 +76,7 @@ export function createCodexConfigMethods(options = {}) {
76
76
  source: session.source,
77
77
  sessionId: session.sessionId,
78
78
  filePath: session.filePath,
79
- ...(this.sessionExportRange === 'all' ? { maxMessages: 'all' } : {})
79
+ maxMessages: 'all'
80
80
  });
81
81
  if (res.error) {
82
82
  this.showMessage(res.error, 'error');
@@ -1,3 +1,4 @@
1
+ import { createWorkflowMethods } from './app.methods.workflows.mjs';
1
2
  import {
2
3
  API_BASE,
3
4
  api,
@@ -53,6 +54,7 @@ import {
53
54
  export function createAppMethods() {
54
55
  return {
55
56
  ...createI18nMethods(),
57
+ ...createWorkflowMethods({ api }),
56
58
  ...createPromptsEditorMethods({ api }),
57
59
  ...createWebhookMethods(),
58
60
  ...createStartupClaudeMethods({
@@ -86,8 +86,10 @@
86
86
  pathname = '/';
87
87
  }
88
88
  url.pathname = pathname;
89
+ const accessToken = url.searchParams.get('token') || '';
89
90
  url.search = '';
90
91
  url.hash = '';
92
+ if (accessToken) url.searchParams.set('token', accessToken);
91
93
  const nextUrl = url.toString();
92
94
  if (nextUrl === window.location.href) return;
93
95
  if (window.history && typeof window.history.replaceState === 'function') {
@@ -610,11 +612,23 @@
610
612
 
611
613
  scheduleAfterFrame(task) {
612
614
  const callback = typeof task === 'function' ? task : () => {};
615
+ const fallbackDelayMs = 100;
616
+ let completed = false;
617
+ let frameId;
618
+ let timer;
619
+ const run = () => {
620
+ if (completed) return;
621
+ completed = true;
622
+ clearTimeout(timer);
623
+ if (frameId !== undefined && typeof cancelAnimationFrame === 'function') {
624
+ cancelAnimationFrame(frameId);
625
+ }
626
+ callback();
627
+ };
628
+ timer = setTimeout(run, fallbackDelayMs);
613
629
  if (typeof requestAnimationFrame === 'function') {
614
- requestAnimationFrame(callback);
615
- return;
630
+ frameId = requestAnimationFrame(run);
616
631
  }
617
- setTimeout(callback, 16);
618
632
  },
619
633
  scheduleIdleTask(task, timeoutMs = 160) {
620
634
  const callback = typeof task === 'function' ? task : () => {};
@@ -78,6 +78,13 @@ export function createPromptsEditorMethods(options = {}) {
78
78
  promptsEditorMeta(key) {
79
79
  return PROMPTS_EDITOR_META[key] || null;
80
80
  },
81
+ promptPathFileName(path) {
82
+ const normalized = typeof path === 'string' ? path.trim() : '';
83
+ if (!normalized) {
84
+ return '';
85
+ }
86
+ return normalized.split(/[\\/]/).filter(Boolean).pop() || normalized;
87
+ },
81
88
 
82
89
 
83
90
  refreshPromptsPreview(key) {
@@ -1,6 +1,6 @@
1
1
  import { nextCodexProviderName } from './provider-default-names.mjs';
2
2
 
3
- const PROVIDER_NAME_PATTERN = /^[a-zA-Z0-9._-]+$/;
3
+ const PROVIDER_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
4
4
  const RESERVED_PROXY_PROVIDER_NAME = 'codexmate-proxy';
5
5
  const RESERVED_LOCAL_PROVIDER_NAME = 'local';
6
6
 
@@ -88,7 +88,7 @@ function getProviderValidationForContext(vm, mode = 'add') {
88
88
  if (!name) {
89
89
  errors.name = '名称不能为空';
90
90
  } else if (!isValidProviderNameInputValue(name)) {
91
- errors.name = '名称仅支持字母/数字/._-';
91
+ errors.name = '名称仅支持字母/数字/_-';
92
92
  } else if (isReservedProviderCreationNameInput(name)) {
93
93
  errors.name = 'codexmate-proxy 为保留名称,不可手动添加';
94
94
  } else if (findProviderByName(vm.providersList, name)) {
@@ -1,3 +1,4 @@
1
+ import { withAccessToken } from './access-token.mjs';
1
2
  import {
2
3
  buildSpeedTestIssue,
3
4
  formatLatency
@@ -219,7 +220,7 @@ export function createRuntimeMethods(options = {}) {
219
220
  return;
220
221
  }
221
222
  this.claudeDownloadProgress = 100;
222
- const downloadUrl = `/download/${encodeURIComponent(res.fileName)}`;
223
+ const downloadUrl = withAccessToken(`/download/${encodeURIComponent(res.fileName)}`);
223
224
  const link = document.createElement('a');
224
225
  link.href = downloadUrl;
225
226
  link.download = res.fileName;
@@ -260,7 +261,7 @@ export function createRuntimeMethods(options = {}) {
260
261
  return;
261
262
  }
262
263
  this.codexDownloadProgress = 100;
263
- const downloadUrl = `/download/${encodeURIComponent(res.fileName)}`;
264
+ const downloadUrl = withAccessToken(`/download/${encodeURIComponent(res.fileName)}`);
264
265
  const link = document.createElement('a');
265
266
  link.href = downloadUrl;
266
267
  link.download = res.fileName;
@@ -1,3 +1,4 @@
1
+ import { getAccessToken } from './access-token.mjs';
1
2
  import {
2
3
  normalizeConfigTemplateDiffConfirmEnabled
3
4
  } from './config-template-confirm-pref.mjs';
@@ -124,6 +125,8 @@ export function createSessionActionMethods(options = {}) {
124
125
  params.set('source', source);
125
126
  if (sessionId) params.set('sessionId', sessionId);
126
127
  if (filePath) params.set('filePath', filePath);
128
+ const accessToken = getAccessToken();
129
+ if (accessToken) params.set('token', accessToken);
127
130
  return `${origin}/session?${params.toString()}`;
128
131
  },
129
132
 
@@ -3,7 +3,8 @@ import {
3
3
  isSessionQueryEnabled,
4
4
  normalizeSessionMessageRole,
5
5
  normalizeSessionPathFilter,
6
- normalizeSessionSource
6
+ normalizeSessionSource,
7
+ parseSessionTitleInfo
7
8
  } from '../logic.mjs';
8
9
  import {
9
10
  applySessionsFilterUrlState,
@@ -78,6 +79,9 @@ export function createSessionBrowserMethods(options = {}) {
78
79
  normalizeSessionPathValue(value) {
79
80
  return normalizeSessionPathFilter(value);
80
81
  },
82
+ parseSessionTitleInfo(session) {
83
+ return parseSessionTitleInfo(session);
84
+ },
81
85
 
82
86
  mergeSessionPathOptions(baseList = [], incomingList = []) {
83
87
  const merged = [];
@@ -456,7 +460,9 @@ export function createSessionBrowserMethods(options = {}) {
456
460
  const scrollEl = this.getSessionPreviewScrollContainer();
457
461
  if (!scrollEl) return;
458
462
  if (typeof scrollEl.scrollTo === 'function') {
459
- scrollEl.scrollTo({ top: 0, behavior: 'smooth' });
463
+ const reduceMotion = typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
464
+ const instant = (typeof document !== 'undefined' && document.hidden) || reduceMotion;
465
+ scrollEl.scrollTo({ top: 0, behavior: instant ? 'instant' : 'smooth' });
460
466
  } else {
461
467
  scrollEl.scrollTop = 0;
462
468
  }
@@ -466,7 +472,9 @@ export function createSessionBrowserMethods(options = {}) {
466
472
  const scrollEl = this.getSessionPreviewScrollContainer();
467
473
  if (!scrollEl) return;
468
474
  if (typeof scrollEl.scrollTo === 'function') {
469
- scrollEl.scrollTo({ top: scrollEl.scrollHeight, behavior: 'smooth' });
475
+ const reduceMotion = typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
476
+ const instant = (typeof document !== 'undefined' && document.hidden) || reduceMotion;
477
+ scrollEl.scrollTo({ top: scrollEl.scrollHeight, behavior: instant ? 'instant' : 'smooth' });
470
478
  } else {
471
479
  scrollEl.scrollTop = scrollEl.scrollHeight;
472
480
  }
@@ -248,14 +248,7 @@ export function createSystemPromptMethods(options = {}) {
248
248
  const content = typeof this.sysPromptContent === 'string' ? this.sysPromptContent : '';
249
249
  if (!content) return;
250
250
  const filename = (this.sysPromptMode === 'system' ? 'SYSTEM.md' : 'APPEND_SYSTEM.md');
251
- const blob = new Blob([content], { type: 'text/markdown' });
252
- const a = document.createElement('a');
253
- a.href = URL.createObjectURL(blob);
254
- a.download = filename;
255
- document.body.appendChild(a);
256
- a.click();
257
- a.remove();
258
- URL.revokeObjectURL(a.href);
251
+ this.downloadTextFile(filename, content, 'text/markdown;charset=utf-8');
259
252
  },
260
253
 
261
254
  async pasteSysPromptContent() {
@@ -0,0 +1,41 @@
1
+ export function createWorkflowMethods({ api }) {
2
+ return {
3
+ async refreshWorkflowRuns() {
4
+ try {
5
+ const [definitions, result] = await Promise.all([api('workflow-list'), api('workflow-active-runs')]);
6
+ if (result.error || definitions.error) throw new Error(result.error || definitions.error);
7
+ this.workflowDefinitions = definitions.workflows || [];
8
+ this.workflowRuns = (result.runs || []).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
9
+ this.workflowError = '';
10
+ } catch (error) { this.workflowError = error.message; }
11
+ },
12
+ async submitWorkflowRun() {
13
+ this.workflowBusy = true;
14
+ try {
15
+ const input = JSON.parse(this.workflowInput);
16
+ const result = await api('workflow-submit', { id: this.workflowId, input, allowWrite: this.workflowAllowWrite });
17
+ if (result.error || result.ok === false) throw new Error(result.error || this.t('workflow.submitFailed'));
18
+ await this.refreshWorkflowRuns();
19
+ } catch (error) { this.workflowError = error instanceof SyntaxError ? this.t('workflow.invalidJson') : error.message; }
20
+ finally { this.workflowBusy = false; }
21
+ },
22
+ async controlWorkflowRun(run, action) {
23
+ this.workflowBusy = true;
24
+ try {
25
+ const params = { runId: run.id };
26
+ if (action === 'resume') {
27
+ params.input = JSON.parse(this.workflowInput);
28
+ params.allowWrite = this.workflowAllowWrite;
29
+ }
30
+ const result = await api(`workflow-${action}`, params);
31
+ if (result.error && !result.id) throw new Error(result.error);
32
+ await this.refreshWorkflowRuns();
33
+ } catch (error) { this.workflowError = error instanceof SyntaxError ? this.t('workflow.invalidJson') : error.message; }
34
+ finally { this.workflowBusy = false; }
35
+ },
36
+ workflowStatusLabel(status) {
37
+ return ['queued', 'running', 'waiting', 'completed', 'failed', 'cancelling', 'cancelled'].includes(status)
38
+ ? this.t(`workflow.status.${status}`) : status;
39
+ }
40
+ };
41
+ }
@@ -1,4 +1,36 @@
1
1
  const en = Object.freeze({
2
+ 'workflow.tagline': "Choose a task. Let it run in the background.",
3
+ 'workflow.options': "Input parameters",
4
+ 'workflow.title': "Automated workflows",
5
+ 'workflow.description': "You can close this page after submitting. Safe steps resume after the service restarts; intervention is requested when a write outcome is unclear.",
6
+ 'workflow.definition': "Task definition",
7
+ 'workflow.noDefinitions': "No task definitions available",
8
+ 'workflow.input': "Input (JSON)",
9
+ 'workflow.inputHint': "Before continuing, load the original input and verify authorization.",
10
+ 'workflow.allowWrite': "Authorize writes for this task",
11
+ 'workflow.submit': "Submit task",
12
+ 'workflow.submitting': "Submitting…",
13
+ 'workflow.refresh': "Refresh results",
14
+ 'workflow.refreshing': "Refreshing…",
15
+ 'workflow.runs': "Run history",
16
+ 'workflow.empty': "No runs yet",
17
+ 'workflow.emptyHint': "After submitting a task, view its status and execution results here.",
18
+ 'workflow.loadInput': "Load original input",
19
+ 'workflow.resume': "Continue after confirming input and authorization",
20
+ 'workflow.cancel': "Cancel further execution",
21
+ 'workflow.summary': "Results and unfinished items",
22
+ 'workflow.details': "Execution details and notification status",
23
+ 'workflow.runId': "Run ID",
24
+ 'workflow.submitFailed': "Submission failed",
25
+ 'workflow.invalidJson': "Enter valid JSON.",
26
+ 'workflow.status.queued': "Queued",
27
+ 'workflow.status.running': "Running",
28
+ 'workflow.status.waiting': "Action required",
29
+ 'workflow.status.completed': "Completed",
30
+ 'workflow.status.failed': "Failed",
31
+ 'workflow.status.cancelling': "Cancelling, waiting for the tool to finish",
32
+ 'workflow.status.cancelled': "Cancelled",
33
+
2
34
  // Global
3
35
  'lang.zh': '中文',
4
36
  'lang.zh-tw': '繁體中文',
@@ -230,8 +262,11 @@ const en = Object.freeze({
230
262
  'subtitle.prompts': 'Edit AGENTS.md and CLAUDE.md.',
231
263
  'prompts.subTab.codex': 'AGENTS.md (Codex)',
232
264
  'prompts.subTab.opencode': 'AGENTS.md (OpenCode)',
233
- 'prompts.subTab.project': 'CLAUDE.md',
234
- 'prompts.subTab.system': 'System Prompt (Pi)',
265
+ 'prompts.subTab.project': 'CLAUDE.md (Claude)',
266
+ 'prompts.subTab.system': 'SYSTEM.md (Pi)',
267
+ 'prompts.path.fullPath': 'Full path',
268
+ 'prompts.actions.edit': 'Edit',
269
+ 'prompts.actions.view': 'View',
235
270
  'prompts.pathReference.title': 'Insert rule reference',
236
271
  'prompts.pathReference.placeholder': 'Insert rule reference…',
237
272
  'prompts.pathReference.codex': 'AGENTS.md (Codex)',
@@ -1303,6 +1338,12 @@ const en = Object.freeze({
1303
1338
  'market.summary.importableDirect': 'Direct importable',
1304
1339
  'market.root.fallback': 'Default path',
1305
1340
 
1341
+ 'market.backup.action': 'Back up current target',
1342
+ 'market.backup.running': 'Backing up...',
1343
+ 'market.export.action': 'Export selected',
1344
+ 'market.export.running': 'Exporting...',
1345
+ 'market.selection.all': 'Select all',
1346
+ 'market.selection.count': '{count} selected',
1306
1347
  'market.installed.title': 'Installed skills',
1307
1348
  'market.installed.note': 'Showing top 6 only.',
1308
1349
  'market.local.refresh': 'Refresh local',
@@ -1,4 +1,36 @@
1
1
  const ja = Object.freeze({
2
+ 'workflow.tagline': "タスクを選んで、あとはバックグラウンドで。",
3
+ 'workflow.options': "入力パラメーター",
4
+ 'workflow.title': "自動ワークフロー",
5
+ 'workflow.description': "送信後はこのページを閉じられます。サービスの再起動後、安全なステップから再開します。書き込み結果が不明な場合は対応を求めます。",
6
+ 'workflow.definition': "タスク定義",
7
+ 'workflow.noDefinitions': "利用可能なタスク定義はありません",
8
+ 'workflow.input': "入力(JSON)",
9
+ 'workflow.inputHint': "続行前に元の入力を読み込み、権限を確認してください。",
10
+ 'workflow.allowWrite': "今回のタスクの書き込みを許可",
11
+ 'workflow.submit': "タスクを送信",
12
+ 'workflow.submitting': "送信中…",
13
+ 'workflow.refresh': "結果を更新",
14
+ 'workflow.refreshing': "更新中…",
15
+ 'workflow.runs': "実行履歴",
16
+ 'workflow.empty': "実行履歴はありません",
17
+ 'workflow.emptyHint': "タスクを送信すると、ここで状態と実行結果を確認できます。",
18
+ 'workflow.loadInput': "元の入力を読み込む",
19
+ 'workflow.resume': "入力と権限を確認して続行",
20
+ 'workflow.cancel': "以降の実行をキャンセル",
21
+ 'workflow.summary': "結果と未完了項目",
22
+ 'workflow.details': "実行の詳細と通知状態",
23
+ 'workflow.runId': "実行ID",
24
+ 'workflow.submitFailed': "送信に失敗しました",
25
+ 'workflow.invalidJson': "有効なJSONを入力してください。",
26
+ 'workflow.status.queued': "待機中",
27
+ 'workflow.status.running': "実行中",
28
+ 'workflow.status.waiting': "対応が必要",
29
+ 'workflow.status.completed': "完了",
30
+ 'workflow.status.failed': "失敗",
31
+ 'workflow.status.cancelling': "キャンセル処理中、ツールの終了を待っています",
32
+ 'workflow.status.cancelled': "キャンセル済み",
33
+
2
34
 
3
35
  // Global
4
36
  'lang.zh': '中国語',
@@ -231,8 +263,11 @@ const ja = Object.freeze({
231
263
  'subtitle.prompts': 'AGENTS.md と CLAUDE.md を編集。',
232
264
  'prompts.subTab.codex': 'AGENTS.md (Codex)',
233
265
  'prompts.subTab.opencode': 'AGENTS.md (OpenCode)',
234
- 'prompts.subTab.project': 'CLAUDE.md',
235
- 'prompts.subTab.system': 'System Prompt (Pi)',
266
+ 'prompts.subTab.project': 'CLAUDE.md (Claude)',
267
+ 'prompts.subTab.system': 'SYSTEM.md (Pi)',
268
+ 'prompts.path.fullPath': 'フルパス',
269
+ 'prompts.actions.edit': '編集',
270
+ 'prompts.actions.view': '表示',
236
271
  'prompts.pathReference.title': 'ルール参照を挿入',
237
272
  'prompts.pathReference.placeholder': 'ルール参照を挿入…',
238
273
  'prompts.pathReference.codex': 'AGENTS.md (Codex)',
@@ -1305,6 +1340,12 @@ const ja = Object.freeze({
1305
1340
  'market.summary.importableDirect': '直接インポート可',
1306
1341
  'market.root.fallback': 'デフォルトディレクトリ',
1307
1342
 
1343
+ 'market.backup.action': '現在のターゲットをバックアップ',
1344
+ 'market.backup.running': 'バックアップ中...',
1345
+ 'market.export.action': '選択をエクスポート',
1346
+ 'market.export.running': 'エクスポート中...',
1347
+ 'market.selection.all': 'すべて選択',
1348
+ 'market.selection.count': '{count} 件選択',
1308
1349
  'market.installed.title': 'インストール済 Skills',
1309
1350
  'market.installed.note': '上位 6 項目のみ表示。',
1310
1351
  'market.local.refresh': 'ローカルを更新',
@@ -1,4 +1,36 @@
1
1
  const vi = Object.freeze({
2
+ 'workflow.tagline': "Chọn tác vụ. Để hệ thống tiếp tục chạy nền.",
3
+ 'workflow.options': "Tham số đầu vào",
4
+ 'workflow.title': "Quy trình tự động",
5
+ 'workflow.description': "Bạn có thể đóng trang sau khi gửi. Các bước an toàn tiếp tục sau khi dịch vụ khởi động lại; hệ thống yêu cầu can thiệp khi chưa rõ kết quả ghi.",
6
+ 'workflow.definition': "Định nghĩa tác vụ",
7
+ 'workflow.noDefinitions': "Chưa có định nghĩa tác vụ khả dụng",
8
+ 'workflow.input': "Dữ liệu đầu vào (JSON)",
9
+ 'workflow.inputHint': "Trước khi tiếp tục, hãy tải dữ liệu đầu vào ban đầu và kiểm tra quyền đã cấp.",
10
+ 'workflow.allowWrite': "Cho phép ghi cho tác vụ này",
11
+ 'workflow.submit': "Gửi tác vụ",
12
+ 'workflow.submitting': "Đang gửi…",
13
+ 'workflow.refresh': "Làm mới kết quả",
14
+ 'workflow.refreshing': "Đang làm mới…",
15
+ 'workflow.runs': "Lịch sử thực thi",
16
+ 'workflow.empty': "Chưa có lần thực thi nào",
17
+ 'workflow.emptyHint': "Sau khi gửi tác vụ, xem trạng thái và kết quả thực thi tại đây.",
18
+ 'workflow.loadInput': "Tải dữ liệu đầu vào ban đầu",
19
+ 'workflow.resume': "Tiếp tục sau khi xác nhận dữ liệu đầu vào và quyền đã cấp",
20
+ 'workflow.cancel': "Hủy các bước thực thi tiếp theo",
21
+ 'workflow.summary': "Kết quả và các mục chưa hoàn thành",
22
+ 'workflow.details': "Chi tiết thực thi và trạng thái thông báo",
23
+ 'workflow.runId': "Mã lần thực thi",
24
+ 'workflow.submitFailed': "Gửi thất bại",
25
+ 'workflow.invalidJson': "Vui lòng nhập JSON hợp lệ.",
26
+ 'workflow.status.queued': "Đang chờ",
27
+ 'workflow.status.running': "Đang thực thi",
28
+ 'workflow.status.waiting': "Cần xử lý",
29
+ 'workflow.status.completed': "Đã hoàn thành",
30
+ 'workflow.status.failed': "Thất bại",
31
+ 'workflow.status.cancelling': "Đang hủy, chờ công cụ kết thúc",
32
+ 'workflow.status.cancelled': "Đã hủy",
33
+
2
34
  'plugins.catalog.promptTemplates.title': 'Mẫu prompt',
3
35
  'plugins.catalog.promptTemplates.description': 'Công cụ prompt theo mẫu, hỗ trợ biến, sao chép và xuất.',
4
36
  'plugins.status.standard': 'tiêu chuẩn',
@@ -259,8 +291,11 @@ const vi = Object.freeze({
259
291
  'subtitle.prompts': 'Chỉnh sửa AGENTS.md và CLAUDE.md.',
260
292
  'prompts.subTab.codex': 'AGENTS.md (Codex)',
261
293
  'prompts.subTab.opencode': 'AGENTS.md (OpenCode)',
262
- 'prompts.subTab.project': 'CLAUDE.md',
263
- 'prompts.subTab.system': 'System Prompt (Pi)',
294
+ 'prompts.subTab.project': 'CLAUDE.md (Claude)',
295
+ 'prompts.subTab.system': 'SYSTEM.md (Pi)',
296
+ 'prompts.path.fullPath': 'Đường dẫn đầy đủ',
297
+ 'prompts.actions.edit': 'Chỉnh sửa',
298
+ 'prompts.actions.view': 'Chế độ xem',
264
299
  'prompts.pathReference.title': 'Chèn tham chiếu quy tắc',
265
300
  'prompts.pathReference.placeholder': 'Chèn tham chiếu quy tắc…',
266
301
  'prompts.pathReference.codex': 'AGENTS.md (Codex)',
@@ -1293,6 +1328,12 @@ const vi = Object.freeze({
1293
1328
  'market.summary.importable': 'Có thể nhập',
1294
1329
  'market.summary.importableDirect': 'Nhập trực tiếp',
1295
1330
  'market.root.fallback': 'Đường dẫn mặc định',
1331
+ 'market.backup.action': 'Sao lưu mục tiêu hiện tại',
1332
+ 'market.backup.running': 'Đang sao lưu...',
1333
+ 'market.export.action': 'Xuất đã chọn',
1334
+ 'market.export.running': 'Đang xuất...',
1335
+ 'market.selection.all': 'Chọn tất cả',
1336
+ 'market.selection.count': 'Đã chọn {count}',
1296
1337
  'market.installed.title': 'Skills đã cài',
1297
1338
  'market.installed.note': 'Chỉ hiển thị top 6.',
1298
1339
  'market.local.refresh': 'Làm mới cục bộ',
@@ -1,4 +1,36 @@
1
1
  const zhTw = Object.freeze({
2
+ 'workflow.tagline': "選好任務,背景接著做。",
3
+ 'workflow.options': "輸入參數",
4
+ 'workflow.title': "自動工作流程",
5
+ 'workflow.description': "提交後可關閉頁面。服務重新啟動後會恢復安全步驟;寫入結果不明時會請求介入。",
6
+ 'workflow.definition': "任務定義",
7
+ 'workflow.noDefinitions': "暫無可用任務定義",
8
+ 'workflow.input': "輸入(JSON)",
9
+ 'workflow.inputHint': "繼續任務前,請先載入原始輸入並核對授權。",
10
+ 'workflow.allowWrite': "授權本次任務寫入",
11
+ 'workflow.submit': "提交任務",
12
+ 'workflow.submitting': "提交中…",
13
+ 'workflow.refresh': "重新整理結果",
14
+ 'workflow.refreshing': "重新整理中…",
15
+ 'workflow.runs': "執行紀錄",
16
+ 'workflow.empty': "暫無執行紀錄",
17
+ 'workflow.emptyHint': "提交任務後,可在此查看狀態與執行結果。",
18
+ 'workflow.loadInput': "載入原始輸入",
19
+ 'workflow.resume': "確認輸入與授權後繼續",
20
+ 'workflow.cancel': "取消後續執行",
21
+ 'workflow.summary': "結果與未完成項目",
22
+ 'workflow.details': "執行詳細資訊與通知狀態",
23
+ 'workflow.runId': "執行識別碼",
24
+ 'workflow.submitFailed': "提交失敗",
25
+ 'workflow.invalidJson': "請輸入有效的 JSON。",
26
+ 'workflow.status.queued': "排隊中",
27
+ 'workflow.status.running': "執行中",
28
+ 'workflow.status.waiting': "需要處理",
29
+ 'workflow.status.completed': "已完成",
30
+ 'workflow.status.failed': "失敗",
31
+ 'workflow.status.cancelling': "正在取消,等待工具結束",
32
+ 'workflow.status.cancelled': "已取消",
33
+
2
34
  // Global
3
35
  'lang.zh': '中文',
4
36
  'lang.zh-tw': '繁體中文',
@@ -230,8 +262,11 @@ const zhTw = Object.freeze({
230
262
  'subtitle.prompts': '編輯 AGENTS.md 與 CLAUDE.md。',
231
263
  'prompts.subTab.codex': 'AGENTS.md (Codex)',
232
264
  'prompts.subTab.opencode': 'AGENTS.md (OpenCode)',
233
- 'prompts.subTab.project': 'CLAUDE.md',
234
- 'prompts.subTab.system': 'System Prompt (Pi)',
265
+ 'prompts.subTab.project': 'CLAUDE.md (Claude)',
266
+ 'prompts.subTab.system': 'SYSTEM.md (Pi)',
267
+ 'prompts.path.fullPath': '完整路徑',
268
+ 'prompts.actions.edit': '編輯',
269
+ 'prompts.actions.view': '檢視',
235
270
  'prompts.pathReference.title': '插入規則引用',
236
271
  'prompts.pathReference.placeholder': '插入規則引用…',
237
272
  'prompts.pathReference.codex': 'AGENTS.md (Codex)',
@@ -1301,6 +1336,12 @@ const zhTw = Object.freeze({
1301
1336
  'market.summary.importableDirect': '可直接匯入',
1302
1337
  'market.root.fallback': '預設目錄',
1303
1338
 
1339
+ 'market.backup.action': '備份目前目標',
1340
+ 'market.backup.running': '備份中...',
1341
+ 'market.export.action': '匯出選中',
1342
+ 'market.export.running': '匯出中...',
1343
+ 'market.selection.all': '全選',
1344
+ 'market.selection.count': '已選 {count}',
1304
1345
  'market.installed.title': '已安裝 Skills',
1305
1346
  'market.installed.note': '僅顯示前 6 項。',
1306
1347
  'market.local.refresh': '重新整理本地',
@@ -1,4 +1,36 @@
1
1
  const zh = Object.freeze({
2
+ 'workflow.tagline': "选好任务,后台接着做。",
3
+ 'workflow.options': "输入参数",
4
+ 'workflow.title': "自动工作流",
5
+ 'workflow.description': "提交后可关闭页面。服务重启后恢复安全步骤;写入结果不明时请求介入。",
6
+ 'workflow.definition': "任务定义",
7
+ 'workflow.noDefinitions': "暂无可用任务定义",
8
+ 'workflow.input': "输入(JSON)",
9
+ 'workflow.inputHint': "继续任务前,请先载入原输入并核对授权。",
10
+ 'workflow.allowWrite': "授权本次任务写入",
11
+ 'workflow.submit': "提交任务",
12
+ 'workflow.submitting': "提交中…",
13
+ 'workflow.refresh': "刷新结果",
14
+ 'workflow.refreshing': "刷新中…",
15
+ 'workflow.runs': "运行记录",
16
+ 'workflow.empty': "暂无运行记录",
17
+ 'workflow.emptyHint': "提交任务后,可在这里查看状态与执行结果。",
18
+ 'workflow.loadInput': "载入原输入",
19
+ 'workflow.resume': "确认输入与授权后继续",
20
+ 'workflow.cancel': "取消后续执行",
21
+ 'workflow.summary': "结果与未完成项",
22
+ 'workflow.details': "执行详情与通知状态",
23
+ 'workflow.runId': "运行标识",
24
+ 'workflow.submitFailed': "提交失败",
25
+ 'workflow.invalidJson': "请输入有效的 JSON。",
26
+ 'workflow.status.queued': "排队中",
27
+ 'workflow.status.running': "执行中",
28
+ 'workflow.status.waiting': "需要处理",
29
+ 'workflow.status.completed': "已完成",
30
+ 'workflow.status.failed': "失败",
31
+ 'workflow.status.cancelling': "正在取消,等待工具结束",
32
+ 'workflow.status.cancelled': "已取消",
33
+
2
34
  // Global
3
35
  'lang.zh': '中文',
4
36
  'lang.zh-tw': '繁體中文',
@@ -230,8 +262,11 @@ const zh = Object.freeze({
230
262
  'subtitle.prompts': '编辑 AGENTS.md 与 CLAUDE.md。',
231
263
  'prompts.subTab.codex': 'AGENTS.md (Codex)',
232
264
  'prompts.subTab.opencode': 'AGENTS.md (OpenCode)',
233
- 'prompts.subTab.project': 'CLAUDE.md',
234
- 'prompts.subTab.system': 'System Prompt (Pi)',
265
+ 'prompts.subTab.project': 'CLAUDE.md (Claude)',
266
+ 'prompts.subTab.system': 'SYSTEM.md (Pi)',
267
+ 'prompts.path.fullPath': '完整路径',
268
+ 'prompts.actions.edit': '编辑',
269
+ 'prompts.actions.view': '视图',
235
270
  'prompts.pathReference.title': '插入规则引用',
236
271
  'prompts.pathReference.placeholder': '插入规则引用…',
237
272
  'prompts.pathReference.codex': 'AGENTS.md (Codex)',
@@ -1301,6 +1336,12 @@ const zh = Object.freeze({
1301
1336
  'market.summary.importableDirect': '可直接导入',
1302
1337
  'market.root.fallback': '默认目录',
1303
1338
 
1339
+ 'market.backup.action': '备份当前目标',
1340
+ 'market.backup.running': '备份中...',
1341
+ 'market.export.action': '导出选中',
1342
+ 'market.export.running': '导出中...',
1343
+ 'market.selection.all': '全选',
1344
+ 'market.selection.count': '已选 {count}',
1304
1345
  'market.installed.title': '已安装 Skills',
1305
1346
  'market.installed.note': '仅显示前 6 项。',
1306
1347
  'market.local.refresh': '刷新本地',
@@ -67,6 +67,22 @@ export function createI18nMethods() {
67
67
  currentLanguageLabel() {
68
68
  return getLanguageMeta(this.lang).nativeName || '中文';
69
69
  },
70
+ toggleLanguageMenu() {
71
+ this.languageMenuOpen = !this.languageMenuOpen;
72
+ },
73
+ closeLanguageMenu() {
74
+ this.languageMenuOpen = false;
75
+ },
76
+ selectLanguage(nextLang) {
77
+ this.setLang(nextLang);
78
+ this.languageMenuOpen = false;
79
+ },
80
+ handleLanguageMenuFocusOut(event) {
81
+ const currentTarget = event && event.currentTarget;
82
+ const relatedTarget = event && event.relatedTarget;
83
+ if (currentTarget && relatedTarget && currentTarget.contains(relatedTarget)) return;
84
+ this.languageMenuOpen = false;
85
+ },
70
86
  openLanguageSettings() {
71
87
  if (typeof this.switchMainTab === 'function') {
72
88
  this.switchMainTab('settings');
@@ -1,3 +1,4 @@
1
+ import { getAccessToken } from './access-token.mjs';
1
2
  import {
2
3
  buildSessionFilterCacheState,
3
4
  isSessionQueryEnabled
@@ -119,6 +120,8 @@ export function buildSessionsFilterShareUrl(vm) {
119
120
  // 使用干净的根路径作为基础 URL,避免把 /web-ui/index.html 或 /session 带进分享链接。
120
121
  const baseUrl = window.location.origin + '/';
121
122
  const url = canonicalizeWebUiUrl(new URL(baseUrl));
123
+ const accessToken = getAccessToken();
124
+ if (accessToken) url.searchParams.set('token', accessToken);
122
125
  url.searchParams.set('tab', 'sessions');
123
126
  url.searchParams.set('s_source', String(vm.sessionFilterSource || 'all'));
124
127
  if (vm.sessionPathFilter) url.searchParams.set('s_path', String(vm.sessionPathFilter || ''));
@@ -52,6 +52,10 @@
52
52
  const selected = Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : [];
53
53
  return Array.from(new Set(selected.map((item) => String(item || '').trim()).filter(Boolean))).length;
54
54
  },
55
+ skillsMarketSelectedCount() {
56
+ const selected = Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : [];
57
+ return Array.from(new Set(selected.map((item) => String(item || '').trim()).filter(Boolean))).length;
58
+ },
55
59
  skillsVisibleSelectedCount() {
56
60
  const selectable = this.skillsSelectableNames;
57
61
  const selectedSet = new Set(Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : []);
@@ -63,6 +67,12 @@
63
67
  const selectedSet = new Set(Array.isArray(this.skillsSelectedNames) ? this.skillsSelectedNames : []);
64
68
  return selectable.every((name) => selectedSet.has(name));
65
69
  },
70
+ skillsMarketAllSelected() {
71
+ const selectable = this.skillsList.map((item) => item && item.name).filter(Boolean);
72
+ if (!selectable.length) return false;
73
+ const selectedSet = new Set(Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : []);
74
+ return selectable.every((name) => selectedSet.has(name));
75
+ },
66
76
  skillsImportSelectableKeys() {
67
77
  const list = Array.isArray(this.skillsImportList) ? this.skillsImportList : [];
68
78
  return list
@@ -97,6 +107,7 @@
97
107
  || this.skillsImporting
98
108
  || this.skillsZipImporting
99
109
  || this.skillsExporting
110
+ || this.skillsBackingUp
100
111
  );
101
112
  },
102
113
  skillsMarketInstalledPreview() {