dsh-chief 1.6.0 → 1.7.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
@@ -17,6 +17,7 @@ import {
17
17
  loadChiefState,
18
18
  mutateChiefState,
19
19
  computeClusterSig,
20
+ emptyWorkspace,
20
21
  ensureWorkspace,
21
22
  clusterView,
22
23
  shortAgentBriefName,
@@ -28,7 +29,7 @@ import {
28
29
  summarizeLlmLedger,
29
30
  } from './chief-state.js'
30
31
  import { listChiefModels, callChiefLlm } from './chief-models.js'
31
- import { collectClusterPeerProgress, listPeerDirectory } from './chief-network.js'
32
+ import { collectClusterPeerProgress, listPeerDirectory, computeBubbleState } from './chief-network.js'
32
33
 
33
34
  let idleAutoPilotHook = null
34
35
 
@@ -405,7 +406,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
405
406
  const isFresh = !rawInput || (hasSaved && view.narrative.hash === inputHash)
406
407
  const cooledForAuto = Date.now() - lastSummaryAt >= AUTO_SUMMARY_COOLDOWN_MS
407
408
  const cooledForChat = Date.now() - lastSummaryAt >= CHAT_OPPORTUNISTIC_SUMMARY_COOLDOWN_MS
408
- const allowBackgroundSummary = runMode === 'managed' && autoSummarize && !isFresh && cooledForAuto
409
+ const allowBackgroundSummary = Boolean(effCfgBefore.sessionEnabled) && runMode === 'managed' && autoSummarize && !isFresh && cooledForAuto
409
410
  const allowChatSummary = Boolean(chatTriggered) && !isFresh && cooledForChat
410
411
 
411
412
  // Opportunistically refresh stale narrative in background after Chief chats (60s debounce),
@@ -498,12 +499,13 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
498
499
  }
499
500
  }
500
501
 
501
- const ownWsBeforeStop = ensureWorkspace(latestState, rootId)
502
+ const ownWsBeforeStop = (latestState.workspaces && latestState.workspaces[rootId]) || emptyWorkspace()
502
503
  const effectiveConfigBeforeStop = resolveWorkspaceConfig(latestState, rootId)
503
504
  if (
504
505
  !_skipAutoPilotCheck
505
506
  && rootId
506
507
  && rootId !== 'global'
508
+ && effectiveConfigBeforeStop.sessionEnabled
507
509
  && (effectiveConfigBeforeStop.autoPilot || effectiveConfigBeforeStop.runMode === 'managed')
508
510
  && effectiveConfigBeforeStop.runMode === 'managed'
509
511
  && !effectiveConfigBeforeStop.stopped
@@ -520,7 +522,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
520
522
 
521
523
  const finalState = loadChiefState()
522
524
  const finalView = clusterView(finalState, rootId)
523
- const ownWs = ensureWorkspace(finalState, rootId)
525
+ const ownWs = (finalState.workspaces && finalState.workspaces[rootId]) || emptyWorkspace()
524
526
  const effectiveConfig = resolveWorkspaceConfig(finalState, rootId)
525
527
  const narrativeAt = hasLatestSaved
526
528
  ? (latestView.narrative.at || 0)
@@ -569,6 +571,7 @@ export async function getChiefView(deps, sessionId, { regenerate = false, autoSu
569
571
  activeWork: getChiefActiveWork(rootId),
570
572
  llmLedger: summarizeLlmLedger(ownWs.llmLedger, effectiveConfig),
571
573
  alertEvents: (Array.isArray(ownWs.alertEvents) ? ownWs.alertEvents : []).slice(-12),
574
+ bubble: computeBubbleState(deps, rootId, finalState, directory),
572
575
  auditLog: (Array.isArray(ownWs.auditLog) ? ownWs.auditLog : []).slice(-50).reverse(),
573
576
  }
574
577
  }