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.
- package/README.md +95 -4
- package/README.vi.md +95 -4
- package/README.zh.md +96 -4
- package/cli/config-bootstrap.js +25 -11
- package/cli/skills.js +33 -8
- package/cli.js +364 -42
- package/lib/cli-config-engine.js +260 -0
- package/lib/cli-utils.js +2 -1
- package/lib/cli-webhook.js +1 -1
- package/lib/handoff-mcp.js +282 -0
- package/lib/http-access-control.js +335 -0
- package/lib/thread-handoff.js +130 -0
- package/lib/web-startup-auth.js +49 -0
- package/lib/workflow-engine.js +92 -21
- package/lib/workflow-runner.js +261 -0
- package/package.json +6 -1
- package/web-ui/app.js +33 -4
- package/web-ui/logic.sessions.mjs +24 -0
- package/web-ui/modules/access-token.mjs +33 -0
- package/web-ui/modules/api.mjs +2 -1
- package/web-ui/modules/app.computed.dashboard.mjs +1 -1
- package/web-ui/modules/app.methods.codex-config.mjs +1 -1
- package/web-ui/modules/app.methods.index.mjs +2 -0
- package/web-ui/modules/app.methods.navigation.mjs +17 -3
- package/web-ui/modules/app.methods.prompts-editor.mjs +7 -0
- package/web-ui/modules/app.methods.providers.mjs +2 -2
- package/web-ui/modules/app.methods.runtime.mjs +3 -2
- package/web-ui/modules/app.methods.session-actions.mjs +3 -0
- package/web-ui/modules/app.methods.session-browser.mjs +11 -3
- package/web-ui/modules/app.methods.system-prompt.mjs +1 -8
- package/web-ui/modules/app.methods.workflows.mjs +41 -0
- package/web-ui/modules/i18n/locales/en.mjs +43 -2
- package/web-ui/modules/i18n/locales/ja.mjs +43 -2
- package/web-ui/modules/i18n/locales/vi.mjs +43 -2
- package/web-ui/modules/i18n/locales/zh-tw.mjs +43 -2
- package/web-ui/modules/i18n/locales/zh.mjs +43 -2
- package/web-ui/modules/i18n.mjs +16 -0
- package/web-ui/modules/sessions-filters-url.mjs +3 -0
- package/web-ui/modules/skills.computed.mjs +11 -0
- package/web-ui/modules/skills.methods.mjs +63 -12
- package/web-ui/modules/thread-handoff.mjs +142 -0
- package/web-ui/partials/index/layout-footer.html +1 -1
- package/web-ui/partials/index/layout-header.html +32 -12
- package/web-ui/partials/index/panel-config-claude.html +2 -0
- package/web-ui/partials/index/panel-config-codex.html +2 -0
- package/web-ui/partials/index/panel-config-kilocode.html +3 -1
- package/web-ui/partials/index/panel-config-openclaw.html +2 -0
- package/web-ui/partials/index/panel-config-opencode.html +3 -1
- package/web-ui/partials/index/panel-config-pi.html +2 -0
- package/web-ui/partials/index/panel-dashboard.html +59 -0
- package/web-ui/partials/index/panel-market.html +23 -5
- package/web-ui/partials/index/panel-prompts.html +28 -16
- package/web-ui/partials/index/panel-sessions.html +51 -70
- package/web-ui/partials/index/panel-trash.html +3 -0
- package/web-ui/partials/index/thread-handoff.html +59 -0
- package/web-ui/res/web-ui-render.precompiled.js +1020 -493
- package/web-ui/styles/controls-forms.css +9 -0
- package/web-ui/styles/dashboard.css +51 -0
- package/web-ui/styles/feedback.css +26 -0
- package/web-ui/styles/layout-shell.css +66 -2
- package/web-ui/styles/modals-core.css +87 -0
- package/web-ui/styles/navigation-panels.css +5 -11
- package/web-ui/styles/plugins-panel.css +62 -0
- package/web-ui/styles/prompts-editor.css +11 -4
- package/web-ui/styles/responsive.css +19 -10
- package/web-ui/styles/sessions-list.css +19 -1
- package/web-ui/styles/sessions-preview.css +224 -140
- package/web-ui/styles/sessions-toolbar-trash.css +2 -2
- package/web-ui/styles/settings-panel.css +1 -1
- package/web-ui/styles/skills-market.css +47 -0
- package/web-ui/styles/titles-cards.css +1 -1
- package/web-ui/styles/trash-panel.css +43 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { authorizationHeaders, withAccessToken } from './access-token.mjs';
|
|
1
2
|
function createUnsupportedSkillsTargetAppError(app) {
|
|
2
3
|
return new Error(`Unsupported skills target app: ${String(app)}`);
|
|
3
4
|
}
|
|
@@ -20,6 +21,7 @@ export function createSkillsMethods({ api }) {
|
|
|
20
21
|
|
|
21
22
|
resetSkillsTargetState() {
|
|
22
23
|
this.skillsSelectedNames = [];
|
|
24
|
+
this.skillsMarketSelectedNames = [];
|
|
23
25
|
this.skillsKeyword = '';
|
|
24
26
|
this.skillsStatusFilter = 'all';
|
|
25
27
|
this.skillsRootPath = '';
|
|
@@ -38,6 +40,7 @@ export function createSkillsMethods({ api }) {
|
|
|
38
40
|
|| this.skillsImporting
|
|
39
41
|
|| this.skillsZipImporting
|
|
40
42
|
|| this.skillsExporting
|
|
43
|
+
|| this.skillsBackingUp
|
|
41
44
|
|| this.skillsMarketLoading
|
|
42
45
|
) {
|
|
43
46
|
return false;
|
|
@@ -73,6 +76,7 @@ export function createSkillsMethods({ api }) {
|
|
|
73
76
|
|| this.skillsImporting
|
|
74
77
|
|| this.skillsZipImporting
|
|
75
78
|
|| this.skillsExporting
|
|
79
|
+
|| this.skillsBackingUp
|
|
76
80
|
|| this.skillsMarketLoading
|
|
77
81
|
) {
|
|
78
82
|
return false;
|
|
@@ -93,6 +97,7 @@ export function createSkillsMethods({ api }) {
|
|
|
93
97
|
this.skillsKeyword = '';
|
|
94
98
|
this.skillsStatusFilter = 'all';
|
|
95
99
|
this.skillsImportSelectedKeys = [];
|
|
100
|
+
this.skillsMarketSelectedNames = [];
|
|
96
101
|
}
|
|
97
102
|
this.showSkillsModal = true;
|
|
98
103
|
await this.refreshSkillsList({ silent: false });
|
|
@@ -106,6 +111,7 @@ export function createSkillsMethods({ api }) {
|
|
|
106
111
|
|| this.skillsImporting
|
|
107
112
|
|| this.skillsZipImporting
|
|
108
113
|
|| this.skillsExporting
|
|
114
|
+
|| this.skillsBackingUp
|
|
109
115
|
);
|
|
110
116
|
if (busy) return;
|
|
111
117
|
this.showSkillsModal = false;
|
|
@@ -213,7 +219,7 @@ export function createSkillsMethods({ api }) {
|
|
|
213
219
|
},
|
|
214
220
|
|
|
215
221
|
async scanImportableSkills(options = {}) {
|
|
216
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting) return false;
|
|
222
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting || this.skillsBackingUp) return false;
|
|
217
223
|
const silent = !!(options && options.silent);
|
|
218
224
|
this.skillsScanningImports = true;
|
|
219
225
|
try {
|
|
@@ -251,7 +257,7 @@ export function createSkillsMethods({ api }) {
|
|
|
251
257
|
},
|
|
252
258
|
|
|
253
259
|
async importSelectedSkills() {
|
|
254
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting) return;
|
|
260
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsImporting || this.skillsZipImporting || this.skillsExporting || this.skillsBackingUp) return;
|
|
255
261
|
const selectedSet = new Set(Array.isArray(this.skillsImportSelectedKeys) ? this.skillsImportSelectedKeys : []);
|
|
256
262
|
const selectedItems = (Array.isArray(this.skillsImportList) ? this.skillsImportList : [])
|
|
257
263
|
.filter((item) => selectedSet.has(this.buildSkillImportKey(item)))
|
|
@@ -321,9 +327,9 @@ export function createSkillsMethods({ api }) {
|
|
|
321
327
|
: `${this.skillsTargetApp}-skills.zip`;
|
|
322
328
|
const response = await fetch(`/api/import-skills-zip?targetApp=${encodeURIComponent(this.skillsTargetApp)}`, {
|
|
323
329
|
method: 'POST',
|
|
324
|
-
headers: {
|
|
330
|
+
headers: authorizationHeaders({
|
|
325
331
|
'x-codexmate-file-name': encodeURIComponent(fileName)
|
|
326
|
-
},
|
|
332
|
+
}),
|
|
327
333
|
body: file
|
|
328
334
|
});
|
|
329
335
|
let payload = {};
|
|
@@ -343,7 +349,7 @@ export function createSkillsMethods({ api }) {
|
|
|
343
349
|
},
|
|
344
350
|
|
|
345
351
|
async importSkillsFromZipFile(file) {
|
|
346
|
-
if (this.skillsDeleting || this.skillsScanningImports || this.skillsZipImporting || this.skillsImporting || this.skillsExporting) return;
|
|
352
|
+
if (this.skillsDeleting || this.skillsScanningImports || this.skillsZipImporting || this.skillsImporting || this.skillsExporting || this.skillsBackingUp) return;
|
|
347
353
|
const maxSize = 20 * 1024 * 1024;
|
|
348
354
|
if (file.size > maxSize) {
|
|
349
355
|
this.showMessage('ZIP 文件过大,限制 20MB', 'error');
|
|
@@ -378,9 +384,16 @@ export function createSkillsMethods({ api }) {
|
|
|
378
384
|
},
|
|
379
385
|
|
|
380
386
|
async exportSelectedSkills() {
|
|
381
|
-
if (this.skillsDeleting || this.skillsExporting || this.skillsZipImporting || this.skillsImporting) return;
|
|
382
|
-
|
|
383
|
-
|
|
387
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
388
|
+
return this.exportSkillSelection(this.skillsSelectedNames);
|
|
389
|
+
},
|
|
390
|
+
async exportMarketSelectedSkills() {
|
|
391
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
392
|
+
return this.exportSkillSelection(this.skillsMarketSelectedNames);
|
|
393
|
+
},
|
|
394
|
+
async exportSkillSelection(sourceNames) {
|
|
395
|
+
const selected = Array.isArray(sourceNames)
|
|
396
|
+
? Array.from(new Set(sourceNames.map((item) => String(item || '').trim()).filter(Boolean)))
|
|
384
397
|
: [];
|
|
385
398
|
if (!selected.length) {
|
|
386
399
|
this.showMessage('请先选择要导出的 skill', 'error');
|
|
@@ -402,9 +415,9 @@ export function createSkillsMethods({ api }) {
|
|
|
402
415
|
}
|
|
403
416
|
const exportedCount = Array.isArray(res.exported) ? res.exported.length : 0;
|
|
404
417
|
const failedCount = Array.isArray(res.failed) ? res.failed.length : 0;
|
|
405
|
-
const downloadUrl = typeof res.downloadPath === 'string' && res.downloadPath.trim()
|
|
418
|
+
const downloadUrl = withAccessToken(typeof res.downloadPath === 'string' && res.downloadPath.trim()
|
|
406
419
|
? res.downloadPath.trim()
|
|
407
|
-
: `/download/${encodeURIComponent(res.fileName)}
|
|
420
|
+
: `/download/${encodeURIComponent(res.fileName)}`);
|
|
408
421
|
const link = document.createElement('a');
|
|
409
422
|
link.href = downloadUrl;
|
|
410
423
|
link.download = res.fileName;
|
|
@@ -423,6 +436,33 @@ export function createSkillsMethods({ api }) {
|
|
|
423
436
|
}
|
|
424
437
|
},
|
|
425
438
|
|
|
439
|
+
async backupCurrentSkills() {
|
|
440
|
+
if (this.skillsDeleting || this.skillsExporting || this.skillsBackingUp || this.skillsZipImporting || this.skillsImporting) return;
|
|
441
|
+
this.skillsBackingUp = true;
|
|
442
|
+
try {
|
|
443
|
+
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');
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const link = document.createElement('a');
|
|
453
|
+
link.href = withAccessToken(res.downloadPath || `/download/${encodeURIComponent(res.fileName)}`);
|
|
454
|
+
link.download = res.fileName;
|
|
455
|
+
document.body.appendChild(link);
|
|
456
|
+
link.click();
|
|
457
|
+
document.body.removeChild(link);
|
|
458
|
+
const count = Array.isArray(res.exported) ? res.exported.length : 0;
|
|
459
|
+
this.showMessage(`已备份 ${this.skillsTargetLabel} 的 ${count} 个 skill`, 'success');
|
|
460
|
+
} catch (e) {
|
|
461
|
+
this.showMessage('备份 skill 失败', 'error');
|
|
462
|
+
} finally {
|
|
463
|
+
this.skillsBackingUp = false;
|
|
464
|
+
}
|
|
465
|
+
},
|
|
426
466
|
async deleteSelectedSkills() {
|
|
427
467
|
if (this.skillsDeleting || this.skillsZipImporting || this.skillsExporting || this.skillsImporting) return;
|
|
428
468
|
if (this.skillsScanningImports) {
|
|
@@ -479,11 +519,22 @@ export function createSkillsMethods({ api }) {
|
|
|
479
519
|
}
|
|
480
520
|
},
|
|
481
521
|
|
|
522
|
+
toggleSkillsMarketSelection(name) {
|
|
523
|
+
const value = String(name || '').trim();
|
|
524
|
+
if (!value) return;
|
|
525
|
+
const selected = new Set(Array.isArray(this.skillsMarketSelectedNames) ? this.skillsMarketSelectedNames : []);
|
|
526
|
+
if (selected.has(value)) selected.delete(value);
|
|
527
|
+
else selected.add(value);
|
|
528
|
+
this.skillsMarketSelectedNames = Array.from(selected);
|
|
529
|
+
},
|
|
530
|
+
toggleAllSkillsMarketSelection() {
|
|
531
|
+
const names = (Array.isArray(this.skillsList) ? this.skillsList : []).map((item) => item && item.name).filter(Boolean);
|
|
532
|
+
this.skillsMarketSelectedNames = this.skillsMarketAllSelected ? [] : names;
|
|
533
|
+
},
|
|
534
|
+
|
|
482
535
|
openSkillsMenu() {
|
|
483
|
-
// Open skills manager modal as menu
|
|
484
536
|
this.openSkillsManager();
|
|
485
537
|
},
|
|
486
|
-
|
|
487
538
|
async importSingleSkill(skill) {
|
|
488
539
|
if (this.skillsImporting || this.skillsZipImporting) return;
|
|
489
540
|
const key = this.buildSkillImportKey(skill);
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { api } from './api.mjs';
|
|
2
|
+
|
|
3
|
+
const STATUS_LABELS = Object.freeze({
|
|
4
|
+
awaiting_read: '等待读取',
|
|
5
|
+
file_ready: '文件已就绪',
|
|
6
|
+
read_confirmed: '目标自报已读取(附证据)'
|
|
7
|
+
});
|
|
8
|
+
const CARD_FIELDS = Object.freeze([
|
|
9
|
+
{ key: 'completed', label: '已完成事项' },
|
|
10
|
+
{ key: 'blockers', label: '阻塞事项' },
|
|
11
|
+
{ key: 'nextSteps', label: '后续步骤' },
|
|
12
|
+
{ key: 'files', label: '相关文件' }
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function emptyDraft() {
|
|
16
|
+
return { target: '', goal: '', completed: '', blockers: '', nextSteps: '', files: '' };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const threadHandoffMixin = {
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
handoffRecords: [],
|
|
23
|
+
handoffDraft: emptyDraft(),
|
|
24
|
+
handoffDrafts: new Map(),
|
|
25
|
+
handoffExpanded: false,
|
|
26
|
+
handoffFields: CARD_FIELDS,
|
|
27
|
+
handoffLoading: false,
|
|
28
|
+
handoffBusy: false,
|
|
29
|
+
handoffError: '',
|
|
30
|
+
handoffNotice: '',
|
|
31
|
+
handoffCopyText: '',
|
|
32
|
+
handoffRequestSeq: 0
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
handoffSessionKey() {
|
|
37
|
+
const session = this.activeSession;
|
|
38
|
+
return session && session.sessionId
|
|
39
|
+
? JSON.stringify([session.source || '', session.sessionId]) : '';
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
watch: {
|
|
43
|
+
handoffSessionKey: {
|
|
44
|
+
immediate: true,
|
|
45
|
+
handler(key, previousKey) {
|
|
46
|
+
if (previousKey) this.handoffDrafts.set(previousKey, this.handoffDraft);
|
|
47
|
+
this.handoffRequestSeq++;
|
|
48
|
+
this.handoffRecords = [];
|
|
49
|
+
this.handoffDraft = this.handoffDrafts.get(key) || emptyDraft();
|
|
50
|
+
this.handoffExpanded = false;
|
|
51
|
+
this.handoffError = '';
|
|
52
|
+
this.handoffNotice = '';
|
|
53
|
+
this.handoffCopyText = '';
|
|
54
|
+
this.handoffLoading = false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
toggleThreadHandoff(event) {
|
|
60
|
+
// Nested optional-field details also emit toggle events.
|
|
61
|
+
if (event.target !== event.currentTarget) return;
|
|
62
|
+
const expanded = event.currentTarget.open;
|
|
63
|
+
if (expanded === this.handoffExpanded) return;
|
|
64
|
+
this.handoffExpanded = expanded;
|
|
65
|
+
if (expanded) void this.loadThreadHandoffs();
|
|
66
|
+
},
|
|
67
|
+
handoffStatusLabel(status) {
|
|
68
|
+
return STATUS_LABELS[status] || '未知状态';
|
|
69
|
+
},
|
|
70
|
+
async loadThreadHandoffs() {
|
|
71
|
+
const threadId = this.activeSession && this.activeSession.sessionId;
|
|
72
|
+
if (!threadId || !this.handoffExpanded) return;
|
|
73
|
+
const requestSeq = ++this.handoffRequestSeq;
|
|
74
|
+
this.handoffLoading = true;
|
|
75
|
+
this.handoffError = '';
|
|
76
|
+
try {
|
|
77
|
+
const result = await api('thread-handoff-list', { threadId });
|
|
78
|
+
if (requestSeq !== this.handoffRequestSeq) return;
|
|
79
|
+
if (result.error) throw new Error(result.error);
|
|
80
|
+
this.handoffRecords = result.records || [];
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (requestSeq === this.handoffRequestSeq) this.handoffError = '加载交接历史失败:' + error.message;
|
|
83
|
+
} finally {
|
|
84
|
+
if (requestSeq === this.handoffRequestSeq) this.handoffLoading = false;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
async createThreadHandoff() {
|
|
88
|
+
const threadId = this.activeSession && this.activeSession.sessionId;
|
|
89
|
+
if (!threadId || this.handoffBusy) return;
|
|
90
|
+
const draft = this.handoffDraft;
|
|
91
|
+
const requestSeq = this.handoffRequestSeq;
|
|
92
|
+
if (!draft.target.trim() || !draft.goal.trim()) {
|
|
93
|
+
this.handoffError = '请填写目标代理与交接目标';
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const card = { goal: draft.goal.trim() };
|
|
97
|
+
for (const { key } of CARD_FIELDS) {
|
|
98
|
+
card[key] = draft[key].split(/\r?\n/).map(line => line.trim()).filter(Boolean);
|
|
99
|
+
}
|
|
100
|
+
this.handoffBusy = true;
|
|
101
|
+
this.handoffError = '';
|
|
102
|
+
this.handoffNotice = '';
|
|
103
|
+
try {
|
|
104
|
+
const result = await api('thread-handoff-create', { threadId, target: draft.target.trim(), card, cwd: this.activeSession.cwd || undefined });
|
|
105
|
+
if (result.error) throw new Error(result.error);
|
|
106
|
+
if (requestSeq !== this.handoffRequestSeq) return;
|
|
107
|
+
this.handoffNotice = result.message || '已生成交接记录;读取状态以交接历史为准。';
|
|
108
|
+
await this.loadThreadHandoffs();
|
|
109
|
+
} catch (error) {
|
|
110
|
+
if (requestSeq === this.handoffRequestSeq) this.handoffError = '生成交接失败:' + error.message;
|
|
111
|
+
} finally {
|
|
112
|
+
this.handoffBusy = false;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
async copyThreadHandoff(record) {
|
|
116
|
+
const threadId = this.activeSession && this.activeSession.sessionId;
|
|
117
|
+
if (!threadId || this.handoffBusy) return;
|
|
118
|
+
const requestSeq = this.handoffRequestSeq;
|
|
119
|
+
this.handoffBusy = true;
|
|
120
|
+
this.handoffError = '';
|
|
121
|
+
this.handoffNotice = '';
|
|
122
|
+
this.handoffCopyText = '';
|
|
123
|
+
try {
|
|
124
|
+
const result = await api('thread-handoff-fallback', { threadId, handoffId: record.id });
|
|
125
|
+
if (result.error) throw new Error(result.error);
|
|
126
|
+
if (requestSeq !== this.handoffRequestSeq) return;
|
|
127
|
+
if (result.record) {
|
|
128
|
+
this.handoffRecords = this.handoffRecords.map(item => item.id === record.id ? result.record : item);
|
|
129
|
+
}
|
|
130
|
+
if (typeof result.text !== 'string' || !result.text.trim()) throw new Error('未返回卡片文本');
|
|
131
|
+
this.handoffCopyText = result.text;
|
|
132
|
+
if (!navigator.clipboard || !navigator.clipboard.writeText) throw new Error('当前环境不支持剪贴板,请手动复制下方文本');
|
|
133
|
+
await navigator.clipboard.writeText(result.text);
|
|
134
|
+
if (requestSeq === this.handoffRequestSeq) this.handoffNotice = '已复制卡片文本;未发送给目标。请粘贴到目标会话。';
|
|
135
|
+
} catch (error) {
|
|
136
|
+
if (requestSeq === this.handoffRequestSeq) this.handoffError = '卡片复制未完成;未发送给目标:' + error.message;
|
|
137
|
+
} finally {
|
|
138
|
+
this.handoffBusy = false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<div id="app" class="container" v-cloak>
|
|
1
|
+
<div id="app" class="container" :class="{ 'navigation-pending': !navigationReady }" v-cloak>
|
|
2
|
+
<div v-if="!navigationReady" class="app-navigation-loading-state" role="status" aria-live="polite">
|
|
3
|
+
{{ t('app.loadingConfig') }}
|
|
4
|
+
</div>
|
|
2
5
|
<div v-if="!sessionStandalone" class="mobile-brand-bar">
|
|
3
6
|
<div class="mobile-brand-title">Codex Mate<span v-if="appVersion" class="brand-version"> v{{ appVersion }}</span></div>
|
|
4
7
|
<button
|
|
@@ -412,11 +415,34 @@
|
|
|
412
415
|
|
|
413
416
|
<div class="side-rail-lang">
|
|
414
417
|
<div class="side-rail-lang-actions">
|
|
415
|
-
<
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
418
|
+
<div class="side-language-menu">
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
class="language-settings-link"
|
|
422
|
+
:aria-label="t('settings.language.sideLabel', { language: currentLanguageLabel() })"
|
|
423
|
+
:aria-expanded="languageMenuOpen ? 'true' : 'false'"
|
|
424
|
+
aria-haspopup="menu"
|
|
425
|
+
@click="toggleLanguageMenu"
|
|
426
|
+
@keydown.esc.prevent="closeLanguageMenu">
|
|
427
|
+
{{ t('settings.language.sideLabel', { language: currentLanguageLabel() }) }}
|
|
428
|
+
<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>
|
|
429
|
+
</button>
|
|
430
|
+
<div v-if="languageMenuOpen" class="side-language-dropdown" role="menu" @focusout="handleLanguageMenuFocusOut">
|
|
431
|
+
<button
|
|
432
|
+
v-for="option in languageOptions()"
|
|
433
|
+
:key="option.code"
|
|
434
|
+
type="button"
|
|
435
|
+
class="side-language-option"
|
|
436
|
+
:class="{ active: option.code === lang }"
|
|
437
|
+
role="menuitemradio"
|
|
438
|
+
:aria-checked="option.code === lang ? 'true' : 'false'"
|
|
439
|
+
@click="selectLanguage(option.code)">
|
|
440
|
+
<span>{{ option.nativeName }}</span>
|
|
441
|
+
<small>{{ option.englishName }}</small>
|
|
442
|
+
<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>
|
|
443
|
+
</button>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
420
446
|
<button
|
|
421
447
|
type="button"
|
|
422
448
|
class="side-announcement-button"
|
|
@@ -583,12 +609,6 @@
|
|
|
583
609
|
<span class="value">{{ installRegistryPreview || 'npmmirror' }}</span>
|
|
584
610
|
</div>
|
|
585
611
|
</div>
|
|
586
|
-
<div class="status-strip status-strip-placeholder" v-else-if="!sessionStandalone" aria-hidden="true">
|
|
587
|
-
<div class="status-chip">
|
|
588
|
-
<span class="label"> </span>
|
|
589
|
-
<span class="value"> </span>
|
|
590
|
-
</div>
|
|
591
|
-
</div>
|
|
592
612
|
<div
|
|
593
613
|
v-if="!sessionStandalone && mainTab === 'config' && isProviderConfigMode && forceCompactLayout && !loading && !initError && displayProvidersList.length > 1"
|
|
594
614
|
class="provider-fast-switch">
|
|
@@ -171,11 +171,13 @@
|
|
|
171
171
|
</div>
|
|
172
172
|
|
|
173
173
|
<div v-if="!isToolConfigWriteAllowed('claude')" class="tool-config-write-overlay">
|
|
174
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'claude'">
|
|
174
175
|
<div class="tool-config-write-overlay-card">
|
|
175
176
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.claude.lockedTitle') }}</div>
|
|
176
177
|
<p>{{ t('toolConfig.claude.lockedDesc') }}</p>
|
|
177
178
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('claude', true)" :disabled="toolConfigPermissionSaving.claude">{{ t('toolConfig.enableWrite') }}</button>
|
|
178
179
|
</div>
|
|
180
|
+
</teleport>
|
|
179
181
|
</div>
|
|
180
182
|
</div>
|
|
181
183
|
</div>
|
|
@@ -190,11 +190,13 @@
|
|
|
190
190
|
</div>
|
|
191
191
|
</div>
|
|
192
192
|
<div v-if="!isToolConfigWriteAllowed('codex')" class="tool-config-write-overlay">
|
|
193
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'codex'">
|
|
193
194
|
<div class="tool-config-write-overlay-card">
|
|
194
195
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.codex.lockedTitle') }}</div>
|
|
195
196
|
<p>{{ t('toolConfig.codex.lockedDesc') }}</p>
|
|
196
197
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('codex', true)" :disabled="toolConfigPermissionSaving.codex">{{ t('toolConfig.enableWrite') }}</button>
|
|
197
198
|
</div>
|
|
199
|
+
</teleport>
|
|
198
200
|
</div>
|
|
199
201
|
</div>
|
|
200
202
|
</div>
|
|
@@ -90,11 +90,13 @@
|
|
|
90
90
|
</section>
|
|
91
91
|
|
|
92
92
|
<div v-if="!isToolConfigWriteAllowed('kilocode')" class="tool-config-write-overlay">
|
|
93
|
-
<
|
|
93
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'kilocode'">
|
|
94
|
+
<div class="tool-config-write-overlay-card">
|
|
94
95
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.kilocode.lockedTitle') }}</div>
|
|
95
96
|
<p>{{ t('toolConfig.kilocode.lockedDesc') }}</p>
|
|
96
97
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('kilocode', true)" :disabled="toolConfigPermissionSaving.kilocode">{{ t('toolConfig.enableWrite') }}</button>
|
|
97
98
|
</div>
|
|
99
|
+
</teleport>
|
|
98
100
|
</div>
|
|
99
101
|
</div>
|
|
100
102
|
</div>
|
|
@@ -134,11 +134,13 @@
|
|
|
134
134
|
</div>
|
|
135
135
|
</section>
|
|
136
136
|
<div v-if="!isToolConfigWriteAllowed('openclaw')" class="tool-config-write-overlay">
|
|
137
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'openclaw'">
|
|
137
138
|
<div class="tool-config-write-overlay-card">
|
|
138
139
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.openclaw.lockedTitle') }}</div>
|
|
139
140
|
<p>{{ t('toolConfig.openclaw.lockedDesc') }}</p>
|
|
140
141
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('openclaw', true)" :disabled="toolConfigPermissionSaving.openclaw">{{ t('toolConfig.enableWrite') }}</button>
|
|
141
142
|
</div>
|
|
143
|
+
</teleport>
|
|
142
144
|
</div>
|
|
143
145
|
</div>
|
|
144
146
|
</div>
|
|
@@ -156,11 +156,13 @@
|
|
|
156
156
|
</div>
|
|
157
157
|
</section>
|
|
158
158
|
<div v-if="!isToolConfigWriteAllowed('opencode')" class="tool-config-write-overlay">
|
|
159
|
-
<
|
|
159
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'opencode'">
|
|
160
|
+
<div class="tool-config-write-overlay-card">
|
|
160
161
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.opencode.lockedTitle') }}</div>
|
|
161
162
|
<p>{{ t('toolConfig.opencode.lockedDesc') }}</p>
|
|
162
163
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('opencode', true)" :disabled="toolConfigPermissionSaving.opencode">{{ t('toolConfig.enableWrite') }}</button>
|
|
163
164
|
</div>
|
|
165
|
+
</teleport>
|
|
164
166
|
</div>
|
|
165
167
|
</div>
|
|
166
168
|
</div>
|
|
@@ -141,11 +141,13 @@
|
|
|
141
141
|
</details>
|
|
142
142
|
</section>
|
|
143
143
|
<div v-if="!isToolConfigWriteAllowed('pi')" class="tool-config-write-overlay">
|
|
144
|
+
<teleport to="body" v-if="mainTab === 'config' && configMode === 'pi'">
|
|
144
145
|
<div class="tool-config-write-overlay-card">
|
|
145
146
|
<div class="tool-config-write-overlay-title">{{ t('toolConfig.pi.lockedTitle') }}</div>
|
|
146
147
|
<p>{{ t('toolConfig.pi.lockedDesc') }}</p>
|
|
147
148
|
<button type="button" class="btn-tool" @click="setToolConfigPermission('pi', true)" :disabled="toolConfigPermissionSaving.pi">{{ t('toolConfig.enableWrite') }}</button>
|
|
148
149
|
</div>
|
|
150
|
+
</teleport>
|
|
149
151
|
</div>
|
|
150
152
|
</div>
|
|
151
153
|
</div>
|
|
@@ -4,6 +4,65 @@
|
|
|
4
4
|
id="panel-dashboard"
|
|
5
5
|
role="tabpanel"
|
|
6
6
|
:aria-labelledby="'tab-dashboard'">
|
|
7
|
+
<section class="selector-section workflow-panel" :aria-label="t('workflow.title')" :aria-busy="workflowBusy">
|
|
8
|
+
<header class="workflow-header">
|
|
9
|
+
<div>
|
|
10
|
+
<h2 class="workflow-title">{{ t('workflow.title') }}</h2>
|
|
11
|
+
<p class="workflow-description">{{ t('workflow.tagline') }}</p>
|
|
12
|
+
</div>
|
|
13
|
+
<button type="button" class="btn-tool btn-tool-compact workflow-refresh" @click="refreshWorkflowRuns" :disabled="workflowBusy">{{ t('workflow.refresh') }}</button>
|
|
14
|
+
</header>
|
|
15
|
+
<form class="workflow-form" @submit.prevent="submitWorkflowRun">
|
|
16
|
+
<div class="workflow-launch">
|
|
17
|
+
<div class="workflow-field">
|
|
18
|
+
<label class="form-label" for="workflow-id">{{ t('workflow.definition') }}</label>
|
|
19
|
+
<select id="workflow-id" v-model="workflowId" class="model-select workflow-select" :disabled="workflowBusy || !workflowDefinitions.length">
|
|
20
|
+
<option v-if="!workflowDefinitions.length" value="diagnose-config">{{ t('workflow.noDefinitions') }}</option>
|
|
21
|
+
<option v-for="item in workflowDefinitions" :key="item.id" :value="item.id">{{ item.name || item.id }}</option>
|
|
22
|
+
</select>
|
|
23
|
+
</div>
|
|
24
|
+
<button type="submit" class="btn btn-confirm workflow-submit" :disabled="workflowBusy || !workflowDefinitions.length">{{ workflowBusy ? t('workflow.submitting') : t('workflow.submit') }}<span aria-hidden="true">↗</span></button>
|
|
25
|
+
</div>
|
|
26
|
+
<details class="workflow-options" :open="workflowInput.trim() !== '{}'">
|
|
27
|
+
<summary>{{ t('workflow.options') }} <span class="workflow-option-kind">JSON</span></summary>
|
|
28
|
+
<div class="workflow-field">
|
|
29
|
+
<label class="form-label" for="workflow-input">{{ t('workflow.input') }}</label>
|
|
30
|
+
<textarea id="workflow-input" v-model="workflowInput" class="form-input workflow-json" rows="4" spellcheck="false" :disabled="workflowBusy" aria-describedby="workflow-input-hint"></textarea>
|
|
31
|
+
<p id="workflow-input-hint" class="form-hint">{{ t('workflow.inputHint') }}</p>
|
|
32
|
+
</div>
|
|
33
|
+
<p class="form-hint">{{ t('workflow.description') }}</p>
|
|
34
|
+
</details>
|
|
35
|
+
<label class="workflow-authorization"><input type="checkbox" v-model="workflowAllowWrite" :disabled="workflowBusy"><span>{{ t('workflow.allowWrite') }}</span></label>
|
|
36
|
+
</form>
|
|
37
|
+
<p v-if="workflowError" class="form-hint form-error" role="alert">{{ workflowError }}</p>
|
|
38
|
+
<details class="workflow-history" :open="workflowRuns.length > 0">
|
|
39
|
+
<summary class="workflow-history-title">{{ t('workflow.runs') }} <span class="workflow-count">{{ workflowRuns.length }}</span></summary>
|
|
40
|
+
<div v-if="!workflowRuns.length" class="workflow-empty">
|
|
41
|
+
<p>{{ t('workflow.empty') }}</p>
|
|
42
|
+
<p class="form-hint">{{ t('workflow.emptyHint') }}</p>
|
|
43
|
+
</div>
|
|
44
|
+
<article v-for="run in workflowRuns" :key="run.id" class="workflow-run">
|
|
45
|
+
<div class="workflow-run-header">
|
|
46
|
+
<h4 class="workflow-run-title">{{ run.definition.name || run.definition.id }}</h4>
|
|
47
|
+
<span class="workflow-status" :data-status="run.status">{{ workflowStatusLabel(run.status) }}</span>
|
|
48
|
+
</div>
|
|
49
|
+
<p class="workflow-run-id">{{ t('workflow.runId') }} <code>{{ run.id }}</code></p>
|
|
50
|
+
<p v-if="run.reason || run.error" class="workflow-run-reason">{{ run.reason || run.error }}</p>
|
|
51
|
+
<div v-if="['queued', 'running', 'waiting'].includes(run.status)" class="workflow-run-actions">
|
|
52
|
+
<template v-if="run.status === 'waiting'">
|
|
53
|
+
<button type="button" class="btn-tool btn-tool-compact" @click="workflowInput = JSON.stringify(run.input, null, 2)" :disabled="workflowBusy">{{ t('workflow.loadInput') }}</button>
|
|
54
|
+
<button type="button" class="btn-tool btn-tool-compact" @click="controlWorkflowRun(run, 'resume')" :disabled="workflowBusy">{{ t('workflow.resume') }}</button>
|
|
55
|
+
</template>
|
|
56
|
+
<button type="button" class="btn-tool btn-tool-compact" @click="controlWorkflowRun(run, 'cancel')" :disabled="workflowBusy">{{ t('workflow.cancel') }}</button>
|
|
57
|
+
</div>
|
|
58
|
+
<details v-if="run.summary" class="workflow-details" :open="run.status === 'waiting'">
|
|
59
|
+
<summary>{{ t('workflow.summary') }}</summary>
|
|
60
|
+
<pre>{{ JSON.stringify(run.summary, null, 2) }}</pre>
|
|
61
|
+
</details>
|
|
62
|
+
<details class="workflow-details"><summary>{{ t('workflow.details') }}</summary><pre>{{ JSON.stringify({ steps: run.steps, notification: run.notification }, null, 2) }}</pre></details>
|
|
63
|
+
</article>
|
|
64
|
+
</details>
|
|
65
|
+
</section>
|
|
7
66
|
<div class="selector-section doctor-hero">
|
|
8
67
|
<div class="selector-header doctor-header">
|
|
9
68
|
<span class="selector-title">{{ t('dashboard.doctor.title') }}</span>
|
|
@@ -49,15 +49,33 @@
|
|
|
49
49
|
<span class="skills-flow-title">{{ t('market.installed.title') }}</span>
|
|
50
50
|
<span class="skills-flow-count">{{ skillsList.length }}</span>
|
|
51
51
|
</div>
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
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
|
+
<button type="button" class="skills-action-btn" @click="exportMarketSelectedSkills" :disabled="loading || !!initError || skillsMarketBusy || skillsMarketSelectedCount === 0">
|
|
57
|
+
{{ skillsExporting ? t('market.export.running') : t('market.export.action') }} ({{ skillsMarketSelectedCount }})
|
|
58
|
+
</button>
|
|
59
|
+
<button type="button" class="btn-mini" @click="refreshSkillsList({ silent: false })" :disabled="loading || !!initError || skillsMarketBusy">
|
|
60
|
+
<svg v-if="!skillsLoading" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" width="14" height="14"><path d="M17 1l4 4-4 4"/><path d="M3 11V9a4 4 0 014-4h14"/><path d="M3 19l-4-4 4-4"/><path d="M17 9v2a4 4 0 01-4 4H3"/></svg>
|
|
61
|
+
<svg v-else viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" width="14" height="14" class="spin"><path d="M10 2v4m0 8v4M2 10h4m8 0h4m-3.5-6.5l2.5 2.5M4 4l2.5 2.5M16 16l-2.5-2.5M4 16l2.5-2.5"/></svg>
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<div v-if="skillsList.length > 0" class="skills-market-selection-bar">
|
|
66
|
+
<label class="skills-market-select-all">
|
|
67
|
+
<input type="checkbox" :checked="skillsMarketAllSelected" @change="toggleAllSkillsMarketSelection" :disabled="skillsMarketBusy">
|
|
68
|
+
<span>{{ t('market.selection.all') }}</span>
|
|
69
|
+
</label>
|
|
70
|
+
<span class="skills-market-selection-count">{{ t('market.selection.count', { count: skillsMarketSelectedCount }) }}</span>
|
|
56
71
|
</div>
|
|
57
72
|
<div v-if="skillsLoading && !skillsMarketLocalLoadedOnce" class="skills-flow-loading">{{ t('market.local.loading') }}</div>
|
|
58
73
|
<div v-else-if="skillsList.length === 0" class="skills-flow-empty">{{ t('market.local.empty') }}</div>
|
|
59
74
|
<div v-else class="skills-flow-list">
|
|
60
|
-
<div v-for="skill in skillsList" :key="'skill-' + skill.name" class="skills-flow-item" :class="{ 'has-issue': !skill.hasSkillFile }">
|
|
75
|
+
<div v-for="skill in skillsList" :key="'skill-' + skill.name" class="skills-flow-item" :class="{ 'has-issue': !skill.hasSkillFile, selected: skillsMarketSelectedNames.includes(skill.name) }">
|
|
76
|
+
<label class="skills-market-item-check">
|
|
77
|
+
<input type="checkbox" :checked="skillsMarketSelectedNames.includes(skill.name)" @change="toggleSkillsMarketSelection(skill.name)" :disabled="skillsMarketBusy">
|
|
78
|
+
</label>
|
|
61
79
|
<div class="skills-flow-main">
|
|
62
80
|
<span class="skills-flow-name">{{ skill.displayName || skill.name }}</span>
|
|
63
81
|
<span class="skills-flow-path">{{ skill.path }}</span>
|