dsh-chief 1.4.0 → 1.5.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/chief-view.js CHANGED
@@ -263,28 +263,30 @@ function buildNarrativeInput({ board, facts, cluster, targets, peerProgress = []
263
263
  const dGlob = Array.isArray(archiveDigest.deskGlobalItems) ? archiveDigest.deskGlobalItems : []
264
264
  const dFlip = Array.isArray(archiveDigest.deskFlippedItems) ? archiveDigest.deskFlippedItems : []
265
265
  const mGlob = Array.isArray(archiveDigest.mountedGlobalItems) ? archiveDigest.mountedGlobalItems : []
266
- const sw = archiveDigest.sealedWatch || {}
266
+ const sAll = Array.isArray(archiveDigest.sessionItems) ? archiveDigest.sessionItems : []
267
+ const gHooks = Array.isArray(archiveDigest.globalHookIndex) ? archiveDigest.globalHookIndex : []
268
+ const recentWatch = Array.isArray(archiveDigest.recentlyUnpinnedWatch) ? archiveDigest.recentlyUnpinnedWatch : []
267
269
  const deskAll = [
268
270
  ...dSess.map(it => `[桌面·本局(主可见)] 《${clamp(it.title, 40)}》:${clamp(it.summary || it.body, 140)}`),
269
271
  ...dGlob.map(it => `[桌面·全局(主可见)] 《${clamp(it.title, 40)}》:${clamp(it.summary || it.body, 140)}`),
270
- ...dFlip.map(it => `[桌面·沉淀(主可见)] 《${clamp(it.title, 40)}》:${clamp(it.summary || it.rawBody, 140)}`),
272
+ ...dFlip.map(it => `[桌面·冷藏已翻牌(主可见)] 《${clamp(it.title, 40)}》:${clamp(it.summary || it.rawBody, 140)}`),
271
273
  ]
272
274
  if (deskAll.length > 0) {
273
- lines.push('', '【当前摆上桌面备选(重点强调,主对话与参谋长共同可见)】', ...deskAll.slice(0, 8).map(x => '- ' + x))
275
+ lines.push('', '【当前认知桌面置顶(主对话与参谋长共同可见)】', ...deskAll.slice(0, 6).map(x => '- ' + x))
274
276
  }
275
277
  if (mGlob.length > 0) {
276
- lines.push('', '【参谋长单独参阅中的全局档案(主对话不可见)】')
278
+ lines.push('', '【参谋长已拉阅的全局档案(主对话不可见)】')
277
279
  for (const it of mGlob.slice(0, 5)) {
278
280
  lines.push(`- [全局参阅] 《${clamp(it.title, 40)}》:${clamp(it.summary || it.body, 120)}`)
279
281
  }
280
282
  }
281
- const sealedLines = [
282
- ...((sw.sessionSealed || []).slice(0, 4).map(it => `- [本局封存·仅参谋关注] 《${clamp(it.title, 36)}》:${clamp(it.summary, 90)}`)),
283
- ...((sw.globalSealed || []).slice(0, 4).map(it => `- [全局封存·仅参谋关注] 《${clamp(it.title, 36)}》:${clamp(it.summary, 90)}`)),
284
- ...((sw.precipSealed || []).slice(0, 3).map(it => `- [沉淀封存·仅参谋关注] 《${clamp(it.title, 36)}》:${clamp(it.summary, 90)}`)),
283
+ const vaultIndexLines = [
284
+ ...sAll.filter(it => !it.takenOut).slice(0, 6).map(it => `- [本局档案·参谋随时可读] 《${clamp(it.title, 36)}》${it.hasHook ? '🪝[' + (it.hookKeywords || []).slice(0, 3).join('·') + ']' : '(待织钩)'}:${clamp(it.summary, 90)}`),
285
+ ...gHooks.slice(0, 5).map(it => `- [全局钩子·参谋见钩可拉] 《${clamp(it.title, 36)}》🪝[${(it.hookKeywords || []).slice(0, 3).join('·')}] ${clamp(it.hookCue, 60)}`),
286
+ ...recentWatch.slice(0, 3).map(w => `- [近期撤下桌面·待观察] 《${clamp(w.title, 36)}》`),
285
287
  ]
286
- if (sealedLines.length > 0) {
287
- lines.push('', '【参谋长后台守望的三库封存索引(主对话上下文零注入)】', ...sealedLines)
288
+ if (vaultIndexLines.length > 0) {
289
+ lines.push('', '【参谋长后台档案柜与钩子索引(未置顶桌面,主对话不注入)】', ...vaultIndexLines)
288
290
  }
289
291
  }
290
292
 
@@ -370,7 +372,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
370
372
  const view = clusterView(state, rootId)
371
373
  const modelsInfo = await listChiefModels(deps, false, rootId)
372
374
  const effCfgBefore = resolveWorkspaceConfig(state, rootId)
373
- const paceMode = effCfgBefore.paceMode || 'manual'
375
+ const runMode = effCfgBefore.runMode || 'off'
374
376
  const isConciseBrief = Boolean(effCfgBefore.tacticalModes && effCfgBefore.tacticalModes.conciseBrief)
375
377
  const currentSig = view.clusterSig || computeClusterSig(directory.cluster)
376
378
  const peerProgress = directory.cluster.length > 1
@@ -402,7 +404,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
402
404
  const isFresh = !rawInput || (hasSaved && view.narrative.hash === inputHash)
403
405
  const cooledForAuto = Date.now() - lastSummaryAt >= AUTO_SUMMARY_COOLDOWN_MS
404
406
  const cooledForChat = Date.now() - lastSummaryAt >= CHAT_OPPORTUNISTIC_SUMMARY_COOLDOWN_MS
405
- const allowBackgroundSummary = paceMode === 'auto' && autoSummarize && !isFresh && cooledForAuto
407
+ const allowBackgroundSummary = runMode === 'managed' && autoSummarize && !isFresh && cooledForAuto
406
408
  const allowChatSummary = Boolean(chatTriggered) && !isFresh && cooledForChat
407
409
 
408
410
  // Opportunistically refresh stale narrative in background after Chief chats (60s debounce),
@@ -417,6 +419,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
417
419
  : NARRATIVE_SYSTEM
418
420
  const res = await callChiefLlm(deps, {
419
421
  sessionId: rootId,
422
+ reasonKind: chatTriggered ? 'chat_summary' : 'auto_summary',
420
423
  system: sysPrompt,
421
424
  prompt: rawInput + (isConciseBrief
422
425
  ? '\n\n请开启【极简战报模式】:分结构列出多个简明短句,不写具体数字参数,精确概括现状:'
@@ -500,8 +503,8 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
500
503
  !_skipAutoPilotCheck
501
504
  && rootId
502
505
  && rootId !== 'global'
503
- && effectiveConfigBeforeStop.autoPilot
504
- && effectiveConfigBeforeStop.paceMode === 'auto'
506
+ && (effectiveConfigBeforeStop.autoPilot || effectiveConfigBeforeStop.runMode === 'managed')
507
+ && effectiveConfigBeforeStop.runMode === 'managed'
505
508
  && !effectiveConfigBeforeStop.stopped
506
509
  ) {
507
510
  if (idleAutoPilotHook) {