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/main' into fix/group-panel-polish

Fei241101c0cf1ca2a2
diff --cc ds-bot/client.js
index 9e7e9ef9,f814e18c..44cc0eac
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@@ -11073,7 -11075,11 +11087,8 @@@ function busyMembers(room2, work, roste
const busy = memberWork(room2, work).filter((entry) => entry.state !== "idle" && roster.byId[entry.id]);
return [...busy.filter((entry) => entry.state === "ask"), ...busy.filter((entry) => entry.state === "work")].map((entry) => ({ ...entry, bot: roster.byId[entry.id] }));
}
-function splitBusy(busy) {
- const speaking = (entry) => entry.state === "work" && entry.here && entry.doing.speaking === true;
- const rows = busy.filter((entry) => entry.state === "work" && entry.here && !speaking(entry)).slice(0, ROWS_MAX);
- return { rows, rest: busy.filter((entry) => !rows.includes(entry) && !speaking(entry)) };
-}
+var dockMembers = (busy) => busy.filter((entry) => !(entry.state === "work" && entry.here && entry.doing.speaking === true));
++var workState = (doing) => doing?.switching ? "thinking" : toolState(doing?.tool ?? "");
function botGroupWork(botId, work, roster) {
return Object.entries(work.rooms ?? {}).flatMap(([roomId, entries2]) => {
const entry = entries2.find((item) => item.botId === botId);
@@@ -11087,78 -11093,39 +11102,78 @@@ function summaryText(busy)
const names = asks.slice(0, 2).map((entry) => entry.bot.name);
const waiting = asks.length === 0 ? "" : asks.length === 1 ? t("{name} is waiting for your approval", { name: names[0] }) : asks.length === 2 ? t("{first} and {second} are waiting for your approval", { first: names[0], second: names[1] }) : t("{first}, {second} and {count} more are waiting for your approval", { first: names[0], second: names[1], count: asks.length - 2, total: asks.length });
const first = workers[0];
- const doing = first ? `${first.bot.name} · ${workPhrase(first.doing.tool)}…${workers.length > 1 ? ` +${workers.length - 1}` : ""}` : "";
+ const doing = first ? `${first.bot.name} · ${workPhrase(first.doing)}…${workers.length > 1 ? ` +${workers.length - 1}` : ""}` : "";
return { waiting, doing };
}
-function Face({ entry, size }) {
+function dockModel(sessionId, roster, work) {
+ const room2 = roster.roomsById[sessionId];
+ if (room2) {
+ const busy = dockMembers(busyMembers(room2, work, roster));
+ if (busy.length === 0) return null;
+ const { waiting, doing } = summaryText(busy);
+ return {
+ open: { details: room2.id },
- faces: busy.slice(0, FACES_MAX).map((entry) => ({ id: entry.id, ask: entry.state === "ask", tool: entry.doing?.tool ?? "" })),
++ faces: busy.slice(0, FACES_MAX).map((entry) => ({ id: entry.id, ask: entry.state === "ask", state: workState(entry.doing) })),
+ waiting,
+ doing
+ };
+ }
+ const bot = roster.byId[sessionId];
+ if (!bot || work.bots?.[bot.id] !== void 0 && work.bots[bot.id].roomId === void 0) return null;
+ const groups = botGroupWork(bot.id, work, roster);
+ if (groups.length === 0) return null;
+ const [first] = groups;
+ return {
+ open: { session: first.room.id },
- faces: [{ id: bot.id, ask: false, tool: first.tool ?? "" }],
++ faces: [{ id: bot.id, ask: false, state: workState(first.doing) }],
+ waiting: "",
- doing: `${t("in {name}", { name: first.room.name })} · ${workPhrase(first.tool)}…${groups.length > 1 ? ` +${groups.length - 1}` : ""}`
++ doing: `${t("in {name}", { name: first.room.name })} · ${workPhrase(first.doing)}…${groups.length > 1 ? ` +${groups.length - 1}` : ""}`
+ };
+}
- function Face({ bot, ask, tool }) {
++function Face({ bot, ask, state }) {
return (0, import_react30.createElement)(
"span",
- { className: "bt-mw-face", "data-ask": entry.state === "ask" || void 0 },
- (0, import_react30.createElement)(BotMark, { bot: entry.bot, size, state: entry.state === "ask" ? "alert" : toolState(entry.doing?.tool ?? "") })
+ { className: "bt-mw-face", "data-ask": ask || void 0 },
- (0, import_react30.createElement)(BotMark, { bot, size: 20, state: ask ? "alert" : toolState(tool) })
++ (0, import_react30.createElement)(BotMark, { bot, size: 20, state: ask ? "alert" : state })
);
}
-function WorkRow({ bot, doing, label, at, now, onOpen }) {
- const text = `${label} · ${workPhrase(doing)}…`;
- const elapsed = typeof at === "number" && now - at >= 6e4 ? elapsedLabel(now - at) : "";
- return (0, import_react30.createElement)(
- "button",
- { type: "button", className: "bt-mw-row", "aria-label": [text, elapsed].filter(Boolean).join(" · "), title: text, onClick: onOpen },
- (0, import_react30.createElement)(BotMark, { bot, size: 22, state: doing?.switching ? "thinking" : toolState(doing?.tool ?? ""), live: true }),
- (0, import_react30.createElement)("span", { className: "bt-mw-row-text" }, (0, import_react30.createElement)(Shimmer, null, text)),
- elapsed ? (0, import_react30.createElement)("span", { className: "bt-mw-row-time" }, `· ${elapsed}`) : null
- );
+function useFitWidth(inner, key) {
+ const [width, setWidth] = (0, import_react30.useState)(null);
+ (0, import_react30.useLayoutEffect)(() => {
+ setWidth(key && inner.current ? inner.current.offsetWidth : null);
+ }, [key]);
+ return width;
}
-function SummaryLine({ busy, onOpen }) {
- const { waiting, doing } = summaryText(busy);
+function MemberDock({ sessionId, useRoster, useWork, actions }) {
+ const roster = useRoster((value) => value);
+ const work = useWork((value) => value);
+ const live = dockModel(sessionId, roster, work);
+ const [kept, leaving] = useLinger(live ? JSON.stringify(live) : null, DOCK_EXIT_MS);
+ const model = kept ? JSON.parse(kept) : null;
+ const inner = (0, import_react30.useRef)(null);
+ const width = useFitWidth(inner, kept);
+ if (!model) return null;
+ const faces = model.faces.map((face) => ({ ...face, bot: roster.byId[face.id] })).filter((face) => face.bot);
+ const label = [model.waiting, model.doing].filter(Boolean).join(" · ");
+ const open = () => model.open.details ? actions.showDetails(model.open.details) : actions.openSession(model.open.session);
return (0, import_react30.createElement)(
"div",
- { className: "bt-event bt-mw-dock" },
+ { className: "bt-mw-dock", "data-leaving": leaving || void 0 },
(0, import_react30.createElement)(
"button",
- { type: "button", className: "bt-event-whole bt-mw-line", "aria-label": [waiting, doing].filter(Boolean).join(" · "), onClick: onOpen },
- (0, import_react30.createElement)("span", { className: "bt-mw-stack", "aria-hidden": true }, busy.slice(0, 4).map((entry) => (0, import_react30.createElement)(Face, { key: entry.id, entry, size: 16 }))),
- waiting ? (0, import_react30.createElement)("span", { className: "bt-mw-ask" }, waiting) : null,
- waiting && doing ? (0, import_react30.createElement)("span", { "aria-hidden": true }, "·") : null,
- doing ? (0, import_react30.createElement)("span", { className: "bt-event-name" }, (0, import_react30.createElement)(Shimmer, null, doing)) : null
+ { type: "button", className: "bt-mw-pill", "aria-label": label, onClick: open, disabled: leaving, style: width ? { width } : void 0 },
+ (0, import_react30.createElement)(
+ "span",
+ { ref: inner, className: "bt-mw-pill-in" },
+ (0, import_react30.createElement)("span", { className: "bt-mw-faces", "aria-hidden": true }, faces.map((face) => (0, import_react30.createElement)(Face, { key: face.id, ...face }))),
+ (0, import_react30.createElement)(
+ "span",
+ { key: label, className: "bt-mw-label", "aria-hidden": true },
+ model.waiting ? (0, import_react30.createElement)("span", { className: "bt-mw-ask" }, model.waiting) : null,
+ model.waiting && model.doing ? (0, import_react30.createElement)("span", { className: "bt-mw-dot" }, "·") : null,
+ model.doing ? (0, import_react30.createElement)("span", { className: "bt-mw-doing" }, (0, import_react30.createElement)(Shimmer, null, model.doing)) : null
+ )
+ )
)
);
}
@@@ -11197,21 -11214,18 +11212,21 @@@ function ApprovalCard({ approval, bot,
)
);
}
-function MemberWork({ entry, bot, room: room2, roster, actions, now }) {
- const [stopping, setStopping] = (0, import_react30.useState)(false);
- if (entry.state === "ask") {
- return (0, import_react30.createElement)(
- "div",
- { className: "bt-mw-member" },
- (0, import_react30.createElement)("div", { className: "bt-mw-state bt-mw-ask" }, `${t("Waiting for your approval")}${since(now, entry.approvals[0].at)}`),
- entry.approvals.map((approval) => (0, import_react30.createElement)(ApprovalCard, { key: approval.id, approval, bot, actions }))
- );
- }
- if (entry.state !== "work") return null;
+function MemberState({ entry, bot, room: room2, roster, now }) {
+ if (entry?.state === "ask") return (0, import_react30.createElement)("span", { className: "bt-member-state bt-mw-ask" }, `${t("Waiting for your approval")}${since(now, entry.approvals[0].at)}`);
+ if (entry?.state !== "work") return bot.role ? (0, import_react30.createElement)("span", { className: "bt-member-state" }, bot.role) : null;
const where = entry.doing.roomId === room2.id ? "" : entry.doing.roomId ? t("in {name}", { name: roster.roomsById[entry.doing.roomId]?.name ?? t("a group chat") }) : t("in its own chat");
+ return (0, import_react30.createElement)(
+ "span",
+ { className: "bt-member-state" },
- (0, import_react30.createElement)(Shimmer, null, `${workPhrase(entry.doing.tool)}…`),
++ (0, import_react30.createElement)(Shimmer, null, `${workPhrase(entry.doing)}…`),
+ where ? ` ${where}` : "",
+ since(now, entry.doing.since)
+ );
+}
+function StopMemberWork({ entry, bot, room: room2, actions }) {
+ const [stopping, setStopping] = (0, import_react30.useState)(false);
+ if (entry?.state !== "work" || !entry.here) return null;
const stop = () => {
setStopping(true);
void Promise.resolve(actions.stopMemberWork(room2.id, bot.id)).catch((error) => actions.reportError(error, "stop")).finally(() => setStopping(false));
@@@ -11407,47 -11412,6 +11422,47 @@@ function About({ text, title = "About"
long ? (0, import_react31.createElement)("button", { type: "button", className: "bt-more", onClick: () => setOpen((value) => !value) }, open ? t("Show less") : t("Show more")) : null
);
}
+var PILE_MAX = 4;
+function MemberPile({ room: room2, roster }) {
+ const members = room2.members.map((id) => roster.byId[id]).filter(Boolean);
+ const shown = members.length > PILE_MAX ? members.slice(0, PILE_MAX - 1) : members;
+ const more = members.length - shown.length;
+ return (0, import_react31.createElement)(
+ "span",
+ { className: "bt-pile", "aria-hidden": true },
+ shown.map((bot, index) => (0, import_react31.createElement)("span", { key: bot.id, className: "bt-pile-face", style: { animationDelay: `${index * 40}ms` } }, (0, import_react31.createElement)(BotMark, { bot, size: 44, live: true }))),
+ more > 0 ? (0, import_react31.createElement)("span", { key: "more", className: "bt-pile-face bt-pile-more", style: { animationDelay: `${shown.length * 40}ms` } }, `+${more}`) : null
+ );
+}
- var markOf = (entry) => entry?.state === "ask" ? "alert" : entry?.state === "work" ? toolState(entry.doing.tool ?? "") : "idle";
++var markOf = (entry) => entry?.state === "ask" ? "alert" : entry?.state === "work" ? workState(entry.doing) : "idle";
+function MemberRow({ member, entry, room: room2, roster, actions, now }) {
+ return (0, import_react31.createElement)(
+ "div",
+ { role: "listitem", className: "bt-member" },
+ (0, import_react31.createElement)(
+ "div",
+ { className: "bt-member-row" },
+ (0, import_react31.createElement)(
+ "button",
+ { type: "button", className: "bt-member-open", title: t("Open {name}'s chat", { name: member.name }), onClick: () => actions.openSession(member.id) },
+ (0, import_react31.createElement)(BotMark, { bot: member, size: 32, state: markOf(entry) }),
+ (0, import_react31.createElement)(
+ "span",
+ { className: "bt-member-text" },
+ (0, import_react31.createElement)(
+ "span",
+ { className: "bt-member-line" },
+ (0, import_react31.createElement)("span", { className: "bt-member-name" }, member.name),
+ room2.admin === member.id ? (0, import_react31.createElement)("span", { className: "bt-tag" }, t("Admin")) : null
+ ),
+ (0, import_react31.createElement)(MemberState, { entry, bot: member, room: room2, roster, now })
+ )
+ ),
+ (0, import_react31.createElement)(StopMemberWork, { entry, bot: member, room: room2, actions })
+ ),
+ (0, import_react31.createElement)(MemberApprovals, { entry, bot: member, actions })
+ );
+}
function GroupOverview({ room: room2, roster, actions, usage, useWork, openSettings }) {
const members = room2.members.map((id) => roster.byId[id]).filter(Boolean);
const { entries: entries2, now } = useMemberWork(room2, useWork);
diff --cc ds-bot/src/client/details-drawer.js
index 7ca66da5,b051eb8d..fc143a9a
--- a/ds-bot/src/client/details-drawer.js
+++ b/ds-bot/src/client/details-drawer.js
@@@ -2,7 -2,7 +2,7 @@@ import { createElement as h, Fragment,
import { isMainOf } from './sources.js'
import { HEADER, currentPart, stripHeader, usageOf } from './text.js'
import { PlusIcon, ShareIcon, CloseIcon, ChevronLeftIcon, GearIcon } from './icons.js'
- import { botState, toolState, BotMark, BotAvatar } from './mark.js'
-import { botState, BotMark, BotAvatar, RoomAvatar } from './mark.js'
++import { botState, BotMark, BotAvatar } from './mark.js'
import { GlobeIcon, Favicon } from './browser-pane.js'
import { useEscape } from './overlay-hooks.js'
import { BotSettingsForm } from './bot-settings.js'
@@@ -12,7 -12,7 +12,7 @@@ import { FolderMenu } from './folder-me
import { MemoryRow } from './memory-panel.js'
import { ScheduleSummary } from './schedules.js'
import { Segmented, useGlide, useMorph } from './motion.js'
- import { MemberApprovals, MemberState, StopMemberWork, useMemberWork } from './member-status.js'
-import { MemberWork, useMemberWork } from './member-status.js'
++import { MemberApprovals, MemberState, StopMemberWork, useMemberWork, workState } from './member-status.js'
import { t } from './i18n.js'
function transcriptOf(list, id, name, hiddenTurns = []) {
@@@ -111,36 -111,6 +111,36 @@@ function About({ text, title = 'About'
long ? h('button', { type: 'button', className: 'bt-more', onClick: () => setOpen(value => !value) }, open ? t('Show less') : t('Show more')) : null)
}
+// A group's face in its details: its first members side by side, each on a disc that
+// cuts into the one before, and how many more there are.
+const PILE_MAX = 4
+function MemberPile({ room, roster }) {
+ const members = room.members.map(id => roster.byId[id]).filter(Boolean)
+ const shown = members.length > PILE_MAX ? members.slice(0, PILE_MAX - 1) : members
+ const more = members.length - shown.length
+ return h('span', { className: 'bt-pile', 'aria-hidden': true },
+ shown.map((bot, index) => h('span', { key: bot.id, className: 'bt-pile-face', style: { animationDelay: `${index * 40}ms` } }, h(BotMark, { bot, size: 44, live: true }))),
+ more > 0 ? h('span', { key: 'more', className: 'bt-pile-face bt-pile-more', style: { animationDelay: `${shown.length * 40}ms` } }, `+${more}`) : null)
+}
+
- const markOf = entry => (entry?.state === 'ask' ? 'alert' : entry?.state === 'work' ? toolState(entry.doing.tool ?? '') : 'idle')
++const markOf = entry => (entry?.state === 'ask' ? 'alert' : entry?.state === 'work' ? workState(entry.doing) : 'idle')
+
+// One member: its mark, name and what it is doing on one surface that opens its chat;
+// Stop beside it while it works here, and the approvals it waits on below.
+function MemberRow({ member, entry, room, roster, actions, now }) {
+ return h('div', { role: 'listitem', className: 'bt-member' },
+ h('div', { className: 'bt-member-row' },
+ h('button', { type: 'button', className: 'bt-member-open', title: t("Open {name}'s chat", { name: member.name }), onClick: () => actions.openSession(member.id) },
+ h(BotMark, { bot: member, size: 32, state: markOf(entry) }),
+ h('span', { className: 'bt-member-text' },
+ h('span', { className: 'bt-member-line' },
+ h('span', { className: 'bt-member-name' }, member.name),
+ room.admin === member.id ? h('span', { className: 'bt-tag' }, t('Admin')) : null),
+ h(MemberState, { entry, bot: member, room, roster, now }))),
+ h(StopMemberWork, { entry, bot: member, room, actions })),
+ h(MemberApprovals, { entry, bot: member, actions }))
+}
+
// A group's overview: what members read, who is in it, and who answers. Changes are
// made in its settings.
function GroupOverview({ room, roster, actions, usage, useWork, openSettings }) {
diff --cc ds-bot/src/client/member-status.js
index 84881376,9c76186b..86d120f1
--- a/ds-bot/src/client/member-status.js
+++ b/ds-bot/src/client/member-status.js
@@@ -33,9 -31,14 +33,11 @@@ export function busyMembers(room, work
.map(entry => ({ ...entry, bot: roster.byId[entry.id] }))
}
-// Members at work in this group get a row of their own, apart from the round's current
-// speaker, which its round shows; the rest go on the summary line.
-export function splitBusy(busy) {
- const speaking = entry => entry.state === 'work' && entry.here && entry.doing.speaking === true
- const rows = busy.filter(entry => entry.state === 'work' && entry.here && !speaking(entry)).slice(0, ROWS_MAX)
- return { rows, rest: busy.filter(entry => !rows.includes(entry) && !speaking(entry)) }
-}
+// The capsule leaves out the round's current speaker, which its round shows.
+const dockMembers = busy => busy.filter(entry => !(entry.state === 'work' && entry.here && entry.doing.speaking === true))
+
++export const workState = doing => (doing?.switching ? 'thinking' : toolState(doing?.tool ?? ''))
+
// The groups a Bot is at work in.
export function botGroupWork(botId, work, roster) {
return Object.entries(work.rooms ?? {}).flatMap(([roomId, entries]) => {
@@@ -58,48 -61,34 +60,48 @@@ export function summaryText(busy)
return { waiting, doing }
}
-function Face({ entry, size }) {
- return h('span', { className: 'bt-mw-face', 'data-ask': entry.state === 'ask' || undefined },
- h(BotMark, { bot: entry.bot, size, state: entry.state === 'ask' ? 'alert' : toolState(entry.doing?.tool ?? '') }))
+// What the capsule shows, as plain data: it outlives the work for its exit.
+function dockModel(sessionId, roster, work) {
+ const room = roster.roomsById[sessionId]
+ if (room) {
+ const busy = dockMembers(busyMembers(room, work, roster))
+ if (busy.length === 0) return null
+ const { waiting, doing } = summaryText(busy)
+ return {
+ open: { details: room.id },
- faces: busy.slice(0, FACES_MAX).map(entry => ({ id: entry.id, ask: entry.state === 'ask', tool: entry.doing?.tool ?? '' })),
++ faces: busy.slice(0, FACES_MAX).map(entry => ({ id: entry.id, ask: entry.state === 'ask', state: workState(entry.doing) })),
+ waiting, doing,
+ }
+ }
+ const bot = roster.byId[sessionId]
+ // A running own chat has its activity row.
+ if (!bot || (work.bots?.[bot.id] !== undefined && work.bots[bot.id].roomId === undefined)) return null
+ const groups = botGroupWork(bot.id, work, roster)
+ if (groups.length === 0) return null
+ const [first] = groups
+ return {
+ open: { session: first.room.id },
- faces: [{ id: bot.id, ask: false, tool: first.tool ?? '' }],
++ faces: [{ id: bot.id, ask: false, state: workState(first.doing) }],
+ waiting: '',
- doing: `${t('in {name}', { name: first.room.name })} · ${workPhrase(first.tool)}…${groups.length > 1 ? ` +${groups.length - 1}` : ''}`,
++ doing: `${t('in {name}', { name: first.room.name })} · ${workPhrase(first.doing)}…${groups.length > 1 ? ` +${groups.length - 1}` : ''}`,
+ }
}
- function Face({ bot, ask, tool }) {
-// One piece of work: the Bot's mark and what it is doing, like the activity row.
-function WorkRow({ bot, doing, label, at, now, onOpen }) {
- const text = `${label} · ${workPhrase(doing)}…`
- const elapsed = typeof at === 'number' && now - at >= 60000 ? elapsedLabel(now - at) : ''
- return h('button', { type: 'button', className: 'bt-mw-row', 'aria-label': [text, elapsed].filter(Boolean).join(' · '), title: text, onClick: onOpen },
- h(BotMark, { bot, size: 22, state: doing?.switching ? 'thinking' : toolState(doing?.tool ?? ''), live: true }),
- h('span', { className: 'bt-mw-row-text' }, h(Shimmer, null, text)),
- elapsed ? h('span', { className: 'bt-mw-row-time' }, `· ${elapsed}`) : null)
++function Face({ bot, ask, state }) {
+ return h('span', { className: 'bt-mw-face', 'data-ask': ask || undefined },
- h(BotMark, { bot, size: 20, state: ask ? 'alert' : toolState(tool) }))
++ h(BotMark, { bot, size: 20, state: ask ? 'alert' : state }))
}
-function SummaryLine({ busy, onOpen }) {
- const { waiting, doing } = summaryText(busy)
- return h('div', { className: 'bt-event bt-mw-dock' },
- h('button', { type: 'button', className: 'bt-event-whole bt-mw-line', 'aria-label': [waiting, doing].filter(Boolean).join(' · '), onClick: onOpen },
- h('span', { className: 'bt-mw-stack', 'aria-hidden': true }, busy.slice(0, 4).map(entry => h(Face, { key: entry.id, entry, size: 16 }))),
- waiting ? h('span', { className: 'bt-mw-ask' }, waiting) : null,
- waiting && doing ? h('span', { 'aria-hidden': true }, '·') : null,
- doing ? h('span', { className: 'bt-event-name' }, h(Shimmer, null, doing)) : null))
+// The capsule springs to the width of what it says; it is measured, so the spring runs
+// between two real widths. A capsule that comes back starts from its own width.
+function useFitWidth(inner, key) {
+ const [width, setWidth] = useState(null)
+ useLayoutEffect(() => { setWidth(key && inner.current ? inner.current.offsetWidth : null) }, [key])
+ return width
}
-// Above a group's composer: who is at work here, and a line for the rest; both open the
-// details panel. Above a Bot's own composer: the groups it is at work in, while its own
-// chat is idle (a running own chat has its activity row).
+// Above the composer, one capsule for everything at work: it opens the group's details,
+// or from a Bot's own chat the group it is at work in.
export function MemberDock({ sessionId, useRoster, useWork, actions }) {
const roster = useRoster(value => value)
const work = useWork(value => value)
@@@ -162,15 -182,6 +164,15 @@@ export function MemberState({ entry, bo
const where = entry.doing.roomId === room.id ? ''
: entry.doing.roomId ? t('in {name}', { name: roster.roomsById[entry.doing.roomId]?.name ?? t('a group chat') })
: t('in its own chat')
+ return h('span', { className: 'bt-member-state' },
- h(Shimmer, null, `${workPhrase(entry.doing.tool)}…`), where ? ` ${where}` : '', since(now, entry.doing.since))
++ h(Shimmer, null, `${workPhrase(entry.doing)}…`), where ? ` ${where}` : '', since(now, entry.doing.since))
+}
+
+// Work in this group can be stopped from its details, since the user cannot reach the
+// member's group Session otherwise.
+export function StopMemberWork({ entry, bot, room, actions }) {
+ const [stopping, setStopping] = useState(false)
+ if (entry?.state !== 'work' || !entry.here) return null
const stop = () => {
setStopping(true)
void Promise.resolve(actions.stopMemberWork(room.id, bot.id))
diff --cc ds-bot/test/member-status.test.js
index 5f183c99,1cc35cf2..d3912be8
--- a/ds-bot/test/member-status.test.js
+++ b/ds-bot/test/member-status.test.js
@@@ -80,7 -78,21 +80,15 @@@ test('one capsule names who waits and w
test('a Bot\'s own chat shows the groups it is at work in, unless its own chat runs', () => {
const away = { bots: { a: { since: 1, roomId: 'r1', tool: 'pwsh' } }, rooms: { r1: [{ botId: 'a', since: 1, tool: 'pwsh' }], r2: [{ botId: 'a', since: 1 }] }, approvals: [] }
- assert.deepEqual(rowLabels(dock('a', away)), ['in Ops · Running shell commands…', 'in Docs · Thinking about it…'])
- assert.deepEqual(rowLabels(dock('a', { ...away, bots: { a: { since: 1 } } })), [])
+ assert.deepEqual(plain(dock('a', away)), { label: 'in Ops · Running shell commands… +1', calls: [['session', 'r1']] })
+ assert.equal(dock('a', { ...away, bots: { a: { since: 1 } } }), null)
assert.equal(dock('b', away), null)
})
+
-test('a row says what a member does in its call\'s own words, and that it moves to a fresh conversation', () => {
- const work = {
- bots: {},
- rooms: { r1: [
- { botId: 'a', since: 1, tool: 'pwsh', note: 'Download Ghidra 12.1.4 and check its hash.' },
- { botId: 'b', since: 1, tool: 'read', target: 'dump.py' },
- { botId: 'c', since: 1, switching: true },
- { botId: 'd', since: 1, tool: 'pwsh', said: '解压 Ghidra,顺便写脚本。', note: 'Expand-Archive' },
- ] },
- approvals: [],
- }
- assert.deepEqual(rowLabels(dock('r1', work)), ['Anvil · Download Ghidra 12.1.4 and check its hash…', 'Flint · Opening a file · dump.py…', 'Prism · Moving to a fresh conversation…', 'Quill · 解压 Ghidra,顺便写脚本…'])
++test('the capsule says what a member does in its call\'s own words, and that it moves to a fresh conversation', () => {
++ const label = doing => dock('r1', { bots: {}, rooms: { r1: [{ botId: 'a', since: 1, ...doing }] }, approvals: [] }).label
++ assert.equal(label({ tool: 'pwsh', note: 'Download Ghidra 12.1.4 and check its hash.' }), 'Anvil · Download Ghidra 12.1.4 and check its hash…')
++ assert.equal(label({ tool: 'read', target: 'dump.py' }), 'Anvil · Opening a file · dump.py…')
++ assert.equal(label({ switching: true }), 'Anvil · Moving to a fresh conversation…')
++ assert.equal(label({ tool: 'pwsh', said: '解压 Ghidra,顺便写脚本。', note: 'Expand-Archive' }), 'Anvil · 解压 Ghidra,顺便写脚本…')
+ })