dsh-config-sync-plugin 0.3.82 → 0.3.83
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/client.js +28 -8
- package/index.js +8 -3
- package/package.json +1 -1
- package/runtime/tools/workspace-view.mjs +44 -17
- package/tools/selftest.mjs +5 -5
package/client.js
CHANGED
|
@@ -504,7 +504,11 @@ window.__ModuleLoader__.load({
|
|
|
504
504
|
|
|
505
505
|
/** 工作区显示状态:三态(显示 / 隐藏会话 / 归档工作区)+ 会话级独立隐藏。 */
|
|
506
506
|
async function callWorkspaceView(payload, opts) {
|
|
507
|
-
|
|
507
|
+
// 两类默认折叠的会话各有一个开关:agents=1 放回智能体,blank=1 放回空会话。
|
|
508
|
+
const q = []
|
|
509
|
+
if (opts && opts.includeAgents) q.push('agents=1')
|
|
510
|
+
if (opts && opts.includeBlank) q.push('blank=1')
|
|
511
|
+
const query = q.length > 0 ? '?' + q.join('&') : ''
|
|
508
512
|
const res = await fetch('/config-sync/workspace-view' + query, payload
|
|
509
513
|
? {
|
|
510
514
|
method: 'POST',
|
|
@@ -1607,38 +1611,40 @@ window.__ModuleLoader__.load({
|
|
|
1607
1611
|
const [editing, setEditing] = react.useState({})
|
|
1608
1612
|
// 默认折叠智能体(subagent)会话:一屏全是子会话时根本找不到自己的会话。
|
|
1609
1613
|
const [showAgents, setShowAgents] = react.useState(false)
|
|
1614
|
+
// 默认折叠空会话:建了没聊过、或者只是 Mnemon 空闲审查的父容器,列出只会干扰。
|
|
1615
|
+
const [showBlank, setShowBlank] = react.useState(false)
|
|
1610
1616
|
|
|
1611
1617
|
const load = react.useCallback(async () => {
|
|
1612
1618
|
setBusy(true); setErr('')
|
|
1613
|
-
try { setData(await callWorkspaceView(null, { includeAgents: showAgents })) }
|
|
1619
|
+
try { setData(await callWorkspaceView(null, { includeAgents: showAgents, includeBlank: showBlank })) }
|
|
1614
1620
|
catch (e) { setErr(String((e && e.message) || e)) }
|
|
1615
1621
|
finally { setBusy(false) }
|
|
1616
|
-
}, [showAgents])
|
|
1622
|
+
}, [showAgents, showBlank])
|
|
1617
1623
|
react.useEffect(() => { load() }, [load])
|
|
1618
1624
|
|
|
1619
1625
|
const changeWorkspace = react.useCallback(async (wsId, state) => {
|
|
1620
1626
|
setBusy(true); setErr(''); setMsg('')
|
|
1621
1627
|
try {
|
|
1622
|
-
const d = await callWorkspaceView({ action: 'workspace', workspaceId: wsId, state, includeAgents: showAgents }, { includeAgents: showAgents })
|
|
1628
|
+
const d = await callWorkspaceView({ action: 'workspace', workspaceId: wsId, state, includeAgents: showAgents, includeBlank: showBlank }, { includeAgents: showAgents, includeBlank: showBlank })
|
|
1623
1629
|
setData(d)
|
|
1624
1630
|
setMsg(d.live === true
|
|
1625
1631
|
? M('已更新,会话列表已同步', 'Updated — the session list is in sync')
|
|
1626
1632
|
: M('已更新;宿主服务暂不可用,已直接写入状态文件', 'Updated; host service unavailable, wrote the state file directly'))
|
|
1627
1633
|
} catch (e) { setErr(String((e && e.message) || e)) }
|
|
1628
1634
|
finally { setBusy(false) }
|
|
1629
|
-
}, [showAgents])
|
|
1635
|
+
}, [showAgents, showBlank])
|
|
1630
1636
|
|
|
1631
1637
|
const changeSession = react.useCallback(async (sid, hidden) => {
|
|
1632
1638
|
setBusy(true); setErr(''); setMsg('')
|
|
1633
1639
|
try {
|
|
1634
|
-
const d = await callWorkspaceView({ action: 'session', sessionId: sid, hidden, includeAgents: showAgents }, { includeAgents: showAgents })
|
|
1640
|
+
const d = await callWorkspaceView({ action: 'session', sessionId: sid, hidden, includeAgents: showAgents, includeBlank: showBlank }, { includeAgents: showAgents, includeBlank: showBlank })
|
|
1635
1641
|
setData(d)
|
|
1636
1642
|
setMsg(d.live === true
|
|
1637
1643
|
? M('已更新,会话列表已同步', 'Updated — the session list is in sync')
|
|
1638
1644
|
: M('已更新;宿主服务暂不可用,已直接写入状态文件', 'Updated; host service unavailable, wrote the state file directly'))
|
|
1639
1645
|
} catch (e) { setErr(String((e && e.message) || e)) }
|
|
1640
1646
|
finally { setBusy(false) }
|
|
1641
|
-
}, [showAgents])
|
|
1647
|
+
}, [showAgents, showBlank])
|
|
1642
1648
|
|
|
1643
1649
|
const stateLabel = (st) => st === 'archive' ? M('归档', 'Archived')
|
|
1644
1650
|
: st === 'hide-sessions' ? M('隐藏会话', 'Sessions hidden')
|
|
@@ -1661,11 +1667,24 @@ window.__ModuleLoader__.load({
|
|
|
1661
1667
|
const wss = data.workspaces || []
|
|
1662
1668
|
const archived = wss.filter(w => w.state === 'archive').length
|
|
1663
1669
|
const agentHidden = Number(data.agentHidden || 0)
|
|
1670
|
+
const blankHidden = Number(data.blankHidden || 0)
|
|
1664
1671
|
return h('div', { style: S.card },
|
|
1665
1672
|
h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' } },
|
|
1666
1673
|
h('div', { style: S.cardTitle }, M('工作区显示状态', 'Workspace visibility')),
|
|
1667
1674
|
h('div', { style: { ...S.hint, flex: 1, minWidth: '160px' } },
|
|
1668
1675
|
M('点工作区展开会话;点「修改」后才可切换状态。改动即时生效,会话列表会跟着变。', 'Click a workspace to expand sessions; click Edit to change states. Changes apply immediately and the session list follows.')),
|
|
1676
|
+
h('label', {
|
|
1677
|
+
style: { display: 'inline-flex', alignItems: 'center', gap: '4px', fontSize: '12px', color: 'var(--dsw-alias-label-secondary)', cursor: 'pointer' },
|
|
1678
|
+
title: M('默认隐藏空会话(没跑过对话的历史条目)与 Mnemon 空闲审查的父容器,勾选后一并列出', 'Blank sessions (never used) and Mnemon idle-review parents are hidden by default; tick to list them too'),
|
|
1679
|
+
},
|
|
1680
|
+
h('input', {
|
|
1681
|
+
type: 'checkbox',
|
|
1682
|
+
checked: showBlank,
|
|
1683
|
+
disabled: busy,
|
|
1684
|
+
onChange: (e) => setShowBlank(e.target.checked === true),
|
|
1685
|
+
}),
|
|
1686
|
+
h('span', null, M('显示空会话', 'Show blank')),
|
|
1687
|
+
),
|
|
1669
1688
|
h('label', {
|
|
1670
1689
|
style: { display: 'inline-flex', alignItems: 'center', gap: '4px', fontSize: '12px', color: 'var(--dsw-alias-label-secondary)', cursor: 'pointer' },
|
|
1671
1690
|
title: M('默认隐藏智能体(subagent)会话,勾选后一并列出', 'Agent (subagent) sessions are hidden by default; tick to list them too'),
|
|
@@ -1684,7 +1703,8 @@ window.__ModuleLoader__.load({
|
|
|
1684
1703
|
err ? h('div', { style: { ...S.hint, color: 'var(--dsw-alias-state-error-primary)' } }, err) : null,
|
|
1685
1704
|
h('div', { style: S.footnote },
|
|
1686
1705
|
M('共 ' + wss.length + ' 个工作区,' + archived + ' 个已归档;归档的工作区会从列表消失,会话仍保留。', wss.length + ' workspaces, ' + archived + ' archived; archived ones disappear from the list, sessions are kept.')
|
|
1687
|
-
+ (agentHidden > 0 && !showAgents ? M('已隐藏 ' + agentHidden + ' 条智能体会话。', ' ' + agentHidden + ' agent sessions hidden.') : '')
|
|
1706
|
+
+ (agentHidden > 0 && !showAgents ? M('已隐藏 ' + agentHidden + ' 条智能体会话。', ' ' + agentHidden + ' agent sessions hidden.') : '')
|
|
1707
|
+
+ (blankHidden > 0 && !showBlank ? M('已隐藏 ' + blankHidden + ' 条空会话(含空闲审查父容器)。', ' ' + blankHidden + ' blank sessions hidden (incl. idle-review parents).') : '')),
|
|
1688
1708
|
wss.length === 0
|
|
1689
1709
|
? h('div', { style: S.footnote }, M('没有工作区。', 'No workspaces.'))
|
|
1690
1710
|
: h('div', { style: { display: 'flex', flexDirection: 'column', gap: '6px', marginTop: '2px' } },
|
package/index.js
CHANGED
|
@@ -4234,12 +4234,16 @@ async function handleCacheGuard(req, res, config) {
|
|
|
4234
4234
|
// 0.3.76:工作区显示状态。自包含读写,不依赖 session-manager API(那个要 owner 凭证)。
|
|
4235
4235
|
// 0.3.82:改成优先走 workspaceRegistry(宿主服务)→ 落盘同时触发 session-list feed,
|
|
4236
4236
|
// 面板上切隐藏/显示即时生效;拿不到 registry 时函数内部退回纯文件写法(live:false)。
|
|
4237
|
+
// 0.3.83:视图默认多折叠一类「空会话」(创建后没发过消息、也没跑过 turn),
|
|
4238
|
+
// 以及 Mnemon 空闲审查的父容器(它只有 subagent/catalog,按空会话判定),
|
|
4239
|
+
// 面板不会再列出一堆空白条目。`?agents=1` / `?blank=1` 分别把两类放回来。
|
|
4237
4240
|
async function handleWorkspaceView(req, res, config) {
|
|
4238
4241
|
const dshHome = dshHomeOf(config)
|
|
4239
4242
|
const registry = workspaceRegistryOf()
|
|
4240
4243
|
const includeAgents = Boolean(req.url && /[?&]agents=1\b/.test(req.url))
|
|
4244
|
+
const includeBlank = Boolean(req.url && /[?&]blank=1\b/.test(req.url))
|
|
4241
4245
|
if (req.method === 'GET') {
|
|
4242
|
-
try { sendJson(res, 200, { ok: true, ...readView(dshHome, { includeAgents }) }) }
|
|
4246
|
+
try { sendJson(res, 200, { ok: true, ...readView(dshHome, { includeAgents, includeBlank }) }) }
|
|
4243
4247
|
catch (error) { sendJson(res, 400, { ok: false, error: String((error && error.message) || error) }) }
|
|
4244
4248
|
return
|
|
4245
4249
|
}
|
|
@@ -4250,13 +4254,14 @@ async function handleWorkspaceView(req, res, config) {
|
|
|
4250
4254
|
const body = raw.trim() ? JSON.parse(raw) : {}
|
|
4251
4255
|
const action = String(body.action || '')
|
|
4252
4256
|
const withAgents = body.includeAgents === true
|
|
4257
|
+
const withBlank = body.includeBlank === true
|
|
4253
4258
|
if (action === 'workspace') {
|
|
4254
|
-
const view = await setWorkspaceStateLive(dshHome, String(body.workspaceId || ''), String(body.state || ''), { registry, includeAgents: withAgents })
|
|
4259
|
+
const view = await setWorkspaceStateLive(dshHome, String(body.workspaceId || ''), String(body.state || ''), { registry, includeAgents: withAgents, includeBlank: withBlank })
|
|
4255
4260
|
sendJson(res, 200, { ok: true, ...view })
|
|
4256
4261
|
return
|
|
4257
4262
|
}
|
|
4258
4263
|
if (action === 'session') {
|
|
4259
|
-
const view = await setSessionStateLive(dshHome, String(body.sessionId || ''), body.hidden === true, { registry, includeAgents: withAgents })
|
|
4264
|
+
const view = await setSessionStateLive(dshHome, String(body.sessionId || ''), body.hidden === true, { registry, includeAgents: withAgents, includeBlank: withBlank })
|
|
4260
4265
|
sendJson(res, 200, { ok: true, ...view })
|
|
4261
4266
|
return
|
|
4262
4267
|
}
|
package/package.json
CHANGED
|
@@ -117,17 +117,18 @@ function cleanTitle(text) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
121
|
-
* origin 取自日志首个 `session` 头事件:`subagent`
|
|
122
|
-
*
|
|
120
|
+
* 从单个会话日志文件提取标题、来源与空会话标记。返回 {title, origin, blank} 并写入缓存。
|
|
121
|
+
* origin 取自日志首个 `session` 头事件:`subagent` 表示智能体(子)会话;
|
|
122
|
+
* blank 表示从没跑过对话(没有 turn/start、没有首条用户消息)。
|
|
123
|
+
* 面板「工作区显示」卡片默认把这两类都折叠掉,只留用户自己真正聊过的会话。
|
|
123
124
|
*/
|
|
124
125
|
function titleFromFile(file) {
|
|
125
126
|
let mtime = 0
|
|
126
|
-
try { mtime = fs.statSync(file).mtimeMs } catch { return { title: '', origin: '' } }
|
|
127
|
+
try { mtime = fs.statSync(file).mtimeMs } catch { return { title: '', origin: '', blank: false } }
|
|
127
128
|
const key = `${file}:${mtime}`
|
|
128
129
|
const hit = TITLE_CACHE.get(key)
|
|
129
130
|
if (hit) return hit
|
|
130
|
-
let result = { title: '', origin: '' }
|
|
131
|
+
let result = { title: '', origin: '', blank: false }
|
|
131
132
|
try {
|
|
132
133
|
const buf = fs.readFileSync(file)
|
|
133
134
|
let text = ''
|
|
@@ -145,6 +146,7 @@ function titleFromFile(file) {
|
|
|
145
146
|
let anyTitle = '' // 无 source 信息的兜底标题(取最后一条)
|
|
146
147
|
let firstUserText = ''
|
|
147
148
|
let origin = '' // 会话来源:subagent = 智能体子会话
|
|
149
|
+
let sawTurn = false // 出现过 turn/start:真正跑过对话
|
|
148
150
|
for (const line of text.split('\n')) {
|
|
149
151
|
if (!line) continue
|
|
150
152
|
let ev
|
|
@@ -153,6 +155,7 @@ function titleFromFile(file) {
|
|
|
153
155
|
if (typeof ev.origin === 'string') origin = ev.origin
|
|
154
156
|
else if (ev.data && typeof ev.data.origin === 'string') origin = ev.data.origin
|
|
155
157
|
}
|
|
158
|
+
if (ev.type === 'turn/start') sawTurn = true
|
|
156
159
|
if (ev.type === 'session/title' && ev.data && typeof ev.data.title === 'string') {
|
|
157
160
|
const kind = ev.data.source && ev.data.source.kind
|
|
158
161
|
if (kind === 'provider') providerTitle = ev.data.title
|
|
@@ -172,9 +175,12 @@ function titleFromFile(file) {
|
|
|
172
175
|
result = {
|
|
173
176
|
title: cleanTitle(providerTitle) || cleanTitle(fallbackTitle) || cleanTitle(anyTitle) || cleanTitle(firstUserText),
|
|
174
177
|
origin,
|
|
178
|
+
// 空会话:从没跑过对话(没有 turn/start,也没有首条用户消息)。DSH 自己也算 blank,
|
|
179
|
+
// 这里独立算一遍,因为面板要据此把「新建了没发消息」的会话藏起来。
|
|
180
|
+
blank: !sawTurn && !firstUserText,
|
|
175
181
|
}
|
|
176
182
|
} catch {
|
|
177
|
-
result = { title: '', origin: '' }
|
|
183
|
+
result = { title: '', origin: '', blank: false }
|
|
178
184
|
}
|
|
179
185
|
if (TITLE_CACHE.size > 400) TITLE_CACHE.clear()
|
|
180
186
|
TITLE_CACHE.set(key, result)
|
|
@@ -206,21 +212,31 @@ function buildSessionLogIndex(dshHome) {
|
|
|
206
212
|
|
|
207
213
|
/**
|
|
208
214
|
* 读视图:列出所有工作区 + 每个工作区下会话的隐藏状态 + 三态归一化 + 会话名称。
|
|
209
|
-
*
|
|
210
|
-
*
|
|
215
|
+
* 默认只留用户自己真正聊过的会话,折叠两类会话:
|
|
216
|
+
* ① 智能体会话(origin === 'subagent');
|
|
217
|
+
* ② 空会话(blank:从没跑过对话)。
|
|
218
|
+
* options.includeAgents=true 时把智能体也算进来;options.includeBlank=true 时把空会话也算进来。
|
|
219
|
+
* 三态与计数都只按保留下来的会话计算。
|
|
220
|
+
*
|
|
221
|
+
* 「Mnemon 空闲审查」的父容器(mnemon-review-owner-v1-*)被一并折叠:
|
|
222
|
+
* 它自己的 header 没有 origin(不是 subagent),但日志里只有一个 subagent/catalog
|
|
223
|
+
* 事件、没有 turn/start,因此按空会话判定隐藏;真正的审查内容在它指向的
|
|
224
|
+
* mnemon-review-v1-* 子会话里,那个带 origin=subagent,属于第 ① 类。
|
|
211
225
|
*/
|
|
212
226
|
export function readView(dshHome, options = {}) {
|
|
213
227
|
const includeAgents = options.includeAgents === true
|
|
228
|
+
const includeBlank = options.includeBlank === true
|
|
214
229
|
const ws = readJson(workspacePath(dshHome))
|
|
215
230
|
const arch = readJson(archivePath(dshHome))
|
|
216
231
|
if (!ws || !ws.tables || !ws.tables.workspaces) {
|
|
217
|
-
return { ok: true, available: false, workspaces: [], includeAgents, agentHidden: 0 }
|
|
232
|
+
return { ok: true, available: false, workspaces: [], includeAgents, includeBlank, agentHidden: 0, blankHidden: 0 }
|
|
218
233
|
}
|
|
219
234
|
const globalArchived = new Set(Array.isArray(ws.global?.archivedSessionIds) ? ws.global.archivedSessionIds : [])
|
|
220
235
|
const archMap = (arch && arch.workspaces && typeof arch.workspaces === 'object') ? arch.workspaces : {}
|
|
221
236
|
const logIndex = buildSessionLogIndex(dshHome)
|
|
222
237
|
const workspaces = []
|
|
223
238
|
let totalAgents = 0
|
|
239
|
+
let totalBlank = 0
|
|
224
240
|
for (const [wsId, rec] of Object.entries(ws.tables.workspaces)) {
|
|
225
241
|
if (!rec || typeof rec !== 'object') continue
|
|
226
242
|
const sessionIds = Array.isArray(rec.sessionIds) ? rec.sessionIds.slice() : []
|
|
@@ -228,12 +244,22 @@ export function readView(dshHome, options = {}) {
|
|
|
228
244
|
const workspaceArchived = Boolean(archRec && archRec.archived === true)
|
|
229
245
|
const all = sessionIds.map((sid) => {
|
|
230
246
|
const log = logIndex.get(sid)
|
|
231
|
-
const meta = log ? titleFromFile(log) : { title: '', origin: '' }
|
|
232
|
-
return {
|
|
247
|
+
const meta = log ? titleFromFile(log) : { title: '', origin: '', blank: false }
|
|
248
|
+
return {
|
|
249
|
+
id: sid,
|
|
250
|
+
title: meta.title,
|
|
251
|
+
hidden: globalArchived.has(sid),
|
|
252
|
+
agent: meta.origin === 'subagent',
|
|
253
|
+
blank: meta.blank === true,
|
|
254
|
+
}
|
|
233
255
|
})
|
|
234
256
|
const agentCount = all.filter((s) => s.agent).length
|
|
257
|
+
const blankCount = all.filter((s) => !s.agent && s.blank).length
|
|
235
258
|
totalAgents += agentCount
|
|
236
|
-
|
|
259
|
+
totalBlank += blankCount
|
|
260
|
+
// 两道过滤独立生效:智能体一类、空会话一类。
|
|
261
|
+
let sessions = includeAgents ? all : all.filter((s) => !s.agent)
|
|
262
|
+
if (!includeBlank) sessions = sessions.filter((s) => !s.blank)
|
|
237
263
|
const hiddenCount = sessions.filter((s) => s.hidden).length
|
|
238
264
|
let state = 'normal'
|
|
239
265
|
if (workspaceArchived) state = 'archive'
|
|
@@ -246,13 +272,14 @@ export function readView(dshHome, options = {}) {
|
|
|
246
272
|
sessionCount: sessions.length,
|
|
247
273
|
hiddenCount,
|
|
248
274
|
agentCount,
|
|
275
|
+
blankCount,
|
|
249
276
|
state,
|
|
250
277
|
archived: workspaceArchived,
|
|
251
278
|
archivedAt: workspaceArchived && typeof archRec.archivedAt === 'number' ? archRec.archivedAt : 0,
|
|
252
279
|
sessions,
|
|
253
280
|
})
|
|
254
281
|
}
|
|
255
|
-
return { ok: true, available: true, workspaces, includeAgents, agentHidden: totalAgents }
|
|
282
|
+
return { ok: true, available: true, workspaces, includeAgents, includeBlank, agentHidden: totalAgents, blankHidden: totalBlank }
|
|
256
283
|
}
|
|
257
284
|
|
|
258
285
|
/** 切换一个工作区的三态。state ∈ normal | hide-sessions | archive。 */
|
|
@@ -373,7 +400,7 @@ function withRegistryHidden(view, registry) {
|
|
|
373
400
|
* options.registry 传宿主 workspaceRegistry;传 null/undefined 时退回文件写法。
|
|
374
401
|
*/
|
|
375
402
|
export async function setWorkspaceStateLive(dshHome, workspaceId, state, options = {}) {
|
|
376
|
-
const { registry = null, includeAgents = false } = options
|
|
403
|
+
const { registry = null, includeAgents = false, includeBlank = false } = options
|
|
377
404
|
if (!['normal', 'hide-sessions', 'archive'].includes(state)) {
|
|
378
405
|
throw new Error(`不支持的工作区状态:${state}`)
|
|
379
406
|
}
|
|
@@ -426,16 +453,16 @@ export async function setWorkspaceStateLive(dshHome, workspaceId, state, options
|
|
|
426
453
|
return { ...fallback, live: false, fallbackFrom: 'registry', stopped, errors }
|
|
427
454
|
}
|
|
428
455
|
void results
|
|
429
|
-
return { ...withRegistryHidden(readView(dshHome, { includeAgents }), registry), live: true, stopped }
|
|
456
|
+
return { ...withRegistryHidden(readView(dshHome, { includeAgents, includeBlank }), registry), live: true, stopped }
|
|
430
457
|
}
|
|
431
458
|
|
|
432
459
|
/** 实时隐藏/显示单个会话。 */
|
|
433
460
|
export async function setSessionStateLive(dshHome, sessionId, hidden, options = {}) {
|
|
434
|
-
const { registry = null, includeAgents = false } = options
|
|
461
|
+
const { registry = null, includeAgents = false, includeBlank = false } = options
|
|
435
462
|
const live = Boolean(registry && typeof registry.archiveSession === 'function')
|
|
436
463
|
if (!live) {
|
|
437
464
|
return { ...setSessionState(dshHome, sessionId, hidden), live: false }
|
|
438
465
|
}
|
|
439
466
|
const r = await applySessionState(registry, sessionId, hidden)
|
|
440
|
-
return { ...withRegistryHidden(readView(dshHome, { includeAgents }), registry), live: true, stopped: r.stopped ? 1 : 0 }
|
|
467
|
+
return { ...withRegistryHidden(readView(dshHome, { includeAgents, includeBlank }), registry), live: true, stopped: r.stopped ? 1 : 0 }
|
|
441
468
|
}
|
package/tools/selftest.mjs
CHANGED
|
@@ -1626,18 +1626,18 @@ console.log('== 0.3.82:工作区显示卡片折叠智能体 + 隐藏/显示即
|
|
|
1626
1626
|
|
|
1627
1627
|
// 1) 智能体折叠:标题提取同时给出 origin,readView 支持 includeAgents 过滤
|
|
1628
1628
|
check('智能体折叠:titleFromFile 同时返回 origin',
|
|
1629
|
-
wvSrc.includes("let result = { title: '', origin: '' }")
|
|
1629
|
+
wvSrc.includes("let result = { title: '', origin: '', blank: false }")
|
|
1630
1630
|
&& wvSrc.includes('if (!origin && ev.type === \'session\')')
|
|
1631
1631
|
&& wvSrc.includes('origin,'), 'workspace-view.mjs 的头事件解析')
|
|
1632
1632
|
check('智能体折叠:readView 默认过滤 origin=subagent 并回报 agentHidden',
|
|
1633
1633
|
wvSrc.includes('const includeAgents = options.includeAgents === true')
|
|
1634
1634
|
&& wvSrc.includes("agent: meta.origin === 'subagent'")
|
|
1635
|
-
&& wvSrc.includes('
|
|
1635
|
+
&& wvSrc.includes('let sessions = includeAgents ? all : all.filter((s) => !s.agent)')
|
|
1636
1636
|
&& wvSrc.includes('agentHidden: totalAgents'), 'workspace-view.mjs 的 readView')
|
|
1637
1637
|
check('智能体折叠:卡片默认不显示、可勾选「显示智能体」',
|
|
1638
1638
|
cliSrc.includes('const [showAgents, setShowAgents] = react.useState(false)')
|
|
1639
1639
|
&& cliSrc.includes("M('显示智能体', 'Show agents')")
|
|
1640
|
-
&& cliSrc.includes(
|
|
1640
|
+
&& cliSrc.includes("q.push('agents=1')"), 'client.js 的勾选框')
|
|
1641
1641
|
|
|
1642
1642
|
// 2) 即时生效:走 workspaceRegistry 而不是直接改文件
|
|
1643
1643
|
check('即时生效:workspace-view 导出实时通道两函数',
|
|
@@ -1653,7 +1653,7 @@ console.log('== 0.3.82:工作区显示卡片折叠智能体 + 隐藏/显示即
|
|
|
1653
1653
|
check('即时生效:路由改用 Live 版本并透传 registry',
|
|
1654
1654
|
idxSrc.includes("import { setWorkspaceStateLive, setSessionStateLive } from './runtime/tools/workspace-view.mjs'")
|
|
1655
1655
|
&& idxSrc.includes('await setWorkspaceStateLive(') && idxSrc.includes('await setSessionStateLive(')
|
|
1656
|
-
&& idxSrc.includes('{ registry, includeAgents: withAgents }'), 'index.js 的 handleWorkspaceView')
|
|
1656
|
+
&& idxSrc.includes('{ registry, includeAgents: withAgents, includeBlank: withBlank }'), 'index.js 的 handleWorkspaceView')
|
|
1657
1657
|
check('即时生效:registry 拿不到时退回文件写法并标记 live:false',
|
|
1658
1658
|
wvSrc.includes('return { ...setWorkspaceState(dshHome, workspaceId, state), live: false }')
|
|
1659
1659
|
&& wvSrc.includes("live: false, fallbackFrom: 'registry'"), 'workspace-view.mjs 的降级')
|
|
@@ -1671,7 +1671,7 @@ console.log('== 配置同步页面 5 点调整 ==')
|
|
|
1671
1671
|
check('会话名称:工具从 session 日志提取 title 并随 readView 返回',
|
|
1672
1672
|
wvSrc.includes('zstdDecompressSync') && wvSrc.includes('buildSessionLogIndex')
|
|
1673
1673
|
&& wvSrc.includes("'session/title'") && wvSrc.includes('title: rec.title || wsId')
|
|
1674
|
-
&& wvSrc.includes("const meta = log ? titleFromFile(log) : { title: '', origin: '' }"), 'workspace-view.mjs 的标题提取')
|
|
1674
|
+
&& wvSrc.includes("const meta = log ? titleFromFile(log) : { title: '', origin: '', blank: false }"), 'workspace-view.mjs 的标题提取')
|
|
1675
1675
|
check('会话名称:与 DSH 面板一致——优先 provider 正式标题,不再取第一条 fallback',
|
|
1676
1676
|
wvSrc.includes('providerTitle') && wvSrc.includes("kind === 'provider'")
|
|
1677
1677
|
&& wvSrc.includes('cleanTitle(providerTitle) || cleanTitle(fallbackTitle)')
|