dsh-chief 1.0.0 → 1.1.0

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/client.js CHANGED
@@ -22,16 +22,16 @@ window.__ModuleLoader__.load({
22
22
 
23
23
  const STATUSES = ['todo', 'doing', 'blocked', 'done']
24
24
  const STATUS_LABEL = { todo: '待推进', doing: '推进中', blocked: '受阻', done: '已完成' }
25
- const STATUS_BADGE = { todo: '○ 待推进', doing: '▶ 推进中', blocked: '⚠ 受阻', done: '✓ 已完成' }
25
+ const STATUS_BADGE = { todo: '○ 待推进', doing: '推进中', blocked: '⚠ 受阻', done: '✓ 已完成' }
26
26
  const STATUS_HEX = {
27
- todo: '#0a84ff',
28
- doing: '#ff9f0a',
27
+ todo: '#8e8e93',
28
+ doing: '#0a84ff',
29
29
  blocked: '#ff453a',
30
30
  done: '#30d158',
31
31
  }
32
32
  const STATUS_BG = {
33
- todo: 'rgba(10, 132, 255, 0.14)',
34
- doing: 'rgba(255, 159, 10, 0.18)',
33
+ todo: 'rgba(142, 142, 147, 0.16)',
34
+ doing: 'rgba(10, 132, 255, 0.16)',
35
35
  blocked: 'rgba(255, 69, 58, 0.18)',
36
36
  done: 'rgba(48, 209, 88, 0.15)',
37
37
  }
@@ -56,6 +56,13 @@ window.__ModuleLoader__.load({
56
56
  acc[c.key] = c.label
57
57
  return acc
58
58
  }, {})
59
+ const FACT_CAT_TONE = {
60
+ discipline: { bg: 'rgba(245, 158, 11, 0.16)', fg: '#fbbf24', border: 'rgba(245, 158, 11, 0.34)' },
61
+ preference: { bg: 'rgba(245, 158, 11, 0.16)', fg: '#fbbf24', border: 'rgba(245, 158, 11, 0.34)' },
62
+ architecture: { bg: 'rgba(10, 132, 255, 0.14)', fg: '#409cff', border: 'rgba(10, 132, 255, 0.30)' },
63
+ team: { bg: 'rgba(10, 132, 255, 0.14)', fg: '#409cff', border: 'rgba(10, 132, 255, 0.30)' },
64
+ progress: { bg: 'rgba(10, 132, 255, 0.14)', fg: '#409cff', border: 'rgba(10, 132, 255, 0.30)' },
65
+ }
59
66
 
60
67
  const RELAY_MODES = [
61
68
  { key: 'steer', label: '插话', hint: '正在运行时立即在下一步切入' },
@@ -79,7 +86,7 @@ window.__ModuleLoader__.load({
79
86
  const BOUND_LISTS = [
80
87
  { field: 'allowed', label: '允许事项', dot: '#30d158' },
81
88
  { field: 'forbidden', label: '禁止红线', dot: '#ff453a' },
82
- { field: 'notes', label: '注意事项', dot: '#ff9f0a' },
89
+ { field: 'notes', label: '注意事项', dot: '#f59e0b' },
83
90
  ]
84
91
  const BOUND_CAP = 20
85
92
 
@@ -162,6 +169,24 @@ window.__ModuleLoader__.load({
162
169
  chiefMeta: {
163
170
  paceMode: 'manual',
164
171
  autoPilot: false,
172
+ tacticalModes: {
173
+ intervention: false,
174
+ maxInterventionTurns: 5,
175
+ strictVerify: true,
176
+ autoCompact: false,
177
+ compactThresholdPct: 80,
178
+ redlineSentinel: false,
179
+ conciseBrief: true,
180
+ },
181
+ runtimeGuard: {
182
+ consecutiveInterventionTurns: 0,
183
+ lastInterventionSignature: '',
184
+ circuitBroken: false,
185
+ circuitReason: '',
186
+ lastCompactedSeq: 0,
187
+ lastCompactedAt: 0,
188
+ },
189
+ flippedCount: 0,
165
190
  modelRef: '',
166
191
  followModelRef: '',
167
192
  resolvedModelRef: '',
@@ -170,26 +195,42 @@ window.__ModuleLoader__.load({
170
195
  mailboxCount: 0,
171
196
  linkedPeersCount: 0,
172
197
  },
198
+ hostCompat: null,
199
+ hostCompatDismissed: false,
173
200
  secView: null,
174
201
  secBusy: false,
175
202
  secRegenerating: false,
176
203
  secSubTab: 'digest',
177
204
  secInput: '',
205
+ secImages: [],
206
+ secDragOver: false,
178
207
  secTarget: 'auto',
179
208
  secMode: 'steer',
180
209
  secLatestReply: null,
181
210
  secModelMenuOpen: false,
182
211
  secPaceMenuOpen: false,
212
+ tacticalMenuOpen: false,
213
+ interventionModalOpen: false,
214
+ interventionAgreed: false,
215
+ precipitateModal: null,
216
+ deployArchivePolicy: 'none',
217
+ deployDrawer: '',
218
+ planResetPrompt: null,
183
219
  secModelsCatalog: null,
184
220
  secNewFactText: '',
185
221
  secNewFactCat: 'discipline',
186
222
  secShowRawTurns: false,
187
223
  // Engineering Memory Filing Cabinet (档案柜 · Cold Lazy-Loaded Vault)
188
224
  archiveMeta: {
225
+ projectKey: '',
226
+ activeCabinetId: 'cab-main',
227
+ cabinetCount: 1,
189
228
  totalCount: 0,
190
229
  folderCount: 0,
191
230
  takenOutCount: 0,
192
231
  unorganizedCount: 0,
232
+ precipitatedCount: 0,
233
+ flippedCount: 0,
193
234
  },
194
235
  archiveLoaded: false,
195
236
  archiveLoading: false,
@@ -197,8 +238,17 @@ window.__ModuleLoader__.load({
197
238
  archiveOrganizeOpen: false,
198
239
  archiveOrganizeScope: 'unorganized',
199
240
  archiveOrganizePrompt: '',
241
+ archiveHarvesting: false,
242
+ archivePrecipitating: false,
243
+ archiveProjectKey: '',
244
+ archiveCabinetId: 'cab-main',
245
+ archiveCabinets: [],
200
246
  archiveFolders: [],
201
247
  archiveItems: [],
248
+ archivePrecipitated: [],
249
+ flippedPrecipitatedIds: [],
250
+ archiveNewCabinetOpen: false,
251
+ archiveNewCabinetName: '',
202
252
  archiveDetails: {},
203
253
  archiveDetailLoading: {},
204
254
  archiveOpenFolders: {},
@@ -632,7 +682,7 @@ window.__ModuleLoader__.load({
632
682
  const query = new URLSearchParams({ parent, mode })
633
683
  const url = 'dsh-resource://subagentchat/session/' + encodeURIComponent(agent.id) + '?' + query.toString()
634
684
  try {
635
- face.openResource(url, { revealIfOpened: true, preferSeparatePane: true })
685
+ face.openResource(url, { revealIfOpened: true, preferNewPane: true })
636
686
  return true
637
687
  } catch {
638
688
  try {
@@ -720,47 +770,48 @@ window.__ModuleLoader__.load({
720
770
  return tapAddTab(empty)
721
771
  }
722
772
 
723
- /** Fast corner-overlay clearance check (queries media elements only, never `querySelectorAll('*')`). */
724
- function reserveCornerSpace(node) {
725
- const none = { top: 0, bottom: 0 }
726
- if (!node || typeof document === 'undefined') return none
727
- const rect = node.getBoundingClientRect()
773
+ /**
774
+ * Horizontal-only clearance for fixed bottom-right desktop mascots overlapping the composer bar.
775
+ * Never reserves vertical top/bottom padding (fixes body center jump & bottom void bugs).
776
+ */
777
+ function reserveCornerSpace(panelNode, secBarNode) {
778
+ const none = { right: 0 }
779
+ if (!panelNode || typeof document === 'undefined' || typeof window === 'undefined') return none
780
+ const rect = panelNode.getBoundingClientRect()
728
781
  if (!rect.width || !rect.height) return none
729
782
 
730
- const rootOf = el => {
783
+ const barRect = secBarNode && typeof secBarNode.getBoundingClientRect === 'function'
784
+ ? secBarNode.getBoundingClientRect()
785
+ : { top: rect.bottom - 120, bottom: rect.bottom, left: rect.left, right: rect.right }
786
+
787
+ const winW = window.innerWidth || document.documentElement.clientWidth || 0
788
+ const winH = window.innerHeight || document.documentElement.clientHeight || 0
789
+ const isFixedOverlay = el => {
731
790
  for (let p = el; p && p !== document.body; p = p.parentElement) {
732
791
  const s = getComputedStyle(p)
733
- if (s.position === 'fixed' && Number(s.zIndex) >= 20) return p
792
+ if (s.position === 'fixed' && (Number(s.zIndex) >= 10 || s.zIndex === 'auto')) return true
734
793
  }
735
- return null
794
+ return false
736
795
  }
737
796
 
738
- let top = 0
739
- let bottom = 0
740
- const candidates = document.body.querySelectorAll('img, video, canvas')
797
+ let right = 0
798
+ const candidates = document.body.querySelectorAll('img, video, canvas, [data-mascot], [class*="mascot"], [class*="pet"]')
741
799
  for (const el of candidates) {
742
- if (node.contains(el)) continue
800
+ if (panelNode.contains(el)) continue
743
801
  const er = el.getBoundingClientRect()
744
- if (!er.width || !er.height) continue
745
- if (er.width * er.height > rect.width * rect.height * 0.55) continue
746
- const left = Math.max(er.left, rect.left)
747
- const right = Math.min(er.right, rect.right)
748
- const yTop = Math.max(er.top, rect.top)
749
- const yBot = Math.min(er.bottom, rect.bottom)
750
- if (!(left < right && yTop < yBot)) continue
802
+ if (er.width < 28 || er.height < 28 || er.width > 320 || er.height > 320) continue
803
+ if (er.bottom < winH - 60 || er.right < winW - 80) continue
804
+ const yOverlap = Math.min(er.bottom, barRect.bottom) - Math.max(er.top, barRect.top - 4)
805
+ if (yOverlap <= 0) continue
806
+ if (er.left >= rect.right - 4 || er.right <= rect.left) continue
751
807
  const cs = getComputedStyle(el)
752
808
  if (cs.display === 'none' || cs.visibility === 'hidden' || Number(cs.opacity) < 0.05) continue
753
- const root = rootOf(el)
754
- if (!root) continue
755
- if (er.top < rect.top + rect.height * 0.5) {
756
- top = Math.max(top, Math.round(er.bottom - rect.top))
757
- } else {
758
- bottom = Math.max(bottom, Math.round(rect.bottom - er.top))
759
- }
809
+ if (!isFixedOverlay(el)) continue
810
+ const needed = Math.ceil(rect.right - er.left + 8)
811
+ if (needed > right) right = needed
760
812
  }
761
813
  return {
762
- top: Math.max(0, Math.min(top, Math.round(rect.height * 0.3))),
763
- bottom: Math.max(0, Math.min(bottom, 160)),
814
+ right: Math.max(0, Math.min(right, Math.round(rect.width * 0.36), 148)),
764
815
  }
765
816
  }
766
817
 
@@ -782,12 +833,24 @@ window.__ModuleLoader__.load({
782
833
  || (store.chiefMeta && store.chiefMeta.followModelRef)
783
834
  || ''
784
835
  const resolvedRef = (modelsObj && modelsObj.resolvedRef) || pinnedRef || followRef || ''
836
+ const prevMeta = store.chiefMeta || {}
837
+ const cfg = (viewData && viewData.config && typeof viewData.config === 'object') ? viewData.config : {}
785
838
  patch({
786
839
  secView: viewData,
787
840
  ...(viewData.models ? { secModelsCatalog: viewData.models } : {}),
788
841
  chiefMeta: {
789
- paceMode: (viewData.config && viewData.config.paceMode) || 'manual',
790
- autoPilot: Boolean(viewData.config && viewData.config.autoPilot),
842
+ ...prevMeta,
843
+ paceMode: cfg.paceMode || 'manual',
844
+ autoPilot: Boolean(cfg.autoPilot),
845
+ tacticalModes: cfg.tacticalModes && typeof cfg.tacticalModes === 'object'
846
+ ? { ...(prevMeta.tacticalModes || {}), ...cfg.tacticalModes }
847
+ : (prevMeta.tacticalModes || {}),
848
+ runtimeGuard: viewData.runtimeGuard && typeof viewData.runtimeGuard === 'object'
849
+ ? viewData.runtimeGuard
850
+ : (prevMeta.runtimeGuard || {}),
851
+ flippedCount: Array.isArray(viewData.flippedPrecipitatedIds)
852
+ ? viewData.flippedPrecipitatedIds.length
853
+ : (prevMeta.flippedCount || 0),
791
854
  modelRef: pinnedRef,
792
855
  followModelRef: followRef,
793
856
  resolvedModelRef: resolvedRef,
@@ -818,6 +881,9 @@ window.__ModuleLoader__.load({
818
881
  if (value && value.agentIdentity) patch({ agentIdentity: value.agentIdentity })
819
882
  if (value && value.boundaries) patch({ boundaries: value.boundaries })
820
883
  if (value && value.chiefMeta) patch({ chiefMeta: { ...store.chiefMeta, ...value.chiefMeta } })
884
+ if (value && (value.hostCompat || (value.chiefMeta && value.chiefMeta.hostCompat))) {
885
+ patch({ hostCompat: value.hostCompat || value.chiefMeta.hostCompat })
886
+ }
821
887
  if (value && value.archiveMeta) patch({ archiveMeta: { ...store.archiveMeta, ...value.archiveMeta } })
822
888
  if (value && value.archives && Array.isArray(value.archives.items)) applyArchiveHeaders(value.archives)
823
889
  if (value && value.view) applySecView(value.view)
@@ -875,7 +941,15 @@ window.__ModuleLoader__.load({
875
941
  headers: { 'content-type': 'application/json' },
876
942
  body: JSON.stringify({ ...nextCfg, session: store.sessionId }),
877
943
  })
878
- if (typeof nextCfg.paceMode === 'string') {
944
+ if (nextCfg.emergencyStopIntervention) {
945
+ patch({ notice: '⏹ 已紧急关停「主动强介入」,自动驱动与巡检续跑已停机' })
946
+ } else if (nextCfg.tacticalModes && typeof nextCfg.tacticalModes === 'object') {
947
+ if (typeof nextCfg.tacticalModes.intervention === 'boolean' && Object.keys(nextCfg.tacticalModes).length === 1) {
948
+ patch({ notice: nextCfg.tacticalModes.intervention ? '⚡ 已开启「主动强介入」模式' : '已关闭「主动强介入」模式' })
949
+ } else {
950
+ patch({ notice: '✦ 已更新参谋长战术驾驶舱开关' })
951
+ }
952
+ } else if (typeof nextCfg.paceMode === 'string') {
879
953
  const paceNotice = nextCfg.paceMode === 'auto'
880
954
  ? '已切为「全自动托管」:节流巡检、跨窗递话与阶段摘要(5分钟冷却)'
881
955
  : nextCfg.paceMode === 'smart'
@@ -1020,12 +1094,122 @@ window.__ModuleLoader__.load({
1020
1094
  }
1021
1095
  }
1022
1096
 
1097
+ const SEC_IMAGE_MIMES = new Set(['image/png', 'image/jpeg', 'image/webp', 'image/gif'])
1098
+ const SEC_MAX_IMAGES = 4
1099
+
1100
+ function readBlobAsDataUrl(blob) {
1101
+ return new Promise((resolve, reject) => {
1102
+ const reader = new FileReader()
1103
+ reader.onload = () => resolve(String(reader.result || ''))
1104
+ reader.onerror = () => reject(reader.error || new Error('读取图片失败'))
1105
+ reader.readAsDataURL(blob)
1106
+ })
1107
+ }
1108
+
1109
+ function encodeImageForChief(file) {
1110
+ return readBlobAsDataUrl(file).then(rawUrl => new Promise((resolve, reject) => {
1111
+ const matchedMime = rawUrl.match(/^data:([^;]+);base64,/i)?.[1]
1112
+ const rawType = (String(file.type || '').toLowerCase() === 'image/jpg' ? 'image/jpeg' : String(file.type || '').toLowerCase())
1113
+ || (matchedMime || 'image/png').toLowerCase()
1114
+ const normType = rawType === 'image/jpg' ? 'image/jpeg' : rawType
1115
+ const extractB64 = url => {
1116
+ const m = String(url || '').match(/^data:([^;]+);base64,(.+)$/is)
1117
+ return m ? { mediaType: m[1].toLowerCase() === 'image/jpg' ? 'image/jpeg' : m[1].toLowerCase(), data: m[2] } : null
1118
+ }
1119
+ const makeItem = (parsed, previewUrl, fallbackName) => ({
1120
+ id: 'img-' + Date.now() + '-' + Math.random().toString(36).slice(2, 6),
1121
+ name: fallbackName || file.name || 'image.png',
1122
+ mediaType: parsed.mediaType,
1123
+ data: parsed.data,
1124
+ previewUrl,
1125
+ })
1126
+ if (normType === 'image/gif' || typeof Image === 'undefined') {
1127
+ const parsed = extractB64(rawUrl)
1128
+ if (!parsed) return reject(new Error('图片编码解析失败'))
1129
+ return resolve(makeItem(parsed, rawUrl, file.name || 'image.gif'))
1130
+ }
1131
+ const img = new Image()
1132
+ img.onload = () => {
1133
+ const w = img.naturalWidth || img.width || 0
1134
+ const h = img.naturalHeight || img.height || 0
1135
+ const maxSide = 2048
1136
+ const tooBigDim = w > maxSide || h > maxSide
1137
+ const tooHeavy = (file.size || 0) > 3.5 * 1024 * 1024
1138
+ if (!tooBigDim && !tooHeavy) {
1139
+ const parsed = extractB64(rawUrl)
1140
+ if (parsed) return resolve(makeItem(parsed, rawUrl))
1141
+ }
1142
+ try {
1143
+ const scale = tooBigDim ? Math.min(1, maxSide / Math.max(w, h)) : 1
1144
+ const tw = Math.max(1, Math.round(w * scale))
1145
+ const th = Math.max(1, Math.round(h * scale))
1146
+ const canvas = document.createElement('canvas')
1147
+ canvas.width = tw
1148
+ canvas.height = th
1149
+ const ctx = canvas.getContext('2d')
1150
+ if (!ctx) throw new Error('no 2d ctx')
1151
+ ctx.drawImage(img, 0, 0, tw, th)
1152
+ const outUrl = canvas.toDataURL('image/jpeg', 0.88)
1153
+ const parsed = extractB64(outUrl)
1154
+ if (!parsed) throw new Error('canvas encode empty')
1155
+ resolve(makeItem(parsed, outUrl, (file.name || 'image').replace(/\.[^.]+$/, '') + '.jpg'))
1156
+ } catch {
1157
+ const parsed = extractB64(rawUrl)
1158
+ if (!parsed) return reject(new Error('图片压缩失败'))
1159
+ resolve(makeItem(parsed, rawUrl))
1160
+ }
1161
+ }
1162
+ img.onerror = () => {
1163
+ const parsed = extractB64(rawUrl)
1164
+ if (parsed) resolve(makeItem(parsed, rawUrl))
1165
+ else reject(new Error('无法加载图片文件'))
1166
+ }
1167
+ img.src = rawUrl
1168
+ }))
1169
+ }
1170
+
1171
+ async function ingestSecImageFiles(fileList) {
1172
+ const incoming = Array.from(fileList || []).filter(f => {
1173
+ if (!f) return false
1174
+ const t = String(f.type || '').toLowerCase()
1175
+ if (t === 'image/jpg' || SEC_IMAGE_MIMES.has(t)) return true
1176
+ return /\.(png|jpe?g|webp|gif)$/i.test(String(f.name || ''))
1177
+ })
1178
+ if (!incoming.length) {
1179
+ patch({ notice: '仅支持 PNG / JPEG / WebP / GIF 格式图片' })
1180
+ return
1181
+ }
1182
+ const existing = Array.isArray(store.secImages) ? store.secImages : []
1183
+ const slots = Math.max(0, SEC_MAX_IMAGES - existing.length)
1184
+ if (!slots) {
1185
+ patch({ notice: `最多一次上传 ${SEC_MAX_IMAGES} 张图片` })
1186
+ return
1187
+ }
1188
+ const picked = incoming.slice(0, slots)
1189
+ if (incoming.length > slots) {
1190
+ patch({ notice: `单次最多 ${SEC_MAX_IMAGES} 张,已截取前 ${slots} 张` })
1191
+ }
1192
+ const encoded = []
1193
+ for (const file of picked) {
1194
+ try {
1195
+ encoded.push(await encodeImageForChief(file))
1196
+ } catch (err) {
1197
+ patch({ error: String((err && err.message) || err) })
1198
+ }
1199
+ }
1200
+ if (encoded.length) {
1201
+ const latest = Array.isArray(store.secImages) ? store.secImages : []
1202
+ patch({ secImages: [...latest, ...encoded].slice(0, SEC_MAX_IMAGES) })
1203
+ }
1204
+ }
1205
+
1023
1206
  async function submitChiefBar(overrideText = '') {
1024
1207
  const text = String(overrideText || store.secInput || '').trim()
1025
- if (!text || store.secBusy) return
1208
+ const imgs = overrideText ? [] : (Array.isArray(store.secImages) ? store.secImages : [])
1209
+ if ((!text && !imgs.length) || store.secBusy) return
1026
1210
  const target = overrideText ? 'auto' : (store.secTarget || 'auto')
1027
1211
  const mode = store.secMode || 'steer'
1028
- patch({ secBusy: true, ...(overrideText ? {} : { secInput: '' }), error: '' })
1212
+ patch({ secBusy: true, ...(overrideText ? {} : { secInput: '', secImages: [] }), error: '' })
1029
1213
  try {
1030
1214
  const value = await call('chief/ask', {
1031
1215
  method: 'POST',
@@ -1035,6 +1219,7 @@ window.__ModuleLoader__.load({
1035
1219
  text,
1036
1220
  target,
1037
1221
  mode,
1222
+ images: imgs.map(({ name, mediaType, data }) => ({ name, mediaType, data })),
1038
1223
  }),
1039
1224
  })
1040
1225
  if (value) {
@@ -1060,7 +1245,7 @@ window.__ModuleLoader__.load({
1060
1245
  }
1061
1246
  } catch (error) {
1062
1247
  patch({
1063
- ...(overrideText ? {} : { secInput: text }),
1248
+ ...(overrideText ? {} : { secInput: text, secImages: imgs }),
1064
1249
  error: String((error && error.message) || error),
1065
1250
  })
1066
1251
  } finally {
@@ -1072,6 +1257,13 @@ window.__ModuleLoader__.load({
1072
1257
  if (!payload || typeof payload !== 'object') return
1073
1258
  const folders = Array.isArray(payload.folders) ? payload.folders : store.archiveFolders
1074
1259
  const items = Array.isArray(payload.items) ? payload.items : store.archiveItems
1260
+ const cabinets = Array.isArray(payload.cabinets) ? payload.cabinets : store.archiveCabinets
1261
+ const activeCabinetId = payload.activeCabinetId || store.archiveCabinetId || 'cab-main'
1262
+ const projectKey = payload.projectKey || store.archiveProjectKey || ''
1263
+ const precipitated = Array.isArray(payload.precipitated) ? payload.precipitated : store.archivePrecipitated
1264
+ const flippedPrecipitatedIds = Array.isArray(payload.flippedPrecipitatedIds)
1265
+ ? payload.flippedPrecipitatedIds
1266
+ : store.flippedPrecipitatedIds
1075
1267
  const openFolders = { ...(store.archiveOpenFolders || {}) }
1076
1268
  // On very first open of the Filing Cabinet, gently open the first non-empty drawer so the user sees how paperclipped files sit inside
1077
1269
  if (!store.archiveLoaded && Object.keys(openFolders).length === 0) {
@@ -1111,21 +1303,28 @@ window.__ModuleLoader__.load({
1111
1303
  }
1112
1304
  patch({
1113
1305
  archiveLoaded: true,
1306
+ archiveProjectKey: projectKey,
1307
+ archiveCabinetId: activeCabinetId,
1308
+ archiveCabinets: cabinets,
1114
1309
  archiveFolders: folders,
1115
1310
  archiveItems: items,
1311
+ archivePrecipitated: precipitated,
1312
+ flippedPrecipitatedIds,
1116
1313
  archiveOpenFolders: openFolders,
1117
1314
  archiveDetails: nextDetails,
1118
1315
  })
1119
1316
  }
1120
1317
 
1121
1318
  /** Tier-1 Lazy Load: called ONLY when the user opens or refreshes the `档案` tab */
1122
- async function loadArchives(force = false) {
1319
+ async function loadArchives(force = false, cabinetIdOverride = '') {
1123
1320
  if (store.archiveLoading) return null
1124
- if (store.archiveLoaded && !force) return null
1321
+ if (store.archiveLoaded && !force && !cabinetIdOverride) return null
1125
1322
  patch({ archiveLoading: true, error: '' })
1126
1323
  try {
1127
1324
  const qs = new URLSearchParams()
1128
1325
  if (store.sessionId) qs.set('session', store.sessionId)
1326
+ const cid = cabinetIdOverride || store.archiveCabinetId || ''
1327
+ if (cid) qs.set('cabinetId', cid)
1129
1328
  const value = await call('archives' + (qs.toString() ? '?' + qs.toString() : ''))
1130
1329
  if (value && value.ok) {
1131
1330
  applyArchiveHeaders(value)
@@ -1145,7 +1344,7 @@ window.__ModuleLoader__.load({
1145
1344
  }
1146
1345
 
1147
1346
  /** Tier-2 Lazy Load: called ONLY when the user clicks a paperclipped dossier card to unfold its points */
1148
- async function loadArchiveDetail(archiveId, force = false) {
1347
+ async function loadArchiveDetail(archiveId, force = false, opts = {}) {
1149
1348
  const id = String(archiveId || '').trim()
1150
1349
  if (!id) return null
1151
1350
  if (!force && store.archiveDetails && store.archiveDetails[id]) {
@@ -1156,6 +1355,8 @@ window.__ModuleLoader__.load({
1156
1355
  try {
1157
1356
  const qs = new URLSearchParams({ id })
1158
1357
  if (store.sessionId) qs.set('session', store.sessionId)
1358
+ if (store.archiveCabinetId) qs.set('cabinetId', store.archiveCabinetId)
1359
+ if (opts && opts.precipitated) qs.set('precipitated', '1')
1159
1360
  const value = await call('archives/detail?' + qs.toString())
1160
1361
  if (value && value.ok && value.item) {
1161
1362
  patch({
@@ -1179,12 +1380,16 @@ window.__ModuleLoader__.load({
1179
1380
 
1180
1381
  async function mutateArchiveApi(payload, toastLabel = '') {
1181
1382
  try {
1383
+ const cabinetId = (payload && payload.cabinetId) || store.archiveCabinetId || 'cab-main'
1182
1384
  const value = await call('archives', {
1183
1385
  method: 'POST',
1184
1386
  headers: { 'content-type': 'application/json' },
1185
- body: JSON.stringify({ session: store.sessionId, ...payload }),
1387
+ body: JSON.stringify({ session: store.sessionId, cabinetId, ...payload }),
1186
1388
  })
1187
1389
  if (value && value.ok) {
1390
+ if (payload.op === 'switchCabinet' || payload.op === 'createCabinet' || payload.op === 'deleteCabinet') {
1391
+ patch({ archiveDetails: {}, archiveOpenFolders: {}, archiveOpenFiles: {} })
1392
+ }
1188
1393
  if (value.item && value.item.id) {
1189
1394
  patch({
1190
1395
  archiveDetails: {
@@ -1219,6 +1424,7 @@ window.__ModuleLoader__.load({
1219
1424
  headers: { 'content-type': 'application/json' },
1220
1425
  body: JSON.stringify({
1221
1426
  session: store.sessionId,
1427
+ cabinetId: opts.cabinetId || store.archiveCabinetId || 'cab-main',
1222
1428
  ids: Array.isArray(opts.ids) ? opts.ids : [],
1223
1429
  folder: opts.folder || '',
1224
1430
  scope: opts.scope || store.archiveOrganizeScope || 'unorganized',
@@ -1251,6 +1457,86 @@ window.__ModuleLoader__.load({
1251
1457
  }
1252
1458
  }
1253
1459
 
1460
+ async function harvestArchivesApi(focusHint = '') {
1461
+ if (store.archiveHarvesting) return null
1462
+ patch({ archiveHarvesting: true, error: '' })
1463
+ try {
1464
+ const value = await call('archives/harvest', {
1465
+ method: 'POST',
1466
+ headers: { 'content-type': 'application/json' },
1467
+ body: JSON.stringify({
1468
+ session: store.sessionId,
1469
+ cabinetId: store.archiveCabinetId || 'cab-main',
1470
+ focusHint,
1471
+ }),
1472
+ })
1473
+ if (value && value.ok) {
1474
+ patch({
1475
+ notice: value.count > 0
1476
+ ? `📥 已抢救 ${value.count} 份本轮对话工程细节入柜(防压缩失忆)`
1477
+ : '📥 当前对话暂无新增重要工程细节',
1478
+ })
1479
+ void loadArchives(true)
1480
+ }
1481
+ return value
1482
+ } catch (error) {
1483
+ patch({ error: String((error && error.message) || error) })
1484
+ return null
1485
+ } finally {
1486
+ patch({ archiveHarvesting: false })
1487
+ }
1488
+ }
1489
+
1490
+ async function precipitateArchivesApi(opts = {}) {
1491
+ if (store.archivePrecipitating) return null
1492
+ patch({ archivePrecipitating: true, error: '' })
1493
+ try {
1494
+ const value = await call('archives/precipitate', {
1495
+ method: 'POST',
1496
+ headers: { 'content-type': 'application/json' },
1497
+ body: JSON.stringify({
1498
+ session: store.sessionId,
1499
+ op: opts.op || 'cabinet',
1500
+ cabinetId: opts.cabinetId || store.archiveCabinetId || 'cab-main',
1501
+ folder: opts.folder || '',
1502
+ clearSource: Boolean(opts.clearSource),
1503
+ }),
1504
+ })
1505
+ if (value && value.ok) {
1506
+ patch({
1507
+ precipitateModal: null,
1508
+ notice: value.count > 0
1509
+ ? `⏬ 已提炼 ${value.count} 条可复用经验封入冷库(默认 0 Token 隔离)`
1510
+ : '⏬ 当前卷宗暂无更多可沉淀经验',
1511
+ })
1512
+ void loadArchives(true)
1513
+ }
1514
+ return value
1515
+ } catch (error) {
1516
+ patch({ error: String((error && error.message) || error) })
1517
+ return null
1518
+ } finally {
1519
+ patch({ archivePrecipitating: false })
1520
+ }
1521
+ }
1522
+
1523
+ async function approveGoalApi() {
1524
+ const value = await act({ action: 'goal.approve' })
1525
+ if (value && value.ok) patch({ notice: '✅ 已批准目标结项并切换回标准计划模式' })
1526
+ return value
1527
+ }
1528
+
1529
+ async function rejectGoalApi(reason) {
1530
+ const text = String(reason || '').trim()
1531
+ if (!text) {
1532
+ patch({ error: '请简短说明驳回原因与补充要求' })
1533
+ return null
1534
+ }
1535
+ const value = await act({ action: 'goal.reject', reason: text })
1536
+ if (value && value.ok) patch({ notice: '↩ 已驳回结项,目标督导将继续推进' })
1537
+ return value
1538
+ }
1539
+
1254
1540
  async function deliverArchiveToChat(headerOrDetail, point = null) {
1255
1541
  let detail = headerOrDetail
1256
1542
  if (!point && (!detail || !Array.isArray(detail.points))) {
@@ -1393,21 +1679,30 @@ window.__ModuleLoader__.load({
1393
1679
  }
1394
1680
  }
1395
1681
 
1396
- async function transfer(target) {
1682
+ async function transfer(target, opts = {}) {
1397
1683
  patch({ transferNote: '投递中…', error: '' })
1398
1684
  try {
1399
1685
  const value = await call('transfer', {
1400
1686
  method: 'POST',
1401
1687
  headers: { 'content-type': 'application/json' },
1402
- body: JSON.stringify({ target, session: store.sessionId, by: 'user' }),
1688
+ body: JSON.stringify({
1689
+ target,
1690
+ session: store.sessionId,
1691
+ by: 'user',
1692
+ deployChief: opts.deployChief !== false,
1693
+ archiveTransferPolicy: opts.archiveTransferPolicy || store.deployArchivePolicy || 'none',
1694
+ ...(opts.archiveDrawer || store.deployDrawer ? { archiveDrawer: opts.archiveDrawer || store.deployDrawer } : {}),
1695
+ ...(opts.toCabinetId ? { toCabinetId: opts.toCabinetId } : {}),
1696
+ ...(opts.customNote ? { customNote: opts.customNote } : {}),
1697
+ }),
1403
1698
  })
1404
1699
  const created = value && value.mode === 'created' && value.sessionId ? String(value.sessionId) : ''
1405
- let note = '已放入待领取队列'
1406
- if (value && value.mode === 'injected') note = '已投递至目标会话'
1700
+ let note = '已放入待领取队列(含参谋预部署)'
1701
+ if (value && value.mode === 'injected') note = '已投递至目标会话并部署参谋'
1407
1702
  if (created) {
1408
1703
  patch({ transferred: true })
1409
1704
  setTimeout(() => patch({ transferred: false }), 2000)
1410
- note = '已创建新会话 ' + shortSession(created)
1705
+ note = '已创建新会话 ' + shortSession(created) + ' 并部署参谋'
1411
1706
  if (navigation && typeof navigation.openSession === 'function') {
1412
1707
  try {
1413
1708
  navigation.openSession(created)
@@ -1420,8 +1715,10 @@ window.__ModuleLoader__.load({
1420
1715
  handoffText: value && value.text ? value.text : store.handoffText,
1421
1716
  })
1422
1717
  void loadTargets()
1718
+ return value
1423
1719
  } catch (error) {
1424
1720
  patch({ transferNote: '失败:' + String((error && error.message) || error) })
1721
+ return null
1425
1722
  }
1426
1723
  }
1427
1724
 
@@ -1699,6 +1996,12 @@ window.__ModuleLoader__.load({
1699
1996
  return h('svg', props,
1700
1997
  h('path', { d: 'm21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48' }),
1701
1998
  )
1999
+ case 'image':
2000
+ return h('svg', props,
2001
+ h('rect', { x: 3, y: 4, width: 18, height: 16, rx: 2.5 }),
2002
+ h('circle', { cx: 8.5, cy: 9.5, r: 1.5 }),
2003
+ h('path', { d: 'm21 15-4.8-4.8a1.5 1.5 0 0 0-2.1 0L6 18.3' }),
2004
+ )
1702
2005
  case 'archive':
1703
2006
  return h('svg', props,
1704
2007
  h('rect', { x: 3, y: 4, width: 18, height: 5, rx: 1.5 }),
@@ -1975,7 +2278,7 @@ window.__ModuleLoader__.load({
1975
2278
 
1976
2279
  /* Scrollable body */
1977
2280
  .dnb-body {
1978
- padding: calc(4px + var(--dnb-safe-top, 0px)) 12px calc(16px + var(--dnb-safe-bottom, 0px));
2281
+ padding: 4px 12px 14px;
1979
2282
  overflow-y: auto;
1980
2283
  overflow-x: hidden;
1981
2284
  flex: 1 1 auto;
@@ -2216,8 +2519,8 @@ window.__ModuleLoader__.load({
2216
2519
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
2217
2520
  }
2218
2521
  .dnb-pyr-apex[data-spotlight="doing"] {
2219
- border-color: #ff9f0a;
2220
- box-shadow: 0 0 0 2.5px rgba(255, 159, 10, 0.28), 0 8px 24px rgba(0, 0, 0, 0.18);
2522
+ border-color: #0a84ff;
2523
+ box-shadow: 0 0 0 2.5px rgba(10, 132, 255, 0.28), 0 8px 24px rgba(0, 0, 0, 0.18);
2221
2524
  }
2222
2525
  .dnb-pyr-apex[data-spotlight="blocked"] {
2223
2526
  border-color: #ff453a;
@@ -2231,9 +2534,9 @@ window.__ModuleLoader__.load({
2231
2534
  flex-shrink: 0;
2232
2535
  transition: background 0.2s ease;
2233
2536
  }
2234
- .dnb-pyr-trunk[data-tone="doing"] { background: #ff9f0a; }
2537
+ .dnb-pyr-trunk[data-tone="doing"] { background: #0a84ff; }
2235
2538
  .dnb-pyr-trunk[data-tone="blocked"] { background: #ff453a; }
2236
- .dnb-pyr-trunk[data-tone="live"] { background: #30d158; }
2539
+ .dnb-pyr-trunk[data-tone="live"] { background: #0a84ff; }
2237
2540
 
2238
2541
  .dnb-pyr-crossbar {
2239
2542
  height: 2px;
@@ -2241,7 +2544,7 @@ window.__ModuleLoader__.load({
2241
2544
  background: var(--dnb-border-strong, rgba(155, 155, 168, 0.52));
2242
2545
  border-radius: 2px;
2243
2546
  }
2244
- .dnb-pyr-crossbar[data-tone="doing"] { background: linear-gradient(90deg, rgba(255,159,10,0.45), #ff9f0a, rgba(255,159,10,0.45)); }
2547
+ .dnb-pyr-crossbar[data-tone="doing"] { background: linear-gradient(90deg, rgba(10,132,255,0.45), #0a84ff, rgba(10,132,255,0.45)); }
2245
2548
  .dnb-pyr-crossbar[data-tone="blocked"] { background: linear-gradient(90deg, rgba(255,69,58,0.45), #ff453a, rgba(255,69,58,0.45)); }
2246
2549
 
2247
2550
  .dnb-pyr-grid {
@@ -2283,11 +2586,11 @@ window.__ModuleLoader__.load({
2283
2586
  background: var(--dnb-border-strong, rgba(165, 165, 178, 0.85));
2284
2587
  }
2285
2588
  .dnb-pyr-branch[data-tone="doing"]::before,
2286
- .dnb-pyr-branch[data-tone="doing"]::after { background: #ff9f0a; }
2589
+ .dnb-pyr-branch[data-tone="doing"]::after { background: #0a84ff; }
2287
2590
  .dnb-pyr-branch[data-tone="blocked"]::before,
2288
2591
  .dnb-pyr-branch[data-tone="blocked"]::after { background: #ff453a; }
2289
2592
  .dnb-pyr-branch[data-tone="live"]::before,
2290
- .dnb-pyr-branch[data-tone="live"]::after { background: #30d158; }
2593
+ .dnb-pyr-branch[data-tone="live"]::after { background: #0a84ff; }
2291
2594
 
2292
2595
  .dnb-pyr-branch-box {
2293
2596
  position: relative;
@@ -2298,9 +2601,9 @@ window.__ModuleLoader__.load({
2298
2601
  .dnb-pyr-branch-box[data-spotlight="doing"] {
2299
2602
  padding: 10px 9px 9px;
2300
2603
  margin-top: 4px;
2301
- border: 2px solid #ff9f0a;
2302
- background: rgba(255, 159, 10, 0.06);
2303
- box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.16), 0 8px 24px rgba(0, 0, 0, 0.18);
2604
+ border: 2px solid #0a84ff;
2605
+ background: rgba(10, 132, 255, 0.06);
2606
+ box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.16), 0 8px 24px rgba(0, 0, 0, 0.18);
2304
2607
  }
2305
2608
  .dnb-pyr-branch-box[data-spotlight="blocked"] {
2306
2609
  padding: 10px 9px 9px;
@@ -2319,7 +2622,7 @@ window.__ModuleLoader__.load({
2319
2622
  font-size: 10.5px;
2320
2623
  font-weight: 700;
2321
2624
  color: #fff;
2322
- background: #ff9f0a;
2625
+ background: #0a84ff;
2323
2626
  margin-bottom: 7px;
2324
2627
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
2325
2628
  }
@@ -2336,11 +2639,11 @@ window.__ModuleLoader__.load({
2336
2639
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
2337
2640
  }
2338
2641
  .dnb-pyr-agent-card[data-running="1"] {
2339
- border-color: rgba(48, 209, 88, 0.52);
2340
- background: linear-gradient(135deg, rgba(48, 209, 88, 0.09) 0%, var(--dnb-elevated, #252529) 72%);
2642
+ border-color: rgba(10, 132, 255, 0.52);
2643
+ background: linear-gradient(135deg, rgba(10, 132, 255, 0.09) 0%, var(--dnb-elevated, #252529) 72%);
2341
2644
  }
2342
2645
  .dnb-pyr-agent-card[data-focused="doing"] {
2343
- border-color: rgba(255, 159, 10, 0.65);
2646
+ border-color: rgba(10, 132, 255, 0.65);
2344
2647
  }
2345
2648
  .dnb-pyr-agent-card[data-focused="blocked"] {
2346
2649
  border-color: rgba(255, 69, 58, 0.68);
@@ -2359,13 +2662,13 @@ window.__ModuleLoader__.load({
2359
2662
  min-width: 0;
2360
2663
  }
2361
2664
  .dnb-pyr-subtree[data-tone="doing"] {
2362
- border-left-color: rgba(255, 159, 10, 0.68);
2665
+ border-left-color: rgba(10, 132, 255, 0.68);
2363
2666
  }
2364
2667
  .dnb-pyr-subtree[data-tone="blocked"] {
2365
2668
  border-left-color: rgba(255, 69, 58, 0.72);
2366
2669
  }
2367
2670
  .dnb-pyr-subtree[data-tone="live"] {
2368
- border-left-color: rgba(48, 209, 88, 0.58);
2671
+ border-left-color: rgba(10, 132, 255, 0.58);
2369
2672
  }
2370
2673
  .dnb-pyr-subitem {
2371
2674
  position: relative;
@@ -2391,7 +2694,7 @@ window.__ModuleLoader__.load({
2391
2694
  background: var(--dnb-border-strong, rgba(165, 165, 178, 0.78));
2392
2695
  }
2393
2696
  .dnb-pyr-subitem[data-tone="doing"]::before,
2394
- .dnb-pyr-subitem[data-tone="doing"]::after { background: #ff9f0a; }
2697
+ .dnb-pyr-subitem[data-tone="doing"]::after { background: #0a84ff; }
2395
2698
  .dnb-pyr-subitem[data-tone="blocked"]::before,
2396
2699
  .dnb-pyr-subitem[data-tone="blocked"]::after { background: #ff453a; }
2397
2700
  .dnb-pyr-subitem[data-tone="done"]::after { background: #30d158; }
@@ -2409,10 +2712,10 @@ window.__ModuleLoader__.load({
2409
2712
  border-color: var(--dnb-border-strong);
2410
2713
  }
2411
2714
  .dnb-pyr-task-card[data-status="doing"] {
2412
- border-left-color: #ff9f0a;
2413
- border-color: rgba(255, 159, 10, 0.34);
2715
+ border-left-color: #0a84ff;
2716
+ border-color: rgba(10, 132, 255, 0.34);
2414
2717
  border-left-width: 3.5px;
2415
- background: linear-gradient(90deg, rgba(255, 159, 10, 0.08) 0%, var(--dnb-card) 64%);
2718
+ background: linear-gradient(90deg, rgba(10, 132, 255, 0.08) 0%, var(--dnb-card) 64%);
2416
2719
  }
2417
2720
  .dnb-pyr-task-card[data-status="blocked"] {
2418
2721
  border-left-color: #ff453a;
@@ -2421,15 +2724,15 @@ window.__ModuleLoader__.load({
2421
2724
  background: linear-gradient(90deg, rgba(255, 69, 58, 0.1) 0%, var(--dnb-card) 64%);
2422
2725
  }
2423
2726
  .dnb-pyr-task-card[data-status="todo"] {
2424
- border-left-color: #0a84ff;
2727
+ border-left-color: #8e8e93;
2425
2728
  }
2426
2729
  .dnb-pyr-task-card[data-status="done"] {
2427
2730
  border-left-color: #30d158;
2428
2731
  opacity: 0.92;
2429
2732
  }
2430
2733
  .dnb-pyr-task-card[data-spotlight="doing"] {
2431
- border-color: #ff9f0a;
2432
- box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.34), 0 6px 18px rgba(0, 0, 0, 0.18);
2734
+ border-color: #0a84ff;
2735
+ box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.34), 0 6px 18px rgba(0, 0, 0, 0.18);
2433
2736
  }
2434
2737
  .dnb-pyr-task-card[data-spotlight="blocked"] {
2435
2738
  border-color: #ff453a;
@@ -2469,15 +2772,15 @@ window.__ModuleLoader__.load({
2469
2772
  background: var(--dnb-fill);
2470
2773
  }
2471
2774
  .dnb-pyr-st-btn[data-active="1"][data-st="todo"] {
2472
- color: #0a84ff;
2473
- border-color: rgba(10, 132, 255, 0.45);
2474
- background: rgba(10, 132, 255, 0.14);
2775
+ color: #a1a1aa;
2776
+ border-color: rgba(142, 142, 147, 0.45);
2777
+ background: rgba(142, 142, 147, 0.16);
2475
2778
  font-weight: 600;
2476
2779
  }
2477
2780
  .dnb-pyr-st-btn[data-active="1"][data-st="doing"] {
2478
- color: #ff9f0a;
2479
- border-color: rgba(255, 159, 10, 0.5);
2480
- background: rgba(255, 159, 10, 0.16);
2781
+ color: #409cff;
2782
+ border-color: rgba(10, 132, 255, 0.5);
2783
+ background: rgba(10, 132, 255, 0.16);
2481
2784
  font-weight: 600;
2482
2785
  }
2483
2786
  .dnb-pyr-st-btn[data-active="1"][data-st="blocked"] {
@@ -2576,6 +2879,23 @@ window.__ModuleLoader__.load({
2576
2879
  animation: dnb-live-dot 1.5s ease-in-out infinite;
2577
2880
  }
2578
2881
 
2882
+ .dnb-spin-ring {
2883
+ width: var(--dnb-spin-size, 10px);
2884
+ height: var(--dnb-spin-size, 10px);
2885
+ border-radius: 50%;
2886
+ border: 1.65px solid rgba(161, 161, 170, 0.28);
2887
+ border-top-color: currentColor;
2888
+ display: inline-block;
2889
+ flex-shrink: 0;
2890
+ box-sizing: border-box;
2891
+ animation: dnb-spin 0.85s linear infinite;
2892
+ }
2893
+ .dnb-svg-spin {
2894
+ transform-box: fill-box;
2895
+ transform-origin: center;
2896
+ animation: dnb-spin 0.85s linear infinite;
2897
+ }
2898
+
2579
2899
  @keyframes dnb-spotlight-march {
2580
2900
  to { stroke-dashoffset: -28px; }
2581
2901
  }
@@ -2607,9 +2927,9 @@ window.__ModuleLoader__.load({
2607
2927
  border: 1px solid transparent;
2608
2928
  }
2609
2929
  .dnb-status-badge[data-status="doing"] {
2610
- background: rgba(255, 159, 10, 0.18);
2611
- border-color: rgba(255, 159, 10, 0.48);
2612
- color: #ff9f0a;
2930
+ background: rgba(10, 132, 255, 0.16);
2931
+ border-color: rgba(10, 132, 255, 0.44);
2932
+ color: #409cff;
2613
2933
  }
2614
2934
  .dnb-status-badge[data-status="blocked"] {
2615
2935
  background: rgba(255, 69, 58, 0.2);
@@ -2617,9 +2937,9 @@ window.__ModuleLoader__.load({
2617
2937
  color: #ff453a;
2618
2938
  }
2619
2939
  .dnb-status-badge[data-status="todo"] {
2620
- background: rgba(10, 132, 255, 0.14);
2621
- border-color: rgba(10, 132, 255, 0.34);
2622
- color: #0a84ff;
2940
+ background: rgba(142, 142, 147, 0.16);
2941
+ border-color: rgba(142, 142, 147, 0.34);
2942
+ color: #a1a1aa;
2623
2943
  }
2624
2944
  .dnb-status-badge[data-status="done"] {
2625
2945
  background: rgba(48, 209, 88, 0.14);
@@ -2653,10 +2973,10 @@ window.__ModuleLoader__.load({
2653
2973
  transform: scale(0.985);
2654
2974
  }
2655
2975
  .dnb-radar-card[data-kind="doing"] {
2656
- border-left: 3.5px solid #ff9f0a;
2657
- background: linear-gradient(90deg, rgba(255, 159, 10, 0.12) 0%, var(--dnb-card) 70%);
2658
- border-color: rgba(255, 159, 10, 0.34);
2659
- border-left-color: #ff9f0a;
2976
+ border-left: 3.5px solid #0a84ff;
2977
+ background: linear-gradient(90deg, rgba(10, 132, 255, 0.12) 0%, var(--dnb-card) 70%);
2978
+ border-color: rgba(10, 132, 255, 0.34);
2979
+ border-left-color: #0a84ff;
2660
2980
  }
2661
2981
  .dnb-radar-card[data-kind="blocked"] {
2662
2982
  border-left: 3.5px solid #ff453a;
@@ -2665,7 +2985,7 @@ window.__ModuleLoader__.load({
2665
2985
  border-left-color: #ff453a;
2666
2986
  }
2667
2987
  .dnb-radar-card[data-focused="1"] {
2668
- box-shadow: 0 0 0 2px rgba(255, 159, 10, 0.36), 0 6px 16px rgba(0, 0, 0, 0.18);
2988
+ box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.36), 0 6px 16px rgba(0, 0, 0, 0.18);
2669
2989
  }
2670
2990
  .dnb-radar-card[data-kind="blocked"][data-focused="1"] {
2671
2991
  box-shadow: 0 0 0 2px rgba(255, 69, 58, 0.42), 0 6px 16px rgba(0, 0, 0, 0.18);
@@ -2680,8 +3000,8 @@ window.__ModuleLoader__.load({
2680
3000
  padding: 7px 10px;
2681
3001
  margin-bottom: 8px;
2682
3002
  border-radius: 11px;
2683
- border: 1px solid rgba(255, 159, 10, 0.45);
2684
- background: rgba(255, 159, 10, 0.13);
3003
+ border: 1px solid rgba(10, 132, 255, 0.45);
3004
+ background: rgba(10, 132, 255, 0.13);
2685
3005
  font-size: 11.5px;
2686
3006
  animation: dnb-enter 0.18s ease-out;
2687
3007
  }
@@ -2707,10 +3027,10 @@ window.__ModuleLoader__.load({
2707
3027
  transition: transform 0.16s cubic-bezier(0.32, 0.72, 0, 1), background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
2708
3028
  }
2709
3029
  .dnb-pin-stamp:hover {
2710
- color: #ff9f0a;
3030
+ color: #fbbf24;
2711
3031
  border-style: solid;
2712
- border-color: rgba(255, 159, 10, 0.48);
2713
- background: rgba(255, 159, 10, 0.1);
3032
+ border-color: rgba(245, 158, 11, 0.48);
3033
+ background: rgba(245, 158, 11, 0.1);
2714
3034
  transform: scale(1.06) rotate(-4deg);
2715
3035
  }
2716
3036
  .dnb-pin-stamp:active {
@@ -2718,10 +3038,10 @@ window.__ModuleLoader__.load({
2718
3038
  }
2719
3039
  .dnb-pin-stamp[data-pinned="1"] {
2720
3040
  border-style: solid;
2721
- border-color: rgba(255, 159, 10, 0.58);
2722
- background: linear-gradient(135deg, rgba(255, 159, 10, 0.26) 0%, rgba(255, 107, 0, 0.16) 100%);
2723
- color: #ff9f0a;
2724
- box-shadow: 0 2px 7px rgba(255, 159, 10, 0.22), inset 0 0.5px 0 rgba(255, 255, 255, 0.22);
3041
+ border-color: rgba(245, 158, 11, 0.58);
3042
+ background: linear-gradient(135deg, rgba(245, 158, 11, 0.26) 0%, rgba(217, 119, 6, 0.16) 100%);
3043
+ color: #fbbf24;
3044
+ box-shadow: 0 2px 7px rgba(245, 158, 11, 0.22), inset 0 0.5px 0 rgba(255, 255, 255, 0.22);
2725
3045
  }
2726
3046
  .dnb-pin-badge {
2727
3047
  display: inline-flex;
@@ -2732,9 +3052,9 @@ window.__ModuleLoader__.load({
2732
3052
  font-size: 9.5px;
2733
3053
  font-weight: 700;
2734
3054
  letter-spacing: 0.2px;
2735
- color: #ff9f0a;
2736
- background: rgba(255, 159, 10, 0.15);
2737
- border: 1px solid rgba(255, 159, 10, 0.34);
3055
+ color: #fbbf24;
3056
+ background: rgba(245, 158, 11, 0.15);
3057
+ border: 1px solid rgba(245, 158, 11, 0.34);
2738
3058
  flex-shrink: 0;
2739
3059
  }
2740
3060
  .dnb-bound-check {
@@ -2876,8 +3196,8 @@ window.__ModuleLoader__.load({
2876
3196
  border-bottom: 1px solid var(--dnb-border);
2877
3197
  }
2878
3198
  .dnb-prose-h2 {
2879
- font-size: 14px;
2880
- font-weight: 600;
3199
+ font-size: 13.5px;
3200
+ font-weight: 700;
2881
3201
  color: var(--dnb-text);
2882
3202
  margin: 14px 0 6px;
2883
3203
  letter-spacing: -0.1px;
@@ -2885,6 +3205,32 @@ window.__ModuleLoader__.load({
2885
3205
  .dnb-prose-h2:first-child {
2886
3206
  margin-top: 0;
2887
3207
  }
3208
+ .dnb-struct-head {
3209
+ display: flex;
3210
+ align-items: center;
3211
+ gap: 7px;
3212
+ padding: 3px 8px;
3213
+ margin: 12px 0 6px;
3214
+ border-radius: 7px;
3215
+ font-size: 13px;
3216
+ font-weight: 700;
3217
+ letter-spacing: -0.1px;
3218
+ line-height: 1.35;
3219
+ }
3220
+ .dnb-struct-head[data-compact="1"] {
3221
+ font-size: 11.8px;
3222
+ padding: 2px 7px;
3223
+ margin: 6px 0 4px;
3224
+ }
3225
+ .dnb-struct-bar {
3226
+ width: 3px;
3227
+ height: 13px;
3228
+ border-radius: 2px;
3229
+ flex-shrink: 0;
3230
+ }
3231
+ .dnb-struct-head[data-compact="1"] .dnb-struct-bar {
3232
+ height: 11px;
3233
+ }
2888
3234
  .dnb-prose-p {
2889
3235
  font-size: 12.8px;
2890
3236
  line-height: 1.72;
@@ -2901,8 +3247,8 @@ window.__ModuleLoader__.load({
2901
3247
  margin: 0 12px 8px;
2902
3248
  padding: 9px 11px;
2903
3249
  border-radius: 13px;
2904
- background: linear-gradient(135deg, rgba(10, 132, 255, 0.11), rgba(255, 159, 10, 0.08));
2905
- border: 1px solid rgba(10, 132, 255, 0.28);
3250
+ background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(10, 132, 255, 0.08));
3251
+ border: 1px solid rgba(245, 158, 11, 0.30);
2906
3252
  flex-shrink: 0;
2907
3253
  animation: dnb-enter 0.2s cubic-bezier(0.32, 0.72, 0, 1);
2908
3254
  }
@@ -2910,10 +3256,61 @@ window.__ModuleLoader__.load({
2910
3256
  /* Persistent Bottom Chief Input Bar (DS-Bot + iOS Style) */
2911
3257
  .dnb-sec-bar {
2912
3258
  flex-shrink: 0;
2913
- padding: 7px 12px calc(10px + var(--dnb-safe-bottom, 0px));
3259
+ padding: 7px calc(12px + var(--dnb-safe-right, 0px)) 10px 12px;
2914
3260
  border-top: 1px solid var(--dnb-border);
2915
3261
  background: var(--dsw-alias-bg-layer-2, rgba(28, 28, 31, 0.65));
2916
3262
  backdrop-filter: blur(16px);
3263
+ transition: border-color 0.16s ease, background 0.16s ease;
3264
+ }
3265
+ .dnb-sec-bar[data-dragover="1"] {
3266
+ border-top-color: var(--dnb-accent);
3267
+ background: rgba(10, 132, 255, 0.10);
3268
+ }
3269
+ .dnb-sec-img-strip {
3270
+ display: flex;
3271
+ align-items: center;
3272
+ gap: 7px;
3273
+ overflow-x: auto;
3274
+ padding: 2px 2px 7px;
3275
+ scrollbar-width: none;
3276
+ }
3277
+ .dnb-sec-img-strip::-webkit-scrollbar { display: none; }
3278
+ .dnb-sec-img-thumb {
3279
+ position: relative;
3280
+ width: 44px;
3281
+ height: 44px;
3282
+ border-radius: 9px;
3283
+ overflow: hidden;
3284
+ border: 1px solid var(--dnb-border-strong);
3285
+ background: var(--dnb-card);
3286
+ flex-shrink: 0;
3287
+ }
3288
+ .dnb-sec-img-thumb img {
3289
+ width: 100%;
3290
+ height: 100%;
3291
+ object-fit: cover;
3292
+ display: block;
3293
+ }
3294
+ .dnb-sec-img-rm {
3295
+ position: absolute;
3296
+ top: 2px;
3297
+ right: 2px;
3298
+ width: 15px;
3299
+ height: 15px;
3300
+ border-radius: 50%;
3301
+ border: none;
3302
+ background: rgba(0, 0, 0, 0.72);
3303
+ color: #fff;
3304
+ font-size: 11px;
3305
+ line-height: 1;
3306
+ padding: 0;
3307
+ display: inline-flex;
3308
+ align-items: center;
3309
+ justify-content: center;
3310
+ cursor: pointer;
3311
+ }
3312
+ .dnb-sec-img-rm:hover {
3313
+ background: #ff453a;
2917
3314
  }
2918
3315
  .dnb-sec-targets {
2919
3316
  display: flex;
@@ -2954,7 +3351,7 @@ window.__ModuleLoader__.load({
2954
3351
  display: flex;
2955
3352
  align-items: center;
2956
3353
  gap: 6px;
2957
- padding: 4px 5px 4px 13px;
3354
+ padding: 4px 5px 4px 7px;
2958
3355
  border-radius: 20px;
2959
3356
  border: 1px solid var(--dnb-border-strong);
2960
3357
  background: var(--dnb-card);
@@ -2964,6 +3361,44 @@ window.__ModuleLoader__.load({
2964
3361
  border-color: var(--dnb-accent);
2965
3362
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.14);
2966
3363
  }
3364
+ .dnb-sec-attach {
3365
+ position: relative;
3366
+ width: 26px;
3367
+ height: 26px;
3368
+ border-radius: 50%;
3369
+ border: none;
3370
+ background: transparent;
3371
+ color: var(--dnb-text-2);
3372
+ display: inline-flex;
3373
+ align-items: center;
3374
+ justify-content: center;
3375
+ cursor: pointer;
3376
+ flex-shrink: 0;
3377
+ transition: background 0.15s ease, color 0.15s ease;
3378
+ }
3379
+ .dnb-sec-attach:hover:not(:disabled) {
3380
+ background: var(--dnb-fill);
3381
+ color: var(--dnb-accent);
3382
+ }
3383
+ .dnb-sec-attach:disabled {
3384
+ opacity: 0.45;
3385
+ cursor: default;
3386
+ }
3387
+ .dnb-sec-attach-badge {
3388
+ position: absolute;
3389
+ top: -1px;
3390
+ right: -1px;
3391
+ min-width: 13px;
3392
+ height: 13px;
3393
+ padding: 0 3px;
3394
+ border-radius: 99px;
3395
+ background: var(--dnb-accent);
3396
+ color: #fff;
3397
+ font-size: 9px;
3398
+ font-weight: 700;
3399
+ line-height: 13px;
3400
+ text-align: center;
3401
+ }
2967
3402
  .dnb-sec-input {
2968
3403
  flex: 1;
2969
3404
  min-width: 0;
@@ -3292,69 +3727,276 @@ window.__ModuleLoader__.load({
3292
3727
  background: rgba(10, 132, 255, 0.11);
3293
3728
  color: var(--dnb-accent);
3294
3729
  }
3295
- `
3296
-
3297
- function Style() {
3298
- return h('style', { 'data-dnb': '3' }, CSS)
3299
- }
3300
-
3301
- function Switch({ checked, onChange }) {
3302
- return h(
3303
- 'button',
3304
- {
3305
- type: 'button',
3306
- role: 'switch',
3307
- 'aria-checked': checked ? 'true' : 'false',
3308
- className: 'dnb-switch',
3309
- 'data-on': checked ? '1' : '0',
3310
- onClick: () => onChange(!checked),
3311
- },
3312
- h('span', { className: 'dnb-switch-thumb' }),
3313
- )
3314
- }
3315
-
3316
- /* ---------------------------------------------------- Spotlight Search */
3317
3730
 
3318
- function SearchDrawer({ view }) {
3319
- if (!view.searchOpen) return null
3320
- const run = () => {
3321
- const text = (view.askText || '').trim()
3322
- if (!text) return
3323
- const hits = searchBoard(text)
3324
- patch({ askHits: hits, askNote: '' })
3731
+ /* vNext Micro-Flat Components: Tactical Cockpit, Scoped Modals, Goal Approval & Cold Vault */
3732
+ .dnb-sec-bar {
3733
+ position: relative;
3325
3734
  }
3326
- const askModel = () => {
3327
- const text = (view.askText || '').trim()
3328
- if (!text) return
3329
- patch({ secInput: text, secTarget: 'auto', searchOpen: false, askHits: null })
3330
- void submitChiefBar()
3735
+ .dnb-modal-backdrop {
3736
+ position: absolute;
3737
+ inset: 0;
3738
+ z-index: 80;
3739
+ background: rgba(0, 0, 0, 0.46);
3740
+ backdrop-filter: blur(4px);
3741
+ display: flex;
3742
+ align-items: center;
3743
+ justify-content: center;
3744
+ padding: 12px;
3331
3745
  }
3332
-
3333
- return h(
3334
- 'div',
3335
- { style: { padding: '0 12px 8px', flexShrink: 0 }, className: 'dnb-view' },
3336
- h(
3337
- 'div',
3338
- { style: { display: 'flex', gap: 6, alignItems: 'center' } },
3339
- h('input', {
3340
- className: 'dnb-input',
3341
- style: { borderRadius: 99, paddingLeft: 12, height: 30 },
3342
- placeholder: '搜索记忆、任务、协同信箱…',
3343
- autoFocus: true,
3344
- value: view.askText || '',
3345
- onChange: e => {
3346
- const val = e.target.value
3347
- patch({ askText: val, askHits: val.trim() ? searchBoard(val) : null })
3348
- },
3349
- onKeyDown: e => {
3350
- if (e.key === 'Enter') run()
3351
- if (e.key === 'Escape') patch({ searchOpen: false, askHits: null })
3352
- },
3353
- }),
3354
- (view.askText || '').trim()
3355
- ? h('button', {
3356
- className: 'dnb-pill',
3357
- style: { height: 30 },
3746
+ .dnb-modal-card {
3747
+ width: 100%;
3748
+ max-height: 92%;
3749
+ overflow-y: auto;
3750
+ border-radius: 12px;
3751
+ background: var(--dnb-elevated);
3752
+ border: 1px solid var(--dnb-border-strong);
3753
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
3754
+ padding: 14px;
3755
+ display: flex;
3756
+ flex-direction: column;
3757
+ gap: 10px;
3758
+ }
3759
+ .dnb-plus-btn {
3760
+ width: 28px;
3761
+ height: 28px;
3762
+ border-radius: 50%;
3763
+ border: 1px solid var(--dnb-border-strong);
3764
+ background: var(--dnb-card);
3765
+ color: var(--dnb-text-2);
3766
+ display: inline-flex;
3767
+ align-items: center;
3768
+ justify-content: center;
3769
+ flex-shrink: 0;
3770
+ cursor: pointer;
3771
+ font-size: 15px;
3772
+ font-weight: 600;
3773
+ line-height: 1;
3774
+ transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
3775
+ }
3776
+ .dnb-plus-btn:hover {
3777
+ border-color: var(--dnb-accent);
3778
+ color: var(--dnb-text);
3779
+ }
3780
+ .dnb-plus-btn[data-active="1"] {
3781
+ border-color: rgba(10, 132, 255, 0.48);
3782
+ background: rgba(10, 132, 255, 0.14);
3783
+ color: var(--dnb-accent);
3784
+ }
3785
+ .dnb-plus-btn[data-danger="1"] {
3786
+ border-color: rgba(245, 158, 11, 0.55);
3787
+ background: rgba(245, 158, 11, 0.16);
3788
+ color: #f59e0b;
3789
+ }
3790
+ .dnb-tactical-pop {
3791
+ position: absolute;
3792
+ left: 12px;
3793
+ right: calc(12px + var(--dnb-safe-right, 0px));
3794
+ bottom: calc(100% + 6px);
3795
+ z-index: 65;
3796
+ border-radius: 12px;
3797
+ background: var(--dnb-popover);
3798
+ border: 1px solid var(--dnb-border-strong);
3799
+ box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
3800
+ padding: 10px 12px;
3801
+ display: flex;
3802
+ flex-direction: column;
3803
+ gap: 8px;
3804
+ max-height: 360px;
3805
+ overflow-y: auto;
3806
+ }
3807
+ .dnb-tactical-row {
3808
+ display: flex;
3809
+ align-items: center;
3810
+ justify-content: space-between;
3811
+ gap: 8px;
3812
+ padding: 5px 0;
3813
+ border-bottom: 1px solid var(--dnb-border);
3814
+ }
3815
+ .dnb-tactical-row:last-of-type {
3816
+ border-bottom: none;
3817
+ }
3818
+ .dnb-tactical-strip {
3819
+ display: flex;
3820
+ align-items: center;
3821
+ gap: 5px;
3822
+ flex-wrap: wrap;
3823
+ padding-bottom: 6px;
3824
+ }
3825
+ .dnb-tac-chip {
3826
+ display: inline-flex;
3827
+ align-items: center;
3828
+ gap: 4px;
3829
+ height: 22px;
3830
+ padding: 0 8px;
3831
+ border-radius: 99px;
3832
+ border: 1px solid var(--dnb-border);
3833
+ background: var(--dnb-card);
3834
+ color: var(--dnb-text-2);
3835
+ font-size: 11px;
3836
+ font-weight: 500;
3837
+ cursor: pointer;
3838
+ }
3839
+ .dnb-tac-chip[data-tone="amber"] {
3840
+ border-color: rgba(245, 158, 11, 0.45);
3841
+ background: rgba(245, 158, 11, 0.12);
3842
+ color: #f59e0b;
3843
+ }
3844
+ .dnb-tac-chip[data-tone="accent"] {
3845
+ border-color: rgba(10, 132, 255, 0.42);
3846
+ background: rgba(10, 132, 255, 0.11);
3847
+ color: var(--dnb-accent);
3848
+ }
3849
+ .dnb-stop-btn {
3850
+ display: inline-flex;
3851
+ align-items: center;
3852
+ gap: 4px;
3853
+ height: 22px;
3854
+ padding: 0 9px;
3855
+ border-radius: 99px;
3856
+ border: 1px solid rgba(255, 69, 58, 0.55);
3857
+ background: rgba(255, 69, 58, 0.16);
3858
+ color: #ff453a;
3859
+ font-size: 11px;
3860
+ font-weight: 600;
3861
+ cursor: pointer;
3862
+ margin-left: auto;
3863
+ }
3864
+ .dnb-stop-btn:hover {
3865
+ background: rgba(255, 69, 58, 0.24);
3866
+ }
3867
+ .dnb-stepper {
3868
+ display: inline-flex;
3869
+ align-items: center;
3870
+ gap: 2px;
3871
+ border: 1px solid var(--dnb-border);
3872
+ border-radius: 7px;
3873
+ background: var(--dnb-card);
3874
+ padding: 1px 3px;
3875
+ }
3876
+ .dnb-stepper button {
3877
+ width: 18px;
3878
+ height: 18px;
3879
+ border: none;
3880
+ background: transparent;
3881
+ color: var(--dnb-text-2);
3882
+ cursor: pointer;
3883
+ font-size: 12px;
3884
+ border-radius: 4px;
3885
+ padding: 0;
3886
+ display: inline-flex;
3887
+ align-items: center;
3888
+ justify-content: center;
3889
+ }
3890
+ .dnb-stepper button:hover {
3891
+ background: var(--dnb-fill);
3892
+ color: var(--dnb-text);
3893
+ }
3894
+ .dnb-stepper span {
3895
+ min-width: 26px;
3896
+ text-align: center;
3897
+ font-size: 11px;
3898
+ font-weight: 600;
3899
+ color: var(--dnb-text);
3900
+ }
3901
+ .dnb-disclaimer-box {
3902
+ border-radius: 8px;
3903
+ border: 1px solid rgba(245, 158, 11, 0.36);
3904
+ background: rgba(245, 158, 11, 0.08);
3905
+ padding: 8px 10px;
3906
+ font-size: 11px;
3907
+ line-height: 1.5;
3908
+ color: var(--dnb-text-2);
3909
+ }
3910
+ .dnb-disclaimer-box strong {
3911
+ color: #f59e0b;
3912
+ }
3913
+ .dnb-goal-approval-card {
3914
+ border-radius: 10px;
3915
+ border: 1px solid rgba(48, 209, 88, 0.45);
3916
+ background: rgba(48, 209, 88, 0.08);
3917
+ padding: 10px 12px;
3918
+ margin-bottom: 10px;
3919
+ display: flex;
3920
+ flex-direction: column;
3921
+ gap: 6px;
3922
+ }
3923
+ .dnb-cab-bar {
3924
+ display: flex;
3925
+ align-items: center;
3926
+ gap: 6px;
3927
+ flex-wrap: wrap;
3928
+ margin-bottom: 8px;
3929
+ }
3930
+ .dnb-precip-box {
3931
+ margin-top: 12px;
3932
+ border-radius: 10px;
3933
+ border: 1px solid var(--dnb-border);
3934
+ background: var(--dnb-card);
3935
+ overflow: hidden;
3936
+ }
3937
+ `
3938
+
3939
+ function Style() {
3940
+ return h('style', { 'data-dnb': '3' }, CSS)
3941
+ }
3942
+
3943
+ function Switch({ checked, onChange }) {
3944
+ return h(
3945
+ 'button',
3946
+ {
3947
+ type: 'button',
3948
+ role: 'switch',
3949
+ 'aria-checked': checked ? 'true' : 'false',
3950
+ className: 'dnb-switch',
3951
+ 'data-on': checked ? '1' : '0',
3952
+ onClick: () => onChange(!checked),
3953
+ },
3954
+ h('span', { className: 'dnb-switch-thumb' }),
3955
+ )
3956
+ }
3957
+
3958
+ /* ---------------------------------------------------- Spotlight Search */
3959
+
3960
+ function SearchDrawer({ view }) {
3961
+ if (!view.searchOpen) return null
3962
+ const run = () => {
3963
+ const text = (view.askText || '').trim()
3964
+ if (!text) return
3965
+ const hits = searchBoard(text)
3966
+ patch({ askHits: hits, askNote: '' })
3967
+ }
3968
+ const askModel = () => {
3969
+ const text = (view.askText || '').trim()
3970
+ if (!text) return
3971
+ patch({ secInput: text, secTarget: 'auto', searchOpen: false, askHits: null })
3972
+ void submitChiefBar()
3973
+ }
3974
+
3975
+ return h(
3976
+ 'div',
3977
+ { style: { padding: '0 12px 8px', flexShrink: 0 }, className: 'dnb-view' },
3978
+ h(
3979
+ 'div',
3980
+ { style: { display: 'flex', gap: 6, alignItems: 'center' } },
3981
+ h('input', {
3982
+ className: 'dnb-input',
3983
+ style: { borderRadius: 99, paddingLeft: 12, height: 30 },
3984
+ placeholder: '搜索记忆、任务、协同信箱…',
3985
+ autoFocus: true,
3986
+ value: view.askText || '',
3987
+ onChange: e => {
3988
+ const val = e.target.value
3989
+ patch({ askText: val, askHits: val.trim() ? searchBoard(val) : null })
3990
+ },
3991
+ onKeyDown: e => {
3992
+ if (e.key === 'Enter') run()
3993
+ if (e.key === 'Escape') patch({ searchOpen: false, askHits: null })
3994
+ },
3995
+ }),
3996
+ (view.askText || '').trim()
3997
+ ? h('button', {
3998
+ className: 'dnb-pill',
3999
+ style: { height: 30 },
3358
4000
  disabled: view.archiveSearchBusy,
3359
4001
  onClick: () => void searchColdArchives(view.askText),
3360
4002
  title: '按需穿透搜索封存懒加载的长期工程档案柜',
@@ -3418,7 +4060,7 @@ window.__ModuleLoader__.load({
3418
4060
  'span',
3419
4061
  { className: 'dnb-status-badge', 'data-status': st, style },
3420
4062
  st === 'doing'
3421
- ? h('span', { className: 'dnb-live-dot', style: { background: '#ff9f0a' } })
4063
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '9.5px', color: '#409cff' } })
3422
4064
  : null,
3423
4065
  STATUS_BADGE[st] || STATUS_LABEL[st],
3424
4066
  )
@@ -3517,11 +4159,11 @@ window.__ModuleLoader__.load({
3517
4159
  height: 23,
3518
4160
  padding: '0 8px',
3519
4161
  fontSize: 10.5,
3520
- color: isFocused ? '#fff' : (kind === 'blocked' ? '#ff453a' : '#ff9f0a'),
4162
+ color: isFocused ? '#fff' : (kind === 'blocked' ? '#ff453a' : '#409cff'),
3521
4163
  background: isFocused
3522
- ? (kind === 'blocked' ? '#ff453a' : '#ff9f0a')
3523
- : (kind === 'blocked' ? 'rgba(255,69,58,0.12)' : 'rgba(255,159,10,0.12)'),
3524
- borderColor: kind === 'blocked' ? 'rgba(255,69,58,0.38)' : 'rgba(255,159,10,0.38)',
4164
+ ? (kind === 'blocked' ? '#ff453a' : '#0a84ff')
4165
+ : (kind === 'blocked' ? 'rgba(255,69,58,0.12)' : 'rgba(10,132,255,0.12)'),
4166
+ borderColor: kind === 'blocked' ? 'rgba(255,69,58,0.38)' : 'rgba(10,132,255,0.38)',
3525
4167
  flexShrink: 0,
3526
4168
  },
3527
4169
  },
@@ -3602,20 +4244,21 @@ window.__ModuleLoader__.load({
3602
4244
  onClick: () => patch({ fleetCollapsed: !isCollapsed }),
3603
4245
  title: isCollapsed ? '点击展开子代理团队' : '点击收起子代理团队',
3604
4246
  },
3605
- h('span', {
3606
- className: runningCount > 0 ? 'dnb-live-dot' : undefined,
3607
- style: {
3608
- width: 7,
3609
- height: 7,
3610
- borderRadius: '50%',
3611
- background: runningCount > 0 ? '#30d158' : 'var(--dnb-text-3)',
3612
- flexShrink: 0,
3613
- },
3614
- }),
4247
+ runningCount > 0
4248
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8px', color: '#409cff' } })
4249
+ : h('span', {
4250
+ style: {
4251
+ width: 7,
4252
+ height: 7,
4253
+ borderRadius: '50%',
4254
+ background: 'var(--dnb-text-3)',
4255
+ flexShrink: 0,
4256
+ },
4257
+ }),
3615
4258
  '子代理团队',
3616
4259
  h(
3617
4260
  'span',
3618
- { style: { color: runningCount > 0 ? '#30d158' : 'var(--dnb-text-3)', fontWeight: 500 } },
4261
+ { style: { color: runningCount > 0 ? '#409cff' : 'var(--dnb-text-3)', fontWeight: 500 } },
3619
4262
  runningCount ? `${runningCount} 运行中 · 共 ${children.length}` : `共 ${children.length} 成员`,
3620
4263
  ),
3621
4264
  ),
@@ -3664,7 +4307,7 @@ window.__ModuleLoader__.load({
3664
4307
  style: {
3665
4308
  height: 25,
3666
4309
  padding: '0 9px',
3667
- borderColor: isRunning && !isSelected ? 'rgba(48, 209, 88, 0.38)' : undefined,
4310
+ borderColor: isRunning && !isSelected ? 'rgba(10, 132, 255, 0.38)' : undefined,
3668
4311
  },
3669
4312
  title: '@' + agent.name + (isTier2 ? '(上级:@' + pKey + ')' : '') + (agent.description ? ' — ' + agent.description : ''),
3670
4313
  onClick: () => {
@@ -3673,15 +4316,16 @@ window.__ModuleLoader__.load({
3673
4316
  setSteerAgent(steerAgent === agent.name ? '' : agent.name)
3674
4317
  },
3675
4318
  },
3676
- h('span', {
3677
- className: isRunning ? 'dnb-live-dot' : undefined,
3678
- style: {
3679
- width: 6.5,
3680
- height: 6.5,
3681
- borderRadius: '50%',
3682
- background: isRunning ? '#30d158' : 'var(--dnb-text-3)',
3683
- },
3684
- }),
4319
+ isRunning
4320
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8px', color: '#409cff' } })
4321
+ : h('span', {
4322
+ style: {
4323
+ width: 6.5,
4324
+ height: 6.5,
4325
+ borderRadius: '50%',
4326
+ background: 'var(--dnb-text-3)',
4327
+ },
4328
+ }),
3685
4329
  '@' + shortAgentName(agent.name),
3686
4330
  )
3687
4331
  }),
@@ -4016,8 +4660,8 @@ window.__ModuleLoader__.load({
4016
4660
  key: depId,
4017
4661
  className: 'dnb-tag',
4018
4662
  style: {
4019
- background: isDone ? STATUS_BG.done : STATUS_BG.doing,
4020
- color: isDone ? STATUS_HEX.done : STATUS_HEX.doing,
4663
+ background: isDone ? STATUS_BG.done : 'rgba(245, 158, 11, 0.16)',
4664
+ color: isDone ? STATUS_HEX.done : '#fbbf24',
4021
4665
  padding: '2px 8px',
4022
4666
  },
4023
4667
  },
@@ -4096,7 +4740,7 @@ window.__ModuleLoader__.load({
4096
4740
  { key: idx, style: { display: 'flex', alignItems: 'center', gap: 8, padding: '3px 0', fontSize: 11.5 } },
4097
4741
  h('button', {
4098
4742
  className: 'dnb-ring',
4099
- style: assum.verified ? { background: '#30d158', borderColor: '#30d158' } : { borderColor: '#ff9f0a' },
4743
+ style: assum.verified ? { background: '#30d158', borderColor: '#30d158' } : { borderColor: '#f59e0b' },
4100
4744
  onClick: () => {
4101
4745
  if (!assum.verified) void act({ action: 'task.verify', id: task.id, assumptionIndex: idx })
4102
4746
  },
@@ -4262,7 +4906,7 @@ window.__ModuleLoader__.load({
4262
4906
  : isBlocked
4263
4907
  ? 'rgba(255, 69, 58, 0.05)'
4264
4908
  : isDoing
4265
- ? 'rgba(255, 159, 10, 0.04)'
4909
+ ? 'rgba(10, 132, 255, 0.05)'
4266
4910
  : undefined,
4267
4911
  borderLeft: (isBlocked || isDoing) ? `3px solid ${color}` : '3px solid transparent',
4268
4912
  },
@@ -4278,7 +4922,10 @@ window.__ModuleLoader__.load({
4278
4922
  marginTop: 1,
4279
4923
  ...(isDone
4280
4924
  ? { background: color, borderColor: color }
4281
- : { borderColor: color, background: isDoing ? STATUS_BG.doing : isBlocked ? STATUS_BG.blocked : 'transparent' }),
4925
+ : {
4926
+ borderColor: isDoing ? 'rgba(10, 132, 255, 0.34)' : color,
4927
+ background: isDoing ? 'rgba(10, 132, 255, 0.10)' : isBlocked ? STATUS_BG.blocked : 'transparent',
4928
+ }),
4282
4929
  },
4283
4930
  title: '切换状态为 ' + STATUS_LABEL[next],
4284
4931
  onClick: e => {
@@ -4286,7 +4933,11 @@ window.__ModuleLoader__.load({
4286
4933
  void act({ action: 'task.update', id: task.id, status: next })
4287
4934
  },
4288
4935
  },
4289
- isDone ? h(Icon, { name: 'check', size: 11 }) : null,
4936
+ isDone
4937
+ ? h(Icon, { name: 'check', size: 11 })
4938
+ : isDoing
4939
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '10px', color: '#409cff' } })
4940
+ : null,
4290
4941
  ),
4291
4942
  h(
4292
4943
  'div',
@@ -4322,7 +4973,7 @@ window.__ModuleLoader__.load({
4322
4973
  ? h('div', { style: { fontSize: 11, color: '#30d158', marginTop: 2 } }, '结论 · ' + task.evidence)
4323
4974
  : null,
4324
4975
  (Array.isArray(task.blockedBy) && task.blockedBy.length && !isDone)
4325
- ? h('div', { style: { fontSize: 11, color: '#ff9f0a', marginTop: 2 } }, '等待前置 ' + task.blockedBy.length + ' 项')
4976
+ ? h('div', { style: { fontSize: 11, color: '#fbbf24', marginTop: 2 } }, '等待前置 ' + task.blockedBy.length + ' 项')
4326
4977
  : null,
4327
4978
  ),
4328
4979
  h(StatusBadge, { status: task.status }),
@@ -4768,7 +5419,7 @@ window.__ModuleLoader__.load({
4768
5419
  y: minY,
4769
5420
  w: Math.max(196, maxX - minX),
4770
5421
  h: maxY - minY,
4771
- color: isBlockedFocus ? '#ff453a' : '#ff9f0a',
5422
+ color: isBlockedFocus ? '#ff453a' : '#409cff',
4772
5423
  isBlocked: isBlockedFocus,
4773
5424
  badgeLabel,
4774
5425
  agentCount,
@@ -4936,7 +5587,7 @@ window.__ModuleLoader__.load({
4936
5587
  h('span', {
4937
5588
  key: d.id,
4938
5589
  className: 'dnb-tag',
4939
- style: { background: STATUS_BG.doing, color: '#ff9f0a', fontSize: 10.5 },
5590
+ style: { background: 'rgba(245, 158, 11, 0.16)', color: '#fbbf24', fontSize: 10.5 },
4940
5591
  }, '⏳ 等待前置:' + clampTitle(d.title || d.id, 14)),
4941
5592
  ),
4942
5593
  doneDeps.map(d =>
@@ -4970,7 +5621,7 @@ window.__ModuleLoader__.load({
4970
5621
  style: {
4971
5622
  width: 15,
4972
5623
  height: 15,
4973
- ...(assum.verified ? { background: '#30d158', borderColor: '#30d158' } : { borderColor: '#ff9f0a' }),
5624
+ ...(assum.verified ? { background: '#30d158', borderColor: '#30d158' } : { borderColor: '#f59e0b' }),
4974
5625
  },
4975
5626
  onClick: e => {
4976
5627
  e.stopPropagation()
@@ -5089,7 +5740,7 @@ window.__ModuleLoader__.load({
5089
5740
  type: 'button',
5090
5741
  className: 'dnb-pyr-act-btn',
5091
5742
  title: isFocusedTarget ? '退出聚光灯框选' : '框选高亮负责推进此任务的代理链路',
5092
- style: isFocusedTarget ? { borderColor: '#ff9f0a', color: '#ff9f0a', background: 'rgba(255,159,10,0.14)' } : undefined,
5743
+ style: isFocusedTarget ? { borderColor: '#409cff', color: '#409cff', background: 'rgba(10,132,255,0.14)' } : undefined,
5093
5744
  onClick: e => {
5094
5745
  e.stopPropagation()
5095
5746
  focusObjectiveInPyramid(isFocusedTarget ? '' : task.id)
@@ -5211,16 +5862,17 @@ window.__ModuleLoader__.load({
5211
5862
  h(
5212
5863
  'div',
5213
5864
  { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 } },
5214
- h('span', {
5215
- className: isRunning ? 'dnb-live-dot' : undefined,
5216
- style: {
5217
- width: 8,
5218
- height: 8,
5219
- borderRadius: '50%',
5220
- background: isRunning ? '#30d158' : (focusTone === 'blocked' ? '#ff453a' : focusTone === 'doing' ? '#ff9f0a' : 'var(--dnb-text-3)'),
5221
- flexShrink: 0,
5222
- },
5223
- }),
5865
+ isRunning
5866
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '9px', color: '#409cff' } })
5867
+ : h('span', {
5868
+ style: {
5869
+ width: 8,
5870
+ height: 8,
5871
+ borderRadius: '50%',
5872
+ background: focusTone === 'blocked' ? '#ff453a' : focusTone === 'doing' ? '#409cff' : 'var(--dnb-text-3)',
5873
+ flexShrink: 0,
5874
+ },
5875
+ }),
5224
5876
  h('span', {
5225
5877
  style: { fontWeight: 700, fontSize: 13, color: 'var(--dnb-text)', wordBreak: 'break-all' },
5226
5878
  }, '@' + shortAgentName(agentObj.name, tier > 1)),
@@ -5232,15 +5884,19 @@ window.__ModuleLoader__.load({
5232
5884
  style: {
5233
5885
  fontSize: 10.5,
5234
5886
  fontWeight: 600,
5235
- color: isRunning ? '#30d158' : (focusTone ? (focusTone === 'blocked' ? '#ff453a' : '#ff9f0a') : 'var(--dnb-text-2)'),
5887
+ display: 'inline-flex',
5888
+ alignItems: 'center',
5889
+ gap: 4,
5890
+ color: isRunning ? '#409cff' : (focusTone ? (focusTone === 'blocked' ? '#ff453a' : '#409cff') : 'var(--dnb-text-2)'),
5236
5891
  },
5237
5892
  },
5893
+ isRunning ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8px', color: '#409cff' } }) : null,
5238
5894
  isRunning ? `${tierLabel} · 运行中` : tierLabel,
5239
5895
  ),
5240
5896
  ),
5241
5897
  desc
5242
5898
  ? h('div', {
5243
- style: { fontSize: 11.5, color: isRunning ? '#30d158' : 'var(--dnb-text-2)', marginTop: 4, lineHeight: 1.4, wordBreak: 'break-word' },
5899
+ style: { fontSize: 11.5, color: isRunning ? '#409cff' : 'var(--dnb-text-2)', marginTop: 4, lineHeight: 1.4, wordBreak: 'break-word' },
5244
5900
  }, desc)
5245
5901
  : null,
5246
5902
  // Openly laid-out subagent actions right on the agent card
@@ -5555,17 +6211,44 @@ window.__ModuleLoader__.load({
5555
6211
  },
5556
6212
  }, '👑 主代理 · 总指挥'),
5557
6213
  runningKidsCount > 0
5558
- ? h('span', {
5559
- className: 'dnb-tag',
5560
- style: { background: 'rgba(48, 209, 88, 0.16)', color: '#30d158', fontWeight: 600 },
5561
- }, `${runningKidsCount} 子代理运行中`)
6214
+ ? h(
6215
+ 'span',
6216
+ {
6217
+ className: 'dnb-tag',
6218
+ style: {
6219
+ background: 'rgba(10, 132, 255, 0.15)',
6220
+ color: '#409cff',
6221
+ fontWeight: 600,
6222
+ display: 'inline-flex',
6223
+ alignItems: 'center',
6224
+ gap: 4.5,
6225
+ },
6226
+ },
6227
+ h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8.5px', color: '#409cff' } }),
6228
+ `${runningKidsCount} 子代理运行中`,
6229
+ )
5562
6230
  : null,
5563
6231
  doingTotal > 0
5564
- ? h('span', { className: 'dnb-tag', style: { background: STATUS_BG.doing, color: '#ff9f0a', fontWeight: 600 } }, `推进 ${doingTotal}`)
5565
- : null,
5566
- blockedTotal > 0
5567
- ? h('span', { className: 'dnb-tag', style: { background: STATUS_BG.blocked, color: '#ff453a', fontWeight: 600 } }, `受阻 ${blockedTotal}`)
5568
- : null,
6232
+ ? h(
6233
+ 'span',
6234
+ {
6235
+ className: 'dnb-tag',
6236
+ style: {
6237
+ background: STATUS_BG.doing,
6238
+ color: '#409cff',
6239
+ fontWeight: 600,
6240
+ display: 'inline-flex',
6241
+ alignItems: 'center',
6242
+ gap: 4.5,
6243
+ },
6244
+ },
6245
+ h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8.5px', color: '#409cff' } }),
6246
+ `推进 ${doingTotal}`,
6247
+ )
6248
+ : null,
6249
+ blockedTotal > 0
6250
+ ? h('span', { className: 'dnb-tag', style: { background: STATUS_BG.blocked, color: '#ff453a', fontWeight: 600 } }, `受阻 ${blockedTotal}`)
6251
+ : null,
5569
6252
  doneTotal > 0
5570
6253
  ? h('span', { className: 'dnb-tag', style: { background: STATUS_BG.done, color: '#30d158' } }, `完成 ${doneTotal}/${allTasks.length}`)
5571
6254
  : null,
@@ -5606,7 +6289,7 @@ window.__ModuleLoader__.load({
5606
6289
  ? board.objective
5607
6290
  : (allTasks.length
5608
6291
  ? `共 ${allTasks.length} 项任务节点(推进中 ${doingTotal} · 受阻 ${blockedTotal} · 待推进 ${todoTotal} · 已完成 ${doneTotal})`
5609
- : '尚未设定长期目标(可在「规划」页签设定 /goal,或点右上「拆解任务图」)'),
6292
+ : '尚未设定长期目标(可在「规划」页签设定目标,或点右上「拆解任务图」)'),
5610
6293
  ),
5611
6294
  ),
5612
6295
 
@@ -5698,8 +6381,8 @@ window.__ModuleLoader__.load({
5698
6381
 
5699
6382
  if (isFocusEdge || isLiveEdge) {
5700
6383
  const hiColor = isFocusEdge
5701
- ? (focusedTask.status === 'blocked' ? '#ff453a' : '#ff9f0a')
5702
- : (kid.kind === 'task' && kid.task.status === 'blocked' ? '#ff453a' : kid.kind === 'agent' ? '#30d158' : '#ff9f0a')
6384
+ ? (focusedTask.status === 'blocked' ? '#ff453a' : '#0a84ff')
6385
+ : (kid.kind === 'task' && kid.task.status === 'blocked' ? '#ff453a' : '#0a84ff')
5703
6386
  els.push(h('path', {
5704
6387
  key: `hi-${parent.id}-${kid.id}`,
5705
6388
  d: `M ${px} ${py} V ${midY} H ${cx} V ${cy}`,
@@ -5717,7 +6400,7 @@ window.__ModuleLoader__.load({
5717
6400
  cy,
5718
6401
  r: isFocusEdge ? 3.2 : 2.3,
5719
6402
  fill: isFocusEdge
5720
- ? (focusedTask.status === 'blocked' ? '#ff453a' : '#ff9f0a')
6403
+ ? (focusedTask.status === 'blocked' ? '#ff453a' : '#0a84ff')
5721
6404
  : 'var(--dnb-border-strong, rgba(165,165,178,0.75))',
5722
6405
  opacity: (focusedTask && !isFocusEdge) ? 0.25 : 1,
5723
6406
  }))
@@ -5756,7 +6439,7 @@ window.__ModuleLoader__.load({
5756
6439
  key: `drop-lr-${parent.id}-${kid.id}`,
5757
6440
  d: `M ${midX} ${cy} H ${cx}`,
5758
6441
  fill: 'none',
5759
- stroke: isFocusEdge ? '#ff9f0a' : 'var(--dnb-border-strong, rgba(155,155,168,0.52))',
6442
+ stroke: isFocusEdge ? '#0a84ff' : 'var(--dnb-border-strong, rgba(155,155,168,0.52))',
5760
6443
  strokeWidth: isFocusEdge ? 2.2 : 1.6,
5761
6444
  }))
5762
6445
  }
@@ -5779,7 +6462,7 @@ window.__ModuleLoader__.load({
5779
6462
  key: 'dep-' + from.id + '-' + to.id,
5780
6463
  d,
5781
6464
  fill: 'none',
5782
- stroke: satisfied ? '#30d158' : '#ff9f0a',
6465
+ stroke: satisfied ? '#30d158' : '#f59e0b',
5783
6466
  strokeWidth: 1.5,
5784
6467
  strokeDasharray: satisfied ? '3 2.5' : '5 3.5',
5785
6468
  markerEnd: satisfied ? 'url(#dnb-arrow-done)' : 'url(#dnb-arrow-wait)',
@@ -5830,7 +6513,7 @@ window.__ModuleLoader__.load({
5830
6513
  ? h('text', {
5831
6514
  x: x + w - 12, y: y + 21,
5832
6515
  textAnchor: 'end',
5833
- fill: '#30d158',
6516
+ fill: '#409cff',
5834
6517
  fontSize: 10,
5835
6518
  fontWeight: 600,
5836
6519
  }, `${runningKids} 运行中`)
@@ -5900,9 +6583,9 @@ window.__ModuleLoader__.load({
5900
6583
  const isFiltered = store.filterAgent === ag.name
5901
6584
  const tierLabel = node.tier === 1 ? '一级代理' : `${node.tier}级代理`
5902
6585
  const accent = isAgentFocused
5903
- ? (focusedTask && focusedTask.status === 'blocked' ? '#ff453a' : '#ff9f0a')
6586
+ ? (focusedTask && focusedTask.status === 'blocked' ? '#ff453a' : '#0a84ff')
5904
6587
  : isRunning
5905
- ? '#30d158'
6588
+ ? '#0a84ff'
5906
6589
  : 'var(--dnb-border-strong, rgba(140,140,150,0.4))'
5907
6590
  const desc = ag.taskTitle || ag.description || (isRunning ? '正在执行任务…' : '待命 / 已完成')
5908
6591
 
@@ -5928,22 +6611,31 @@ window.__ModuleLoader__.load({
5928
6611
  className: 'dnb-pulse-ring',
5929
6612
  x: x - 2.5, y: y - 2.5, width: w + 5, height: nh + 5, rx: NODE_R + 2,
5930
6613
  fill: 'none',
5931
- stroke: isAgentFocused ? accent : '#30d158',
6614
+ stroke: isAgentFocused ? accent : '#0a84ff',
5932
6615
  strokeWidth: 1.8,
5933
6616
  })
5934
6617
  : null,
5935
6618
  h('rect', {
5936
6619
  x, y, width: w, height: nh, rx: NODE_R,
5937
6620
  fill: isAgentFocused
5938
- ? (focusedTask && focusedTask.status === 'blocked' ? 'rgba(255,69,58,0.12)' : 'rgba(255,159,10,0.12)')
6621
+ ? (focusedTask && focusedTask.status === 'blocked' ? 'rgba(255,69,58,0.12)' : 'rgba(10,132,255,0.12)')
5939
6622
  : 'var(--dsw-alias-bg-layer-2, #232328)',
5940
6623
  stroke: isAgentFocused || isRunning || isFiltered ? accent : 'var(--dnb-border)',
5941
6624
  strokeWidth: isAgentFocused ? 2.1 : (isRunning || isFiltered ? 1.6 : 1.1),
5942
6625
  }),
5943
- h('circle', {
5944
- cx: x + 13, cy: y + 18, r: 4,
5945
- fill: isRunning ? '#30d158' : (isAgentFocused ? accent : 'var(--dnb-text-3)'),
5946
- }),
6626
+ isRunning
6627
+ ? h('circle', {
6628
+ className: 'dnb-svg-spin',
6629
+ cx: x + 13, cy: y + 18, r: 4,
6630
+ fill: 'none',
6631
+ stroke: '#409cff',
6632
+ strokeWidth: 1.6,
6633
+ strokeDasharray: '16 9',
6634
+ })
6635
+ : h('circle', {
6636
+ cx: x + 13, cy: y + 18, r: 4,
6637
+ fill: isAgentFocused ? accent : 'var(--dnb-text-3)',
6638
+ }),
5947
6639
  h('text', {
5948
6640
  x: x + 23, y: y + 22,
5949
6641
  fill: 'var(--dnb-text, #f2f2f7)',
@@ -5959,7 +6651,7 @@ window.__ModuleLoader__.load({
5959
6651
  }, tierLabel),
5960
6652
  h('text', {
5961
6653
  x: x + 12, y: y + 40,
5962
- fill: isRunning ? '#30d158' : 'var(--dnb-text-2, #98989d)',
6654
+ fill: isRunning ? '#409cff' : 'var(--dnb-text-2, #98989d)',
5963
6655
  fontSize: 10.5,
5964
6656
  }, clampTitle(desc, 12)),
5965
6657
  kidCount > 0
@@ -6035,7 +6727,7 @@ window.__ModuleLoader__.load({
6035
6727
  fill: isBlocked
6036
6728
  ? 'rgba(255, 69, 58, 0.11)'
6037
6729
  : isDoing
6038
- ? 'rgba(255, 159, 10, 0.09)'
6730
+ ? 'rgba(10, 132, 255, 0.09)'
6039
6731
  : isSelected
6040
6732
  ? 'var(--dnb-elevated, #2c2c2e)'
6041
6733
  : 'var(--dsw-alias-bg-layer-2, #222225)',
@@ -6045,11 +6737,21 @@ window.__ModuleLoader__.load({
6045
6737
  strokeWidth: (isSelected || isFocusedTarget) ? 2.2 : ((isDoing || isBlocked) ? 1.6 : 1),
6046
6738
  }),
6047
6739
  h('rect', {
6048
- x: x + 9, y: y + 8, width: isBlocked ? 52 : 60, height: 16, rx: 8,
6740
+ x: x + 9, y: y + 8, width: isBlocked ? 52 : (isDoing ? 66 : 60), height: 16, rx: 8,
6049
6741
  fill: badgeBg,
6050
6742
  }),
6743
+ isDoing
6744
+ ? h('circle', {
6745
+ className: 'dnb-svg-spin',
6746
+ cx: x + 19, y: y + 16, r: 3.6,
6747
+ fill: 'none',
6748
+ stroke: '#409cff',
6749
+ strokeWidth: 1.4,
6750
+ strokeDasharray: '14 8',
6751
+ })
6752
+ : null,
6051
6753
  h('text', {
6052
- x: x + (isBlocked ? 35 : 39), y: y + 19.5,
6754
+ x: x + (isBlocked ? 35 : (isDoing ? 47 : 39)), y: y + 19.5,
6053
6755
  textAnchor: 'middle',
6054
6756
  fill: color,
6055
6757
  fontSize: 9.5,
@@ -6059,7 +6761,7 @@ window.__ModuleLoader__.load({
6059
6761
  ? h('text', {
6060
6762
  x: x + w - 10, y: y + 19.5,
6061
6763
  textAnchor: 'end',
6062
- fill: '#ff9f0a',
6764
+ fill: '#f59e0b',
6063
6765
  fontSize: 9.5,
6064
6766
  fontWeight: 600,
6065
6767
  }, `等 ${unresolvedDepCount}`)
@@ -6100,14 +6802,14 @@ window.__ModuleLoader__.load({
6100
6802
  h('rect', {
6101
6803
  className: 'dnb-spotlight-halo',
6102
6804
  x: sp.x - 4, y: sp.y - 4, width: sp.w + 8, height: sp.h + 8, rx: 18,
6103
- fill: sp.isBlocked ? 'rgba(255, 69, 58, 0.08)' : 'rgba(255, 159, 10, 0.08)',
6805
+ fill: sp.isBlocked ? 'rgba(255, 69, 58, 0.08)' : 'rgba(10, 132, 255, 0.08)',
6104
6806
  stroke: sp.color,
6105
6807
  strokeWidth: 1,
6106
6808
  opacity: 0.55,
6107
6809
  }),
6108
6810
  h('rect', {
6109
6811
  x: sp.x, y: sp.y, width: sp.w, height: sp.h, rx: 15,
6110
- fill: sp.isBlocked ? 'rgba(255, 69, 58, 0.05)' : 'rgba(255, 159, 10, 0.05)',
6812
+ fill: sp.isBlocked ? 'rgba(255, 69, 58, 0.05)' : 'rgba(10, 132, 255, 0.05)',
6111
6813
  stroke: sp.color,
6112
6814
  strokeWidth: 2.3,
6113
6815
  }),
@@ -6148,9 +6850,9 @@ window.__ModuleLoader__.load({
6148
6850
 
6149
6851
  const STATUS_FILTERS = [
6150
6852
  { key: 'all', label: '全部', count: allTasks.length },
6151
- { key: 'doing', label: '推进中', count: doingTotal, color: '#ff9f0a' },
6853
+ { key: 'doing', label: '推进中', count: doingTotal, color: '#0a84ff' },
6152
6854
  { key: 'blocked', label: '受阻', count: blockedTotal, color: '#ff453a' },
6153
- { key: 'todo', label: '待推进', count: todoTotal, color: '#0a84ff' },
6855
+ { key: 'todo', label: '待推进', count: todoTotal, color: '#8e8e93' },
6154
6856
  { key: 'done', label: '已完成', count: doneTotal, color: '#30d158' },
6155
6857
  ]
6156
6858
 
@@ -6171,7 +6873,7 @@ window.__ModuleLoader__.load({
6171
6873
  'div',
6172
6874
  { className: 'dnb-progress', style: { marginBottom: 8 } },
6173
6875
  doneTotal ? h('div', { style: { width: (doneTotal / allTasks.length) * 100 + '%', background: '#30d158', transition: 'width 0.3s ease' } }) : null,
6174
- doingTotal ? h('div', { style: { width: (doingTotal / allTasks.length) * 100 + '%', background: '#ff9f0a', transition: 'width 0.3s ease' } }) : null,
6876
+ doingTotal ? h('div', { style: { width: (doingTotal / allTasks.length) * 100 + '%', background: '#0a84ff', transition: 'width 0.3s ease' } }) : null,
6175
6877
  blockedTotal ? h('div', { style: { width: (blockedTotal / allTasks.length) * 100 + '%', background: '#ff453a', transition: 'width 0.3s ease' } }) : null,
6176
6878
  )
6177
6879
  : null,
@@ -6192,9 +6894,11 @@ window.__ModuleLoader__.load({
6192
6894
  style: { height: 24, padding: '0 8.5px', fontSize: 11 },
6193
6895
  onClick: () => patch({ taskStatusFilter: f.key }),
6194
6896
  },
6195
- f.color
6196
- ? h('span', { style: { width: 6, height: 6, borderRadius: '50%', background: f.color } })
6197
- : null,
6897
+ f.key === 'doing' && doingTotal > 0
6898
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8.5px', color: '#409cff' } })
6899
+ : f.color
6900
+ ? h('span', { style: { width: 6, height: 6, borderRadius: '50%', background: f.color } })
6901
+ : null,
6198
6902
  `${f.label} ${f.count}`,
6199
6903
  ),
6200
6904
  ),
@@ -6374,7 +7078,7 @@ window.__ModuleLoader__.load({
6374
7078
  h('marker', {
6375
7079
  id: 'dnb-arrow-wait', viewBox: '0 0 10 10', refX: '8', refY: '5',
6376
7080
  markerWidth: '5.5', markerHeight: '5.5', orient: 'auto-start-reverse',
6377
- }, h('path', { d: 'M 0 1.5 L 9 5 L 0 8.5 z', fill: '#ff9f0a' })),
7081
+ }, h('path', { d: 'M 0 1.5 L 9 5 L 0 8.5 z', fill: '#f59e0b' })),
6378
7082
  h('marker', {
6379
7083
  id: 'dnb-arrow-done', viewBox: '0 0 10 10', refX: '8', refY: '5',
6380
7084
  markerWidth: '5.5', markerHeight: '5.5', orient: 'auto-start-reverse',
@@ -6460,7 +7164,7 @@ window.__ModuleLoader__.load({
6460
7164
  contextMenu.task.status === 'doing' && (contextMenu.task.subagent || contextMenu.task.owner)
6461
7165
  ? h('div', {
6462
7166
  className: 'dnb-menu-item',
6463
- style: { color: '#ff9f0a' },
7167
+ style: { color: '#f59e0b' },
6464
7168
  onClick: () => {
6465
7169
  const t = contextMenu.task
6466
7170
  setContextMenu(null)
@@ -6487,6 +7191,7 @@ window.__ModuleLoader__.load({
6487
7191
  /* ------------------------------------------------------------- Plan Tab */
6488
7192
 
6489
7193
  function PlanTab({ board }) {
7194
+ const view = store
6490
7195
  const [objective, setObjective] = React.useState(null)
6491
7196
  const [contextMenu, setContextMenu] = React.useState(null)
6492
7197
  const [consultIdx, setConsultIdx] = React.useState(-1)
@@ -6494,42 +7199,78 @@ window.__ModuleLoader__.load({
6494
7199
  const [secAnswers, setSecAnswers] = React.useState({})
6495
7200
  const [secAskingIdx, setSecAskingIdx] = React.useState(-1)
6496
7201
  const [newStepText, setNewStepText] = React.useState('')
7202
+ const [rejectingGoal, setRejectingGoal] = React.useState(false)
7203
+ const [rejectReason, setRejectReason] = React.useState('')
7204
+ const [showHandoffPreview, setShowHandoffPreview] = React.useState(false)
7205
+
7206
+ React.useEffect(() => {
7207
+ void loadTargets()
7208
+ }, [view.sessionId])
6497
7209
 
6498
7210
  const current = objective === null ? ((board && board.objective) || '') : objective
7211
+ const savedObj = String((board && board.objective) || '').trim()
6499
7212
  const steps = (board && Array.isArray(board.plan)) ? board.plan : []
6500
7213
  const doneCount = steps.filter(s => s && s.done).length
6501
7214
  const isGoalMode = (board && board.mode) === 'goal'
7215
+ const goalApproval = (board && board.goalApproval) || null
7216
+
7217
+ const commitObjective = async (setGoal = false, resetStalePlan = false) => {
7218
+ const nextVal = String(current || '').trim()
7219
+ setObjective(null)
7220
+ patch({ planResetPrompt: null })
7221
+ const res = await act({
7222
+ action: 'objective.set',
7223
+ objective: nextVal,
7224
+ ...(setGoal ? { setGoalMode: true } : {}),
7225
+ ...(resetStalePlan ? { resetStalePlan: true } : {}),
7226
+ })
7227
+ if (res && res.ok) {
7228
+ patch({ notice: setGoal ? '🎯 已设为长期目标并开启督导' : '核心目标已保存' })
7229
+ }
7230
+ }
6502
7231
 
6503
7232
  const saveObjective = () => {
6504
7233
  if (objective === null) return
6505
- const nextVal = objective
6506
- setObjective(null)
6507
- void act({ action: 'plan.set', objective: nextVal })
6508
- patch({ notice: '长期目标已保存' })
7234
+ const nextVal = String(objective || '').trim()
7235
+ if (nextVal !== savedObj && steps.length > 0) {
7236
+ patch({ planResetPrompt: { text: nextVal, setGoal: false } })
7237
+ setObjective(null)
7238
+ return
7239
+ }
7240
+ void commitObjective(false, false)
6509
7241
  }
6510
7242
 
6511
7243
  const toggleGoalMode = () => {
6512
- const nextMode = isGoalMode ? 'plan' : 'goal'
6513
- void act({ action: 'mode.set', mode: nextMode })
6514
- patch({
6515
- notice: nextMode === 'goal'
6516
- ? '已开启 /goal 持续督导:每轮核验长期目标是否实质推进'
6517
- : '已切回常规推进模式:按小任务板逐步勾选推进',
6518
- })
7244
+ const cleanCurrent = String(current || '').trim()
7245
+ if (!isGoalMode) {
7246
+ if (!cleanCurrent) {
7247
+ patch({ error: '请先输入本阶段核心目标,再开启目标督导' })
7248
+ return
7249
+ }
7250
+ if (cleanCurrent !== savedObj && steps.length > 0) {
7251
+ patch({ planResetPrompt: { text: cleanCurrent, setGoal: true } })
7252
+ setObjective(null)
7253
+ return
7254
+ }
7255
+ void commitObjective(true, false)
7256
+ return
7257
+ }
7258
+ void act({ action: 'mode.set', mode: 'plan' })
7259
+ patch({ notice: '已退出目标督导,切回标准计划推进模式' })
6519
7260
  }
6520
7261
 
6521
7262
  const keepIds = list => list.map(s => ({ id: s.id, text: s.text, done: s.done }))
6522
7263
  const pushSteps = next => void act({ action: 'plan.set', steps: next })
6523
7264
 
6524
7265
  const buildExplainPrompt = (stepText, idx) => {
6525
- const goalCtx = (current || '').trim() ? `(当前长期目标:${String(current).trim().slice(0, 90)})` : ''
7266
+ const goalCtx = (current || '').trim() ? `(当前核心目标:${String(current).trim().slice(0, 90)})` : ''
6526
7267
  return `请用通俗易懂的大白话给我解释一下小任务板第 ${idx + 1} 步「${String(stepText || '').slice(0, 80)}」${goalCtx}:\n1. 这条具体是什么意思?\n2. 为什么需要有这个步骤(它解决什么问题、不做会怎样)?`
6527
7268
  }
6528
7269
 
6529
7270
  const askStepViaChief = async (idx, stepText, customQuestion = '') => {
6530
7271
  setSecAskingIdx(idx)
6531
7272
  try {
6532
- const goalCtx = (current || '').trim() ? `当前长期目标:「${String(current).trim().slice(0, 100)}」。` : ''
7273
+ const goalCtx = (current || '').trim() ? `当前核心目标:「${String(current).trim().slice(0, 100)}」。` : ''
6533
7274
  const q = customQuestion
6534
7275
  ? `${goalCtx}针对小任务板第 ${idx + 1} 步「${String(stepText || '').slice(0, 90)}」,用户咨询:${customQuestion}。请结合当前会话上下文,用通俗简明的分点大白话直接解答(不要派活或改状态)。`
6535
7276
  : `${goalCtx}请结合当前会话上下文,用通俗易懂的分点大白话向用户解释小任务板第 ${idx + 1} 步「${String(stepText || '').slice(0, 90)}」:1) 这句话是什么意思;2) 为什么要有这一步;3) 目前这一步做到了什么程度或结论。`
@@ -6572,7 +7313,7 @@ window.__ModuleLoader__.load({
6572
7313
  { className: 'dnb-view' },
6573
7314
  h(ObjectiveRadarStrip, { board, compact: true }),
6574
7315
 
6575
- // ==================== Zone 1: Long-Term /goal Objective Box ====================
7316
+ // ==================== Zone 1: Long-Term Objective & Goal Supervision Box ====================
6576
7317
  h(
6577
7318
  'div',
6578
7319
  {
@@ -6582,18 +7323,19 @@ window.__ModuleLoader__.load({
6582
7323
  h(
6583
7324
  'div',
6584
7325
  { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 } },
6585
- h('span', { style: { fontWeight: 600, color: 'var(--dnb-text)' } }, '长期目标'),
6586
- h('span', {
6587
- style: {
6588
- padding: '1px 6px',
6589
- borderRadius: 6,
6590
- fontSize: 10.5,
6591
- fontFamily: 'ui-monospace, SFMono-Regular, Consolas, monospace',
6592
- fontWeight: 600,
6593
- background: isGoalMode ? 'rgba(255, 159, 10, 0.16)' : 'rgba(10, 132, 255, 0.12)',
6594
- color: isGoalMode ? '#ff9f0a' : 'var(--dnb-accent)',
6595
- },
6596
- }, '/goal'),
7326
+ h('span', { style: { fontWeight: 600, color: 'var(--dnb-text)' } }, '核心目标'),
7327
+ isGoalMode
7328
+ ? h('span', {
7329
+ style: {
7330
+ padding: '1px 7px',
7331
+ borderRadius: 99,
7332
+ fontSize: 10.5,
7333
+ fontWeight: 600,
7334
+ background: 'rgba(245, 158, 11, 0.16)',
7335
+ color: '#fbbf24',
7336
+ },
7337
+ }, '🎯 目标督导中')
7338
+ : null,
6597
7339
  board && board.objectiveAt && objective === null
6598
7340
  ? h('span', { style: { fontSize: 10.5, color: 'var(--dnb-text-3)' } }, timeLabel(board.objectiveAt))
6599
7341
  : null,
@@ -6607,16 +7349,16 @@ window.__ModuleLoader__.load({
6607
7349
  height: 23,
6608
7350
  padding: '0 8px',
6609
7351
  fontSize: 11,
6610
- borderColor: isGoalMode ? 'rgba(255, 159, 10, 0.45)' : undefined,
6611
- background: isGoalMode ? 'rgba(255, 159, 10, 0.12)' : undefined,
6612
- color: isGoalMode ? '#ff9f0a' : 'var(--dnb-text-2)',
6613
- fontWeight: isGoalMode ? 600 : 400,
7352
+ borderColor: isGoalMode ? 'rgba(245, 158, 11, 0.45)' : 'rgba(10, 132, 255, 0.35)',
7353
+ background: isGoalMode ? 'rgba(245, 158, 11, 0.14)' : 'rgba(10, 132, 255, 0.09)',
7354
+ color: isGoalMode ? '#fbbf24' : 'var(--dnb-accent)',
7355
+ fontWeight: 600,
6614
7356
  },
6615
7357
  title: isGoalMode
6616
- ? '已开启 /goal 持续目标督导:防空转守卫每轮核验长期目标是否实质推进(点击切回常规模式)'
6617
- : '点击开启 /goal 持续目标督导:盯紧上方长期总目标,防止模型只改步骤原地空转',
7358
+ ? '退出目标督导并切回标准计划模式'
7359
+ : '设为长期目标并开启督导:达成后需您拍板结项才结束',
6618
7360
  onClick: toggleGoalMode,
6619
- }, isGoalMode ? '🎯 持续督导中' : '持续督导'),
7361
+ }, isGoalMode ? '退出目标' : '🎯 设为目标'),
6620
7362
  h('button', {
6621
7363
  className: 'dnb-pill dnb-pill-accent',
6622
7364
  style: { height: 23, padding: '0 9px', fontSize: 11 },
@@ -6637,14 +7379,14 @@ window.__ModuleLoader__.load({
6637
7379
  className: 'dnb-group',
6638
7380
  style: isGoalMode
6639
7381
  ? {
6640
- borderColor: 'rgba(255, 159, 10, 0.38)',
6641
- boxShadow: '0 0 0 1px rgba(255, 159, 10, 0.10)',
7382
+ borderColor: 'rgba(245, 158, 11, 0.38)',
7383
+ boxShadow: '0 0 0 1px rgba(245, 158, 11, 0.10)',
6642
7384
  }
6643
7385
  : undefined,
6644
7386
  },
6645
7387
  h('textarea', {
6646
7388
  className: 'dnb-bare-area',
6647
- placeholder: '输入或由 /goal 自动同步长期总目标…',
7389
+ placeholder: '输入当前阶段核心目标,点击右上「🎯 设为目标」即可开启持续督导…',
6648
7390
  value: current,
6649
7391
  onChange: e => setObjective(e.target.value),
6650
7392
  onBlur: saveObjective,
@@ -6667,13 +7409,13 @@ window.__ModuleLoader__.load({
6667
7409
  padding: '5px 10px 7px',
6668
7410
  borderTop: '1px solid var(--dnb-border)',
6669
7411
  fontSize: 11,
6670
- color: isGoalMode ? '#ff9f0a' : 'var(--dnb-text-3)',
7412
+ color: isGoalMode ? '#fbbf24' : 'var(--dnb-text-3)',
6671
7413
  },
6672
7414
  },
6673
7415
  h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } },
6674
7416
  isGoalMode
6675
- ? '🎯 正在按 /goal 长期目标持续推进督导'
6676
- : '与对话 /goal 长期目标实时双向同步'),
7417
+ ? '🎯 目标督导生效中:达成后将向您请示结项,未获批准不自动退回'
7418
+ : '标准计划推进模式(点击右上「🎯 设为目标」开启持续督导)'),
6677
7419
  h(
6678
7420
  'div',
6679
7421
  { style: { display: 'flex', alignItems: 'center', gap: 5, flexShrink: 0 } },
@@ -6691,8 +7433,8 @@ window.__ModuleLoader__.load({
6691
7433
  title: '让模型用大白话解释这个长期目标的核心问题与解决思路',
6692
7434
  onClick: () => {
6693
7435
  void askLeadModel(
6694
- `请用通俗易懂的大白话给我解释一下当前长期目标「${String(current).trim().slice(0, 120)}」:核心卡点是什么、整体打算怎么解决?`,
6695
- '咨询长期目标',
7436
+ `请用通俗易懂的大白话给我解释一下当前核心目标「${String(current).trim().slice(0, 120)}」:核心卡点是什么、整体打算怎么解决?`,
7437
+ '咨询核心目标',
6696
7438
  )
6697
7439
  },
6698
7440
  }, '咨询目标')
@@ -6702,6 +7444,129 @@ window.__ModuleLoader__.load({
6702
7444
  : null,
6703
7445
  ),
6704
7446
 
7447
+ // Inline Stale Plan Reset Prompt when Objective changed and old steps exist
7448
+ view.planResetPrompt
7449
+ ? h(
7450
+ 'div',
7451
+ {
7452
+ className: 'dnb-group',
7453
+ style: {
7454
+ marginTop: 8,
7455
+ padding: '8px 10px',
7456
+ borderColor: 'rgba(245, 158, 11, 0.42)',
7457
+ background: 'rgba(245, 158, 11, 0.07)',
7458
+ display: 'flex',
7459
+ flexDirection: 'column',
7460
+ gap: 6,
7461
+ },
7462
+ },
7463
+ h('div', { style: { fontSize: 11.5, color: 'var(--dnb-text)', fontWeight: 600 } },
7464
+ `检测到您修改了核心目标,下方小任务板还有 ${steps.length} 条旧步骤:`),
7465
+ h(
7466
+ 'div',
7467
+ { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
7468
+ h('button', {
7469
+ type: 'button',
7470
+ className: 'dnb-mini-btn',
7471
+ 'data-tone': 'amber',
7472
+ onClick: () => void commitObjective(Boolean(view.planResetPrompt.setGoal), true),
7473
+ }, '清空旧步骤并重来'),
7474
+ h('button', {
7475
+ type: 'button',
7476
+ className: 'dnb-mini-btn',
7477
+ 'data-tone': 'accent',
7478
+ onClick: () => void commitObjective(Boolean(view.planResetPrompt.setGoal), false),
7479
+ }, '保留旧步骤并保存'),
7480
+ h('button', {
7481
+ type: 'button',
7482
+ className: 'dnb-mini-btn',
7483
+ onClick: () => patch({ planResetPrompt: null }),
7484
+ }, '取消'),
7485
+ ),
7486
+ )
7487
+ : null,
7488
+
7489
+ // Pending Goal Completion Human Approval Card
7490
+ (goalApproval && goalApproval.status === 'pending')
7491
+ ? h(
7492
+ 'div',
7493
+ { className: 'dnb-goal-approval-card', style: { marginTop: 10 } },
7494
+ h('div', { style: { fontSize: 12, fontWeight: 700, color: '#30d158' } }, '🎯 参谋长判定目标已达标 · 等待您拍板结项'),
7495
+ goalApproval.summary
7496
+ ? h('div', { style: { fontSize: 11.5, color: 'var(--dnb-text)', lineHeight: 1.5 } }, goalApproval.summary)
7497
+ : null,
7498
+ goalApproval.evidence
7499
+ ? h('div', {
7500
+ style: {
7501
+ padding: '6px 8px',
7502
+ borderRadius: 7,
7503
+ background: 'var(--dnb-card)',
7504
+ border: '1px solid var(--dnb-border)',
7505
+ fontSize: 11,
7506
+ color: 'var(--dnb-text-2)',
7507
+ whiteSpace: 'pre-wrap',
7508
+ },
7509
+ }, '验证依据:' + goalApproval.evidence)
7510
+ : null,
7511
+ rejectingGoal
7512
+ ? h(
7513
+ 'div',
7514
+ { style: { display: 'flex', gap: 5, marginTop: 2 } },
7515
+ h('input', {
7516
+ className: 'dnb-input',
7517
+ style: { height: 26, fontSize: 11.5, flex: 1 },
7518
+ placeholder: '填写驳回原因或补充要求…',
7519
+ value: rejectReason,
7520
+ onChange: e => setRejectReason(e.target.value),
7521
+ onKeyDown: e => {
7522
+ if (e.key === 'Enter' && rejectReason.trim()) {
7523
+ void rejectGoalApi(rejectReason).then(() => {
7524
+ setRejectingGoal(false)
7525
+ setRejectReason('')
7526
+ })
7527
+ }
7528
+ },
7529
+ }),
7530
+ h('button', {
7531
+ type: 'button',
7532
+ className: 'dnb-primary-btn',
7533
+ style: { height: 26, padding: '0 9px', fontSize: 11 },
7534
+ disabled: view.busy || !rejectReason.trim(),
7535
+ onClick: () => void rejectGoalApi(rejectReason).then(() => {
7536
+ setRejectingGoal(false)
7537
+ setRejectReason('')
7538
+ }),
7539
+ }, '提交驳回'),
7540
+ h('button', {
7541
+ type: 'button',
7542
+ className: 'dnb-pill',
7543
+ style: { height: 26, padding: '0 8px', fontSize: 11 },
7544
+ onClick: () => setRejectingGoal(false),
7545
+ }, '取消'),
7546
+ )
7547
+ : h(
7548
+ 'div',
7549
+ { style: { display: 'flex', gap: 6, marginTop: 2 } },
7550
+ h('button', {
7551
+ type: 'button',
7552
+ className: 'dnb-primary-btn',
7553
+ style: { height: 26, padding: '0 11px', fontSize: 11.5, background: '#30d158', color: '#09180e', fontWeight: 700 },
7554
+ disabled: view.busy,
7555
+ onClick: () => void approveGoalApi(),
7556
+ }, '✅ 批准结项'),
7557
+ h('button', {
7558
+ type: 'button',
7559
+ className: 'dnb-pill',
7560
+ style: { height: 26, padding: '0 9px', fontSize: 11.5 },
7561
+ onClick: () => {
7562
+ setRejectingGoal(true)
7563
+ setRejectReason('')
7564
+ },
7565
+ }, '↩ 驳回继续'),
7566
+ ),
7567
+ )
7568
+ : null,
7569
+
6705
7570
  // ==================== Zone 2: Small Task Board (Steps + Consultation) ====================
6706
7571
  h(
6707
7572
  'div',
@@ -6998,6 +7863,135 @@ window.__ModuleLoader__.load({
6998
7863
  ),
6999
7864
  ),
7000
7865
 
7866
+ // ==================== Zone 3: Cross-Session Handoff & One-Click Chief Deployment ====================
7867
+ (() => {
7868
+ const targets = Array.isArray(view.targets) ? view.targets : []
7869
+ const options = [{ id: 'new', label: '新建独立会话并部署参谋' }].concat(
7870
+ targets
7871
+ .filter(item => item && item.id !== view.sessionId)
7872
+ .map(item => ({
7873
+ id: item.id,
7874
+ label: [item.name || shortSession(item.id), timeLabel(item.lastSeen)].filter(Boolean).join(' · '),
7875
+ })),
7876
+ )
7877
+ const target = options.some(i => i.id === view.target) ? view.target : 'new'
7878
+ const policy = view.deployArchivePolicy || 'none'
7879
+ const drawers = Array.isArray(view.archiveFolders) ? view.archiveFolders : []
7880
+ return h(
7881
+ React.Fragment,
7882
+ null,
7883
+ h('div', { className: 'dnb-section-head', style: { marginTop: 14 } },
7884
+ h('span', { style: { fontWeight: 600, color: 'var(--dnb-text)' } }, '🚀 跨会话接力 & 一键部署参谋'),
7885
+ h('span', { style: { fontSize: 10.5, color: 'var(--dnb-text-3)', fontWeight: 400 } }, '冷库保持 0 Token 隔离'),
7886
+ ),
7887
+ h(
7888
+ 'div',
7889
+ { className: 'dnb-group', style: { padding: 10, display: 'flex', flexDirection: 'column', gap: 8 } },
7890
+ h(
7891
+ 'div',
7892
+ { style: { fontSize: 11, color: 'var(--dnb-text-2)' } },
7893
+ '工作档案跟随策略(同步模型/纪律/战术开关,强介入默认安全置关):',
7894
+ ),
7895
+ h(
7896
+ 'div',
7897
+ { style: { display: 'flex', gap: 4, flexWrap: 'wrap' } },
7898
+ [
7899
+ { key: 'none', label: '不带工作档案' },
7900
+ { key: 'mounted', label: '仅挂桌面备查' },
7901
+ { key: 'drawer', label: '带整个抽屉' },
7902
+ { key: 'all', label: '全柜工作档案' },
7903
+ ].map(p =>
7904
+ h('button', {
7905
+ key: p.key,
7906
+ type: 'button',
7907
+ className: 'dnb-mini-btn',
7908
+ 'data-tone': policy === p.key ? 'accent' : undefined,
7909
+ onClick: () => {
7910
+ patch({ deployArchivePolicy: p.key })
7911
+ if (p.key === 'drawer' && !view.archiveLoaded) void loadArchives(false)
7912
+ },
7913
+ }, p.label),
7914
+ ),
7915
+ ),
7916
+ policy === 'drawer'
7917
+ ? h('select', {
7918
+ className: 'dnb-input',
7919
+ style: { height: 28, padding: '0 9px', borderRadius: 9, fontSize: 11.5 },
7920
+ value: view.deployDrawer || ((drawers[0] && drawers[0].id) || 'inbox'),
7921
+ onChange: e => patch({ deployDrawer: e.target.value }),
7922
+ }, drawers.length
7923
+ ? drawers.map(d => h('option', { key: d.id, value: d.id }, `${d.label} (${d.count || 0} 卷)`))
7924
+ : [h('option', { key: 'inbox', value: 'inbox' }, '未归类收件箱 (加载抽屉中…)')])
7925
+ : null,
7926
+ h(
7927
+ 'div',
7928
+ { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
7929
+ h('button', {
7930
+ type: 'button',
7931
+ className: 'dnb-primary-btn',
7932
+ style: { flex: 1, height: 30, fontSize: 11.5 },
7933
+ disabled: Boolean(view.handoffBusy),
7934
+ onClick: () => void transfer('create', {
7935
+ deployChief: true,
7936
+ archiveTransferPolicy: policy,
7937
+ archiveDrawer: policy === 'drawer' ? (view.deployDrawer || (drawers[0] && drawers[0].id) || 'inbox') : '',
7938
+ }),
7939
+ }, '🚀 新建窗口并部署参谋长'),
7940
+ h('button', {
7941
+ type: 'button',
7942
+ className: 'dnb-pill',
7943
+ style: { height: 30, padding: '0 10px', fontSize: 11.5 },
7944
+ disabled: Boolean(view.handoffBusy),
7945
+ onClick: async () => {
7946
+ const text = store.handoffText || (await loadHandoff())
7947
+ if (text) copyText(text, '自包含交接单已复制')
7948
+ },
7949
+ }, h(Icon, { name: 'copy', size: 12 }), '复制交接单'),
7950
+ ),
7951
+ h(
7952
+ 'div',
7953
+ { style: { display: 'flex', gap: 6 } },
7954
+ h('select', {
7955
+ className: 'dnb-input',
7956
+ style: { flex: 1, height: 28, padding: '0 10px', borderRadius: 99, fontSize: 11.5 },
7957
+ value: target,
7958
+ onChange: e => patch({ target: e.target.value }),
7959
+ }, options.map(i => h('option', { key: i.id, value: i.id }, i.label))),
7960
+ h('button', {
7961
+ type: 'button',
7962
+ className: 'dnb-pill dnb-pill-accent',
7963
+ style: { height: 28, padding: '0 10px', fontSize: 11.5 },
7964
+ disabled: Boolean(view.handoffBusy),
7965
+ onClick: () => void transfer(target === 'new' ? 'create' : target, {
7966
+ deployChief: true,
7967
+ archiveTransferPolicy: policy,
7968
+ archiveDrawer: policy === 'drawer' ? (view.deployDrawer || (drawers[0] && drawers[0].id) || 'inbox') : '',
7969
+ }),
7970
+ }, '投递并部署'),
7971
+ ),
7972
+ h(
7973
+ 'div',
7974
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' } },
7975
+ h('button', {
7976
+ type: 'button',
7977
+ className: 'dnb-mini-btn',
7978
+ onClick: () => {
7979
+ const nextShow = !showHandoffPreview
7980
+ setShowHandoffPreview(nextShow)
7981
+ if (nextShow && !view.handoffText) void loadHandoff()
7982
+ },
7983
+ }, showHandoffPreview ? '收起交接单预览' : '预览自包含交接单'),
7984
+ view.transferNote
7985
+ ? h('span', { style: { fontSize: 11, color: 'var(--dnb-text-3)' } }, view.transferNote)
7986
+ : null,
7987
+ ),
7988
+ showHandoffPreview
7989
+ ? h('pre', { className: 'dnb-pre', style: { maxHeight: 160, marginTop: 2 } }, view.handoffText || '加载中…')
7990
+ : null,
7991
+ ),
7992
+ )
7993
+ })(),
7994
+
7001
7995
  // Upgraded Step Consultation & Action Context Menu
7002
7996
  contextMenu && contextMenu.stepIndex !== undefined
7003
7997
  ? (() => {
@@ -8081,6 +9075,65 @@ window.__ModuleLoader__.load({
8081
9075
  'div',
8082
9076
  { className: 'dnb-view' },
8083
9077
 
9078
+ // 0. Project Multi-Cabinet Switcher Bar
9079
+ (() => {
9080
+ const cabinets = Array.isArray(view.archiveCabinets) && view.archiveCabinets.length
9081
+ ? view.archiveCabinets
9082
+ : [{ id: view.archiveCabinetId || 'cab-main', name: '默认工程档案柜', count: items.length }]
9083
+ const activeCabId = view.archiveCabinetId || 'cab-main'
9084
+ return h(
9085
+ 'div',
9086
+ { className: 'dnb-cab-bar' },
9087
+ h('span', { style: { fontSize: 11.5, fontWeight: 600, color: 'var(--dnb-text-2)' } }, '档案柜:'),
9088
+ h('select', {
9089
+ className: 'dnb-input',
9090
+ style: { flex: 1, minWidth: 120, height: 26, padding: '0 8px', borderRadius: 8, fontSize: 11.5 },
9091
+ value: activeCabId,
9092
+ onChange: e => {
9093
+ const nextCid = e.target.value
9094
+ patch({ archiveCabinetId: nextCid })
9095
+ void mutateArchiveApi({ op: 'switchCabinet', cabinetId: nextCid }, '已切换工程档案柜')
9096
+ },
9097
+ }, cabinets.map(c => h('option', { key: c.id, value: c.id }, `${c.name} (${c.count ?? 0})`))),
9098
+ h('button', {
9099
+ type: 'button',
9100
+ className: 'dnb-mini-btn',
9101
+ onClick: () => patch({ archiveNewCabinetOpen: !view.archiveNewCabinetOpen }),
9102
+ }, '+ 新柜'),
9103
+ view.archiveNewCabinetOpen
9104
+ ? h(
9105
+ 'div',
9106
+ { style: { display: 'flex', gap: 5, width: '100%', marginTop: 2 } },
9107
+ h('input', {
9108
+ className: 'dnb-input',
9109
+ style: { height: 26, fontSize: 11.5, borderRadius: 8, flex: 1 },
9110
+ placeholder: '输入新档案柜名称(如:压测专项档案柜)…',
9111
+ value: view.archiveNewCabinetName || '',
9112
+ onChange: e => patch({ archiveNewCabinetName: e.target.value }),
9113
+ onKeyDown: async e => {
9114
+ if (e.key === 'Enter' && (view.archiveNewCabinetName || '').trim()) {
9115
+ const nm = view.archiveNewCabinetName.trim()
9116
+ patch({ archiveNewCabinetName: '', archiveNewCabinetOpen: false })
9117
+ await mutateArchiveApi({ op: 'createCabinet', name: nm }, `已新建并切入「${nm}」`)
9118
+ }
9119
+ },
9120
+ }),
9121
+ h('button', {
9122
+ type: 'button',
9123
+ className: 'dnb-primary-btn',
9124
+ style: { height: 26, padding: '0 10px', fontSize: 11 },
9125
+ onClick: async () => {
9126
+ const nm = String(view.archiveNewCabinetName || '').trim()
9127
+ if (!nm) return
9128
+ patch({ archiveNewCabinetName: '', archiveNewCabinetOpen: false })
9129
+ await mutateArchiveApi({ op: 'createCabinet', name: nm }, `已新建并切入「${nm}」`)
9130
+ },
9131
+ }, '创建'),
9132
+ )
9133
+ : null,
9134
+ )
9135
+ })(),
9136
+
8084
9137
  // 1. Top Vault Status & Chief Curation Bar
8085
9138
  h(
8086
9139
  'div',
@@ -8092,7 +9145,7 @@ window.__ModuleLoader__.load({
8092
9145
  'div',
8093
9146
  { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: 12.5, fontWeight: 600, color: 'var(--dnb-text)' } },
8094
9147
  h(Icon, { name: 'archive', size: 13.5, style: { color: '#f59e0b' } }),
8095
- `工程档案柜 · ${totalCount} 卷`,
9148
+ `工作卷宗 · ${totalCount} 卷`,
8096
9149
  ),
8097
9150
  h(
8098
9151
  'div',
@@ -8105,6 +9158,14 @@ window.__ModuleLoader__.load({
8105
9158
  h(
8106
9159
  'div',
8107
9160
  { style: { display: 'flex', alignItems: 'center', gap: 5, flexShrink: 0, flexWrap: 'wrap', justifyContent: 'flex-end' } },
9161
+ h('button', {
9162
+ type: 'button',
9163
+ className: 'dnb-pill',
9164
+ style: { height: 26, padding: '0 9px', fontSize: 11, borderColor: 'rgba(16, 185, 129, 0.4)', color: '#10b981' },
9165
+ disabled: Boolean(view.archiveHarvesting),
9166
+ title: '从最近对话中抢救命令、文件路径、接口决策与踩坑细节并归档(防上下文压缩遗忘)',
9167
+ onClick: () => void harvestArchivesApi(),
9168
+ }, view.archiveHarvesting ? '抢救中…' : '📥 抢救细节'),
8108
9169
  h('button', {
8109
9170
  type: 'button',
8110
9171
  className: 'dnb-pill dnb-pill-accent',
@@ -8116,8 +9177,23 @@ window.__ModuleLoader__.load({
8116
9177
  view.archiveOrganizing
8117
9178
  ? h(Icon, { name: 'refresh', size: 11.5, style: { animation: 'dnb-spin 0.9s linear infinite' } })
8118
9179
  : h(Icon, { name: 'sparkles', size: 11.5 }),
8119
- view.archiveOrganizing ? '参谋长收纳中…' : '请参谋长整理收纳',
9180
+ view.archiveOrganizing ? '参谋长收纳中…' : '✦ 参谋一键整理',
8120
9181
  ),
9182
+ h('button', {
9183
+ type: 'button',
9184
+ className: 'dnb-pill',
9185
+ style: { height: 26, padding: '0 9px', fontSize: 11 },
9186
+ disabled: Boolean(view.archivePrecipitating),
9187
+ title: '从当前档案柜提炼通用经验进入跨会话 0-Token 沉淀冷库',
9188
+ onClick: () => patch({
9189
+ precipitateModal: {
9190
+ op: 'cabinet',
9191
+ cabinetId: view.archiveCabinetId || 'cab-main',
9192
+ label: '当前工程档案柜',
9193
+ clearSource: false,
9194
+ },
9195
+ }),
9196
+ }, '⏬ 沉淀可复用经验'),
8121
9197
  h('button', {
8122
9198
  type: 'button',
8123
9199
  className: 'dnb-pill',
@@ -8514,6 +9590,23 @@ window.__ModuleLoader__.load({
8514
9590
  onClick: () => void requestOrganizeArchives({ folder: folder.id, scope: 'folder' }),
8515
9591
  }, h(Icon, { name: 'sparkles', size: 10 }), '整理本抽屉')
8516
9592
  : null,
9593
+ fItems.length > 0
9594
+ ? h('button', {
9595
+ type: 'button',
9596
+ className: 'dnb-mini-btn',
9597
+ disabled: view.archivePrecipitating,
9598
+ title: '从本抽屉提炼高价值可复用经验到项目沉淀冷库(默认 0 Token 隔离)',
9599
+ onClick: () => patch({
9600
+ precipitateModal: {
9601
+ op: 'drawer',
9602
+ cabinetId: view.archiveCabinetId || 'cab-main',
9603
+ folder: folder.id,
9604
+ label: folder.label + '抽屉',
9605
+ clearSource: false,
9606
+ },
9607
+ }),
9608
+ }, '⏬ 沉淀')
9609
+ : null,
8517
9610
  h('button', {
8518
9611
  type: 'button',
8519
9612
  className: 'dnb-mini-btn',
@@ -8545,6 +9638,121 @@ window.__ModuleLoader__.load({
8545
9638
  ),
8546
9639
  )
8547
9640
  }),
9641
+
9642
+ // 8. Project-wide Precipitated Cold Vault (0-Token isolated unless explicitly flipped out)
9643
+ (() => {
9644
+ const precipList = Array.isArray(view.archivePrecipitated) ? view.archivePrecipitated : []
9645
+ const flippedSet = new Set(Array.isArray(view.flippedPrecipitatedIds) ? view.flippedPrecipitatedIds : [])
9646
+ return h(
9647
+ 'div',
9648
+ { className: 'dnb-precip-box' },
9649
+ h(
9650
+ 'div',
9651
+ {
9652
+ className: 'dnb-cell dnb-cell-hover',
9653
+ style: { cursor: 'pointer', justifyContent: 'space-between', padding: '9px 11px' },
9654
+ onClick: () => patch({ archiveOpenFolders: { ...(view.archiveOpenFolders || {}), __precip: !(view.archiveOpenFolders && view.archiveOpenFolders.__precip) } }),
9655
+ },
9656
+ h(
9657
+ 'div',
9658
+ { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0 } },
9659
+ h('span', { style: { fontSize: 12, fontWeight: 700, color: 'var(--dnb-text)' } }, '🏛️ 跨会话沉淀冷库'),
9660
+ h('span', { className: 'dnb-tag', style: { fontSize: 10 } }, `${precipList.length} 条 · 默认 0 Token 隔离`),
9661
+ flippedSet.size > 0
9662
+ ? h('span', { className: 'dnb-tag', style: { fontSize: 10, background: 'rgba(10,132,255,0.14)', color: 'var(--dnb-accent)' } }, `本会话已翻出 ${flippedSet.size}`)
9663
+ : null,
9664
+ ),
9665
+ h(Icon, {
9666
+ name: 'chevron',
9667
+ size: 13,
9668
+ style: {
9669
+ color: 'var(--dnb-text-3)',
9670
+ transform: (view.archiveOpenFolders && view.archiveOpenFolders.__precip) ? 'rotate(90deg)' : 'none',
9671
+ transition: 'transform 0.16s ease',
9672
+ },
9673
+ }),
9674
+ ),
9675
+ (view.archiveOpenFolders && view.archiveOpenFolders.__precip)
9676
+ ? h(
9677
+ 'div',
9678
+ { style: { padding: '8px 11px 10px', borderTop: '1px solid var(--dnb-border)', display: 'flex', flexDirection: 'column', gap: 7 } },
9679
+ precipList.length === 0
9680
+ ? h('div', { style: { fontSize: 11.5, color: 'var(--dnb-text-3)', lineHeight: 1.5 } },
9681
+ '冷库尚空。可点击上方「⏬ 沉淀可复用经验」或抽屉右上「⏬ 沉淀」,将通用踩坑、架构约定与验收经验提炼封存于此。')
9682
+ : precipList.map(p => {
9683
+ const isFlipped = flippedSet.has(p.id)
9684
+ const isOpen = Boolean(view.archiveOpenFiles && view.archiveOpenFiles['prec_' + p.id])
9685
+ const detail = (view.archiveDetails && view.archiveDetails[p.id]) || null
9686
+ return h(
9687
+ 'div',
9688
+ {
9689
+ key: p.id,
9690
+ style: {
9691
+ borderRadius: 9,
9692
+ border: isFlipped ? '1px solid rgba(10, 132, 255, 0.45)' : '1px solid var(--dnb-border)',
9693
+ background: isFlipped ? 'rgba(10, 132, 255, 0.06)' : 'var(--dnb-elevated)',
9694
+ padding: '8px 10px',
9695
+ display: 'flex',
9696
+ flexDirection: 'column',
9697
+ gap: 5,
9698
+ },
9699
+ },
9700
+ h(
9701
+ 'div',
9702
+ {
9703
+ style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 6, cursor: 'pointer' },
9704
+ onClick: () => {
9705
+ const key = 'prec_' + p.id
9706
+ const nextOpen = !isOpen
9707
+ patch({ archiveOpenFiles: { ...(view.archiveOpenFiles || {}), [key]: nextOpen } })
9708
+ if (nextOpen && !detail) void loadArchiveDetail(p.id, false, { precipitated: true })
9709
+ },
9710
+ },
9711
+ h(
9712
+ 'div',
9713
+ { style: { display: 'flex', alignItems: 'center', gap: 6, minWidth: 0, flex: 1 } },
9714
+ h('span', { className: 'dnb-tag', style: { fontSize: 10, flexShrink: 0 } }, p.category || '经验'),
9715
+ h('span', { style: { fontSize: 12, fontWeight: 600, color: 'var(--dnb-text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, p.title),
9716
+ ),
9717
+ h('span', { style: { fontSize: 10.5, color: 'var(--dnb-text-3)', flexShrink: 0 } }, isOpen ? '收起' : `${p.pointsCount || 0} 要点`),
9718
+ ),
9719
+ p.summary
9720
+ ? h('div', { style: { fontSize: 11.5, color: 'var(--dnb-text-2)', lineHeight: 1.45 } }, p.summary)
9721
+ : null,
9722
+ isOpen && detail
9723
+ ? h(
9724
+ 'div',
9725
+ { style: { padding: '6px 8px', borderRadius: 7, background: 'var(--dnb-card)', fontSize: 11.5, color: 'var(--dnb-text-2)', lineHeight: 1.5, display: 'flex', flexDirection: 'column', gap: 4 } },
9726
+ Array.isArray(detail.points) && detail.points.length
9727
+ ? detail.points.map((pt, pidx) => h('div', { key: pidx }, h('strong', { style: { color: 'var(--dnb-text)' } }, `• ${pt.title}:`), pt.detail || pt.cue || ''))
9728
+ : h('div', { style: { whiteSpace: 'pre-wrap' } }, detail.body || detail.summary || ''),
9729
+ )
9730
+ : null,
9731
+ h(
9732
+ 'div',
9733
+ { style: { display: 'flex', alignItems: 'center', gap: 5, marginTop: 2 } },
9734
+ h('button', {
9735
+ type: 'button',
9736
+ className: 'dnb-mini-btn',
9737
+ 'data-tone': isFlipped ? 'accent' : undefined,
9738
+ onClick: () => void mutateArchiveApi(
9739
+ { op: isFlipped ? 'sealBack' : 'flipOut', id: p.id },
9740
+ isFlipped ? '🔒 已封回冷库(本会话恢复 0 Token 隔离)' : '📂 已翻出并注入当前会话参谋参考',
9741
+ ),
9742
+ }, isFlipped ? '🔒 封回冷库' : '📂 翻出注入本会话'),
9743
+ h('button', {
9744
+ type: 'button',
9745
+ className: 'dnb-mini-btn',
9746
+ style: { marginLeft: 'auto', color: '#ff453a' },
9747
+ onClick: () => void mutateArchiveApi({ op: 'deletePrecipitated', id: p.id }, '已删除沉淀条目'),
9748
+ }, '删除'),
9749
+ ),
9750
+ )
9751
+ }),
9752
+ )
9753
+ : null,
9754
+ )
9755
+ })(),
8548
9756
  )
8549
9757
  }
8550
9758
 
@@ -8552,119 +9760,17 @@ window.__ModuleLoader__.load({
8552
9760
 
8553
9761
  function HandoffTab({ view }) {
8554
9762
  React.useEffect(() => {
8555
- if (!store.handoffText) void loadHandoff()
8556
9763
  void loadTargets()
8557
9764
  }, [view.sessionId])
8558
9765
 
8559
- const targets = Array.isArray(view.targets) ? view.targets : []
8560
- const options = [{ id: 'new', label: '新建会话并交接' }].concat(
8561
- targets
8562
- .filter(item => item && item.id !== view.sessionId)
8563
- .map(item => ({
8564
- id: item.id,
8565
- label: [item.name || shortSession(item.id), timeLabel(item.lastSeen)].filter(Boolean).join(' · '),
8566
- })),
8567
- )
8568
- const target = options.some(i => i.id === view.target) ? view.target : 'new'
8569
-
8570
- const copyPacket = async () => {
8571
- const text = store.handoffText || (await loadHandoff())
8572
- if (text) copyText(text, '交接单已复制')
8573
- }
8574
-
8575
- const exportMd = () => {
8576
- const text = store.handoffText || ''
8577
- if (!text) return
8578
- const blob = new Blob([text], { type: 'text/markdown' })
8579
- const url = URL.createObjectURL(blob)
8580
- const a = document.createElement('a')
8581
- a.href = url
8582
- a.download = 'handoff-' + new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19) + '.md'
8583
- a.click()
8584
- URL.revokeObjectURL(url)
8585
- patch({ notice: '已导出 Markdown' })
8586
- }
8587
-
8588
9766
  return h(
8589
9767
  'div',
8590
9768
  { className: 'dnb-view' },
8591
- // Card 1: Quick Actions
8592
- h('div', { className: 'dnb-section-head' }, h('span', null, '会话交接')),
8593
- h(
8594
- 'div',
8595
- { className: 'dnb-group', style: { padding: 10 } },
8596
- h(
8597
- 'div',
8598
- { style: { display: 'flex', gap: 8, marginBottom: 8 } },
8599
- h('button', {
8600
- className: 'dnb-primary-btn',
8601
- style: { flex: 1 },
8602
- disabled: view.handoffBusy,
8603
- onClick: () => void copyPacket(),
8604
- }, h(Icon, { name: 'copy', size: 13 }), view.handoffBusy ? '生成中…' : '复制交接单'),
8605
- h('button', {
8606
- className: 'dnb-pill dnb-pill-accent',
8607
- style: { flex: 1, height: 30 },
8608
- disabled: view.handoffBusy,
8609
- onClick: () => void transfer('create'),
8610
- }, '新会话接力'),
8611
- ),
8612
- h(
8613
- 'div',
8614
- { style: { display: 'flex', gap: 6 } },
8615
- h('select', {
8616
- className: 'dnb-input',
8617
- style: { flex: 1, height: 30, padding: '0 10px', borderRadius: 99, fontSize: 12 },
8618
- value: target,
8619
- onChange: e => patch({ target: e.target.value }),
8620
- }, options.map(i => h('option', { key: i.id, value: i.id }, i.label))),
8621
- h('button', {
8622
- className: 'dnb-pill',
8623
- style: { height: 30 },
8624
- disabled: view.handoffBusy,
8625
- onClick: () => void transfer(target === 'new' ? 'create' : target),
8626
- }, '投递'),
8627
- ),
8628
- ),
8629
-
8630
- // Card 2: Packet Preview
8631
- h(
8632
- 'div',
8633
- { className: 'dnb-section-head', style: { marginTop: 12 } },
8634
- h('span', null, '交接单预览'),
8635
- h(
8636
- 'div',
8637
- { style: { display: 'flex', gap: 4 } },
8638
- h('button', { className: 'dnb-pill', style: { height: 22, fontSize: 11 }, onClick: () => void loadHandoff() }, '刷新'),
8639
- h('button', {
8640
- className: 'dnb-pill',
8641
- style: { height: 22, fontSize: 11 },
8642
- onClick: () => {
8643
- if (view.handoffEdit === null || view.handoffEdit === undefined) {
8644
- patch({ handoffEdit: view.handoffText || '' })
8645
- } else {
8646
- patch({ handoffText: view.handoffEdit, handoffEdit: null, notice: '已更新预览' })
8647
- }
8648
- },
8649
- }, view.handoffEdit === null || view.handoffEdit === undefined ? '编辑' : '完成'),
8650
- h('button', { className: 'dnb-pill', style: { height: 22, fontSize: 11 }, onClick: exportMd }, '导出'),
8651
- ),
8652
- ),
8653
- h(
8654
- 'div',
8655
- { className: 'dnb-group' },
8656
- view.handoffEdit === null || view.handoffEdit === undefined
8657
- ? h('pre', { className: 'dnb-pre', style: { maxHeight: 220 } }, view.handoffText || '暂无内容')
8658
- : h('textarea', {
8659
- className: 'dnb-bare-area',
8660
- style: { minHeight: 180, fontFamily: 'monospace', fontSize: 11.5 },
8661
- value: view.handoffEdit,
8662
- onChange: e => patch({ handoffEdit: e.target.value }),
8663
- }),
9769
+ // Guard Preferences (Cross-session handoff now lives in `规划` Zone 3)
9770
+ h('div', { className: 'dnb-section-head' },
9771
+ h('span', { style: { fontWeight: 600, color: 'var(--dnb-text)' } }, '自动化守护偏好'),
9772
+ h('span', { style: { fontSize: 10.5, color: 'var(--dnb-text-3)', fontWeight: 400 } }, '跨会话接力已收口至「规划」页底部'),
8664
9773
  ),
8665
-
8666
- // Card 3: iOS Settings Switches
8667
- h('div', { className: 'dnb-section-head', style: { marginTop: 12 } }, h('span', null, '自动化偏好')),
8668
9774
  h(
8669
9775
  'div',
8670
9776
  { className: 'dnb-group' },
@@ -8825,11 +9931,18 @@ window.__ModuleLoader__.load({
8825
9931
  { className: 'dnb-section-head' },
8826
9932
  h(
8827
9933
  'span',
8828
- { style: { display: 'inline-flex', alignItems: 'center', gap: 6 } },
9934
+ {
9935
+ style: {
9936
+ display: 'inline-flex',
9937
+ alignItems: 'center',
9938
+ gap: 6,
9939
+ color: field === 'allowed' ? '#34d399' : field === 'forbidden' ? '#ff6961' : '#fbbf24',
9940
+ },
9941
+ },
8829
9942
  h('span', { style: { width: 7, height: 7, borderRadius: '50%', background: dot } }),
8830
9943
  label,
8831
9944
  pinnedCountInCol > 0
8832
- ? h('span', { style: { fontSize: 10.5, color: '#ff9f0a', fontWeight: 600 } }, `📌${pinnedCountInCol}`)
9945
+ ? h('span', { style: { fontSize: 10.5, color: '#fbbf24', fontWeight: 600 } }, `📌${pinnedCountInCol}`)
8833
9946
  : null,
8834
9947
  ),
8835
9948
  h(
@@ -8876,7 +9989,7 @@ window.__ModuleLoader__.load({
8876
9989
  style: {
8877
9990
  justifyContent: 'space-between',
8878
9991
  gap: 8,
8879
- background: isPinned ? 'linear-gradient(90deg, rgba(255, 159, 10, 0.08) 0%, transparent 65%)' : undefined,
9992
+ background: isPinned ? 'linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, transparent 65%)' : undefined,
8880
9993
  },
8881
9994
  },
8882
9995
  // Front Pushpin Stamp (小图钉戳)
@@ -9022,7 +10135,7 @@ window.__ModuleLoader__.load({
9022
10135
  className: 'dnb-pill',
9023
10136
  'data-active': subTab === 'handoff' ? '1' : '0',
9024
10137
  onClick: () => patch({ boundSubTab: 'handoff' }),
9025
- }, '会话交接 & 守护'),
10138
+ }, '守护偏好'),
9026
10139
  ),
9027
10140
  subTab === 'rules'
9028
10141
  ? h(
@@ -9035,9 +10148,9 @@ window.__ModuleLoader__.load({
9035
10148
  height: 25,
9036
10149
  padding: '0 9px',
9037
10150
  fontSize: 11,
9038
- color: '#ff9f0a',
9039
- background: 'rgba(255, 159, 10, 0.12)',
9040
- borderColor: 'rgba(255, 159, 10, 0.32)',
10151
+ color: '#fbbf24',
10152
+ background: 'rgba(245, 158, 11, 0.12)',
10153
+ borderColor: 'rgba(245, 158, 11, 0.34)',
9041
10154
  },
9042
10155
  disabled: view.secBusy,
9043
10156
  title: '请 DSH 参谋长把当前零散、重复的多条重要边界浓缩合并成一条高密度总则',
@@ -9153,16 +10266,58 @@ window.__ModuleLoader__.load({
9153
10266
 
9154
10267
  function classifyBulletTagTone(tag) {
9155
10268
  const t = String(tag || '')
9156
- if (/禁止|红线|受阻|风险|告警|错误|撞墙/.test(t)) {
9157
- return { bg: 'rgba(255, 69, 58, 0.15)', fg: '#ff453a' }
10269
+ if (
10270
+ /禁止|红线|受阻|错误|失败|撞墙|高危|违规|严禁|崩溃|死锁/.test(t)
10271
+ || (/风险|告警|异常/.test(t) && !/保障|兜底|已解|可控|无风险|解除/.test(t))
10272
+ ) {
10273
+ return { bg: 'rgba(255, 69, 58, 0.16)', fg: '#ff6961', border: 'rgba(255, 69, 58, 0.30)', spinning: false }
10274
+ }
10275
+ if (/完成|已完|结论|允许|已解|就绪|已验证|通过|已执行|已处理|兜底|保障|达成/.test(t)) {
10276
+ return { bg: 'rgba(48, 209, 88, 0.15)', fg: '#30d158', border: 'rgba(48, 209, 88, 0.28)', spinning: false }
9158
10277
  }
9159
- if (/推进|进行|待验|注意|提醒/.test(t)) {
9160
- return { bg: 'rgba(255, 159, 10, 0.16)', fg: '#ff9f0a' }
10278
+ if (/待办|待收尾|待推进|未完|未开始|待定|搁置|排队|空闲|休眠/.test(t)) {
10279
+ return { bg: 'rgba(142, 142, 147, 0.16)', fg: '#a1a1aa', border: 'rgba(142, 142, 147, 0.26)', spinning: false }
9161
10280
  }
9162
- if (/完成|结论|允许|已解|就绪|已执行|已处理/.test(t)) {
9163
- return { bg: 'rgba(48, 209, 88, 0.15)', fg: '#30d158' }
10281
+ if (/注意|提醒|警告|警惕|纪律|顺序|验收|待验|核对|原因|约束|谨慎|观察|复核|风险/.test(t)) {
10282
+ return { bg: 'rgba(245, 158, 11, 0.16)', fg: '#fbbf24', border: 'rgba(245, 158, 11, 0.30)', spinning: false }
9164
10283
  }
9165
- return { bg: 'rgba(10, 132, 255, 0.14)', fg: '#409cff' }
10284
+ if (/推进|进行中|执行中|运行中|处理中|排查中|构建中|同步中|验证中/.test(t)) {
10285
+ return { bg: 'rgba(10, 132, 255, 0.16)', fg: '#409cff', border: 'rgba(10, 132, 255, 0.32)', spinning: true }
10286
+ }
10287
+ return { bg: 'rgba(10, 132, 255, 0.14)', fg: '#409cff', border: 'rgba(10, 132, 255, 0.26)', spinning: false }
10288
+ }
10289
+
10290
+ function classifySectionHeadingTone(heading) {
10291
+ const s = String(heading || '')
10292
+ const hasWarn = /纪律|边界|注意|提醒|警告|风险|约束|验收|待验/.test(s)
10293
+ const hasRed = /禁止|红线|受阻|阻塞|错误|告警|故障/.test(s)
10294
+ if (hasWarn && hasRed) {
10295
+ return { fg: '#fbbf24', bar: 'linear-gradient(180deg, #f59e0b 0%, #ff453a 100%)' }
10296
+ }
10297
+ if (hasRed) {
10298
+ return { fg: '#ff6961', bar: '#ff453a' }
10299
+ }
10300
+ if (hasWarn) {
10301
+ return { fg: '#fbbf24', bar: '#f59e0b' }
10302
+ }
10303
+ if (/已完成|达成|放行|收口/.test(s)) {
10304
+ return { fg: '#34d399', bar: '#30d158' }
10305
+ }
10306
+ if (/待办|未完成|遗留|后续/.test(s)) {
10307
+ return { fg: '#a1a1aa', bar: '#8e8e93' }
10308
+ }
10309
+ return { fg: '#60a5fa', bar: '#0a84ff' }
10310
+ }
10311
+
10312
+ function renderStructuredHeading(heading, compact) {
10313
+ if (!heading) return null
10314
+ const tone = classifySectionHeadingTone(heading)
10315
+ return h(
10316
+ 'div',
10317
+ { className: compact ? 'dnb-struct-head is-compact' : 'dnb-struct-head', style: { color: tone.fg } },
10318
+ h('span', { className: 'dnb-struct-bar', style: { background: tone.bar } }),
10319
+ h('span', null, heading),
10320
+ )
9166
10321
  }
9167
10322
 
9168
10323
  function splitTaggedBullet(rawLine) {
@@ -9241,16 +10396,21 @@ window.__ModuleLoader__.load({
9241
10396
  style: {
9242
10397
  display: 'inline-flex',
9243
10398
  alignItems: 'center',
10399
+ gap: 4.5,
9244
10400
  padding: '1px 6.5px',
9245
10401
  borderRadius: 6,
9246
10402
  fontSize: 10.5,
9247
10403
  fontWeight: 700,
9248
10404
  background: tone.bg,
9249
10405
  color: tone.fg,
10406
+ border: '1px solid ' + tone.border,
9250
10407
  flexShrink: 0,
9251
10408
  marginTop: 1.5,
9252
10409
  },
9253
10410
  },
10411
+ tone.spinning
10412
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '9px', color: tone.fg } })
10413
+ : null,
9254
10414
  item.badge,
9255
10415
  )
9256
10416
  : h('span', {
@@ -9281,9 +10441,7 @@ window.__ModuleLoader__.load({
9281
10441
  h(
9282
10442
  'div',
9283
10443
  { key: bi, style: { marginTop: bi === 0 ? 0 : 6 } },
9284
- blk.heading
9285
- ? h('div', { style: { fontSize: 11.5, fontWeight: 700, color: 'var(--dnb-text-2)', marginBottom: 2 } }, blk.heading)
9286
- : null,
10444
+ blk.heading ? renderStructuredHeading(blk.heading, true) : null,
9287
10445
  blk.items.map((it, ii) => renderStructuredItem(it, `${bi}-${ii}`)),
9288
10446
  ),
9289
10447
  ),
@@ -9412,7 +10570,7 @@ window.__ModuleLoader__.load({
9412
10570
  h(
9413
10571
  'div',
9414
10572
  { key: i, style: { marginTop: i === 0 ? 0 : 12 } },
9415
- blk.heading ? h('div', { className: 'dnb-prose-h2', style: { marginTop: 0, marginBottom: 4 } }, blk.heading) : null,
10573
+ blk.heading ? renderStructuredHeading(blk.heading, false) : null,
9416
10574
  (blk.items || []).map((it, j) => renderStructuredItem(it, `${i}-${j}`)),
9417
10575
  ),
9418
10576
  )
@@ -9458,7 +10616,33 @@ window.__ModuleLoader__.load({
9458
10616
  ),
9459
10617
  item.role === 'chief'
9460
10618
  ? renderStructuredText(item.text)
9461
- : h('div', { style: { fontSize: 12, color: 'var(--dnb-text)', lineHeight: 1.5, whiteSpace: 'pre-wrap' } }, item.text),
10619
+ : h(
10620
+ React.Fragment,
10621
+ null,
10622
+ item.imageCount > 0
10623
+ ? h(
10624
+ 'div',
10625
+ {
10626
+ style: {
10627
+ display: 'inline-flex',
10628
+ alignItems: 'center',
10629
+ gap: 4,
10630
+ padding: '1px 7px',
10631
+ marginBottom: item.text ? 4 : 0,
10632
+ borderRadius: 999,
10633
+ background: 'rgba(10, 132, 255, 0.15)',
10634
+ color: '#409cff',
10635
+ fontSize: 10.5,
10636
+ fontWeight: 600,
10637
+ },
10638
+ },
10639
+ `🖼 附图 ×${item.imageCount}`,
10640
+ )
10641
+ : null,
10642
+ item.text
10643
+ ? h('div', { style: { fontSize: 12, color: 'var(--dnb-text)', lineHeight: 1.5, whiteSpace: 'pre-wrap' } }, item.text)
10644
+ : null,
10645
+ ),
9462
10646
  Array.isArray(item.actions) && item.actions.length
9463
10647
  ? h(
9464
10648
  'div',
@@ -9519,7 +10703,13 @@ window.__ModuleLoader__.load({
9519
10703
  'div',
9520
10704
  { style: { display: 'flex', alignItems: 'center', gap: 5 } },
9521
10705
  fact.pinned ? h(Icon, { name: 'pin', size: 11.5, style: { color: 'var(--dnb-accent)' } }) : null,
9522
- h('span', { className: 'dnb-tag' }, FACT_CAT_LABEL[fact.category] || '条目'),
10706
+ (() => {
10707
+ const ft = FACT_CAT_TONE[fact.category]
10708
+ return h('span', {
10709
+ className: 'dnb-tag',
10710
+ style: ft ? { background: ft.bg, color: ft.fg, border: '1px solid ' + ft.border } : undefined,
10711
+ }, FACT_CAT_LABEL[fact.category] || '条目')
10712
+ })(),
9523
10713
  h('span', { style: { fontSize: 10.5, color: 'var(--dnb-text-3)' } }, relativeTimeLabel(fact.updatedAt || fact.addedAt)),
9524
10714
  ),
9525
10715
  h(
@@ -9673,16 +10863,17 @@ window.__ModuleLoader__.load({
9673
10863
  h(
9674
10864
  'div',
9675
10865
  { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
9676
- h('span', {
9677
- style: {
9678
- width: 7.5,
9679
- height: 7.5,
9680
- borderRadius: '50%',
9681
- background: isRunning ? '#30d158' : 'var(--dnb-text-3)',
9682
- boxShadow: isRunning ? '0 0 0 3px rgba(48, 209, 88, 0.18)' : 'none',
9683
- flexShrink: 0,
9684
- },
9685
- }),
10866
+ isRunning
10867
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '9px', color: '#409cff' } })
10868
+ : h('span', {
10869
+ style: {
10870
+ width: 7.5,
10871
+ height: 7.5,
10872
+ borderRadius: '50%',
10873
+ background: 'var(--dnb-text-3)',
10874
+ flexShrink: 0,
10875
+ },
10876
+ }),
9686
10877
  h('span', { style: { fontWeight: 600, fontSize: 12.5 } }, peer.name),
9687
10878
  h('span', { className: 'dnb-tag', style: { fontSize: 10.5 } }, kindBadge),
9688
10879
  ),
@@ -9757,14 +10948,16 @@ window.__ModuleLoader__.load({
9757
10948
  h(
9758
10949
  'div',
9759
10950
  { style: { display: 'flex', alignItems: 'center', gap: 6 } },
9760
- h('span', {
9761
- style: {
9762
- width: 6.5,
9763
- height: 6.5,
9764
- borderRadius: '50%',
9765
- background: sess.status === 'running' ? '#30d158' : 'var(--dnb-text-3)',
9766
- },
9767
- }),
10951
+ sess.status === 'running'
10952
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '8px', color: '#409cff' } })
10953
+ : h('span', {
10954
+ style: {
10955
+ width: 6.5,
10956
+ height: 6.5,
10957
+ borderRadius: '50%',
10958
+ background: 'var(--dnb-text-3)',
10959
+ },
10960
+ }),
9768
10961
  h('span', { style: { fontWeight: 500, fontSize: 12.5, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, sess.name),
9769
10962
  sess.openTasks ? h('span', { className: 'dnb-tag', style: { fontSize: 10 } }, sess.openTasks + ' 待办') : null,
9770
10963
  ),
@@ -10045,28 +11238,128 @@ window.__ModuleLoader__.load({
10045
11238
  const rawSuggestions = (view.secView && Array.isArray(view.secView.suggestions))
10046
11239
  ? view.secView.suggestions.filter(s => s && s.status === 'pending')
10047
11240
  : []
10048
- // Prioritize Prime Minister boundary proposals first so wall-hits never get buried
10049
- const suggestions = [
10050
- ...rawSuggestions.filter(s => s.kind === 'bound'),
10051
- ...rawSuggestions.filter(s => s.kind !== 'bound'),
10052
- ]
11241
+ // Prioritize goal approval & boundary proposals first so critical gates never get buried
11242
+ const rankSug = s => (s.kind === 'goal_approval' ? 0 : s.kind === 'bound' ? 1 : 2)
11243
+ const suggestions = [...rawSuggestions].sort((a, b) => rankSug(a) - rankSug(b))
10053
11244
  const [expandedId, setExpandedId] = React.useState('')
10054
11245
  const [editingId, setEditingId] = React.useState('')
10055
11246
  const [editDraft, setEditDraft] = React.useState('')
10056
11247
  const [editBoundCol, setEditBoundCol] = React.useState('forbidden')
11248
+ const [rejectingGoalId, setRejectingGoalId] = React.useState('')
11249
+ const [rejectGoalDraft, setRejectGoalDraft] = React.useState('')
10057
11250
 
10058
11251
  if (!suggestions.length) return null
10059
11252
 
10060
11253
  const BOUND_FIELD_META = {
10061
11254
  forbidden: { label: '禁止红线', color: '#ff453a', bg: 'rgba(255, 69, 58, 0.14)' },
10062
11255
  allowed: { label: '允许范围', color: '#30d158', bg: 'rgba(48, 209, 88, 0.14)' },
10063
- notes: { label: '注意事项', color: '#ff9f0a', bg: 'rgba(255, 159, 10, 0.14)' },
11256
+ notes: { label: '注意事项', color: '#fbbf24', bg: 'rgba(245, 158, 11, 0.14)' },
10064
11257
  }
10065
11258
 
10066
11259
  return h(
10067
11260
  React.Fragment,
10068
11261
  null,
10069
11262
  suggestions.slice(0, 2).map(sug => {
11263
+ if (sug.kind === 'goal_approval') {
11264
+ const isRejecting = rejectingGoalId === sug.id
11265
+ return h(
11266
+ 'div',
11267
+ {
11268
+ key: sug.id,
11269
+ className: 'dnb-sug-card',
11270
+ style: {
11271
+ background: 'rgba(48, 209, 88, 0.08)',
11272
+ borderColor: 'rgba(48, 209, 88, 0.40)',
11273
+ },
11274
+ },
11275
+ h(
11276
+ 'div',
11277
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 6, marginBottom: 4 } },
11278
+ h(
11279
+ 'div',
11280
+ { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: 11.5, fontWeight: 700, color: '#30d158' } },
11281
+ '🎯 参谋长目标达标请示(待您拍板结项)',
11282
+ ),
11283
+ h('button', {
11284
+ className: 'dnb-icon-btn',
11285
+ style: { width: 20, height: 20 },
11286
+ title: '暂缓忽略通知',
11287
+ onClick: () => void decideSuggestion(sug, 'dismiss'),
11288
+ }, h(Icon, { name: 'x', size: 12 })),
11289
+ ),
11290
+ h('div', { style: { fontSize: 12.5, fontWeight: 600, color: 'var(--dnb-text)', marginBottom: 3 } }, sug.title || '主对话目标已满足验收条件'),
11291
+ sug.reason
11292
+ ? h('div', { style: { fontSize: 11.5, color: 'var(--dnb-text-2)', lineHeight: 1.45, marginBottom: 6 } }, sug.reason)
11293
+ : null,
11294
+ sug.draftText
11295
+ ? h('div', {
11296
+ style: {
11297
+ padding: '6px 9px',
11298
+ marginBottom: 7,
11299
+ borderRadius: 8,
11300
+ background: 'var(--dnb-card)',
11301
+ border: '1px solid var(--dnb-border)',
11302
+ fontSize: 11.5,
11303
+ color: 'var(--dnb-text-2)',
11304
+ whiteSpace: 'pre-wrap',
11305
+ },
11306
+ }, sug.draftText)
11307
+ : null,
11308
+ isRejecting
11309
+ ? h(
11310
+ 'div',
11311
+ { style: { display: 'flex', gap: 5, marginBottom: 6 } },
11312
+ h('input', {
11313
+ className: 'dnb-input',
11314
+ style: { height: 26, fontSize: 11.5, flex: 1 },
11315
+ placeholder: '输入驳回原因或补充要求,督导将继续推动…',
11316
+ value: rejectGoalDraft,
11317
+ onChange: e => setRejectGoalDraft(e.target.value),
11318
+ onKeyDown: e => {
11319
+ if (e.key === 'Enter' && rejectGoalDraft.trim()) {
11320
+ void rejectGoalApi(rejectGoalDraft).then(() => {
11321
+ setRejectingGoalId('')
11322
+ setRejectGoalDraft('')
11323
+ })
11324
+ }
11325
+ },
11326
+ }),
11327
+ h('button', {
11328
+ className: 'dnb-primary-btn',
11329
+ style: { height: 26, padding: '0 9px', fontSize: 11 },
11330
+ disabled: view.busy || !rejectGoalDraft.trim(),
11331
+ onClick: () => void rejectGoalApi(rejectGoalDraft).then(() => {
11332
+ setRejectingGoalId('')
11333
+ setRejectGoalDraft('')
11334
+ }),
11335
+ }, '提交'),
11336
+ h('button', {
11337
+ className: 'dnb-pill',
11338
+ style: { height: 26, padding: '0 8px', fontSize: 11 },
11339
+ onClick: () => setRejectingGoalId(''),
11340
+ }, '取消'),
11341
+ )
11342
+ : h(
11343
+ 'div',
11344
+ { style: { display: 'flex', alignItems: 'center', gap: 6 } },
11345
+ h('button', {
11346
+ className: 'dnb-primary-btn',
11347
+ style: { height: 25, padding: '0 10px', fontSize: 11.5, background: '#30d158', color: '#09180e', fontWeight: 700 },
11348
+ disabled: view.busy || view.secBusy,
11349
+ onClick: () => void approveGoalApi(),
11350
+ }, '✅ 批准结项'),
11351
+ h('button', {
11352
+ className: 'dnb-pill',
11353
+ style: { height: 25, padding: '0 9px', fontSize: 11.5 },
11354
+ onClick: () => {
11355
+ setRejectingGoalId(sug.id)
11356
+ setRejectGoalDraft('')
11357
+ },
11358
+ }, '↩ 驳回继续'),
11359
+ ),
11360
+ )
11361
+ }
11362
+
10070
11363
  const isBound = sug.kind === 'bound'
10071
11364
  const openDraft = expandedId === sug.id
10072
11365
  const isEditing = editingId === sug.id
@@ -10084,8 +11377,8 @@ window.__ModuleLoader__.load({
10084
11377
  key: sug.id,
10085
11378
  className: 'dnb-sug-card',
10086
11379
  style: {
10087
- background: 'rgba(255, 159, 10, 0.08)',
10088
- borderColor: 'rgba(255, 159, 10, 0.34)',
11380
+ background: 'rgba(245, 158, 11, 0.08)',
11381
+ borderColor: 'rgba(245, 158, 11, 0.34)',
10089
11382
  },
10090
11383
  },
10091
11384
  h(
@@ -10093,7 +11386,7 @@ window.__ModuleLoader__.load({
10093
11386
  { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 6, marginBottom: 5 } },
10094
11387
  h(
10095
11388
  'div',
10096
- { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: 11, fontWeight: 700, color: '#ff9f0a', flexWrap: 'wrap' } },
11389
+ { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: 11, fontWeight: 700, color: '#fbbf24', flexWrap: 'wrap' } },
10097
11390
  isConsolidation ? `🏛 参谋长边界浓缩请示 · ${replacesList.length} 合 1` : '🏛 参谋长边界请示',
10098
11391
  h(
10099
11392
  'span',
@@ -10189,7 +11482,7 @@ window.__ModuleLoader__.load({
10189
11482
  { style: { display: 'flex', alignItems: 'center', gap: 5, flexWrap: 'wrap' } },
10190
11483
  h('button', {
10191
11484
  className: 'dnb-primary-btn',
10192
- style: { height: 25, padding: '0 10px', fontSize: 11.5, background: '#ff9f0a', color: '#111', gap: 4 },
11485
+ style: { height: 25, padding: '0 10px', fontSize: 11.5, background: '#f59e0b', color: '#111', gap: 4 },
10193
11486
  disabled: view.secBusy,
10194
11487
  title: '批准并盖上小图钉,作为跨任务全局共享边界生效',
10195
11488
  onClick: () => {
@@ -10299,7 +11592,10 @@ window.__ModuleLoader__.load({
10299
11592
  )
10300
11593
  }
10301
11594
 
10302
- function ChiefComposerBar({ view }) {
11595
+ function ChiefComposerBar({ view, barRef }) {
11596
+ const fileInputRef = React.useRef(null)
11597
+ const secImages = Array.isArray(view.secImages) ? view.secImages : []
11598
+ const canSend = (Boolean((view.secInput || '').trim()) || secImages.length > 0) && !view.secBusy
10303
11599
  const peers = (view.secView && Array.isArray(view.secView.peers)) ? view.secView.peers : []
10304
11600
  const fallbackChildren = Array.isArray(view.subagents)
10305
11601
  ? view.subagents.filter(a => a && a.name && a.name !== 'lead').map(a => ({
@@ -10326,15 +11622,164 @@ window.__ModuleLoader__.load({
10326
11622
  const activeTarget = view.secTarget || 'auto'
10327
11623
  const activePeer = targetChips.find(p => p.key === activeTarget) || null
10328
11624
  const modeObj = RELAY_MODES.find(m => m.key === (view.secMode || 'steer')) || RELAY_MODES[0]
10329
- const placeholder = activeTarget === 'auto'
10330
- ? '问实时进展、诊卡点、浓缩边界,或吩咐参谋长拆话调度…'
10331
- : activeTarget === 'all'
10332
- ? '向全体成员广播(' + modeObj.label + ')…'
10333
- : ('给 @' + shortAgentName(activePeer ? activePeer.name : activeTarget, true) + ' ' + modeObj.label + '…')
11625
+ const meta = view.chiefMeta || {}
11626
+ const tm = meta.tacticalModes || {}
11627
+ const guard = meta.runtimeGuard || {}
11628
+ const maxTurns = Number(tm.maxInterventionTurns) || 5
11629
+ const pct = Number(tm.compactThresholdPct) || 80
11630
+ const activeChipsCount = (tm.intervention ? 1 : 0)
11631
+ + (tm.autoCompact ? 1 : 0)
11632
+ + (tm.redlineSentinel ? 1 : 0)
11633
+ + (tm.strictVerify === false ? 0 : 0)
11634
+ const toggleTacticalField = (key, val) => {
11635
+ if (key === 'intervention' && val === true) {
11636
+ patch({ tacticalMenuOpen: false, interventionModalOpen: true, interventionAgreed: false })
11637
+ return
11638
+ }
11639
+ void updateSecConfig({ tacticalModes: { ...tm, [key]: val } })
11640
+ }
11641
+ const placeholder = secImages.length > 0
11642
+ ? ('已附 ' + secImages.length + ' 张图,回车可直接发送或补充说明…')
11643
+ : (activeTarget === 'auto'
11644
+ ? '问实时进展、诊卡点、浓缩边界,或吩咐参谋长拆话调度…'
11645
+ : activeTarget === 'all'
11646
+ ? '向全体成员广播(' + modeObj.label + ')…'
11647
+ : ('给 @' + shortAgentName(activePeer ? activePeer.name : activeTarget, true) + ' ' + modeObj.label + '…'))
10334
11648
 
10335
11649
  return h(
10336
11650
  'div',
10337
- { className: 'dnb-sec-bar' },
11651
+ {
11652
+ ref: barRef,
11653
+ className: 'dnb-sec-bar',
11654
+ 'data-dragover': view.secDragOver ? '1' : '0',
11655
+ onDragOver: e => {
11656
+ if (e.dataTransfer && Array.from(e.dataTransfer.types || []).includes('Files')) {
11657
+ e.preventDefault()
11658
+ if (!view.secDragOver) patch({ secDragOver: true })
11659
+ }
11660
+ },
11661
+ onDragLeave: e => {
11662
+ if (!e.currentTarget.contains(e.relatedTarget)) {
11663
+ if (view.secDragOver) patch({ secDragOver: false })
11664
+ }
11665
+ },
11666
+ onDrop: e => {
11667
+ e.preventDefault()
11668
+ patch({ secDragOver: false })
11669
+ if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length) {
11670
+ void ingestSecImageFiles(e.dataTransfer.files)
11671
+ }
11672
+ },
11673
+ },
11674
+ // Tactical Cockpit Popover (Anchored above `+` button)
11675
+ view.tacticalMenuOpen
11676
+ ? h(
11677
+ 'div',
11678
+ { className: 'dnb-tactical-pop' },
11679
+ h(
11680
+ 'div',
11681
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 6 } },
11682
+ h('span', { style: { fontSize: 12, fontWeight: 700, color: 'var(--dnb-text)' } }, '🎛 参谋长战术驾驶舱'),
11683
+ h('button', {
11684
+ type: 'button',
11685
+ className: 'dnb-icon-btn',
11686
+ style: { width: 20, height: 20 },
11687
+ onClick: () => patch({ tacticalMenuOpen: false }),
11688
+ }, h(Icon, { name: 'x', size: 12 })),
11689
+ ),
11690
+ // Row 1: Intervention + Max Turns Stepper
11691
+ h(
11692
+ 'div',
11693
+ { className: 'dnb-tactical-row' },
11694
+ h(
11695
+ 'div',
11696
+ { style: { flex: 1, minWidth: 0 } },
11697
+ h('div', { style: { fontSize: 12, fontWeight: 600, color: tm.intervention ? '#f59e0b' : 'var(--dnb-text)' } }, '⚡ 主动强介入(需风险确认)'),
11698
+ h('div', { style: { fontSize: 11, color: 'var(--dnb-text-3)', marginTop: 1 } }, '每轮停止时自动核验、自驱纠偏与续跑,含防死循环熔断'),
11699
+ ),
11700
+ h(
11701
+ 'div',
11702
+ { style: { display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 } },
11703
+ h(
11704
+ 'div',
11705
+ { className: 'dnb-stepper', title: '连续主动介入轮数上限' },
11706
+ h('button', { type: 'button', onClick: () => toggleTacticalField('maxInterventionTurns', Math.max(1, maxTurns - 1)) }, '-'),
11707
+ h('span', null, `${maxTurns}轮`),
11708
+ h('button', { type: 'button', onClick: () => toggleTacticalField('maxInterventionTurns', Math.min(15, maxTurns + 1)) }, '+'),
11709
+ ),
11710
+ h(Switch, { checked: Boolean(tm.intervention), onChange: v => toggleTacticalField('intervention', v) }),
11711
+ ),
11712
+ ),
11713
+ // Row 2: Auto-Compact + Threshold% Stepper
11714
+ h(
11715
+ 'div',
11716
+ { className: 'dnb-tactical-row' },
11717
+ h(
11718
+ 'div',
11719
+ { style: { flex: 1, minWidth: 0 } },
11720
+ h('div', { style: { fontSize: 12, fontWeight: 600, color: 'var(--dnb-text)' } }, '🗜 压缩前抢救 + 自动压缩'),
11721
+ h('div', { style: { fontSize: 11, color: 'var(--dnb-text-3)', marginTop: 1 } }, '达阈值时先写实档并核验落盘,再静默压缩上下文'),
11722
+ ),
11723
+ h(
11724
+ 'div',
11725
+ { style: { display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 } },
11726
+ h(
11727
+ 'div',
11728
+ { className: 'dnb-stepper', title: '触发抢救与压缩的上下文占用阈值' },
11729
+ h('button', { type: 'button', onClick: () => toggleTacticalField('compactThresholdPct', Math.max(50, pct - 5)) }, '-'),
11730
+ h('span', null, `${pct}%`),
11731
+ h('button', { type: 'button', onClick: () => toggleTacticalField('compactThresholdPct', Math.min(95, pct + 5)) }, '+'),
11732
+ ),
11733
+ h(Switch, { checked: Boolean(tm.autoCompact), onChange: v => toggleTacticalField('autoCompact', v) }),
11734
+ ),
11735
+ ),
11736
+ // Row 3: Strict Verify
11737
+ h(
11738
+ 'div',
11739
+ { className: 'dnb-tactical-row' },
11740
+ h(
11741
+ 'div',
11742
+ { style: { flex: 1, minWidth: 0 } },
11743
+ h('div', { style: { fontSize: 12, fontWeight: 600, color: 'var(--dnb-text)' } }, '✓ 严格实证核验'),
11744
+ h('div', { style: { fontSize: 11, color: 'var(--dnb-text-3)', marginTop: 1 } }, '要求结论附文件/命令证据,未核实不放行结项'),
11745
+ ),
11746
+ h(Switch, { checked: tm.strictVerify !== false, onChange: v => toggleTacticalField('strictVerify', v) }),
11747
+ ),
11748
+ // Row 4: Redline Sentinel
11749
+ h(
11750
+ 'div',
11751
+ { className: 'dnb-tactical-row' },
11752
+ h(
11753
+ 'div',
11754
+ { style: { flex: 1, minWidth: 0 } },
11755
+ h('div', { style: { fontSize: 12, fontWeight: 600, color: 'var(--dnb-text)' } }, '🛡 红线越界哨兵'),
11756
+ h('div', { style: { fontSize: 11, color: 'var(--dnb-text-3)', marginTop: 1 } }, '触碰禁止红线时立即发高优纠偏或拦截'),
11757
+ ),
11758
+ h(Switch, { checked: Boolean(tm.redlineSentinel), onChange: v => toggleTacticalField('redlineSentinel', v) }),
11759
+ ),
11760
+ // Row 5: Concise Brief
11761
+ h(
11762
+ 'div',
11763
+ { className: 'dnb-tactical-row' },
11764
+ h(
11765
+ 'div',
11766
+ { style: { flex: 1, minWidth: 0 } },
11767
+ h('div', { style: { fontSize: 12, fontWeight: 600, color: 'var(--dnb-text)' } }, '📝 极简战报模式'),
11768
+ h('div', { style: { fontSize: 11, color: 'var(--dnb-text-3)', marginTop: 1 } }, '汇报直击卡点、决定与可验证证据,压缩废话'),
11769
+ ),
11770
+ h(Switch, { checked: tm.conciseBrief !== false, onChange: v => toggleTacticalField('conciseBrief', v) }),
11771
+ ),
11772
+ // Dual Mandatory Disclaimer Footer
11773
+ h(
11774
+ 'div',
11775
+ { className: 'dnb-disclaimer-box' },
11776
+ h('strong', null, '⚠️ 能力与提示词免责提示:'),
11777
+ '1. 参谋长的一切自动审查、强介入驱动、压缩前抢救与红线拦截能力均高度依赖您为参谋长配置的底层大模型能力与上下文质量,不同模型在规划严谨度与遵循指令上的表现存在客观差异。',
11778
+ ' 2. 若主会话或当前项目中挂载了过多的系统提示词(System Prompt)、Rules 或硬性规则,可能与本插件的自主干预逻辑产生指令冲突,进而导致介入循环异常、提前熔断或执行偏离预期。',
11779
+ ),
11780
+ )
11781
+ : null,
11782
+
10338
11783
  // Dismissible Structured Latest Reply Bubble
10339
11784
  view.secLatestReply
10340
11785
  ? h(
@@ -10365,6 +11810,52 @@ window.__ModuleLoader__.load({
10365
11810
  )
10366
11811
  : null,
10367
11812
 
11813
+ // Active Tactical Mode Strip (only shown when non-default modes or intervention/circuitBreaker active)
11814
+ (tm.intervention || tm.autoCompact || tm.redlineSentinel || guard.circuitBroken)
11815
+ ? h(
11816
+ 'div',
11817
+ { className: 'dnb-tactical-strip' },
11818
+ tm.intervention
11819
+ ? h('button', {
11820
+ type: 'button',
11821
+ className: 'dnb-tac-chip',
11822
+ 'data-tone': 'amber',
11823
+ onClick: () => patch({ tacticalMenuOpen: !view.tacticalMenuOpen }),
11824
+ }, `⚡ 强介入 ${Number(guard.interventionTurns ?? guard.consecutiveInterventionTurns ?? 0)}/${maxTurns}`)
11825
+ : null,
11826
+ tm.autoCompact
11827
+ ? h('button', {
11828
+ type: 'button',
11829
+ className: 'dnb-tac-chip',
11830
+ 'data-tone': 'accent',
11831
+ onClick: () => patch({ tacticalMenuOpen: !view.tacticalMenuOpen }),
11832
+ }, `🗜 自动压缩 ${pct}%`)
11833
+ : null,
11834
+ tm.redlineSentinel
11835
+ ? h('button', {
11836
+ type: 'button',
11837
+ className: 'dnb-tac-chip',
11838
+ onClick: () => patch({ tacticalMenuOpen: !view.tacticalMenuOpen }),
11839
+ }, '🛡 红线哨兵')
11840
+ : null,
11841
+ guard.circuitBroken
11842
+ ? h('span', {
11843
+ className: 'dnb-tac-chip',
11844
+ style: { borderColor: 'rgba(255,69,58,0.45)', color: '#ff453a', background: 'rgba(255,69,58,0.1)' },
11845
+ title: guard.circuitReason || '已触发自动防死循环熔断',
11846
+ }, '⛔ 已熔断')
11847
+ : null,
11848
+ tm.intervention
11849
+ ? h('button', {
11850
+ type: 'button',
11851
+ className: 'dnb-stop-btn',
11852
+ title: '立即急停主动强介入与后台自驱,保留当前计划',
11853
+ onClick: () => void updateSecConfig({ emergencyStopIntervention: true }),
11854
+ }, '⏹ 急停')
11855
+ : null,
11856
+ )
11857
+ : null,
11858
+
10368
11859
  // Compact Target & Posture Strip
10369
11860
  h(
10370
11861
  'div',
@@ -10386,7 +11877,7 @@ window.__ModuleLoader__.load({
10386
11877
  }),
10387
11878
  },
10388
11879
  p.status === 'running'
10389
- ? h('span', { style: { width: 5.5, height: 5.5, borderRadius: '50%', background: '#30d158' } })
11880
+ ? h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '7.5px', color: '#409cff' } })
10390
11881
  : null,
10391
11882
  '@' + clampTitle(p.key === 'lead' ? '主对话' : shortAgentName(p.name, true), 9.5),
10392
11883
  ),
@@ -10412,10 +11903,84 @@ window.__ModuleLoader__.load({
10412
11903
  : null,
10413
11904
  ),
10414
11905
 
10415
- // DS-Bot Style Rounded Pill Input + Up-Arrow Send Button
11906
+ // Attached Image Preview Strip (only when attached)
11907
+ secImages.length > 0
11908
+ ? h(
11909
+ 'div',
11910
+ { className: 'dnb-sec-img-strip' },
11911
+ secImages.map(img =>
11912
+ h(
11913
+ 'div',
11914
+ { key: img.id, className: 'dnb-sec-img-thumb', title: img.name || '附图' },
11915
+ h('img', {
11916
+ src: img.previewUrl || ('data:' + img.mediaType + ';base64,' + img.data),
11917
+ alt: img.name || '附图',
11918
+ }),
11919
+ h(
11920
+ 'button',
11921
+ {
11922
+ type: 'button',
11923
+ className: 'dnb-sec-img-rm',
11924
+ title: '移除图片',
11925
+ onClick: () => {
11926
+ const next = (store.secImages || []).filter(item => item.id !== img.id)
11927
+ patch({ secImages: next })
11928
+ },
11929
+ },
11930
+ '×',
11931
+ ),
11932
+ ),
11933
+ ),
11934
+ h(
11935
+ 'span',
11936
+ { style: { fontSize: 10.5, color: 'var(--dnb-text-3)', marginLeft: 'auto', alignSelf: 'center', flexShrink: 0 } },
11937
+ '附图 ' + secImages.length + '/' + SEC_MAX_IMAGES,
11938
+ ),
11939
+ )
11940
+ : null,
11941
+
11942
+ // DS-Bot Style Rounded Pill Input + `+` Tactical Button + Attach Image + Up-Arrow Send Button
10416
11943
  h(
10417
11944
  'div',
10418
11945
  { className: 'dnb-sec-shell' },
11946
+ h('button', {
11947
+ type: 'button',
11948
+ className: 'dnb-plus-btn',
11949
+ 'data-active': (view.tacticalMenuOpen || activeChipsCount > 0) ? '1' : '0',
11950
+ 'data-danger': tm.intervention ? '1' : '0',
11951
+ title: '打开参谋长战术驾驶舱(强介入 / 压缩抢救 / 红线哨兵 / 核验开关)',
11952
+ onClick: () => patch({ tacticalMenuOpen: !view.tacticalMenuOpen, secModelMenuOpen: false, secPaceMenuOpen: false }),
11953
+ }, view.tacticalMenuOpen ? '×' : '+'),
11954
+ h('input', {
11955
+ ref: fileInputRef,
11956
+ type: 'file',
11957
+ accept: 'image/png,image/jpeg,image/webp,image/gif',
11958
+ multiple: true,
11959
+ style: { display: 'none' },
11960
+ onChange: e => {
11961
+ const files = e.target && e.target.files
11962
+ if (files && files.length) void ingestSecImageFiles(files)
11963
+ if (e.target) e.target.value = ''
11964
+ },
11965
+ }),
11966
+ h(
11967
+ 'button',
11968
+ {
11969
+ type: 'button',
11970
+ className: 'dnb-sec-attach',
11971
+ disabled: Boolean(view.secBusy) || secImages.length >= SEC_MAX_IMAGES,
11972
+ title: secImages.length >= SEC_MAX_IMAGES
11973
+ ? `最多可附 ${SEC_MAX_IMAGES} 张图片`
11974
+ : '上传图片(支持拖拽或 Ctrl+V 粘贴截图)',
11975
+ onClick: () => {
11976
+ if (fileInputRef.current) fileInputRef.current.click()
11977
+ },
11978
+ },
11979
+ h(Icon, { name: 'image', size: 15 }),
11980
+ secImages.length > 0
11981
+ ? h('span', { className: 'dnb-sec-attach-badge' }, String(secImages.length))
11982
+ : null,
11983
+ ),
10419
11984
  h('input', {
10420
11985
  ref: el => { secInputEl = el },
10421
11986
  className: 'dnb-sec-input',
@@ -10423,6 +11988,20 @@ window.__ModuleLoader__.load({
10423
11988
  disabled: view.secBusy,
10424
11989
  value: view.secInput || '',
10425
11990
  onChange: e => patch({ secInput: e.target.value }),
11991
+ onPaste: e => {
11992
+ const items = (e.clipboardData && e.clipboardData.items) ? Array.from(e.clipboardData.items) : []
11993
+ let imgFiles = items
11994
+ .filter(it => it && it.kind === 'file' && String(it.type || '').startsWith('image/'))
11995
+ .map(it => it.getAsFile())
11996
+ .filter(Boolean)
11997
+ if (!imgFiles.length && e.clipboardData && e.clipboardData.files) {
11998
+ imgFiles = Array.from(e.clipboardData.files).filter(f => f && String(f.type || '').startsWith('image/'))
11999
+ }
12000
+ if (imgFiles.length) {
12001
+ e.preventDefault()
12002
+ void ingestSecImageFiles(imgFiles)
12003
+ }
12004
+ },
10426
12005
  onKeyDown: e => {
10427
12006
  if (e.key === 'Enter' && !e.shiftKey) {
10428
12007
  e.preventDefault()
@@ -10433,7 +12012,7 @@ window.__ModuleLoader__.load({
10433
12012
  h('button', {
10434
12013
  type: 'button',
10435
12014
  className: 'dnb-sec-send',
10436
- disabled: view.secBusy || !(view.secInput || '').trim(),
12015
+ disabled: !canSend,
10437
12016
  title: '发送给 DSH 参谋长',
10438
12017
  onClick: () => void submitChiefBar(),
10439
12018
  },
@@ -10447,23 +12026,232 @@ window.__ModuleLoader__.load({
10447
12026
 
10448
12027
  /* ----------------------------------------------------------- Main Panel */
10449
12028
 
12029
+ function InterventionConfirmModal({ view, board }) {
12030
+ if (!view.interventionModalOpen) return null
12031
+ const meta = view.chiefMeta || {}
12032
+ const tm = meta.tacticalModes || {}
12033
+ const bnd = view.boundaries || { forbidden: [], allowed: [], notes: [] }
12034
+ const obj = (board && board.objective) ? String(board.objective).trim() : ''
12035
+ const forbiddenList = Array.isArray(bnd.forbidden) ? bnd.forbidden.filter(Boolean) : []
12036
+ const missingPrerequisite = !obj || forbiddenList.length === 0
12037
+
12038
+ return h(
12039
+ 'div',
12040
+ {
12041
+ className: 'dnb-modal-backdrop',
12042
+ onClick: e => {
12043
+ if (e.target === e.currentTarget) patch({ interventionModalOpen: false })
12044
+ },
12045
+ },
12046
+ h(
12047
+ 'div',
12048
+ { className: 'dnb-modal-card' },
12049
+ h(
12050
+ 'div',
12051
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 } },
12052
+ h('span', { style: { fontSize: 13.5, fontWeight: 700, color: '#f59e0b' } }, '⚡ 启用「主动强介入」前置风险与边界核对'),
12053
+ h('button', {
12054
+ type: 'button',
12055
+ className: 'dnb-icon-btn',
12056
+ style: { width: 22, height: 22 },
12057
+ onClick: () => patch({ interventionModalOpen: false }),
12058
+ }, h(Icon, { name: 'x', size: 13 })),
12059
+ ),
12060
+ // Live Objective & Redline Readback
12061
+ h(
12062
+ 'div',
12063
+ {
12064
+ style: {
12065
+ borderRadius: 9,
12066
+ padding: '8px 10px',
12067
+ border: missingPrerequisite ? '1px solid rgba(255, 69, 58, 0.45)' : '1px solid var(--dnb-border)',
12068
+ background: missingPrerequisite ? 'rgba(255, 69, 58, 0.08)' : 'var(--dnb-card)',
12069
+ display: 'flex',
12070
+ flexDirection: 'column',
12071
+ gap: 5,
12072
+ fontSize: 11.5,
12073
+ },
12074
+ },
12075
+ h('div', null, h('strong', null, '当前主目标:'), obj ? obj : h('span', { style: { color: '#ff453a', fontWeight: 600 } }, '未设定(建议先设定清晰长期目标)')),
12076
+ h('div', null, h('strong', null, '已设禁止红线:'), forbiddenList.length
12077
+ ? forbiddenList.slice(0, 3).map(f => '「' + f.text + '」').join('、') + (forbiddenList.length > 3 ? ` 等 ${forbiddenList.length} 条` : '')
12078
+ : h('span', { style: { color: '#ff453a', fontWeight: 600 } }, '未设定(缺少禁止红线时强介入风险较高)')),
12079
+ missingPrerequisite
12080
+ ? h(
12081
+ 'div',
12082
+ { style: { display: 'flex', gap: 6, marginTop: 3 } },
12083
+ !obj
12084
+ ? h('button', {
12085
+ type: 'button',
12086
+ className: 'dnb-mini-btn',
12087
+ 'data-tone': 'amber',
12088
+ onClick: () => patch({ interventionModalOpen: false, tab: 'plan' }),
12089
+ }, '前往设定目标')
12090
+ : null,
12091
+ !forbiddenList.length
12092
+ ? h('button', {
12093
+ type: 'button',
12094
+ className: 'dnb-mini-btn',
12095
+ 'data-tone': 'amber',
12096
+ onClick: () => patch({ interventionModalOpen: false, tab: 'boundaries', boundarySubTab: 'rules' }),
12097
+ }, '前往设定红线')
12098
+ : null,
12099
+ )
12100
+ : null,
12101
+ ),
12102
+ // 3 Concrete Operational Risks
12103
+ h(
12104
+ 'div',
12105
+ { style: { fontSize: 11.5, color: 'var(--dnb-text-2)', lineHeight: 1.55 } },
12106
+ h('div', { style: { fontWeight: 600, color: 'var(--dnb-text)', marginBottom: 3 } }, '开启后的行为与实操风险:'),
12107
+ h('div', null, '• Token 额外消耗:主对话每轮停顿都将唤醒参谋长核验并可能继续发指令。'),
12108
+ h('div', null, '• 对话节奏接管:参谋长会主动插话纠偏与派发下步,点击红色「⏹ 急停」可随时中断。'),
12109
+ h('div', null, `• 防死循环熔断:达到 ${Number(tm.maxInterventionTurns) || 5} 轮上限或连续 3 轮无实际进展将自动熔断退回待命。`),
12110
+ ),
12111
+ // Dual Mandatory Disclaimers
12112
+ h(
12113
+ 'div',
12114
+ { className: 'dnb-disclaimer-box' },
12115
+ h('div', { style: { marginBottom: 4 } },
12116
+ h('strong', null, '免责声明 1(模型依赖):'),
12117
+ '参谋长的一切自动审查、强介入驱动、压缩前抢救与红线拦截能力均高度依赖您为参谋长配置的底层大模型能力与上下文质量,不同模型在规划严谨度与遵循指令上的表现存在客观差异。',
12118
+ ),
12119
+ h('div', null,
12120
+ h('strong', null, '免责声明 2(规则冲突):'),
12121
+ '若主会话或当前项目中挂载了过多的系统提示词(System Prompt)、Rules 或硬性规则,可能与本插件的自主干预逻辑产生指令冲突,进而导致介入循环异常、提前熔断或执行偏离预期。',
12122
+ ),
12123
+ ),
12124
+ // Explicit Checkbox Agreement
12125
+ h(
12126
+ 'label',
12127
+ { style: { display: 'flex', alignItems: 'flex-start', gap: 7, fontSize: 11.5, color: 'var(--dnb-text)', cursor: 'pointer', lineHeight: 1.45 } },
12128
+ h('input', {
12129
+ type: 'checkbox',
12130
+ checked: Boolean(view.interventionAgreed),
12131
+ style: { marginTop: 2 },
12132
+ onChange: e => patch({ interventionAgreed: Boolean(e.target.checked) }),
12133
+ }),
12134
+ '我已核对当前目标与红线,理解底层模型与宿主提示词规则冲突可能带来偏离,并确认启用主动强介入。',
12135
+ ),
12136
+ h(
12137
+ 'div',
12138
+ { style: { display: 'flex', justifyContent: 'flex-end', gap: 7, marginTop: 2 } },
12139
+ h('button', {
12140
+ type: 'button',
12141
+ className: 'dnb-pill',
12142
+ style: { height: 28, padding: '0 12px', fontSize: 12 },
12143
+ onClick: () => patch({ interventionModalOpen: false, interventionAgreed: false }),
12144
+ }, '取消'),
12145
+ h('button', {
12146
+ type: 'button',
12147
+ className: 'dnb-primary-btn',
12148
+ style: { height: 28, padding: '0 14px', fontSize: 12, background: '#f59e0b', color: '#111', fontWeight: 700, opacity: view.interventionAgreed ? 1 : 0.45 },
12149
+ disabled: !view.interventionAgreed,
12150
+ onClick: async () => {
12151
+ const ok = await updateSecConfig({
12152
+ tacticalModes: { ...tm, intervention: true },
12153
+ confirmedInterventionRisk: true,
12154
+ })
12155
+ if (ok) patch({ interventionModalOpen: false, interventionAgreed: false })
12156
+ },
12157
+ }, '确认启用主动强介入'),
12158
+ ),
12159
+ ),
12160
+ )
12161
+ }
12162
+
12163
+ function PrecipitateConfirmModal({ view }) {
12164
+ const m = view.precipitateModal
12165
+ if (!m) return null
12166
+ return h(
12167
+ 'div',
12168
+ {
12169
+ className: 'dnb-modal-backdrop',
12170
+ onClick: e => {
12171
+ if (e.target === e.currentTarget && !view.archivePrecipitating) patch({ precipitateModal: null })
12172
+ },
12173
+ },
12174
+ h(
12175
+ 'div',
12176
+ { className: 'dnb-modal-card' },
12177
+ h(
12178
+ 'div',
12179
+ { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 } },
12180
+ h('span', { style: { fontSize: 13.5, fontWeight: 700, color: 'var(--dnb-accent)' } }, '⏬ 沉淀可复用工程经验至冷库'),
12181
+ h('button', {
12182
+ type: 'button',
12183
+ className: 'dnb-icon-btn',
12184
+ style: { width: 22, height: 22 },
12185
+ disabled: Boolean(view.archivePrecipitating),
12186
+ onClick: () => patch({ precipitateModal: null }),
12187
+ }, h(Icon, { name: 'x', size: 13 })),
12188
+ ),
12189
+ h(
12190
+ 'div',
12191
+ { style: { fontSize: 12, color: 'var(--dnb-text-2)', lineHeight: 1.5 } },
12192
+ `将从「${m.label || '当前档案'}」中提炼高价值的通用踩坑、架构约定与验收模式,封入同项目全局冷库。冷库条目默认全会话 `,
12193
+ h('strong', { style: { color: 'var(--dnb-text)' } }, '0 Token 隔离'),
12194
+ ',仅在您需要时点击「翻出」才会临时注入当前对话。',
12195
+ ),
12196
+ h(
12197
+ 'label',
12198
+ { style: { display: 'flex', alignItems: 'flex-start', gap: 7, fontSize: 11.5, color: 'var(--dnb-text)', cursor: 'pointer', lineHeight: 1.45 } },
12199
+ h('input', {
12200
+ type: 'checkbox',
12201
+ checked: Boolean(m.clearSource),
12202
+ disabled: Boolean(view.archivePrecipitating),
12203
+ style: { marginTop: 2 },
12204
+ onChange: e => patch({ precipitateModal: { ...m, clearSource: Boolean(e.target.checked) } }),
12205
+ }),
12206
+ '沉淀成功后同步清空已沉淀的原工作档案条目(保留冷库精炼经验)',
12207
+ ),
12208
+ h(
12209
+ 'div',
12210
+ { style: { display: 'flex', justifyContent: 'flex-end', gap: 7 } },
12211
+ h('button', {
12212
+ type: 'button',
12213
+ className: 'dnb-pill',
12214
+ style: { height: 28, padding: '0 12px', fontSize: 12 },
12215
+ disabled: Boolean(view.archivePrecipitating),
12216
+ onClick: () => patch({ precipitateModal: null }),
12217
+ }, '取消'),
12218
+ h('button', {
12219
+ type: 'button',
12220
+ className: 'dnb-primary-btn',
12221
+ style: { height: 28, padding: '0 14px', fontSize: 12, fontWeight: 600 },
12222
+ disabled: Boolean(view.archivePrecipitating),
12223
+ onClick: () => void precipitateArchivesApi({
12224
+ op: m.op || 'cabinet',
12225
+ cabinetId: m.cabinetId || view.archiveCabinetId || 'cab-main',
12226
+ folder: m.folder || '',
12227
+ clearSource: Boolean(m.clearSource),
12228
+ }),
12229
+ }, view.archivePrecipitating ? '正在提炼沉淀…' : '开始提炼沉淀'),
12230
+ ),
12231
+ ),
12232
+ )
12233
+ }
12234
+
10450
12235
  function PanelInner(props) {
10451
12236
  const view = useStore()
10452
12237
  const isPage = !!(props && props.variant === 'main')
10453
12238
  const isDock = !!(props && props.variant === 'dock')
10454
12239
  const selfRef = React.useRef(null)
10455
12240
 
12241
+ const secBarRef = React.useRef(null)
12242
+
10456
12243
  React.useEffect(() => {
10457
12244
  const host = isDock || isPage || view.open ? selfRef.current : null
10458
12245
  if (!host) return undefined
10459
12246
  const measure = () => {
10460
12247
  try {
10461
- const reserve = reserveCornerSpace(host)
10462
- const key = reserve.top + '/' + reserve.bottom
12248
+ host.style.removeProperty('--dnb-safe-top')
12249
+ host.style.removeProperty('--dnb-safe-bottom')
12250
+ const reserve = reserveCornerSpace(host, secBarRef.current)
12251
+ const key = String(reserve.right || 0)
10463
12252
  if (key === host.dataset.dnbReserve) return
10464
12253
  host.dataset.dnbReserve = key
10465
- host.style.setProperty('--dnb-safe-top', reserve.top + 'px')
10466
- host.style.setProperty('--dnb-safe-bottom', reserve.bottom + 'px')
12254
+ host.style.setProperty('--dnb-safe-right', (reserve.right || 0) + 'px')
10467
12255
  } catch {}
10468
12256
  }
10469
12257
  const timer = setInterval(measure, 3500)
@@ -10630,13 +12418,14 @@ window.__ModuleLoader__.load({
10630
12418
  style: {
10631
12419
  padding: '5px 10px',
10632
12420
  borderRadius: 10,
10633
- background: board.cursor.blocked ? STATUS_BG.blocked : 'rgba(255, 159, 10, 0.12)',
10634
- color: board.cursor.blocked ? '#ff453a' : '#ff9f0a',
12421
+ background: board.cursor.blocked ? STATUS_BG.blocked : 'rgba(10, 132, 255, 0.13)',
12422
+ border: board.cursor.blocked ? '1px solid rgba(255, 69, 58, 0.30)' : '1px solid rgba(10, 132, 255, 0.30)',
12423
+ color: board.cursor.blocked ? '#ff453a' : '#409cff',
10635
12424
  fontSize: 11.5,
10636
12425
  fontWeight: 600,
10637
- overflow: 'hidden',
10638
- textOverflow: 'ellipsis',
10639
- whiteSpace: 'nowrap',
12426
+ display: 'flex',
12427
+ alignItems: 'center',
12428
+ gap: 6.5,
10640
12429
  cursor: 'pointer',
10641
12430
  },
10642
12431
  title: '点击跳转金字塔视角查看推进/受阻子代理',
@@ -10647,7 +12436,10 @@ window.__ModuleLoader__.load({
10647
12436
  else patch({ tab: 'tasks', taskViewMode: 'graph' })
10648
12437
  },
10649
12438
  },
10650
- (board.cursor.blocked ? '⚠ ' : '▶ ') + cursorText,
12439
+ board.cursor.blocked
12440
+ ? '⚠ '
12441
+ : h('span', { className: 'dnb-spin-ring', style: { '--dnb-spin-size': '10px', color: '#409cff' } }),
12442
+ h('span', { style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', minWidth: 0 } }, cursorText),
10651
12443
  ),
10652
12444
  )
10653
12445
  : null,
@@ -10698,6 +12490,31 @@ window.__ModuleLoader__.load({
10698
12490
  ),
10699
12491
  ),
10700
12492
 
12493
+ // Host Compatibility Banner (when DSH host is pre-rc.2 without named subagent tree APIs)
12494
+ view.hostCompat && view.hostCompat.present && view.hostCompat.namedSubagentsSupported === false && !view.hostCompatDismissed
12495
+ ? h(
12496
+ 'div',
12497
+ {
12498
+ style: {
12499
+ margin: '0 12px 8px',
12500
+ padding: '6px 10px',
12501
+ borderRadius: 10,
12502
+ border: '1px solid rgba(245, 158, 11, 0.42)',
12503
+ background: 'rgba(245, 158, 11, 0.12)',
12504
+ color: '#f59e0b',
12505
+ fontSize: 11.5,
12506
+ lineHeight: 1.45,
12507
+ display: 'flex',
12508
+ justifyContent: 'space-between',
12509
+ alignItems: 'center',
12510
+ gap: 8,
12511
+ },
12512
+ },
12513
+ h('span', null, '⚠ ' + (view.hostCompat.warning || '当前 DSH 宿主版本不支持命名子代理 API,请升级至 >= 0.2.2-rc.2。')),
12514
+ h('span', { style: { cursor: 'pointer', paddingLeft: 6, flexShrink: 0 }, onClick: () => patch({ hostCompatDismissed: true }) }, '×'),
12515
+ )
12516
+ : null,
12517
+
10701
12518
  // Error Banner (only on API failure)
10702
12519
  view.error
10703
12520
  ? h(
@@ -10728,7 +12545,11 @@ window.__ModuleLoader__.load({
10728
12545
  ),
10729
12546
 
10730
12547
  // Persistent Bottom Chief Input & Relay Bar
10731
- h(ChiefComposerBar, { view }),
12548
+ h(ChiefComposerBar, { view, barRef: secBarRef }),
12549
+
12550
+ // Scoped Modal Overlays (Strictly bounded inside .dnb-panel)
12551
+ h(InterventionConfirmModal, { view, board }),
12552
+ h(PrecipitateConfirmModal, { view }),
10732
12553
 
10733
12554
  // Floating iOS Toast
10734
12555
  view.notice ? h('div', { className: 'dnb-toast' }, view.notice) : null,
@@ -10784,6 +12605,14 @@ window.__ModuleLoader__.load({
10784
12605
  memReply: '',
10785
12606
  memHits: null,
10786
12607
  memOpen: '',
12608
+ tacticalMenuOpen: false,
12609
+ interventionModalOpen: false,
12610
+ interventionAgreed: false,
12611
+ precipitateModal: null,
12612
+ archiveLoaded: false,
12613
+ archiveDetails: {},
12614
+ archiveOpenFolders: {},
12615
+ archiveOpenFiles: {},
10787
12616
  }
10788
12617
  : {}),
10789
12618
  })