dsh-agent-board 1.9.9 → 1.9.11
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 +2 -1
- package/lib/client/board-list.js +50 -17
- package/lib/client/dashboard.js +414 -203
- package/lib/client/kernel.js +66 -17
- package/lib/client/task-detail.js +233 -51
- package/lib/client.js +763 -288
- package/lib/core.mjs +54 -3
- package/lib/dispatch.mjs +443 -44
- package/lib/rpc.mjs +10 -7
- package/lib/session.mjs +11 -3
- package/lib/store.mjs +3 -1
- package/package.json +1 -1
- package/test/core.test.mjs +646 -2
- package/test/lane-gui-bysize.test.mjs +595 -0
- package/test/lifecycle.test.mjs +102 -15
package/lib/client/dashboard.js
CHANGED
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
function TrendChart(props) {
|
|
64
64
|
var data = props.data || []
|
|
65
65
|
var max = 1; data.forEach(function (d) { if (d.count > max) max = d.count })
|
|
66
|
-
return React.createElement('div', { style: { padding: '
|
|
67
|
-
React.createElement('div', { style: { fontSize:
|
|
66
|
+
return React.createElement('div', { style: { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 } },
|
|
67
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6 } }, '近 7 天完成趋势'),
|
|
68
68
|
React.createElement('div', { style: { display: 'flex', alignItems: 'flex-end', gap: 4, height: 40 } },
|
|
69
69
|
data.map(function (d, i) {
|
|
70
70
|
var h = d.count > 0 ? Math.max(10, Math.round(d.count / max * 36)) : 3
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
})))
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
function StatCard(props) { return React.createElement('div', { style: { flex: '1 1 0', minWidth: 80, padding: '
|
|
78
|
+
function StatCard(props) { return React.createElement('div', { style: { flex: '1 1 0', minWidth: 80, padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, textAlign: 'center' } }, React.createElement('div', { style: { fontSize: 20, fontWeight: 700, color: props.color || C.text } }, String(props.value)), React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, marginTop: 2 } }, props.label)) }
|
|
79
79
|
|
|
80
80
|
// 双行指标卡(耗时口径三分离:原「平均完成时间」一个展示位拆为 排队/执行 两行,不挤占其他指标位)
|
|
81
|
-
function StatCardDual(props) { return React.createElement('div', { style: { flex: '1 1 0', minWidth: 80, padding: '
|
|
81
|
+
function StatCardDual(props) { return React.createElement('div', { style: { flex: '1 1 0', minWidth: 80, padding: '10px 12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, textAlign: 'center' }, title: props.title }, React.createElement('div', { style: { fontSize: 14, fontWeight: 700, color: props.color || C.text } }, String(props.value1)), React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, marginTop: 1 } }, props.label1), React.createElement('div', { style: { fontSize: 14, fontWeight: 700, color: props.color || C.text, marginTop: 3 } }, String(props.value2)), React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, marginTop: 1 } }, props.label2)) }
|
|
82
82
|
|
|
83
83
|
// 调研 ROI 对比行(task-mutnjesa):让数据替道理说话——「有调研 vs 无调研」分组账单直接摆给主窗口看,
|
|
84
84
|
// 比任何引导文案都管用。数据源 computeStats 的 roi(null = 任一组为空或总样本 <4,整块不渲染);
|
|
@@ -99,14 +99,14 @@
|
|
|
99
99
|
icon + ' ' + label + ' ',
|
|
100
100
|
React.createElement('span', { style: { fontWeight: 600, color: warnNums ? C.warn : C.text } }, g.n + ' 卡 平均 ' + fmtM(g.execMs) + '/约 ' + (g.tok === null ? '-' : (approx ? '~' : '') + fmtTokens(g.tok)) + ' tok'))
|
|
101
101
|
}
|
|
102
|
-
return React.createElement('div', { style: { padding: '
|
|
103
|
-
React.createElement('span', { style: { fontSize:
|
|
102
|
+
return React.createElement('div', { style: { padding: '10px 12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14, fontSize: C.fsSub, color: C.text2, display: 'flex', alignItems: 'baseline', gap: 8, flexWrap: 'wrap' }, title: 'resolved/archived 且领取过的卡按有无调研注入分组现算(执行 = 被领取→完成;token 均值只计有 usage 结算记录的卡,口径 = 有效消耗:输入+输出+缓存写,不含缓存读;老卡无分量字段时退化为合计并标 ~)' },
|
|
103
|
+
React.createElement('span', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, display: 'inline-flex', alignItems: 'center', gap: 4 } }, ic('scale', 11), '调研 ROI'),
|
|
104
104
|
grp('📎', '有调研', roi.yes, false),
|
|
105
105
|
React.createElement('span', null, '·'),
|
|
106
106
|
grp('⚠️', '无调研', roi.no, noSlower))
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function BarRow(props) { var pct = props.total > 0 ? (props.count / props.total * 100) : 0; return React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 } }, React.createElement('span', { style: { width: 40, fontSize:
|
|
109
|
+
function BarRow(props) { var pct = props.total > 0 ? (props.count / props.total * 100) : 0; return React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 } }, React.createElement('span', { style: { width: 40, fontSize: C.fsSub, color: C.text2, textAlign: 'right', flexShrink: 0 } }, props.label), React.createElement('div', { style: { flex: 1, height: 8, background: C.nested, borderRadius: 4, overflow: 'hidden' } }, React.createElement('div', { style: { height: '100%', width: pct + '%', background: props.color || C.brand, borderRadius: 4, transition: 'width .3s' } })), React.createElement('span', { style: { width: 24, fontSize: C.fsSub, color: C.text2, flexShrink: 0 } }, String(props.count))) }
|
|
110
110
|
|
|
111
111
|
// ===== 仪表盘:日期范围筛选(共享给报告与全局总览)=====
|
|
112
112
|
function tsInRange(iso, from, to) {
|
|
@@ -145,29 +145,29 @@
|
|
|
145
145
|
function fmt(d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2) }
|
|
146
146
|
setRange(fmt(from), fmt(to))
|
|
147
147
|
}
|
|
148
|
-
var headBtn = { fontSize:
|
|
149
|
-
var chip = { fontSize:
|
|
150
|
-
var dateInput = { fontSize:
|
|
148
|
+
var headBtn = { fontSize: C.fsSub, padding: '3px 10px', border: '1px solid ' + (rg.from || rg.to ? C.brand : C.border), borderRadius: 5, background: (rg.from || rg.to) ? C.nested : C.card, color: (rg.from || rg.to) ? C.brand : C.text2, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 4 }
|
|
149
|
+
var chip = { fontSize: C.fsSub, padding: '2px 8px', border: '1px solid ' + C.border2, borderRadius: 10, background: C.card, color: C.text2, cursor: 'pointer' }
|
|
150
|
+
var dateInput = { fontSize: C.fsSub, padding: '2px 6px', border: '1px solid ' + C.border2, borderRadius: 4, background: C.card, color: C.text }
|
|
151
151
|
return React.createElement('div', { style: { marginBottom: 10 } },
|
|
152
152
|
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
|
|
153
153
|
React.createElement('button', { onClick: function () { state.rfOpen = !open; setOpen(!open) }, style: headBtn },
|
|
154
154
|
ic('calendar-days', 11),
|
|
155
155
|
React.createElement('span', null, '统计范围: ' + rangeLabel()),
|
|
156
156
|
ic(open ? 'chevron-up' : 'chevron-down', 10))),
|
|
157
|
-
open ? React.createElement('div', { style: { marginTop: 6, padding: '
|
|
157
|
+
open ? React.createElement('div', { style: { marginTop: 6, padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8 } },
|
|
158
158
|
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
|
|
159
|
-
React.createElement('span', { style: { fontSize:
|
|
159
|
+
React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 } }, '快捷:'),
|
|
160
160
|
React.createElement('button', { onClick: function () { preset(1) }, style: chip }, '今天'),
|
|
161
161
|
React.createElement('button', { onClick: function () { preset(7) }, style: chip }, '近 7 天'),
|
|
162
162
|
React.createElement('button', { onClick: function () { preset(30) }, style: chip }, '近 30 天'),
|
|
163
163
|
React.createElement('button', { onClick: function () { preset(0) }, style: chip }, '全部'),
|
|
164
164
|
React.createElement('span', { style: { flex: 1 } }),
|
|
165
|
-
React.createElement('label', { style: { fontSize:
|
|
165
|
+
React.createElement('label', { style: { fontSize: C.fsSub, color: C.text2, display: 'inline-flex', alignItems: 'center', gap: 4 } }, '开始',
|
|
166
166
|
React.createElement('input', { type: 'date', value: rg.from, onChange: function (e) { setRange(e.target.value, rg.to) }, style: dateInput })),
|
|
167
|
-
React.createElement('label', { style: { fontSize:
|
|
167
|
+
React.createElement('label', { style: { fontSize: C.fsSub, color: C.text2, display: 'inline-flex', alignItems: 'center', gap: 4 } }, '截至',
|
|
168
168
|
React.createElement('input', { type: 'date', value: rg.to, onChange: function (e) { setRange(rg.from, e.target.value) }, style: dateInput })),
|
|
169
|
-
React.createElement('span', { style: { fontSize:
|
|
170
|
-
React.createElement('div', { style: { fontSize:
|
|
169
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '作用于报告、全局总览与 Token 区(模型分布/Top8/累计)')),
|
|
170
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 5 } }, '报告统计「时间范围内有活动」的任务;总览只显示范围内有活跃的会话;Token 区按 run 的本地日落点过滤(今日与近 7 天为固定口径,不受范围影响)。')) : null)
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
function GlobalBoards() {
|
|
@@ -180,15 +180,15 @@
|
|
|
180
180
|
var rg = activeRange()
|
|
181
181
|
var shown = boards.filter(function (b) { return !rg.from && !rg.to ? true : tsInRange(b.lastActivity, rg.from, rg.to) })
|
|
182
182
|
var activeN = boards.filter(function (b) { return b.counts.inProgress || b.counts.verifying || b.counts.pending || b.counts.blocked }).length
|
|
183
|
-
return React.createElement('div', { style: { padding: '
|
|
184
|
-
React.createElement('div', { onClick: function () { state.gboOpen = !open; setOpen(!open); if (!open) load() }, style: { fontSize:
|
|
183
|
+
return React.createElement('div', { style: { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 } },
|
|
184
|
+
React.createElement('div', { onClick: function () { state.gboOpen = !open; setOpen(!open); if (!open) load() }, style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, cursor: 'pointer', display: 'flex', alignItems: 'center', gap: 4 } },
|
|
185
185
|
ic('layout-grid', 11),
|
|
186
186
|
React.createElement('span', null, '全局会话总览(本机 ' + boards.length + ' 个看板 · ' + activeN + ' 个活跃)'),
|
|
187
|
-
open && (rg.from || rg.to) ? React.createElement('span', { style: { fontSize:
|
|
187
|
+
open && (rg.from || rg.to) ? React.createElement('span', { style: { fontSize: C.fsAux, color: C.brand } }, '范围: ' + rangeLabel()) : null,
|
|
188
188
|
React.createElement('span', { style: { marginLeft: 'auto', display: 'inline-flex', color: C.text2 } }, ic(open ? 'chevron-up' : 'chevron-down', 11))),
|
|
189
|
-
open ? (shown.length === 0 ? React.createElement('div', { style: { fontSize:
|
|
189
|
+
open ? (shown.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, padding: '6px 0' } }, '时间范围内无活跃会话') : shown.map(function (b, i) {
|
|
190
190
|
var isSelf = b.session === state.sessionId
|
|
191
|
-
return React.createElement('div', { key: i, style: { display: 'flex', alignItems: 'center', gap: 6, fontSize:
|
|
191
|
+
return React.createElement('div', { key: i, style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: C.fsSub, padding: '3px 0', borderBottom: '1px solid ' + C.nested } },
|
|
192
192
|
React.createElement('span', { onClick: function () { if (!isSelf && uiWorkspaceSvc) uiWorkspaceSvc.openSession(b.session) }, style: { color: isSelf ? C.text2 : C.brand, cursor: isSelf ? 'default' : 'pointer', textDecoration: isSelf ? 'none' : 'underline', minWidth: 90 } }, (isSelf ? '★ ' : '') + shortId(b.session)),
|
|
193
193
|
React.createElement('span', { style: { color: C.text2 } }, workModeNames[b.teamMode ? 'team' : (b.boardMode === 'auto' ? 'auto' : 'list')]),
|
|
194
194
|
React.createElement('span', { style: { display: 'inline-flex', gap: 5 } },
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
try { var blob = new Blob([text], { type: 'text/markdown' }); var a = document.createElement('a'); a.href = URL.createObjectURL(blob); a.download = 'board-report.md'; a.click(); setMsg('✅ 已下载 board-report.md'); setTimeout(function () { setMsg('') }, 2500) } catch (_) { setMsg('⚠️ 导出失败') }
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 5 } }, React.createElement('button', { onClick: gen, title: '生成本看板 markdown 报告并复制', style: { fontSize:
|
|
311
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 5 } }, React.createElement('button', { onClick: gen, title: '生成本看板 markdown 报告并复制', style: { fontSize: C.fsSub, padding: '3px 10px', border: '1px solid ' + C.border, borderRadius: 5, background: C.card, color: C.text, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 4 } }, ic('file-down', 12), '生成报告'), msg ? React.createElement('span', { style: { fontSize: C.fsSub, color: C.ok } }, msg) : null)
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
// ===== Token 消耗区(数据源:host 端 get-tasks 的 usageSummary)=====
|
|
@@ -347,20 +347,20 @@
|
|
|
347
347
|
var pct = props.max > 0 ? Math.max(2, Math.round(props.value / props.max * 100)) : 0
|
|
348
348
|
var clickable = !!props.onClick
|
|
349
349
|
return React.createElement('div', { onClick: props.onClick, title: props.title, style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4, cursor: clickable ? 'pointer' : 'default' } },
|
|
350
|
-
React.createElement('span', { style: { width: 110, fontSize:
|
|
350
|
+
React.createElement('span', { style: { width: 110, fontSize: C.fsSub, color: props.labelColor || C.text2, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flexShrink: 0 } }, props.label),
|
|
351
351
|
React.createElement('div', { style: { flex: 1, height: 8, background: C.nested, borderRadius: 4, overflow: 'hidden' } },
|
|
352
352
|
React.createElement('div', { style: { height: '100%', width: pct + '%', background: props.color || C.brand, borderRadius: 4, transition: 'width .3s' } })),
|
|
353
|
-
React.createElement('span', { style: { width: 54, fontSize:
|
|
353
|
+
React.createElement('span', { style: { width: 54, fontSize: C.fsSub, color: C.text2, textAlign: 'right', flexShrink: 0 } }, fmtTokens(props.value)))
|
|
354
354
|
}
|
|
355
355
|
function TokenUsage(props) {
|
|
356
356
|
var u = props.usage
|
|
357
|
-
var box = { padding: '
|
|
357
|
+
var box = { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 }
|
|
358
358
|
// 范围激活标记:Token 区的模型分布/Top8/累计已按「统计范围」过滤(host 侧重算),
|
|
359
359
|
// 不加标记的话用户没法判断看到的数字是全量还是范围内——标记与 RangeFilter 同源(activeRange)。
|
|
360
360
|
var tg = activeRange()
|
|
361
361
|
var tgOn = !!(tg.from || tg.to)
|
|
362
|
-
var head = React.createElement('div', { style: { fontSize:
|
|
363
|
-
tgOn ? React.createElement('span', { style: { fontSize:
|
|
362
|
+
var head = React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('bar-chart-3', 11), 'Token 消耗',
|
|
363
|
+
tgOn ? React.createElement('span', { style: { fontSize: C.fsAux, fontWeight: 400, color: C.brand, border: '1px solid ' + C.brand, borderRadius: 8, padding: '0 6px' }, title: '模型分布 / 任务消耗 Top 8 / 累计已按统计范围过滤:' + rangeLabel() }, '范围内: ' + rangeLabel()) : null)
|
|
364
364
|
// ===== 主窗口(本会话对话)消耗(task-muwsol23):host 增量尾读主会话 v4 日志聚合 =====
|
|
365
365
|
// 隔离口径:只在 Token 区单列一行 + 模型分布尾部追加一条;不进累计 / Top 8 / 模型归属摊派。
|
|
366
366
|
// 缺字段(老 host)/ 读不到日志 / 无 usage → mw=null → 两处都不渲染(静默降级,不炸轮询)。
|
|
@@ -376,13 +376,13 @@
|
|
|
376
376
|
// 主窗口单列行(累计行下方):「主窗口(本会话):今日 X · 累计 Y」(总量口径,有效值见悬浮 title)
|
|
377
377
|
function mwLine() {
|
|
378
378
|
if (!mw) return null
|
|
379
|
-
return React.createElement('div', { style: { fontSize:
|
|
379
|
+
return React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, marginBottom: 8 }, title: '主窗口(本会话对话)消耗:总量口径(含缓存读);有效消耗(输入+输出+缓存写,不含缓存读)= ' + String(mw.effective) + ' tok。host 增量尾读本会话 v4 日志聚合' + (tgOn ? ';随统计范围裁剪(按助手消息的本地日落点)' : '') + '。与看板派发口径并列展示——不进累计 / Top 8 / 模型归属摊派' },
|
|
380
380
|
'主窗口(本会话):今日 ',
|
|
381
381
|
React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(mwToday)),
|
|
382
382
|
' · 累计 ',
|
|
383
383
|
React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(mw.total)))
|
|
384
384
|
}
|
|
385
|
-
if (!u || !u.total) return React.createElement('div', { style: box }, head, React.createElement('div', { style: { fontSize:
|
|
385
|
+
if (!u || !u.total) return React.createElement('div', { style: box }, head, React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无数据(Worker/Verifier 会话日志里还没有 usage 记录)'), mwLine())
|
|
386
386
|
// ===== 主数字口径翻转(task-muxnqunk,用户 2026-10-07 裁决「算总的吧」,推翻 task-muwq9u04 的
|
|
387
387
|
// 有效主显):模型分布行与 Top8 行的主数字一律显示**总量**(byModel / topTasks[].total,含缓存读),
|
|
388
388
|
// 有效消耗(byModelEff / topTasks[].effective)退到 title 悬浮;老 host 缺 byModelEff / 老卡无
|
|
@@ -421,16 +421,16 @@
|
|
|
421
421
|
// maxDay 按总量归一(主显口径)——task-muwsnyqv ③ 的「只按有效归一 + 旧口径灰柱」规则随
|
|
422
422
|
// 口径翻转退役:总量就是主口径,不再存在「缓存读撑歪有效柱」的问题。
|
|
423
423
|
for (var di = 0; di < days.length; di++) { var dc = dayOf(byDay[days[di]]); if (dc.t > maxDay) maxDay = dc.t; if (dc.t > 0 || dc.e > 0) hasDayData = true }
|
|
424
|
-
function mini(label, value) { return React.createElement('span', { style: { fontSize:
|
|
424
|
+
function mini(label, value) { return React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 } }, label + ' ', React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(value))) }
|
|
425
425
|
// 累计三分量:有效(真实成本)+ 缓存读(占了 total 的大头,必须单列才看得出虚高来源)+ 合计
|
|
426
426
|
var effTotal = (typeof u.effective === 'number') ? u.effective : ((u.input || 0) + (u.output || 0) + (u.cacheWrite || 0))
|
|
427
427
|
return React.createElement('div', { style: box },
|
|
428
428
|
head,
|
|
429
429
|
React.createElement('div', { style: { display: 'flex', alignItems: 'baseline', gap: 10, flexWrap: 'wrap', marginBottom: 8 } },
|
|
430
430
|
React.createElement('span', { style: { fontSize: 20, fontWeight: 700, color: C.brand }, title: '今日总量(本地日 ' + todayKey + ')= 输入+输出+缓存写+缓存读(含缓存读);一次 run 的消耗整笔记在结算日;有效消耗(不含缓存读)' + (todayCell.e === null ? '不可知:该日账为旧口径数据,只有总量' : '= ' + String(todayCell.e) + ' tok') }, fmtTokens(todayCell.t)),
|
|
431
|
-
React.createElement('span', { style: { fontSize:
|
|
432
|
-
(todayCell.e !== null && todayCell.t > todayCell.e) ? React.createElement('span', { style: { fontSize:
|
|
433
|
-
React.createElement('span', { style: { fontSize:
|
|
431
|
+
React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 } }, 'tokens(今日总量,含缓存读)'),
|
|
432
|
+
(todayCell.e !== null && todayCell.t > todayCell.e) ? React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 }, title: '今日有效消耗 = 输入+输出+缓存写(不含缓存读);与总量的差额就是缓存读' }, '其中有效 ', React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(todayCell.e))) : null,
|
|
433
|
+
React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 } }, '累计(本看板) 有效 ', React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(effTotal)), ' · 缓存读 ', React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(u.cacheRead)), ' · 合计 ', React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, fmtTokens(u.total))),
|
|
434
434
|
mini('输入', u.input), mini('输出', u.output), u.cacheWrite ? mini('缓存写', u.cacheWrite) : null),
|
|
435
435
|
// 主窗口(本会话对话)单列行:累计行下方,与看板派发口径并列不混入(mw=null 静默不渲染)
|
|
436
436
|
mwLine(),
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
// 柱高一律取**总量**(含缓存读,口径翻转 task-muxnqunk);e===null 的旧口径日就是正常柱
|
|
439
439
|
// (t 恒有值),有效值在 tooltip 里对照(不可知则注明)。7 天全为 0 时整块不渲染。
|
|
440
440
|
hasDayData ? React.createElement('div', { style: { marginBottom: 8 } },
|
|
441
|
-
React.createElement('div', { style: { fontSize:
|
|
441
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 4 } }, '近 7 天(总量,含缓存读)'),
|
|
442
442
|
React.createElement('div', { style: { display: 'flex', alignItems: 'flex-end', gap: 4 } },
|
|
443
443
|
days.map(function (k) {
|
|
444
444
|
var c = dayOf(byDay[k])
|
|
@@ -451,16 +451,16 @@
|
|
|
451
451
|
}))) : null,
|
|
452
452
|
React.createElement('div', { style: { display: 'flex', gap: 12, flexWrap: 'wrap' } },
|
|
453
453
|
React.createElement('div', { style: { flex: '1 1 240px', minWidth: 200 } },
|
|
454
|
-
React.createElement('div', { style: { fontSize:
|
|
455
|
-
models.length === 0 ? React.createElement('div', { style: { fontSize:
|
|
454
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 4 } }, '按模型分布(总量)'),
|
|
455
|
+
models.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无数据') : models.map(function (m) {
|
|
456
456
|
return React.createElement(UsageRow, { key: m.model, label: m.model, value: m.total, max: maxM, color: C.brand, title: m.model + ':总量 ' + String(m.total) + ' tokens(含缓存读)' + (m.eff === null ? ';有效不可知(本模型无分量留账)' : ' · 有效 ' + String(m.eff) + ' tokens(输入+输出+缓存写)') })
|
|
457
457
|
}),
|
|
458
458
|
// 模型分布尾部追加「主窗口(对话)」一条(task-muwsol23):总量为 0 不渲染;
|
|
459
459
|
// 琥珀色与 run 模型(brand)区分,固定尾部不参与排序,与派发口径并列不混入
|
|
460
460
|
(mw && mw.total > 0) ? React.createElement(UsageRow, { key: 'main-window', label: '主窗口(对话)', value: mw.total, max: maxM, color: C.warn, title: '主窗口(对话):总量 ' + String(mw.total) + ' tokens(含缓存读)· 有效 ' + String(mw.effective) + ' tokens(不含缓存读)——本会话对话消耗,与看板派发口径并列不混入(不进累计 / Top 8)' }) : null),
|
|
461
461
|
React.createElement('div', { style: { flex: '1 1 240px', minWidth: 200 } },
|
|
462
|
-
React.createElement('div', { style: { fontSize:
|
|
463
|
-
top.length === 0 ? React.createElement('div', { style: { fontSize:
|
|
462
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 4 } }, '任务消耗 Top 8(总量)'),
|
|
463
|
+
top.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无数据') : top.map(function (x) {
|
|
464
464
|
var t = getTask(x.id)
|
|
465
465
|
return React.createElement(UsageRow, { key: x.id, label: x.title || x.id, value: x.total, max: maxT, color: C.ok, labelColor: t ? C.brand : C.text2, title: x.title + '(总量 ' + String(x.total) + ' tokens(含缓存读) · 其中缓存读 ' + String(x.cacheRead || 0) + (x.eff === null ? ';有效不可知(老卡无五分量留账)' : ' · 有效 ' + String(x.eff) + ' tokens(输入+输出+缓存写)') + ' · ' + (x.runs || 0) + ' 次 run)' + (t ? '——点击查看详情' : ''), onClick: t ? function () { state.detailId = x.id; notify() } : undefined })
|
|
466
466
|
}))),
|
|
@@ -469,11 +469,11 @@
|
|
|
469
469
|
// 范围说明(task-muwc7hjd):用户常把 RangeFilter 当成「整页过滤」,但今日大数字与近 7 天柱子
|
|
470
470
|
// 是自身固定口径(今日=本地今天、近 7 天=最近 7 个本地日)——不随范围变,必须在文案里讲清,
|
|
471
471
|
// 否则「选了范围数字没变」看起来像 bug。模型分布/Top8/累计才是范围生效的三处。
|
|
472
|
-
React.createElement('div', { style: { fontSize:
|
|
473
|
-
React.createElement('div', { style: { fontSize:
|
|
472
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 6, lineHeight: 1.5 } }, '口径:累计与 Top 8 仅看板派发的 Worker/Verifier run(= 一次执行)消耗;主窗口行=本会话对话消耗,与看板派发口径并列不混入(单列一行 + 模型分布尾部一条,不进累计 / Top 8);主数字(今日 / 近 7 天 / 模型分布 / Top 8 / 主窗口行)均为总量口径(含缓存读);有效消耗(input+output+cacheWrite,不含缓存读)见悬浮 title'),
|
|
473
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 2, lineHeight: 1.5 } }, '统计范围作用于按模型分布 / 任务消耗 Top 8 / 累计三分量(按 run 的本地日落点过滤);今日与「近 7 天」为固定口径,不随范围变化。'),
|
|
474
474
|
// 「→ 模型表现」滚动锚链接(task-muxhtgi2 卡3):一键滚到下方模型×场景八指标表
|
|
475
475
|
// (与详情页 goArbitration 同一 scrollIntoView 原语;目标区空态也挂锚 id,链接始终可达)
|
|
476
|
-
React.createElement('div', { style: { fontSize:
|
|
476
|
+
React.createElement('div', { style: { fontSize: C.fsAux, marginTop: 4 } },
|
|
477
477
|
React.createElement('span', { onClick: function () { var el = document.getElementById('tskb-model-perf'); if (el && el.scrollIntoView) el.scrollIntoView({ block: 'start' }) }, style: { color: C.brand, cursor: 'pointer' }, title: '滚动到下方「模型表现」区:模型 × 场景(角色 × 规模段)八指标对比表' }, '→ 模型表现')))
|
|
478
478
|
}
|
|
479
479
|
|
|
@@ -521,12 +521,12 @@
|
|
|
521
521
|
var totalRuns = 0
|
|
522
522
|
for (var li = 0; li < lanes.length; li++) totalRuns += (bySize[lanes[li]] && bySize[lanes[li]].runs) || 0
|
|
523
523
|
if (!totalRuns) return null
|
|
524
|
-
var thL2 = { fontSize:
|
|
525
|
-
var thR2 = { fontSize:
|
|
526
|
-
var tdL2 = { fontSize:
|
|
527
|
-
var tdR2 = { fontSize:
|
|
524
|
+
var thL2 = { fontSize: C.fsAux, color: C.text2, fontWeight: 600, textAlign: 'left', padding: '2px 4px', borderBottom: '1px solid ' + C.border, whiteSpace: 'nowrap' }
|
|
525
|
+
var thR2 = { fontSize: C.fsAux, color: C.text2, fontWeight: 600, textAlign: 'right', padding: '2px 4px', borderBottom: '1px solid ' + C.border, whiteSpace: 'nowrap', cursor: 'help' }
|
|
526
|
+
var tdL2 = { fontSize: C.fsSub, color: C.text, textAlign: 'left', padding: '3px 4px', borderBottom: '1px solid ' + C.nested, whiteSpace: 'nowrap' }
|
|
527
|
+
var tdR2 = { fontSize: C.fsSub, color: C.text, textAlign: 'right', padding: '3px 4px', borderBottom: '1px solid ' + C.nested, whiteSpace: 'nowrap' }
|
|
528
528
|
return React.createElement('div', { style: { marginTop: 8 } },
|
|
529
|
-
React.createElement('div', { style: { fontSize:
|
|
529
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 4 } }, '按档位'),
|
|
530
530
|
React.createElement('table', { style: { width: '100%', borderCollapse: 'collapse' } },
|
|
531
531
|
React.createElement('thead', null, React.createElement('tr', null,
|
|
532
532
|
React.createElement('th', { style: thL2 }, '档位'),
|
|
@@ -544,7 +544,7 @@
|
|
|
544
544
|
React.createElement('td', { style: tdR2 }, String(b.failed + b.timeouts)),
|
|
545
545
|
React.createElement('td', { style: tdR2 }, fmtTokens(b.effSum)))
|
|
546
546
|
}))),
|
|
547
|
-
React.createElement('div', { style: { fontSize:
|
|
547
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 4, lineHeight: 1.5 } }, '口径:行 = 力度档位(run.size 派发留档,老 run 无 size 归标档);只计 Worker/Verifier run(hook 恒父模型不计入);驳回 = 归因到该档 worker run 的验收驳回;异常 = 超时 + 跑崩;token = 有效口径(悬浮行看总量);随统计范围裁剪'))
|
|
548
548
|
}
|
|
549
549
|
function ModelPerf(props) {
|
|
550
550
|
var _R = React; var useState = _R.useState
|
|
@@ -552,38 +552,38 @@
|
|
|
552
552
|
var _b = useState(state.mpSize || ''), sizeF = _b[0], setSizeF = _b[1]
|
|
553
553
|
function pickRole(v) { state.mpRole = v; setRoleF(v) }
|
|
554
554
|
function pickSize(v) { state.mpSize = v; setSizeF(v) }
|
|
555
|
-
var box = { padding: '
|
|
555
|
+
var box = { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 }
|
|
556
556
|
// 范围激活标记与 Token 区同源:scoreboard 由 host 按同一 range 裁剪,范围内数据必须亮明身份
|
|
557
557
|
var tg = activeRange()
|
|
558
558
|
var tgOn = !!(tg.from || tg.to)
|
|
559
|
-
var head = React.createElement('div', { style: { fontSize:
|
|
560
|
-
tgOn ? React.createElement('span', { style: { fontSize:
|
|
559
|
+
var head = React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('bot', 11), '模型表现',
|
|
560
|
+
tgOn ? React.createElement('span', { style: { fontSize: C.fsAux, fontWeight: 400, color: C.brand, border: '1px solid ' + C.brand, borderRadius: 8, padding: '0 6px' }, title: '本区桶数据已按统计范围过滤(与 Token 区同一 range 口径):' + rangeLabel() }, '范围内: ' + rangeLabel()) : null)
|
|
561
561
|
var sb = props.sb
|
|
562
562
|
var buckets = (sb && Array.isArray(sb.buckets)) ? sb.buckets : []
|
|
563
563
|
// 空态:无 scoreboard(老 host)/ 无入桶 run → 一句话空态(锚 id 照挂,Token 区链接始终可达);
|
|
564
564
|
// 按档位小表仍渲染(它不要求学模型名——无模型老 run 也烧了档位 token,档位视图可能恰好还有数据)
|
|
565
|
-
if (!buckets.length) return React.createElement('div', { id: 'tskb-model-perf', style: box }, head, React.createElement('div', { style: { fontSize:
|
|
565
|
+
if (!buckets.length) return React.createElement('div', { id: 'tskb-model-perf', style: box }, head, React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无足够 run 数据(还没有可入桶的已落定 Worker/Verifier run 留账)'), React.createElement(LaneTable, { bySize: sb && sb.bySize }))
|
|
566
566
|
// 本地筛选:角色 × 规模段,纯数组 pass 不重拉
|
|
567
567
|
var shown = buckets.filter(function (b) { return (!roleF || b.role === roleF) && (!sizeF || b.size === sizeF) })
|
|
568
568
|
function chip(cur, setter, v, label) {
|
|
569
569
|
var on = cur === v
|
|
570
|
-
return React.createElement('button', { onClick: function () { setter(v) }, style: { fontSize:
|
|
570
|
+
return React.createElement('button', { onClick: function () { setter(v) }, style: { fontSize: C.fsSub, padding: '1px 8px', border: '1px solid ' + (on ? C.brand : C.border2), borderRadius: 10, background: on ? C.nested : C.card, color: on ? C.brand : C.text2, cursor: 'pointer' } }, label)
|
|
571
571
|
}
|
|
572
|
-
var thL = { fontSize:
|
|
573
|
-
var thR = { fontSize:
|
|
574
|
-
var tdL = { fontSize:
|
|
575
|
-
var tdR = { fontSize:
|
|
572
|
+
var thL = { fontSize: C.fsAux, color: C.text2, fontWeight: 600, textAlign: 'left', padding: '2px 4px', borderBottom: '1px solid ' + C.border, whiteSpace: 'nowrap' }
|
|
573
|
+
var thR = { fontSize: C.fsAux, color: C.text2, fontWeight: 600, textAlign: 'right', padding: '2px 4px', borderBottom: '1px solid ' + C.border, whiteSpace: 'nowrap', cursor: 'help' }
|
|
574
|
+
var tdL = { fontSize: C.fsSub, color: C.text, textAlign: 'left', padding: '3px 4px', borderBottom: '1px solid ' + C.nested, whiteSpace: 'nowrap' }
|
|
575
|
+
var tdR = { fontSize: C.fsSub, color: C.text, textAlign: 'right', padding: '3px 4px', borderBottom: '1px solid ' + C.nested, whiteSpace: 'nowrap' }
|
|
576
576
|
var insufN = shown.filter(function (b) { return b.insufficient }).length
|
|
577
577
|
return React.createElement('div', { id: 'tskb-model-perf', style: box },
|
|
578
578
|
head,
|
|
579
579
|
// 场景筛选器(本地):角色 + 规模段两组 chip;右侧计数「显示/总数 · 样本不足 N」
|
|
580
580
|
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 4, flexWrap: 'wrap', marginBottom: 6 } },
|
|
581
|
-
React.createElement('span', { style: { fontSize:
|
|
581
|
+
React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2 } }, '角色'),
|
|
582
582
|
chip(roleF, pickRole, '', '全部'), chip(roleF, pickRole, 'worker', 'worker'), chip(roleF, pickRole, 'verifier', 'verifier'),
|
|
583
|
-
React.createElement('span', { style: { fontSize:
|
|
583
|
+
React.createElement('span', { style: { fontSize: C.fsSub, color: C.text2, marginLeft: 6 } }, '规模段'),
|
|
584
584
|
chip(sizeF, pickSize, '', '全部'), chip(sizeF, pickSize, 'small', '小'), chip(sizeF, pickSize, 'medium', '中'), chip(sizeF, pickSize, 'large', '大'),
|
|
585
|
-
React.createElement('span', { style: { fontSize:
|
|
586
|
-
shown.length === 0 ? React.createElement('div', { style: { fontSize:
|
|
585
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2, marginLeft: 'auto' } }, shown.length + '/' + buckets.length + ' 桶' + (insufN ? ' · ' + insufN + ' 桶样本不足' : ''))),
|
|
586
|
+
shown.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2, padding: '4px 0' } }, '当前筛选无匹配桶(试试放宽角色/规模段)')
|
|
587
587
|
: React.createElement('div', { style: { overflowX: 'auto' } },
|
|
588
588
|
React.createElement('table', { style: { width: '100%', borderCollapse: 'collapse' } },
|
|
589
589
|
React.createElement('thead', null, React.createElement('tr', null,
|
|
@@ -600,7 +600,7 @@
|
|
|
600
600
|
React.createElement('td', { style: tdR }, String(b.runs)),
|
|
601
601
|
MP_COLS.map(function (c) { return React.createElement('td', { key: c.k, style: tdR }, c.fmt(b)) }))
|
|
602
602
|
})))),
|
|
603
|
-
React.createElement('div', { style: { fontSize:
|
|
603
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 6, lineHeight: 1.5 } }, '口径:每行 = 模型 × 角色 × 规模段桶(规模按任务有效 token:小 <1M / 中 1~10M / 大 >10M);率类分母为桶内 runs,一次通过率分母为桶内 resolved 任务;失败率 = 跑崩落定(outcome 为 incomplete/error/failed)的 run / 桶内 runs,terminated 人工终止不计入;runs<5 行灰显 = 样本不足仅供参考;随统计范围裁剪(与 Token 区同一 range)'),
|
|
604
604
|
// 按档位小表(task-mvneq4mw):三档 × runs/驳回/异常/token,挂在八指标表下方
|
|
605
605
|
React.createElement(LaneTable, { bySize: sb && sb.bySize }))
|
|
606
606
|
}
|
|
@@ -642,12 +642,12 @@
|
|
|
642
642
|
function QualityTrends(props) {
|
|
643
643
|
var sb = props.sb
|
|
644
644
|
var tr = (sb && sb.trends && typeof sb.trends === 'object') ? sb.trends : null
|
|
645
|
-
var box = { padding: '
|
|
645
|
+
var box = { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 }
|
|
646
646
|
// 范围激活标记与 Token / 模型表现区同源:trends 由 host 按同一 range 裁剪,范围内数据必须亮明身份
|
|
647
647
|
var tg = activeRange()
|
|
648
648
|
var tgOn = !!(tg.from || tg.to)
|
|
649
|
-
var head = React.createElement('div', { style: { fontSize:
|
|
650
|
-
tgOn ? React.createElement('span', { style: { fontSize:
|
|
649
|
+
var head = React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('check-circle', 11), '质量趋势',
|
|
650
|
+
tgOn ? React.createElement('span', { style: { fontSize: C.fsAux, fontWeight: 400, color: C.brand, border: '1px solid ' + C.brand, borderRadius: 8, padding: '0 6px' }, title: '本区趋势数据已按统计范围过滤(与 Token 区同一 range 口径):' + rangeLabel() }, '范围内: ' + rangeLabel()) : null)
|
|
651
651
|
var fpByDay = (tr && tr.firstPassByDay && typeof tr.firstPassByDay === 'object') ? tr.firstPassByDay : {}
|
|
652
652
|
var durB = (tr && tr.durationBuckets && typeof tr.durationBuckets === 'object') ? tr.durationBuckets : null
|
|
653
653
|
var toByDay = (tr && tr.timeoutByDay && typeof tr.timeoutByDay === 'object') ? tr.timeoutByDay : {}
|
|
@@ -660,14 +660,14 @@
|
|
|
660
660
|
var rsmRuns = (rsm && rsm.runs) || 0
|
|
661
661
|
if (!tr || (fpSum + toSum + durSum + rsmRuns) === 0) {
|
|
662
662
|
return React.createElement('div', { id: 'tskb-quality-trends', style: box }, head,
|
|
663
|
-
React.createElement('div', { style: { fontSize:
|
|
663
|
+
React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无足够 run 数据(还没有可统计的已落定 Worker/Verifier run / resolved 任务)'))
|
|
664
664
|
}
|
|
665
665
|
var days14 = lastNDays(14)
|
|
666
666
|
var todayKey = localDayKey()
|
|
667
667
|
// 块头:左块名 + 右侧今日/汇总值(fontWeight 400 小字)
|
|
668
668
|
function blockHead(label, rightEl, tip) {
|
|
669
|
-
return React.createElement('div', { title: tip, style: { fontSize:
|
|
670
|
-
rightEl ? React.createElement('span', { style: { marginLeft: 'auto', fontWeight: 400, fontSize:
|
|
669
|
+
return React.createElement('div', { title: tip, style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 4, display: 'flex', alignItems: 'baseline', gap: 6 } }, label,
|
|
670
|
+
rightEl ? React.createElement('span', { style: { marginLeft: 'auto', fontWeight: 400, fontSize: C.fsAux } }, rightEl) : null)
|
|
671
671
|
}
|
|
672
672
|
// ===== ① 一次通过率趋势(近 14 天):当日率 = 落定 resolved 任务中零驳回(rejectCount=0)占比 =====
|
|
673
673
|
var fpCells = days14.map(function (k) {
|
|
@@ -681,21 +681,21 @@
|
|
|
681
681
|
var block1 = React.createElement('div', { style: { flex: '1 1 260px', minWidth: 230, overflow: 'hidden' } },
|
|
682
682
|
blockHead('一次通过率(近 14 天)', React.createElement('span', null, '今日 ', React.createElement('span', { style: { color: fpToday.rate !== null ? C.brand : C.text2, fontWeight: 600 } }, fpToday.rate !== null ? mpPct(fpToday.rate) : '—')), '一次通过率 = 当天落定「已完成」任务里零驳回(rejectCount=0)的占比;驳回 = Verifier 验收判 reject'),
|
|
683
683
|
fpHas ? qtDayBars(fpCells, C.ok, todayKey)
|
|
684
|
-
: React.createElement('div', { style: { fontSize:
|
|
684
|
+
: React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '近 14 天窗口内暂无 resolved 任务落定'))
|
|
685
685
|
// ===== ② 卡时长分布(四桶横条):创建 → 落定(verifiedAt||resolvedAt)墙钟,含排队/执行/验收全程 =====
|
|
686
686
|
var durMax = 1
|
|
687
687
|
if (durB) QT_DUR_BUCKETS.forEach(function (b) { var v = Number(durB[b.k]) || 0; if (v > durMax) durMax = v })
|
|
688
688
|
var block2 = React.createElement('div', { style: { flex: '1 1 180px', minWidth: 170 } },
|
|
689
689
|
blockHead('卡时长分布', durSum > 0 ? React.createElement('span', null, React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, String(durSum)), ' 张落定卡') : null, '卡时长 = 创建 → 落定的墙钟(含排队/执行/验收全程)'),
|
|
690
|
-
durSum === 0 ? React.createElement('div', { style: { fontSize:
|
|
690
|
+
durSum === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无时长样本')
|
|
691
691
|
: React.createElement('div', null, QT_DUR_BUCKETS.map(function (b) {
|
|
692
692
|
var v = Number(durB[b.k]) || 0
|
|
693
693
|
var pct = v > 0 ? Math.max(2, Math.round(v / durMax * 100)) : 0
|
|
694
694
|
return React.createElement('div', { key: b.k, style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 }, title: b.tip + ':' + v + ' 张(创建→落定墙钟,含排队 / 执行 / 验收全程)' },
|
|
695
|
-
React.createElement('span', { style: { width: 44, fontSize:
|
|
695
|
+
React.createElement('span', { style: { width: 44, fontSize: C.fsSub, color: C.text2, textAlign: 'right', flexShrink: 0 } }, b.label),
|
|
696
696
|
React.createElement('div', { style: { flex: 1, height: 8, background: C.nested, borderRadius: 4, overflow: 'hidden' } },
|
|
697
697
|
React.createElement('div', { style: { height: '100%', width: pct + '%', background: C.brand, borderRadius: 4, transition: 'width .3s' } })),
|
|
698
|
-
React.createElement('span', { style: { width: 24, fontSize:
|
|
698
|
+
React.createElement('span', { style: { width: 24, fontSize: C.fsSub, color: C.text2, flexShrink: 0 } }, String(v)))
|
|
699
699
|
})))
|
|
700
700
|
// ===== ③ 超时率走势(近 14 天迷你柱行):当日率 = 超时落定(timeout/error)run / 当日 runs =====
|
|
701
701
|
var toCells = days14.map(function (k) {
|
|
@@ -709,12 +709,12 @@
|
|
|
709
709
|
var block3 = React.createElement('div', { style: { flex: '1 1 260px', minWidth: 230, overflow: 'hidden' } },
|
|
710
710
|
blockHead('超时率走势(近 14 天)', React.createElement('span', null, '今日 ', React.createElement('span', { style: { color: toToday.rate !== null ? C.warn : C.text2, fontWeight: 600 } }, toToday.rate !== null ? mpPct(toToday.rate) : '—')), '超时率 = 超时落定(timeout/error)的 run 占当天 run 的比例'),
|
|
711
711
|
toHas ? qtDayBars(toCells, C.warn, todayKey)
|
|
712
|
-
: React.createElement('div', { style: { fontSize:
|
|
712
|
+
: React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '近 14 天窗口内暂无 run 落定'))
|
|
713
713
|
// ===== ④ 续跑成功率(范围总量口径,卡2出参无 byDay):resume:true 续跑记录中 completed 占比 =====
|
|
714
714
|
var rsmRate = (rsm && typeof rsm.rate === 'number' && isFinite(rsm.rate)) ? rsm.rate : null
|
|
715
715
|
var block4 = React.createElement('div', { style: { flex: '1 1 180px', minWidth: 170 } },
|
|
716
716
|
blockHead('续跑成功率', rsmRuns > 0 ? React.createElement('span', null, React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, String((rsm && rsm.completed) || 0) + '/' + rsmRuns), ' 续跑成功') : null, '续跑成功率 = resume 续跑记录中 outcome=completed 的占比;续跑 = 前次超时/失败后继续跑'),
|
|
717
|
-
rsmRuns === 0 ? React.createElement('div', { style: { fontSize:
|
|
717
|
+
rsmRuns === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无续跑记录')
|
|
718
718
|
: React.createElement('div', { title: '续跑成功率 = resume:true 续跑记录中 outcome=completed 的占比(范围总量口径,host 出参无逐日);续跑 = 前次 run 超时/失败后续跑' },
|
|
719
719
|
React.createElement('div', { style: { fontSize: 16, fontWeight: 700, color: rsmRate !== null ? C.ok : C.text2 } }, rsmRate !== null ? mpPct(rsmRate) : '—'),
|
|
720
720
|
React.createElement('div', { style: { height: 6, background: C.nested, borderRadius: 3, overflow: 'hidden', marginTop: 4 } },
|
|
@@ -724,7 +724,7 @@
|
|
|
724
724
|
React.createElement('div', { style: { display: 'flex', gap: 16, flexWrap: 'wrap', marginBottom: 8 } }, block1, block2),
|
|
725
725
|
React.createElement('div', { style: { display: 'flex', gap: 16, flexWrap: 'wrap' } }, block3, block4),
|
|
726
726
|
// 口径 caption:一句讲清统计本体(看板派发 run / 任务落定)+ 驳回定义 + 固定窗口与范围的关系
|
|
727
|
-
React.createElement('div', { style: { fontSize:
|
|
727
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 8, lineHeight: 1.5 } }, '口径:仅看板派发的 Worker/Verifier run 与任务落定记录(按本地日落点,随统计范围裁剪);一次通过率 = 当日落定 resolved 任务中零驳回占比(驳回 = 验收 verdict rejected,归因驳回前最近 worker run);超时 = run 落定 timeout/error;续跑成功率 = resume 续跑记录中 completed 占比(范围总量口径,无逐日);卡时长 = 创建 → 落定墙钟(含排队 / 验收)。通过率与超时率为近 14 天固定窗口——范围落在窗口外时对应日柱为空'))
|
|
728
728
|
}
|
|
729
729
|
|
|
730
730
|
// ===== 驳回聚类区(记分卡卡5,task-muxhu1zv):驳回原因 Top3 +「建议沉淀为约定」文本(一键复制)=====
|
|
@@ -740,15 +740,15 @@
|
|
|
740
740
|
var sb = props.sb
|
|
741
741
|
var rc = sb && sb.rejectionClusters
|
|
742
742
|
if (!rc || typeof rc !== 'object') return null // 老 host 缺字段:整块不渲染(零残留)
|
|
743
|
-
var box = { padding: '
|
|
743
|
+
var box = { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 }
|
|
744
744
|
var tg = activeRange()
|
|
745
745
|
var tgOn = !!(tg.from || tg.to)
|
|
746
|
-
var head = React.createElement('div', { style: { fontSize:
|
|
747
|
-
tgOn ? React.createElement('span', { style: { fontSize:
|
|
746
|
+
var head = React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('flask-conical', 11), '驳回聚类',
|
|
747
|
+
tgOn ? React.createElement('span', { style: { fontSize: C.fsAux, fontWeight: 400, color: C.brand, border: '1px solid ' + C.brand, borderRadius: 8, padding: '0 6px' }, title: '本区已按统计范围过滤(按驳回消息本地日落点,与 Token 区同一 range):' + rangeLabel() }, '范围内: ' + rangeLabel()) : null)
|
|
748
748
|
var top = Array.isArray(rc.top) ? rc.top : []
|
|
749
749
|
if (!rc.total || !top.length) {
|
|
750
750
|
return React.createElement('div', { id: 'tskb-rejection-clusters', style: box }, head,
|
|
751
|
-
React.createElement('div', { style: { fontSize:
|
|
751
|
+
React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无驳回记录(验收驳回后会按关键词模板聚类出 Top3 类目与约定建议)'))
|
|
752
752
|
}
|
|
753
753
|
// 复制建议文本:clipboard API 不可用/被拒时静默降级(按钮不变样,下轮再试)
|
|
754
754
|
function copySugg(c) {
|
|
@@ -765,14 +765,14 @@
|
|
|
765
765
|
top.map(function (c, i) {
|
|
766
766
|
var tip = (c.samples && c.samples.length) ? '代表原文:\n' + c.samples.map(function (s) { return '· ' + s }).join('\n') : '(无代表原文)'
|
|
767
767
|
return React.createElement('div', { key: c.id, title: tip, style: { marginBottom: 6, paddingBottom: 6, borderBottom: i < top.length - 1 ? '1px solid ' + C.nested : 'none' } },
|
|
768
|
-
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize:
|
|
768
|
+
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, fontSize: C.fsSub } },
|
|
769
769
|
React.createElement('span', { style: { color: C.warn, fontWeight: 700 } }, 'Top' + (i + 1)),
|
|
770
770
|
React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, c.label),
|
|
771
|
-
React.createElement('span', { style: { color: C.text2, fontSize:
|
|
772
|
-
React.createElement('button', { onClick: function () { copySugg(c) }, title: '复制「建议沉淀为约定」文本(粘贴到派发约定/Worker prompt,沉淀动作人工)', style: { marginLeft: 'auto', fontSize:
|
|
773
|
-
React.createElement('div', { style: { fontSize:
|
|
771
|
+
React.createElement('span', { style: { color: C.text2, fontSize: C.fsSub } }, c.pct + '%(' + c.count + '/' + rc.total + ')'),
|
|
772
|
+
React.createElement('button', { onClick: function () { copySugg(c) }, title: '复制「建议沉淀为约定」文本(粘贴到派发约定/Worker prompt,沉淀动作人工)', style: { marginLeft: 'auto', fontSize: C.fsAux, padding: '1px 8px', border: '1px solid ' + C.border2, borderRadius: 9, background: C.card, color: copiedId === c.id ? C.ok : C.text2, cursor: 'pointer' } }, copiedId === c.id ? '✅ 已复制' : '📋 复制约定建议')),
|
|
773
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, lineHeight: 1.5, marginTop: 2 } }, String(c.suggestion || '')))
|
|
774
774
|
}),
|
|
775
|
-
React.createElement('div', { style: { fontSize:
|
|
775
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 4, lineHeight: 1.5 } }, '口径:规则法关键词模板聚类(首命中归类,不上 embedding);占比分母 = ' + (tgOn ? '范围内' : '') + '驳回总数(' + rc.total + ' 条)' + (rc.restCount ? ';另有 ' + rc.restCount + ' 类未进 Top3' : '') + ';建议文本一键复制后人工沉淀为约定'))
|
|
776
776
|
}
|
|
777
777
|
|
|
778
778
|
// ===== 架构健康提示区(架构自省 L1 · 数据源:state.healthHints)=====
|
|
@@ -785,15 +785,15 @@
|
|
|
785
785
|
if (!hints.length) return null
|
|
786
786
|
// 三级配色:err=🚨 红(C.err,数据安全红线);warn=⚠️ 琥珀(C.warn);info=ℹ️ 蓝灰(DSH 现有 business 信息色)
|
|
787
787
|
var infoColor = 'var(--dsw-alias-state-business-primary)'
|
|
788
|
-
return React.createElement('div', { style: { padding: '
|
|
789
|
-
React.createElement('div', { style: { fontSize:
|
|
788
|
+
return React.createElement('div', { style: { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 } },
|
|
789
|
+
React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('activity', 11), '架构健康'),
|
|
790
790
|
// 术语白话(巡检 n-muyg5m7o5r00):settle/touches/p90 等黑话第一屏无解,补一行术语说明
|
|
791
|
-
React.createElement('div', { style: { fontSize:
|
|
791
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginBottom: 5, lineHeight: 1.5 } }, '运行时自检告警,多为自动恢复的瞬时异常。术语:settle = 任务结算通道;touches = 任务声明的改动文件(文件锁);p90 = 执行时长第 90 百分位'),
|
|
792
792
|
hints.map(function (h, i) {
|
|
793
793
|
var warn = h.level === 'warn'
|
|
794
794
|
var err = h.level === 'err'
|
|
795
795
|
var col = err ? C.err : (warn ? C.warn : infoColor)
|
|
796
|
-
return React.createElement('div', { key: i, style: { display: 'flex', alignItems: 'baseline', gap: 5, fontSize:
|
|
796
|
+
return React.createElement('div', { key: i, style: { display: 'flex', alignItems: 'baseline', gap: 5, fontSize: C.fsSub, lineHeight: 1.5, color: col, marginBottom: 3 } },
|
|
797
797
|
React.createElement('span', { style: { flexShrink: 0 } }, err ? '🚨' : (warn ? '⚠️' : 'ℹ️')),
|
|
798
798
|
React.createElement('span', null, String(h.text)))
|
|
799
799
|
}))
|
|
@@ -831,38 +831,38 @@
|
|
|
831
831
|
if (r && r.ok) { if (typeof fetchTasks === 'function') fetchTasks() } else { setMsg((r && r.error) || '清理失败') }
|
|
832
832
|
}).catch(function (e) { setMsg('清理失败: ' + (e && e.message || e)); setBusy(false) })
|
|
833
833
|
}
|
|
834
|
-
var box = { padding: '
|
|
835
|
-
var head = React.createElement('div', { style: { fontSize:
|
|
836
|
-
var btn = { fontSize:
|
|
837
|
-
var dangerBtn = { fontSize:
|
|
834
|
+
var box = { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 }
|
|
835
|
+
var head = React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('trash-2', 11), '存储清理')
|
|
836
|
+
var btn = { fontSize: C.fsSub, padding: '2px 10px', border: '1px solid ' + C.border, borderRadius: 5, background: C.card, color: C.text, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 4 }
|
|
837
|
+
var dangerBtn = { fontSize: C.fsSub, padding: '2px 10px', border: '1px solid ' + C.err, borderRadius: 5, background: C.card, color: C.err, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 4 }
|
|
838
838
|
function skippedLine(s, i) {
|
|
839
|
-
return React.createElement('div', { key: 'sk' + i, style: { fontSize:
|
|
839
|
+
return React.createElement('div', { key: 'sk' + i, style: { fontSize: C.fsAux, color: C.text2, marginBottom: 2 } },
|
|
840
840
|
React.createElement('span', { style: { color: C.warn } }, '⏭ '), String(s.id || '').slice(0, 14) + '…:' + (s.text || s.reason || ''))
|
|
841
841
|
}
|
|
842
842
|
return React.createElement('div', { style: box },
|
|
843
843
|
head,
|
|
844
844
|
React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap' } },
|
|
845
845
|
React.createElement('button', { onClick: preview, disabled: busy, style: btn, title: '扫描本看板归档超过保留天数的卡片的会话,估算可释放空间(只读不删)' }, ic('refresh-cw', 11), busy ? '扫描中…' : '预览可清理会话'),
|
|
846
|
-
prev ? React.createElement('span', { style: { fontSize:
|
|
846
|
+
prev ? React.createElement('span', { style: { fontSize: C.fsSub, color: C.text } }, prev.total > 0 ? ('可删 ' + prev.total + ' 个会话 · 约 ' + fmtBytes(prev.totalBytes)) : '无可删会话') : null,
|
|
847
847
|
prev && prev.total > 0 ? React.createElement('button', { onClick: function () { setOpen(!open); setConfirmOn(false) }, style: btn }, ic(open ? 'chevron-up' : 'chevron-down', 10), open ? '收起明细' : '展开明细') : null,
|
|
848
848
|
prev && prev.total > 0 ? (confirmOn ? React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 4 } },
|
|
849
849
|
React.createElement('button', { onClick: runClean, disabled: busy, style: dangerBtn, title: '确认删除不可恢复;token 账已入卡不受影响' }, ic('check', 11), '确认清理(不可恢复)'),
|
|
850
850
|
React.createElement('button', { onClick: function () { setConfirmOn(false) }, style: btn }, '取消'))
|
|
851
851
|
: React.createElement('button', { onClick: function () { setConfirmOn(true) }, disabled: busy, style: btn, title: '删除不可恢复;token 账已入卡不受影响' }, ic('trash-2', 11), '清理')) : null),
|
|
852
|
-
msg ? React.createElement('div', { style: { fontSize:
|
|
853
|
-
report && report.ok ? React.createElement('div', { style: { fontSize:
|
|
852
|
+
msg ? React.createElement('div', { style: { fontSize: C.fsAux, color: C.err, marginTop: 4 } }, msg) : null,
|
|
853
|
+
report && report.ok ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text, marginTop: 5 } },
|
|
854
854
|
'✅ 已释放约 ' + fmtBytes(report.freedBytes) + '(删除 ' + report.deleted + ' 个会话' + ((report.skipped && report.skipped.length) ? ' · 跳过 ' + report.skipped.length + ' 个' : '') + ')') : null,
|
|
855
855
|
report && report.ok && report.skipped && report.skipped.length ? React.createElement('div', { style: { marginTop: 4 } }, report.skipped.map(skippedLine)) : null,
|
|
856
856
|
open && prev && prev.total > 0 ? React.createElement('div', { style: { marginTop: 6, borderTop: '1px solid ' + C.nested, paddingTop: 5 } },
|
|
857
|
-
React.createElement('div', { style: { fontSize:
|
|
857
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginBottom: 4 } }, '可删会话(会话目录 + projcache 缓存一并删除)'),
|
|
858
858
|
(prev.byTask || []).map(function (b) {
|
|
859
|
-
return React.createElement('div', { key: b.taskId, style: { marginBottom: 3, fontSize:
|
|
859
|
+
return React.createElement('div', { key: b.taskId, style: { marginBottom: 3, fontSize: C.fsAux, color: C.text2 } },
|
|
860
860
|
React.createElement('span', { style: { color: C.brand } }, shortId(b.title)), ':' + b.count + ' 个 · 约 ' + fmtBytes(b.bytes))
|
|
861
861
|
}),
|
|
862
|
-
React.createElement('div', { style: { fontSize:
|
|
862
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 2 } }, '数据来源:本看板 runs[] 里所属卡已归档超过 ' + (state.cleanupRetentionDays || 7) + ' 天、且 outcome 已落定并已不活跃的 Worker/Verifier 会话;token 账早已记入卡片,删除不影响任何统计。')
|
|
863
863
|
) : null,
|
|
864
864
|
prev && prev.total === 0 && prev.skipped && prev.skipped.length ? React.createElement('div', { style: { marginTop: 5 } },
|
|
865
|
-
React.createElement('div', { style: { fontSize:
|
|
865
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginBottom: 3 } }, '无符合条件可删的会话(跳过项)'),
|
|
866
866
|
prev.skipped.slice(0, 8).map(skippedLine)) : null)
|
|
867
867
|
}
|
|
868
868
|
|
|
@@ -871,7 +871,7 @@
|
|
|
871
871
|
return React.createElement('div', null,
|
|
872
872
|
React.createElement(RangeFilter),
|
|
873
873
|
React.createElement(GlobalBoards),
|
|
874
|
-
React.createElement('div', { style: { display: 'flex', gap:
|
|
874
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, marginBottom: 14, flexWrap: 'wrap' } }, React.createElement(StatCard, { label: '总任务', value: stats.total, color: C.text }), React.createElement(StatCard, { label: '待办', value: stats.byStatus['pending'] || 0, color: C.text2 }), React.createElement(StatCard, { label: '进行中', value: stats.byStatus['in-progress'] || 0, color: C.brand }), React.createElement(StatCard, { label: '验证中', value: stats.byStatus['verifying'] || 0, color: C.warn }), React.createElement(StatCard, { label: '已完成', value: stats.byStatus['resolved'] || 0, color: C.ok }), React.createElement(StatCard, { label: '已归档', value: stats.byStatus['archived'] || 0, color: C.text2 })),
|
|
875
875
|
React.createElement(HealthHints),
|
|
876
876
|
React.createElement(StorageCleanup),
|
|
877
877
|
React.createElement(TokenUsage, { usage: state.usageSummary }),
|
|
@@ -881,14 +881,14 @@
|
|
|
881
881
|
React.createElement(QualityTrends, { sb: (state.usageSummary && state.usageSummary.scoreboard) || null }),
|
|
882
882
|
// 驳回聚类区(卡5):质量趋势区正下方;scoreboard.rejectionClusters(老 host 缺字段 → 组件返回 null 整块不渲染)
|
|
883
883
|
React.createElement(RejectionClusters, { sb: (state.usageSummary && state.usageSummary.scoreboard) || null }),
|
|
884
|
-
React.createElement('div', { style: { display: 'flex', gap:
|
|
885
|
-
React.createElement('div', { style: { flex: '1 1 0', minWidth: 200, padding: '
|
|
886
|
-
React.createElement('div', { style: { flex: '1 1 0', minWidth: 200, padding: '
|
|
887
|
-
React.createElement('div', { style: { display: 'flex', gap:
|
|
884
|
+
React.createElement('div', { style: { display: 'flex', gap: 14, marginBottom: 14, flexWrap: 'wrap' } },
|
|
885
|
+
React.createElement('div', { style: { flex: '1 1 0', minWidth: 200, padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8 } }, React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6 } }, '按状态分布'), statusOrder.map(function (s) { return React.createElement(BarRow, { key: s, label: statusLabels[s] || s, count: stats.byStatus[s] || 0, total: stats.total, color: statusColors[s] || C.brand }) })),
|
|
886
|
+
React.createElement('div', { style: { flex: '1 1 0', minWidth: 200, padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8 } }, React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6 } }, '按优先级分布'), prioOrder.map(function (p) { return React.createElement(BarRow, { key: p, label: prioLabel[p] || p, count: stats.byPriority[p] || 0, total: stats.total, color: prioColor[p] || C.brand }) }))),
|
|
887
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, marginBottom: 14, flexWrap: 'wrap' } }, React.createElement(StatCardDual, { label1: '平均排队', value1: stats.avgQueue, label2: '平均执行', value2: stats.avgExec, title: '耗时口径三分离:⏳ 排队 = 创建 → 被领取(等了多久);⏱ 执行 = 被领取 → 完成(干了多久);均不含验收时长' }), React.createElement(StatCard, { label: '平均验证时间', value: stats.avgVerify }), React.createElement(StatCard, { label: '今日完成', value: stats.todayDone, color: C.ok })),
|
|
888
888
|
React.createElement(ResearchRoiRow, { roi: stats.roi }),
|
|
889
889
|
React.createElement(TrendChart, { data: stats.dailyDone }),
|
|
890
|
-
Object.keys(stats.byAgent).length > 0 ? React.createElement('div', { style: { padding: '
|
|
891
|
-
React.createElement('div', { style: { padding: '
|
|
890
|
+
Object.keys(stats.byAgent).length > 0 ? React.createElement('div', { style: { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, marginBottom: 14 } }, React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6 } }, 'Agent 负载(进行中+验证中)'), Object.keys(stats.byAgent).map(function (aid) { return React.createElement('div', { key: aid, style: { display: 'flex', alignItems: 'center', gap: 6, marginBottom: 3, fontSize: C.fsSub } }, React.createElement(ActorLink, { id: aid }), React.createElement('span', { style: { color: C.text2 } }, stats.byAgent[aid] + ' 个任务')) })) : null,
|
|
891
|
+
React.createElement('div', { style: { padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8 } }, React.createElement('div', { style: { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 6 } }, '最近活跃'), stats.recentActivity.length === 0 ? React.createElement('div', { style: { fontSize: C.fsSub, color: C.text2 } }, '暂无记录') : stats.recentActivity.map(function (a, i) { return React.createElement('div', { key: i, style: { fontSize: C.fsSub, color: C.text2, marginBottom: 3, display: 'flex', gap: 4, alignItems: 'center' } }, React.createElement('span', { style: { color: statusColors[a.to] || C.brand, fontWeight: 600 } }, statusLabels[a.to] || a.to), React.createElement('span', { style: { color: C.text, maxWidth: 120, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, a.title), React.createElement(ActorLink, { id: a.actor }), React.createElement('span', null, ago(a.timestamp))) })))
|
|
892
892
|
}
|
|
893
893
|
|
|
894
894
|
// 工作模式选择器(v75):boardMode/teamMode 双开关收敛为一维三档,点击走 set-work-mode 单入口。
|
|
@@ -929,7 +929,7 @@
|
|
|
929
929
|
// 现口径:下限取 props.min,**maxWorkers 传 min:1**(1 是合法最小值;暂停派发请切「清单模式」),
|
|
930
930
|
// Verifier 并发显式传 min:0(0=不要 Verifier,语义合法);越界值失焦/回车即回弹服务端权威值(不写服务端),
|
|
931
931
|
// input title 给出下限与出路(「最少 1(暂停派发请切清单模式)」)。
|
|
932
|
-
function PoolCfg(props) { var _R = React; var useState = _R.useState, useEffect = _R.useEffect; var lo = props.min === undefined ? 1 : props.min; var _a = useState(String(props.value)), val = _a[0], setVal = _a[1]; var _b = useState(false), dirty = _b[0], setDirty = _b[1]; useEffect(function () { setVal(String(props.value)); setDirty(false) }, [props.value]); function commit(v) { var n = parseInt(v, 10); if (isNaN(n) || n < lo || n > 10) { setVal(String(props.value)); setDirty(false); return } setVal(String(n)); setDirty(false); rpc('set-board-config', { key: props.cfgKey, value: n }).then(fetchTasks).catch(function () {}) } function step(d) { var n = parseInt(val, 10); if (isNaN(n)) n = lo; commit(String(Math.max(lo, Math.min(10, n + d)))) } var miniBtn = { fontSize:
|
|
932
|
+
function PoolCfg(props) { var _R = React; var useState = _R.useState, useEffect = _R.useEffect; var lo = props.min === undefined ? 1 : props.min; var _a = useState(String(props.value)), val = _a[0], setVal = _a[1]; var _b = useState(false), dirty = _b[0], setDirty = _b[1]; useEffect(function () { setVal(String(props.value)); setDirty(false) }, [props.value]); function commit(v) { var n = parseInt(v, 10); if (isNaN(n) || n < lo || n > 10) { setVal(String(props.value)); setDirty(false); return } setVal(String(n)); setDirty(false); rpc('set-board-config', { key: props.cfgKey, value: n }).then(fetchTasks).catch(function () {}) } function step(d) { var n = parseInt(val, 10); if (isNaN(n)) n = lo; commit(String(Math.max(lo, Math.min(10, n + d)))) } var miniBtn = { fontSize: C.fsAux, padding: '0px 4px', border: '1px solid ' + C.border2, borderRadius: 2, background: C.nested, color: C.text2, cursor: 'pointer', lineHeight: '14px' }; return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 1, fontSize: C.fsSub, color: C.text2 } }, props.label, React.createElement('button', { onClick: function () { step(-1) }, title: '减 1', style: miniBtn }, '−'), React.createElement('input', { value: val, title: props.tip || (lo + ' ~ 10'), onChange: function (e) { setVal(e.target.value); setDirty(e.target.value !== String(props.value)) }, onBlur: function () { if (dirty) commit(val) }, onKeyDown: function (e) { if (e.key === 'Enter') commit(val) }, style: { width: 22, padding: '0px 2px', fontSize: C.fsAux, textAlign: 'center', border: '1px solid ' + (dirty ? C.brand : C.border2), borderRadius: 2, background: C.card, color: C.text } }), React.createElement('button', { onClick: function () { step(1) }, title: '加 1', style: miniBtn }, '+'), dirty ? React.createElement('button', { onClick: function () { commit(val) }, title: '应用', style: { fontSize: C.fsAux, padding: '0px 5px', border: 'none', borderRadius: 2, background: C.brand, color: C_INV, cursor: 'pointer', lineHeight: '14px', fontWeight: 600, display: 'inline-flex', alignItems: 'center' } }, ic('check', 9)) : null) }
|
|
933
933
|
function MinCfg(props) {
|
|
934
934
|
var _R = React; var useState = _R.useState, useEffect = _R.useEffect
|
|
935
935
|
var _a = useState(String(props.value)), val = _a[0], setVal = _a[1]
|
|
@@ -940,17 +940,17 @@
|
|
|
940
940
|
if (isNaN(n) || n < props.min || n > props.max) { setVal(String(props.value)); setDirty(false); return }
|
|
941
941
|
setVal(String(n)); setDirty(false); rpc('set-board-config', { key: props.cfgKey, value: n }).then(function (r) { if (typeof props.onSaved === 'function') props.onSaved(r); return fetchTasks() }).catch(function () {})
|
|
942
942
|
}
|
|
943
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
943
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } },
|
|
944
944
|
props.label,
|
|
945
945
|
React.createElement('input', {
|
|
946
946
|
value: val, title: props.tip || (props.min + ' ~ ' + props.max + ' 分钟'),
|
|
947
947
|
onChange: function (e) { setVal(e.target.value); setDirty(e.target.value !== String(props.value)) },
|
|
948
948
|
onBlur: function () { if (dirty) commit(val) },
|
|
949
949
|
onKeyDown: function (e) { if (e.key === 'Enter') commit(val) },
|
|
950
|
-
style: { width: 38, padding: '0px 3px', fontSize:
|
|
950
|
+
style: { width: 38, padding: '0px 3px', fontSize: C.fsAux, textAlign: 'center', border: '1px solid ' + (dirty ? C.brand : C.border2), borderRadius: 2, background: C.card, color: C.text }
|
|
951
951
|
}),
|
|
952
|
-
React.createElement('span', { style: { fontSize:
|
|
953
|
-
dirty ? React.createElement('button', { onClick: function () { commit(val) }, title: '应用', style: { fontSize:
|
|
952
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '分'),
|
|
953
|
+
dirty ? React.createElement('button', { onClick: function () { commit(val) }, title: '应用', style: { fontSize: C.fsAux, padding: '0px 5px', border: 'none', borderRadius: 2, background: C.brand, color: C_INV, cursor: 'pointer', lineHeight: '14px', fontWeight: 600, display: 'inline-flex', alignItems: 'center' } }, ic('check', 9)) : null)
|
|
954
954
|
}
|
|
955
955
|
// 清理保留天数输入(卡龄主闸设置项 cleanupRetentionDays,1~90 天):与 MinCfg 同款受控输入 + 失焦/回车提交,
|
|
956
956
|
// 越界值直接回弹到服务端权威值(不留脏态),成功走 set-board-config → fetchTasks 由服务端权威值纠偏。
|
|
@@ -964,17 +964,17 @@
|
|
|
964
964
|
if (isNaN(n) || n < 1 || n > 90) { setVal(String(props.value)); setDirty(false); return }
|
|
965
965
|
setVal(String(n)); setDirty(false); rpc('set-board-config', { key: 'cleanupRetentionDays', value: n }).then(fetchTasks).catch(function () {})
|
|
966
966
|
}
|
|
967
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
967
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } },
|
|
968
968
|
props.label,
|
|
969
969
|
React.createElement('input', {
|
|
970
970
|
value: val, title: props.tip || ('1 ~ 90 天,默认 7'),
|
|
971
971
|
onChange: function (e) { setVal(e.target.value); setDirty(e.target.value !== String(props.value)) },
|
|
972
972
|
onBlur: function () { if (dirty) commit(val) },
|
|
973
973
|
onKeyDown: function (e) { if (e.key === 'Enter') commit(val) },
|
|
974
|
-
style: { width: 38, padding: '0px 3px', fontSize:
|
|
974
|
+
style: { width: 38, padding: '0px 3px', fontSize: C.fsAux, textAlign: 'center', border: '1px solid ' + (dirty ? C.brand : C.border2), borderRadius: 2, background: C.card, color: C.text }
|
|
975
975
|
}),
|
|
976
|
-
React.createElement('span', { style: { fontSize:
|
|
977
|
-
dirty ? React.createElement('button', { onClick: function () { commit(val) }, title: '应用', style: { fontSize:
|
|
976
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '天'),
|
|
977
|
+
dirty ? React.createElement('button', { onClick: function () { commit(val) }, title: '应用', style: { fontSize: C.fsAux, padding: '0px 5px', border: 'none', borderRadius: 2, background: C.brand, color: C_INV, cursor: 'pointer', lineHeight: '14px', fontWeight: 600, display: 'inline-flex', alignItems: 'center' } }, ic('check', 9)) : null)
|
|
978
978
|
}
|
|
979
979
|
|
|
980
980
|
// ===== 取模来源角标(task-mvnyc8vo,用户「能看到子 agent 当前在用什么模型跑」)=====
|
|
@@ -1046,16 +1046,16 @@
|
|
|
1046
1046
|
// 与下方降级文本输入同款两段式语义,巡检路过戳一下不再直接写配置。
|
|
1047
1047
|
function pick(v) { setVal(v); setDirty(v !== (props.value || '')) }
|
|
1048
1048
|
if (models) {
|
|
1049
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
1050
|
-
React.createElement('select', { value: val, onChange: function (e) { pick(e.target.value) }, title: label + '(空=' + inhLabel + ';选中后点 ✓ 才保存)', style: { width: 150, padding: '0px 4px', fontSize:
|
|
1049
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } }, label,
|
|
1050
|
+
React.createElement('select', { value: val, onChange: function (e) { pick(e.target.value) }, title: label + '(空=' + inhLabel + ';选中后点 ✓ 才保存)', style: { width: 150, padding: '0px 4px', fontSize: C.fsAux, border: '1px solid ' + (dirty ? C.brand : C.border), borderRadius: 2, background: C.card, color: C.text } },
|
|
1051
1051
|
React.createElement('option', { value: '' }, inhLabel),
|
|
1052
1052
|
models.map(function (m) { return React.createElement('option', { key: m.id, value: m.id }, m.name + ' (' + m.provider + ')') })),
|
|
1053
|
-
dirty ? React.createElement('button', { onClick: save, title: '保存 ' + label, style: { fontSize:
|
|
1053
|
+
dirty ? React.createElement('button', { onClick: save, title: '保存 ' + label, style: { fontSize: C.fsAux, padding: '0px 5px', border: 'none', borderRadius: 2, background: C.brand, color: C_INV, cursor: 'pointer', lineHeight: '14px', fontWeight: 600, display: 'inline-flex', alignItems: 'center' } }, ic('check', 9)) : null)
|
|
1054
1054
|
}
|
|
1055
1055
|
// 降级:文本输入(模型枚举不可用时)
|
|
1056
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
1057
|
-
React.createElement('input', { value: val, onChange: function (e) { setVal(e.target.value); setDirty(e.target.value !== (props.value || '')) }, onBlur: function () { if (dirty) save() }, onKeyDown: function (e) { if (e.key === 'Enter') save() }, placeholder: '空=' + inhLabel, style: { width: 110, padding: '0px 4px', fontSize:
|
|
1058
|
-
dirty ? React.createElement('button', { onClick: save, title: '应用', style: { fontSize:
|
|
1056
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } }, label,
|
|
1057
|
+
React.createElement('input', { value: val, onChange: function (e) { setVal(e.target.value); setDirty(e.target.value !== (props.value || '')) }, onBlur: function () { if (dirty) save() }, onKeyDown: function (e) { if (e.key === 'Enter') save() }, placeholder: '空=' + inhLabel, style: { width: 110, padding: '0px 4px', fontSize: C.fsAux, border: '1px solid ' + (dirty ? C.brand : C.border2), borderRadius: 2, background: C.card, color: C.text } }),
|
|
1058
|
+
dirty ? React.createElement('button', { onClick: save, title: '应用', style: { fontSize: C.fsAux, padding: '0px 5px', border: 'none', borderRadius: 2, background: C.brand, color: C_INV, cursor: 'pointer', lineHeight: '14px', fontWeight: 600, display: 'inline-flex', alignItems: 'center' } }, ic('check', 9)) : null)
|
|
1059
1059
|
}
|
|
1060
1060
|
|
|
1061
1061
|
// 界面缩放档位选择(task-mv58e01j,用户反馈「字体整体偏小」):90/100/110/125/150% 五档下拉。
|
|
@@ -1070,8 +1070,8 @@
|
|
|
1070
1070
|
try { localStorage.setItem(UI_ZOOM_KEY, String(n)) } catch (_) {}
|
|
1071
1071
|
notify()
|
|
1072
1072
|
}
|
|
1073
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
1074
|
-
React.createElement('select', { value: String(cur), onChange: function (e) { pick(e.target.value) }, title: '界面缩放:等比放大/缩小面板内字体、图标与间距(选中即时生效,本地记忆)', style: { padding: '0px 4px', fontSize:
|
|
1073
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } }, '界面缩放',
|
|
1074
|
+
React.createElement('select', { value: String(cur), onChange: function (e) { pick(e.target.value) }, title: '界面缩放:等比放大/缩小面板内字体、图标与间距(选中即时生效,本地记忆)', style: { padding: '0px 4px', fontSize: C.fsAux, border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: C.text } },
|
|
1075
1075
|
UI_ZOOM_LEVELS.map(function (z) { return React.createElement('option', { key: String(z), value: String(z) }, Math.round(z * 100) + '%' + (z === 1 ? '(默认)' : '')) })))
|
|
1076
1076
|
}
|
|
1077
1077
|
|
|
@@ -1085,8 +1085,8 @@
|
|
|
1085
1085
|
try { localStorage.removeItem(ONBOARD_DISMISS_KEY) } catch (_) {}
|
|
1086
1086
|
state.onboardDismissed = false; notify()
|
|
1087
1087
|
}
|
|
1088
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize:
|
|
1089
|
-
React.createElement('button', { onClick: reopen, title: '重新显示首用引导横幅(board 视图顶部定位行)', style: { padding: '0px 5px', fontSize:
|
|
1088
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'center', gap: 3, fontSize: C.fsSub, color: C.text2 } }, '引导横幅',
|
|
1089
|
+
React.createElement('button', { onClick: reopen, title: '重新显示首用引导横幅(board 视图顶部定位行)', style: { padding: '0px 5px', fontSize: C.fsAux, border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: C.text, cursor: 'pointer', lineHeight: '14px' } }, '重新显示'))
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
// ===== 模型健康点(task-mvoulhm7):🟢健康 / 🟡降级(链路存活,task-mvrqdw4k 空响应分治) / 🟡冷却中至HH:mm / 🔴熔断 / ⚪未知 =====
|
|
@@ -1221,8 +1221,8 @@
|
|
|
1221
1221
|
// 纯删除在 host diff 校验(子卡A task-mwcw0z5t:仅「当前配置没有的新值」过合法清单)下天然放行——
|
|
1222
1222
|
// 只删不增、剩余项全在合法目录,零新增 RPC、零校验改动;成功后 fetchTasks 回读由 commit 既有逻辑承接。
|
|
1223
1223
|
function cleanRetired() { if (!inDir) return; commit(list.filter(function (m) { return !!inDir[m] })) }
|
|
1224
|
-
var chipBtn = { fontSize:
|
|
1225
|
-
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'flex-start', gap: 4, fontSize:
|
|
1224
|
+
var chipBtn = { fontSize: C.fsAux, padding: '0px 2px', border: 'none', background: 'transparent', color: C.text2, cursor: 'pointer', lineHeight: '12px' }
|
|
1225
|
+
return React.createElement('span', { style: { display: 'inline-flex', alignItems: 'flex-start', gap: 4, fontSize: C.fsAux, color: C.text2, whiteSpace: 'normal' } },
|
|
1226
1226
|
props.label ? React.createElement('span', { style: { paddingTop: 1, minWidth: 62 } }, props.label) : null,
|
|
1227
1227
|
React.createElement('span', { style: { display: 'inline-flex', flexWrap: 'wrap', gap: 3, alignItems: 'center', maxWidth: 250 } },
|
|
1228
1228
|
list.length === 0 ? React.createElement('span', { style: { color: C.text2, fontStyle: 'italic', paddingTop: 1 } }, props.emptyHint || '无') : null,
|
|
@@ -1241,7 +1241,7 @@
|
|
|
1241
1241
|
// effort 文本段(task-mwkbo9z6 ①③):gated 于 eff——纯字符串槽位不渲染(芯片只显 id,零视觉变化);
|
|
1242
1242
|
// 点击展开改档小下拉(选项=efforts+「默认」);改档中渲染 select 替换文本,失焦收起不下发
|
|
1243
1243
|
eff ? (effEdit === i
|
|
1244
|
-
? React.createElement('select', { value: eff, onChange: function (e) { changeEffort(i, e.target.value) }, onBlur: function () { setEffEdit(null) }, title: '改思考等级(默认=不指定 effort,走模型默认档)', style: { fontSize:
|
|
1244
|
+
? React.createElement('select', { value: eff, onChange: function (e) { changeEffort(i, e.target.value) }, onBlur: function () { setEffEdit(null) }, title: '改思考等级(默认=不指定 effort,走模型默认档)', style: { fontSize: C.fsAux, padding: '0px 1px', border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: C.text } },
|
|
1245
1245
|
React.createElement('option', { value: '' }, '默认'),
|
|
1246
1246
|
(effOpts || []).map(function (ef) { return React.createElement('option', { key: ef, value: ef }, ef) }))
|
|
1247
1247
|
: React.createElement('span', { onClick: function () { if (effOpts) setEffEdit(effEdit === i ? null : i) }, title: effOpts ? '点击修改思考等级(当前 ' + eff + ')' : '思考等级 ' + eff, style: { cursor: effOpts ? 'pointer' : 'default' } }, ' · ' + eff)) : null,
|
|
@@ -1250,20 +1250,20 @@
|
|
|
1250
1250
|
React.createElement('button', { onClick: function () { removeAt(i) }, title: '移除(×)', style: chipBtn }, '×'))
|
|
1251
1251
|
})),
|
|
1252
1252
|
// 尾部:下拉(过滤已选)/ 目录缺失降级文本输入 + effort 下拉(task-mwkbo9z6 ②)+「添加」追加链尾
|
|
1253
|
-
avail ? React.createElement('select', { value: pickVal, onChange: function (e) { setPickVal(e.target.value); setPickEff(e.target.value ? defaultEffortOf(e.target.value) : '') }, title: '选择要追加到链尾的模型(已在链中的已过滤)', style: { width: 150, padding: '0px 2px', fontSize:
|
|
1253
|
+
avail ? React.createElement('select', { value: pickVal, onChange: function (e) { setPickVal(e.target.value); setPickEff(e.target.value ? defaultEffortOf(e.target.value) : '') }, title: '选择要追加到链尾的模型(已在链中的已过滤)', style: { width: 150, padding: '0px 2px', fontSize: C.fsAux, border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: C.text } },
|
|
1254
1254
|
React.createElement('option', { value: '' }, '选择模型…'),
|
|
1255
1255
|
avail.map(function (m) { return React.createElement('option', { key: m.id, value: m.id }, m.name + ' (' + m.provider + ')') }))
|
|
1256
|
-
: React.createElement('input', { value: pickVal, onChange: function (e) { setPickVal(e.target.value) }, onKeyDown: function (e) { if (e.key === 'Enter') add() }, placeholder: 'provider/model', title: '模型目录不可用,手输 provider/model 后点添加', style: { width: 110, padding: '0px 4px', fontSize:
|
|
1256
|
+
: React.createElement('input', { value: pickVal, onChange: function (e) { setPickVal(e.target.value) }, onKeyDown: function (e) { if (e.key === 'Enter') add() }, placeholder: 'provider/model', title: '模型目录不可用,手输 provider/model 后点添加', style: { width: 110, padding: '0px 4px', fontSize: C.fsAux, border: '1px solid ' + C.border2, borderRadius: 2, background: C.card, color: C.text } }),
|
|
1257
1257
|
// 添加时 effort 下拉(task-mwkbo9z6 ②):选中模型带 efforts 清单才渲染(无 efforts/未选/目录不可用/
|
|
1258
1258
|
// 降级手输 → pickEfforts=null → 隐藏,只添加 id);选项=该模型 efforts,默认选中 defaultEffort
|
|
1259
1259
|
//(模型切换即重置);「默认」=不指定 effort(纯字符串添加,走模型默认档)。
|
|
1260
|
-
pickEfforts ? React.createElement('select', { value: pickEff, onChange: function (e) { setPickEff(e.target.value) }, title: '思考等级(默认=不指定 effort,走模型默认档)', style: { padding: '0px 2px', fontSize:
|
|
1260
|
+
pickEfforts ? React.createElement('select', { value: pickEff, onChange: function (e) { setPickEff(e.target.value) }, title: '思考等级(默认=不指定 effort,走模型默认档)', style: { padding: '0px 2px', fontSize: C.fsAux, border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: C.text } },
|
|
1261
1261
|
React.createElement('option', { value: '' }, '默认'),
|
|
1262
1262
|
pickEfforts.map(function (ef) { return React.createElement('option', { key: ef, value: ef }, ef) })) : null,
|
|
1263
|
-
React.createElement('button', { onClick: add, disabled: !pickVal, title: '追加到链尾', style: { fontSize:
|
|
1263
|
+
React.createElement('button', { onClick: add, disabled: !pickVal, title: '追加到链尾', style: { fontSize: C.fsAux, padding: '0px 5px', border: '1px solid ' + C.border, borderRadius: 2, background: C.card, color: pickVal ? C.brand : C.text2, cursor: pickVal ? 'pointer' : 'default', lineHeight: '14px', fontWeight: 600 } }, '添加'),
|
|
1264
1264
|
// 「清理失效(N)」一键按钮(task-mwcw2jx8):retiredCount>0 才渲染(同槽多个下架模型逐个 × 要点 N
|
|
1265
1265
|
// 次等 N 次 RPC,此键一次收口);warn 描边与「⚠️下架」芯片标记同色系;busy 置灰防连点
|
|
1266
|
-
retiredCount ? React.createElement('button', { onClick: cleanRetired, disabled: busy, title: '一键移除全部已下架模型(仅删除,不新增)', style: { fontSize:
|
|
1266
|
+
retiredCount ? React.createElement('button', { onClick: cleanRetired, disabled: busy, title: '一键移除全部已下架模型(仅删除,不新增)', style: { fontSize: C.fsAux, padding: '0px 5px', border: '1px solid ' + C.warn, borderRadius: 2, background: C.card, color: C.warn, cursor: busy ? 'default' : 'pointer', lineHeight: '14px', fontWeight: 600, flexShrink: 0 } }, '清理失效(' + retiredCount + ')') : null,
|
|
1267
1267
|
msg ? React.createElement('span', { style: { color: C.err, maxWidth: 140 } }, msg) : null)
|
|
1268
1268
|
}
|
|
1269
1269
|
|
|
@@ -1357,42 +1357,51 @@
|
|
|
1357
1357
|
if (!open && btnRef.current) { var r = btnRef.current.getBoundingClientRect(); setPos(clampPopoverPos(r, ROUTE_POPOVER_W, z, popoverBounds(btnRef.current))) }
|
|
1358
1358
|
setOpen(!open)
|
|
1359
1359
|
}
|
|
1360
|
+
// 分组卡片 + 字号阶梯(阶段1 补漏,task-mwnlwd0e):与仪表盘/归档卡片同族——弹层根已是 C.card,
|
|
1361
|
+
// 组卡抬一层 C.nested 圆角卡;组头 fsSub·600,配置项标签 fsSub / 值·输入·注释 fsAux(取代旧
|
|
1362
|
+
// 10/9px 平铺)。只改布局与信息层级:定位(fixed + clampPopoverPos + uiZoom 补偿)、读写通道零改动。
|
|
1363
|
+
var cfgCard = { background: C.nested, border: '1px solid ' + C.border, borderRadius: 8, padding: '8px 10px', marginBottom: 8 }
|
|
1364
|
+
var cfgHead = { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 5 }
|
|
1360
1365
|
return React.createElement('span', { ref: ref, style: { position: 'relative', display: 'inline-flex' } },
|
|
1361
1366
|
React.createElement('button', { ref: btnRef, onClick: toggle, title: '模型路由(板级模型 / 力度路由六槽 / 备用模型链)', style: { fontSize: 12, padding: '3px 8px', border: '1px solid ' + (open ? C.brand : C.border), borderRadius: 6, cursor: 'pointer', background: open ? C.nested : 'transparent', color: C.text2, display: 'inline-flex', alignItems: 'center' } }, ic('cpu', 13)),
|
|
1362
1367
|
open && pos ? React.createElement('div', { style: { position: 'fixed', top: pos.top + 'px', left: pos.left != null ? pos.left + 'px' : null, right: pos.right != null ? pos.right + 'px' : null, padding: '8px 10px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, boxShadow: '0 4px 16px rgba(0,0,0,0.15)', zIndex: 1000, whiteSpace: 'nowrap', maxHeight: (pos.maxH || 300) + 'px', overflowY: 'auto' } },
|
|
1363
1368
|
// ① 板级模型(从池配置弹层搬入,组件与写通道逐字不变)
|
|
1364
|
-
React.createElement('div', { style:
|
|
1365
|
-
|
|
1366
|
-
React.createElement(
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
React.createElement(
|
|
1371
|
-
|
|
1372
|
-
|
|
1369
|
+
React.createElement('div', { style: cfgCard },
|
|
1370
|
+
React.createElement('div', { style: cfgHead }, '板级模型'),
|
|
1371
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center', marginBottom: 5 } },
|
|
1372
|
+
React.createElement(ModelCfg, { label: 'Worker 模型', cfgKey: 'workerModel', value: props.workerModel }),
|
|
1373
|
+
props.workerModel ? React.createElement(ModelHealthDot, { model: props.workerModel, health: modelHealth }) : null,
|
|
1374
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '(Worker 执行模型)')),
|
|
1375
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
1376
|
+
React.createElement(ModelCfg, { label: 'Verifier 模型', cfgKey: 'verifierModel', value: props.verifierModel }),
|
|
1377
|
+
props.verifierModel ? React.createElement(ModelHealthDot, { model: props.verifierModel, health: modelHealth }) : null,
|
|
1378
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '(Verifier 异构审查)'))),
|
|
1373
1379
|
// 主动健康嗅探配置:只打本页已配置模型;关掉后冷却/熔断/run 被动健康面仍然保留。
|
|
1374
|
-
React.createElement('div', { style:
|
|
1375
|
-
|
|
1376
|
-
React.createElement('
|
|
1377
|
-
React.createElement('
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
+
React.createElement('div', { style: cfgCard },
|
|
1381
|
+
React.createElement('div', { style: cfgHead }, '健康嗅探(事前调度)'),
|
|
1382
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center', whiteSpace: 'normal', maxWidth: 360 } },
|
|
1383
|
+
React.createElement('label', { style: { display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: C.fsSub, color: C.text, cursor: 'pointer' }, title: '每间隔对板级/档位/备用链中已配置模型发一次 maxTokens=1 的极短 ping;不创建子代理' },
|
|
1384
|
+
React.createElement('input', { type: 'checkbox', checked: !!probeEnabled, onChange: function (e) { saveProbeEnabled(e.target.checked) } }), '主动探测'),
|
|
1385
|
+
React.createElement(MinCfg, { label: '间隔', cfgKey: 'probeIntervalMin', value: probeIntervalMin, min: 1, max: 1440, tip: '主动健康探测间隔(1~1440 分钟,默认 15)', onSaved: refreshModelHealth }),
|
|
1386
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '仅已配置模型 · 关闭仍保留被动健康'))),
|
|
1380
1387
|
// ② 力度路由六槽(链编辑器,task-mvokikl3):三档 × Worker/Verifier 各一条有序模型链——
|
|
1381
1388
|
// 读写整个槽位数组(非仅首选);空链=继承上方板级模型行。
|
|
1382
|
-
React.createElement('div', { style:
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
React.createElement('div', { style: { marginBottom:
|
|
1387
|
-
React.createElement(
|
|
1388
|
-
|
|
1389
|
-
React.createElement(
|
|
1390
|
-
|
|
1391
|
-
|
|
1389
|
+
React.createElement('div', { style: cfgCard },
|
|
1390
|
+
React.createElement('div', { style: cfgHead }, '力度路由'),
|
|
1391
|
+
[['light', '轻档'], ['standard', '标档'], ['heavy', '重档']].map(function (ln) {
|
|
1392
|
+
var laneObj = (props.laneModels && props.laneModels[ln[0]]) || {}
|
|
1393
|
+
return React.createElement('div', { key: ln[0], style: { marginBottom: 4 } },
|
|
1394
|
+
React.createElement('div', { style: { marginBottom: 2 } },
|
|
1395
|
+
React.createElement(OrderedModelsEditor, { label: ln[1] + ' Worker', value: laneObj.worker, models: routeModels, emptyHint: '继承板级', health: modelHealth, onSave: function (next) { return saveLaneSlot(ln[0], 'worker', next) } })),
|
|
1396
|
+
React.createElement('div', null,
|
|
1397
|
+
React.createElement(OrderedModelsEditor, { label: ln[1] + ' Verifier', value: laneObj.verifier, models: routeModels, emptyHint: '继承板级', health: modelHealth, onSave: function (next) { return saveLaneSlot(ln[0], 'verifier', next) } })))
|
|
1398
|
+
}),
|
|
1399
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 1, whiteSpace: 'normal', maxWidth: 360 } }, '每槽=有序模型链:按序取第一个健康模型(首选冷却/熔断则次选递补,槽内全病走备用链→降档→父模型);空链 = 继承上方 Worker/Verifier 模型行;卡档位走对话 task_update size=light/standard/heavy')),
|
|
1392
1400
|
// ③ 备用模型链:同款链编辑器(task-mvokikl3,替代逗号/换行文本框)
|
|
1393
|
-
React.createElement('div', { style:
|
|
1394
|
-
|
|
1395
|
-
|
|
1401
|
+
React.createElement('div', { style: cfgCard },
|
|
1402
|
+
React.createElement('div', { style: cfgHead }, '备用模型链'),
|
|
1403
|
+
React.createElement(OrderedModelsEditor, { label: '备用链', value: props.fbModels, models: routeModels, emptyHint: '无(不启用)', health: modelHealth, onSave: saveFallbackChain }),
|
|
1404
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 3, whiteSpace: 'normal', maxWidth: 360 } }, '取模口径:卡级特例 → 档位路由 → 板级模型;备用链=档位链全不可用时的跨档逃生索——候选冷却/熔断时按链顺序找首个健康替代,链尽再走降档/父模型兜底;空链=不启用'))) : null)
|
|
1396
1405
|
}
|
|
1397
1406
|
|
|
1398
1407
|
function PoolCfgPopover(props) {
|
|
@@ -1427,65 +1436,78 @@
|
|
|
1427
1436
|
if (!open && btnRef.current) { var r = btnRef.current.getBoundingClientRect(); setPos(clampPopoverPos(r, POOL_POPOVER_W, z, popoverBounds(btnRef.current))) }
|
|
1428
1437
|
setOpen(!open)
|
|
1429
1438
|
}
|
|
1439
|
+
// 分组卡片 + 字号阶梯(阶段1 补漏,task-mwnlwd0e,与 ModelRoutePopover 同款):组卡 C.nested 圆角卡
|
|
1440
|
+
// + 组头 fsSub·600,配置项标签 fsSub / 值·输入·注释 fsAux——只改布局与信息层级,定位(fixed +
|
|
1441
|
+
// clampPopoverPos + uiZoom 补偿)与开关读写(setCfg 乐观更新/失败回滚)零改动。
|
|
1442
|
+
var cfgCard = { background: C.nested, border: '1px solid ' + C.border, borderRadius: 8, padding: '8px 10px', marginBottom: 8 }
|
|
1443
|
+
var cfgHead = { fontSize: C.fsSub, fontWeight: 600, color: C.text2, marginBottom: 5 }
|
|
1430
1444
|
return React.createElement('span', { ref: ref, style: { position: 'relative', display: 'inline-flex' } },
|
|
1431
1445
|
React.createElement('button', { ref: btnRef, onClick: toggle, title: '池配置', style: { fontSize: 12, padding: '3px 8px', border: '1px solid ' + (open ? C.brand : C.border), borderRadius: 6, cursor: 'pointer', background: open ? C.nested : 'transparent', color: C.text2, display: 'inline-flex', alignItems: 'center' } }, ic('settings', 13)),
|
|
1432
1446
|
open && pos ? React.createElement('div', { style: { position: 'fixed', top: pos.top + 'px', left: pos.left != null ? pos.left + 'px' : null, right: pos.right != null ? pos.right + 'px' : null, padding: '8px 10px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8, boxShadow: '0 4px 16px rgba(0,0,0,0.15)', zIndex: 1000, whiteSpace: 'nowrap', maxHeight: (pos.maxH || 300) + 'px', overflowY: 'auto' } },
|
|
1433
|
-
React.createElement('div', { style:
|
|
1434
|
-
|
|
1435
|
-
React.createElement(
|
|
1436
|
-
|
|
1447
|
+
React.createElement('div', { style: cfgCard },
|
|
1448
|
+
React.createElement('div', { style: cfgHead }, '并发上限(一次性派发,用完即销毁)'),
|
|
1449
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
1450
|
+
React.createElement(PoolCfg, { label: 'Worker 并发', cfgKey: 'maxWorkers', value: props.maxW, min: 1, tip: '最少 1(暂停派发请切清单模式);1 ~ 10' }),
|
|
1451
|
+
React.createElement(PoolCfg, { label: 'Verifier 并发', cfgKey: 'maxVerifiers', value: props.maxV, min: 0, tip: '0 ~ 5;0=不要 Verifier(验收需人工)' }))),
|
|
1437
1452
|
// 模型相关配置(板级 Worker/Verifier 模型行 + 力度路由六槽)已搬至「模型路由」独立弹层
|
|
1438
1453
|
//(task-mvnyc8vo,ModelRoutePopover)——本弹层只留并发/超时/开关。
|
|
1439
|
-
React.createElement('div', { style:
|
|
1440
|
-
|
|
1441
|
-
React.createElement(
|
|
1442
|
-
|
|
1454
|
+
React.createElement('div', { style: cfgCard },
|
|
1455
|
+
React.createElement('div', { style: cfgHead }, '两级超时(软超时只提醒主窗口,由你决定继续等待或终止)'),
|
|
1456
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
1457
|
+
React.createElement(MinCfg, { label: '软超时', cfgKey: 'softTimeoutMin', value: props.softT, min: 1, max: 480, tip: '超过后在看板提醒主窗口,不终止 run(1~480 分钟)' }),
|
|
1458
|
+
React.createElement(MinCfg, { label: '硬超时', cfgKey: 'hardTimeoutMin', value: props.hardT, min: 1, max: 1440, tip: '兜底:人不在线时自动终止挂死 run 并重试(1~1440 分钟)' }))),
|
|
1443
1459
|
// 学习飞轮 v1 总开关:关掉后不生成候选教训、prompt 不提软召回、详情页不渲染「沉淀」按钮
|
|
1444
|
-
React.createElement('div', { style:
|
|
1445
|
-
|
|
1446
|
-
React.createElement('
|
|
1447
|
-
|
|
1460
|
+
React.createElement('div', { style: cfgCard },
|
|
1461
|
+
React.createElement('div', { style: cfgHead }, '学习反馈'),
|
|
1462
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: C.fsSub, color: C.text, cursor: 'pointer', whiteSpace: 'normal', maxWidth: 300 } },
|
|
1463
|
+
React.createElement('input', { type: 'checkbox', checked: !!props.feedbackEnabled, onChange: function (e) { setCfg('feedbackEnabled', e.target.checked) } }),
|
|
1464
|
+
React.createElement('span', null, '候选教训(Verifier 驳回/仲裁结论自动生成候选,Worker prompt 提示先检索历史教训)'))),
|
|
1448
1465
|
// 回执开关(用户要求「回执可以做一个开关,放到设置里」):派发/完成两类回执各自可关,缺省都开。
|
|
1449
1466
|
// 只影响回执播报,不影响派发与状态机;歧义裁决通知不在此闸门内(见下行说明文案)。
|
|
1450
|
-
React.createElement('div', { style:
|
|
1451
|
-
|
|
1452
|
-
React.createElement('
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
React.createElement('
|
|
1456
|
-
|
|
1457
|
-
|
|
1467
|
+
React.createElement('div', { style: cfgCard },
|
|
1468
|
+
React.createElement('div', { style: cfgHead }, '通知'),
|
|
1469
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: C.fsSub, color: C.text, cursor: 'pointer', whiteSpace: 'normal', maxWidth: 300 } },
|
|
1470
|
+
React.createElement('input', { type: 'checkbox', checked: props.notifyDispatch !== false, onChange: function (e) { setCfg('notifyDispatch', e.target.checked) } }),
|
|
1471
|
+
React.createElement('span', null, '⚡ 派发回执(任务被 Worker/Verifier 领走时播报)')),
|
|
1472
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: C.fsSub, color: C.text, cursor: 'pointer', whiteSpace: 'normal', maxWidth: 300, marginTop: 3 } },
|
|
1473
|
+
React.createElement('input', { type: 'checkbox', checked: props.notifyDone !== false, onChange: function (e) { setCfg('notifyDone', e.target.checked) } }),
|
|
1474
|
+
React.createElement('span', null, '✅ 完成回执(任务完成或阻塞时聚合播报)')),
|
|
1475
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 3, whiteSpace: 'normal', maxWidth: 300 } }, '歧义裁决通知不受这两个开关影响(任务等人裁决必须提醒)')),
|
|
1458
1476
|
// 自测指南开关(verifyUserGuide,缺省 true,「通知」小节旁的「验收」小节):关掉后
|
|
1459
1477
|
// ① Verifier prompt 不再要求「## 自测指南」段(省 token);② 验收落账不挂 userTest;
|
|
1460
1478
|
// ③ 详情页自测指南块与报告「本版自测清单」段整块不渲染。老看板缺字段=开。
|
|
1461
|
-
React.createElement('div', { style:
|
|
1462
|
-
|
|
1463
|
-
React.createElement('
|
|
1464
|
-
|
|
1479
|
+
React.createElement('div', { style: cfgCard },
|
|
1480
|
+
React.createElement('div', { style: cfgHead }, '验收'),
|
|
1481
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: C.fsSub, color: C.text, cursor: 'pointer', whiteSpace: 'normal', maxWidth: 300 } },
|
|
1482
|
+
React.createElement('input', { type: 'checkbox', checked: props.verifyUserGuide !== false, onChange: function (e) { setCfg('verifyUserGuide', e.target.checked) } }),
|
|
1483
|
+
React.createElement('span', null, '📋 自测指南(验收结论附用户自测步骤,详情页与报告展示)'))),
|
|
1465
1484
|
// 史诗拆分总开关(板级 epicSplit,缺省 true):**只关引导,不禁机制**——关掉后 Team 提示词不再
|
|
1466
1485
|
// 注入「大任务必须拆分」第 6~8 条拆分 doctrine、create-task 响应不再附 suggestSplit 软提示;显式传 parentId 建
|
|
1467
1486
|
// 子卡、史诗自动收口/hooks 状态机照常(用户/主窗口明确要拆时不受阻)。勾选态缺字段=开,与 host 同口径。
|
|
1468
|
-
React.createElement('div', { style:
|
|
1469
|
-
|
|
1470
|
-
React.createElement('
|
|
1471
|
-
|
|
1472
|
-
|
|
1487
|
+
React.createElement('div', { style: cfgCard },
|
|
1488
|
+
React.createElement('div', { style: cfgHead }, '功能'),
|
|
1489
|
+
React.createElement('label', { style: { display: 'flex', alignItems: 'center', gap: 5, fontSize: C.fsSub, color: C.text, cursor: 'pointer', whiteSpace: 'normal', maxWidth: 300 } },
|
|
1490
|
+
React.createElement('input', { type: 'checkbox', checked: props.epicSplit !== false, onChange: function (e) { setCfg('epicSplit', e.target.checked) } }),
|
|
1491
|
+
React.createElement('span', null, '🧩 史诗拆分:大任务引导拆为 epic + 子任务')),
|
|
1492
|
+
React.createElement('div', { style: { fontSize: C.fsAux, color: C.text2, marginTop: 3, whiteSpace: 'normal', maxWidth: 300 } }, '关掉只停引导:显式 parentId 建子卡与史诗自动收口照常工作')),
|
|
1473
1493
|
// 清理保留天数(卡龄主闸 cleanupRetentionDays,默认 7、可配 1-90):回收与归档生命周期对齐——
|
|
1474
1494
|
// 卡片归档满该天数后,其会话才进入可清理池。仪表盘「存储清理」区文案读同一服务端权威值。
|
|
1475
|
-
React.createElement('div', { style:
|
|
1476
|
-
|
|
1477
|
-
React.createElement(
|
|
1478
|
-
|
|
1495
|
+
React.createElement('div', { style: cfgCard },
|
|
1496
|
+
React.createElement('div', { style: cfgHead }, '存储清理'),
|
|
1497
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
1498
|
+
React.createElement(RetentionCfg, { label: '归档保留', value: props.retentionDays, tip: '卡片归档后多少天可被完全回收(1~90 天,默认 7)' }),
|
|
1499
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '(归档满该天数后其会话可被清理回收)'))),
|
|
1479
1500
|
// 界面缩放档位(task-mv58e01j):设置弹层「界面」小节——五档下拉选中即 localStorage
|
|
1480
1501
|
// 持久化 + state.uiZoom + notify 即时生效(zoom 挂在 TopPanel 根容器,只影响本面板)。
|
|
1481
|
-
React.createElement('div', { style:
|
|
1482
|
-
|
|
1483
|
-
React.createElement(
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
React.createElement(
|
|
1488
|
-
|
|
1502
|
+
React.createElement('div', { style: cfgCard },
|
|
1503
|
+
React.createElement('div', { style: cfgHead }, '界面'),
|
|
1504
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center' } },
|
|
1505
|
+
React.createElement(ZoomCfg, null),
|
|
1506
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '(等比缩放面板字体/图标/间距,仅本面板生效并本地记忆)')),
|
|
1507
|
+
// 引导横幅重开行(task-mvnnkv7x-2):仅关闭态(obd=true)渲染——横幅挂着时无需重开入口
|
|
1508
|
+
state.onboardDismissed ? React.createElement('div', { style: { display: 'flex', gap: 8, alignItems: 'center', marginTop: 3 } },
|
|
1509
|
+
React.createElement(OnboardReset, null),
|
|
1510
|
+
React.createElement('span', { style: { fontSize: C.fsAux, color: C.text2 } }, '(首用定位行已 ✕ 关闭,点此重新显示)')) : null)) : null)
|
|
1489
1511
|
}
|
|
1490
1512
|
|
|
1491
1513
|
function TeamView() {
|
|
@@ -1508,12 +1530,57 @@
|
|
|
1508
1530
|
}
|
|
1509
1531
|
var ws = ps.workers || [], vs = ps.verifiers || []
|
|
1510
1532
|
var _R2 = React; var _st = _R2.useState(''), editMsg = _st[0], setEditMsg = _st[1]
|
|
1533
|
+
// ===== 执行池四区(task-mwndka2w,原型 prototype/ux-redesign.html 执行池):成员卡与超时策略之外 =====
|
|
1534
|
+
// 新增 模型健康 / 最近完成 / 资源水位 三区。数据面纪律:全部复用既有通道现算、零新增采集——
|
|
1535
|
+
// ① 模型清单/水位/feed 读 state(laneModels / poolStatus / tasks 的 run 留账);
|
|
1536
|
+
// ② 健康四态与 effort/下架元数据走既有 RPC:get-tasks.modelHealth(挂载即取 + 15s 局部刷新,
|
|
1537
|
+
// 与 ModelRoutePopover 同款「局部拉取、不改 kernel 全局 state」,epoch 丢迟到响应)+
|
|
1538
|
+
// list-models 目录(一次取;老宿主/枚举失败 → null:已下架不标、默认 effort 档关闭,不误报
|
|
1539
|
+
// ——OrderedModelsEditor 的 inCat 同口径)。
|
|
1540
|
+
var _tvh = _R2.useState(null), mhData = _tvh[0], setMhData = _tvh[1]
|
|
1541
|
+
var _tvc = _R2.useState(null), catModels = _tvc[0], setCatModels = _tvc[1]
|
|
1542
|
+
var mhEpoch = _R2.useRef(0)
|
|
1543
|
+
function refreshTeamHealth() {
|
|
1544
|
+
var epoch = mhEpoch.current, args = state.tasksHash ? { ifHash: state.tasksHash } : {}
|
|
1545
|
+
return rpc('get-tasks', args).then(function (d) {
|
|
1546
|
+
if (!d || d.error || epoch !== mhEpoch.current) return d
|
|
1547
|
+
setMhData(d.modelHealth || null)
|
|
1548
|
+
return d
|
|
1549
|
+
}).catch(function () { return null })
|
|
1550
|
+
}
|
|
1551
|
+
_R2.useEffect(function () { refreshTeamHealth(); var timer = setInterval(refreshTeamHealth, 15000); return function () { clearInterval(timer); mhEpoch.current++ } }, [])
|
|
1552
|
+
_R2.useEffect(function () {
|
|
1553
|
+
var cancelled = false
|
|
1554
|
+
rpc('list-models').then(function (r) { if (!cancelled && r && r.ok && Array.isArray(r.models) && r.models.length) setCatModels(r.models) }).catch(function () {})
|
|
1555
|
+
return function () { cancelled = true }
|
|
1556
|
+
}, [])
|
|
1511
1557
|
function saveTimeout(cfgKey, v, min, max) {
|
|
1512
1558
|
var n = parseInt(v, 10)
|
|
1513
1559
|
if (isNaN(n) || n < min || n > max) { setEditMsg('范围 ' + min + '~' + max + ' 分钟'); setTimeout(function () { setEditMsg('') }, 2500); return }
|
|
1514
1560
|
rpc('set-board-config', { key: cfgKey, value: n }).then(function () { setEditMsg('✅ 已保存'); setTimeout(function () { setEditMsg('') }, 2000); fetchTasks() }).catch(function () { setEditMsg('⚠️ 保存失败'); setTimeout(function () { setEditMsg('') }, 2500) })
|
|
1515
1561
|
}
|
|
1516
1562
|
var tIn = { width: 44, padding: '1px 3px', fontSize: 10, textAlign: 'center', border: '1px solid ' + C.border, borderRadius: 3, background: C.card, color: C.text }
|
|
1563
|
+
// ===== 三区现算数据(纯函数助手定义在本组件之后,函数声明提升跨用)=====
|
|
1564
|
+
var tmr = teamModelRows(state.workerModel, state.verifierModel, state.laneModels, state.fallbackModels, catModels)
|
|
1565
|
+
var feed = teamDoneFeed(state.tasks, 6)
|
|
1566
|
+
var hourTok = teamHourTokens(state.tasks, new Date())
|
|
1567
|
+
var todayN = teamTodayDone(state.tasks, new Date())
|
|
1568
|
+
var wBusyN = (ps.workers || []).filter(function (m) { return m && m.busy }).length
|
|
1569
|
+
var vBusyN = (ps.verifiers || []).filter(function (m) { return m && m.busy }).length
|
|
1570
|
+
var wCap = state.maxWorkers || 3, vCap = state.maxVerifiers || 2
|
|
1571
|
+
function pctOf(v, max) { var x = Number(v) || 0; if (!(max > 0)) return 0; var p = Math.round(x / max * 100); return x > 0 ? Math.max(2, p) : 0 }
|
|
1572
|
+
function waterRow(label, valText, pct, tip, color) {
|
|
1573
|
+
return React.createElement('div', { style: { marginBottom: 8 } },
|
|
1574
|
+
React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', fontSize: 10, color: C.text2, marginBottom: 3 }, title: tip },
|
|
1575
|
+
React.createElement('span', null, label),
|
|
1576
|
+
React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, valText)),
|
|
1577
|
+
React.createElement('div', { style: { height: 8, background: C.nested, borderRadius: 4, overflow: 'hidden' } },
|
|
1578
|
+
React.createElement('div', { style: { height: '100%', width: pct + '%', background: color || C.brand, borderRadius: 4, transition: 'width .3s' } })))
|
|
1579
|
+
}
|
|
1580
|
+
var zoneBox = { flex: '1 1 230px', minWidth: 230, padding: '12px', background: C.card, border: '1px solid ' + C.border, borderRadius: 8 }
|
|
1581
|
+
function zoneHead(icon, text, tip) {
|
|
1582
|
+
return React.createElement('div', { title: tip, style: { fontSize: 11, fontWeight: 600, color: C.text2, marginBottom: 8, display: 'flex', alignItems: 'center', gap: 4 } }, ic(icon, 11), text)
|
|
1583
|
+
}
|
|
1517
1584
|
return React.createElement('div', null,
|
|
1518
1585
|
React.createElement('div', { style: { marginBottom: 10, padding: '6px 8px', background: C.card, border: '1px solid ' + C.border, borderRadius: 6, display: 'flex', alignItems: 'center', gap: 6, flexWrap: 'wrap', fontSize: 10, color: C.text2 } },
|
|
1519
1586
|
ic('activity', 11),
|
|
@@ -1529,5 +1596,149 @@
|
|
|
1529
1596
|
React.createElement('div', { style: { fontSize: 12, fontWeight: 600, color: C.text, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('zap', 12), 'Worker 池 (' + ws.length + ')'),
|
|
1530
1597
|
ws.length === 0 ? React.createElement('div', { style: { fontSize: 10, color: C.text2, marginBottom: 10 } }, '暂无 Worker(有待办任务时自动扩容)') : React.createElement('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap', marginBottom: 12 } }, ws.map(function (m) { return memberCard(m, 'worker') })),
|
|
1531
1598
|
React.createElement('div', { style: { fontSize: 12, fontWeight: 600, color: C.text, marginBottom: 6, display: 'flex', alignItems: 'center', gap: 4 } }, ic('clipboard-check', 12), 'Verifier 池 (' + vs.length + ')'),
|
|
1532
|
-
vs.length === 0 ? React.createElement('div', { style: { fontSize: 10, color: C.text2 } }, '暂无 Verifier(有验证中任务时自动扩容)') : React.createElement('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap' } }, vs.map(function (m) { return memberCard(m, 'verifier') }))
|
|
1599
|
+
vs.length === 0 ? React.createElement('div', { style: { fontSize: 10, color: C.text2 } }, '暂无 Verifier(有验证中任务时自动扩容)') : React.createElement('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap' } }, vs.map(function (m) { return memberCard(m, 'verifier') })),
|
|
1600
|
+
// ===== 执行池四区 · 新增三区(task-mwndka2w):模型健康 / 最近完成 / 资源水位 =====
|
|
1601
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, flexWrap: 'wrap', marginTop: 12 } },
|
|
1602
|
+
// ② 模型健康:本板已配置模型(板级 ∪ 力度路由六槽 ∪ 备用链,与 host 侧 configuredModelIds 同口径)
|
|
1603
|
+
// 逐个健康态(ModelHealthDot 四态图标 + 状态标签)+ effort 档 + 目录外「已下架」标记。
|
|
1604
|
+
React.createElement('div', { style: zoneBox },
|
|
1605
|
+
zoneHead('activity', '模型健康 (' + tmr.order.length + ')', '本板已配置模型的健康态(get-tasks.modelHealth,15s 局部刷新)与 effort 档;「已下架」按 list-models 目录判定(目录不可用不标,不误报)'),
|
|
1606
|
+
tmr.order.length === 0 ? React.createElement('div', { style: { fontSize: 10, color: C.text2 } }, '未配置模型(板级 / 力度路由 / 备用链均为空,可在「模型路由」弹层配置)') : tmr.order.map(function (mid) {
|
|
1607
|
+
var h = (mhData && mhData[mid]) || null
|
|
1608
|
+
var meta = (h && MODEL_HEALTH_META[h.state]) || MODEL_HEALTH_META.unknown
|
|
1609
|
+
var retired = !!(tmr.inCat && !tmr.inCat[mid])
|
|
1610
|
+
var eff = tmr.effConf[mid] || (tmr.defEff && tmr.defEff[mid]) || ''
|
|
1611
|
+
return React.createElement('div', { key: mid, style: { display: 'flex', alignItems: 'center', gap: 5, padding: '5px 0', borderBottom: '1px solid ' + C.nested } },
|
|
1612
|
+
React.createElement(ModelHealthDot, { model: mid, health: mhData }),
|
|
1613
|
+
React.createElement('span', { title: mid, style: { flex: 1, minWidth: 0, fontSize: 10, color: C.text, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, mid),
|
|
1614
|
+
React.createElement('span', { title: '思考等级 effort 档:' + (eff ? (tmr.effConf[mid] ? '档位槽显式配置「' + eff + '」' : '模型默认档「' + eff + '」(list-models defaultEffort)') : '未指定(走模型默认档)'), style: { fontSize: 9, color: C.text2, flexShrink: 0 } }, eff || '—'),
|
|
1615
|
+
retired ? React.createElement('span', { title: '该模型已不在当前网关可用清单(list-models 目录无此 id)——可到「模型路由」弹层清理或替换', style: { fontSize: 9, color: C.err, fontWeight: 600, flexShrink: 0 } }, '⚠️已下架') : React.createElement('span', { title: (h && h.note) || '尚无健康信号', style: { fontSize: 9, color: meta.color, flexShrink: 0, cursor: 'help' } }, meta.label))
|
|
1616
|
+
}),
|
|
1617
|
+
mhData === null ? React.createElement('div', { style: { fontSize: 9, color: C.text2, marginTop: 6 } }, '健康信号读取中(get-tasks.modelHealth)…') : null,
|
|
1618
|
+
catModels === null ? React.createElement('div', { style: { fontSize: 9, color: C.text2, marginTop: 3 } }, '模型目录不可用:已下架判定与默认 effort 档关闭') : null),
|
|
1619
|
+
// ③ 最近完成:resolved 卡按 resolvedAt(兜底 verifiedAt)倒序 feed(带相对时间,点击进详情)。
|
|
1620
|
+
React.createElement('div', { style: zoneBox },
|
|
1621
|
+
zoneHead('check', '最近完成 (' + feed.length + ')', 'state.tasks 中 status=resolved 的卡按完成时间倒序取近 6 条(数据零新增采集);点击条目进任务详情'),
|
|
1622
|
+
feed.length === 0 ? React.createElement('div', { style: { fontSize: 10, color: C.text2 } }, '暂无已完成任务(Worker 提交验收、验收通过后出现在这里)') : feed.map(function (t) {
|
|
1623
|
+
var doneAt = t.resolvedAt || t.verifiedAt
|
|
1624
|
+
return React.createElement('div', { key: t.id, onClick: function () { state.detailId = t.id; state.view = 'board'; notify() }, title: (t.title || t.id) + '\n完成时间:' + healthTimeText(doneAt) + '(点击查看任务详情)', style: { display: 'flex', alignItems: 'center', gap: 4, padding: '5px 0', borderBottom: '1px solid ' + C.nested, cursor: 'pointer' } },
|
|
1625
|
+
React.createElement('span', { style: { flex: 1, minWidth: 0, fontSize: 10, color: C.text, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' } }, '✅ ' + (t.title || t.id)),
|
|
1626
|
+
React.createElement('span', { style: { fontSize: 9, color: C.text2, flexShrink: 0 } }, '· ' + ago(doneAt)))
|
|
1627
|
+
})),
|
|
1628
|
+
// ④ 资源水位:Worker/Verifier 并发水位条(poolStatus busy / 上限,与池状态条同口径)+
|
|
1629
|
+
// 本小时 token 消耗(run 留账按 at 归桶现算,水位对照今日峰值小时)+ 今日完成数。
|
|
1630
|
+
React.createElement('div', { style: zoneBox },
|
|
1631
|
+
zoneHead('bar-chart-3', '资源水位', 'Worker/Verifier 并发(poolStatus busy / 上限)· 本小时 token 消耗(run 留账现算,对照今日峰值小时)· 今日完成数(resolvedAt 过今日零点,与仪表盘统计卡同口径)'),
|
|
1632
|
+
waterRow('Worker 并发', wBusyN + ' / ' + wCap, pctOf(wBusyN, wCap), '在跑 Worker 数 / 并发上限(⚡ = 在跑)'),
|
|
1633
|
+
waterRow('Verifier 并发', vBusyN + ' / ' + vCap, pctOf(vBusyN, vCap), '在跑 Verifier 数 / 并发上限(拆解官在跑也占 Verifier 并发位)'),
|
|
1634
|
+
waterRow('本小时 token 消耗', hourTok.cur ? '~' + fmtTokens(hourTok.cur) : '暂无消耗', pctOf(hourTok.cur, hourTok.peak), '今日当前时钟小时(' + ('0' + new Date().getHours()).slice(-2) + ':00 起)run 留账 token 合计,总量口径(input+output+缓存读+缓存写,老 run 缺 total 时分量兜底);今日峰值小时 ' + (hourTok.peak ? fmtTokens(hourTok.peak) : '—') + ' · 今日合计 ' + fmtTokens(hourTok.today), C.warn),
|
|
1635
|
+
React.createElement('div', { style: { display: 'flex', justifyContent: 'space-between', fontSize: 10, color: C.text2 } },
|
|
1636
|
+
React.createElement('span', null, '今日完成任务'),
|
|
1637
|
+
React.createElement('span', { style: { color: C.text, fontWeight: 600 } }, todayN + ' 张')))))
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// ===== 执行池四区纯函数(task-mwndka2w):三区数据面全部「入参显式现算、零存储零采集」,行为级可测 =====
|
|
1641
|
+
// 模型清单:板级 ∪ 力度路由六槽 ∪ 备用链(与 host 侧 configuredModelIds 同口径去重保序);
|
|
1642
|
+
// 槽位两形态(string | {id,effort},task-mwkbo9z6)→ 每模型 effort 档(首个非空显式档优先);
|
|
1643
|
+
// 目录(list-models)非空才建 inCat/defEff 索引——null/空目录不标下架、不猜默认档(OrderedModelsEditor 同口径)。
|
|
1644
|
+
function teamModelRows(workerModel, verifierModel, laneModels, fallbackModels, catModels) {
|
|
1645
|
+
var occ = []
|
|
1646
|
+
function add(v) {
|
|
1647
|
+
var s = '', eff = ''
|
|
1648
|
+
if (typeof v === 'string') s = v.trim()
|
|
1649
|
+
else if (v && typeof v === 'object' && !Array.isArray(v) && typeof v.id === 'string') { s = v.id.trim(); if (typeof v.effort === 'string' && v.effort.trim()) eff = v.effort.trim() }
|
|
1650
|
+
if (s) occ.push({ id: s, eff: eff })
|
|
1651
|
+
}
|
|
1652
|
+
add(workerModel); add(verifierModel)
|
|
1653
|
+
if (laneModels && typeof laneModels === 'object' && !Array.isArray(laneModels)) {
|
|
1654
|
+
var lanes = ['light', 'standard', 'heavy']
|
|
1655
|
+
for (var i = 0; i < lanes.length; i++) {
|
|
1656
|
+
var lane = laneModels[lanes[i]] || {}
|
|
1657
|
+
for (var role in lane) {
|
|
1658
|
+
if (!Object.prototype.hasOwnProperty.call(lane, role)) continue
|
|
1659
|
+
var arr = lane[role]
|
|
1660
|
+
if (Array.isArray(arr)) for (var j = 0; j < arr.length; j++) add(arr[j])
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
if (Array.isArray(fallbackModels)) for (var f = 0; f < fallbackModels.length; f++) add(fallbackModels[f])
|
|
1665
|
+
var order = [], effConf = {}
|
|
1666
|
+
for (var k = 0; k < occ.length; k++) {
|
|
1667
|
+
var o = occ[k]
|
|
1668
|
+
if (!Object.prototype.hasOwnProperty.call(effConf, o.id)) { effConf[o.id] = o.eff; order.push(o.id) }
|
|
1669
|
+
else if (!effConf[o.id] && o.eff) effConf[o.id] = o.eff
|
|
1670
|
+
}
|
|
1671
|
+
var inCat = null, defEff = null
|
|
1672
|
+
if (catModels && catModels.length) {
|
|
1673
|
+
inCat = {}; defEff = {}
|
|
1674
|
+
for (var c = 0; c < catModels.length; c++) {
|
|
1675
|
+
var cm = catModels[c]
|
|
1676
|
+
if (cm && typeof cm.id === 'string' && cm.id) {
|
|
1677
|
+
inCat[cm.id] = 1
|
|
1678
|
+
if (typeof cm.defaultEffort === 'string' && cm.defaultEffort) defEff[cm.id] = cm.defaultEffort
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
return { order: order, effConf: effConf, inCat: inCat, defEff: defEff }
|
|
1683
|
+
}
|
|
1684
|
+
// 最近完成 feed:resolved 卡按 resolvedAt(兜底 verifiedAt)倒序取近 N 条(默认 6);
|
|
1685
|
+
// 点击进详情的交互在 TeamView 渲染层,本函数只管过滤排序切片。
|
|
1686
|
+
function teamDoneFeed(tasks, n) {
|
|
1687
|
+
var take = Number(n) > 0 ? Math.floor(Number(n)) : 6
|
|
1688
|
+
var list = Array.isArray(tasks) ? tasks : []
|
|
1689
|
+
var out = []
|
|
1690
|
+
for (var i = 0; i < list.length; i++) {
|
|
1691
|
+
var t = list[i]
|
|
1692
|
+
if (!t || t.status !== 'resolved' || !(t.resolvedAt || t.verifiedAt)) continue
|
|
1693
|
+
out.push(t)
|
|
1694
|
+
}
|
|
1695
|
+
out.sort(function (a, b) { return String(b.resolvedAt || b.verifiedAt || '').localeCompare(String(a.resolvedAt || a.verifiedAt || '')) })
|
|
1696
|
+
return out.slice(0, take)
|
|
1697
|
+
}
|
|
1698
|
+
// 本小时 token 消耗(资源水位):任务 run 留账(t.runs[].at + usage,总量口径、老 run 缺 total 时
|
|
1699
|
+
// 分量兜底求和)按今天的小时桶归集——cur=当前时钟小时,peak=今日峰值小时(水位条分母),
|
|
1700
|
+
// today=今日合计;非今日/无法解析/无 usage 的 run 一律不计(不伪造 0)。
|
|
1701
|
+
function teamHourTokens(tasks, now) {
|
|
1702
|
+
var n = (now instanceof Date) ? now : new Date()
|
|
1703
|
+
var buckets = {}, total = 0
|
|
1704
|
+
var list = Array.isArray(tasks) ? tasks : []
|
|
1705
|
+
for (var i = 0; i < list.length; i++) {
|
|
1706
|
+
var t = list[i]
|
|
1707
|
+
if (!t || !Array.isArray(t.runs)) continue
|
|
1708
|
+
for (var j = 0; j < t.runs.length; j++) {
|
|
1709
|
+
var r = t.runs[j]
|
|
1710
|
+
if (!r || !r.at) continue
|
|
1711
|
+
var at = new Date(r.at)
|
|
1712
|
+
if (isNaN(at.getTime())) continue
|
|
1713
|
+
if (at.getFullYear() !== n.getFullYear() || at.getMonth() !== n.getMonth() || at.getDate() !== n.getDate()) continue
|
|
1714
|
+
var u = (r.usage && typeof r.usage === 'object') ? r.usage : null
|
|
1715
|
+
var tok = 0
|
|
1716
|
+
if (u) {
|
|
1717
|
+
tok = Number(u.total) || 0
|
|
1718
|
+
if (!tok) tok = (Number(u.input) || 0) + (Number(u.output) || 0) + (Number(u.cacheRead) || 0) + (Number(u.cacheWrite) || 0)
|
|
1719
|
+
}
|
|
1720
|
+
if (!tok) continue
|
|
1721
|
+
var hk = at.getHours()
|
|
1722
|
+
buckets[hk] = (buckets[hk] || 0) + tok
|
|
1723
|
+
total += tok
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
var cur = buckets[n.getHours()] || 0, peak = 0
|
|
1727
|
+
for (var k in buckets) if (Object.prototype.hasOwnProperty.call(buckets, k) && buckets[k] > peak) peak = buckets[k]
|
|
1728
|
+
return { cur: cur, peak: peak, today: total }
|
|
1729
|
+
}
|
|
1730
|
+
// 今日完成数(资源水位):resolvedAt 过了今天本地零点的任务数(与仪表盘 computeStats 的
|
|
1731
|
+
// todayDone 同口径:只认 resolvedAt、不筛 status——驳回重投的卡 resolvedAt 已被置空,天然不计)。
|
|
1732
|
+
function teamTodayDone(tasks, now) {
|
|
1733
|
+
var n = (now instanceof Date) ? now : new Date()
|
|
1734
|
+
var start = new Date(n.getFullYear(), n.getMonth(), n.getDate())
|
|
1735
|
+
var list = Array.isArray(tasks) ? tasks : []
|
|
1736
|
+
var cnt = 0
|
|
1737
|
+
for (var i = 0; i < list.length; i++) {
|
|
1738
|
+
var t = list[i]
|
|
1739
|
+
if (!t || !t.resolvedAt) continue
|
|
1740
|
+
var d = new Date(t.resolvedAt)
|
|
1741
|
+
if (!isNaN(d.getTime()) && d >= start) cnt++
|
|
1742
|
+
}
|
|
1743
|
+
return cnt
|
|
1533
1744
|
}
|