codexmate 0.1.34 → 0.1.36
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 +102 -86
- package/README.vi.md +105 -79
- package/README.zh.md +102 -84
- package/cli/analytics-export-args.js +7 -0
- package/cli/session-usage.js +4 -1
- package/cli.js +30 -6
- package/lib/data/model-prices.json +1868 -0
- package/lib/session-context-health.js +5 -1
- package/lib/session-evidence-collections.js +85 -0
- package/lib/session-features.js +15 -0
- package/lib/session-project-git.js +65 -0
- package/lib/session-projects.js +12 -1
- package/lib/session-stories.js +67 -0
- package/lib/session-usage-ledger.js +77 -0
- package/lib/session-usage-pricing.js +42 -0
- package/lib/session-usage-report.js +101 -0
- package/package.json +4 -1
- package/plugins/prompt-templates/computed.mjs +9 -0
- package/web-ui/app.js +12 -0
- package/web-ui/logic.codex.mjs +14 -0
- package/web-ui/logic.session-artifacts.mjs +39 -0
- package/web-ui/modules/app.methods.agents.mjs +3 -2
- package/web-ui/modules/app.methods.claude-config.mjs +26 -5
- package/web-ui/modules/app.methods.install.mjs +13 -17
- package/web-ui/modules/app.methods.navigation.mjs +1 -1
- package/web-ui/modules/app.methods.openclaw-editing.mjs +29 -0
- package/web-ui/modules/app.methods.openclaw-persist.mjs +3 -3
- package/web-ui/modules/app.methods.opencode-config.mjs +34 -0
- package/web-ui/modules/app.methods.pi-config.mjs +14 -9
- package/web-ui/modules/app.methods.providers.mjs +11 -0
- package/web-ui/modules/app.methods.session-browser.mjs +35 -0
- package/web-ui/modules/app.methods.session-trash.mjs +4 -5
- package/web-ui/modules/app.methods.startup-claude.mjs +1 -0
- package/web-ui/modules/app.methods.system-prompt.mjs +16 -7
- package/web-ui/modules/app.methods.web-ui-preferences.mjs +5 -0
- package/web-ui/modules/claude-provider-presets.mjs +23 -0
- package/web-ui/modules/i18n/locales/en.mjs +127 -1
- package/web-ui/modules/i18n/locales/ja.mjs +127 -1
- package/web-ui/modules/i18n/locales/vi.mjs +127 -1
- package/web-ui/modules/i18n/locales/zh-tw.mjs +127 -1
- package/web-ui/modules/i18n/locales/zh.mjs +127 -1
- package/web-ui/modules/pi-provider-templates.mjs +6 -1
- package/web-ui/modules/session-collections.mjs +65 -0
- package/web-ui/modules/session-evidence.mjs +81 -0
- package/web-ui/modules/session-features.mjs +15 -1
- package/web-ui/modules/session-git.mjs +39 -0
- package/web-ui/modules/session-stories.mjs +64 -0
- package/web-ui/modules/usage-pricing.mjs +30 -0
- package/web-ui/partials/index/layout-footer.html +1 -1
- package/web-ui/partials/index/modal-openclaw-config.html +3 -0
- package/web-ui/partials/index/modals-basic.html +1 -1
- package/web-ui/partials/index/modals-pi-provider.html +1 -1
- package/web-ui/partials/index/panel-config-claude.html +4 -21
- package/web-ui/partials/index/panel-config-codex.html +3 -1
- package/web-ui/partials/index/panel-config-opencode.html +4 -0
- package/web-ui/partials/index/panel-sessions.html +20 -20
- package/web-ui/partials/index/panel-settings.html +45 -0
- package/web-ui/partials/index/panel-usage.html +2 -0
- package/web-ui/partials/index/session-features.html +82 -2
- package/web-ui/partials/index/thread-handoff.html +73 -62
- package/web-ui/partials/index/usage-records.html +41 -0
- package/web-ui/res/web-ui-render.precompiled.js +896 -236
- package/web-ui/styles/session-features.css +63 -0
- package/web-ui/styles/sessions-list.css +74 -0
- package/web-ui/styles/sessions-preview.css +106 -68
- package/web-ui/styles/sessions-usage.css +8 -0
- package/web-ui/styles/settings-panel.css +4 -0
- package/web-ui/styles/theme-violet.css +9 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const usagePricingMixin = {
|
|
2
|
+
data() { return { usagePricingOpen: false, usagePricing: null, usagePricingBusy: false, usagePricingError: '', usagePricingSequence: 0 }; },
|
|
3
|
+
beforeUnmount() { this.usagePricingSequence++; },
|
|
4
|
+
watch: { sessionsUsageTimeRange() { if (this.usagePricingOpen) void this.loadUsagePricing(); } },
|
|
5
|
+
methods: {
|
|
6
|
+
toggleUsagePricing(event) {
|
|
7
|
+
if (event.target !== event.currentTarget) return;
|
|
8
|
+
this.usagePricingOpen = event.currentTarget.open;
|
|
9
|
+
if (this.usagePricingOpen) return this.loadUsagePricing();
|
|
10
|
+
},
|
|
11
|
+
async loadUsagePricing() {
|
|
12
|
+
const sequence = ++this.usagePricingSequence;
|
|
13
|
+
const range = this.sessionsUsageTimeRange;
|
|
14
|
+
const today = new Date();
|
|
15
|
+
const from = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate() - (range === '30d' ? 29 : 6)));
|
|
16
|
+
this.usagePricingBusy = true; this.usagePricingError = ''; this.usagePricing = null;
|
|
17
|
+
try {
|
|
18
|
+
const report = await this.featureCall('session-usage-pricing', { source: 'all', limit: range === 'all' ? 2000 : (range === '30d' ? 1200 : 600),
|
|
19
|
+
...(range === 'all' ? {} : { from: from.toISOString().slice(0, 10), to: today.toISOString().slice(0, 10) }) });
|
|
20
|
+
if (sequence === this.usagePricingSequence) this.usagePricing = report;
|
|
21
|
+
} catch (error) { if (sequence === this.usagePricingSequence) this.usagePricingError = error.message; }
|
|
22
|
+
finally { if (sequence === this.usagePricingSequence) this.usagePricingBusy = false; }
|
|
23
|
+
},
|
|
24
|
+
formatPriceUsd(value) { return value === null ? this.t('usage.records.unknown') : '$' + value.toFixed(6); },
|
|
25
|
+
formatTokenRate(value) { return typeof value === 'number' ? (value * 1000000).toLocaleString('en-US', { maximumFractionDigits: 6 }) : this.t('usage.records.unknown'); },
|
|
26
|
+
downloadUsagePricing() {
|
|
27
|
+
if (this.usagePricing) this.downloadTextFile('codexmate-price-reference.json', JSON.stringify(this.usagePricing, null, 2), 'application/json;charset=utf-8');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -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"
|
|
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
|
-
<
|
|
59
|
-
|
|
60
|
-
<button type="button" class="btn-mini"
|
|
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"
|
|
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>
|
|
@@ -190,14 +190,6 @@
|
|
|
190
190
|
{{ parseSessionTitleInfo(session).location }}
|
|
191
191
|
</div>
|
|
192
192
|
</div>
|
|
193
|
-
<span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
|
|
194
|
-
<span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
|
|
195
|
-
<span
|
|
196
|
-
v-if="sessionContextUtilization[getSessionExportKey(session)] && sessionContextUtilization[getSessionExportKey(session)].percent > 0"
|
|
197
|
-
:class="['session-context-badge', 'session-context-' + sessionContextUtilization[getSessionExportKey(session)].level]"
|
|
198
|
-
:title="'Context: ' + sessionContextUtilization[getSessionExportKey(session)].percent + '%'">
|
|
199
|
-
{{ sessionContextUtilization[getSessionExportKey(session)].percent }}%
|
|
200
|
-
</span>
|
|
201
193
|
</div>
|
|
202
194
|
<div class="session-item-actions">
|
|
203
195
|
<button
|
|
@@ -231,6 +223,14 @@
|
|
|
231
223
|
<div class="session-item-meta">
|
|
232
224
|
<span class="session-source" :data-source="session.source">{{ session.sourceLabel }}</span>
|
|
233
225
|
<span class="session-item-time">{{ session.updatedAtLabel || session.updatedAt || t('sessions.unknownTime') }}</span>
|
|
226
|
+
<span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
|
|
227
|
+
<span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
|
|
228
|
+
<span
|
|
229
|
+
v-if="sessionContextUtilization[getSessionExportKey(session)] && sessionContextUtilization[getSessionExportKey(session)].percent > 0"
|
|
230
|
+
:class="['session-context-badge', 'session-context-' + sessionContextUtilization[getSessionExportKey(session)].level]"
|
|
231
|
+
:title="'Context: ' + sessionContextUtilization[getSessionExportKey(session)].percent + '%'">
|
|
232
|
+
{{ sessionContextUtilization[getSessionExportKey(session)].percent }}%
|
|
233
|
+
</span>
|
|
234
234
|
<span v-if="getSessionHotLabel(session)" class="session-item-hot">{{ getSessionHotLabel(session) }}</span>
|
|
235
235
|
<div v-if="session.match && session.match.snippets && session.match.snippets.length" class="session-match-snippets">
|
|
236
236
|
<div v-for="(snip, si) in session.match.snippets.slice(0, 2)" :key="si" class="session-match-snippet">{{ snip }}</div>
|
|
@@ -428,20 +428,20 @@
|
|
|
428
428
|
<span class="session-msg-role">{{ msg.roleLabel || (msg.normalizedRole === 'user' ? t('sessions.roleLabel.user') : (msg.normalizedRole === 'system' ? t('sessions.roleLabel.system') : t('sessions.roleLabel.assistant'))) }}</span>
|
|
429
429
|
<span class="session-msg-time">{{ msg.timestamp || '' }}</span>
|
|
430
430
|
</div>
|
|
431
|
+
<button
|
|
432
|
+
v-if="msg.normalizedRole === 'user'"
|
|
433
|
+
type="button"
|
|
434
|
+
class="session-msg-copy"
|
|
435
|
+
@click="copySessionMessage(msg)"
|
|
436
|
+
:aria-label="t('sessions.preview.copyMessage')"
|
|
437
|
+
:title="t('sessions.preview.copyMessage')">
|
|
438
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
439
|
+
<rect x="8" y="8" width="12" height="12" rx="2"></rect>
|
|
440
|
+
<path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"></path>
|
|
441
|
+
</svg>
|
|
442
|
+
</button>
|
|
431
443
|
</div>
|
|
432
444
|
<div class="session-msg-content" v-html="msg.text || ''"></div>
|
|
433
|
-
<button
|
|
434
|
-
v-if="msg.normalizedRole === 'user'"
|
|
435
|
-
type="button"
|
|
436
|
-
class="session-msg-copy"
|
|
437
|
-
@click="copySessionMessage(msg)"
|
|
438
|
-
:aria-label="t('sessions.preview.copyMessage')"
|
|
439
|
-
:title="t('sessions.preview.copyMessage')">
|
|
440
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
441
|
-
<rect x="8" y="8" width="12" height="12" rx="2"></rect>
|
|
442
|
-
<path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"></path>
|
|
443
|
-
</svg>
|
|
444
|
-
</button>
|
|
445
445
|
</div>
|
|
446
446
|
<div v-if="canLoadMoreSessionMessages" class="session-preview-load-more">
|
|
447
447
|
<span>{{ t('sessions.preview.shownCount', { shown: activeSessionVisibleMessages.length, total: activeSessionMessages.length }) }}</span>
|
|
@@ -32,6 +32,16 @@
|
|
|
32
32
|
:class="['segmented-option', { active: settingsTab === 'data' }]"
|
|
33
33
|
@click="onSettingsTabClick('data')"
|
|
34
34
|
@keydown="onSettingsTabKeydown($event, 'data')">{{ t('settings.tab.data') }}</button>
|
|
35
|
+
<button
|
|
36
|
+
id="settings-tab-about"
|
|
37
|
+
type="button"
|
|
38
|
+
role="tab"
|
|
39
|
+
aria-controls="settings-panel-about"
|
|
40
|
+
:aria-selected="settingsTab === 'about'"
|
|
41
|
+
:tabindex="settingsTab === 'about' ? 0 : -1"
|
|
42
|
+
:class="['segmented-option', { active: settingsTab === 'about' }]"
|
|
43
|
+
@click="onSettingsTabClick('about')"
|
|
44
|
+
@keydown="onSettingsTabKeydown($event, 'about')">{{ t('settings.tab.about') }}</button>
|
|
35
45
|
</div>
|
|
36
46
|
</div>
|
|
37
47
|
|
|
@@ -270,4 +280,39 @@
|
|
|
270
280
|
</section>
|
|
271
281
|
</div>
|
|
272
282
|
</div>
|
|
283
|
+
|
|
284
|
+
<div
|
|
285
|
+
v-show="settingsTab === 'about'"
|
|
286
|
+
id="settings-panel-about"
|
|
287
|
+
role="tabpanel"
|
|
288
|
+
aria-labelledby="settings-tab-about">
|
|
289
|
+
<div class="settings-grid">
|
|
290
|
+
<section class="settings-card" aria-labelledby="settings-about-update-title">
|
|
291
|
+
<div class="settings-card-main">
|
|
292
|
+
<div class="settings-card-content">
|
|
293
|
+
<h2 id="settings-about-update-title" class="settings-card-title">Codex Mate · {{ t('settings.about.update') }}</h2>
|
|
294
|
+
<p class="settings-card-hint">{{ t('settings.about.currentVersion', { version: appVersion ? 'v' + appVersion : '—' }) }}</p>
|
|
295
|
+
<div role="status">
|
|
296
|
+
<p v-if="appVersionStatusLoading" class="settings-card-hint">{{ t('side.update.checking') }}</p>
|
|
297
|
+
<p v-else-if="appVersionStatusError" class="settings-card-hint form-error">{{ appVersionStatusError }}</p>
|
|
298
|
+
<template v-else-if="appVersionStatusChecked">
|
|
299
|
+
<p class="settings-card-hint">{{ t('settings.about.latestVersion', { version: 'v' + appLatestVersion }) }}</p>
|
|
300
|
+
<p class="settings-card-hint">{{ t(isAppUpdateAvailable() ? 'side.update.available' : 'side.update.upToDate') }}</p>
|
|
301
|
+
</template>
|
|
302
|
+
</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
<div class="settings-card-actions">
|
|
306
|
+
<button id="settings-about-check-update" type="button" class="settings-card-action"
|
|
307
|
+
:disabled="appVersionStatusLoading"
|
|
308
|
+
@click="loadAppVersionStatus({ force: true, silent: true })">
|
|
309
|
+
{{ t(appVersionStatusError ? 'side.update.retry' : 'side.update.check') }}
|
|
310
|
+
</button>
|
|
311
|
+
<button v-if="!appVersionStatusLoading && !appVersionStatusError && isAppUpdateAvailable()"
|
|
312
|
+
id="settings-about-view-update" type="button" class="settings-card-action"
|
|
313
|
+
@click="openAppUpdateModal($event.currentTarget)">{{ t('settings.about.viewUpdate') }}</button>
|
|
314
|
+
</div>
|
|
315
|
+
</section>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
273
318
|
</div>
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
+
<!-- @include ./usage-records.html -->
|
|
21
|
+
|
|
20
22
|
<div v-if="sessionsUsageLoading && !sessionsUsageList.length" class="usage-empty-state">
|
|
21
23
|
<div class="usage-empty-illustration">
|
|
22
24
|
<svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -20,12 +20,18 @@
|
|
|
20
20
|
<div v-if="indexReport" class="feature-meta" role="status">
|
|
21
21
|
<span class="feature-status" :data-status="indexReport.job.status">{{ t('features.status.' + indexReport.job.status) }}</span>
|
|
22
22
|
<span>{{ t('features.indexStatus', { count: indexReport.indexed, processed: indexReport.job.processed, total: indexReport.job.candidates }) }}</span>
|
|
23
|
+
<span class="feature-index-time">{{ t('features.indexCatalogTime', { time: indexCatalogTime }) }}</span>
|
|
23
24
|
</div>
|
|
24
25
|
<form class="feature-actions feature-search-form" @submit.prevent="searchSessionIndex">
|
|
25
26
|
<input v-model="indexQuery" :aria-label="t('features.search')" :placeholder="t('features.search')">
|
|
26
27
|
<button class="btn-mini feature-primary" :disabled="featureBusy || !indexQuery.trim() || !indexReport?.updatedAt">{{ t('features.search') }}</button>
|
|
27
28
|
</form>
|
|
28
|
-
<details class="feature-disclosure
|
|
29
|
+
<details class="feature-disclosure feature-index-scope">
|
|
30
|
+
<summary>{{ t('features.searchScope') }}</summary>
|
|
31
|
+
<p class="feature-hint">{{ t('features.indexScope') }}</p>
|
|
32
|
+
<p v-for="entry in indexSourceCoverage" :key="entry.source" class="feature-hint feature-index-coverage">{{ t('features.indexSourceCoverage', { source: t('sessions.source.' + entry.source), count: entry.candidates ?? t('features.indexUnknown'), limit: entry.discoveryLimit ?? t('features.indexUnknown') }) }}</p>
|
|
33
|
+
<p v-if="!indexSourceCoverage.length" class="feature-hint feature-index-unknown">{{ t('features.indexCoverageUnknown') }}</p>
|
|
34
|
+
</details>
|
|
29
35
|
<p v-if="indexReport?.failures.length" class="form-error" role="alert">{{ t('features.indexFailures', { count: indexReport.failures.length }) }}</p>
|
|
30
36
|
<p v-if="featureBusy" class="feature-loading" role="status">{{ t('features.loading') }}</p>
|
|
31
37
|
<template v-if="indexResults">
|
|
@@ -36,11 +42,48 @@
|
|
|
36
42
|
<header class="feature-record-heading"><h4>{{ result.session.title || result.session.sessionId }}</h4><span class="feature-source">{{ result.session.source }}</span></header>
|
|
37
43
|
<small class="feature-path" :title="result.session.cwd">{{ result.session.cwd }}</small>
|
|
38
44
|
<pre class="feature-excerpt">{{ result.snippet }}</pre>
|
|
39
|
-
<div class="feature-record-actions"><button type="button" class="btn-mini" @click="openIndexedMessage(result)">{{ t('features.source') }}</button></div>
|
|
45
|
+
<div class="feature-record-actions"><button type="button" class="btn-mini" @click="openIndexedMessage(result)">{{ t('features.source') }}</button><label class="evidence-select"><input type="checkbox" :checked="isEvidenceSelected(result)" @change="toggleEvidence(result)">{{ t('evidence.select') }}</label></div>
|
|
40
46
|
<details class="feature-disclosure"><summary>{{ t('features.context') }}</summary><pre>{{ result.before }}</pre><pre>{{ result.after }}</pre></details>
|
|
41
47
|
</article>
|
|
42
48
|
</template>
|
|
43
49
|
</div>
|
|
50
|
+
<details class="feature-disclosure evidence-collections" :open="collectionsOpen" @toggle="toggleCollections($event)">
|
|
51
|
+
<summary>{{ t('collections.title') }}</summary>
|
|
52
|
+
<p class="feature-hint">{{ t('collections.scope') }}</p>
|
|
53
|
+
<p v-if="collectionError" class="form-error" role="alert">{{ collectionError }}</p>
|
|
54
|
+
<p v-if="collectionBusy" role="status">{{ t('features.loading') }}</p>
|
|
55
|
+
<ol class="collection-list"><li v-for="item in collections" :key="item.id">
|
|
56
|
+
<button type="button" class="btn-mini" @click="openEvidenceCollection(item)" :disabled="collectionBusy || evidenceBusy" :aria-pressed="collectionId === item.id">{{ item.name }}</button>
|
|
57
|
+
<span class="feature-count">{{ item.references.length }}/100</span>
|
|
58
|
+
<button type="button" class="btn-mini feature-quiet" @click="removeEvidenceCollection(item)" :disabled="collectionBusy">{{ t('collections.remove') }}</button>
|
|
59
|
+
</li></ol>
|
|
60
|
+
<p v-if="!collectionBusy && !collections.length" class="feature-hint">{{ t('collections.empty') }}</p>
|
|
61
|
+
<form v-if="evidenceSelections.length" class="feature-editor collection-editor" @submit.prevent="saveEvidenceCollection(false)">
|
|
62
|
+
<label>{{ t('collections.name') }}<input v-model="collectionName" maxlength="160" required></label>
|
|
63
|
+
<div class="feature-actions">
|
|
64
|
+
<button class="btn-mini" :disabled="collectionBusy || evidenceBusy || !collectionName.trim()">{{ t('collections.save') }}</button>
|
|
65
|
+
<button v-if="collectionId" type="button" class="btn-mini feature-quiet" @click="saveEvidenceCollection(true)" :disabled="collectionBusy || evidenceBusy || !collectionName.trim()">{{ t('collections.saveAs') }}</button>
|
|
66
|
+
</div>
|
|
67
|
+
</form>
|
|
68
|
+
<button type="button" class="btn-mini feature-quiet" @click="loadEvidenceCollections" :disabled="collectionBusy">{{ t('collections.refresh') }}</button>
|
|
69
|
+
</details>
|
|
70
|
+
<section v-if="evidenceSelections.length" class="evidence-basket" :aria-label="t('evidence.title')">
|
|
71
|
+
<div class="feature-section-heading"><h3>{{ t('evidence.title') }}</h3><span class="feature-count">{{ evidenceSelections.length }}/100</span></div>
|
|
72
|
+
<p class="feature-hint">{{ t('evidence.memory') }}</p>
|
|
73
|
+
<ol class="evidence-list"><li v-for="item in evidenceSelections" :key="evidenceKey(item)"><span><strong>{{ item.session.title || item.session.sessionId }}</strong><small class="feature-meta">{{ item.session.source }} · {{ item.nodeId }}</small><small v-if="item.state" class="collection-source-state" :data-state="item.state">{{ t('collections.state.' + item.state) }}</small></span><button type="button" class="btn-mini feature-quiet" @click="openIndexedMessage(item)">{{ t('features.source') }}</button><button type="button" class="btn-mini" @click="toggleEvidence(item)">{{ t('evidence.remove') }}</button></li></ol>
|
|
74
|
+
<form class="feature-actions feature-search-form evidence-generator" @submit.prevent="generateEvidencePack">
|
|
75
|
+
<input v-model="evidenceGoal" :aria-label="t('evidence.goal')" :placeholder="t('evidence.goal')">
|
|
76
|
+
<select v-model="evidenceFormat" :aria-label="t('artifacts.format')">
|
|
77
|
+
<option value="evidence">{{ t('evidence.title') }}</option>
|
|
78
|
+
<option value="receipt">{{ t('artifacts.receipt') }}</option>
|
|
79
|
+
<option value="relay">{{ t('artifacts.relay') }}</option>
|
|
80
|
+
</select>
|
|
81
|
+
<textarea v-if="evidenceFormat !== 'evidence'" v-model="evidenceNote" class="evidence-generator-note" rows="3" maxlength="4000" :aria-label="t('artifacts.note')" :placeholder="t('artifacts.notePlaceholder')"></textarea>
|
|
82
|
+
<button class="btn-mini feature-primary" :disabled="evidenceBusy">{{ evidenceBusy ? t('features.loading') : evidenceFormat === 'evidence' ? t('evidence.generate') : t('artifacts.generate.' + evidenceFormat) }}</button>
|
|
83
|
+
</form>
|
|
84
|
+
<p v-if="evidenceError" class="form-error" role="alert">{{ evidenceError }}</p>
|
|
85
|
+
<details v-if="evidencePack" class="feature-disclosure evidence-preview" open><summary>{{ t('evidence.preview', { count: evidencePack.length }) }}</summary><pre>{{ evidencePack }}</pre><button type="button" class="btn-mini" @click="downloadEvidencePack">{{ t('evidence.download') }}</button></details>
|
|
86
|
+
</section>
|
|
44
87
|
<div v-if="featureView === 'projects'" class="feature-content">
|
|
45
88
|
<div class="feature-section-heading"><h3>{{ t('features.projects') }}</h3><small v-if="projectReport" class="feature-meta">{{ t('features.readAt', { time: projectReport.readAt }) }}</small></div>
|
|
46
89
|
<p class="feature-hint">{{ t('features.projectHistory') }}</p>
|
|
@@ -56,6 +99,43 @@
|
|
|
56
99
|
<template v-if="projectReport.detail">
|
|
57
100
|
<div class="feature-section-heading feature-project-heading"><h4 class="feature-path" :title="projectReport.detail.cwd">{{ projectReport.detail.cwd || t('features.unassigned') }}</h4></div>
|
|
58
101
|
<p v-if="projectReport.detail.truncated" class="feature-hint">{{ t('features.partial') }}</p>
|
|
102
|
+
<details v-if="projectSelected" class="feature-disclosure project-git" @toggle="toggleProjectGit($event)">
|
|
103
|
+
<summary>{{ t('git.title') }}</summary>
|
|
104
|
+
<p class="feature-hint">{{ t('git.scope') }}</p>
|
|
105
|
+
<p v-if="projectGitError" class="form-error" role="alert">{{ projectGitError }}</p>
|
|
106
|
+
<p v-if="projectGitBusy" role="status">{{ t('features.loading') }}</p>
|
|
107
|
+
<template v-if="projectGit">
|
|
108
|
+
<p class="feature-meta">{{ t('git.status.' + projectGit.status) }} · {{ t('features.readAt', { time: projectGit.readAt }) }}</p>
|
|
109
|
+
<template v-if="projectGit.root">
|
|
110
|
+
<p class="feature-path">{{ projectGit.root }}</p>
|
|
111
|
+
<p class="feature-meta">{{ projectGit.branch || t('git.detached') }} · <code>{{ projectGit.head || t('git.noHead') }}</code> · {{ t('git.changes', { count: projectGit.changedFiles }) }}</p>
|
|
112
|
+
<ul class="git-change-list"><li v-for="change in projectGit.changes" :key="change.path"><code>{{ change.status }}</code> {{ change.path }}</li></ul>
|
|
113
|
+
<p v-if="projectGit.changesTruncated || projectGit.commitsTruncated" class="feature-hint">{{ t('git.truncated') }}</p>
|
|
114
|
+
<ol class="git-commit-list"><li v-for="commit in projectGit.commits" :key="commit.sha"><button type="button" class="btn-mini" @click="loadProjectGitCommit(commit.sha)" :disabled="projectGitBusy"><code>{{ commit.sha.slice(0, 8) }}</code> {{ commit.subject }}</button><small class="feature-meta">{{ commit.timestamp }}</small><div class="feature-link-list"><button v-for="session in commit.candidates" :key="session.source + session.sessionId" type="button" @click="selectSession(session)">{{ t('git.candidate') }}: {{ session.source }} · {{ session.title || session.sessionId }}</button></div></li></ol>
|
|
115
|
+
<pre v-if="projectGitCommit" class="feature-code git-commit-stat">{{ projectGitCommit.sha }}
|
|
116
|
+
{{ projectGitCommit.stat }}</pre>
|
|
117
|
+
<section v-if="projectGitCommit" class="project-stories" :aria-label="t('stories.title')">
|
|
118
|
+
<h4>{{ t('stories.title') }}</h4>
|
|
119
|
+
<p class="feature-hint">{{ t('stories.scope') }}</p>
|
|
120
|
+
<p v-if="storyError" class="form-error" role="alert">{{ storyError }}</p>
|
|
121
|
+
<p v-if="storyBusy" role="status">{{ t('features.loading') }}</p>
|
|
122
|
+
<article v-for="item in commitStories" :key="item.id" class="story-record">
|
|
123
|
+
<p class="feature-meta">{{ t('stories.linked') }} · {{ item.session.source }}</p>
|
|
124
|
+
<button v-if="item.available" type="button" class="btn-mini" @click="selectSession(item.session)">{{ item.session.title || item.session.sessionId }}</button>
|
|
125
|
+
<p v-else class="feature-hint">{{ item.session.title || item.session.sessionId }} · {{ t('stories.unavailable') }}</p>
|
|
126
|
+
<p class="feature-note">{{ item.note }}</p>
|
|
127
|
+
<button type="button" class="btn-mini feature-quiet" @click="removeProjectStory(item)" :disabled="storyBusy">{{ t('stories.remove') }}</button>
|
|
128
|
+
</article>
|
|
129
|
+
<form class="feature-editor story-editor" @submit.prevent="saveProjectStory">
|
|
130
|
+
<label>{{ t('stories.session') }}<select v-model="storySession" :disabled="storyBusy"><option value="">{{ t('stories.choose') }}</option><option v-for="session in storySessions" :key="storySessionKey(session)" :value="storySessionKey(session)">{{ session.source }} · {{ session.title || session.sessionId }}</option></select></label>
|
|
131
|
+
<label>{{ t('stories.note') }}<textarea v-model="storyNote" maxlength="4000"></textarea></label>
|
|
132
|
+
<div class="feature-actions"><button class="btn-mini" :disabled="storyBusy || !storySession">{{ t('stories.save') }}</button><button type="button" class="btn-mini feature-quiet" @click="loadProjectStories" :disabled="storyBusy">{{ t('stories.refresh') }}</button></div>
|
|
133
|
+
</form>
|
|
134
|
+
</section>
|
|
135
|
+
</template>
|
|
136
|
+
</template>
|
|
137
|
+
<button type="button" class="btn-mini" @click="loadProjectGit" :disabled="projectGitBusy">{{ t('git.refresh') }}</button>
|
|
138
|
+
</details>
|
|
59
139
|
<div class="feature-project-sessions">
|
|
60
140
|
<article v-for="session in projectReport.detail.sessions" :key="session.source + session.sessionId" class="feature-session-row">
|
|
61
141
|
<button type="button" @click="selectSession(session)">{{ session.title || session.sessionId }}</button>
|
|
@@ -1,62 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
<details v-if="activeSession" :key="handoffSessionKey" class="session-workspace thread-handoff" :open="handoffExpanded" @toggle="toggleThreadHandoff" aria-label="会话交接">
|
|
2
|
+
<summary class="thread-handoff-summary"><span>会话交接</span><span class="thread-handoff-summary-hint">{{ handoffExpanded ? '收起' : '填写交接 · 查看历史' }}</span></summary>
|
|
3
|
+
<div v-if="handoffExpanded" class="thread-handoff-body">
|
|
4
|
+
<div class="session-workspace-header session-workspace-card-wide">
|
|
5
|
+
<p class="session-workspace-subtitle">草稿在切换会话后保留,刷新后清空。</p>
|
|
6
|
+
<button class="btn-mini" type="button" @click="loadThreadHandoffs" :disabled="handoffLoading || handoffBusy">{{ handoffLoading ? '刷新中…' : '刷新历史' }}</button>
|
|
7
|
+
</div>
|
|
8
|
+
<form @submit.prevent="createThreadHandoff" class="thread-handoff-form">
|
|
9
|
+
<label class="thread-handoff-field">
|
|
10
|
+
<span class="session-workspace-card-title">交给谁 <small>必填</small></span>
|
|
11
|
+
<input v-model="handoffDraft.target" class="session-query-input" required :disabled="handoffBusy" placeholder="目标代理标识,例如 claude">
|
|
12
|
+
</label>
|
|
13
|
+
<label class="thread-handoff-field">
|
|
14
|
+
<span class="session-workspace-card-title">接下来做什么 <small>必填</small></span>
|
|
15
|
+
<textarea v-model="handoffDraft.goal" class="session-query-input" rows="3" required :disabled="handoffBusy" placeholder="描述下一步任务、预期结果或验收标准"></textarea>
|
|
16
|
+
</label>
|
|
17
|
+
<details class="thread-handoff-optional">
|
|
18
|
+
<summary class="thread-handoff-optional-summary">补充上下文</summary>
|
|
19
|
+
<div class="session-workspace-grid">
|
|
20
|
+
<label v-for="field in handoffFields" :key="field.key" class="thread-handoff-field">
|
|
21
|
+
<span class="session-workspace-card-title">{{ field.label }}(可选)</span>
|
|
22
|
+
<textarea v-model="handoffDraft[field.key]" class="session-query-input" rows="3" :disabled="handoffBusy" placeholder="每行填写一项"></textarea>
|
|
23
|
+
</label>
|
|
24
|
+
</div>
|
|
25
|
+
</details>
|
|
26
|
+
<div class="thread-handoff-actions">
|
|
27
|
+
<button class="btn-mini thread-handoff-submit" type="submit" :disabled="handoffBusy || handoffLoading || !handoffDraft.target.trim() || !handoffDraft.goal.trim()">{{ handoffBusy ? '处理中…' : '生成交接' }}</button>
|
|
28
|
+
</div>
|
|
29
|
+
</form>
|
|
30
|
+
<p v-if="handoffError" class="state-message error session-workspace-card-wide" role="alert">{{ handoffError }}</p>
|
|
31
|
+
<p v-if="handoffNotice" class="state-message session-workspace-card-wide" role="status" aria-live="polite">{{ handoffNotice }}</p>
|
|
32
|
+
<label v-if="handoffCopyText" class="thread-handoff-copy session-workspace-card-wide">
|
|
33
|
+
<span class="session-workspace-card-title">卡片文本(未发送,可手动复制)</span>
|
|
34
|
+
<textarea class="session-query-input" rows="6" readonly :value="handoffCopyText" @focus="$event.target.select()"></textarea>
|
|
35
|
+
</label>
|
|
36
|
+
<p class="session-workspace-subtitle session-workspace-card-wide">复制不会自动发送。读取确认由目标代理通过 CLI ack 提交。</p>
|
|
37
|
+
<div v-if="selectedContextIds.length" class="feature-actions"><button type="button" class="btn-mini" @click="generateSelectedHandoff" :disabled="featureBusy || !selectedContextIds.length">{{ t('features.generateDraft', { count: selectedContextIds.length }) }}</button></div>
|
|
38
|
+
<p v-if="handoffDraftEvidence.length">{{ t('features.draftReview') }}</p>
|
|
39
|
+
<details v-if="handoffUnverified.length" class="thread-handoff-audit"><summary>{{ t('features.unverified', { count: handoffUnverified.length }) }}</summary><pre v-for="(text, index) in handoffUnverified" :key="index">{{ text }}</pre></details>
|
|
40
|
+
<ul v-if="handoffDraftEvidence.length" class="thread-handoff-evidence"><li v-for="item in handoffDraftEvidence" :key="item.nodeId"><button type="button" class="btn-mini" @click="locateDraftEvidence(item)">{{ item.nodeId }} · {{ t('features.evidence.' + item.status) }}</button></li></ul>
|
|
41
|
+
<section class="thread-handoff-history session-workspace-card-wide" aria-label="交接历史">
|
|
42
|
+
<h3>交接历史</h3>
|
|
43
|
+
<p v-if="handoffLoading" class="session-workspace-card-wide" role="status">正在加载交接历史…</p>
|
|
44
|
+
<p v-else-if="!handoffError && !handoffRecords.length" class="session-workspace-empty session-workspace-card-wide">暂无交接记录</p>
|
|
45
|
+
<ol v-if="handoffRecords.length" class="session-workspace-list session-workspace-card-wide">
|
|
46
|
+
<li v-for="record in handoffRecords" :key="record.id" class="session-workspace-card thread-handoff-record">
|
|
47
|
+
<div class="thread-handoff-record-heading">
|
|
48
|
+
<div class="thread-handoff-record-title"><strong>{{ record.target }}</strong><span class="thread-handoff-record-status">{{ handoffStatusLabel(record.status) }}</span></div>
|
|
49
|
+
<button class="btn-mini" type="button" @click="copyThreadHandoff(record)" :disabled="handoffBusy || handoffLoading">{{ record.route === 'mcp' ? '回退文件并复制卡片' : '复制卡片' }}</button>
|
|
50
|
+
</div>
|
|
51
|
+
<p class="thread-handoff-record-route">{{ record.route === 'mcp' ? 'MCP 工具' : '文件级' }} · {{ record.writeResult === 'written' ? '已写入' : (record.writeResult === 'failed_or_unconfirmed' ? '失败或结果未确认(不重试)' : '未执行写入') }}</p>
|
|
52
|
+
<p v-if="record.reason" class="thread-handoff-record-reason">原因:{{ record.reason }}</p>
|
|
53
|
+
<p v-if="record.readConfirmation" class="thread-handoff-read-proof">读取证据:<span>{{ record.readConfirmation.evidence }}</span></p>
|
|
54
|
+
<details class="thread-handoff-audit">
|
|
55
|
+
<summary>投递详情</summary>
|
|
56
|
+
<dl>
|
|
57
|
+
<div><dt>交接标识</dt><dd><code>{{ record.id }}</code></dd></div>
|
|
58
|
+
<div><dt>创建时间</dt><dd>{{ record.createdAt }}</dd></div>
|
|
59
|
+
<div><dt>投递耗时</dt><dd>{{ record.durationMs }} 毫秒</dd></div>
|
|
60
|
+
<div><dt>写入耗时</dt><dd>{{ record.writeDurationMs || 0 }} 毫秒</dd></div>
|
|
61
|
+
<div><dt>文件回退</dt><dd>{{ record.fallback ? '是' : '否' }}</dd></div>
|
|
62
|
+
<div v-if="record.mcp"><dt>MCP 服务</dt><dd>{{ record.mcp.server }} · {{ record.mcp.tool }}</dd></div>
|
|
63
|
+
<div v-if="record.filePath"><dt>文件位置</dt><dd><code>{{ record.filePath }}</code></dd></div>
|
|
64
|
+
<div v-if="record.readConfirmation"><dt>读取代理</dt><dd>{{ record.readConfirmation.agent }}</dd></div>
|
|
65
|
+
<div v-if="record.readConfirmation"><dt>确认时间</dt><dd>{{ record.readConfirmation.at }}</dd></div>
|
|
66
|
+
<div v-for="(warning, index) in record.discoveryWarnings || []" :key="index"><dt>探测提示</dt><dd>{{ warning.source }} · {{ warning.reason }}</dd></div>
|
|
67
|
+
</dl>
|
|
68
|
+
</details>
|
|
69
|
+
</li>
|
|
70
|
+
</ol>
|
|
71
|
+
</section>
|
|
72
|
+
</div>
|
|
73
|
+
</details>
|