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/CHANGELOG.md +42 -0
- package/README.en.md +66 -50
- package/README.md +67 -50
- package/api-routes.js +165 -3
- package/archive-core.js +136 -8
- package/archive-dossiers.js +450 -20
- package/archive-precipitated.js +115 -36
- package/auto-continue.js +13 -5
- package/board-actions.js +59 -4
- package/board-schema.js +1 -1
- package/chief-approvals.js +176 -11
- package/chief-archives.js +157 -30
- package/chief-commands.js +565 -101
- package/chief-models.js +158 -28
- package/chief-review.js +211 -70
- package/chief-state.js +362 -32
- package/chief-view.js +17 -14
- package/client.js +3744 -2207
- package/digest.js +18 -9
- package/model-tools.js +15 -5
- package/package.json +9 -4
- package/runtime-hooks.js +115 -12
- package/subagent-runtime.js +257 -1
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
|
|
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 => `[
|
|
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('', '
|
|
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
|
|
282
|
-
...(
|
|
283
|
-
...
|
|
284
|
-
...
|
|
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 (
|
|
287
|
-
lines.push('', '
|
|
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
|
|
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 =
|
|
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.
|
|
506
|
+
&& (effectiveConfigBeforeStop.autoPilot || effectiveConfigBeforeStop.runMode === 'managed')
|
|
507
|
+
&& effectiveConfigBeforeStop.runMode === 'managed'
|
|
505
508
|
&& !effectiveConfigBeforeStop.stopped
|
|
506
509
|
) {
|
|
507
510
|
if (idleAutoPilotHook) {
|