dsh-agent-board 1.9.10 → 1.9.12

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/README.md CHANGED
@@ -41,7 +41,7 @@
41
41
  | **0.1.7 ~ 0.1.7-x**(含 rc) | **≥ 1.2.2(必须)** | 0.1.7 会话日志升级为 format v4:插件消息 `source.kind` 必须是生产者自有 kind。1.2.1 及更早会在**任务完成/阻塞回执**落盘时抛 `SessionFormatError: format v4 message requires a producer-owned source kind`,并连带使主窗口当前轮次失败(表现为「本轮运行失败」);同时「跳转会话」因宿主移除 `sessions.open` 而失效(控制台 `sessionsSvc.open is not a function`),卡片活动心跳读不到 v4 日志(`session.v4.jsonl.zstd`) |
42
42
  | 0.1.5-rc.1 ~ 0.1.6 | ≤ 1.2.1 | 1.2.2 起按 0.1.7 协议编写(v4 source kind、`uiWorkspace.openSession` 跳转),旧宿主未做回归验证,建议停留 1.2.1 |
43
43
 
44
- > 当前版本 **v1.9.10** 已在宿主 **0.2.2-rc.1** 全量实测:860 断言全绿 + 拆解官/力度路由/健康嗅探/帧活性挂死检测真机 E2E 全链;宿主侧活性自检通过(get-tasks/list-models/set-work-mode/poolStatus 全通)。本版特性:**teamModeCache 主动预填充**(修新会话无 Team 提示词——订阅 agent/created 主动 rt 预填充,新会话第一轮即有 Team 提示词;section text() 未命中时 fire-and-forget 兜底,60s/sid 节流,老会话重启后第二轮有)。上一版(v1.9.9)特性:思考等级可配 + 卡片生命周期状态机 + 拆解官粒度引导 + pipeline 分类修正 + buildWorkerPrompt 注入 touches + epic 父卡生命周期。
44
+ > 当前版本 **v1.9.12** 已在宿主 **0.2.2-rc.5** 实测:904 断言全绿 + 真机 Worker→Verifier 全链(pending→in-progress→verifying→resolved,Verifier 独立复跑验收通过)。本版修复 rc.5 两处破坏性契约变更:① **agents 服务移除 roots()/isOwnedBy()** → 根判定改 list()+SessionHeader.parentSession(修 get-tasks 500);② **subagents 移除 list() 且 Activation 规格由嵌套 request 改为扁平继承** → provider 枚举改 list→providers Map 双面探测,activationSpecOf 同时给扁平字段与嵌套 request(修 spawn TypeError 重试风暴)+ 外层异常详情落卡(spawn-throw)并纳入指数退避/最大次数治理。上一版(v1.9.11)为 agents 契约迁移首修。
45
45
 
46
46
  ```sh
47
47
  dsh plugin --profile web add dsh-agent-board@latest # 0.1.7+/0.2.x 宿主(推荐)
@@ -204,6 +204,31 @@
204
204
  return React.createElement('span', { title: b.tip, style: base }, b.txt)
205
205
  }
206
206
 
207
+ // ===== 执行者身份三型(主窗口 claim 与池 Worker 状态区分·direct 标识)=====
208
+ // 病根(主窗口实证):主窗口手动 claim 后 claimedBy=主窗口 session id,卡面/详情页照旧按
209
+ // 「⚡ 会话id(执行该任务的子代理会话)」口径渲染——读起来像池 Worker 在跑,实际不存在池
210
+ // Worker,「无 Worker 的进行中」被误判为异常。把 in-progress 认领位按执行者身份分三型:
211
+ // self(主窗口亲办)= claimedBy === selfId(GUI 所在主窗口会话认领亲办);
212
+ // pool(池 Worker) = claimedBy 命中 t.runs 里 role='worker' 留档(host 派发 spawn 成功后把
213
+ // claimedBy 从 'spawn-pending' 换成真实 run id 并同 id 留档 runs——这是
214
+ // 池 spawn 的可辨识指纹);
215
+ // subagent(直接子代理)= 其余真实会话 id(主窗口用 subagent 工具直接派生、非池 spawn 的
216
+ // 子代理领取——board 无对应 role='worker' 留档)。
217
+ // 'spawn-pending'(派发在途占位)与 'auto-dispatch'/'system'(老哨兵)不算任何执行者 → null,
218
+ // 卡面维持原 ⚡ 渲染口径(派发在途既非「无 Worker」也非「亲办」)。pipeline=direct 的卡三型
219
+ // 都可能出现(亲办 / 转手直接子代理 / GUI 手动派发池 Worker),三型统一用执行者徽章表达,
220
+ // 不再一律表现成 Worker 执行中。纯函数(只读 t 与传入 selfId,不引用 state/C/React),
221
+ // 可被单测从源码提取执行。
222
+ function executorKindOf(t, selfId) {
223
+ if (!t || !t.claimedBy) return null
224
+ var sid = String(t.claimedBy)
225
+ if (sid === 'spawn-pending' || sid === 'auto-dispatch' || sid === 'system') return null
226
+ if (selfId && sid === String(selfId)) return 'self'
227
+ var runs = Array.isArray(t.runs) ? t.runs : []
228
+ for (var i = 0; i < runs.length; i++) { if (runs[i] && runs[i].role === 'worker' && String(runs[i].id) === sid) return 'pool' }
229
+ return 'subagent'
230
+ }
231
+
207
232
  function Card(props) { var t = props.task; var pc = prioColor[t.priority] || prioColor.low; var dragging = state.dragTask === t.id; var preview = (t.deliverable && t.deliverable.summary) || t.resolution; var critGlow = t.priority === 'critical' && !t.escalation; var sel = !!state.selected[t.id]; var pm = pipeOf(t); var depBlock = t.status === 'pending' && depsBlocked(t); var delOk = !state.selectMode && canDelete(t); var cs = (state.childStats && state.childStats[t.id]) || null; var csDone = cs ? (typeof cs.settled === 'number' ? cs.settled : cs.resolved) : 0; var epic = !!(cs && cs.total > 0); var parentT = t.parentId ? getTask(t.parentId) : null; var depWaitTitle = ''; var depWaitN = 0; if (depBlock) { t.dependsOn.forEach(function (id) { var d = getTask(id); if (!d || (d.status !== 'resolved' && d.status !== 'archived')) { depWaitN++; if (!depWaitTitle) depWaitTitle = d && d.title ? d.title : id } }) } var durB = cardDur(t);
208
233
  // 无障碍(反馈 n-mut9rzpyc7p1):卡片根以 button 角色进 Tab 序(aria-label=标题+状态),
209
234
  // Enter/Space 触发与点击相同的激活行为(多选=切换选中,否则开详情);
@@ -219,7 +244,15 @@
219
244
  (Array.isArray(t.waitingForTouches) && t.waitingForTouches.length) ? React.createElement('span', { title: '等文件锁释放:' + t.waitingForTouches.join('、') + '(touches 冲突,详情页可 force 越权派发)', style: { color: C.warn, fontWeight: 600 } }, '🔒 等文件释放') : null,
220
245
  React.createElement('span', { title: pm.label, style: { fontSize: 9, padding: '0 4px', borderRadius: 2, background: C.nested, border: '1px solid ' + C.border } }, pm.short),
221
246
  (t.retryCount || 0) + (t.rejectCount || 0) > 0 ? React.createElement('span', { title: '重试 ' + (t.retryCount || 0) + ' 次 / 驳回 ' + (t.rejectCount || 0) + ' 次', style: { color: C.warn, fontWeight: 600 } }, '⟳' + ((t.retryCount || 0) + (t.rejectCount || 0))) : null,
222
- t.status === 'in-progress' && t.claimedBy ? React.createElement('span', { title: '执行该任务的子代理会话:' + t.claimedBy }, '⚡ ' + String(t.claimedBy).slice(0, 8) + '…') : null,
247
+ // 执行者三型徽章(主窗口 claim 与池 Worker 状态区分·direct 标识):主窗口亲办(claimedBy=本会话)
248
+ // →「🪟 主窗口亲办」;直接子代理(非主窗口且无 runs worker 留档)→「🤖 直接子代理」+会话id;
249
+ // 池 Worker / 派发在途占位 → 维持原「⚡ 会话id…」形态(池 Worker 的既有身份表达,title 区分)。
250
+ t.status === 'in-progress' && t.claimedBy ? (function () {
251
+ var ek = executorKindOf(t, state.sessionId)
252
+ if (ek === 'self') return React.createElement('span', { title: '主窗口亲办:本卡由主窗口会话(' + t.claimedBy + ')认领直接处理,不存在池 Worker——「无 Worker 的进行中」是亲办语义、不是异常(pipeline=direct 的预期执行形态)', style: { color: C.brand, fontWeight: 600, whiteSpace: 'nowrap' } }, '🪟 主窗口亲办')
253
+ if (ek === 'subagent') return React.createElement('span', { title: '执行该任务的直接子代理会话(主窗口 subagent 工具派生、非派发池 spawn):' + t.claimedBy, style: { color: C.brand, fontWeight: 600, whiteSpace: 'nowrap' } }, '🤖 直接子代理 ' + String(t.claimedBy).slice(0, 8) + '…')
254
+ return React.createElement('span', { title: (ek === 'pool' ? '执行该任务的池 Worker 子代理会话(派发池 spawn)' : '执行该任务的子代理会话(派发在途)') + ':' + t.claimedBy }, '⚡ ' + String(t.claimedBy).slice(0, 8) + '…')
255
+ })() : null,
223
256
  t.assignee ? React.createElement('span', { title: '指派给:' + t.assignee }, '👤→' + String(t.assignee).slice(0, 8) + '…') : null,
224
257
  durB ? React.createElement('span', { title: durB.tip }, durB.txt) : null,
225
258
  // 删除入口(仅草稿/待办/阻塞,多选模式下隐藏以免误触):hover 才由透明转红,平时不抢视觉
@@ -267,26 +300,26 @@
267
300
  rpc('update-task', { taskId: id, resetToPending: true }).then(function () { fetchTasks() }).catch(function () {})
268
301
  }
269
302
  return React.createElement('div', null,
270
- React.createElement('input', { value: q, onChange: function (e) { setQ(e.target.value); state.archQ = e.target.value }, placeholder: '检索标题 / ID / 标签…', style: { width: '100%', padding: '5px 8px', fontSize: 11, border: '1px solid ' + C.border2, borderRadius: 5, background: C.card, color: C.text, marginBottom: 8 } }),
271
- React.createElement('div', { style: { fontSize: 10, color: C.text2, marginBottom: 6 }, title: '归档 tab 含已归档 + 已取消两类;仪表盘「已归档」只数已归档,不数已取消' }, '共 ' + archived.length + ' 条' + (cancelledCount > 0 ? '(含已取消 ' + cancelledCount + ' 条)' : '')),
272
- archived.length === 0 ? React.createElement('div', { style: { fontSize: 11, color: C.text2, padding: 12, textAlign: 'center' } }, '暂无归档/已取消任务') :
273
- list.length === 0 ? React.createElement('div', { style: { fontSize: 11, color: C.text2, padding: 12, textAlign: 'center' } }, '无匹配结果') :
303
+ React.createElement('input', { value: q, onChange: function (e) { setQ(e.target.value); state.archQ = e.target.value }, placeholder: '检索标题 / ID / 标签…', style: { width: '100%', padding: '7px 10px', fontSize: C.fsSub, border: '1px solid ' + C.border2, borderRadius: 6, background: C.card, color: C.text, marginBottom: 8 } }),
304
+ React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginBottom: 8 }, title: '归档 tab 含已归档 + 已取消两类;仪表盘「已归档」只数已归档,不数已取消' }, '共 ' + archived.length + ' 条' + (cancelledCount > 0 ? '(含已取消 ' + cancelledCount + ' 条)' : '')),
305
+ archived.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, padding: 16, textAlign: 'center' } }, '暂无归档/已取消任务') :
306
+ list.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, padding: 16, textAlign: 'center' } }, '无匹配结果') :
274
307
  list.map(function (t) {
275
308
  // 归档行点击进详情(用户 2026-10-09 指令):复用 state.detailId 机制,与看板卡同路径;
276
309
  // 详情页对 archived 的操作区既有门禁不回归(恢复待办=保存并重置、删除仅 draft/pending/blocked)。
277
- return React.createElement('div', { key: t.id, onClick: function () { state.detailId = t.id; notify() }, title: '点击查看详情', style: { padding: '6px 8px', marginBottom: 5, background: C.card, border: '1px solid ' + C.border, borderRadius: 6, cursor: 'pointer' } },
278
- React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
279
- React.createElement('span', { style: { fontSize: 11, fontWeight: 600, color: C.text, flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, title: t.title }, t.title),
280
- reviewPending(t) ? React.createElement('span', { title: '👁 建议过目(命中风险信号):\n' + ((t.reviewHint && t.reviewHint.reasons) || []).join('\n'), style: { fontSize: 9, padding: '0 4px', borderRadius: 2, background: 'color-mix(in srgb, ' + C.warn + ' 22%, transparent)', color: C.warn, fontWeight: 600, whiteSpace: 'nowrap', flexShrink: 0 } }, '👁 建议过目') : null,
281
- t.verification ? React.createElement('span', { title: '验收结论: ' + (t.verification.summary || '').slice(0, 100), style: { fontSize: 9, padding: '1px 5px', borderRadius: 3, background: t.verification.verdict === 'approved' ? C.ok : C.err, color: C_INV } }, t.verification.verdict === 'approved' ? '过' : '驳') : null,
282
- t.status === 'cancelled' ? React.createElement('span', { title: '已取消(可恢复待办)', style: { fontSize: 9, padding: '0 4px', borderRadius: 2, background: 'color-mix(in srgb, ' + C.warn + ' 20%, transparent)', color: C.warn, fontWeight: 600, whiteSpace: 'nowrap', flexShrink: 0 } }, '已取消') : null,
283
- React.createElement('span', { style: { fontSize: 9, color: C.text2 } }, (t.archivedAt || t.cancelledAt) ? ago(t.archivedAt || t.cancelledAt) : '')),
284
- t.verification && t.verification.summary ? React.createElement('div', { style: { fontSize: 10, color: C.text2, marginTop: 2, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, '📝 ' + t.verification.summary) : null,
285
- React.createElement('div', { style: { display: 'flex', gap: 5, marginTop: 4, flexWrap: 'wrap' } },
286
- React.createElement('button', { onClick: function (e) { e.stopPropagation(); restore(t.id) }, title: wm === 'list' ? '恢复为待办' : '恢复为待办(将按当前工作模式立即重新派发,消耗一轮 Worker+Verifier token)', style: { fontSize: 9, padding: '2px 7px', border: '1px solid ' + C.brand, borderRadius: 3, background: 'transparent', color: C.brand, cursor: 'pointer' } }, '↩ 恢复待办'),
310
+ return React.createElement('div', { key: t.id, onClick: function () { state.detailId = t.id; notify() }, title: '点击查看详情', style: { padding: '10px 12px', marginBottom: 8, background: C.card, border: '1px solid ' + C.border, borderRadius: 8, cursor: 'pointer' } },
311
+ React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 8 } },
312
+ React.createElement('span', { style: { fontSize: C.fsBody, fontWeight: 600, color: C.text, flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, title: t.title }, t.title),
313
+ reviewPending(t) ? React.createElement('span', { title: '👁 建议过目(命中风险信号):\n' + ((t.reviewHint && t.reviewHint.reasons) || []).join('\n'), style: { fontSize: C.fsAux, padding: '1px 6px', borderRadius: 4, background: 'color-mix(in srgb, ' + C.warn + ' 22%, transparent)', color: C.warn, fontWeight: 600, whiteSpace: 'nowrap', flexShrink: 0 } }, '👁 建议过目') : null,
314
+ t.verification ? React.createElement('span', { title: '验收结论: ' + (t.verification.summary || '').slice(0, 100), style: { fontSize: C.fsAux, padding: '1px 6px', borderRadius: 4, background: t.verification.verdict === 'approved' ? C.ok : C.err, color: C_INV } }, t.verification.verdict === 'approved' ? '过' : '驳') : null,
315
+ t.status === 'cancelled' ? React.createElement('span', { title: '已取消(可恢复待办)', style: { fontSize: C.fsAux, padding: '1px 6px', borderRadius: 4, background: 'color-mix(in srgb, ' + C.warn + ' 20%, transparent)', color: C.warn, fontWeight: 600, whiteSpace: 'nowrap', flexShrink: 0 } }, '已取消') : null,
316
+ React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, (t.archivedAt || t.cancelledAt) ? ago(t.archivedAt || t.cancelledAt) : '')),
317
+ t.verification && t.verification.summary ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, marginTop: 3, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, '📝 ' + t.verification.summary) : null,
318
+ React.createElement('div', { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' } },
319
+ React.createElement('button', { onClick: function (e) { e.stopPropagation(); restore(t.id) }, title: wm === 'list' ? '恢复为待办' : '恢复为待办(将按当前工作模式立即重新派发,消耗一轮 Worker+Verifier token)', style: { fontSize: C.fsAux, padding: '3px 9px', border: '1px solid ' + C.brand, borderRadius: 4, background: 'transparent', color: C.brand, cursor: 'pointer' } }, '↩ 恢复待办'),
287
320
  (function () {
288
321
  var runs = historyRuns(t)
289
- if (!runs.length) return React.createElement('span', { style: { fontSize: 9, color: C.text2, opacity: 0.6, padding: '2px 0' } }, '无历史会话')
322
+ if (!runs.length) return React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2, opacity: 0.6, padding: '3px 0' } }, '无历史会话')
290
323
  // 拆解官可见性同族修正(task-mvomad6c ③):runs 行此前 W/V 二元标签,decomposer 被误标 W——
291
324
  // 加 🧩 标签与独立序数(W/V 序号口径逐字不变)
292
325
  var wN = 0, vN = 0, dN = 0
@@ -297,7 +330,7 @@
297
330
  return React.createElement('button', {
298
331
  key: i, onClick: function (e) { e.stopPropagation(); if (uiWorkspaceSvc) uiWorkspaceSvc.openSession(r.id) },
299
332
  title: (isV ? 'Verifier' : (isD ? '拆解官' : 'Worker')) + ' 第 ' + seq + ' 次' + (r.at ? ' · ' + ago(r.at) : '') + (r.model ? ' · ' + r.model : '') + '(' + r.id + ')',
300
- style: { fontSize: 9, padding: '2px 7px', border: '1px solid ' + (isV ? C.warn : C.brand), borderRadius: 3, background: 'transparent', color: isV ? C.warn : C.brand, cursor: 'pointer' }
333
+ style: { fontSize: C.fsAux, padding: '3px 9px', border: '1px solid ' + (isV ? C.warn : C.brand), borderRadius: 4, background: 'transparent', color: isV ? C.warn : C.brand, cursor: 'pointer' }
301
334
  }, '→ ' + (isV ? 'V' : (isD ? '🧩' : 'W')) + '#' + seq)
302
335
  }))
303
336
  })()))