codexmate 0.1.33 → 0.1.35

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 (91) hide show
  1. package/README.md +27 -2
  2. package/README.vi.md +27 -2
  3. package/README.zh.md +27 -2
  4. package/cli/analytics-export-args.js +7 -0
  5. package/cli/local-bridge.js +10 -6
  6. package/cli/openai-chat-routing.js +38 -0
  7. package/cli/routing-bridge.js +143 -0
  8. package/cli/session-usage.js +4 -1
  9. package/cli/system-prompt-files.js +75 -53
  10. package/cli.js +191 -9
  11. package/lib/data/model-prices.json +1868 -0
  12. package/lib/file-sharing-lan.js +111 -0
  13. package/lib/file-sharing.js +196 -0
  14. package/lib/model-test-client.js +61 -0
  15. package/lib/model-test.js +126 -0
  16. package/lib/routing-groups.js +161 -0
  17. package/lib/session-context-health.js +5 -1
  18. package/lib/session-evidence-collections.js +85 -0
  19. package/lib/session-features.js +15 -0
  20. package/lib/session-project-git.js +65 -0
  21. package/lib/session-projects.js +12 -1
  22. package/lib/session-stories.js +67 -0
  23. package/lib/session-usage-ledger.js +77 -0
  24. package/lib/session-usage-pricing.js +42 -0
  25. package/lib/session-usage-report.js +101 -0
  26. package/package.json +4 -1
  27. package/plugins/file-sharing/manifest.mjs +10 -0
  28. package/plugins/file-sharing/methods.mjs +101 -0
  29. package/plugins/file-sharing/overview.mjs +3 -0
  30. package/plugins/file-sharing/ownership.mjs +5 -0
  31. package/plugins/prompt-templates/computed.mjs +9 -0
  32. package/plugins/registry.mjs +3 -0
  33. package/web-ui/app.js +25 -2
  34. package/web-ui/index.html +3 -2
  35. package/web-ui/logic.session-artifacts.mjs +39 -0
  36. package/web-ui/modules/app.computed.main-tabs.mjs +3 -0
  37. package/web-ui/modules/app.methods.agents.mjs +14 -1
  38. package/web-ui/modules/app.methods.install.mjs +23 -3
  39. package/web-ui/modules/app.methods.navigation.mjs +2 -0
  40. package/web-ui/modules/app.methods.prompts-editor.mjs +7 -4
  41. package/web-ui/modules/app.methods.session-actions.mjs +2 -2
  42. package/web-ui/modules/app.methods.session-browser.mjs +35 -0
  43. package/web-ui/modules/app.methods.system-prompt.mjs +99 -19
  44. package/web-ui/modules/app.methods.theme.mjs +4 -3
  45. package/web-ui/modules/app.methods.web-ui-preferences.mjs +12 -0
  46. package/web-ui/modules/i18n/locales/en.mjs +239 -5
  47. package/web-ui/modules/i18n/locales/ja.mjs +239 -5
  48. package/web-ui/modules/i18n/locales/vi.mjs +239 -5
  49. package/web-ui/modules/i18n/locales/zh-tw.mjs +239 -5
  50. package/web-ui/modules/i18n/locales/zh.mjs +239 -5
  51. package/web-ui/modules/model-test.mjs +82 -0
  52. package/web-ui/modules/plugins.methods.mjs +3 -1
  53. package/web-ui/modules/prompt-ecosystem.methods.mjs +4 -3
  54. package/web-ui/modules/routing.mjs +206 -0
  55. package/web-ui/modules/session-collections.mjs +65 -0
  56. package/web-ui/modules/session-evidence.mjs +81 -0
  57. package/web-ui/modules/session-features.mjs +15 -1
  58. package/web-ui/modules/session-git.mjs +39 -0
  59. package/web-ui/modules/session-stories.mjs +64 -0
  60. package/web-ui/modules/usage-pricing.mjs +30 -0
  61. package/web-ui/partials/index/layout-footer.html +1 -1
  62. package/web-ui/partials/index/layout-header.html +33 -12
  63. package/web-ui/partials/index/modals-basic.html +15 -0
  64. package/web-ui/partials/index/panel-plugins.html +3 -9
  65. package/web-ui/partials/index/panel-prompts.html +13 -7
  66. package/web-ui/partials/index/panel-routing.html +3 -0
  67. package/web-ui/partials/index/panel-sessions.html +20 -20
  68. package/web-ui/partials/index/panel-settings.html +11 -1
  69. package/web-ui/partials/index/panel-usage.html +2 -0
  70. package/web-ui/partials/index/plugin-file-sharing.html +47 -0
  71. package/web-ui/partials/index/routing-model-test.html +53 -0
  72. package/web-ui/partials/index/session-diagnostics.html +7 -4
  73. package/web-ui/partials/index/session-features.html +82 -2
  74. package/web-ui/partials/index/thread-handoff.html +73 -62
  75. package/web-ui/partials/index/usage-records.html +41 -0
  76. package/web-ui/res/web-ui-render.precompiled.js +1378 -230
  77. package/web-ui/styles/base-theme.css +1 -1
  78. package/web-ui/styles/modals-core.css +6 -5
  79. package/web-ui/styles/navigation-panels.css +4 -0
  80. package/web-ui/styles/plugins-panel.css +40 -1
  81. package/web-ui/styles/responsive.css +10 -5
  82. package/web-ui/styles/routing.css +78 -0
  83. package/web-ui/styles/session-features.css +180 -7
  84. package/web-ui/styles/sessions-list.css +74 -0
  85. package/web-ui/styles/sessions-preview.css +106 -68
  86. package/web-ui/styles/sessions-usage.css +8 -0
  87. package/web-ui/styles/settings-panel.css +30 -0
  88. package/web-ui/styles/system-prompt.css +8 -7
  89. package/web-ui/styles/theme-violet-tokens.css +52 -0
  90. package/web-ui/styles/theme-violet.css +1742 -0
  91. package/web-ui/styles.css +2 -0
@@ -190,14 +190,6 @@
190
190
  {{ parseSessionTitleInfo(session).location }}
191
191
  </div>
192
192
  </div>
193
- <span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
194
- <span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
195
- <span
196
- v-if="sessionContextUtilization[getSessionExportKey(session)] && sessionContextUtilization[getSessionExportKey(session)].percent > 0"
197
- :class="['session-context-badge', 'session-context-' + sessionContextUtilization[getSessionExportKey(session)].level]"
198
- :title="'Context: ' + sessionContextUtilization[getSessionExportKey(session)].percent + '%'">
199
- {{ sessionContextUtilization[getSessionExportKey(session)].percent }}%
200
- </span>
201
193
  </div>
202
194
  <div class="session-item-actions">
203
195
  <button
@@ -231,6 +223,14 @@
231
223
  <div class="session-item-meta">
232
224
  <span class="session-source" :data-source="session.source">{{ session.sourceLabel }}</span>
233
225
  <span class="session-item-time">{{ session.updatedAtLabel || session.updatedAt || t('sessions.unknownTime') }}</span>
226
+ <span class="session-count-badge">{{ session.messageCount == null ? '...' : session.messageCount }}</span>
227
+ <span v-if="session.match && session.match.hit" class="session-match-badge">{{ session.match.count }}</span>
228
+ <span
229
+ v-if="sessionContextUtilization[getSessionExportKey(session)] && sessionContextUtilization[getSessionExportKey(session)].percent > 0"
230
+ :class="['session-context-badge', 'session-context-' + sessionContextUtilization[getSessionExportKey(session)].level]"
231
+ :title="'Context: ' + sessionContextUtilization[getSessionExportKey(session)].percent + '%'">
232
+ {{ sessionContextUtilization[getSessionExportKey(session)].percent }}%
233
+ </span>
234
234
  <span v-if="getSessionHotLabel(session)" class="session-item-hot">{{ getSessionHotLabel(session) }}</span>
235
235
  <div v-if="session.match && session.match.snippets && session.match.snippets.length" class="session-match-snippets">
236
236
  <div v-for="(snip, si) in session.match.snippets.slice(0, 2)" :key="si" class="session-match-snippet">{{ snip }}</div>
@@ -428,20 +428,20 @@
428
428
  <span class="session-msg-role">{{ msg.roleLabel || (msg.normalizedRole === 'user' ? t('sessions.roleLabel.user') : (msg.normalizedRole === 'system' ? t('sessions.roleLabel.system') : t('sessions.roleLabel.assistant'))) }}</span>
429
429
  <span class="session-msg-time">{{ msg.timestamp || '' }}</span>
430
430
  </div>
431
+ <button
432
+ v-if="msg.normalizedRole === 'user'"
433
+ type="button"
434
+ class="session-msg-copy"
435
+ @click="copySessionMessage(msg)"
436
+ :aria-label="t('sessions.preview.copyMessage')"
437
+ :title="t('sessions.preview.copyMessage')">
438
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
439
+ <rect x="8" y="8" width="12" height="12" rx="2"></rect>
440
+ <path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"></path>
441
+ </svg>
442
+ </button>
431
443
  </div>
432
444
  <div class="session-msg-content" v-html="msg.text || ''"></div>
433
- <button
434
- v-if="msg.normalizedRole === 'user'"
435
- type="button"
436
- class="session-msg-copy"
437
- @click="copySessionMessage(msg)"
438
- :aria-label="t('sessions.preview.copyMessage')"
439
- :title="t('sessions.preview.copyMessage')">
440
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
441
- <rect x="8" y="8" width="12" height="12" rx="2"></rect>
442
- <path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"></path>
443
- </svg>
444
- </button>
445
445
  </div>
446
446
  <div v-if="canLoadMoreSessionMessages" class="session-preview-load-more">
447
447
  <span>{{ t('sessions.preview.shownCount', { shown: activeSessionVisibleMessages.length, total: activeSessionMessages.length }) }}</span>
@@ -64,25 +64,35 @@
64
64
  <div class="settings-card-main">
65
65
  <div class="settings-card-content">
66
66
  <div class="settings-card-title">{{ t('settings.theme.title') }}</div>
67
- <div class="settings-toggle-group">
67
+ <div class="settings-toggle-group settings-theme-options">
68
68
  <button
69
69
  type="button"
70
70
  :class="['toggle-btn', { active: theme === 'light' }]"
71
+ :aria-pressed="theme === 'light'"
71
72
  @click="setTheme('light')">
72
73
  {{ t('settings.theme.light') }}
73
74
  </button>
74
75
  <button
75
76
  type="button"
76
77
  :class="['toggle-btn', { active: theme === 'dark' }]"
78
+ :aria-pressed="theme === 'dark'"
77
79
  @click="setTheme('dark')">
78
80
  {{ t('settings.theme.dark') }}
79
81
  </button>
80
82
  <button
81
83
  type="button"
82
84
  :class="['toggle-btn', { active: theme === 'ocean' }]"
85
+ :aria-pressed="theme === 'ocean'"
83
86
  @click="setTheme('ocean')">
84
87
  {{ t('settings.theme.ocean') }}
85
88
  </button>
89
+ <button
90
+ type="button"
91
+ :class="['toggle-btn', { active: theme === 'violet' }]"
92
+ :aria-pressed="theme === 'violet'"
93
+ @click="setTheme('violet')">
94
+ {{ t('settings.theme.violet') }}
95
+ </button>
86
96
  </div>
87
97
  </div>
88
98
  </div>
@@ -17,6 +17,8 @@
17
17
  </div>
18
18
  </div>
19
19
 
20
+ <!-- @include ./usage-records.html -->
21
+
20
22
  <div v-if="sessionsUsageLoading && !sessionsUsageList.length" class="usage-empty-state">
21
23
  <div class="usage-empty-illustration">
22
24
  <svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -0,0 +1,47 @@
1
+ <div v-else-if="pluginsActiveId === 'file-sharing'" class="plugins-panel" id="plugin-file-sharing">
2
+ <div class="plugins-panel-head">
3
+ <div class="plugins-panel-title">{{ t('plugins.fileSharing.title') }}</div>
4
+ <div class="file-sharing-actions">
5
+ <button type="button" class="btn-mini" :disabled="fileSharingBusy" @click="$refs.fileSharingFiles.click()">{{ t('plugins.fileSharing.chooseFiles') }}</button>
6
+ <button type="button" class="btn-mini" :disabled="fileSharingBusy" @click="$refs.fileSharingFolder.click()">{{ t('plugins.fileSharing.chooseFolder') }}</button>
7
+ <button type="button" class="btn-mini" :disabled="fileSharingBusy" @click="refreshFileSharing">{{ t('common.refresh') }}</button>
8
+ </div>
9
+ </div>
10
+ <input ref="fileSharingFiles" id="file-sharing-files" type="file" multiple hidden @change="selectFileSharingItems($event, false)">
11
+ <input ref="fileSharingFolder" id="file-sharing-folder" type="file" webkitdirectory hidden @change="selectFileSharingItems($event, true)">
12
+ <p v-if="fileSharingError" role="alert" class="state-message error">{{ fileSharingError }}</p>
13
+ <div v-if="fileSharingPending" class="file-sharing-pending">
14
+ <p class="plugins-panel-note">{{ t('plugins.fileSharing.confirm') }}</p>
15
+ <ul class="file-sharing-items" aria-live="polite">
16
+ <li v-for="(file, index) in fileSharingPending.entries" :key="index" dir="auto">{{ file.name }}</li>
17
+ </ul>
18
+ <div class="file-sharing-actions">
19
+ <button type="button" class="btn-mini" id="upload-file-sharing" :disabled="fileSharingBusy" @click="uploadFileSharingItems">{{ t('plugins.fileSharing.upload') }}</button>
20
+ <button type="button" class="btn-mini" id="cancel-file-sharing" :disabled="fileSharingBusy" @click="fileSharingPending = null">{{ t('common.cancel') }}</button>
21
+ </div>
22
+ </div>
23
+ <p v-if="fileSharingBusy" role="status" class="plugins-panel-note">{{ t('common.loading') }}</p>
24
+ <p v-else-if="!fileSharingBatches.length" class="skills-empty-state">{{ t('plugins.fileSharing.empty') }}</p>
25
+ <ul v-if="fileSharingBatches.length" class="file-sharing-items file-sharing-batches">
26
+ <li v-for="batch in fileSharingBatches" :key="batch.id">
27
+ <div class="file-sharing-row">
28
+ <strong dir="auto">{{ batch.folder || t('plugins.fileSharing.files', { count: batch.files.length }) }}</strong>
29
+ <button type="button" class="btn-mini file-sharing-icon file-sharing-remove" :aria-label="t('plugins.fileSharing.remove')" :title="t('plugins.fileSharing.remove')" :disabled="fileSharingBusy" @click="removeFileSharingBatch(batch.id)">
30
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6m5 4v6m4-6v6"/></svg>
31
+ </button>
32
+ </div>
33
+ <ul class="file-sharing-items">
34
+ <li v-for="(file, index) in batch.files" :key="index" class="file-sharing-row">
35
+ <span dir="auto">{{ file.name }}</span>
36
+ <span class="file-sharing-size">{{ t('plugins.fileSharing.bytes', { size: file.size }) }}</span>
37
+ <a class="btn-mini file-sharing-icon" :aria-label="t('plugins.fileSharing.download')" :title="t('plugins.fileSharing.download')" :href="fileSharingDownloadUrl(batch.id, index)" download referrerpolicy="no-referrer">
38
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4"/></svg>
39
+ </a>
40
+ <button type="button" class="btn-mini file-sharing-icon file-sharing-copy" :aria-label="t('plugins.fileSharing.copyLink')" :title="t('plugins.fileSharing.copyLink')" :disabled="fileSharingBusy" @click="copyFileSharingLink(batch.id, index)">
41
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" focusable="false"><path d="M10 13a4 4 0 0 0 6 .5l3-3a4 4 0 0 0-5.5-5.5l-1.7 1.7m2.2 4.3a4 4 0 0 0-6-.5l-3 3a4 4 0 0 0 5.5 5.5l1.7-1.7"/></svg>
42
+ </button>
43
+ </li>
44
+ </ul>
45
+ </li>
46
+ </ul>
47
+ </div>
@@ -0,0 +1,53 @@
1
+ <div class="routing-test">
2
+ <form novalidate @submit.prevent="runModelTest" :aria-busy="modelTestRunning">
3
+ <fieldset :disabled="modelTestRunning || modelTestLoading">
4
+ <legend class="routing-test-legend">{{ t('modelTest.selection') }}</legend>
5
+ <div class="routing-test-heading">
6
+ <div class="segmented-control" role="group" :aria-label="t('modelTest.source')">
7
+ <button v-for="target in ['codex', 'pi']" :key="target" type="button" :class="['segment', { active: modelTestTarget === target }]" :aria-pressed="modelTestTarget === target" @click="setModelTestTarget(target)">{{ target === 'codex' ? 'Codex' : 'Pi' }}</button>
8
+ </div>
9
+ <button type="button" class="btn-tool routing-icon-btn" :disabled="modelTestLoading || modelTestRunning" :aria-label="t('routing.refresh')" :title="t('routing.refresh')" @click="loadModelTestCatalog">
10
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" focusable="false"><path d="M20 7v5h-5M4 17v-5h5M6 7a7 7 0 0 1 12-1l2 3M4 15l2 3a7 7 0 0 0 12-1"/></svg>
11
+ </button>
12
+ </div>
13
+ <div class="routing-form-head">
14
+ <label class="routing-field"><span class="form-label">{{ t('routing.provider') }}</span>
15
+ <select class="model-select" v-model="modelTestProvider" @change="selectModelTestProvider">
16
+ <option value="" disabled>{{ t('routing.selectProvider') }}</option>
17
+ <option v-for="provider in modelTestProviders()" :key="provider.name" :value="provider.name">{{ provider.name }}</option>
18
+ </select>
19
+ </label>
20
+ <label class="routing-field"><span class="form-label">{{ t('routing.model') }}</span>
21
+ <select class="model-select" v-model="modelTestModel">
22
+ <option value="" disabled>{{ t('modelTest.selectModel') }}</option>
23
+ <option v-for="model in modelTestModels()" :key="model" :value="model">{{ model }}</option>
24
+ </select>
25
+ </label>
26
+ </div>
27
+ <p v-if="!modelTestLoading && !modelTestModels().length" class="routing-hint">{{ t('modelTest.empty') }} <button type="button" class="btn-tool" @click="switchConfigMode(modelTestTarget)">{{ t('routing.openConfig') }}</button></p>
28
+ <label class="routing-field routing-test-prompt"><span class="form-label">{{ t('modelTest.prompt') }}</span>
29
+ <textarea class="form-input" v-model="modelTestPrompt" rows="4" maxlength="8000"></textarea>
30
+ </label>
31
+ <div class="routing-test-actions">
32
+ <button type="submit" class="btn-tool btn-primary" :disabled="!modelTestPrompt.trim() || !modelTestModels().length">{{ t(modelTestRunning ? 'modelTest.running' : 'modelTest.run') }}</button>
33
+ </div>
34
+ </fieldset>
35
+ </form>
36
+ <p v-if="modelTestError" class="routing-error" role="alert">{{ modelTestError }}</p>
37
+ <div class="routing-test-response" aria-live="polite" :aria-busy="modelTestRunning">
38
+ <p v-if="modelTestLoading" class="routing-hint" role="status">{{ t('modelTest.loading') }}</p>
39
+ <template v-else-if="modelTestResult">
40
+ <div class="routing-test-result-head">
41
+ <strong>{{ modelTestResult.provider }} / {{ modelTestResult.responseModel || modelTestResult.model }}</strong>
42
+ <span class="routing-hint">{{ t(modelTestRunning ? 'modelTest.running' : modelTestResult.ok ? 'modelTest.completed' : 'modelTest.failed') }}<template v-if="!modelTestRunning"> · {{ modelTestDuration() }}</template></span>
43
+ </div>
44
+ <p class="routing-test-question">{{ modelTestResult.prompt }}</p>
45
+ <p v-if="!modelTestRunning && !modelTestResult.ok" class="routing-error" role="alert">{{ modelTestResult.error }}</p>
46
+ <template v-else-if="!modelTestRunning">
47
+ <div v-if="modelTestRenderedResponse.html" class="routing-test-answer" v-html="modelTestRenderedResponse.html"></div>
48
+ <p v-else class="routing-test-answer routing-test-plain">{{ modelTestResult.text }}</p>
49
+ <p v-if="modelTestResult.incomplete" class="routing-hint">{{ t('modelTest.incomplete') }}</p>
50
+ </template>
51
+ </template>
52
+ </div>
53
+ </div>
@@ -1,5 +1,8 @@
1
1
  <details class="session-features feature-diagnostics" @toggle="$event.target === $event.currentTarget && $event.currentTarget.open && loadDiagnosticTargets()">
2
- <summary class="feature-diagnostics-heading">{{ t('features.diagnostics') }}</summary>
2
+ <summary class="feature-diagnostics-heading">
3
+ <span>{{ t('features.diagnostics') }}</span>
4
+ <svg class="feature-diagnostics-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true" focusable="false"><path d="m9 5 7 7-7 7"/></svg>
5
+ </summary>
3
6
  <div class="feature-content">
4
7
  <p class="feature-hint">{{ t('features.diagnosticScope') }}</p>
5
8
  <p v-if="featureError" class="form-error feature-feedback" role="alert">{{ featureError }}</p>
@@ -8,8 +11,8 @@
8
11
  <label v-for="name in diagnosticsTargets" :key="name"><input type="checkbox" :value="name" v-model="diagnosticsSelected" :disabled="diagnosticsReport?.status === 'running'"><span>{{ name }}</span></label>
9
12
  </div>
10
13
  <div class="feature-actions feature-diagnostic-controls">
11
- <button type="button" class="btn-mini feature-primary" @click="startDiagnostics" :disabled="diagnosticsReport?.status === 'running'">{{ t('features.check') }}</button>
12
- <button v-if="diagnosticsReport?.status === 'running'" type="button" class="btn-mini feature-quiet" @click="cancelDiagnostics">{{ t('features.cancel') }}</button>
14
+ <button type="button" class="feature-button feature-primary" @click="startDiagnostics" :disabled="diagnosticsReport?.status === 'running'">{{ t('features.check') }}</button>
15
+ <button v-if="diagnosticsReport?.status === 'running'" type="button" class="feature-button feature-quiet" @click="cancelDiagnostics">{{ t('features.cancel') }}</button>
13
16
  <span v-if="diagnosticsReport" class="feature-status" :data-status="diagnosticsReport.status" role="status">{{ t('features.status.' + diagnosticsReport.status) }}</span>
14
17
  </div>
15
18
  <template v-if="diagnosticsReport">
@@ -23,7 +26,7 @@
23
26
  <p v-if="item.errorCode" class="form-error">{{ t('features.error.' + item.errorCode) }}</p>
24
27
  <details class="feature-disclosure"><summary>{{ t('features.technicalDetails') }}</summary><pre class="feature-code">{{ JSON.stringify(item.evidence || {}, null, 2) }}</pre></details>
25
28
  </article>
26
- <footer class="feature-record-actions feature-export-actions"><button type="button" class="btn-mini feature-quiet" @click="exportDiagnostics('json')">{{ t('features.exportJson') }}</button><button type="button" class="btn-mini feature-quiet" @click="exportDiagnostics('md')">{{ t('features.exportMarkdown') }}</button></footer>
29
+ <footer class="feature-record-actions feature-export-actions"><button type="button" class="feature-button feature-quiet" @click="exportDiagnostics('json')">{{ t('features.exportJson') }}</button><button type="button" class="feature-button feature-quiet" @click="exportDiagnostics('md')">{{ t('features.exportMarkdown') }}</button></footer>
27
30
  </template>
28
31
  </div>
29
32
  </details>
@@ -20,12 +20,18 @@
20
20
  <div v-if="indexReport" class="feature-meta" role="status">
21
21
  <span class="feature-status" :data-status="indexReport.job.status">{{ t('features.status.' + indexReport.job.status) }}</span>
22
22
  <span>{{ t('features.indexStatus', { count: indexReport.indexed, processed: indexReport.job.processed, total: indexReport.job.candidates }) }}</span>
23
+ <span class="feature-index-time">{{ t('features.indexCatalogTime', { time: indexCatalogTime }) }}</span>
23
24
  </div>
24
25
  <form class="feature-actions feature-search-form" @submit.prevent="searchSessionIndex">
25
26
  <input v-model="indexQuery" :aria-label="t('features.search')" :placeholder="t('features.search')">
26
27
  <button class="btn-mini feature-primary" :disabled="featureBusy || !indexQuery.trim() || !indexReport?.updatedAt">{{ t('features.search') }}</button>
27
28
  </form>
28
- <details class="feature-disclosure"><summary>{{ t('features.searchScope') }}</summary><p class="feature-hint">{{ t('features.indexScope') }}</p></details>
29
+ <details class="feature-disclosure feature-index-scope">
30
+ <summary>{{ t('features.searchScope') }}</summary>
31
+ <p class="feature-hint">{{ t('features.indexScope') }}</p>
32
+ <p v-for="entry in indexSourceCoverage" :key="entry.source" class="feature-hint feature-index-coverage">{{ t('features.indexSourceCoverage', { source: t('sessions.source.' + entry.source), count: entry.candidates ?? t('features.indexUnknown'), limit: entry.discoveryLimit ?? t('features.indexUnknown') }) }}</p>
33
+ <p v-if="!indexSourceCoverage.length" class="feature-hint feature-index-unknown">{{ t('features.indexCoverageUnknown') }}</p>
34
+ </details>
29
35
  <p v-if="indexReport?.failures.length" class="form-error" role="alert">{{ t('features.indexFailures', { count: indexReport.failures.length }) }}</p>
30
36
  <p v-if="featureBusy" class="feature-loading" role="status">{{ t('features.loading') }}</p>
31
37
  <template v-if="indexResults">
@@ -36,11 +42,48 @@
36
42
  <header class="feature-record-heading"><h4>{{ result.session.title || result.session.sessionId }}</h4><span class="feature-source">{{ result.session.source }}</span></header>
37
43
  <small class="feature-path" :title="result.session.cwd">{{ result.session.cwd }}</small>
38
44
  <pre class="feature-excerpt">{{ result.snippet }}</pre>
39
- <div class="feature-record-actions"><button type="button" class="btn-mini" @click="openIndexedMessage(result)">{{ t('features.source') }}</button></div>
45
+ <div class="feature-record-actions"><button type="button" class="btn-mini" @click="openIndexedMessage(result)">{{ t('features.source') }}</button><label class="evidence-select"><input type="checkbox" :checked="isEvidenceSelected(result)" @change="toggleEvidence(result)">{{ t('evidence.select') }}</label></div>
40
46
  <details class="feature-disclosure"><summary>{{ t('features.context') }}</summary><pre>{{ result.before }}</pre><pre>{{ result.after }}</pre></details>
41
47
  </article>
42
48
  </template>
43
49
  </div>
50
+ <details class="feature-disclosure evidence-collections" :open="collectionsOpen" @toggle="toggleCollections($event)">
51
+ <summary>{{ t('collections.title') }}</summary>
52
+ <p class="feature-hint">{{ t('collections.scope') }}</p>
53
+ <p v-if="collectionError" class="form-error" role="alert">{{ collectionError }}</p>
54
+ <p v-if="collectionBusy" role="status">{{ t('features.loading') }}</p>
55
+ <ol class="collection-list"><li v-for="item in collections" :key="item.id">
56
+ <button type="button" class="btn-mini" @click="openEvidenceCollection(item)" :disabled="collectionBusy || evidenceBusy" :aria-pressed="collectionId === item.id">{{ item.name }}</button>
57
+ <span class="feature-count">{{ item.references.length }}/100</span>
58
+ <button type="button" class="btn-mini feature-quiet" @click="removeEvidenceCollection(item)" :disabled="collectionBusy">{{ t('collections.remove') }}</button>
59
+ </li></ol>
60
+ <p v-if="!collectionBusy && !collections.length" class="feature-hint">{{ t('collections.empty') }}</p>
61
+ <form v-if="evidenceSelections.length" class="feature-editor collection-editor" @submit.prevent="saveEvidenceCollection(false)">
62
+ <label>{{ t('collections.name') }}<input v-model="collectionName" maxlength="160" required></label>
63
+ <div class="feature-actions">
64
+ <button class="btn-mini" :disabled="collectionBusy || evidenceBusy || !collectionName.trim()">{{ t('collections.save') }}</button>
65
+ <button v-if="collectionId" type="button" class="btn-mini feature-quiet" @click="saveEvidenceCollection(true)" :disabled="collectionBusy || evidenceBusy || !collectionName.trim()">{{ t('collections.saveAs') }}</button>
66
+ </div>
67
+ </form>
68
+ <button type="button" class="btn-mini feature-quiet" @click="loadEvidenceCollections" :disabled="collectionBusy">{{ t('collections.refresh') }}</button>
69
+ </details>
70
+ <section v-if="evidenceSelections.length" class="evidence-basket" :aria-label="t('evidence.title')">
71
+ <div class="feature-section-heading"><h3>{{ t('evidence.title') }}</h3><span class="feature-count">{{ evidenceSelections.length }}/100</span></div>
72
+ <p class="feature-hint">{{ t('evidence.memory') }}</p>
73
+ <ol class="evidence-list"><li v-for="item in evidenceSelections" :key="evidenceKey(item)"><span><strong>{{ item.session.title || item.session.sessionId }}</strong><small class="feature-meta">{{ item.session.source }} · {{ item.nodeId }}</small><small v-if="item.state" class="collection-source-state" :data-state="item.state">{{ t('collections.state.' + item.state) }}</small></span><button type="button" class="btn-mini feature-quiet" @click="openIndexedMessage(item)">{{ t('features.source') }}</button><button type="button" class="btn-mini" @click="toggleEvidence(item)">{{ t('evidence.remove') }}</button></li></ol>
74
+ <form class="feature-actions feature-search-form evidence-generator" @submit.prevent="generateEvidencePack">
75
+ <input v-model="evidenceGoal" :aria-label="t('evidence.goal')" :placeholder="t('evidence.goal')">
76
+ <select v-model="evidenceFormat" :aria-label="t('artifacts.format')">
77
+ <option value="evidence">{{ t('evidence.title') }}</option>
78
+ <option value="receipt">{{ t('artifacts.receipt') }}</option>
79
+ <option value="relay">{{ t('artifacts.relay') }}</option>
80
+ </select>
81
+ <textarea v-if="evidenceFormat !== 'evidence'" v-model="evidenceNote" class="evidence-generator-note" rows="3" maxlength="4000" :aria-label="t('artifacts.note')" :placeholder="t('artifacts.notePlaceholder')"></textarea>
82
+ <button class="btn-mini feature-primary" :disabled="evidenceBusy">{{ evidenceBusy ? t('features.loading') : evidenceFormat === 'evidence' ? t('evidence.generate') : t('artifacts.generate.' + evidenceFormat) }}</button>
83
+ </form>
84
+ <p v-if="evidenceError" class="form-error" role="alert">{{ evidenceError }}</p>
85
+ <details v-if="evidencePack" class="feature-disclosure evidence-preview" open><summary>{{ t('evidence.preview', { count: evidencePack.length }) }}</summary><pre>{{ evidencePack }}</pre><button type="button" class="btn-mini" @click="downloadEvidencePack">{{ t('evidence.download') }}</button></details>
86
+ </section>
44
87
  <div v-if="featureView === 'projects'" class="feature-content">
45
88
  <div class="feature-section-heading"><h3>{{ t('features.projects') }}</h3><small v-if="projectReport" class="feature-meta">{{ t('features.readAt', { time: projectReport.readAt }) }}</small></div>
46
89
  <p class="feature-hint">{{ t('features.projectHistory') }}</p>
@@ -56,6 +99,43 @@
56
99
  <template v-if="projectReport.detail">
57
100
  <div class="feature-section-heading feature-project-heading"><h4 class="feature-path" :title="projectReport.detail.cwd">{{ projectReport.detail.cwd || t('features.unassigned') }}</h4></div>
58
101
  <p v-if="projectReport.detail.truncated" class="feature-hint">{{ t('features.partial') }}</p>
102
+ <details v-if="projectSelected" class="feature-disclosure project-git" @toggle="toggleProjectGit($event)">
103
+ <summary>{{ t('git.title') }}</summary>
104
+ <p class="feature-hint">{{ t('git.scope') }}</p>
105
+ <p v-if="projectGitError" class="form-error" role="alert">{{ projectGitError }}</p>
106
+ <p v-if="projectGitBusy" role="status">{{ t('features.loading') }}</p>
107
+ <template v-if="projectGit">
108
+ <p class="feature-meta">{{ t('git.status.' + projectGit.status) }} · {{ t('features.readAt', { time: projectGit.readAt }) }}</p>
109
+ <template v-if="projectGit.root">
110
+ <p class="feature-path">{{ projectGit.root }}</p>
111
+ <p class="feature-meta">{{ projectGit.branch || t('git.detached') }} · <code>{{ projectGit.head || t('git.noHead') }}</code> · {{ t('git.changes', { count: projectGit.changedFiles }) }}</p>
112
+ <ul class="git-change-list"><li v-for="change in projectGit.changes" :key="change.path"><code>{{ change.status }}</code> {{ change.path }}</li></ul>
113
+ <p v-if="projectGit.changesTruncated || projectGit.commitsTruncated" class="feature-hint">{{ t('git.truncated') }}</p>
114
+ <ol class="git-commit-list"><li v-for="commit in projectGit.commits" :key="commit.sha"><button type="button" class="btn-mini" @click="loadProjectGitCommit(commit.sha)" :disabled="projectGitBusy"><code>{{ commit.sha.slice(0, 8) }}</code> {{ commit.subject }}</button><small class="feature-meta">{{ commit.timestamp }}</small><div class="feature-link-list"><button v-for="session in commit.candidates" :key="session.source + session.sessionId" type="button" @click="selectSession(session)">{{ t('git.candidate') }}: {{ session.source }} · {{ session.title || session.sessionId }}</button></div></li></ol>
115
+ <pre v-if="projectGitCommit" class="feature-code git-commit-stat">{{ projectGitCommit.sha }}
116
+ {{ projectGitCommit.stat }}</pre>
117
+ <section v-if="projectGitCommit" class="project-stories" :aria-label="t('stories.title')">
118
+ <h4>{{ t('stories.title') }}</h4>
119
+ <p class="feature-hint">{{ t('stories.scope') }}</p>
120
+ <p v-if="storyError" class="form-error" role="alert">{{ storyError }}</p>
121
+ <p v-if="storyBusy" role="status">{{ t('features.loading') }}</p>
122
+ <article v-for="item in commitStories" :key="item.id" class="story-record">
123
+ <p class="feature-meta">{{ t('stories.linked') }} · {{ item.session.source }}</p>
124
+ <button v-if="item.available" type="button" class="btn-mini" @click="selectSession(item.session)">{{ item.session.title || item.session.sessionId }}</button>
125
+ <p v-else class="feature-hint">{{ item.session.title || item.session.sessionId }} · {{ t('stories.unavailable') }}</p>
126
+ <p class="feature-note">{{ item.note }}</p>
127
+ <button type="button" class="btn-mini feature-quiet" @click="removeProjectStory(item)" :disabled="storyBusy">{{ t('stories.remove') }}</button>
128
+ </article>
129
+ <form class="feature-editor story-editor" @submit.prevent="saveProjectStory">
130
+ <label>{{ t('stories.session') }}<select v-model="storySession" :disabled="storyBusy"><option value="">{{ t('stories.choose') }}</option><option v-for="session in storySessions" :key="storySessionKey(session)" :value="storySessionKey(session)">{{ session.source }} · {{ session.title || session.sessionId }}</option></select></label>
131
+ <label>{{ t('stories.note') }}<textarea v-model="storyNote" maxlength="4000"></textarea></label>
132
+ <div class="feature-actions"><button class="btn-mini" :disabled="storyBusy || !storySession">{{ t('stories.save') }}</button><button type="button" class="btn-mini feature-quiet" @click="loadProjectStories" :disabled="storyBusy">{{ t('stories.refresh') }}</button></div>
133
+ </form>
134
+ </section>
135
+ </template>
136
+ </template>
137
+ <button type="button" class="btn-mini" @click="loadProjectGit" :disabled="projectGitBusy">{{ t('git.refresh') }}</button>
138
+ </details>
59
139
  <div class="feature-project-sessions">
60
140
  <article v-for="session in projectReport.detail.sessions" :key="session.source + session.sessionId" class="feature-session-row">
61
141
  <button type="button" @click="selectSession(session)">{{ session.title || session.sessionId }}</button>
@@ -1,62 +1,73 @@
1
- <details v-if="activeSession" :key="handoffSessionKey" class="session-workspace thread-handoff" :open="handoffExpanded" @toggle="toggleThreadHandoff" aria-label="会话交接">
2
- <summary class="thread-handoff-summary"><span>会话交接</span><span class="thread-handoff-summary-hint">{{ handoffExpanded ? '收起' : '填写交接 · 查看历史' }}</span></summary>
3
- <div v-if="handoffExpanded" class="thread-handoff-body">
4
- <div class="session-workspace-header session-workspace-card-wide">
5
- <p class="session-workspace-subtitle">草稿在切换会话后保留,刷新后清空。</p>
6
- <button class="btn-mini" type="button" @click="loadThreadHandoffs" :disabled="handoffLoading || handoffBusy">{{ handoffLoading ? '刷新中…' : '刷新历史' }}</button>
7
- </div>
8
- <form @submit.prevent="createThreadHandoff" class="thread-handoff-form">
9
- <label class="thread-handoff-field">
10
- <span class="session-workspace-card-title">交给谁 <small>必填</small></span>
11
- <input v-model="handoffDraft.target" class="session-query-input" required :disabled="handoffBusy" placeholder="目标代理标识,例如 claude">
12
- </label>
13
- <label class="thread-handoff-field">
14
- <span class="session-workspace-card-title">接下来做什么 <small>必填</small></span>
15
- <textarea v-model="handoffDraft.goal" class="session-query-input" rows="3" required :disabled="handoffBusy" placeholder="描述下一步任务、预期结果或验收标准"></textarea>
16
- </label>
17
- <details class="thread-handoff-optional">
18
- <summary class="thread-handoff-optional-summary">补充上下文</summary>
19
- <div class="session-workspace-grid">
20
- <label v-for="field in handoffFields" :key="field.key" class="thread-handoff-field">
21
- <span class="session-workspace-card-title">{{ field.label }}(可选)</span>
22
- <textarea v-model="handoffDraft[field.key]" class="session-query-input" rows="3" :disabled="handoffBusy" placeholder="每行填写一项"></textarea>
23
- </label>
24
- </div>
25
- </details>
26
- <div class="thread-handoff-actions">
27
- <button class="btn-mini thread-handoff-submit" type="submit" :disabled="handoffBusy || handoffLoading || !handoffDraft.target.trim() || !handoffDraft.goal.trim()">{{ handoffBusy ? '处理中…' : '生成交接' }}</button>
28
- </div>
29
- </form>
30
- <p v-if="handoffError" class="state-message error session-workspace-card-wide" role="alert">{{ handoffError }}</p>
31
- <p v-if="handoffNotice" class="state-message session-workspace-card-wide" role="status" aria-live="polite">{{ handoffNotice }}</p>
32
- <label v-if="handoffCopyText" class="session-workspace-card session-workspace-card-wide">
33
- <span class="session-workspace-card-title">卡片文本(未发送,可手动复制)</span>
34
- <textarea class="session-query-input" rows="6" readonly :value="handoffCopyText" @focus="$event.target.select()"></textarea>
35
- </label>
36
- <p class="session-workspace-subtitle session-workspace-card-wide">复制不会自动发送。读取确认由目标代理通过 CLI ack 提交。</p>
37
- <div class="feature-actions"><button type="button" class="btn-mini" @click="generateSelectedHandoff" :disabled="featureBusy || !selectedContextIds.length">{{ t('features.generateDraft', { count: selectedContextIds.length }) }}</button></div>
38
- <p v-if="handoffDraftEvidence.length">{{ t('features.draftReview') }}</p>
39
- <details v-if="handoffUnverified.length"><summary>{{ t('features.unverified', { count: handoffUnverified.length }) }}</summary><pre v-for="(text, index) in handoffUnverified" :key="index">{{ text }}</pre></details>
40
- <ul v-if="handoffDraftEvidence.length"><li v-for="item in handoffDraftEvidence" :key="item.nodeId"><button type="button" class="btn-mini" @click="locateDraftEvidence(item)">{{ item.nodeId }} · {{ t('features.evidence.' + item.status) }}</button></li></ul>
41
- <p v-if="handoffLoading" class="session-workspace-card-wide" role="status">正在加载交接历史…</p>
42
- <p v-else-if="!handoffError && !handoffRecords.length" class="session-workspace-empty session-workspace-card-wide">暂无交接记录</p>
43
- <ol v-if="handoffRecords.length" class="session-workspace-list session-workspace-card-wide">
44
- <li v-for="record in handoffRecords" :key="record.id" class="session-workspace-card">
45
- <div class="session-workspace-card-title">{{ record.target }} · {{ handoffStatusLabel(record.status) }}</div>
46
- <div>交接标识:<code>{{ record.id }}</code></div>
47
- <div>创建时间:{{ record.createdAt }} · 投递耗时:{{ record.durationMs }} 毫秒 · 写入耗时:{{ record.writeDurationMs || 0 }} 毫秒</div>
48
- <div>交接路径:{{ record.route === 'mcp' ? 'MCP 工具' : '文件级' }} · 文件回退:{{ record.fallback ? '是' : '否' }}</div>
49
- <div v-if="record.mcp">服务:{{ record.mcp.server }} · 工具:{{ record.mcp.tool }}</div>
50
- <div>写入结果:{{ record.writeResult === 'written' ? '已写入' : (record.writeResult === 'failed_or_unconfirmed' ? '失败或结果未确认(不重试)' : '未执行写入') }}</div>
51
- <div v-if="record.filePath">文件位置:<code>{{ record.filePath }}</code></div>
52
- <div v-if="record.reason">原因:{{ record.reason }}</div>
53
- <div v-if="record.readConfirmation">
54
- <div>读取代理:{{ record.readConfirmation.agent }} · 确认时间:{{ record.readConfirmation.at }}</div>
55
- <div>读取证据:{{ record.readConfirmation.evidence }}</div>
56
- </div>
57
- <div v-for="(warning, index) in record.discoveryWarnings || []" :key="index">探测提示:{{ warning.source }} · {{ warning.reason }}</div>
58
- <button class="btn-mini" type="button" @click="copyThreadHandoff(record)" :disabled="handoffBusy || handoffLoading">{{ record.route === 'mcp' ? '回退文件并复制卡片' : '复制卡片' }}</button>
59
- </li>
60
- </ol>
61
- </div>
62
- </details>
1
+ <details v-if="activeSession" :key="handoffSessionKey" class="session-workspace thread-handoff" :open="handoffExpanded" @toggle="toggleThreadHandoff" aria-label="会话交接">
2
+ <summary class="thread-handoff-summary"><span>会话交接</span><span class="thread-handoff-summary-hint">{{ handoffExpanded ? '收起' : '填写交接 · 查看历史' }}</span></summary>
3
+ <div v-if="handoffExpanded" class="thread-handoff-body">
4
+ <div class="session-workspace-header session-workspace-card-wide">
5
+ <p class="session-workspace-subtitle">草稿在切换会话后保留,刷新后清空。</p>
6
+ <button class="btn-mini" type="button" @click="loadThreadHandoffs" :disabled="handoffLoading || handoffBusy">{{ handoffLoading ? '刷新中…' : '刷新历史' }}</button>
7
+ </div>
8
+ <form @submit.prevent="createThreadHandoff" class="thread-handoff-form">
9
+ <label class="thread-handoff-field">
10
+ <span class="session-workspace-card-title">交给谁 <small>必填</small></span>
11
+ <input v-model="handoffDraft.target" class="session-query-input" required :disabled="handoffBusy" placeholder="目标代理标识,例如 claude">
12
+ </label>
13
+ <label class="thread-handoff-field">
14
+ <span class="session-workspace-card-title">接下来做什么 <small>必填</small></span>
15
+ <textarea v-model="handoffDraft.goal" class="session-query-input" rows="3" required :disabled="handoffBusy" placeholder="描述下一步任务、预期结果或验收标准"></textarea>
16
+ </label>
17
+ <details class="thread-handoff-optional">
18
+ <summary class="thread-handoff-optional-summary">补充上下文</summary>
19
+ <div class="session-workspace-grid">
20
+ <label v-for="field in handoffFields" :key="field.key" class="thread-handoff-field">
21
+ <span class="session-workspace-card-title">{{ field.label }}(可选)</span>
22
+ <textarea v-model="handoffDraft[field.key]" class="session-query-input" rows="3" :disabled="handoffBusy" placeholder="每行填写一项"></textarea>
23
+ </label>
24
+ </div>
25
+ </details>
26
+ <div class="thread-handoff-actions">
27
+ <button class="btn-mini thread-handoff-submit" type="submit" :disabled="handoffBusy || handoffLoading || !handoffDraft.target.trim() || !handoffDraft.goal.trim()">{{ handoffBusy ? '处理中…' : '生成交接' }}</button>
28
+ </div>
29
+ </form>
30
+ <p v-if="handoffError" class="state-message error session-workspace-card-wide" role="alert">{{ handoffError }}</p>
31
+ <p v-if="handoffNotice" class="state-message session-workspace-card-wide" role="status" aria-live="polite">{{ handoffNotice }}</p>
32
+ <label v-if="handoffCopyText" class="thread-handoff-copy session-workspace-card-wide">
33
+ <span class="session-workspace-card-title">卡片文本(未发送,可手动复制)</span>
34
+ <textarea class="session-query-input" rows="6" readonly :value="handoffCopyText" @focus="$event.target.select()"></textarea>
35
+ </label>
36
+ <p class="session-workspace-subtitle session-workspace-card-wide">复制不会自动发送。读取确认由目标代理通过 CLI ack 提交。</p>
37
+ <div v-if="selectedContextIds.length" class="feature-actions"><button type="button" class="btn-mini" @click="generateSelectedHandoff" :disabled="featureBusy || !selectedContextIds.length">{{ t('features.generateDraft', { count: selectedContextIds.length }) }}</button></div>
38
+ <p v-if="handoffDraftEvidence.length">{{ t('features.draftReview') }}</p>
39
+ <details v-if="handoffUnverified.length" class="thread-handoff-audit"><summary>{{ t('features.unverified', { count: handoffUnverified.length }) }}</summary><pre v-for="(text, index) in handoffUnverified" :key="index">{{ text }}</pre></details>
40
+ <ul v-if="handoffDraftEvidence.length" class="thread-handoff-evidence"><li v-for="item in handoffDraftEvidence" :key="item.nodeId"><button type="button" class="btn-mini" @click="locateDraftEvidence(item)">{{ item.nodeId }} · {{ t('features.evidence.' + item.status) }}</button></li></ul>
41
+ <section class="thread-handoff-history session-workspace-card-wide" aria-label="交接历史">
42
+ <h3>交接历史</h3>
43
+ <p v-if="handoffLoading" class="session-workspace-card-wide" role="status">正在加载交接历史…</p>
44
+ <p v-else-if="!handoffError && !handoffRecords.length" class="session-workspace-empty session-workspace-card-wide">暂无交接记录</p>
45
+ <ol v-if="handoffRecords.length" class="session-workspace-list session-workspace-card-wide">
46
+ <li v-for="record in handoffRecords" :key="record.id" class="session-workspace-card thread-handoff-record">
47
+ <div class="thread-handoff-record-heading">
48
+ <div class="thread-handoff-record-title"><strong>{{ record.target }}</strong><span class="thread-handoff-record-status">{{ handoffStatusLabel(record.status) }}</span></div>
49
+ <button class="btn-mini" type="button" @click="copyThreadHandoff(record)" :disabled="handoffBusy || handoffLoading">{{ record.route === 'mcp' ? '回退文件并复制卡片' : '复制卡片' }}</button>
50
+ </div>
51
+ <p class="thread-handoff-record-route">{{ record.route === 'mcp' ? 'MCP 工具' : '文件级' }} · {{ record.writeResult === 'written' ? '已写入' : (record.writeResult === 'failed_or_unconfirmed' ? '失败或结果未确认(不重试)' : '未执行写入') }}</p>
52
+ <p v-if="record.reason" class="thread-handoff-record-reason">原因:{{ record.reason }}</p>
53
+ <p v-if="record.readConfirmation" class="thread-handoff-read-proof">读取证据:<span>{{ record.readConfirmation.evidence }}</span></p>
54
+ <details class="thread-handoff-audit">
55
+ <summary>投递详情</summary>
56
+ <dl>
57
+ <div><dt>交接标识</dt><dd><code>{{ record.id }}</code></dd></div>
58
+ <div><dt>创建时间</dt><dd>{{ record.createdAt }}</dd></div>
59
+ <div><dt>投递耗时</dt><dd>{{ record.durationMs }} 毫秒</dd></div>
60
+ <div><dt>写入耗时</dt><dd>{{ record.writeDurationMs || 0 }} 毫秒</dd></div>
61
+ <div><dt>文件回退</dt><dd>{{ record.fallback ? '是' : '否' }}</dd></div>
62
+ <div v-if="record.mcp"><dt>MCP 服务</dt><dd>{{ record.mcp.server }} · {{ record.mcp.tool }}</dd></div>
63
+ <div v-if="record.filePath"><dt>文件位置</dt><dd><code>{{ record.filePath }}</code></dd></div>
64
+ <div v-if="record.readConfirmation"><dt>读取代理</dt><dd>{{ record.readConfirmation.agent }}</dd></div>
65
+ <div v-if="record.readConfirmation"><dt>确认时间</dt><dd>{{ record.readConfirmation.at }}</dd></div>
66
+ <div v-for="(warning, index) in record.discoveryWarnings || []" :key="index"><dt>探测提示</dt><dd>{{ warning.source }} · {{ warning.reason }}</dd></div>
67
+ </dl>
68
+ </details>
69
+ </li>
70
+ </ol>
71
+ </section>
72
+ </div>
73
+ </details>