A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Check that mica.css still matches DSH's page
Fei2411cbaff110d3ca
diff --git a/app/scripts/check-packed.mjs b/app/scripts/check-packed.mjsindex a2dc9d2a..b690ea0d 100644--- a/app/scripts/check-packed.mjs+++ b/app/scripts/check-packed.mjs@@ -4,7 +4,7 @@// Usage: node scripts/check-packed.mjs [app executable] [screenshot.png]// The executable defaults to the one that `npm run pack` or `npm run dist` writes into dist-pack/.import { spawn, spawnSync } from 'node:child_process'-import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'+import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'import { tmpdir } from 'node:os'import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path'import { setTimeout as sleep } from 'node:timers/promises'@@ -121,6 +121,16 @@ function devtools(url, problems) {return { opened, call }}+// mica.css styles DSH's own page, which can change with a DSH upgrade; every rule must still+// find an element, on every platform, so the change shows here and not as a broken window.+function micaRules() {+ const css = readFileSync(join(root, 'src', 'mica.css'), 'utf8').replace(/\/\*[\s\S]*?\*\//gu, '')+ return [...css.matchAll(/([^{}]+)\{/gu)].map(([, selectors]) => selectors.split(',')+ .map(selector => selector.trim().replace(/::(?:before|after)$/u, ''))+ .filter(selector => selector !== '' && selector !== 'body'))+ .filter(rule => rule.length > 0)+}+async function chat(cdp) {const evaluate = async expression => (await cdp.call('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })).result.valueconst until = async (expression, label, ms = 120_000) => {@@ -137,6 +147,8 @@ async function chat(cdp) {await cdp.call('Runtime.enable')await cdp.call('Log.enable')await until("document.querySelector('.bt-tile, .bt-row')", 'the team')+ const stale = await evaluate(`${JSON.stringify(micaRules())}.filter(rule => !rule.some(selector => document.querySelector(selector) !== null)).map(rule => rule.join(', '))`)+ if (stale.length > 0) throw new Error(`src/mica.css no longer matches DSH's page: ${stale.join(' | ')}`)await dismissNotice()const main = await evaluate("fetch('api/bot', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ endpoint: 'state', payload: {} }) }).then(r => r.json()).then(r => r.value.mainBotId)")await evaluate(`document.querySelector(${JSON.stringify(`[data-bot-id="${main}"]`)}).click()`)diff --git a/docs/plans/2026-10-13-dsh-concessions.md b/docs/plans/2026-10-13-dsh-concessions.mdindex 7a8f519d..6f6d2059 100644--- a/docs/plans/2026-10-13-dsh-concessions.md+++ b/docs/plans/2026-10-13-dsh-concessions.md@@ -26,6 +26,7 @@ DS Bot 是 DSH 插件,只能用 DSH 公开的接口。有些地方 DSH 的设| C11 | 10-13 | #129 | 模型流卡死时没有看门狗,回合不会结束 | 没读的请求合成一条,`list_bots` 和 `message_bot` 里看得到对方在做什么、在等什么(#262) | 卡死的 Bot 要用户手动停止 | 监控回合,提供恢复入口 || C12 | 10-13 | #38 | 超长工具结果会被截断(默认约 12500 tokens) | 未处理 | 超长的群轮次,刷新后回复可能不见 | 插件侧可改为只存摘要和 id;应用有自己的存储 || C13 | 10-14 | #37,PR #168 | 预设是全局或按会话选的,插件不能只给 Bot 会话换掉 PTC 的工具展示、保留用户其余配置 | DS Bot 新建的会话一律用 standard 预设,用户给 DSH 选的预设(包括自定义组合)不用于 Bot | 用户自定义预设里的插件不会出现在 Bot 里 | 每个 Bot 可选自己的 harness(愿景第 9 条),默认 standard |+| C14 | 10-20 | #362,PR #363 | DSH 网页前端的 Windows 标题栏布局只有不透明一种,没有让窗口材质透出侧栏的接口;桌面模式(`data-platform`)要 DSH Desktop 的原生键盘桥 | 桌面应用只标 `data-windows-titlebar`(DSH 网页前端自己的标题栏布局),页面留在网页模式。Windows 11 上 `app/src/mica.css` 用 DSH 的私有类名让 Mica 透出侧栏;`check-packed` 检查每条规则还能找到元素 | 升级锁定的 DSH 时类名或结构可能变;macOS 暂时保留系统标题栏 | 自己的界面接着做时,窗口外框由应用自己画 |## 记录规则