A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Merge dev into feat/500-desktop-tray
Fei2411652e7fffdfe6
diff --cc app/scripts/check-packed.mjsindex 372de1c3,8764a5a8..39453f91--- a/app/scripts/check-packed.mjs+++ b/app/scripts/check-packed.mjs@@@ -1,7 -1,6 +1,7 @@@- // Check a packaged app: start it on throwaway folders with the ds-bot mock model, choose a model,+ // Check a packaged app: process an image with its sharp, then start it on throwaway folders with the ds-bot mock model, choose a model,-// send a message, wait for the reply, then close the window the way a user does and wait until-// the app has exited. Fails on a page error or a non-zero exit.+// send a message, wait for the reply, then close the window the way a user does: the window hides+// and the app goes on. The window comes back when the app is started again, and the app ends the+// way the tray's Quit ends it. Fails on a page error or a non-zero exit.// 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'@@@ -266,17 -250,17 +291,18 @@@ async function chat(cdp)let failed = falseconst problems = []try {+ const packedApp = outsideCheckout(resolve(executable))+ checkSharp(packedApp)const modelUrl = await startMock()- const port = 9300 + Math.floor(Math.random() * 600)+ const port = await freePort()+ const mainPort = await freePort()// A terminal inside an Electron-based editor may set ELECTRON_RUN_AS_NODE, which turns the app into plain Node.const { ELECTRON_RUN_AS_NODE: _runAsNode, ...env } = process.envObject.assign(env, {DS_BOT_HOME: join(work, 'home'), DS_BOT_SHELL_DATA: join(work, 'shell'),DEEPSEEK_BASE_URL: modelUrl, DEEPSEEK_API_KEY: 'mock-key',})- const runnable = outsideCheckout(resolve(executable))- const app = spawn(runnable, [`--remote-debugging-port=${String(port)}`, `--inspect=127.0.0.1:${String(mainPort)}`], { stdio: 'inherit', env })- const app = spawn(packedApp, [`--remote-debugging-port=${String(port)}`], { stdio: 'inherit', env })++ const app = spawn(packedApp, [`--remote-debugging-port=${String(port)}`, `--inspect=127.0.0.1:${String(mainPort)}`], { stdio: 'inherit', env })children.push(app)const exited = new Promise((done) => { app.once('exit', (code, signal) => { done({ code, signal }) }) })const cdp = devtools((await appPage(port, Date.now() + 120_000)).webSocketDebuggerUrl, problems)diff --cc ds-bot/client.jsindex 11627b2b,f6327bbc..ba5328ec--- a/ds-bot/client.js+++ b/ds-bot/client.js@@@ -7587,12 -7791,13 +7791,13 @@@ function TriggerCell({ node, sessionIdreturn first?.turn === turn && unseenSince(visit, first.start) ? clockLabel(first.start) : "";});const body = triggerBody();- return unreadOpening ? (0, import_react12.createElement)(import_react12.Fragment, null, (0, import_react12.createElement)("div", { className: "bt-open-new" }, (0, import_react12.createElement)(NewDivider), (0, import_react12.createElement)("div", { className: "bt-time-sep", role: "separator" }, unreadOpening)), body) : body;+ return unreadOpening ? (0, import_react13.createElement)(import_react13.Fragment, null, (0, import_react13.createElement)("div", { className: "bt-open-new" }, (0, import_react13.createElement)(NewDivider), (0, import_react13.createElement)("div", { className: "bt-time-sep", role: "separator" }, unreadOpening)), body) : body;function triggerBody() {if (source.kind === "bot") {- if (source.handoff === true) return roster.roomsById[sessionId] ? null : (0, import_react12.createElement)(EarlierParts, { sessionId, roster, actions });+ if (source.handoff === true) return roster.roomsById[sessionId] ? null : (0, import_react13.createElement)(EarlierParts, { sessionId, roster, actions });if (source.role === "kickoff" || source.role === "room") return null;if (source.role === "secret" || deferred) return null;- if (source.role === "update") return (0, import_react12.createElement)("div", { className: "bt-event" }, t("Profile updated"));++ if (source.role === "update") return (0, import_react13.createElement)("div", { className: "bt-event" }, t("Profile updated"));if (source.role === "post") {if (source.logged !== void 0) return null;if (source.failed !== void 0 || source.resumed === true || source.stopped === true || source.done === true) return null;@@@ -7839,9 -8092,11 +8092,11 @@@ function GroupReplies({ sessionId, callconst pending = done || !live.speaking ? [] : [live.speaking];const speakerTool = useWork?.((work) => work.bots?.[live.speaking]?.tool) ?? void 0;const speakerDoing = useWork?.((work) => work.bots?.[live.speaking]?.tool ? workPhrase(work.bots[live.speaking]) : void 0) ?? void 0;- if (replies.length === 0 && pending.length === 0) return null;+ if (replies.length === 0 && pending.length === 0) {- return broken ? (0, import_react12.createElement)("div", { className: "bt-group-replies" }, (0, import_react12.createElement)("div", { className: "bt-event" }, t("The group replies could not be shown"))) : null;++ return broken ? (0, import_react13.createElement)("div", { className: "bt-group-replies" }, (0, import_react13.createElement)("div", { className: "bt-event" }, t("The group replies could not be shown"))) : null;+ }const room2 = roster.roomsById[sessionId];- return (0, import_react12.createElement)(+ return (0, import_react13.createElement)("div",{ className: "bt-group-replies" },stackReplies(replies).map(({ reply, index, texts: texts2, time, duration }) => {