codexmate 0.1.29 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +95 -4
  2. package/README.vi.md +95 -4
  3. package/README.zh.md +96 -4
  4. package/cli/config-bootstrap.js +25 -11
  5. package/cli/skills.js +33 -8
  6. package/cli.js +364 -42
  7. package/lib/cli-config-engine.js +260 -0
  8. package/lib/cli-utils.js +2 -1
  9. package/lib/cli-webhook.js +1 -1
  10. package/lib/handoff-mcp.js +282 -0
  11. package/lib/http-access-control.js +335 -0
  12. package/lib/thread-handoff.js +130 -0
  13. package/lib/web-startup-auth.js +49 -0
  14. package/lib/workflow-engine.js +92 -21
  15. package/lib/workflow-runner.js +261 -0
  16. package/package.json +6 -1
  17. package/web-ui/app.js +33 -4
  18. package/web-ui/logic.sessions.mjs +24 -0
  19. package/web-ui/modules/access-token.mjs +33 -0
  20. package/web-ui/modules/api.mjs +2 -1
  21. package/web-ui/modules/app.computed.dashboard.mjs +1 -1
  22. package/web-ui/modules/app.methods.codex-config.mjs +1 -1
  23. package/web-ui/modules/app.methods.index.mjs +2 -0
  24. package/web-ui/modules/app.methods.navigation.mjs +17 -3
  25. package/web-ui/modules/app.methods.prompts-editor.mjs +7 -0
  26. package/web-ui/modules/app.methods.providers.mjs +2 -2
  27. package/web-ui/modules/app.methods.runtime.mjs +3 -2
  28. package/web-ui/modules/app.methods.session-actions.mjs +3 -0
  29. package/web-ui/modules/app.methods.session-browser.mjs +11 -3
  30. package/web-ui/modules/app.methods.system-prompt.mjs +1 -8
  31. package/web-ui/modules/app.methods.workflows.mjs +41 -0
  32. package/web-ui/modules/i18n/locales/en.mjs +43 -2
  33. package/web-ui/modules/i18n/locales/ja.mjs +43 -2
  34. package/web-ui/modules/i18n/locales/vi.mjs +43 -2
  35. package/web-ui/modules/i18n/locales/zh-tw.mjs +43 -2
  36. package/web-ui/modules/i18n/locales/zh.mjs +43 -2
  37. package/web-ui/modules/i18n.mjs +16 -0
  38. package/web-ui/modules/sessions-filters-url.mjs +3 -0
  39. package/web-ui/modules/skills.computed.mjs +11 -0
  40. package/web-ui/modules/skills.methods.mjs +63 -12
  41. package/web-ui/modules/thread-handoff.mjs +142 -0
  42. package/web-ui/partials/index/layout-footer.html +1 -1
  43. package/web-ui/partials/index/layout-header.html +32 -12
  44. package/web-ui/partials/index/panel-config-claude.html +2 -0
  45. package/web-ui/partials/index/panel-config-codex.html +2 -0
  46. package/web-ui/partials/index/panel-config-kilocode.html +3 -1
  47. package/web-ui/partials/index/panel-config-openclaw.html +2 -0
  48. package/web-ui/partials/index/panel-config-opencode.html +3 -1
  49. package/web-ui/partials/index/panel-config-pi.html +2 -0
  50. package/web-ui/partials/index/panel-dashboard.html +59 -0
  51. package/web-ui/partials/index/panel-market.html +23 -5
  52. package/web-ui/partials/index/panel-prompts.html +28 -16
  53. package/web-ui/partials/index/panel-sessions.html +51 -70
  54. package/web-ui/partials/index/panel-trash.html +3 -0
  55. package/web-ui/partials/index/thread-handoff.html +59 -0
  56. package/web-ui/res/web-ui-render.precompiled.js +1020 -493
  57. package/web-ui/styles/controls-forms.css +9 -0
  58. package/web-ui/styles/dashboard.css +51 -0
  59. package/web-ui/styles/feedback.css +26 -0
  60. package/web-ui/styles/layout-shell.css +66 -2
  61. package/web-ui/styles/modals-core.css +87 -0
  62. package/web-ui/styles/navigation-panels.css +5 -11
  63. package/web-ui/styles/plugins-panel.css +62 -0
  64. package/web-ui/styles/prompts-editor.css +11 -4
  65. package/web-ui/styles/responsive.css +19 -10
  66. package/web-ui/styles/sessions-list.css +19 -1
  67. package/web-ui/styles/sessions-preview.css +224 -140
  68. package/web-ui/styles/sessions-toolbar-trash.css +2 -2
  69. package/web-ui/styles/settings-panel.css +1 -1
  70. package/web-ui/styles/skills-market.css +47 -0
  71. package/web-ui/styles/titles-cards.css +1 -1
  72. package/web-ui/styles/trash-panel.css +43 -6
@@ -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="form-hint">
41
- {{ agentsPath || t('common.notLoaded') }}
42
- <span v-if="agentsPath">
43
- {{ paren(agentsExists ? t('common.exists') : t('common.notExistsWillCreateOnSave')) }}
44
- </span>
45
- <span v-if="agentsPath" class="prompts-token-hint">· {{ t('prompts.tokenCount.hint', { count: agentsTokenCount }) }}</span>
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="form-hint">
280
- {{ sysPromptPath || t('common.notLoaded') }}
281
- <span v-if="sysPromptPath">
282
- {{ paren(sysPromptExists ? t('common.exists') : t('common.notExistsWillCreateOnSave')) }}
283
- </span>
284
- <span v-if="sysPromptPath" class="prompts-token-hint">· {{ t('prompts.tokenCount.hint', { count: sysPromptTokenCount }) }}</span>
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>
@@ -139,16 +139,12 @@
139
139
  <small class="session-search-scope">{{ t('sessions.search.scopeHint') }}</small>
140
140
  </div>
141
141
 
142
- <div v-if="sessionsLoading && sessionsList.length === 0" class="state-message">
143
- {{ t('sessions.loadingList') }}
144
- </div>
145
-
146
- <div v-else-if="!sessionsLoading && sessionsList.length === 0" class="session-empty session-empty-refined">
142
+ <div v-if="!sessionsLoading && sessionsList.length === 0" class="session-empty session-empty-refined">
147
143
  <p>{{ t(hasActiveSessionFilters() ? 'sessions.empty.filtered' : 'sessions.empty.source') }}</p>
148
144
  <button v-if="hasActiveSessionFilters()" class="btn-tool btn-tool-compact" type="button" @click="clearSessionFilters">{{ t('sessions.empty.clearFilters') }}</button>
149
145
  </div>
150
146
 
151
- <div v-else class="session-layout">
147
+ <div v-else-if="sessionsList.length > 0" class="session-layout">
152
148
  <div
153
149
  v-if="sessionListRenderEnabled"
154
150
  class="session-list"
@@ -185,7 +181,12 @@
185
181
  <span class="session-batch-check-mark"></span>
186
182
  </label>
187
183
  <div class="session-item-main">
188
- <div class="session-item-title">{{ session.title || session.sessionId }}</div>
184
+ <div class="session-item-heading">
185
+ <div class="session-item-title">{{ parseSessionTitleInfo(session).title || session.sessionId }}</div>
186
+ <div v-if="parseSessionTitleInfo(session).location" class="session-item-location" :title="parseSessionTitleInfo(session).location">
187
+ {{ parseSessionTitleInfo(session).location }}
188
+ </div>
189
+ </div>
189
190
  <span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
190
191
  <span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
191
192
  <span
@@ -228,7 +229,6 @@
228
229
  <span class="session-source" :data-source="session.source">{{ session.sourceLabel }}</span>
229
230
  <span class="session-item-time">{{ session.updatedAtLabel || session.updatedAt || t('sessions.unknownTime') }}</span>
230
231
  <span v-if="getSessionHotLabel(session)" class="session-item-hot">{{ getSessionHotLabel(session) }}</span>
231
- <span v-if="session.cwd" class="session-item-cwd session-item-sub">{{ session.cwd }}</span>
232
232
  <div v-if="session.match && session.match.snippets && session.match.snippets.length" class="session-match-snippets">
233
233
  <div v-for="(snip, si) in session.match.snippets.slice(0, 2)" :key="si" class="session-match-snippet">{{ snip }}</div>
234
234
  </div>
@@ -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>
@@ -251,30 +252,14 @@
251
252
  <span class="session-preview-meta-item">{{ activeSession.cwd }}</span>
252
253
  </div>
253
254
  </div>
254
- <div class="session-export-control">
255
- <label class="session-export-label" for="session-export-range">{{ t('sessions.export.range') }}</label>
256
- <select id="session-export-range" v-model="sessionExportRange" :disabled="sessionExporting[getSessionExportKey(activeSession)]" aria-describedby="session-export-scope">
257
- <option value="default">{{ t('sessions.export.default') }}</option>
258
- <option value="all">{{ t('sessions.export.all') }}</option>
259
- </select>
260
- <button
261
- class="btn-session-export has-label"
262
- @click="exportSession(activeSession)"
263
- :disabled="!activeSession || sessionExporting[getSessionExportKey(activeSession)]"
264
- :title="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')"
265
- :aria-label="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')">
266
- <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>
267
- <span class="session-action-label">{{ (activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export') }}</span>
268
- </button>
269
- </div>
270
255
  <div class="session-actions session-preview-actions">
271
256
  <div class="session-secondary-actions">
272
- <button class="btn-session-refresh has-label" @click="loadActiveSessionDetail" :disabled="sessionDetailLoading || !activeSession"
257
+ <button class="btn-session-refresh has-label session-action-optional-label" @click="loadActiveSessionDetail" :disabled="sessionDetailLoading || !activeSession"
273
258
  :title="sessionDetailLoading ? t('sessions.preview.loading') : t('sessions.preview.refresh')"
274
259
  :aria-label="sessionDetailLoading ? t('sessions.preview.loading') : t('sessions.preview.refresh')">
275
- <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>
276
- <span class="session-action-label">{{ t('sessions.preview.refresh') }}</span>
277
- </button>
260
+ <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>
261
+ <span class="session-action-label session-action-optional-text">{{ t('sessions.preview.refresh') }}</span>
262
+ </button>
278
263
  <div class="session-link-group"><button
279
264
  class="btn-session-open"
280
265
  @click="copySessionLink(activeSession)"
@@ -291,29 +276,38 @@
291
276
  <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>
292
277
  </button></div>
293
278
  <button
294
- class="btn-session-open has-label"
279
+ class="btn-session-open has-label session-action-optional-label"
295
280
  @click="copySessionPath(activeSession)"
296
281
  :disabled="!activeSession || !getSessionFilePath(activeSession)"
297
282
  :title="t('sessions.preview.copyPath')"
298
283
  :aria-label="t('sessions.preview.copyPath')">
299
- <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>
300
- <span class="session-action-label">{{ t('sessions.preview.copyPath') }}</span>
284
+ <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>
285
+ <span class="session-action-label session-action-optional-text">{{ t('sessions.preview.copyPath') }}</span>
301
286
  </button>
302
287
  </div>
303
- <div class="session-danger-action"><button
288
+ <div class="session-primary-actions">
289
+ <button
290
+ class="btn-session-export has-label"
291
+ @click="exportSession(activeSession)"
292
+ :disabled="!activeSession || sessionExporting[getSessionExportKey(activeSession)]"
293
+ :title="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')"
294
+ :aria-label="(activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export')">
295
+ <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>
296
+ <span class="session-action-label">{{ (activeSession && sessionExporting[getSessionExportKey(activeSession)]) ? t('sessions.preview.exporting') : t('sessions.preview.export') }}</span>
297
+ </button>
298
+ <button
304
299
  v-if="isDeleteAvailable(activeSession)"
305
- class="btn-session-delete has-label"
300
+ class="btn-session-delete has-label session-delete-text-button"
306
301
  @click="deleteSession(activeSession)"
307
302
  :disabled="!activeSession || sessionsLoading || sessionDeleting[getSessionExportKey(activeSession)]"
308
303
  :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'))"
309
304
  :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'))">
310
- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 4 4 4 13 4"/><path d="M5.5 4V2.5a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1V4"/><path d="M12 4v9.5a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 4 13.5V4"/></svg>
311
- <span class="session-action-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')) }}</span>
312
- </button></div>
305
+ <span class="session-action-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')) }}</span>
306
+ </button>
307
+ </div>
313
308
  </div>
314
309
  </div>
315
310
  <div class="session-export-feedback">
316
- <small id="session-export-scope">{{ t('sessions.export.scopeHint') }}</small>
317
311
  <p v-if="sessionExportNotice && sessionExportNotice.key === getSessionExportKey(activeSession)" class="session-export-notice" role="status">{{ t('sessions.export.truncated') }}</p>
318
312
  </div>
319
313
 
@@ -465,9 +459,14 @@
465
459
  </button>
466
460
  </div>
467
461
  <aside v-if="sessionPreviewRenderEnabled && sessionTimelineNodes.length" :class="['session-timeline', 'session-timeline-' + sessionTimelineStyle]" :aria-label="t('sessions.timeline.aria')">
468
- <!-- 点状模式 -->
469
- <template v-if="sessionTimelineStyle === 'dots'">
470
- <div class="session-timeline-track"></div>
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')">
471
470
  <button
472
471
  v-for="node in sessionTimelineNodes"
473
472
  :key="'timeline-' + node.key"
@@ -475,39 +474,21 @@
475
474
  type="button"
476
475
  :class="['session-timeline-node', { active: sessionTimelineActiveKey === node.key }]"
477
476
  :aria-current="sessionTimelineActiveKey === node.key ? 'true' : null"
478
- :style="{ top: `${node.safePercent}%` }"
479
477
  :title="node.title"
478
+ :aria-label="node.title"
480
479
  @click="jumpToSessionTimelineNode(node.key)">
481
- <span class="sr-only">{{ node.title }}</span>
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>
482
486
  </button>
483
- <div class="session-timeline-current" v-if="sessionTimelineActiveTitle">
484
- {{ sessionTimelineActiveTitle }}
485
- </div>
486
- </template>
487
-
488
- <!-- 条状模式 -->
489
- <template v-else>
490
- <div class="session-timeline-bar-track">
491
- <div class="session-timeline-bar-progress"
492
- :style="{ height: sessionTimelineProgressPercent + '%' }">
493
- </div>
494
- </div>
495
- <button
496
- v-for="node in sessionTimelineNodes"
497
- :key="'timeline-bar-' + node.key"
498
- v-memo="[sessionTimelineActiveKey === node.key, node.safePercent, node.title]"
499
- type="button"
500
- :class="['session-timeline-bar-node', { active: sessionTimelineActiveKey === node.key }]"
501
- :aria-current="sessionTimelineActiveKey === node.key ? 'true' : null"
502
- :style="{ top: `${node.safePercent}%` }"
503
- :title="node.title"
504
- @click="jumpToSessionTimelineNode(node.key)">
505
- <span class="sr-only">{{ node.title }}</span>
506
- </button>
507
- <div class="session-timeline-current" v-if="sessionTimelineActiveTitle">
508
- {{ sessionTimelineActiveTitle }}
509
- </div>
510
- </template>
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>
511
492
  </aside>
512
493
  </template>
513
494
 
@@ -29,6 +29,8 @@
29
29
  </div>
30
30
  </section>
31
31
 
32
+ <section class="trash-content-section" :aria-label="t('settings.trash.title')">
33
+
32
34
  <!-- Disabled state -->
33
35
  <div v-if="getSessionTrashViewState() === 'disabled'" class="trash-empty-state trash-disabled-state">
34
36
  <svg class="trash-empty-svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="1.2">
@@ -114,5 +116,6 @@
114
116
  </div>
115
117
  </div>
116
118
  </template>
119
+ </section>
117
120
  </div>
118
121
  </div>
@@ -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>