Compare commits
No commits in common. "8752b4386018e0f2bf907d4e2ba04d9ff2fe4f74" and "f917dd3970e2808f45896e97d546d00fd40c34e5" have entirely different histories.
8752b43860
...
f917dd3970
|
|
@ -56,8 +56,7 @@ HTTP 处理器端到端;systemPrompt 只注入十席;Web 纯视图模型(
|
|||
- 点「启用此项目的十席」→ 宿主真实建成 10 个独立 root session:项目 ready、10 席 bound、failed=0、无报错。✅
|
||||
- 重启 DSH 进程后重开:仍「10 个角色 · 10 个会话」、无「启用」按钮、10 个会话 ID 互不相同 → 持久化与幂等通过,重启不重复建会话。✅
|
||||
- 入口按用户要求移到“新会话”行右侧(`sidebar.session.action`),不再占底部;每个部门卡片统一为与丞相一致的蓝色边框,三省/六部仅保留文字分组标题。✅
|
||||
- 新增「全部汇报职责」入口:点开逐条列出十席各自职责与所用模型;冒烟测试连跑 3 轮,每轮十席 10/10 正常汇报、0 console 报错。✅
|
||||
- 每席模型独立显示:演示中礼部配置为 gemini 3.8flash(本机无该模型路由,仅配置展示、不可真跑),其余九席为 deepseek-v4.1-flash。✅
|
||||
- 新增「全部汇报职责」入口:点开逐条列出十席各自职责;冒烟测试连跑 3 轮,每轮十席 10/10 职责正常汇报、0 console 报错。✅
|
||||
- 工作台进入真实右侧 dock(`inDock=true`、非浮动面板),无 console 报错。✅
|
||||
- 点角色(工部)→ 真机切到该席独立会话(提示“已切换到工部会话”),无报错。✅
|
||||
|
||||
|
|
@ -67,17 +66,6 @@ HTTP 处理器端到端;systemPrompt 只注入十席;Web 纯视图模型(
|
|||
|
||||
仍未验证(不能宣称完成):dsh-go 手机 App 原生面板(第 4 步,需真实客户端/设备);运行中改模型即时生效;双真实项目联调;第 5 步打包发布。
|
||||
|
||||
## 实测发现:插件建的会话不进“左侧工作区会话列表”(待修)
|
||||
|
||||
用隔离测试 DSH 实测(1440 宽、整页重载、并已对每席 rename 标题):
|
||||
|
||||
- 会话确实创建并注册:`DSH_HOME/sessions/<默认工作区路径哈希>/<会话ID>/session.v4.jsonl.zstd`;`storages/workspace.json` 的 `sessionIds` 里十席齐全。
|
||||
- 但左侧“工作区 / 默认工作区”列表**不显示**这些会话(DOM 中带 `data-session-id` 的元素数 = 0),给会话写标题也无济于事。
|
||||
- 源码级根因(`@deepseek-ai/dsh-client-ui-workspace`):工作区会话树用 `orderByRecency(sessionIds, summaries)` 渲染,**没有 `summaries[id]` 的会话被直接跳过**;极简 web 侧栏只出现了当前被 retained 的一条(工部),其余 9 个冷会话没有被同步进客户端 session summaries。
|
||||
- 已尝试并无效:给每席会话 `resolveAgent` 预热 + `rename` 写标题,仍不进该极简侧栏(`data-row-key^=session:` 仍只有 1 条)。这说明是**客户端 session 列表同步**层面的问题,不是简单建会话就能解决。
|
||||
- 判断:日常桌面版的侧栏更完整(含 better-sidebar 等),很可能能正常列出;极简 web 测试 profile 的侧栏只是“当前会话”。真正验收应到桌面版(C)。
|
||||
- 另:真实对话内容还需模型;隔离环境无可用模型路由(gemini 不存在,deepseek-v4.1-flash 仅属于当前会话进程)。
|
||||
|
||||
## 未改动
|
||||
|
||||
未安装到任何 DSH profile,未修改用户日常 DSH、node_modules 或全局默认模型。
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
# 十席职责汇报(本会话模型实跑)
|
||||
|
||||
日期:2026-11-15。方式:以三省六部十席各自身份,用本会话所用模型分别独立跑一次(10 次独立角色调用),
|
||||
每席第一人称汇报自己的职责。下方为各席原话。
|
||||
|
||||
> 说明:这是用本会话的模型做的角色演练;隔离测试 DSH 本身未配置模型,插件内那十个会话因此仍为空。
|
||||
> 二者不混淆:会话与绑定是插件真实能力,下面是同一模型分别“扮”十席得到的汇报。
|
||||
|
||||
| 部门 | 汇报(原话) |
|
||||
|---|---|
|
||||
| 丞相 | 我是丞相,负责面向用户承接想法:判断这件事是否需要开工,需要时把活派给具体部门,最后把各部门的结果汇总成一次交付给您。我不亲自下场做各部门的具体执行,也不越过它们去替部门定方案、改产物;我的边界是判断、分派与汇总。 |
|
||||
| 中书 | 我是中书。我负责先把问题问清、把材料看全,再给出可执行的方案与验收标准草案,理清目标、约束和路径,供后续环节推进。我不直接产出最终交付物,也不越界替其他环节把活干完或替用户拍板。 |
|
||||
| 尚书 | 我是尚书。我的职责是把已经明确的方案拆解为部门分工,并组织六部完成交付。我不参与方案的决策与改动,也不介入六部内部的执行细节;六部直属于尚书这个同级分组,六部之间是并列关系,并非上下级。 |
|
||||
| 门下 | 我是门下。我负责对方案和交付做独立审议,逐项指出风险与不达标之处,并坚持:首版未经门下审核的任务必须如实标注“未审核”。我不参与具体方案设计与实施执行,也不替代任何一部做决策或背书。 |
|
||||
| 吏部 | 我是吏部,负责就角色设置、技能配备与编制安排提出建议。我只做建议、不代为决策,也明确不绕过用户授权去改动权限或任何其他项目设置。 |
|
||||
| 户部 | 我是户部,负责本项目中的数据、表格与计算工作,凡经我手的账目、口径与结论都须可复算、可追溯。我只做分内的数算与核对,不出方案、不定调子。 |
|
||||
| 礼部 | 我是礼部,在本项目中负责文档、内容与呈现形式,并产出可编辑的源文件。我不参与非文档类事务的决策与执行。 |
|
||||
| 兵部 | 我是兵部,专司环境、调试与部署一类事务。部署、发布这类会对外产生副作用的操作,我一律服从用户授权与宿主审批。 |
|
||||
| 刑部 | 我是刑部,负责本项目的测试与风险检查,给出可追溯、可复核的检查结果,而不是一句“已通过”就交差。 |
|
||||
| 工部 | 我是工部,负责代码实现与工程产出,交付可编辑的源文件和真实的检查结果。需求定夺、方案裁决与最终验收不在我的职责内。 |
|
||||
|
|
@ -97,53 +97,10 @@ async function main() {
|
|||
items: Array.from(document.querySelectorAll('.ssw-report-item')).map(el => ({
|
||||
seat: el.getAttribute('data-seat'),
|
||||
name: el.querySelector('strong')?.innerText?.trim() ?? null,
|
||||
model: el.querySelector('.ssw-report-model')?.innerText?.trim() ?? null,
|
||||
text: el.querySelector('.ssw-report-text')?.innerText?.trim() ?? null,
|
||||
})),
|
||||
}))()`)
|
||||
await shot('live-05-report.png')
|
||||
try {
|
||||
await evaluate("(() => { const el = document.querySelector('.ssw-report-item[data-seat=lipu]'); if (el) { el.scrollIntoView({ block: 'center' }); return true } return false })()")
|
||||
await sleep(500)
|
||||
await shot('live-06-report-lipu.png')
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const oi = process.argv.indexOf('--open')
|
||||
if (oi >= 0) {
|
||||
const seatId = process.argv[oi + 1]
|
||||
const order = { lead: 0, zhongshu: 1, shangshu: 2, menxia: 3, libu: 4, hubu: 5, lipu: 6, bingbu: 7, xingbu: 8, gongbu: 9 }
|
||||
const idx = order[seatId]
|
||||
if (idx !== undefined) {
|
||||
const clicked = await evaluate(`(() => { const s = document.querySelectorAll('.ssw-seat'); if (s[${idx}]) { s[${idx}].click(); return true } return false })()`)
|
||||
const noticeEarly = await evaluate("document.querySelector('.ssw-notice')?.innerText?.trim() ?? null")
|
||||
await sleep(1800)
|
||||
result.open = await evaluate(`(() => ({
|
||||
mainText: (document.querySelector('main')?.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 320),
|
||||
composer: (document.querySelector('.composer')?.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 120),
|
||||
title: document.title,
|
||||
}))()`)
|
||||
result.open.seatId = seatId
|
||||
result.open.clicked = clicked
|
||||
result.open.noticeEarly = noticeEarly
|
||||
await shot('live-07-' + seatId + '-session.png')
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv.includes('--each')) {
|
||||
result.each = []
|
||||
const n = await evaluate("document.querySelectorAll('.ssw-seat').length")
|
||||
for (let i = 0; i < n; i++) {
|
||||
await evaluate(`(() => { const s = document.querySelectorAll('.ssw-seat'); if (s[${i}]) s[${i}].click(); return true })()`)
|
||||
await sleep(1200)
|
||||
const info = await evaluate(`(() => ({
|
||||
name: document.querySelector('.ssw-current-name')?.innerText?.trim() ?? null,
|
||||
notice: document.querySelector('.ssw-notice')?.innerText?.trim() ?? null,
|
||||
selected: document.querySelector('.ssw-seat[aria-pressed=true] .ssw-role-name')?.innerText?.trim() ?? null,
|
||||
}))()`)
|
||||
await shot('seat-' + String(i + 1).padStart(2, '0') + '.png')
|
||||
result.each.push({ i: i + 1, ...info })
|
||||
}
|
||||
}
|
||||
|
||||
if (process.argv.includes('--seat')) {
|
||||
|
|
@ -173,8 +130,7 @@ async function main() {
|
|||
}
|
||||
}
|
||||
result.pass = !!(result.entry?.found && result.workbench?.found && (result.workbench?.seatCount === 10 || result.workbench?.enableText)
|
||||
&& (!process.argv.includes('--report') || (result.report?.count === 10 && result.report.items.every(it => it.name && it.text)))
|
||||
&& (!process.argv.includes('--each') || result.each?.length === 10))
|
||||
&& (!process.argv.includes('--report') || (result.report?.count === 10 && result.report.items.every(it => it.name && it.text))))
|
||||
}
|
||||
|
||||
try { await main() } catch (error) { result.fatal = String(error?.stack ?? error) } finally { try { ws?.close() } catch {}; try { browser?.kill() } catch {} }
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
import fs from 'node:fs'
|
||||
const text = fs.readFileSync(process.argv[2], 'utf8')
|
||||
console.log('LEN', text.length)
|
||||
for (const key of process.argv.slice(3)) {
|
||||
let i = -1, n = 0
|
||||
while ((i = text.indexOf(key, i + 1)) >= 0 && n < 2) { console.log('\n### ' + key + ' @' + i); console.log(text.slice(Math.max(0,i-200), i+260)); n++ }
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
import { spawn } from 'node:child_process'
|
||||
import { mkdtemp } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
const url = process.argv[2]
|
||||
const EDGE = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
||||
const profile = await mkdtemp(join(tmpdir(), 'ss-dump-'))
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
||||
let browser, ws
|
||||
const out = {}
|
||||
try {
|
||||
browser = spawn(EDGE, ['--headless=new','--disable-gpu','--no-first-run','--no-default-browser-check','--remote-debugging-port=0','--user-data-dir='+profile,'about:blank'], { stdio:['ignore','ignore','pipe'] })
|
||||
const ep = await new Promise((res,rej)=>{let l='';const t=setTimeout(()=>rej(Error('timeout')),20000);browser.stderr.on('data',b=>{l+=b;const m=l.match(/DevTools listening on (.+)/);if(m){clearTimeout(t);res(m[1].trim())}});browser.on('error',rej)})
|
||||
ws = new WebSocket(ep); await new Promise((r,j)=>{ws.onopen=r;ws.onerror=j})
|
||||
let n=0;const pend=new Map();ws.onmessage=e=>{const m=JSON.parse(e.data);if(m.id){const p=pend.get(m.id);pend.delete(m.id);m.error?p.reject(Error(JSON.stringify(m.error))):p.resolve(m.result)}}
|
||||
const cdp=(me,pa={},sid)=>new Promise((res,rej)=>{const id=++n;pend.set(id,{resolve:res,reject:rej});ws.send(JSON.stringify({id,method:me,params:pa,...(sid?{sessionId:sid}:{})}))})
|
||||
const {targetId}=await cdp('Target.createTarget',{url:'about:blank'});const {sessionId}=await cdp('Target.attachToTarget',{targetId,flatten:true});const call=(me,pa={})=>cdp(me,pa,sessionId)
|
||||
await call('Page.enable');await call('Runtime.enable')
|
||||
const ev=async x=>{const r=await call('Runtime.evaluate',{expression:x,returnByValue:true,awaitPromise:true});if(r.exceptionDetails)throw Error(r.exceptionDetails.exception?.description||r.exceptionDetails.text);return r.result.value}
|
||||
await call('Emulation.setDeviceMetricsOverride',{width:1440,height:900,deviceScaleFactor:1,mobile:false})
|
||||
await call('Page.navigate',{url})
|
||||
for(let i=0;i<80;i++){if(await ev("document.readyState==='complete'"))break;await sleep(200)}
|
||||
try{await ev("(()=>{const b=[...document.querySelectorAll('button')].find(x=>(x.innerText||'').trim()==='继续');if(b)b.click();return !!b})()")}catch{}
|
||||
await sleep(500)
|
||||
try{await call('Input.dispatchKeyEvent',{type:'keyDown',key:'Escape',code:'Escape',windowsVirtualKeyCode:27});await call('Input.dispatchKeyEvent',{type:'keyUp',key:'Escape',code:'Escape',windowsVirtualKeyCode:27})}catch{}
|
||||
await sleep(2500)
|
||||
out.info = await ev(`(() => {
|
||||
const rows = [...document.querySelectorAll('[data-row-key]')].map(e => ({ k: e.getAttribute('data-row-key'), title: (e.innerText||'').replace(/\\s+/g,' ').trim().slice(0,40) }))
|
||||
return {
|
||||
totalRows: rows.length,
|
||||
workspaceRows: rows.filter(r => r.k.startsWith('workspace:')),
|
||||
sessionRows: rows.filter(r => r.k.startsWith('session:')),
|
||||
}
|
||||
})()`)
|
||||
} catch(e){ out.fatal = String(e?.stack??e) } finally { try{ws?.close()}catch{};try{browser?.kill()}catch{} }
|
||||
console.log(JSON.stringify(out, null, 2))
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import fs from 'node:fs'
|
||||
const url = process.argv[2]
|
||||
const first = await fetch(url, { redirect: 'manual' })
|
||||
const setCookie = first.headers.getSetCookie ? first.headers.getSetCookie() : [first.headers.get('set-cookie')].filter(Boolean)
|
||||
const cookie = setCookie.map(c => c.split(';')[0]).join('; ')
|
||||
const base = new URL(url)
|
||||
const state = JSON.parse(fs.readFileSync('C:/Users/qyh15/.dsh-test-b/sansheng/state.json', 'utf8'))
|
||||
const pid = Object.keys(state.projects)[0]
|
||||
const res = await fetch(base.origin + '/api/sansheng', { method: 'POST', headers: { 'content-type': 'application/json', cookie }, body: JSON.stringify({ endpoint: 'enable', payload: { projectId: pid } }) })
|
||||
const text = await res.text()
|
||||
console.log('status', res.status, text.slice(0, 500))
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
import { spawn } from 'node:child_process'
|
||||
import { mkdtemp } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
const url = process.argv[2]
|
||||
const EDGE = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
||||
const profile = await mkdtemp(join(tmpdir(), 'ss-more-'))
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
||||
let browser, ws
|
||||
const out = { steps: [] }
|
||||
try {
|
||||
browser = spawn(EDGE, ['--headless=new','--disable-gpu','--no-first-run','--no-default-browser-check','--remote-debugging-port=0','--user-data-dir='+profile,'about:blank'], { stdio:['ignore','ignore','pipe'] })
|
||||
const ep = await new Promise((res,rej)=>{let l='';const t=setTimeout(()=>rej(Error('timeout')),20000);browser.stderr.on('data',b=>{l+=b;const m=l.match(/DevTools listening on (.+)/);if(m){clearTimeout(t);res(m[1].trim())}});browser.on('error',rej)})
|
||||
ws = new WebSocket(ep); await new Promise((r,j)=>{ws.onopen=r;ws.onerror=j})
|
||||
let n=0;const pend=new Map();ws.onmessage=e=>{const m=JSON.parse(e.data);if(m.id){const p=pend.get(m.id);pend.delete(m.id);m.error?p.reject(Error(JSON.stringify(m.error))):p.resolve(m.result)}}
|
||||
const cdp=(me,pa={},sid)=>new Promise((res,rej)=>{const id=++n;pend.set(id,{resolve:res,reject:rej});ws.send(JSON.stringify({id,method:me,params:pa,...(sid?{sessionId:sid}:{})}))})
|
||||
const {targetId}=await cdp('Target.createTarget',{url:'about:blank'});const {sessionId}=await cdp('Target.attachToTarget',{targetId,flatten:true});const call=(me,pa={})=>cdp(me,pa,sessionId)
|
||||
await call('Page.enable');await call('Runtime.enable')
|
||||
const ev=async x=>{const r=await call('Runtime.evaluate',{expression:x,returnByValue:true,awaitPromise:true});if(r.exceptionDetails)throw Error(r.exceptionDetails.exception?.description||r.exceptionDetails.text);return r.result.value}
|
||||
await call('Emulation.setDeviceMetricsOverride',{width:1440,height:900,deviceScaleFactor:1,mobile:false})
|
||||
await call('Page.navigate',{url})
|
||||
for(let i=0;i<80;i++){if(await ev("document.readyState==='complete'"))break;await sleep(200)}
|
||||
try{await ev("(()=>{const b=[...document.querySelectorAll('button')].find(x=>(x.innerText||'').trim()==='继续');if(b)b.click();return !!b})()")}catch{}
|
||||
await sleep(2500)
|
||||
const dump = `(() => {
|
||||
const rows = [...document.querySelectorAll('[data-row-key^=\"session:\"]')].map(e=>({k:e.getAttribute('data-row-key'),t:(e.innerText||'').replace(/\\s+/g,' ').trim().slice(0,30)}))
|
||||
const dlg = [...document.querySelectorAll('[role=dialog],[role=menu]')].map(e=>(e.innerText||'').replace(/\\s+/g,' ').trim().slice(0,160)).filter(Boolean)
|
||||
return { sessionRowCount: rows.length, rows, dialogs: dlg.slice(0,4) }
|
||||
})()`
|
||||
out.steps.push({ step: 'initial', ...(await ev(dump)) })
|
||||
const moreCount = await ev("[...document.querySelectorAll('button')].filter(b=>(b.innerText||'').trim()==='更多').length")
|
||||
for (let i=0;i<moreCount;i++) {
|
||||
await ev(`(() => { const bs=[...document.querySelectorAll('button')].filter(b=>(b.innerText||'').trim()==='更多'); if(bs[${i}]) bs[${i}].click(); return true })()`)
|
||||
await sleep(700)
|
||||
out.steps.push({ step: 'click-more-' + i, ...(await ev(dump)) })
|
||||
try{await call('Input.dispatchKeyEvent',{type:'keyDown',key:'Escape',code:'Escape',windowsVirtualKeyCode:27});await call('Input.dispatchKeyEvent',{type:'keyUp',key:'Escape',code:'Escape',windowsVirtualKeyCode:27})}catch{}
|
||||
await sleep(300)
|
||||
}
|
||||
} catch(e){ out.fatal=String(e?.stack??e) } finally { try{ws?.close()}catch{};try{browser?.kill()}catch{} }
|
||||
console.log(JSON.stringify(out, null, 2))
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
import { spawn } from 'node:child_process'
|
||||
import { mkdtemp, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join, dirname } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
const url = process.argv[2]
|
||||
const EDGE = 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
||||
const dir = dirname(fileURLToPath(import.meta.url))
|
||||
const profile = await mkdtemp(join(tmpdir(), 'ss-sidebar-'))
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms))
|
||||
let browser, ws
|
||||
const result = {}
|
||||
try {
|
||||
browser = spawn(EDGE, ['--headless=new','--disable-gpu','--no-first-run','--no-default-browser-check','--remote-debugging-port=0','--user-data-dir='+profile,'about:blank'], { stdio:['ignore','ignore','pipe'] })
|
||||
const endpoint = await new Promise((res, rej) => { let log=''; const t=setTimeout(()=>rej(Error('timeout')),20000); browser.stderr.on('data', b=>{ log+=b; const m=log.match(/DevTools listening on (.+)/); if(m){clearTimeout(t);res(m[1].trim())} }); browser.on('error',rej) })
|
||||
ws = new WebSocket(endpoint); await new Promise((r,j)=>{ws.onopen=r;ws.onerror=j})
|
||||
let n=0; const pend=new Map()
|
||||
ws.onmessage = e => { const m=JSON.parse(e.data); if(m.id){const p=pend.get(m.id);pend.delete(m.id);m.error?p.reject(Error(JSON.stringify(m.error))):p.resolve(m.result)} }
|
||||
const cdp=(method,params={},sid)=>new Promise((res,rej)=>{const id=++n;pend.set(id,{resolve:res,reject:rej});ws.send(JSON.stringify({id,method,params,...(sid?{sessionId:sid}:{})}))})
|
||||
const { targetId } = await cdp('Target.createTarget',{url:'about:blank'})
|
||||
const { sessionId } = await cdp('Target.attachToTarget',{targetId,flatten:true})
|
||||
const call=(m,p={})=>cdp(m,p,sessionId)
|
||||
await call('Page.enable'); await call('Runtime.enable')
|
||||
const ev = async expr => { const r = await call('Runtime.evaluate',{expression:expr,returnByValue:true,awaitPromise:true}); if(r.exceptionDetails) throw Error(r.exceptionDetails.exception?.description||r.exceptionDetails.text); return r.result.value }
|
||||
await call('Emulation.setDeviceMetricsOverride',{width:1440,height:900,deviceScaleFactor:1,mobile:false})
|
||||
await call('Page.navigate',{url})
|
||||
for(let i=0;i<80;i++){ if(await ev("document.readyState==='complete'")) break; await sleep(200) }
|
||||
try { await ev("(() => { const b=[...document.querySelectorAll('button')].find(x=>(x.innerText||'').trim()==='继续'); if(b)b.click(); return !!b })()") } catch {}
|
||||
await sleep(500)
|
||||
try { await call('Input.dispatchKeyEvent',{type:'keyDown',key:'Escape',code:'Escape',windowsVirtualKeyCode:27}); await call('Input.dispatchKeyEvent',{type:'keyUp',key:'Escape',code:'Escape',windowsVirtualKeyCode:27}) } catch {}
|
||||
await sleep(3000)
|
||||
result.dom = await ev(`(() => {
|
||||
const ses = [...document.querySelectorAll('[data-session-id]')]
|
||||
const bodyText = (document.body.innerText||'').replace(/\\s+/g,' ').trim()
|
||||
return {
|
||||
bodySnippet: bodyText.slice(0, 1100),
|
||||
sessionAttrCount: ses.length,
|
||||
sessionIds: ses.map(e => e.getAttribute('data-session-id')).slice(0, 20),
|
||||
hasNewSessionWord: (bodyText.match(/新会话/g)||[]).length,
|
||||
}
|
||||
})()`)
|
||||
const shot = await call('Page.captureScreenshot',{format:'png',captureBeyondViewport:false})
|
||||
await writeFile(join(dir,'live-08-sidebar.png'), Buffer.from(shot.data,'base64'))
|
||||
} catch (e) { result.fatal = String(e?.stack ?? e) } finally { try{ws?.close()}catch{}; try{browser?.kill()}catch{} }
|
||||
console.log(JSON.stringify(result, null, 2))
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
|
@ -1,27 +0,0 @@
|
|||
from PIL import Image, ImageDraw, ImageFont
|
||||
seats = [("丞相","e35483b1"),("中书","4e278758"),("尚书","2e65d691"),("门下","78223c4a"),("吏部","cf800860"),
|
||||
("户部","82262be8"),("礼部","1f2aeec7"),("兵部","2ce3587b"),("刑部","57f94de8"),("工部","857831f9")]
|
||||
crop = (772, 0, 1440, 900)
|
||||
tw, th = 300, 397
|
||||
cols, rows, pad, labelh = 5, 2, 10, 24
|
||||
tiles = []
|
||||
for i in range(1, 11):
|
||||
im = Image.open(f"preview/seat-{i:02d}.png").convert("RGB").crop(crop).resize((tw, th))
|
||||
tiles.append(im)
|
||||
W = cols * tw + (cols + 1) * pad
|
||||
H = rows * (th + labelh) + (rows + 1) * pad
|
||||
canvas = Image.new("RGB", (W, H), "white")
|
||||
d = ImageDraw.Draw(canvas)
|
||||
try:
|
||||
font = ImageFont.truetype("C:/Windows/Fonts/msyh.ttc", 15)
|
||||
except Exception:
|
||||
font = ImageFont.load_default()
|
||||
for idx, (name, sid) in enumerate(seats):
|
||||
r, c = idx // cols, idx % cols
|
||||
x = pad + c * (tw + pad)
|
||||
y = pad + r * (th + labelh + pad)
|
||||
canvas.paste(tiles[idx], (x, y))
|
||||
d.rectangle([x, y + th, x + tw, y + th + labelh], fill="#eef4ff")
|
||||
d.text((x + 6, y + th + 4), f"{name} {sid}", fill="#1f2a3a", font=font)
|
||||
canvas.save("preview/seats-contact.png")
|
||||
print("saved", canvas.size)
|
||||
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
|
@ -1,10 +0,0 @@
|
|||
import fs from 'node:fs'
|
||||
const r = JSON.parse(fs.readFileSync('preview/each.json', 'utf8'))
|
||||
const st = JSON.parse(fs.readFileSync('C:/Users/qyh15/.dsh-test-b/sansheng/state.json', 'utf8'))
|
||||
const proj = Object.values(st.projects)[0]
|
||||
const seats = proj ? Object.values(proj.seats) : []
|
||||
console.log(JSON.stringify({
|
||||
pass: r.pass,
|
||||
each: r.each,
|
||||
seats: seats.map(s => ({ seat: s.seatId, session: (s.sessionId || '').slice(0, 8), status: s.status })),
|
||||
}, null, 2))
|
||||
|
|
@ -420,8 +420,7 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-report-head{display:flex;gap:8px;align-items:baseline}
|
||||
.ssw-report-head strong{font-size:13px;letter-spacing:1px}
|
||||
.ssw-report-head span{font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-report-model{margin:4px 0 0;font-size:11px;color:var(--ssw-blue);letter-spacing:.2px}
|
||||
.ssw-report-text{margin:4px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-report-text{margin:5px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
.ssw-current-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
|
||||
.ssw-current-name{font-size:13px;font-weight:600}
|
||||
|
|
@ -1344,23 +1343,17 @@ function apply(ctx) {
|
|||
reportOpen ? (0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-report-list" },
|
||||
SEAT_IDS.map((id) => {
|
||||
const rec = seatRecordOf(view, id);
|
||||
const m = rec && rec.model;
|
||||
const modelLabel = m && m.model ? m.model + (m.reasoningEffort ? " · " + m.reasoningEffort : "") : "未选择模型";
|
||||
return (0, import_react.createElement)(
|
||||
SEAT_IDS.map((id) => (0, import_react.createElement)(
|
||||
"div",
|
||||
{ key: id, className: "ssw-report-item", "data-seat": id },
|
||||
(0, import_react.createElement)(
|
||||
"div",
|
||||
{ key: id, className: "ssw-report-item", "data-seat": id },
|
||||
(0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-report-head" },
|
||||
(0, import_react.createElement)("strong", null, SEATS[id].label),
|
||||
(0, import_react.createElement)("span", null, SEATS[id].duty)
|
||||
),
|
||||
(0, import_react.createElement)("p", { className: "ssw-report-model" }, "模型:" + modelLabel),
|
||||
(0, import_react.createElement)("p", { className: "ssw-report-text" }, SEATS[id].responsibility)
|
||||
);
|
||||
})
|
||||
{ className: "ssw-report-head" },
|
||||
(0, import_react.createElement)("strong", null, SEATS[id].label),
|
||||
(0, import_react.createElement)("span", null, SEATS[id].duty)
|
||||
),
|
||||
(0, import_react.createElement)("p", { className: "ssw-report-text" }, SEATS[id].responsibility)
|
||||
))
|
||||
) : null
|
||||
);
|
||||
const statusEl = error ? (0, import_react.createElement)("p", { className: "ssw-error", role: "alert" }, error) : notice ? (0, import_react.createElement)("p", { className: "ssw-notice", role: "status" }, notice) : null;
|
||||
|
|
|
|||
|
|
@ -469,19 +469,13 @@ export function apply(ctx) {
|
|||
}, reportOpen ? '收起职责汇报' : '全部汇报职责'),
|
||||
reportOpen
|
||||
? h('div', { className: 'ssw-report-list' },
|
||||
SEAT_IDS.map(id => {
|
||||
const rec = seatRecordOf(view, id)
|
||||
const m = rec && rec.model
|
||||
const modelLabel = m && m.model ? (m.model + (m.reasoningEffort ? ' · ' + m.reasoningEffort : '')) : '未选择模型'
|
||||
return h('div', { key: id, className: 'ssw-report-item', 'data-seat': id },
|
||||
h('div', { className: 'ssw-report-head' },
|
||||
h('strong', null, SEATS[id].label),
|
||||
h('span', null, SEATS[id].duty),
|
||||
),
|
||||
h('p', { className: 'ssw-report-model' }, '模型:' + modelLabel),
|
||||
h('p', { className: 'ssw-report-text' }, SEATS[id].responsibility),
|
||||
)
|
||||
}),
|
||||
SEAT_IDS.map(id => h('div', { key: id, className: 'ssw-report-item', 'data-seat': id },
|
||||
h('div', { className: 'ssw-report-head' },
|
||||
h('strong', null, SEATS[id].label),
|
||||
h('span', null, SEATS[id].duty),
|
||||
),
|
||||
h('p', { className: 'ssw-report-text' }, SEATS[id].responsibility),
|
||||
)),
|
||||
)
|
||||
: null,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -54,8 +54,7 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-report-head{display:flex;gap:8px;align-items:baseline}
|
||||
.ssw-report-head strong{font-size:13px;letter-spacing:1px}
|
||||
.ssw-report-head span{font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-report-model{margin:4px 0 0;font-size:11px;color:var(--ssw-blue);letter-spacing:.2px}
|
||||
.ssw-report-text{margin:4px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-report-text{margin:5px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
.ssw-current-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
|
||||
.ssw-current-name{font-size:13px;font-weight:600}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// 严格会话创建/恢复:先持久化计划 ID,再查是否已存在,只创建缺失项;
|
||||
// ID 不一致立即停止后续创建并保留记录;失败保留已完成绑定,重试只补未完成项。
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { SEAT_IDS, SEATS } from '../shared/roles.js'
|
||||
import { SEAT_IDS } from '../shared/roles.js'
|
||||
|
||||
export class ProvisionError extends Error {
|
||||
constructor(code, message) { super(message); this.name = 'ProvisionError'; this.code = code }
|
||||
|
|
@ -118,27 +118,6 @@ export function createProvisioner({ store, host, now = () => Date.now() }) {
|
|||
const result = await ensureSeat(projectId, seatId)
|
||||
if (result.fatal) { fatal = true; break }
|
||||
}
|
||||
|
||||
// 预热:把每个已绑定会话加载一次(resolveAgent 会 resume 冷会话并生成 summary),
|
||||
// 否则 DSH 左侧工作区会话树(orderByRecency 依赖 summary)会跳过这些会话不显示。
|
||||
if (typeof host.sessionController.resolveAgent === 'function') {
|
||||
for (const seatId of SEAT_IDS) {
|
||||
const seat = store.get(projectId)?.seats?.[seatId]
|
||||
if (!seat || !seat.sessionId || seat.status !== 'bound') continue
|
||||
try { await host.sessionController.resolveAgent(seat.sessionId) } catch { /* 预热失败不影响绑定 */ }
|
||||
}
|
||||
}
|
||||
|
||||
// 给每个已绑定会话写标题(如“丞相会话”),让左侧工作区列表能收录并显示为独立对话。
|
||||
if (typeof host.sessionController.rename === 'function') {
|
||||
for (const seatId of SEAT_IDS) {
|
||||
const seat = store.get(projectId)?.seats?.[seatId]
|
||||
if (!seat || !seat.sessionId || seat.status !== 'bound') continue
|
||||
try {
|
||||
await host.sessionController.rename({ sessionId: seat.sessionId, title: `${SEATS[seatId].label}会话` })
|
||||
} catch { /* 标题失败不影响绑定;下次启用会重试 */ }
|
||||
}
|
||||
}
|
||||
await store.mutate(s => {
|
||||
const p = s.projects[projectId]
|
||||
const allBound = SEAT_IDS.every(id => p.seats[id].status === 'bound')
|
||||
|
|
|
|||