dsh-chief 1.5.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/CHANGELOG.md +63 -0
- package/README.en.md +281 -129
- package/README.md +286 -134
- package/api-routes.js +232 -2
- package/board-actions.js +1452 -2005
- package/board-handoff.js +709 -0
- package/board-schema.js +365 -7
- package/chief-approvals.js +6 -2
- package/chief-archives.js +1 -0
- package/chief-commands.js +1884 -3484
- package/chief-compaction.js +1 -0
- package/chief-executor.js +6 -1
- package/chief-models.js +112 -5
- package/chief-network.js +1098 -869
- package/chief-review.js +448 -51
- package/chief-state.js +1996 -2523
- package/chief-view.js +10 -4
- package/client.js +20318 -11591
- package/command-helpers.js +568 -0
- package/command-ops.js +1226 -0
- package/digest.js +29 -4
- package/idle-guard.js +233 -8
- package/index.js +6 -0
- package/locale/en.json +72 -1
- package/locale/zh.json +72 -1
- package/model-tools.js +46 -3
- package/network-harness.js +1047 -0
- package/package.json +13 -5
- package/runtime-hooks.js +316 -14
- package/safety/guard-walls.js +5 -0
- package/safety/invariant-guards.js +126 -6
- package/safety/tool-gate.js +2 -0
- package/state-media.js +173 -0
- package/state-schema.js +1505 -0
- package/subagent-runtime.js +85 -4
package/model-tools.js
CHANGED
|
@@ -16,6 +16,40 @@ import {
|
|
|
16
16
|
CHIEF_PERMISSION_META,
|
|
17
17
|
} from './chief.js'
|
|
18
18
|
import { normalizePermissionMode } from './chief-executor.js'
|
|
19
|
+
import { computeBubbleState } from './chief-network.js'
|
|
20
|
+
|
|
21
|
+
function summarizeBubbleSnapshot(secDeps, rootId, dir) {
|
|
22
|
+
try {
|
|
23
|
+
const rid = rootId || 'global'
|
|
24
|
+
const b = computeBubbleState(secDeps, rid, null, dir || null)
|
|
25
|
+
const clusterLen = Array.isArray(dir && dir.cluster) ? dir.cluster.length : 0
|
|
26
|
+
const linkedPeersCount = clusterLen > 0
|
|
27
|
+
? Math.max(0, clusterLen - 1)
|
|
28
|
+
: (Array.isArray(dir && dir.targets) ? dir.targets.filter(t => t && t.kind === 'peer-session').length : 0)
|
|
29
|
+
return {
|
|
30
|
+
locked: Boolean(b && b.locked),
|
|
31
|
+
enrolledHarnesses: (Array.isArray(b && b.enrolledHarnesses) ? b.enrolledHarnesses : []).map(h => ({
|
|
32
|
+
provider: h.provider,
|
|
33
|
+
label: h.label || h.provider,
|
|
34
|
+
role: h.role || h.roleHint || '',
|
|
35
|
+
installed: h.installed !== false,
|
|
36
|
+
configured: Boolean(h.configured),
|
|
37
|
+
running: Boolean(h.running),
|
|
38
|
+
})),
|
|
39
|
+
availableHarnesses: (Array.isArray(b && b.availableHarnesses) ? b.availableHarnesses : [])
|
|
40
|
+
.filter(h => h && h.installed !== false)
|
|
41
|
+
.map(h => ({
|
|
42
|
+
provider: h.provider,
|
|
43
|
+
label: h.label || h.provider,
|
|
44
|
+
role: h.role || h.roleHint || '',
|
|
45
|
+
configured: Boolean(h.configured),
|
|
46
|
+
})),
|
|
47
|
+
linkedPeersCount,
|
|
48
|
+
}
|
|
49
|
+
} catch {
|
|
50
|
+
return { locked: false, enrolledHarnesses: [], availableHarnesses: [], linkedPeersCount: 0 }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
19
53
|
import {
|
|
20
54
|
STATUSES,
|
|
21
55
|
PRIORITIES,
|
|
@@ -105,8 +139,9 @@ export function createModelTools(deps) {
|
|
|
105
139
|
],
|
|
106
140
|
description:
|
|
107
141
|
'Board operation (MUST be called whenever recording tasks/status/conclusions or relaying messages; plain text alone does NOT update the board or notify peers). '
|
|
108
|
-
+ 'Use "graph.plan" (or "task.batch") to plan a hierarchical/DAG task graph in one call (supports parentId, blockedBy, owner/subagent, intent, evidence). '
|
|
109
|
-
+ '
|
|
142
|
+
+ 'Use "graph.plan" (or "task.batch") to plan a hierarchical/DAG task graph in one call (supports parentId, blockedBy, planStepId, targetPlanStepId, owner/subagent, intent, evidence). '
|
|
143
|
+
+ 'For multi-step workflows, define ordered steps via "plan.set" first and bind tasks/subagents with "planStepId" (and optional "targetPlanStepId") so the workflow topology displays step-by-step progress and subagent return arrows. '
|
|
144
|
+
+ 'Use "task.dispatch" to spawn or message a subagent, "team.steer" to steer a subagent, and "mail.send" to relay messages or dispatch work across lead/subagents/linked sessions/enrolled Bubble harnesses (pass provider id as target). '
|
|
110
145
|
+ 'Use "inquiry.reply" (inquiryId, text) whenever you see a priority [INQUIRY #id] from DSH Chief — answer accurately and continue your current work immediately without stopping. '
|
|
111
146
|
+ 'Use "chief.request" (subject, text) to ask DSH Chief for cross-session coordination, permission elevation, to report exploration & planning results, or when blocked by an insurmountable guard wall that cannot be bypassed safely. '
|
|
112
147
|
+ 'Use "wall.list" (read-only) to inspect currently active persistent guard walls defending high-risk paths/commands. '
|
|
@@ -125,6 +160,8 @@ export function createModelTools(deps) {
|
|
|
125
160
|
id: { type: 'string', description: 'Task id or temporary symbolic key (e.g. "t1", "api-design") referenced by parentId or blockedBy.' },
|
|
126
161
|
title: { type: 'string', description: 'Short task title.' },
|
|
127
162
|
parentId: { type: 'string', description: 'Parent task id/key for hierarchical decomposition.' },
|
|
163
|
+
planStepId: { type: 'string', description: 'Optional plan step id (from board.plan) this task or subagent branch belongs to; auto-binds to the current active step if omitted.' },
|
|
164
|
+
targetPlanStepId: { type: 'string', description: 'Optional plan step id that this task/subagent reports back to upon completion (defaults to planStepId; set to a later step for cross-step handoff).' },
|
|
128
165
|
blockedBy: { type: 'array', items: { type: 'string' }, description: 'Upstream task ids/keys that must finish (done) before this task unlocks.' },
|
|
129
166
|
owner: { type: 'string', description: 'Assigned subagent name (e.g. "researcher", "coder", "verifier") or owner.' },
|
|
130
167
|
subagent: { type: 'string', description: 'Subagent name to bind to this task.' },
|
|
@@ -203,7 +240,7 @@ export function createModelTools(deps) {
|
|
|
203
240
|
},
|
|
204
241
|
step: { type: 'string', description: 'cursor.set: which plan step is open right now, in your own words.' },
|
|
205
242
|
next: { type: 'string', description: 'cursor.set: the very next action — concrete enough to execute without re-reading the transcript.' },
|
|
206
|
-
blocked: { type: 'string', description: 'cursor.set:
|
|
243
|
+
blocked: { type: 'string', description: 'cursor.set: ONLY fill when execution is genuinely stalled/cannot proceed (e.g. missing credentials, permission denied, unresolved error). MUST pass empty string "" when not blocked — NEVER put "无", "none", user preferences/rules, or resolved notes here.' },
|
|
207
244
|
clear: { type: 'boolean', description: 'cursor.set: wipe step / next / blocked instead of overwriting them.' },
|
|
208
245
|
expectedTaskId: { type: 'string', description: 'cursor.set: task id this cursor is working on — the panel highlights that node in the tree.' },
|
|
209
246
|
memoryId: { type: 'string', description: 'Memory entry id for memory.remove.' },
|
|
@@ -227,6 +264,8 @@ export function createModelTools(deps) {
|
|
|
227
264
|
taskId: { type: 'string', description: 'task id for task.update / task.claim / task.release / task.remove / task.verify / task.dispatch (alias for id).' },
|
|
228
265
|
target: { type: 'string', description: 'task.add / task.update / task.dispatch: who this task is assigned to — visible in tree view as owner label.' },
|
|
229
266
|
parentId: { type: 'string', description: 'task.add / task.update: parent task id for tree hierarchy — renders the child indented under its parent.' },
|
|
267
|
+
planStepId: { type: 'string', description: 'task.add / task.update / task.dispatch: optional plan step id (from board.plan) this task or subagent belongs to; auto-binds to the current active step if omitted.' },
|
|
268
|
+
targetPlanStepId: { type: 'string', description: 'task.add / task.update / task.dispatch: optional plan step id that this task/subagent reports back to upon completion (defaults to planStepId).' },
|
|
230
269
|
status: { type: 'string', enum: STATUSES, description: 'Task status.' },
|
|
231
270
|
priority: { type: 'string', enum: PRIORITIES, description: 'Task priority.' },
|
|
232
271
|
field: {
|
|
@@ -421,6 +460,8 @@ export function createModelTools(deps) {
|
|
|
421
460
|
const roster = await refreshSubagentTree(runtime, session, board)
|
|
422
461
|
const svc = runtime.get('agentTeams')
|
|
423
462
|
const rawTeamTasks = (svc && typeof svc.listTasks === 'function' && callerAgent) ? (svc.listTasks(callerAgent) || []) : []
|
|
463
|
+
const secDeps = makeChiefDeps(runtime)
|
|
464
|
+
const dir = await listPeerDirectory(secDeps, session || rawSession).catch(() => null)
|
|
424
465
|
return {
|
|
425
466
|
ok: true,
|
|
426
467
|
subagents: roster,
|
|
@@ -429,6 +470,7 @@ export function createModelTools(deps) {
|
|
|
429
470
|
owner: t.ownerName || '', blockedBy: t.blockedBy || [],
|
|
430
471
|
ready: t.ready, revision: t.revision,
|
|
431
472
|
})),
|
|
473
|
+
bubble: summarizeBubbleSnapshot(secDeps, session || rawSession, dir),
|
|
432
474
|
...summary(board, roster),
|
|
433
475
|
}
|
|
434
476
|
} catch (err) {
|
|
@@ -543,6 +585,7 @@ export function createModelTools(deps) {
|
|
|
543
585
|
ok: true,
|
|
544
586
|
inbox,
|
|
545
587
|
peers: dir.targets,
|
|
588
|
+
bubble: summarizeBubbleSnapshot(secDeps, session || rawSession, dir),
|
|
546
589
|
...summary(board, roster),
|
|
547
590
|
}
|
|
548
591
|
}
|