Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Merge remote-tracking branch 'origin/dev' into feat/612-responsive-layout

Fei2411fa647b4f8b80
diff --cc ds-bot/client.js
index c31fe0e1,ba5328ec..a3481bb5
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@@ -19502,15 -19333,26 +19609,33 @@@ function apply(ctx)
expected2 = target;
ctx.uiWorkspace.openSession(target);
}, current: mainView });
+ const panelFolded = (view) => {
+ const state = ui2.getSnapshot();
+ if (state.details === null) return false;
+ const f = frame.getSnapshot();
+ return frameLayout({ viewport: f.viewport, sidebarWidth: f.sidebarWidth, pref: sidebarPref.getSnapshot(), drawer: state.leftDrawer, panel: { view: view ?? state.view, yielded: state.panelYield === true } }).panel === "folded";
+ };
+ const yieldBrowser = (state) => state.panelYield === true || panelFolded("browser");
+ const homeToMainBot = () => {
+ const snapshot = roster.getSnapshot();
+ if (!snapshot.ready || !snapshot.mainBotId) return;
+ const main = mainView();
+ if (main !== void 0 && snapshot.byId[main] === void 0 && snapshot.roomsById[main] === void 0) {
+ actions.openSession(snapshot.mainBotId);
+ }
+ };
+ const ensureBotHome = () => {
+ if (roster.getSnapshot().ready) homeToMainBot();
+ else {
+ const off = roster.subscribe(() => {
+ if (!roster.getSnapshot().ready) return;
+ off();
+ homeToMainBot();
+ });
+ }
+ };
const actions = {
- ...teamActions({ call, after, partFor, roster, ui: ui2, live, cards, heldCards, turnClock }),
+ ...teamActions({ call, after, partFor, roster, ui: ui2, live, cards, heldCards, turnClock, panelFolded }),
// The full-pane overlays sit above the conversation, so opening one must dismiss them
// or the click appears to do nothing.
isAgentSession: (id) => isAgentSessionId(id),
diff --cc ds-bot/src/client/index.js
index fa29efa2,928cbb28..d86d921d
--- a/ds-bot/src/client/index.js
+++ b/ds-bot/src/client/index.js
@@@ -382,18 -376,29 +382,39 @@@ export function apply(ctx)
}
const mainView = () => Object.values(ctx.sessions.list.getSnapshot().byId ?? {}).find(session => (session?.retainedBy?.mainView ?? 0) > 0)?.id
const show = listedOpener({ list: ctx.sessions.list, refresh: () => Promise.resolve(ctx.sessions.refresh?.()).catch(quietly('refresh sessions')), open: (target) => { expected = target; ctx.uiWorkspace.openSession(target) }, current: mainView })
+ // Whether the open Bot panel is folded away for lack of room: its opener then
+ // means "show it" (the column yields), not "close it". A panel shown because
+ // the column already yielded is not folded, so its opener closes it.
+ const panelFolded = (view) => {
+ const state = ui.getSnapshot()
+ if (state.details === null) return false
+ const f = frame.getSnapshot()
+ return frameLayout({ viewport: f.viewport, sidebarWidth: f.sidebarWidth, pref: sidebarPref.getSnapshot(), drawer: state.leftDrawer, panel: { view: view ?? state.view, yielded: state.panelYield === true } }).panel === 'folded'
+ }
+ const yieldBrowser = state => state.panelYield === true || panelFolded('browser')
+ // Bot mode's view must hold a team conversation; an outside Session wears the
+ // Bot skin without one. Runs whenever the surface is (or stays) Bot mode —
+ // including a cold start, where no setSurface call ever fires.
+ const homeToMainBot = () => {
+ const snapshot = roster.getSnapshot()
+ if (!snapshot.ready || !snapshot.mainBotId) return
+ const main = mainView()
+ if (main !== undefined && snapshot.byId[main] === undefined && snapshot.roomsById[main] === undefined) {
+ actions.openSession(snapshot.mainBotId)
+ }
+ }
+ const ensureBotHome = () => {
+ if (roster.getSnapshot().ready) homeToMainBot()
+ else {
+ const off = roster.subscribe(() => {
+ if (!roster.getSnapshot().ready) return
+ off()
+ homeToMainBot()
+ })
+ }
+ }
const actions = {
- ...teamActions({ call, after, partFor, roster, ui, live, cards, heldCards, turnClock }),
+ ...teamActions({ call, after, partFor, roster, ui, live, cards, heldCards, turnClock, panelFolded }),
// The full-pane overlays sit above the conversation, so opening one must dismiss them
// or the click appears to do nothing.
isAgentSession: id => isAgentSessionId(id),