codexmate 0.1.30 → 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.js +360 -44
- 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 +1 -1
- package/web-ui/app.js +23 -2
- package/web-ui/modules/access-token.mjs +33 -0
- package/web-ui/modules/api.mjs +2 -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 +6 -2
- package/web-ui/modules/app.methods.workflows.mjs +41 -0
- package/web-ui/modules/i18n/locales/en.mjs +37 -2
- package/web-ui/modules/i18n/locales/ja.mjs +37 -2
- package/web-ui/modules/i18n/locales/vi.mjs +37 -2
- package/web-ui/modules/i18n/locales/zh-tw.mjs +37 -2
- package/web-ui/modules/i18n/locales/zh.mjs +37 -2
- 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/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-prompts.html +28 -16
- package/web-ui/partials/index/panel-sessions.html +21 -33
- package/web-ui/partials/index/thread-handoff.html +59 -0
- package/web-ui/res/web-ui-render.precompiled.js +614 -152
- 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 +11 -4
- package/web-ui/styles/responsive.css +19 -10
- package/web-ui/styles/sessions-preview.css +185 -111
|
@@ -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>
|
|
@@ -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>
|
|
@@ -276,12 +282,18 @@
|
|
|
276
282
|
|
|
277
283
|
<div class="prompts-editor">
|
|
278
284
|
<div class="prompts-editor-toolbar">
|
|
279
|
-
<div class="
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
<div class="prompts-path-summary-wrap">
|
|
286
|
+
<details v-if="sysPromptPath" class="prompts-path-summary">
|
|
287
|
+
<summary class="prompts-path-summary-trigger" :title="sysPromptPath">
|
|
288
|
+
<span class="prompts-path-summary-name">{{ promptPathFileName(sysPromptPath) }}</span>
|
|
289
|
+
<span class="prompts-token-hint">· {{ t('prompts.tokenCount.hint', { count: sysPromptTokenCount }) }}</span>
|
|
290
|
+
</summary>
|
|
291
|
+
<div class="prompts-path-summary-popover" role="tooltip">
|
|
292
|
+
<span class="prompts-path-summary-popover-label">{{ t('prompts.path.fullPath') }}</span>
|
|
293
|
+
<code>{{ sysPromptPath }}</code>
|
|
294
|
+
</div>
|
|
295
|
+
</details>
|
|
296
|
+
<div v-else class="form-hint prompts-path-summary-empty">{{ t('common.notLoaded') }}</div>
|
|
285
297
|
</div>
|
|
286
298
|
<div class="prompts-editor-actions">
|
|
287
299
|
<div class="prompts-editor-group prompts-editor-group--pathref">
|
|
@@ -295,7 +307,7 @@
|
|
|
295
307
|
<option v-for="opt in promptsPathReferenceOptionList()" :key="opt.id" :value="opt.id" :disabled="opt.disabled">{{ opt.label }}</option>
|
|
296
308
|
</select>
|
|
297
309
|
</div>
|
|
298
|
-
<div class="prompts-editor-group prompts-editor-group--secondary">
|
|
310
|
+
<div class="prompts-editor-group prompts-editor-group--secondary prompts-editor-group--edit" role="group" :aria-label="t('prompts.actions.edit')">
|
|
299
311
|
<button class="btn-mini" @click="exportSysPromptContent" :disabled="sysPromptLoading || sysPromptSaving || !sysPromptContent" :title="t('modal.agents.export')">
|
|
300
312
|
<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
313
|
</button>
|
|
@@ -309,7 +321,7 @@
|
|
|
309
321
|
<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
322
|
</button>
|
|
311
323
|
</div>
|
|
312
|
-
<div class="prompts-editor-group prompts-editor-group--workflow">
|
|
324
|
+
<div class="prompts-editor-group prompts-editor-group--workflow prompts-editor-group--view" role="group" :aria-label="t('prompts.actions.view')">
|
|
313
325
|
<button class="btn-mini" @click="sysPromptDiffVisible ? resetSysPromptDiffState() : cancelSysPromptEdit()" :disabled="sysPromptSaving || sysPromptDiffLoading" :title="t('common.cancel')">
|
|
314
326
|
<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
327
|
</button>
|
|
@@ -240,6 +240,7 @@
|
|
|
240
240
|
<div :class="['session-preview', { active: !!activeSession }]" :ref="setSessionPreviewContainerRef">
|
|
241
241
|
<template v-if="activeSession">
|
|
242
242
|
<div class="session-preview-scroll" :ref="setSessionPreviewScrollRef" @scroll="onSessionPreviewScroll">
|
|
243
|
+
<!-- @include ./thread-handoff.html -->
|
|
243
244
|
<div class="session-preview-header" :ref="setSessionPreviewHeaderRef">
|
|
244
245
|
<div>
|
|
245
246
|
<div class="session-preview-title">{{ activeSession.title || activeSession.sessionId }}</div>
|
|
@@ -458,9 +459,14 @@
|
|
|
458
459
|
</button>
|
|
459
460
|
</div>
|
|
460
461
|
<aside v-if="sessionPreviewRenderEnabled && sessionTimelineNodes.length" :class="['session-timeline', 'session-timeline-' + sessionTimelineStyle]" :aria-label="t('sessions.timeline.aria')">
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
<
|
|
462
|
+
<header class="session-timeline-heading">
|
|
463
|
+
<span>阅读目录</span>
|
|
464
|
+
<span class="session-timeline-count">{{ sessionTimelineNodes.length }} 个定位点</span>
|
|
465
|
+
</header>
|
|
466
|
+
<div class="session-timeline-reading-progress" aria-hidden="true">
|
|
467
|
+
<span :style="{ width: sessionTimelineProgressPercent + '%' }"></span>
|
|
468
|
+
</div>
|
|
469
|
+
<nav class="session-timeline-index" :aria-label="t('sessions.timeline.aria')">
|
|
464
470
|
<button
|
|
465
471
|
v-for="node in sessionTimelineNodes"
|
|
466
472
|
:key="'timeline-' + node.key"
|
|
@@ -468,39 +474,21 @@
|
|
|
468
474
|
type="button"
|
|
469
475
|
:class="['session-timeline-node', { active: sessionTimelineActiveKey === node.key }]"
|
|
470
476
|
: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
477
|
:title="node.title"
|
|
478
|
+
:aria-label="node.title"
|
|
497
479
|
@click="jumpToSessionTimelineNode(node.key)">
|
|
498
|
-
<span class="
|
|
480
|
+
<span class="session-timeline-number">{{ node.title.split(' · ')[0] }}</span>
|
|
481
|
+
<span class="session-timeline-label">
|
|
482
|
+
<span class="session-timeline-role">{{ node.role === 'user' ? '提问' : node.role === 'assistant' ? '回复' : node.roleLabel }}</span>
|
|
483
|
+
<time class="session-timeline-time">{{ node.displayTime ? node.displayTime.slice(-5) : '无时间' }}</time>
|
|
484
|
+
</span>
|
|
485
|
+
<span class="session-timeline-indicator" aria-hidden="true"></span>
|
|
499
486
|
</button>
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
487
|
+
</nav>
|
|
488
|
+
<footer class="session-timeline-current" :title="sessionTimelineActiveTitle">
|
|
489
|
+
<span class="session-timeline-status-dot" aria-hidden="true"></span>
|
|
490
|
+
{{ sessionTimelineActiveTitle ? '正在阅读 ' + sessionTimelineActiveTitle.split(' · ')[0] : '选择节点定位原文' }}
|
|
491
|
+
</footer>
|
|
504
492
|
</aside>
|
|
505
493
|
</template>
|
|
506
494
|
|
|
@@ -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>
|