codexmate 0.1.30 → 0.1.32
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 +98 -7
- package/README.vi.md +98 -7
- package/README.zh.md +99 -7
- package/cli/agents-files.js +18 -4
- package/cli/config-bootstrap.js +25 -11
- package/cli/plugin-config.js +64 -0
- package/cli/prompt-history.js +17 -4
- package/cli/system-prompt-files.js +7 -2
- package/cli.js +396 -46
- package/lib/cli-config-engine.js +266 -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/session-context-health.js +82 -0
- package/lib/session-context-records.js +153 -0
- package/lib/thread-handoff.js +130 -0
- package/lib/web-startup-auth.js +53 -0
- package/lib/workflow-engine.js +92 -21
- package/lib/workflow-runner.js +261 -0
- package/package.json +1 -1
- package/plugins/prompt-templates/computed.mjs +3 -3
- package/plugins/prompt-templates/invocation.mjs +73 -0
- package/plugins/prompt-templates/methods.mjs +48 -3
- package/plugins/prompt-templates/overview.mjs +2 -0
- package/web-ui/app.js +48 -2
- package/web-ui/index.html +1 -0
- package/web-ui/logic.context-health.mjs +144 -0
- package/web-ui/modules/access-token.mjs +33 -0
- package/web-ui/modules/api.mjs +2 -1
- package/web-ui/modules/app.computed.prompts.mjs +11 -0
- package/web-ui/modules/app.methods.agents.mjs +20 -3
- package/web-ui/modules/app.methods.index.mjs +6 -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 +6 -2
- package/web-ui/modules/app.methods.system-prompt.mjs +17 -2
- package/web-ui/modules/app.methods.workflows.mjs +41 -0
- package/web-ui/modules/context-health.methods.mjs +70 -0
- package/web-ui/modules/i18n/locales/en.mjs +70 -2
- package/web-ui/modules/i18n/locales/ja.mjs +70 -2
- package/web-ui/modules/i18n/locales/vi.mjs +70 -2
- package/web-ui/modules/i18n/locales/zh-tw.mjs +70 -2
- package/web-ui/modules/i18n/locales/zh.mjs +70 -2
- package/web-ui/modules/plugins.methods.mjs +2 -0
- package/web-ui/modules/prompt-ecosystem.methods.mjs +136 -0
- package/web-ui/modules/sessions-filters-url.mjs +3 -0
- package/web-ui/modules/skills.methods.mjs +6 -5
- package/web-ui/modules/thread-handoff.mjs +142 -0
- package/web-ui/partials/index/context-health.html +45 -0
- package/web-ui/partials/index/modal-prompt-invocation.html +17 -0
- 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-plugins.html +37 -9
- package/web-ui/partials/index/panel-prompts.html +46 -18
- package/web-ui/partials/index/panel-sessions.html +35 -44
- package/web-ui/partials/index/thread-handoff.html +59 -0
- package/web-ui/res/web-ui-render.precompiled.js +1289 -177
- package/web-ui/styles/context-health.css +107 -0
- package/web-ui/styles/controls-forms.css +9 -0
- package/web-ui/styles/dashboard.css +51 -0
- package/web-ui/styles/modals-core.css +87 -0
- package/web-ui/styles/navigation-panels.css +1 -1
- package/web-ui/styles/plugins-panel.css +62 -0
- package/web-ui/styles/prompts-editor.css +34 -4
- package/web-ui/styles/responsive.css +19 -10
- package/web-ui/styles/sessions-preview.css +206 -111
- package/web-ui/styles/sub-tabs.css +181 -0
- package/web-ui/styles.css +2 -0
|
@@ -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>
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
<div v-if="promptComposerMissingVars.length" class="plugins-panel-note">{{ t('plugins.promptTemplates.compose.missingCount', { count: promptComposerMissingVars.length }) }}</div>
|
|
100
100
|
</div>
|
|
101
101
|
<div class="prompt-editor-actions">
|
|
102
|
-
<button v-if="promptComposerMissingVars.length" type="button" class="btn-mini" @click="focusPromptComposerFirstMissingVar" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.compose.jumpToMissing') }}</button>
|
|
103
|
-
<button type="button" class="btn-mini" @click="resetPromptComposerVarValues" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
102
|
+
<button v-if="promptComposerMissingVars.length" type="button" class="btn-mini" @click="focusPromptComposerFirstMissingVar" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.compose.jumpToMissing') }}</button>
|
|
103
|
+
<button type="button" class="btn-mini" @click="resetPromptComposerVarValues" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
104
104
|
</div>
|
|
105
105
|
</div>
|
|
106
106
|
<div class="prompt-vars-grid">
|
|
@@ -139,9 +139,9 @@
|
|
|
139
139
|
v-model.trim="promptTemplatesKeyword"
|
|
140
140
|
:aria-label="t('plugins.promptTemplates.manage.searchAria')"
|
|
141
141
|
:placeholder="t('plugins.promptTemplates.manage.searchPlaceholder')">
|
|
142
|
-
<button type="button" class="btn-mini" @click="createPromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.manage.create') }}</button>
|
|
142
|
+
<button type="button" class="btn-mini" @click="createPromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.manage.create') }}</button>
|
|
143
143
|
<button type="button" class="btn-mini" @click="exportPromptTemplates" :disabled="pluginsLoading || !promptTemplatesList.length">{{ t('plugins.promptTemplates.manage.export') }}</button>
|
|
144
|
-
<button type="button" class="btn-mini" @click="triggerPromptTemplatesImport" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.manage.import') }}</button>
|
|
144
|
+
<button type="button" class="btn-mini" @click="triggerPromptTemplatesImport" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.manage.import') }}</button>
|
|
145
145
|
</div>
|
|
146
146
|
|
|
147
147
|
<div v-if="pluginsLoading && !promptTemplatesLoadedOnce" class="skills-empty-state">{{ t('plugins.promptTemplates.manage.loading') }}</div>
|
|
@@ -168,15 +168,43 @@
|
|
|
168
168
|
</div>
|
|
169
169
|
|
|
170
170
|
<div class="prompt-templates-pane prompt-templates-pane-editor">
|
|
171
|
+
<div class="prompt-editor-actions">
|
|
172
|
+
<button type="button" class="btn-mini" @click="openPluginHistory" :disabled="pluginsLoading || pluginConfigSaving || pluginHistoryLoading">{{ t('common.history') }}</button>
|
|
173
|
+
<button type="button" class="btn-mini" @click="sharePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving || !promptTemplateDraft">{{ t('ecosystem.share') }}</button>
|
|
174
|
+
</div>
|
|
175
|
+
<details v-if="pluginHistoryVisible" class="prompt-history-panel" open>
|
|
176
|
+
<summary class="prompt-history-summary">
|
|
177
|
+
<span>{{ t('common.history') }}</span>
|
|
178
|
+
<button type="button" class="btn-mini" @click="pluginHistoryVisible = false; pluginHistorySelectedId = ''" :aria-label="t('common.close')">×</button>
|
|
179
|
+
</summary>
|
|
180
|
+
<div class="prompt-history-body">
|
|
181
|
+
<div class="prompt-history-list" role="group" :aria-label="t('common.history')">
|
|
182
|
+
<button v-for="item in pluginHistoryItems" :key="item.id" type="button" :class="['btn-mini', { active: pluginHistorySelectedId === item.id }]" :aria-pressed="pluginHistorySelectedId === item.id" :disabled="pluginHistoryLoading || pluginConfigSaving" @click="viewPluginHistory(item)">{{ item.id }}</button>
|
|
183
|
+
</div>
|
|
184
|
+
<p v-if="pluginHistoryLoading" class="state-message">{{ t('diff.generating') }}</p>
|
|
185
|
+
<p v-else-if="pluginHistoryError" class="state-message error" role="alert">{{ pluginHistoryError }}</p>
|
|
186
|
+
<p v-else-if="!pluginHistoryItems.length" class="state-message">{{ t('toast.history.empty') }}</p>
|
|
187
|
+
<template v-if="pluginHistorySelectedId && !pluginHistoryLoading && !pluginHistoryError">
|
|
188
|
+
<div class="form-hint">{{ t('ecosystem.historyCompare') }} · +{{ pluginHistoryComparison.stats.added }} / −{{ pluginHistoryComparison.stats.removed }}</div>
|
|
189
|
+
<div class="agents-diff-view prompt-history-diff" role="region" :aria-label="t('ecosystem.historyCompare')" tabindex="0">
|
|
190
|
+
<div v-for="(line, index) in pluginHistoryComparison.lines" :key="index" :class="['agents-diff-line', line.type]">
|
|
191
|
+
<span class="agents-diff-line-sign">{{ line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ') }}</span>
|
|
192
|
+
<span class="agents-diff-line-text">{{ line.value }}</span>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
<button type="button" class="btn-mini btn-confirm-mini" @click="rollbackPluginConfig" :disabled="pluginConfigSaving || pluginHistoryLoading">{{ t('ecosystem.rollback') }}</button>
|
|
196
|
+
</template>
|
|
197
|
+
</div>
|
|
198
|
+
</details>
|
|
171
199
|
<div v-if="!promptTemplateDraft" class="skills-empty-state">{{ t('plugins.promptTemplates.editor.selectHint') }}</div>
|
|
172
200
|
<template v-else>
|
|
173
201
|
<div class="prompt-editor-head">
|
|
174
202
|
<div class="prompt-editor-title-row">
|
|
175
203
|
<input class="form-input prompt-editor-name" type="text" v-model.trim="promptTemplateDraftRaw.name" :disabled="promptTemplateDraft.isBuiltin" :placeholder="t('plugins.promptTemplates.editor.namePlaceholder')" :aria-label="t('plugins.promptTemplates.editor.nameAria')">
|
|
176
204
|
<div v-if="!promptTemplateDraft.isBuiltin" class="prompt-editor-actions">
|
|
177
|
-
<button type="button" class="btn-mini" @click="duplicatePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.duplicate') }}</button>
|
|
178
|
-
<button type="button" class="btn-mini delete" @click="deletePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.delete') }}</button>
|
|
179
|
-
<button type="button" class="btn-mini" @click="savePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.save') }}</button>
|
|
205
|
+
<button type="button" class="btn-mini" @click="duplicatePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.duplicate') }}</button>
|
|
206
|
+
<button type="button" class="btn-mini delete" @click="deletePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.delete') }}</button>
|
|
207
|
+
<button type="button" class="btn-mini" @click="savePromptTemplate" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.editor.save') }}</button>
|
|
180
208
|
</div>
|
|
181
209
|
</div>
|
|
182
210
|
<div v-if="promptTemplateDraft.isBuiltin" class="plugins-panel-note">
|
|
@@ -206,7 +234,7 @@
|
|
|
206
234
|
<div class="plugins-panel-note">{{ t('plugins.promptTemplates.vars.hint') }}</div>
|
|
207
235
|
</div>
|
|
208
236
|
<div v-if="!promptTemplateDraft.isBuiltin" class="prompt-editor-actions">
|
|
209
|
-
<button type="button" class="btn-mini" @click="resetPromptVariableValues" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
237
|
+
<button type="button" class="btn-mini" @click="resetPromptVariableValues" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
210
238
|
</div>
|
|
211
239
|
</div>
|
|
212
240
|
|
|
@@ -225,7 +253,7 @@
|
|
|
225
253
|
<div class="prompt-vars-title">{{ t('plugins.promptTemplates.preview.title') }}</div>
|
|
226
254
|
<div class="plugins-panel-note">{{ t('plugins.promptTemplates.preview.hint') }}</div>
|
|
227
255
|
</div>
|
|
228
|
-
<button type="button" class="btn-mini" @click="copyRenderedPrompt" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.preview.copy') }}</button>
|
|
256
|
+
<button type="button" class="btn-mini" @click="copyRenderedPrompt" :disabled="pluginsLoading || pluginConfigSaving">{{ t('plugins.promptTemplates.preview.copy') }}</button>
|
|
229
257
|
</div>
|
|
230
258
|
<textarea class="form-input prompt-preview-textarea" :value="renderedPrompt" rows="10" readonly spellcheck="false" :aria-label="t('plugins.promptTemplates.preview.outputAria')"></textarea>
|
|
231
259
|
</div>
|
|
@@ -37,12 +37,18 @@
|
|
|
37
37
|
|
|
38
38
|
<div v-if="promptsSubTab !== 'system'" class="prompts-editor">
|
|
39
39
|
<div class="prompts-editor-toolbar">
|
|
40
|
-
<div class="
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
<div class="prompts-path-summary-wrap">
|
|
41
|
+
<details v-if="agentsPath" class="prompts-path-summary">
|
|
42
|
+
<summary class="prompts-path-summary-trigger" :title="agentsPath">
|
|
43
|
+
<span class="prompts-path-summary-name">{{ promptPathFileName(agentsPath) }}</span>
|
|
44
|
+
<span class="prompts-token-hint">· {{ t('prompts.tokenCount.hint', { count: agentsTokenCount }) }}</span>
|
|
45
|
+
</summary>
|
|
46
|
+
<div class="prompts-path-summary-popover" role="tooltip">
|
|
47
|
+
<span class="prompts-path-summary-popover-label">{{ t('prompts.path.fullPath') }}</span>
|
|
48
|
+
<code>{{ agentsPath }}</code>
|
|
49
|
+
</div>
|
|
50
|
+
</details>
|
|
51
|
+
<div v-else class="form-hint prompts-path-summary-empty">{{ t('common.notLoaded') }}</div>
|
|
46
52
|
</div>
|
|
47
53
|
<div class="prompts-editor-actions">
|
|
48
54
|
<div class="prompts-editor-group prompts-editor-group--pathref">
|
|
@@ -56,7 +62,7 @@
|
|
|
56
62
|
<option v-for="opt in promptsPathReferenceOptionList()" :key="opt.id" :value="opt.id" :disabled="opt.disabled">{{ opt.label }}</option>
|
|
57
63
|
</select>
|
|
58
64
|
</div>
|
|
59
|
-
<div class="prompts-editor-group prompts-editor-group--secondary">
|
|
65
|
+
<div class="prompts-editor-group prompts-editor-group--secondary prompts-editor-group--edit" role="group" :aria-label="t('prompts.actions.edit')">
|
|
60
66
|
<button
|
|
61
67
|
class="btn-mini"
|
|
62
68
|
@click="exportAgentsContent"
|
|
@@ -86,7 +92,7 @@
|
|
|
86
92
|
<svg class="btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 8v4l3 2"/><path d="M3 12a9 9 0 1 0 9-9 9 9 0 0 0-7.5 4M3 4v4h4"/></svg>
|
|
87
93
|
</button>
|
|
88
94
|
</div>
|
|
89
|
-
<div class="prompts-editor-group prompts-editor-group--workflow">
|
|
95
|
+
<div class="prompts-editor-group prompts-editor-group--workflow prompts-editor-group--view" role="group" :aria-label="t('prompts.actions.view')">
|
|
90
96
|
<button class="btn-mini" @click="agentsDiffVisible ? resetAgentsDiffState() : loadPromptsContent()" :disabled="agentsSaving || agentsDiffLoading" :title="t('common.cancel')">
|
|
91
97
|
<svg class="btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6L6 18M6 6l12 12"/></svg>
|
|
92
98
|
</button>
|
|
@@ -112,8 +118,16 @@
|
|
|
112
118
|
<div v-if="promptHistoryLoading" class="state-message">{{ t('diff.generating') }}</div>
|
|
113
119
|
<div v-else-if="promptHistoryError" class="state-message error">{{ promptHistoryError }}</div>
|
|
114
120
|
<div v-else-if="!promptHistoryItems.length" class="state-message">{{ t('toast.history.empty') }}</div>
|
|
115
|
-
<div v-if="
|
|
121
|
+
<div v-if="promptHistoryPreviewId && !promptHistoryLoading && !promptHistoryError" class="prompt-history-preview-wrap">
|
|
116
122
|
<pre class="prompt-history-preview">{{ promptHistoryPreviewContent }}</pre>
|
|
123
|
+
<div class="form-hint">{{ t('ecosystem.historyCompare') }} · +{{ promptHistoryComparison.stats.added }} / −{{ promptHistoryComparison.stats.removed }}</div>
|
|
124
|
+
<div class="agents-diff-view prompt-history-diff" role="region" :aria-label="t('ecosystem.historyCompare')" tabindex="0">
|
|
125
|
+
<div v-for="(line, index) in promptHistoryComparison.lines" :key="index" :class="['agents-diff-line', line.type]">
|
|
126
|
+
<span class="agents-diff-line-sign">{{ line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ') }}</span>
|
|
127
|
+
<span class="agents-diff-line-text">{{ line.value }}</span>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
<button type="button" class="btn-mini btn-confirm-mini" @click="rollbackPromptHistory('agents')" :disabled="agentsSaving || promptHistoryLoading || agentsDiffVisible">{{ t('ecosystem.rollback') }}</button>
|
|
117
131
|
<button type="button" class="btn-mini btn-confirm-mini" @click="applyPromptHistoryToEditor" :disabled="agentsSaving || agentsDiffVisible">{{ t('common.restoreToEditor') }}</button>
|
|
118
132
|
</div>
|
|
119
133
|
</div>
|
|
@@ -276,12 +290,18 @@
|
|
|
276
290
|
|
|
277
291
|
<div class="prompts-editor">
|
|
278
292
|
<div class="prompts-editor-toolbar">
|
|
279
|
-
<div class="
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
293
|
+
<div class="prompts-path-summary-wrap">
|
|
294
|
+
<details v-if="sysPromptPath" class="prompts-path-summary">
|
|
295
|
+
<summary class="prompts-path-summary-trigger" :title="sysPromptPath">
|
|
296
|
+
<span class="prompts-path-summary-name">{{ promptPathFileName(sysPromptPath) }}</span>
|
|
297
|
+
<span class="prompts-token-hint">· {{ t('prompts.tokenCount.hint', { count: sysPromptTokenCount }) }}</span>
|
|
298
|
+
</summary>
|
|
299
|
+
<div class="prompts-path-summary-popover" role="tooltip">
|
|
300
|
+
<span class="prompts-path-summary-popover-label">{{ t('prompts.path.fullPath') }}</span>
|
|
301
|
+
<code>{{ sysPromptPath }}</code>
|
|
302
|
+
</div>
|
|
303
|
+
</details>
|
|
304
|
+
<div v-else class="form-hint prompts-path-summary-empty">{{ t('common.notLoaded') }}</div>
|
|
285
305
|
</div>
|
|
286
306
|
<div class="prompts-editor-actions">
|
|
287
307
|
<div class="prompts-editor-group prompts-editor-group--pathref">
|
|
@@ -295,7 +315,7 @@
|
|
|
295
315
|
<option v-for="opt in promptsPathReferenceOptionList()" :key="opt.id" :value="opt.id" :disabled="opt.disabled">{{ opt.label }}</option>
|
|
296
316
|
</select>
|
|
297
317
|
</div>
|
|
298
|
-
<div class="prompts-editor-group prompts-editor-group--secondary">
|
|
318
|
+
<div class="prompts-editor-group prompts-editor-group--secondary prompts-editor-group--edit" role="group" :aria-label="t('prompts.actions.edit')">
|
|
299
319
|
<button class="btn-mini" @click="exportSysPromptContent" :disabled="sysPromptLoading || sysPromptSaving || !sysPromptContent" :title="t('modal.agents.export')">
|
|
300
320
|
<svg class="btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 3v12M8 11l4 4 4-4M4 17v2h16v-2"/></svg>
|
|
301
321
|
</button>
|
|
@@ -309,7 +329,7 @@
|
|
|
309
329
|
<svg class="btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 8v4l3 2"/><path d="M3 12a9 9 0 1 0 9-9 9 9 0 0 0-7.5 4M3 4v4h4"/></svg>
|
|
310
330
|
</button>
|
|
311
331
|
</div>
|
|
312
|
-
<div class="prompts-editor-group prompts-editor-group--workflow">
|
|
332
|
+
<div class="prompts-editor-group prompts-editor-group--workflow prompts-editor-group--view" role="group" :aria-label="t('prompts.actions.view')">
|
|
313
333
|
<button class="btn-mini" @click="sysPromptDiffVisible ? resetSysPromptDiffState() : cancelSysPromptEdit()" :disabled="sysPromptSaving || sysPromptDiffLoading" :title="t('common.cancel')">
|
|
314
334
|
<svg class="btn-icon-sm" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 6L6 18M6 6l12 12"/></svg>
|
|
315
335
|
</button>
|
|
@@ -335,8 +355,16 @@
|
|
|
335
355
|
<div v-if="sysHistoryLoading" class="state-message">{{ t('diff.generating') }}</div>
|
|
336
356
|
<div v-else-if="sysHistoryError" class="state-message error">{{ sysHistoryError }}</div>
|
|
337
357
|
<div v-else-if="!sysHistoryItems.length" class="state-message">{{ t('toast.history.empty') }}</div>
|
|
338
|
-
<div v-if="
|
|
358
|
+
<div v-if="sysHistoryPreviewId && !sysHistoryLoading && !sysHistoryError" class="prompt-history-preview-wrap">
|
|
339
359
|
<pre class="prompt-history-preview">{{ sysHistoryPreviewContent }}</pre>
|
|
360
|
+
<div class="form-hint">{{ t('ecosystem.historyCompare') }} · +{{ sysHistoryComparison.stats.added }} / −{{ sysHistoryComparison.stats.removed }}</div>
|
|
361
|
+
<div class="agents-diff-view prompt-history-diff" role="region" :aria-label="t('ecosystem.historyCompare')" tabindex="0">
|
|
362
|
+
<div v-for="(line, index) in sysHistoryComparison.lines" :key="index" :class="['agents-diff-line', line.type]">
|
|
363
|
+
<span class="agents-diff-line-sign">{{ line.type === 'add' ? '+' : (line.type === 'del' ? '−' : ' ') }}</span>
|
|
364
|
+
<span class="agents-diff-line-text">{{ line.value }}</span>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
<button type="button" class="btn-mini btn-confirm-mini" @click="rollbackPromptHistory('sys')" :disabled="sysPromptSaving || sysHistoryLoading || sysPromptDiffVisible">{{ t('ecosystem.rollback') }}</button>
|
|
340
368
|
<button type="button" class="btn-mini btn-confirm-mini" @click="applySysHistoryToEditor" :disabled="sysPromptSaving || sysPromptDiffVisible">{{ t('common.restoreToEditor') }}</button>
|
|
341
369
|
</div>
|
|
342
370
|
</div>
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
{{ sessionStandaloneTitle }}
|
|
18
18
|
<span v-if="sessionStandaloneSourceLabel"> · {{ sessionStandaloneSourceLabel }}</span>
|
|
19
19
|
</div>
|
|
20
|
+
<!-- @include ./context-health.html -->
|
|
20
21
|
<pre class="session-standalone-text">{{ sessionStandaloneText }}</pre>
|
|
21
22
|
</div>
|
|
22
23
|
</div>
|
|
@@ -240,6 +241,7 @@
|
|
|
240
241
|
<div :class="['session-preview', { active: !!activeSession }]" :ref="setSessionPreviewContainerRef">
|
|
241
242
|
<template v-if="activeSession">
|
|
242
243
|
<div class="session-preview-scroll" :ref="setSessionPreviewScrollRef" @scroll="onSessionPreviewScroll">
|
|
244
|
+
<!-- @include ./thread-handoff.html -->
|
|
243
245
|
<div class="session-preview-header" :ref="setSessionPreviewHeaderRef">
|
|
244
246
|
<div>
|
|
245
247
|
<div class="session-preview-title">{{ activeSession.title || activeSession.sessionId }}</div>
|
|
@@ -253,11 +255,11 @@
|
|
|
253
255
|
</div>
|
|
254
256
|
<div class="session-actions session-preview-actions">
|
|
255
257
|
<div class="session-secondary-actions">
|
|
256
|
-
<button class="btn-session-refresh has-label session-action-optional-label" @click="loadActiveSessionDetail" :disabled="sessionDetailLoading || !activeSession"
|
|
258
|
+
<button class="btn-session-refresh has-label session-action-optional-label" data-icon-only="true" @click="loadActiveSessionDetail" :disabled="sessionDetailLoading || !activeSession"
|
|
257
259
|
:title="sessionDetailLoading ? t('sessions.preview.loading') : t('sessions.preview.refresh')"
|
|
258
260
|
:aria-label="sessionDetailLoading ? t('sessions.preview.loading') : t('sessions.preview.refresh')">
|
|
259
|
-
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2.5 8a5.5 5.5 0 0 1 9.4-3.8"/><path d="M13.5 8a5.5 5.5 0 0 1-9.4 3.8"/><polyline points="2.5 2 2.5 5 5.5 5"/><polyline points="13.5 14 13.5 11 10.5 11"/></svg>
|
|
260
|
-
<span class="session-action-label session-action-optional-text">{{ t('sessions.preview.refresh') }}</span>
|
|
261
|
+
<svg aria-hidden="true" focusable="false" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2.5 8a5.5 5.5 0 0 1 9.4-3.8"/><path d="M13.5 8a5.5 5.5 0 0 1-9.4 3.8"/><polyline points="2.5 2 2.5 5 5.5 5"/><polyline points="13.5 14 13.5 11 10.5 11"/></svg>
|
|
262
|
+
<span class="session-action-label session-action-optional-text" hidden aria-hidden="true">{{ t('sessions.preview.refresh') }}</span>
|
|
261
263
|
</button>
|
|
262
264
|
<div class="session-link-group"><button
|
|
263
265
|
class="btn-session-open"
|
|
@@ -275,37 +277,39 @@
|
|
|
275
277
|
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2h-8.5A1.5 1.5 0 0 0 2 3.5v8A1.5 1.5 0 0 0 3.5 13h8a1.5 1.5 0 0 0 1.5-1.5v-3"/><path d="M13 2v4h-4"/><path d="M13 2L7 8"/></svg>
|
|
276
278
|
</button></div>
|
|
277
279
|
<button
|
|
278
|
-
class="btn-session-open has-label session-action-optional-label"
|
|
280
|
+
class="btn-session-open has-label session-action-optional-label" data-icon-only="true"
|
|
279
281
|
@click="copySessionPath(activeSession)"
|
|
280
282
|
:disabled="!activeSession || !getSessionFilePath(activeSession)"
|
|
281
283
|
:title="t('sessions.preview.copyPath')"
|
|
282
284
|
:aria-label="t('sessions.preview.copyPath')">
|
|
283
|
-
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2 5.5V12.5a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7.5a1 1 0 0 0-1-1H8L6.5 5H3a1 1 0 0 0-1 1z"/></svg>
|
|
284
|
-
<span class="session-action-label session-action-optional-text">{{ t('sessions.preview.copyPath') }}</span>
|
|
285
|
+
<svg aria-hidden="true" focusable="false" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M2 5.5V12.5a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V7.5a1 1 0 0 0-1-1H8L6.5 5H3a1 1 0 0 0-1 1z"/></svg>
|
|
286
|
+
<span class="session-action-label session-action-optional-text" hidden aria-hidden="true">{{ t('sessions.preview.copyPath') }}</span>
|
|
285
287
|
</button>
|
|
286
288
|
</div>
|
|
287
289
|
<div class="session-primary-actions">
|
|
288
290
|
<button
|
|
289
|
-
class="btn-session-export has-label"
|
|
291
|
+
class="btn-session-export has-label" data-icon-only="true"
|
|
290
292
|
@click="exportSession(activeSession)"
|
|
291
293
|
:disabled="!activeSession || sessionExporting[getSessionExportKey(activeSession)]"
|
|
292
294
|
:title="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')"
|
|
293
295
|
:aria-label="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')">
|
|
294
|
-
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v8"/><polyline points="4 7 8 10.5 12 7"/><path d="M2.5 12v1.5a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1V12"/></svg>
|
|
295
|
-
<span class="session-action-label">{{ (activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export') }}</span>
|
|
296
|
+
<svg aria-hidden="true" focusable="false" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v8"/><polyline points="4 7 8 10.5 12 7"/><path d="M2.5 12v1.5a1 1 0 0 0 1 1h9a1 1 0 0 0 1-1V12"/></svg>
|
|
297
|
+
<span class="session-action-label" hidden aria-hidden="true">{{ (activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export') }}</span>
|
|
296
298
|
</button>
|
|
297
299
|
<button
|
|
298
300
|
v-if="isDeleteAvailable(activeSession)"
|
|
299
|
-
class="btn-session-delete has-label session-delete-text-button"
|
|
301
|
+
class="btn-session-delete has-label session-delete-text-button" data-icon-only="true"
|
|
300
302
|
@click="deleteSession(activeSession)"
|
|
301
303
|
:disabled="!activeSession || sessionsLoading || sessionDeleting[getSessionExportKey(activeSession)]"
|
|
302
304
|
:title="(activeSession && sessionDeleting[getSessionExportKey(activeSession)]) ? (sessionTrashEnabled === false ? t('sessions.preview.deleting') : t('sessions.preview.moving')) : (sessionTrashEnabled === false ? t('sessions.preview.deleteHard') : t('sessions.preview.moveToTrash'))"
|
|
303
305
|
:aria-label="(activeSession && sessionDeleting[getSessionExportKey(activeSession)]) ? (sessionTrashEnabled === false ? t('sessions.preview.deleting') : t('sessions.preview.moving')) : (sessionTrashEnabled === false ? t('sessions.preview.deleteHard') : t('sessions.preview.moveToTrash'))">
|
|
304
|
-
<
|
|
306
|
+
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M2.5 4.5h11M6 4.5V2.5h4v2"/><path d="m4 4.5 .5 9h7l.5-9M6.5 7v4M9.5 7v4"/></svg>
|
|
307
|
+
<span class="session-action-label" hidden aria-hidden="true">{{ (activeSession && sessionDeleting[getSessionExportKey(activeSession)]) ? (sessionTrashEnabled === false ? t('sessions.preview.deleting') : t('sessions.preview.moving')) : (sessionTrashEnabled === false ? t('sessions.preview.deleteHard') : t('sessions.preview.moveToTrash')) }}</span>
|
|
305
308
|
</button>
|
|
306
309
|
</div>
|
|
307
310
|
</div>
|
|
308
311
|
</div>
|
|
312
|
+
<!-- @include ./context-health.html -->
|
|
309
313
|
<div class="session-export-feedback">
|
|
310
314
|
<p v-if="sessionExportNotice && sessionExportNotice.key === getSessionExportKey(activeSession)" class="session-export-notice" role="status">{{ t('sessions.export.truncated') }}</p>
|
|
311
315
|
</div>
|
|
@@ -458,9 +462,14 @@
|
|
|
458
462
|
</button>
|
|
459
463
|
</div>
|
|
460
464
|
<aside v-if="sessionPreviewRenderEnabled && sessionTimelineNodes.length" :class="['session-timeline', 'session-timeline-' + sessionTimelineStyle]" :aria-label="t('sessions.timeline.aria')">
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
<
|
|
465
|
+
<header class="session-timeline-heading">
|
|
466
|
+
<span>阅读目录</span>
|
|
467
|
+
<span class="session-timeline-count">{{ sessionTimelineNodes.length }} 个定位点</span>
|
|
468
|
+
</header>
|
|
469
|
+
<div class="session-timeline-reading-progress" aria-hidden="true">
|
|
470
|
+
<span :style="{ width: sessionTimelineProgressPercent + '%' }"></span>
|
|
471
|
+
</div>
|
|
472
|
+
<nav class="session-timeline-index" :aria-label="t('sessions.timeline.aria')">
|
|
464
473
|
<button
|
|
465
474
|
v-for="node in sessionTimelineNodes"
|
|
466
475
|
:key="'timeline-' + node.key"
|
|
@@ -468,39 +477,21 @@
|
|
|
468
477
|
type="button"
|
|
469
478
|
:class="['session-timeline-node', { active: sessionTimelineActiveKey === node.key }]"
|
|
470
479
|
:aria-current="sessionTimelineActiveKey === node.key ? 'true' : null"
|
|
471
|
-
:style="{ top: `${node.safePercent}%` }"
|
|
472
|
-
:title="node.title"
|
|
473
|
-
@click="jumpToSessionTimelineNode(node.key)">
|
|
474
|
-
<span class="sr-only">{{ node.title }}</span>
|
|
475
|
-
</button>
|
|
476
|
-
<div class="session-timeline-current" v-if="sessionTimelineActiveTitle">
|
|
477
|
-
{{ sessionTimelineActiveTitle }}
|
|
478
|
-
</div>
|
|
479
|
-
</template>
|
|
480
|
-
|
|
481
|
-
<!-- 条状模式 -->
|
|
482
|
-
<template v-else>
|
|
483
|
-
<div class="session-timeline-bar-track">
|
|
484
|
-
<div class="session-timeline-bar-progress"
|
|
485
|
-
:style="{ height: sessionTimelineProgressPercent + '%' }">
|
|
486
|
-
</div>
|
|
487
|
-
</div>
|
|
488
|
-
<button
|
|
489
|
-
v-for="node in sessionTimelineNodes"
|
|
490
|
-
:key="'timeline-bar-' + node.key"
|
|
491
|
-
v-memo="[sessionTimelineActiveKey === node.key, node.safePercent, node.title]"
|
|
492
|
-
type="button"
|
|
493
|
-
:class="['session-timeline-bar-node', { active: sessionTimelineActiveKey === node.key }]"
|
|
494
|
-
:aria-current="sessionTimelineActiveKey === node.key ? 'true' : null"
|
|
495
|
-
:style="{ top: `${node.safePercent}%` }"
|
|
496
480
|
:title="node.title"
|
|
481
|
+
:aria-label="node.title"
|
|
497
482
|
@click="jumpToSessionTimelineNode(node.key)">
|
|
498
|
-
<span class="
|
|
483
|
+
<span class="session-timeline-number">{{ node.title.split(' · ')[0] }}</span>
|
|
484
|
+
<span class="session-timeline-label">
|
|
485
|
+
<span class="session-timeline-role">{{ node.role === 'user' ? '提问' : node.role === 'assistant' ? '回复' : node.roleLabel }}</span>
|
|
486
|
+
<time class="session-timeline-time">{{ node.displayTime ? node.displayTime.slice(-5) : '无时间' }}</time>
|
|
487
|
+
</span>
|
|
488
|
+
<span class="session-timeline-indicator" aria-hidden="true"></span>
|
|
499
489
|
</button>
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
490
|
+
</nav>
|
|
491
|
+
<footer class="session-timeline-current" :title="sessionTimelineActiveTitle">
|
|
492
|
+
<span class="session-timeline-status-dot" aria-hidden="true"></span>
|
|
493
|
+
{{ sessionTimelineActiveTitle ? '正在阅读 ' + sessionTimelineActiveTitle.split(' · ')[0] : '选择节点定位原文' }}
|
|
494
|
+
</footer>
|
|
504
495
|
</aside>
|
|
505
496
|
</template>
|
|
506
497
|
|
|
@@ -0,0 +1,59 @@
|
|
|
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">补充上下文 <small>已完成 / 阻塞 / 步骤 / 文件 · 可选</small></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
|
+
<span class="session-workspace-subtitle">生成后可复制到目标会话</span>
|
|
28
|
+
<button class="btn-mini thread-handoff-submit" type="submit" :disabled="handoffBusy || handoffLoading || !handoffDraft.target.trim() || !handoffDraft.goal.trim()">{{ handoffBusy ? '处理中…' : '生成交接' }}</button>
|
|
29
|
+
</div>
|
|
30
|
+
</form>
|
|
31
|
+
<p v-if="handoffError" class="state-message error session-workspace-card-wide" role="alert">{{ handoffError }}</p>
|
|
32
|
+
<p v-if="handoffNotice" class="state-message session-workspace-card-wide" role="status" aria-live="polite">{{ handoffNotice }}</p>
|
|
33
|
+
<label v-if="handoffCopyText" class="session-workspace-card session-workspace-card-wide">
|
|
34
|
+
<span class="session-workspace-card-title">卡片文本(未发送,可手动复制)</span>
|
|
35
|
+
<textarea class="session-query-input" rows="6" readonly :value="handoffCopyText" @focus="$event.target.select()"></textarea>
|
|
36
|
+
</label>
|
|
37
|
+
<p class="session-workspace-subtitle session-workspace-card-wide">复制不会自动发送。读取确认由目标代理通过 CLI ack 提交。</p>
|
|
38
|
+
<p v-if="handoffLoading" class="session-workspace-card-wide" role="status">正在加载交接历史…</p>
|
|
39
|
+
<p v-else-if="!handoffError && !handoffRecords.length" class="session-workspace-empty session-workspace-card-wide">暂无交接记录</p>
|
|
40
|
+
<ol v-if="handoffRecords.length" class="session-workspace-list session-workspace-card-wide">
|
|
41
|
+
<li v-for="record in handoffRecords" :key="record.id" class="session-workspace-card">
|
|
42
|
+
<div class="session-workspace-card-title">{{ record.target }} · {{ handoffStatusLabel(record.status) }}</div>
|
|
43
|
+
<div>交接标识:<code>{{ record.id }}</code></div>
|
|
44
|
+
<div>创建时间:{{ record.createdAt }} · 投递耗时:{{ record.durationMs }} 毫秒 · 写入耗时:{{ record.writeDurationMs || 0 }} 毫秒</div>
|
|
45
|
+
<div>交接路径:{{ record.route === 'mcp' ? 'MCP 工具' : '文件级' }} · 文件回退:{{ record.fallback ? '是' : '否' }}</div>
|
|
46
|
+
<div v-if="record.mcp">服务:{{ record.mcp.server }} · 工具:{{ record.mcp.tool }}</div>
|
|
47
|
+
<div>写入结果:{{ record.writeResult === 'written' ? '已写入' : (record.writeResult === 'failed_or_unconfirmed' ? '失败或结果未确认(不重试)' : '未执行写入') }}</div>
|
|
48
|
+
<div v-if="record.filePath">文件位置:<code>{{ record.filePath }}</code></div>
|
|
49
|
+
<div v-if="record.reason">原因:{{ record.reason }}</div>
|
|
50
|
+
<div v-if="record.readConfirmation">
|
|
51
|
+
<div>读取代理:{{ record.readConfirmation.agent }} · 确认时间:{{ record.readConfirmation.at }}</div>
|
|
52
|
+
<div>读取证据:{{ record.readConfirmation.evidence }}</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div v-for="(warning, index) in record.discoveryWarnings || []" :key="index">探测提示:{{ warning.source }} · {{ warning.reason }}</div>
|
|
55
|
+
<button class="btn-mini" type="button" @click="copyThreadHandoff(record)" :disabled="handoffBusy || handoffLoading">{{ record.route === 'mcp' ? '回退文件并复制卡片' : '复制卡片' }}</button>
|
|
56
|
+
</li>
|
|
57
|
+
</ol>
|
|
58
|
+
</div>
|
|
59
|
+
</details>
|