Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Team rooms: bots split work into threads when asked, and each work thread shows one status (#7719)
Milind Sonic01144826f5e
diff --git a/docs/team-board.md b/docs/team-board.mdindex b19138f15c..8844ffba0f 100644--- a/docs/team-board.md+++ b/docs/team-board.md@@ -2,15 +2,42 @@A work layer over a Team Cloud's rooms. A room thread can carry one **board item**: a title, a state, what it waitsfor, labels, and which bot may take it. Rooms and threads stay what they are; the item only says where the work in that-thread stands. Nothing new is shown to anyone: a person sees an item exactly when they can see its room thread.+thread stands. A person sees an item exactly when they can see its room thread.-It is off unless an Owner or Admin turns on **Board** in Settings → Features (`features.teamBoard` in `config.json`).-The switch exists only on a Team Cloud; anywhere else, and while it is off, the routes below answer 404.+It is on every Team Cloud, with no switch; anywhere else the routes below answer 404 and the bots have no board tools.+An older `config.json` that still has `features.teamBoard` loads as before, and the key is dropped.-The server hands each ready item to a free bot of its room and starts that bot's turn in the item's thread; the bot-settles it with its board tools. There is no Board page: items are read and changed through the routes below and the-bots' tools, and a room thread whose item waits on a person shows as waiting on you, as an open card does. Repeating-items come later.+People never see the word "board". A person asks a bot in a room to split work up (or hands it a goal with clear+separate parts); the bot calls `board_add`, which opens one room thread per piece, and the server hands each ready piece+to a free bot of the room and starts that bot's turn in the piece's thread; the bot settles it with its board tools.+There is no Board page and nothing to fill in. Repeating items come later.++## What people see++A room thread that is an item shows one short status on its row in the room feed and under its title when it is open+beside the feed (`src/lib/room-work.ts`):++| State | Status |+|---|---|+| `waiting`, `ready` | Up next |+| `working` | *Bot* working (on the row only while no turn runs: the row's own line says a bot is working while one does) |+| `needs_person` | Needs you, when the viewer was asked or nobody in particular was; else Needs *name* |+| `done` | Done |+| `failed` | Stopped |+| `cancelled` | nothing |++On a row the status stands where "Closed" would. A room thread whose item waits on a person also shows as waiting on+you, as an open card does. A room with no threads yet says, under its empty line, that a bot can split big work into+threads. The feed reads `GET /api/board?groupId=` and follows `board.item` frames.++## What bots are told++Every room turn on a Team Cloud carries one line (`ROOM_SPLIT_PROMPT`, `server/system-prompt.ts`): when a person asks to+split or share out work, or hands over a goal with clearly separate parts, use `board_add`; otherwise just answer; never+split a small request or a piece you were handed. When someone asks to see the work or where it stands, the bot calls+`board_list` and shows it in the chat with the existing `show_html` tool, one compact page grouped by the statuses above,+and replaces that page by its `app_id` when asked again; never unasked. No tool was added for it. `board_add` itself refuses a call from a thread that is already an+item, so a bot working one piece cannot turn it into more turns.## The item@@ -51,7 +78,7 @@ Every other move is refused with 409 `board_bad_move`. The rules are `server/boa## Dispatch-`server/board/dispatcher.ts`, wired in `server/board/wiring.ts`. It runs on a Team Cloud with the board on, whenever the+`server/board/dispatcher.ts`, wired in `server/board/wiring.ts`. It runs on a Team Cloud, whenever theboard changes, a bot's state changes, the runtime reports a turn's node changed, and on the shared due-timer.- **Per bot.** A bot runs one room turn at a time and only when idle everywhere. For each `ready` item, oldest first,@@ -62,7 +89,7 @@ board changes, a bot's state changes, the runtime reports a turn's node changed,waiting). A refusal pauses every dispatch until the cap resets; no attempt is counted.- **Model.** A bot whose engine is missing is passed over for 10 minutes.- **The turn.** `take` (attempts + 1), then `startGroupTurn` in the item's thread with `@Bot` and the bot as the one- mention, as unattended work (`trigger: { kind: "bot" }`, never the person's own request), from a sender named Board+ mention, as unattended work (`trigger: { kind: "bot" }`, never the person's own request), from a sender named Handoffwith no person behind it. The line carries the item's title, its thread's first line, what each need came to, and howto finish. A start the server refuses hands the item back (or fails it at the third attempt) and waits a minute.- **The lease is the turn.** An item still `working`, not set aside, whose thread is idle 20 seconds or more after its@@ -81,18 +108,19 @@ board changes, a bot's state changes, the runtime reports a turn's node changed,## Bot tools-Listed only on a Team Cloud with the board on (`OMB_TEAM_BOARD`), in chats and in rooms, deferred for Claude; each is-in the core tool group. The internal routes are `server/routes/board-tools.ts`; a confined turn (work from outside)+Listed to every bot of a Team Cloud (`OMB_TEAM_BOARD`, set from the Team Cloud itself), in chats and in rooms,+deferred for Claude; each is in the core tool group. The internal routes are `server/routes/board-tools.ts`; a confined turn (work from outside)cannot reach them.- `board_add` `{ room?, items: [{ key, title, brief?, needs?, labels?, for? }] }`: 1 to 15 items, each on a new thread ofthe room (default: the room of the turn), the bot's `brief` (or the title) as its first line, written as the bot's.`needs` are keys of the same call or item ids of the room; `for` is a bot's name in the room. Everything is checked- before the first thread opens, so a bad entry leaves nothing behind. Only rooms the bot is a member of.+ before the first thread opens, so a bad entry leaves nothing behind. Only rooms the bot is a member of, and never from+ a thread that is already an item.- `board_list` `{ room?, state? }`: the items of the bot's rooms, one line each, at most 60.- `board_update` `{ item?, move?, text?, person?, minutes?, labels? }`: the item of this thread unless `item` is given.`done` and `failed` take `text` as the result; `ask` posts `text` as the bot's line in the thread and puts it in the- inbox of `person` (a teammate's name or email), else of the person who made the item; `later` takes `minutes` (1 to+ inbox of `person` (a teammate's name or email), else of the person who made the item, and keeps their name on the item; `later` takes `minutes` (1 to1,440) and `text` as the note; `release` hands it back to ready. `labels` replaces them. Only the bot holding an itemmay settle, ask about or set it aside.@@ -101,7 +129,8 @@ cannot reach them.For every member and admin who is signed in (`server/routes/board.ts`). Writing needs what writing in the room needs:chat access to each of its bots.-- `GET /api/board[?groupId=]` → `{ items }`, the ones the caller can see, oldest first.+- `GET /api/board[?groupId=]` → `{ items, you }`, the ones the caller can see, oldest first; `you` is the caller's+ person key, as `question.person` names whoever was asked.- `POST /api/board/items` `{ groupId, title, text?, needs?, labels?, forBotId?, threadId? }` → 201 `{ item }`. Without`threadId` it opens a new thread in the room, without making it the room's current one, whose first line is `text`(or the title), written as the caller's; no bot answers it. With `threadId`, that thread of the room becomes the item.diff --git a/docs/verification/team-board.md b/docs/verification/team-board.mdindex 0471d319c7..af9d6da694 100644--- a/docs/verification/team-board.md+++ b/docs/verification/team-board.md@@ -12,10 +12,11 @@ pnpm exec vitest run server/board server/cloud-team-board.e2e.test.ts server/closettling hands the item back and the third fails it; nothing starts in the first two minutes or twice; a dependentstarts once its need is done; a refused start; a person's reply; an inbox answer; `later`.- `server/cloud-team-board-dispatch.e2e.test.ts`: a Team Cloud whose board waits run 20 times faster- (`OMB_BOARD_TIME_SCALE=0.05`); the tools are listed only with the switch on; a person's item reaches Writer as+ (`OMB_BOARD_TIME_SCALE=0.05`); the tools are listed to every bot with no switch, and a room turn carries the split+ line; a person's item reaches Writer asunattended work (its usage row's trigger is `bot`) and its done result reaches the review that needed it; an asklands in the maker's inbox, the room thread shows waiting on you, and her reply goes to Writer although Reviewer is- the room's default; `board_add` from Lead; `later`.+ the room's default; `board_add` from Lead, and refused from inside an item's thread; `later`.What only a real model shows is whether a bot reads its line and uses the tools well. That pass is by hand.@@ -28,8 +29,7 @@ export OMB_OPENROUTER_API_KEY=… # or OMB_ANTHROPIC_API_KEY (Claude botsnode --experimental-strip-types scripts/launch-team-board.ts```-It makes a temp folder for the server's HOME and data folder (never `~/.openmausbot`), starts a Team Cloud with the board-on, pairs an Owner ([email protected]) and a Member ([email protected]) with the Admin's signed claims, and prints the URL,+It makes a temp folder for the server's HOME and data folder (never `~/.openmausbot`), starts a Team Cloud, pairs an Owner ([email protected]) and a Member ([email protected]) with the Admin's signed claims, and prints the URL,both tokens and a header line `H`. Ctrl-C stops it and removes the folder. `--offline` starts it with no network atall, to check that it starts and pairs.@@ -50,10 +50,10 @@ curl -s $H -H "authorization: Bearer $OWNER" -X POST $BASE/api/groups \## The pass1. **Lead splits a goal.** As Mira, write in the room's thread: `@Lead Plan our launch post: Writer drafts it, Reviewer- reviews the draft. Put it on the board with board_add.` Expect two new room threads with items; the review `needs`+ reviews the draft. Split it up.` Expect two new room threads with items; the review `needs`the draft and is `for` Reviewer (`GET /api/board`).2. **A worker takes it.** About two minutes after the server started (sooner with the scale), the draft goes to Writer:- its thread gets a line from Board starting `@Writer`, and Writer works there.+ its thread gets a line from Handoff starting `@Writer`, and Writer works there.3. **Kill it mid-run.** While Writer works, write `@Writer stop` in the draft thread as Mira. Writer's turn stops andWriter is held in the room. Within about 20 s the item is `ready` again with `attempts: 1`, and the next free memberbot (Lead or Reviewer) is started on it (`attempts: 2`); held Writer is not (lift the hold as `server/room-holds.ts` says).@@ -66,8 +66,8 @@ curl -s $H -H "authorization: Bearer $OWNER" -X POST $BASE/api/groups \6. **The dependent readies.** When Writer calls `board_update done`, the review becomes `ready` and goes to Reviewer,whose line from Board lists what the draft came to.7. **Later.** Ask a bot to `board_update later` with `minutes: 1` and a note; the item stays `working`, the bot takes- other items meanwhile, and after a minute the same bot gets a Board line with its note.+ other items meanwhile, and after a minute the same bot gets a Handoff line with its note.-Things to look for: each Board line is in the thread's language; the usage page counts these turns as the bot's own+Things to look for: each Handoff line is in the thread's language; a small request is answered, not split; the usage page counts these turns as the bot's own(unattended), never as Mira's request; nothing asks anyone to approve anything; a spend limit set below what is spent(Settings → Spending) leaves every ready item ready and starts nothing until it is raised.diff --git a/packages/phone-protocol/src/board.ts b/packages/phone-protocol/src/board.tsindex 9ba0940961..36a3125cc0 100644--- a/packages/phone-protocol/src/board.ts+++ b/packages/phone-protocol/src/board.ts@@ -19,6 +19,8 @@ export interface BoardItemQuestion {askedAt: number;/** The person key of whoever was asked; absent when anyone who sees the room may answer. */person?: string;+ /** That person's name when they were asked, for showing whom the item waits on. */+ name?: string;}/** Its bot set the item aside to look again at `at` (board_update later): the item stays `working` and keeps its holder,@@ -115,6 +117,8 @@ export interface BoardItemPatchBody {/** GET /api/board (`?groupId=` for one room): the items the caller can see, oldest first. */export interface BoardListResponse {items: BoardItem[];+ /** The caller's person key, as an item's `question.person` names whoever was asked. */+ you?: string;}export interface BoardItemResponse {diff --git a/scripts/ci-scope.mjs b/scripts/ci-scope.mjsindex 86596ee973..56a4aced5a 100644--- a/scripts/ci-scope.mjs+++ b/scripts/ci-scope.mjs@@ -70,6 +70,7 @@ export const VITEST_SUBSETS = {"scripts/testing/team-own-chat.e2e.test.ts","scripts/testing/team-private-default-ui.e2e.test.ts","scripts/testing/team-side-switch-ui.e2e.test.ts",+ "scripts/testing/work-status-ui.e2e.test.ts","server/body-thread-guards.e2e.test.ts","server/check-work-team.e2e.test.ts","server/client-notifications.e2e.test.ts",diff --git a/scripts/ci-scope.test.ts b/scripts/ci-scope.test.tsindex b37403d52a..a620c205e8 100644--- a/scripts/ci-scope.test.ts+++ b/scripts/ci-scope.test.ts@@ -210,6 +210,7 @@ describe("CI outputs", () => {"scripts/testing/team-own-chat.e2e.test.ts","scripts/testing/team-private-default-ui.e2e.test.ts","scripts/testing/team-side-switch-ui.e2e.test.ts",+ "scripts/testing/work-status-ui.e2e.test.ts","server/body-thread-guards.e2e.test.ts","server/check-work-team.e2e.test.ts","server/client-notifications.e2e.test.ts",diff --git a/scripts/launch-team-board.ts b/scripts/launch-team-board.tsindex 33b96426f0..b131e7441b 100644--- a/scripts/launch-team-board.ts+++ b/scripts/launch-team-board.ts@@ -1,12 +1,12 @@// A throwaway Team Cloud on this computer for a real-model pass over the Team Board (docs/verification/team-board.md).-// Everything lives in a new temp folder (its HOME and its data folder), the board is switched on, an Owner and a Member+// Everything lives in a new temp folder (its HOME and its data folder), an Owner and a Member// are paired the way the Admin pairs them, and the tokens and a few curl lines are printed. It runs until Ctrl-C and// then removes the folder. Only the provider keys named below cross from this shell into the server.// node --experimental-strip-types scripts/launch-team-board.ts [--offline]// --offline: the server reaches nothing but this computer (a check that it starts and pairs, with no model to answer).import { spawn } from "node:child_process";import { randomBytes, randomUUID } from "node:crypto";-import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";+import { mkdirSync, mkdtempSync, rmSync } from "node:fs";import { createServer } from "node:net";import { tmpdir } from "node:os";import { dirname, join } from "node:path";@@ -31,7 +31,6 @@ const freePort = () => new Promise<number>((resolve, reject) => {const root = mkdtempSync(join(tmpdir(), "omb-team-board-"));const dataDir = join(root, ".openmausbot");mkdirSync(dataDir, { recursive: true });-writeFileSync(join(dataDir, "config.json"), JSON.stringify({ features: { teamBoard: true } }));const port = await freePort();const secret = randomBytes(32).toString("base64url");const base = `http://127.0.0.1:${port}`;@@ -74,7 +73,7 @@ const owner = await pair("[email protected]", "owner");const member = await pair("[email protected]", "member");const headers = `-H 'host: ${HOST}' -H 'x-forwarded-proto: https' -H 'x-forwarded-for: 203.0.113.9' -H 'origin: https://${HOST}' -H 'content-type: application/json'`;console.log(`-Team Cloud with the board on: ${base} (data: ${dataDir})+Team Cloud: ${base} (data: ${dataDir})Provider keys passed: ${Object.keys(passed).join(", ") || "none"}OWNER=${owner}MEMBER=${member}diff --git a/scripts/testing/work-status-ui.e2e.test.ts b/scripts/testing/work-status-ui.e2e.test.tsnew file mode 100644index 0000000000..2102338c25--- /dev/null+++ b/scripts/testing/work-status-ui.e2e.test.ts@@ -0,0 +1,235 @@+// A Team Cloud room whose work a bot split into threads, in the real app in headless Chrome: Lead splits Mira's ask with+// board_add (one room thread per piece), and each work thread shows one short status on its feed row and over it when+// it is open beside the feed (Up next, Writer working, Needs you, Needs Mira, Done, Stopped), with no switch and no+// "Board" anywhere a person reads. A live change moves a row's status, and an empty room says a bot can split big work.+// The pieces' states are written to board.json and the Cloud restarted on it; the dispatcher's quiet minutes last hours+// here, so nothing moves them. Asked where the work stands, Lead (the synthetic Claude CLI) shows it in the thread with+// show_html, grouped by the same statuses. Run with OMB_UI_E2E=1; OMB_WORK_STATUS_SHOTS=DIR keeps the screenshots.+import { randomBytes } from "node:crypto";+import { mkdirSync, readFileSync, writeFileSync } from "node:fs";+import { join } from "node:path";+import { afterAll, beforeAll, describe, expect, it } from "vitest";++import { WELCOME_VERSION } from "../../electron/onboarding-record.mjs";+import type { BoardItem } from "../../shared/board.ts";+import { personKey } from "../../server/person-key.ts";+import { hostTimeout } from "../../server/testing/host-timeout.ts";+import { SPOTLIGHTS } from "../../src/lib/first-conversation.ts";+import { TOUR_STEPS } from "../../src/lib/guided-tour.ts";+import { NOTICES } from "../../src/lib/notices.ts";+import { launchCloudSendFixture, type CloudSendFixture, type CloudTeamFixture } from "./cloud-send-fixture.ts";+import { agentBrowser, ensureUiBrowser, sessionEnv } from "./control-omb-ui.ts";+import { mountPreview, REPO_ROOT } from "./preview-fixture.ts";++const enabled = process.env.OMB_UI_E2E === "1";+if (!enabled) console.info("skipping the work status UI e2e: set OMB_UI_E2E=1");++const SHOTS = process.env.OMB_WORK_STATUS_SHOTS || join(REPO_ROOT, ".omb-scratch", "work-status");+const WIDE = ["1440", "900"] as const, NARROW = ["900", "800"] as const;+const OLIVE = { email: "[email protected]", role: "owner" as const };+const MIRA = { email: "[email protected]", role: "member" as const };+/** The synthetic CLI calls the tools tool-calls.json names for a word of the turn's newest line. */+const ENGINE = `const dir = process.env.FAKE_CLAUDE_FIXTURE_DIR;+process.env.FAKE_CLAUDE_TOOL_CALLS_FILE = dir + "/tool-calls.json";+process.env.FAKE_CLAUDE_MARKERS_LATEST = "1";`;+/** What a bot's work view looks like: one compact page, grouped by what people see on the threads. */+function workPage(groups: Array<[string, string[]]>): string {+ const section = ([status, titles]: [string, string[]]) => `<section><h3>${status}</h3><ul>${titles.map((title) => `<li>${title}</li>`).join("")}</ul></section>`;+ return `<style>body{margin:0;font:13px/18px var(--font-sans);color:var(--color-text-primary);background:transparent}+main{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;padding:12px}+section{border:0.5px solid var(--color-border-primary);border-radius:10px;padding:8px 10px}+h3{margin:0 0 4px;font-size:12px;font-weight:600;opacity:.85}+ul{margin:0;padding:0;list-style:none}li{padding:2px 0}</style>+<main>${groups.map(section).join("")}</main>`;+}+const DISMISS = `(() => { [...document.querySelectorAll('[role="dialog"] button, dialog button')].find((button) => button.textContent.trim() === "Not now")?.click(); return true; })()`;++type Bot = { id: string; name: string };+type Room = { id: string; threadId: string };++let fx: CloudSendFixture, team: CloudTeamFixture;+let tools: { binary: string; chrome: string | null };+let olive = "", mira = "";+let writer: Bot, reviewer: Bot, lead: Bot, launch: Room, quiet: Room;+const pieces: Record<string, BoardItem> = {};++async function openApp(size: readonly [string, string]) {+ const preview = await mountPreview({ info: { url: team.base } }, { entry: "/scripts/testing/threads-preview.tsx", route: "/__threads.html", title: "Work status",+ logLevel: "warn", proxyHeaders: { ...fx.edge, authorization: `Bearer ${olive}` } });+ // agent-browser 0.37 refuses a socket path over 103 bytes, and it lives under this home.+ const home = join(fx.root, "b0");+ mkdirSync(join(home, "tmp"), { recursive: true });+ const env = sessionEnv({ home, session: "w0", chrome: tools.chrome });+ const browser = (...args: string[]) => agentBrowser(tools.binary, env, args, 120_000);+ await browser("set", "viewport", ...size);+ const evaluate = async <T>(js: string) => (await browser("eval", js)).result as T;+ await browser("open", new URL("/package.json", preview.previewUrl).href);+ await evaluate(`(() => { for (const notice of ${JSON.stringify(NOTICES)}) localStorage.setItem(notice, "1"); return true; })()`);+ await browser("open", preview.previewUrl);+ const until = (js: string, timeout = 60_000) => expect.poll(() => evaluate<boolean>(`Boolean(${js})`), { timeout, interval: 400 }).toBe(true).catch(async (cause: unknown) => {+ await browser("screenshot", join(SHOTS, "failed.png")).catch(() => {});+ throw new Error(`${js} never held`, { cause });+ });+ const click = async (selector: string) => {+ await until(`document.querySelector(${JSON.stringify(selector)})`);+ await evaluate(`document.querySelector(${JSON.stringify(selector)}).click(); true`);+ };+ return {+ evaluate, until, click, browser,+ statuses: () => evaluate<Record<string, string>>(`Object.fromEntries([...document.querySelectorAll('[data-feed-thread]')].map((row) => [row.dataset.feedThread, row.querySelector('[data-feed-work]')?.textContent ?? '']))`),+ async ready() {+ // Rooms are on the Team side; the offer of one's own MausBot is left for later.+ await until(`${DISMISS} && (document.querySelector('[data-team-side-option="team"]')?.click(), document.querySelector('[data-sidebar-group-row]'))`);+ for (const label of ["Skip setup", "Hide setup"]) {+ await evaluate(`[...document.querySelectorAll('button')].find((button) => button.textContent.trim() === ${JSON.stringify(label)})?.click(); true`);+ await new Promise((resolve) => setTimeout(resolve, 400));+ }+ await evaluate(DISMISS);+ },+ async skins(name: string) {+ for (const skin of ["midnight", "daylight"]) {+ await evaluate(`import('/src/lib/skins.ts').then(({ applySkin }) => { applySkin(${JSON.stringify(skin)}); return true; })`);+ await new Promise((resolve) => setTimeout(resolve, 700));+ await browser("screenshot", join(SHOTS, `${name}-${skin}.png`));+ }+ await evaluate("import('/src/lib/skins.ts').then(({ applySkin }) => { applySkin('midnight'); return true; })");+ },+ async close() {+ await browser("close").catch(() => {});+ await preview.close();+ },+ };+}++(enabled ? describe : describe.skip)("a work thread's one status, in the real app on a Team Cloud", () => {+ let app: Awaited<ReturnType<typeof openApp>> | null = null;++ beforeAll(async () => {+ mkdirSync(SHOTS, { recursive: true });+ tools = await ensureUiBrowser(process.env);+ fx = await launchCloudSendFixture({ onePasswordToken: `ops_fake-work-status-${randomBytes(8).toString("hex")}`,+ team: { id: "team-acme-work-ui", name: "Acme", engine: ENGINE, env: { OMB_BOARD_TIME_SCALE: "1000" } } });+ team = fx.team!;+ olive = (await team.pair(OLIVE)).token!;+ mira = (await team.pair(MIRA)).token!;+ writeFileSync(join(team.home, "tool-calls.json"), "{}");+ const onboarding = { completedAt: new Date().toISOString(), version: WELCOME_VERSION, hintsSeen: [...TOUR_STEPS.map((step) => step.id), ...SPOTLIGHTS, "cloud-welcome-done", "cloud-setup-hidden"] };+ expect((await team.as(olive, "PATCH", "/api/config", { onboarding, language: "en" })).status).toBe(200);+ for (const token of [olive, mira]) await team.as(token, "PUT", "/api/me/welcome", { welcomed: true });+ const bot = async (name: string) => {+ const made = await team.as(olive, "POST", "/api/bots", { name, visibility: "everyone" });+ expect(made.status, JSON.stringify(made.body)).toBe(201);+ return made.body.bot as Bot;+ };+ writer = await bot("Writer");+ reviewer = await bot("Reviewer");+ lead = await bot("Lead");+ const room = async (name: string) => {+ const made = await team.as(olive, "POST", "/api/groups", { name, memberIds: [writer.id, reviewer.id, lead.id], setup: { bulletin: "", defaultResponder: { kind: "member", botId: lead.id } } });+ expect(made.status, JSON.stringify(made.body)).toBe(201);+ return made.body.group as Room;+ };+ launch = await room("Launch");+ quiet = await room("Ideas");++ const asked = await team.as(mira, "POST", `/api/groups/${launch.id}/messages`, { text: "@Lead Plan the launch and split it up between you.", threadId: launch.threadId });+ expect(asked.status, JSON.stringify(asked.body)).toBe(202);+ for (const end = Date.now() + 60_000; !((await team.as(olive, "GET", "/api/bots")).body.bots as Array<{ busy?: boolean }>).every((one) => !one.busy);) {+ if (Date.now() > end) throw new Error("Lead's turn did not end");+ await new Promise((resolve) => setTimeout(resolve, 300));+ }+ // Lead splits the work, as its tool does when a person asks: one room thread per piece, Lead's brief first in each.+ const bearer = await team.capability(lead.id, launch.threadId);+ const split = await fetch(`${team.base}/api/internal/board/add`, { method: "POST", headers: { authorization: `Bearer ${bearer}`, "content-type": "application/json" }, body: JSON.stringify({ items: [+ { key: "research", title: "Research venues", brief: "Shortlist three venues near the office that fit 80 people." },+ { key: "venue", title: "Book the venue", brief: "Book the venue the team picks from the shortlist.", needs: ["research"] },+ { key: "date", title: "Pick the launch date", brief: "Find a Friday in March that works for marketing and sales." },+ { key: "draft", title: "Draft the launch post", brief: "Write a 300-word launch post for the blog.", for: "Writer" },+ { key: "review", title: "Review the post", brief: "Check the draft for tone and facts.", needs: ["draft"], for: "Reviewer" },+ { key: "banners", title: "Order printed banners", brief: "Order two roll-up banners from the usual printer." },+ ] }) });+ expect(split.status, await split.clone().text()).toBe(201);+ const items = (await team.as(olive, "GET", `/api/board?groupId=${launch.id}`)).body.items as BoardItem[];+ for (const item of items) pieces[item.title] = item;+ const at = Date.now();+ const holder = (bot: Bot) => ({ botId: bot.id, since: at - 60_000 });+ const states: Record<string, Partial<BoardItem>> = {+ "Research venues": { state: "done", attempts: 1, result: "The Loft, Hall 9 and Riverside." },+ "Book the venue": { state: "needs_person", holder: holder(writer), attempts: 1, question: { text: "Which of the three should I book?", askedAt: at, person: personKey({ id: "", email: OLIVE.email }), name: "Olive" } },+ "Pick the launch date": { state: "needs_person", holder: holder(lead), attempts: 1, question: { text: "Does March 13 work for sales?", askedAt: at, person: personKey({ id: "", email: MIRA.email }), name: "Mira" } },+ "Draft the launch post": { state: "working", holder: holder(writer), attempts: 1 },+ "Review the post": { state: "waiting" },+ "Order printed banners": { state: "failed", attempts: 3, result: "Stopped after 3 tries." },+ };+ // Written while nothing changes the board, then read again by the restarted Cloud.+ const file = join(team.home, ".openmausbot", "board.json");+ const stored = JSON.parse(readFileSync(file, "utf8")) as { version: 1; items: BoardItem[]; repeats: unknown[] };+ stored.items = stored.items.map((item) => ({ ...item, ...states[item.title] }));+ writeFileSync(file, JSON.stringify(stored, null, 2));+ await team.relaunch();+ }, hostTimeout(300_000));++ afterAll(async () => {+ await app?.close().catch(() => {});+ await fx?.close();+ }, hostTimeout(120_000));++ it("shows each work thread's status on its row and over it when open, in both reference skins", async () => {+ app = await openApp(WIDE);+ await app.ready();+ await app.click(`[data-sidebar-group-row="${launch.id}"]`);+ await app.until(`document.querySelectorAll('[data-feed-thread] [data-feed-work]').length === 6`);+ const byTitle = (title: string) => pieces[title]!.threadId;+ expect(await app.statuses()).toMatchObject({+ [byTitle("Research venues")]: "Done",+ [byTitle("Book the venue")]: "Needs you",+ [byTitle("Pick the launch date")]: "Needs Mira",+ [byTitle("Draft the launch post")]: "Writer working",+ [byTitle("Review the post")]: "Up next",+ [byTitle("Order printed banners")]: "Stopped",+ });+ expect(await app.evaluate<string>("document.querySelector('main').innerText"), "no Board for people").not.toMatch(/\bBoard\b/);+ const mark = (title: string) => app!.evaluate<string | null>(`document.querySelector('[data-feed-thread="${byTitle(title)}"] [data-feed-mark]')?.dataset.feedMark ?? null`);+ expect(await mark("Pick the launch date"), "what waits on Mira does not wait on Olive").not.toBe("waiting");+ expect(await mark("Book the venue")).toBe("waiting");+ await app.evaluate(`document.querySelector('[data-feed-thread="${byTitle("Book the venue")}"] > button').click(); true`);+ await app.until(`document.querySelector('[data-thread-panel="${byTitle("Book the venue")}"] [data-thread-work="needs"]')`);+ expect(await app.evaluate<string>(`document.querySelector('[data-thread-work]').textContent`)).toBe("Needs you");+ await app.skins("01-feed-and-thread-1440");++ // A live change moves the row: Olive marks the post's draft done, and its review is up next as before.+ const done = await team.as(olive, "PATCH", `/api/board/items/${byTitle("Draft the launch post")}`, { move: "done", result: "Draft in the doc." });+ expect(done.status, JSON.stringify(done.body)).toBe(200);+ await app.until(`document.querySelector('[data-feed-thread="${byTitle("Draft the launch post")}"] [data-feed-work]')?.textContent === "Done"`);+ }, hostTimeout(300_000));++ it("keeps the statuses where the feed and the thread share a narrow window, and an empty room hints at splitting", async () => {+ await app!.browser("set", "viewport", ...NARROW);+ await new Promise((resolve) => setTimeout(resolve, 800));+ await app!.until(`document.querySelectorAll('[data-feed-thread] [data-feed-work]').length >= 5 && document.querySelector('[data-thread-work]')`);+ await app!.browser("screenshot", join(SHOTS, "02-feed-and-thread-narrow-900-midnight.png"));+ await app!.browser("set", "viewport", ...WIDE);+ await app!.click(`[data-sidebar-group-row="${quiet.id}"]`);+ await app!.until("document.querySelector('[data-feed-split-hint]')");+ expect(await app!.evaluate<string>("document.querySelector('[data-feed-split-hint]').textContent")).toBe("Ask a bot to split big work into threads.");+ await app!.skins("04-empty-room-hint-1440");+ }, hostTimeout(300_000));++ it("shows where the work stands in the thread when a person asks, as one page grouped by the same statuses", async () => {+ const page = workPage([["Needs you", ["Book the venue"]], ["Needs Mira", ["Pick the launch date"]], ["Up next", ["Review the post"]],+ ["Done", ["Research venues", "Draft the launch post"]], ["Stopped", ["Order printed banners"]]]);+ writeFileSync(join(team.home, "tool-calls.json"), JSON.stringify({ stand: [+ { name: "board_list", server: "agents", input: { room: "Launch" } },+ { name: "show_html", server: "agents", input: { title: "Launch: where the work stands", html: page, height: 200 } },+ ] }));+ await app!.click(`[data-sidebar-group-row="${launch.id}"]`);+ await app!.until(`document.querySelector('[data-feed-thread="${launch.threadId}"]')`);+ await app!.evaluate(`document.querySelector('[data-feed-thread="${launch.threadId}"] > button').click(); true`);+ await app!.until(`document.querySelector('[data-thread-panel="${launch.threadId}"]')`);+ const sent = await team.as(olive, "POST", `/api/groups/${launch.id}/messages`, { text: "@Lead where does the work stand?", threadId: launch.threadId });+ expect(sent.status, JSON.stringify(sent.body)).toBe(202);+ await app!.until(`document.querySelector('[data-thread-panel="${launch.threadId}"] iframe[data-app-frame]')`, 90_000);+ await new Promise((resolve) => setTimeout(resolve, 1_500));+ await app!.skins("05-work-view-in-thread-1440");+ }, hostTimeout(300_000));+});diff --git a/server/board/dispatcher.test.ts b/server/board/dispatcher.test.tsindex 186723d9e8..3be015e83e 100644--- a/server/board/dispatcher.test.ts+++ b/server/board/dispatcher.test.ts@@ -183,7 +183,7 @@ describe("board dispatcher", () => {expect(state(item.threadId)).toMatchObject({ state: "working", attempts: 1 });});- it("looks at nothing while the switch is off", async () => {+ it("looks at nothing off a Team Cloud", async () => {const { h, dispatcher, add, pastQuiet } = harness({ on: false });add("Hidden");pastQuiet();diff --git a/server/board/dispatcher.ts b/server/board/dispatcher.tsindex 6d44d40940..a713830b83 100644--- a/server/board/dispatcher.ts+++ b/server/board/dispatcher.ts@@ -24,7 +24,7 @@ export type BoardBrief = { kind: "take"; item: BoardItem; botId: string } | { kiexport interface BoardDispatchDeps {board: Pick<Board, "list" | "get" | "move" | "onChange">;- /** A Team Cloud with `features.teamBoard` on. */+ /** A Team Cloud. */on(): boolean;now?: () => number;/** The room's member bots, in the room's order; null for no such room. */diff --git a/server/board/state.ts b/server/board/state.tsindex 738116c4eb..9e43dbaf56 100644--- a/server/board/state.ts+++ b/server/board/state.ts@@ -26,7 +26,7 @@ export type BoardMove =| { move: "take"; botId: string }| { move: "done"; result?: string }| { move: "failed"; result?: string }- | { move: "ask"; question: string; person?: string }+ | { move: "ask"; question: string; person?: string; name?: string }/** The holder sets the item aside until `at`; the dispatcher's `wake` starts it again then, with `note`. */| { move: "later"; at: number; note: string }| { move: "wake" }@@ -152,7 +152,7 @@ export function applyMove(item: BoardItem, move: BoardMove, actor: BoardActor, iif (!text) throw badInput("Say what you want to ask.");if (text.length > BOARD_LIMITS.questionMax) throw badInput(`A question is at most ${BOARD_LIMITS.questionMax} characters.`);const { later: _later, ...rest } = item;- return { ...rest, state: "needs_person", question: { text, askedAt: now, ...(move.person ? { person: move.person } : {}) }, updatedAt: now };+ return { ...rest, state: "needs_person", question: { text, askedAt: now, ...(move.person ? { person: move.person, ...(move.name ? { name: move.name } : {}) } : {}) }, updatedAt: now };}case "later": {const note = typeof move.note === "string" ? move.note.trim() : "";diff --git a/server/board/store.ts b/server/board/store.tsindex a0cd679cbb..804d25333a 100644--- a/server/board/store.ts+++ b/server/board/store.ts@@ -19,7 +19,7 @@ const itemSchema = z.looseObject({forBotId: id.optional(),holder: z.object({ botId: id, since: z.number() }).optional(),attempts: z.number().int().min(0),- question: z.object({ text: z.string(), askedAt: z.number(), person: z.string().optional() }).optional(),+ question: z.object({ text: z.string(), askedAt: z.number(), person: z.string().optional(), name: z.string().optional() }).optional(),later: z.object({ at: z.number(), note: z.string() }).optional(),laterCount: z.number().int().min(0).optional(),result: z.string().optional(),diff --git a/server/board/wiring.ts b/server/board/wiring.tsindex a7fc63d200..87034dc99f 100644--- a/server/board/wiring.ts+++ b/server/board/wiring.ts@@ -18,10 +18,8 @@ const BRIEF_TEXT_MAX = 2_000;export interface TeamBoardDeps {dataDir: string;- /** A Team Cloud. */+ /** A Team Cloud: the board exists only there. */team: boolean;- /** `features.teamBoard`, read on every request. */- enabled(): boolean;store: Pick<Store, "group" | "groups" | "groupByThread" | "groupTaskByThread" | "createGroupTask" | "patchGroupTask" | "appendMessage" | "messagesFor" | "bot" | "onChange">;visible(auth: RequestAuth): VisibleSet;person(auth: RequestAuth): BoardPerson | null;@@ -39,7 +37,7 @@ export interface TeamBoardDeps {/** startGroupTurn with this text, a non-person trigger and the bot as the one mentioned. */startTurn(groupId: string, threadId: string, botId: string, text: string, sender: ResolvedSender): void;/** Reaches the person's inbox with a bot's question (team-messages.ts `ask`). */- askPerson(botId: string, threadId: string, to: { name?: string; key?: string }, question: string, title: string): { status: number; text: string; person?: string };+ askPerson(botId: string, threadId: string, to: { name?: string; key?: string }, question: string, title: string): { status: number; text: string; person?: string; name?: string };/** A card in this thread waits on a person (person-waits.ts), which owns the thread's waiting state while it does. */cardWaiting(threadId: string): boolean;/** Multiplies the dispatcher's waits and a later's minute; only tests set it (OMB_BOARD_TIME_SCALE, up to 1,000). */@@ -48,7 +46,7 @@ export interface TeamBoardDeps {export function createTeamBoard(deps: TeamBoardDeps) {const { store } = deps;- const on = () => deps.team && deps.enabled();+ const on = () => deps.team;const scale = deps.timeScale && deps.timeScale > 0 && deps.timeScale <= 1_000 ? deps.timeScale : 1;const memberBots = (groupId: string) => {const room = store.group(groupId);@@ -164,7 +162,7 @@ export function createTeamBoard(deps: TeamBoardDeps) {if (bot) store.appendMessage(threadId, { role: "bot", kind: "text", text: question, from: { botId: bot.id, name: bot.name, color: bot.color } });if (!to.name && !to.key) return { ok: false, text: "Nobody made this item to ask, so the question waits in this thread for anyone who sees it." };const asked = deps.askPerson(botId, threadId, to, question, line(threadId, "server.board.askTitle", { bot: bot?.name ?? botId, title: item?.title ?? "" }));- return { ok: asked.status === 200, text: asked.text, ...(asked.person ? { person: asked.person } : {}) };+ return { ok: asked.status === 200, text: asked.text, ...(asked.person ? { person: asked.person, ...(asked.name ? { name: asked.name } : {}) } : {}) };},tooManyLaters: (threadId) => line(threadId, "server.board.tooManyLaters", { count: BOARD_LIMITS.latersMax }),}),diff --git a/server/cloud-team-board-dispatch.e2e.test.ts b/server/cloud-team-board-dispatch.e2e.test.tsindex b64a590c43..f97c5ffcb6 100644--- a/server/cloud-team-board-dispatch.e2e.test.ts+++ b/server/cloud-team-board-dispatch.e2e.test.ts@@ -81,25 +81,28 @@ afterAll(async () => {await fx?.close();});-it("lists no board tools while the switch is off, and refuses their calls", async () => {+it("lists the board tools to every bot of a Team Cloud with no switch, and tells a room's bots to split work only when asked", async () => {+ const dump = () => JSON.parse(readFileSync(file("dump.json"), "utf8")) as { systemPrompt?: string | null; mcpConfig?: { mcpServers?: { agents?: { env?: Record<string, string> } } } };+ const idle = () => until(async () => ((await team.as(olive, "GET", "/api/bots")).body.bots as Array<{ busy?: boolean }>).every((one) => !one.busy), "idle");rmSync(file("dump.json"), { force: true });const sent = await team.as(olive, "POST", `/api/bots/${writer.id}/messages`, { text: "Hello", threadId: writer.threadId });expect(sent.status, JSON.stringify(sent.body)).toBe(202);- await until(() => existsSync(file("dump.json")), "a turn");- const env = () => JSON.parse(readFileSync(file("dump.json"), "utf8")).mcpConfig?.mcpServers?.agents?.env as Record<string, string>;- expect(env().OMB_TEAM_BOARD).toBe("0");- const bearer = await team.capability(writer.id, launch.threadId);- const refused = await fetch(`${team.base}/api/internal/board/list`, { method: "POST", headers: { authorization: `Bearer ${bearer}`, "content-type": "application/json" }, body: "{}" });- expect(refused.status).toBe(404);- const on = await team.as(olive, "PATCH", "/api/config", { features: { teamBoard: true } });- expect(on.status, JSON.stringify(on.body)).toBe(200);- await until(async () => ((await team.as(olive, "GET", "/api/bots")).body.bots as Array<{ busy?: boolean }>).every((one) => !one.busy), "idle");+ await until(() => existsSync(file("dump.json")), "a chat turn");+ expect(dump().mcpConfig?.mcpServers?.agents?.env?.OMB_TEAM_BOARD).toBe("1");+ expect(dump().systemPrompt).toBeTruthy();+ expect(dump().systemPrompt ?? "", "the split line is for rooms").not.toContain("board_add");+ expect(dump().systemPrompt ?? "", "and so is the work view").not.toContain("call board_list and show it here with show_html");+ await idle();rmSync(file("dump.json"), { force: true });- await team.as(olive, "POST", `/api/bots/${writer.id}/messages`, { text: "Hello again", threadId: writer.threadId });- await until(() => existsSync(file("dump.json")), "a second turn");- expect(env().OMB_TEAM_BOARD).toBe("1");- // Writer's own chat turn must be over before the next case: a busy Writer would hand its first item to another bot.- await until(async () => ((await team.as(olive, "GET", "/api/bots")).body.bots as Array<{ busy?: boolean }>).every((one) => !one.busy), "idle again");+ const room = await team.as(mira, "POST", `/api/groups/${launch.id}/messages`, { text: "Hello room", threadId: launch.threadId });+ expect(room.status, JSON.stringify(room.body)).toBe(202);+ await until(() => existsSync(file("dump.json")), "a room turn");+ expect(dump().mcpConfig?.mcpServers?.agents?.env?.OMB_TEAM_BOARD).toBe("1");+ expect(dump().systemPrompt ?? "").toContain("When a person here asks you to split up or share out work");+ expect(dump().systemPrompt ?? "").toContain("When someone asks to see the work or where it stands, call board_list and show it here with show_html");+ expect(dump().systemPrompt ?? "").toContain("asked again, replace that page by its app_id. Never show it unasked.");+ // Every bot must be idle before the next case: a busy one would hand its first item to another bot.+ await idle();}, hostTimeout(90_000));it("hands a person's item to a free bot as unattended work, and a done item readies and dispatches what needs it", async () => {@@ -113,14 +116,14 @@ it("hands a person's item to a free bot as unattended work, and a done item readawait settled(alpha.threadId, "done");expect(await item(alpha.threadId)).toMatchObject({ result: "Draft at drafts/alpha.md", attempts: 1 });const lines = await messages(mira, alpha.threadId);- const brief = lines.find((line) => line.role === "user" && line.sender?.name === "Board")!;+ const brief = lines.find((line) => line.role === "user" && line.sender?.name === "Handoff")!;expect(brief.text).toMatch(/^@Writer /);expect(brief.text).toContain("Alpha draft");expect(brief.text).toContain("Write the launch post for Friday.");expect(brief.sender?.id, "the board is no person").toBeUndefined();await until(async () => (await messages(mira, alpha.threadId)).some((line) => line.role === "bot" && line.kind === "text" && line.from?.botId === writer.id), "Writer's reply");await settled(beta.threadId, "done");- const review = (await messages(mira, beta.threadId)).find((line) => line.sender?.name === "Board")!;+ const review = (await messages(mira, beta.threadId)).find((line) => line.sender?.name === "Handoff")!;expect(review.text).toMatch(/^@Reviewer /);expect(review.text).toContain("Draft at drafts/alpha.md");expect(await item(beta.threadId)).toMatchObject({ result: "Reads well." });@@ -137,6 +140,7 @@ it("an ask waits on the person who made the item, reaches their inbox, and theirawait settled(gamma.threadId, "needs_person");const asked = await item(gamma.threadId);expect(asked).toMatchObject({ holder: { botId: writer.id }, question: { text: "Which date should the launch be?", person: personKey({ id: "", email: MIRA.email }) } });+ expect(asked.question?.name, "whom it waits on, by name").toBeTruthy();expect((await messages(mira, gamma.threadId)).some((line) => line.role === "bot" && line.text === "Which date should the launch be?" && line.from?.botId === writer.id)).toBe(true);await until(async () => ((await team.as(mira, "GET", "/api/inbox")).body.rows as Array<{ text: string; origin?: { threadId: string } }>).some((row) => row.text === "Which date should the launch be?" && row.origin?.threadId === gamma.threadId), "Mira's inbox line");@@ -174,7 +178,7 @@ it("a reply queued behind the turn that asked still goes to the same bot, and thexpect(await item(theta.threadId)).toMatchObject({ result: "Booked Thursday.", attempts: 1 });const lines = await messages(mira, theta.threadId);expect(lines.filter((line) => line.role === "user" && line.text?.includes("Thursday works")).map((line) => line.text)).toEqual(["@Writer Thursday works"]);- expect(lines.filter((line) => line.sender?.name === "Board"), "never handed out again").toHaveLength(1);+ expect(lines.filter((line) => line.sender?.name === "Handoff"), "never handed out again").toHaveLength(1);rmSync(file("release"), { force: true });}, hostTimeout(120_000));@@ -196,7 +200,7 @@ it("an answer from the person's inbox, which starts no turn by itself, brings thexpect(answered.status, JSON.stringify(answered.body)).toBe(202);await settled(zeta.threadId, "done");expect(await item(zeta.threadId)).toMatchObject({ result: "Booked The Hall.", attempts: 1 });- const boardLines = (await messages(mira, zeta.threadId)).filter((row) => row.sender?.name === "Board");+ const boardLines = (await messages(mira, zeta.threadId)).filter((row) => row.sender?.name === "Handoff");expect(boardLines).toHaveLength(2);expect(boardLines[1]!.text).toMatch(/^@Writer .*The Hall, please\./s);}, hostTimeout(120_000));@@ -219,6 +223,11 @@ it("board_add from a lead makes a thread and an item each, with needs, and a badawait settled(two.threadId, "done");const listed = await (await call("list", {})).json() as { text: string };expect(listed.text).toContain(`${two.threadId} [done] Delta two`);+ // A bot working one piece cannot split it into more: that would start turns nobody asked for.+ const inside = await team.capability(writer.id, one.threadId);+ const again = await fetch(`${team.base}/api/internal/board/add`, { method: "POST", headers: { authorization: `Bearer ${inside}`, "content-type": "application/json" }, body: JSON.stringify({ items: [{ key: "x", title: "Delta three" }] }) });+ expect(again.status).toBe(409);+ expect((await board(olive)).some((entry) => entry.title === "Delta three")).toBe(false);}, hostTimeout(120_000));it("later sets the item aside and brings it back to the same bot at its time, counting no attempt", async () => {@@ -231,7 +240,7 @@ it("later sets the item aside and brings it back to the same bot at its time, coexpect(await item(epsilon.threadId)).toMatchObject({ state: "working", holder: { botId: writer.id }, laterCount: 1, later: { note: "See whether CI passed" } });await settled(epsilon.threadId, "done");expect(await item(epsilon.threadId)).toMatchObject({ result: "CI green.", attempts: 1, laterCount: 1 });- const woken = (await messages(mira, epsilon.threadId)).filter((line) => line.sender?.name === "Board");+ const woken = (await messages(mira, epsilon.threadId)).filter((line) => line.sender?.name === "Handoff");expect(woken).toHaveLength(2);expect(woken[1]!.text).toMatch(/^@Writer .*See whether CI passed/s);}, hostTimeout(120_000));diff --git a/server/cloud-team-board.e2e.test.ts b/server/cloud-team-board.e2e.test.tsindex 35e55deb45..535f02fe22 100644--- a/server/cloud-team-board.e2e.test.ts+++ b/server/cloud-team-board.e2e.test.ts@@ -1,12 +1,13 @@// The Team Board on a real Team Cloud: Olive (the Owner) and three Members. Desk is in the Launch room everyone sees;// Payroll is shared with Mira to chat and Cara to view, so its Pay desk room is Mira's and Cara's to see and Ben's not at-// all. The board answers 404 until Olive switches it on; a member's item opens a room thread with their line and starts+// all. The board is there from the start, with no switch; a member's item opens a room thread with their line and starts// no turn; nobody who cannot see the room hears of its items; needs ready what waits on them; and a personal Cloud has// no board. The engine is the synthetic Claude CLI.import { randomBytes } from "node:crypto";import { afterAll, beforeAll, expect, it } from "vitest";import { launchCloudSendFixture, type CloudSendFixture, type CloudTeamFixture } from "../scripts/testing/cloud-send-fixture.ts";import type { BoardItem, BoardItemFrame } from "../shared/board.ts";+import { personKey } from "./person-key.ts";import { hostTimeout } from "./testing/host-timeout.ts";const OLIVE = { email: "[email protected]", role: "owner" as const };@@ -89,16 +90,17 @@ afterAll(async () => {await fx?.close();});-it("has no board until it is switched on, and the switch shows only here", async () => {- expect((await team.as(mira, "GET", "/api/board")).status).toBe(404);- expect((await team.as(mira, "POST", "/api/board/items", { groupId: launch.id, title: "Early" })).status).toBe(404);- expect((await team.as(olive, "GET", "/api/config")).body.features.teamBoard).toBe(false);- const on = await team.as(olive, "PATCH", "/api/config", { features: { teamBoard: true } });- expect(on.status, JSON.stringify(on.body)).toBe(200);- expect(on.body.features.teamBoard).toBe(true);- expect((await team.as(mira, "GET", "/api/config")).body.features?.teamBoard).toBe(true);+it("has a board from the start with no switch, names each caller's own key, and ignores an older app's switch", async () => {+ expect(await board(mira)).toEqual([]);+ // "Needs you": the key an item's question names is the one GET /api/board says is the caller's, the Owner's too.+ for (const [token, person] of [[olive, OLIVE], [mira, MIRA]] as const) {+ expect((await team.as(token, "GET", "/api/board")).body.you).toBe(personKey({ id: "", email: person.email }));+ }+ expect((await team.as(olive, "GET", "/api/config")).body.features.teamBoard).toBeUndefined();+ const old = await team.as(olive, "PATCH", "/api/config", { features: { teamBoard: false } });+ expect(old.status, JSON.stringify(old.body)).toBe(200);+ expect(old.body.features.teamBoard).toBeUndefined();expect(await board(mira)).toEqual([]);- expect((await fx.onCloud("GET", "/api/config")).body.features?.teamBoard).toBeUndefined();}, hostTimeout(60_000));it("a member's item opens a room thread with their line and starts no turn", async () => {diff --git a/server/config.test.ts b/server/config.test.tsindex 0edfcb5e76..fdf339ff75 100644--- a/server/config.test.ts+++ b/server/config.test.ts@@ -57,6 +57,11 @@ const reloaded = (patch: object, cfg: AppConfig = {}) =>changedInstanceIds(engineLaunches(instanceConfigs(cfg), {}), engineLaunches(instanceConfigs({ ...cfg, ...patch } as AppConfig), {}));describe("configuration boundaries", () => {+ it("loads and takes a retired features.teamBoard without keeping it: the Team Board has no switch", () => {+ expect(parseStoredConfig({ features: { teamBoard: true, threadTabs: true } }).features).toEqual({ threadTabs: true });+ expect(parseConfigPatch({ features: { teamBoard: false } }).features).toEqual({});+ });+it("requires an explicit backup to opt into automatic recovery without reloading engines", () => {expect(parseStoredConfig({}).automaticRecovery).toBeUndefined();expect(parseConfigPatch({ automaticRecovery: { enabled: false } })).toEqual({ automaticRecovery: { enabled: false } });diff --git a/server/config.ts b/server/config.tsindex 51cd8fd04d..64fab7e10b 100644--- a/server/config.ts+++ b/server/config.ts@@ -226,7 +226,7 @@ const featureConfigSchema = z.object({/** Room jobs to several members run side by side, each in a thread of its own. On unless false. */parallelRoomJobs: z.boolean().optional(),acpPlanLines: z.boolean().optional(), // An ACP agent's plan as activity lines. Off unless true.-}).extend({ agentsToolBridge: z.boolean().optional(), savedSteps: z.boolean().optional(), usbPhoneTakeover: z.boolean().optional(), cloudComputerAutoReplace: z.boolean().optional(), phonePush: z.boolean().optional(), skillBurger: z.boolean().optional(), threadTabs: z.boolean().optional(), teamBoard: z.boolean().optional(), suggestedReplies: z.boolean().optional() }); // suggestedReplies: a faded next-line suggestion in an empty composer after a bot replies, written by the bot's own engine's smallest model, on unless false; skillBurger: Skill Burgers in chat, the side menu and the bot panel, and the tools that run them, on unless false; threadTabs: a bot's threads as tabs above its chat, off unless true; teamBoard: the Team Board on a Team Cloud (docs/team-board.md), off unless true; cloudComputerAutoReplace: set a dead or silent cloud computer aside (kept seven days with its files) and give its bot a new one by itself, on unless false (OMB_CLOUD_COMPUTER_AUTO_REPLACE wins); agentsToolBridge: the find_tool / use_tool bridge, off unless true; savedSteps: repeat a computer task from its saved steps, on unless false; usbPhoneTakeover: watch and take over the bots' USB phone, off unless true; phonePush: wake a paired phone whose app is closed through the hosted push relay, on unless false (OMB_PHONE_PUSH=0 or 1 wins)+}).extend({ agentsToolBridge: z.boolean().optional(), savedSteps: z.boolean().optional(), usbPhoneTakeover: z.boolean().optional(), cloudComputerAutoReplace: z.boolean().optional(), phonePush: z.boolean().optional(), skillBurger: z.boolean().optional(), threadTabs: z.boolean().optional(), suggestedReplies: z.boolean().optional() }); // suggestedReplies: a faded next-line suggestion in an empty composer after a bot replies, written by the bot's own engine's smallest model, on unless false; skillBurger: Skill Burgers in chat, the side menu and the bot panel, and the tools that run them, on unless false; threadTabs: a bot's threads as tabs above its chat, off unless true; cloudComputerAutoReplace: set a dead or silent cloud computer aside (kept seven days with its files) and give its bot a new one by itself, on unless false (OMB_CLOUD_COMPUTER_AUTO_REPLACE wins); agentsToolBridge: the find_tool / use_tool bridge, off unless true; savedSteps: repeat a computer task from its saved steps, on unless false; usbPhoneTakeover: watch and take over the bots' USB phone, off unless true; phonePush: wake a paired phone whose app is closed through the hosted push relay, on unless false (OMB_PHONE_PUSH=0 or 1 wins)const onboardingConfigSchema = z.object({completedAt: z.string().trim().max(40).optional(),version: z.number().int().min(0).max(1000).optional(),@@ -467,7 +467,7 @@ export interface AppConfig extends HelperConfig {context?: { rebuildBytes?: number; compactAt?: number; autoCompact?: boolean; roomCompactAt?: number; roomSessions?: boolean; replayToolHistory?: boolean };memory?: { captureQuietMs?: number; tidyHour?: number };vpsIdle?: z.infer<typeof vpsIdleConfigSchema>; localVm?: { mode?: "shared" | "per-bot" | "pool"; maxInstances?: number; idleTimeoutMinutes?: number; preserveInstalledApps?: boolean; memoryGb?: number; cpus?: number };- features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; llmThreadTitles?: boolean; smartSetupChoices?: boolean; autoRecall?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; parallelRoomJobs?: boolean; acpPlanLines?: boolean; agentsToolBridge?: boolean; savedSteps?: boolean; usbPhoneTakeover?: boolean; cloudComputerAutoReplace?: boolean; phonePush?: boolean; skillBurger?: boolean; threadTabs?: boolean; teamBoard?: boolean; suggestedReplies?: boolean };+ features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; llmThreadTitles?: boolean; smartSetupChoices?: boolean; autoRecall?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; parallelRoomJobs?: boolean; acpPlanLines?: boolean; agentsToolBridge?: boolean; savedSteps?: boolean; usbPhoneTakeover?: boolean; cloudComputerAutoReplace?: boolean; phonePush?: boolean; skillBurger?: boolean; threadTabs?: boolean; suggestedReplies?: boolean };onboarding?: { completedAt?: string; version?: number; reelSeen?: boolean; hintsSeen?: string[]; firstTurnAt?: string };browserProfiles?: BrowserProfile[];browserEngine?: BrowserEngineConfig;diff --git a/server/drivers/agents-board-tools.ts b/server/drivers/agents-board-tools.tsindex a4a3e007a3..77306e3509 100644--- a/server/drivers/agents-board-tools.ts+++ b/server/drivers/agents-board-tools.ts@@ -1,4 +1,4 @@-// The Team Board's three agents tools (docs/team-board.md), mounted only on a Team Cloud with the board on. Each is a+// The Team Board's three agents tools (docs/team-board.md), mounted on every Team Cloud bot. Each is a// thin call to its internal route (server/routes/board-tools.ts), which checks the bot, its rooms and every move.import type { ToolCallContext, ToolCallResult } from "./agents-call.ts";import type { Json } from "./agents-client.ts";@@ -17,7 +17,7 @@ const LABELS = { type: "object", additionalProperties: { type: "string", maxLengexport const BOARD_TOOL_DEFINITIONS = [{name: "board_add",- description: "Add work items to a room's board, each on a new thread; the server gives ready ones to free bots of the room.",+ description: "Split work into items, each on a new room thread; free bots of the room take the ready ones.",inputSchema: {type: "object",additionalProperties: false,@@ -46,7 +46,7 @@ export const BOARD_TOOL_DEFINITIONS = [},{name: "board_list",- description: "The board items of your rooms, with state, holder and needs.",+ description: "Your rooms' work items: state, holder, needs.",inputSchema: {type: "object",additionalProperties: false,@@ -58,7 +58,7 @@ export const BOARD_TOOL_DEFINITIONS = [},{name: "board_update",- description: "Settle the board item you hold (default: this thread's): done or failed with text as the result, ask a person (text = question), later (look again in minutes; text = note) or release it.",+ description: "Settle the item you hold (default: this thread's): done or failed (text = result), ask a person (text = question), later (minutes; text = note) or release.",inputSchema: {type: "object",additionalProperties: false,diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.jsonindex a2fb2be528..ed1a17675c 100644--- a/server/drivers/agents-catalog-goldens/profiles.json+++ b/server/drivers/agents-catalog-goldens/profiles.json@@ -1878,8 +1878,8 @@]},"skills+shared+voice+x+team+board": {- "bytes": 73990,- "sha256": "b6e4fff5ff94e61f50a16692e52c5c272dc5969f7bcb261ca469b799535473fa",+ "bytes": 73927,+ "sha256": "245eabe4fcb44c0bb0445a036998b3ca0dfa3c20ac7fb459d61d04456489094d","tools": ["tool_result_read","list_shared_computers",@@ -1952,8 +1952,8 @@]},"default+room+board": {- "bytes": 59478,- "sha256": "aa77140c54cdaef028008f3dbe2ec82d28716e323060467d69bc2363b6dc6e4a",+ "bytes": 59415,+ "sha256": "780a19f28772625de5acbfb586bbc95e976270e60e11c991024df2c85e6c7281","tools": ["tool_result_read","list_room_targets",diff --git a/server/drivers/agents-catalog-wire.test.ts b/server/drivers/agents-catalog-wire.test.tsindex d3f19396cb..b47faca5a0 100644--- a/server/drivers/agents-catalog-wire.test.ts+++ b/server/drivers/agents-catalog-wire.test.ts@@ -10,6 +10,7 @@ import { fileURLToPath } from "node:url";import { build } from "esbuild";import { afterAll, beforeAll, describe, expect, it } from "vitest";import { waitForExit } from "../testing/cleanup.ts";+import { fitToolListForBudget, toolSchemaProfile } from "../tool-schema-profile.ts";import { availableTools, catalogProfileFromEnv } from "./agents-catalog.ts";const HERE = dirname(fileURLToPath(import.meta.url));@@ -66,7 +67,8 @@ function profiles(): Record<string, Profile> {// The plan's included app hosting reaches only a Cloud home the Admin wired for it; the fullest profile carries it.all["skills+shared+voice+x+team+images+hosting"] = { env: { ...all["skills+shared+voice+x+team+images"]!.env, OMB_APP_HOSTING: "1" } };all["default+hosting"] = { env: { ...all.default!.env, OMB_APP_HOSTING: "1" } };- // A Team Cloud with its board on mounts the three board tools, in a chat and in a room; never on the fullest profile.+ // Every Team Cloud bot has the three board tools, in a chat and in a room. The Team profiles without them, the fullest+ // one among them, still pin the rest of the list but no longer ship as they are: see the Gemini check below.all["skills+shared+voice+x+team+board"] = { env: { ...all["skills+shared+voice+x+team"]!.env, OMB_TEAM_BOARD: "1" } };all["default+room+board"] = { env: { ...all["default+room"]!.env, OMB_TEAM_PEOPLE: "1", OMB_TEAM_BOARD: "1" } };// A bot whose person turned groups off; the fullest profile has every group on.@@ -284,7 +286,7 @@ describe("agents proxy tools/list golden", () => {}});- it("mounts the three board tools only on a Team Cloud with the board on, in a chat and in a room, and adds nothing else", () => {+ it("mounts the three board tools where the harness says (every Team Cloud bot), in a chat and in a room, and adds nothing else", () => {const names = (wire: string) => toolsOf(wire).map((tool) => tool.name);expect(names(wires["skills+shared+voice+x+team+board"]!).filter((tool) => !BOARD_TOOLS.includes(tool))).toEqual(names(wires["skills+shared+voice+x+team"]!));expect(names(wires["default+room+board"]!).filter((tool) => !BOARD_TOOLS.includes(tool))).toEqual(names(wires["default+room"]!));@@ -293,6 +295,15 @@ describe("agents proxy tools/list golden", () => {}});+ it("fits a Team Cloud's real fullest list, the board tools included, under Gemini's list budget with every name kept", async () => {+ const tools = toolsOf(await toolsListWire(PROXY_SOURCE, { ...PROFILES[FULL]!.env, OMB_TEAM_BOARD: "1" })) as Array<Tool & { inputSchema?: unknown }>;+ for (const tool of BOARD_TOOLS) expect(tools.map((one) => one.name)).toContain(tool);+ const gemini = toolSchemaProfile("gemini")!;+ const fitted = fitToolListForBudget(tools, gemini);+ expect(Buffer.byteLength(JSON.stringify(fitted), "utf8")).toBeLessThanOrEqual(gemini.maxListBytes!);+ expect(fitted.map((tool) => tool.name)).toEqual(tools.map((tool) => tool.name));+ }, 60_000);+it("mounts generate_image and edit_image only when an image provider is set up, and adds nothing else", () => {const names = (wire: string) => toolsOf(wire).map((tool) => tool.name);expect(names(wires["default+images"]!).filter((tool) => tool !== "generate_image" && tool !== "edit_image")).toEqual(names(wires.default!));diff --git a/server/drivers/own-mcp-session-budget.test.ts b/server/drivers/own-mcp-session-budget.test.tsindex df34e47a02..4ea13b3adf 100644--- a/server/drivers/own-mcp-session-budget.test.ts+++ b/server/drivers/own-mcp-session-budget.test.ts@@ -36,7 +36,7 @@ const HARNESS = "http://127.0.0.1:8799";const CHIEF = { OMB_CHIEF_OF_STAFF: "1", OMB_COMPUTER_SELECTION: "1" };const NON_CHIEF = { OMB_CHIEF_OF_STAFF: "0", OMB_COMPUTER_SELECTION: "1" };const FULLEST = { ...CHIEF, OMB_SKILL_AUTHORING_ENABLED: "1", OMB_SHARED_COMPUTERS_ENABLED: "1", OMB_VOICE_NOTES: "1", OMB_X_RESEARCH: "1",- OMB_RESEARCH: "1", OMB_TEAM_PEOPLE: "1", OMB_IMAGE_GENERATION: "1", OMB_APP_HOSTING: "1" };+ OMB_RESEARCH: "1", OMB_TEAM_PEOPLE: "1", OMB_TEAM_BOARD: "1", OMB_IMAGE_GENERATION: "1", OMB_APP_HOSTING: "1" };const agentsList = (env: Record<string, string>) => agentsToolList(env).listed as ListedTool[];const catalog = (tools: unknown) => tools as readonly ListedTool[];diff --git a/server/host/team-messages.ts b/server/host/team-messages.tsindex 2a5a688068..b761e95fe0 100644--- a/server/host/team-messages.ts+++ b/server/host/team-messages.ts@@ -212,7 +212,7 @@ export function createTeamMessages(deps: TeamMessagesDeps) {/** A board item's bot asks a teammate (by name or address, else by person key) in a room thread: the question reaches* their inbox, from the bot, and their answer comes back to that thread. No hourly cap: a bot asks once per item turn. */- function ask(botId: string, threadId: string, to: { name?: string; key?: string }, question: string, title: string): Passed & { person?: string } {+ function ask(botId: string, threadId: string, to: { name?: string; key?: string }, question: string, title: string): Passed & { person?: string; name?: string } {const at = where(botId, threadId);if (!team || !at?.group) return { status: 403, text: "Only a bot in this room can ask from it." };if (deps.confined?.(threadId)) return { status: 403, text: OUTSIDE_REFUSAL };@@ -223,7 +223,7 @@ export function createTeamMessages(deps: TeamMessagesDeps) {if (!deps.sees(person).thread(threadId)) return { status: 403, text: `${person.name} can't see this room, so they can't answer here. Ask someone who can.` };const delivered = inbox.deliver(person.key, { kind: "message", reason: "asked", from: { name: at.bot.name, botId: at.bot.id }, to: "bot", origin: originOf(at, threadId), text: question, title, notify: "mention" });if (!delivered) return { status: 409, text: `${person.name} has no inbox here yet, so the question waits in this thread for anyone who sees it.` };- return { status: 200, text: `Asked ${person.name} in their inbox.`, person: person.key };+ return { status: 200, text: `Asked ${person.name} in their inbox.`, person: person.key, name: person.name };}const handledTurns = new Set<string>();diff --git a/server/index.ts b/server/index.tsindex 62b4a44592..d68b86fc80 100644--- a/server/index.ts+++ b/server/index.ts@@ -411,7 +411,7 @@ import {LEARN_PROMPT, LEARN_RULES_PROMPT,PROFILE_PROMPT,TEAM_MEMORY_PROMPT,- TRIGGER_PROMPT, ROOM_CLOSE_PROMPT,+ TRIGGER_PROMPT, ROOM_CLOSE_PROMPT, ROOM_SPLIT_PROMPT,ROUTINE_EXECUTION_PROMPT, READ_ONLY_ROUTINE_EXECUTION_PROMPT,WEBHOOK_PROMPT, BOT_API_PROMPT, BOT_API_OWNER_PROMPT, AUTOMATION_REPLY_PROMPT,resolveComputerPromptKind,@@ -1799,7 +1799,7 @@ function agentsIntegration() {const bot = store.bot(botId), speaking = botForThread(botId, threadId) ?? bot;// Only advertises the tools; the routes behind them refuse regardless.- const host = { skillAuthoring: skillAuthoringEnabled(cfg), skillBurger: skillBurgerEnabled(cfg), sharedComputers: botLending(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM), board: Boolean(CLOUD_TEAM) && cfg.features?.teamBoard === true,+ const host = { skillAuthoring: skillAuthoringEnabled(cfg), skillBurger: skillBurgerEnabled(cfg), sharedComputers: botLending(), cloudHome: Boolean(CLOUD_HOME), team: Boolean(CLOUD_TEAM), board: Boolean(CLOUD_TEAM),voiceNotes: tts.voiceReady(cfg, speaking?.voice) && speaking?.voiceNotes !== false, x: Boolean(researchCredential(cfg.treg?.key)), research: researchAvailability.available(), imageGeneration: imageGenerationReady(cfg), meetings: boat.boatConfigured(cfg), appHosting: hostingCredential() !== null, localVm: localVmAvailability.available() };return { ...agentsProxyLaunch(), env: agentsServerEnv({ threadId, bot: bot ?? { id: botId }, room: Boolean(store.groupByThread(threadId)), teamComputer: Boolean(bot && inheritedTeamComputer(bot)), botDriven: automated || botDrivenConversation(store.taskByThread(botId, threadId)), host },{ generation, depth, skillAuthoring, roomHandoffId, ...(hostFiles && !CLOUD_HOME && !HOSTED_WORKSPACE ? { deliversSavedFiles: true } : {}) },@@ -9949,7 +9949,7 @@ async function runClaimedGroupMemberTurn(outsideRoom.length > 0 && roomPeerRosterSystemPrompt(outsideRoom), sharedNamesNote(roomMembers.filter((member) => member.id !== bot.id), Boolean(integrations.agents)),integrations.agents && (CREDENTIAL_PROMPT + botLogins.secretsPrompt(bot.id, vaultReaders.turn(threadId)) + (orchestration && !orchestration.roomHandoffId ? THREADS_PROMPT : "")).trim(),integrations.agents && (!orchestration || orchestration.roomHandoffId) && "For actual OpenMausBot teamwork, discover IDs with list_room_targets and use coordinate_bots for advice or work in this or another room. Do not substitute native coding helpers for these named bots. Consult only when needed to make a decision; no discussion step is mandatory. Give concrete responsibilities, exact accessible paths and acceptance checks. End your turn after assigning; busy teammates queue and results automatically resume you. When they return, finish the requested verification and give the user one final answer. Native helper names are not evidence that an OpenMausBot teammate participated. Plain @mentions are only for conversational replies in this room." + requesterRule,- integrations.agents && TRIGGER_PROMPT.trim(), integrations.agents && !readyGroup.dm && ROOM_CLOSE_PROMPT,+ integrations.agents && TRIGGER_PROMPT.trim(), integrations.agents && !readyGroup.dm && ROOM_CLOSE_PROMPT, integrations.agents && !readyGroup.dm && CLOUD_TEAM && ROOM_SPLIT_PROMPT,integrations.agents && PROFILE_PROMPT.trim(),integrations.agents && skillAuthoringEnabled(cfg) && LEARN_RULES_PROMPT.trim(),orchestration?.systemInstructions,@@ -11368,7 +11368,7 @@ function claimPhoneSecretBotDeletion(botId: string): (() => void) | null {}const secretCards = createSecretCards({ store, cfg, botLogins, vaultStore: logins, vaultReader: vaultReaders.turn, phoneSecrets, phoneSecretSubmissions, connectorThread, answerCardNode, followCard: (threadId, from, to) => coordinator.followCard(threadId, from, to), threadLanguage, email: { connect: (request, reading) => emailService.connect(request, reading), refusal: () => emailService.status().reason, connected: (address) => { const one = emailService.store.get(address); return Boolean(one && !one.problem); }, sendingProblem: (address) => emailService.sendingProblem(address), account: (address) => emailService.status().accounts.find((one) => one.address.toLowerCase() === address.toLowerCase()), checkOutgoing: (address, fields) => emailService.checkOutgoing(address, fields), profileAddress: () => cfg.profile?.email?.trim() || undefined }, dataDir: DATA_DIR, providerKeysRefused: Boolean(hostedModels), layerFolder: (botId, threadId) => workspaceDir(teamHost.layer(botId, threadId)), turnVm: (threadId) => localVmThreadTargets.get(threadId)?.key });-const teamBoard = createTeamBoard({ dataDir: DATA_DIR, team: Boolean(CLOUD_TEAM), enabled: () => cfg.features?.teamBoard === true, store, visible: (auth) => visibleTo(viewerFor(auth)), person: (auth) => auth.kind === "session" && auth.session.email ? { person: personKey(auth.session), name: messageSender(auth)?.name ?? "" } : null, sender: messageSender, opened: (auth, threadId) => { if (auth.kind === "session") threadStarters.set(threadId, actorKey(auth)); }, roomRefusal: (groupId) => phoneSecretSubmissions.hasGroup(groupId) ? "This room is securely saving a credential. Try again when it finishes." : null, broadcast, botFree: (botId, groupId, threadId) => { const bot = store.bot(botId), group = store.group(groupId); return Boolean(bot && group && !bot.hidden && !bot.busy && !bot.approvalGrant && !botHolds.held(botId) && !starterCaps.pausedText(botId, undefined, threadId) && !roomHeld(group, botId) && !providerInstancesChanging.has(bot.modelSelection.instanceId) && !roomMemberLock.heldElsewhere(botId, threadId) && !activeGroupTurnForBot(botId)); }, threadWorking: groupThreadIsWorking, capped: (botId) => { try { assertWithinBudget(cfg, DATA_DIR); usageCapGate.assertTurn(botId, false); return null; } catch (error) { const refused = error as { code?: unknown; resetsAt?: unknown }; return refused?.code === USAGE_CAP_CODE ? { resetsAt: typeof refused.resetsAt === "number" ? refused.resetsAt : Date.now() + 3_600_000 } : null; } }, modelReady: (botId) => { const instance = registry.get(store.bot(botId)?.modelSelection.instanceId ?? ""); return Boolean(instance && !policyModelRefusal(instance) && registry.lastSnapshot(instance.instanceId)?.authenticated !== false); }, startTurn: (groupId, threadId, botId, text, sender) => { startGroupTurn(groupId, text, undefined, undefined, "chat", undefined, { threadId, mentions: [botId], trigger: { kind: "bot", botId }, sender }); }, askPerson: teamMessages.ask, cardWaiting: (threadId) => Boolean(personWaits.open(threadId)), timeScale: Number(process.env.OMB_BOARD_TIME_SCALE) || undefined }); ROUTES.push(teamBoard.routes); pokeBoard = teamBoard.poke; ROUTES.push(createCheckBackRoutes({ checkBacks, sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), refusal: (auth, threadId, messageId) => cardAnswerRefusal(auth, threadId, messageId, "deny") })); ROUTES.push(createBurstRoutes({ owner: (id) => burst.owner(id), sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), refusal: (auth, threadId, id) => cardAnswerRefusal(auth, threadId, id, "allow"), view: (id) => burst.view(id), run: (id) => burst.run(id), cancel: (id) => burst.cancel(id), retry: (id) => burst.retryFailed(id), edit: (id, plan) => burst.edit(id, plan) })); ROUTES.push(createSecretCardRoutes({ cards: secretCards, phoneSecretSubmissions, threadVisible: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), answerContext: (auth, botId, threadId) => ({ personalCloud: Boolean(CLOUD_PERSONAL), shared: sharedMembership(), owner: (CLOUD_TEAM ? teamOwners.routing.askedPerson(botId, threadId) : null) ?? threadStarters.get(threadId) ?? null, person: auth.kind === "session" ? personKey(auth.session) : null }) }));+const teamBoard = createTeamBoard({ dataDir: DATA_DIR, team: Boolean(CLOUD_TEAM), store, visible: (auth) => visibleTo(viewerFor(auth)), person: (auth) => auth.kind === "session" && auth.session.email ? { person: personKey(auth.session), name: messageSender(auth)?.name ?? "" } : null, sender: messageSender, opened: (auth, threadId) => { if (auth.kind === "session") threadStarters.set(threadId, actorKey(auth)); }, roomRefusal: (groupId) => phoneSecretSubmissions.hasGroup(groupId) ? "This room is securely saving a credential. Try again when it finishes." : null, broadcast, botFree: (botId, groupId, threadId) => { const bot = store.bot(botId), group = store.group(groupId); return Boolean(bot && group && !bot.hidden && !bot.busy && !bot.approvalGrant && !botHolds.held(botId) && !starterCaps.pausedText(botId, undefined, threadId) && !roomHeld(group, botId) && !providerInstancesChanging.has(bot.modelSelection.instanceId) && !roomMemberLock.heldElsewhere(botId, threadId) && !activeGroupTurnForBot(botId)); }, threadWorking: groupThreadIsWorking, capped: (botId) => { try { assertWithinBudget(cfg, DATA_DIR); usageCapGate.assertTurn(botId, false); return null; } catch (error) { const refused = error as { code?: unknown; resetsAt?: unknown }; return refused?.code === USAGE_CAP_CODE ? { resetsAt: typeof refused.resetsAt === "number" ? refused.resetsAt : Date.now() + 3_600_000 } : null; } }, modelReady: (botId) => { const instance = registry.get(store.bot(botId)?.modelSelection.instanceId ?? ""); return Boolean(instance && !policyModelRefusal(instance) && registry.lastSnapshot(instance.instanceId)?.authenticated !== false); }, startTurn: (groupId, threadId, botId, text, sender) => { startGroupTurn(groupId, text, undefined, undefined, "chat", undefined, { threadId, mentions: [botId], trigger: { kind: "bot", botId }, sender }); }, askPerson: teamMessages.ask, cardWaiting: (threadId) => Boolean(personWaits.open(threadId)), timeScale: Number(process.env.OMB_BOARD_TIME_SCALE) || undefined }); ROUTES.push(teamBoard.routes); pokeBoard = teamBoard.poke; ROUTES.push(createCheckBackRoutes({ checkBacks, sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), refusal: (auth, threadId, messageId) => cardAnswerRefusal(auth, threadId, messageId, "deny") })); ROUTES.push(createBurstRoutes({ owner: (id) => burst.owner(id), sees: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), refusal: (auth, threadId, id) => cardAnswerRefusal(auth, threadId, id, "allow"), view: (id) => burst.view(id), run: (id) => burst.run(id), cancel: (id) => burst.cancel(id), retry: (id) => burst.retryFailed(id), edit: (id, plan) => burst.edit(id, plan) })); ROUTES.push(createSecretCardRoutes({ cards: secretCards, phoneSecretSubmissions, threadVisible: (auth, threadId) => visibleTo(viewerFor(auth)).thread(threadId), answerContext: (auth, botId, threadId) => ({ personalCloud: Boolean(CLOUD_PERSONAL), shared: sharedMembership(), owner: (CLOUD_TEAM ? teamOwners.routing.askedPerson(botId, threadId) : null) ?? threadStarters.get(threadId) ?? null, person: auth.kind === "session" ? personKey(auth.session) : null }) }));// By design OpenMausBot never receives a website password: the person signs in where the bot works, and the bot uses that session.@@ -11616,7 +11616,7 @@ function configStatus() {autoRecall: autoRecallEnabled(cfg),roomMemoryCapture: roomMemoryCaptureEnabled(cfg),parallelRoomJobs: parallelRoomJobsEnabled(cfg),- savedSteps: savedStepsEnabled(cfg), savedStepsHere: savedSteps.here(), skillBurger: skillBurgerEnabled(cfg), threadTabs: cfg.features?.threadTabs === true, suggestedReplies: cfg.features?.suggestedReplies !== false, roomFeed: true, roomFeedSince: roomFeedSince(DATA_DIR), teamBoard: CLOUD_TEAM ? cfg.features?.teamBoard === true : undefined,+ savedSteps: savedStepsEnabled(cfg), savedStepsHere: savedSteps.here(), skillBurger: skillBurgerEnabled(cfg), threadTabs: cfg.features?.threadTabs === true, suggestedReplies: cfg.features?.suggestedReplies !== false, roomFeed: true, roomFeedSince: roomFeedSince(DATA_DIR),usbPhoneTakeover: HAS_USB_PORT ? usbPhoneTakeoverEnabled(cfg) : undefined,},onboarding: {diff --git a/server/room-bot-close.e2e.test.ts b/server/room-bot-close.e2e.test.tsindex 12e78b16b7..6b728a9ae9 100644--- a/server/room-bot-close.e2e.test.ts+++ b/server/room-bot-close.e2e.test.ts@@ -40,6 +40,8 @@ it("closes its room thread with its final reply, and a person's next line opensexpect((await cli("wait", "--channel", room.id, "--timeout", "45")).status).toBe("settled");const turn = evidence().find((record) => record.planKey === "W1");expect(turn.system).toContain("When the work in this thread is finished, close it with your final reply");+ // Splitting work and the work view are a Team Cloud's: no board tools here, so no line about them.+ expect(turn.system).not.toMatch(/board_add|board_list/);expect((turn.evidence[0].result.tools as Array<{ name: string; inputSchema: { required?: string[] } }>).find((tool) => tool.name === "close_thread")?.inputSchema.required ?? []).not.toContain("thread_id");const closeAnswer = turn.evidence.at(-1).response.result;expect(closeAnswer.isError ?? false, JSON.stringify(closeAnswer)).toBe(false);diff --git a/server/routes/board-tools.ts b/server/routes/board-tools.tsindex 46224a9f2c..871a3025bf 100644--- a/server/routes/board-tools.ts+++ b/server/routes/board-tools.ts@@ -1,6 +1,6 @@// The Team Board's bot tools (board_add, board_list, board_update), inside index.ts's /api/internal/ block, after the-// capability bearer is checked: the bot and its thread are the capability's, never a body field. On a Team Cloud with-// the board on only; anywhere else they answer 404 like an unknown path.+// capability bearer is checked: the bot and its thread are the capability's, never a body field. On a Team Cloud only;+// anywhere else they answer 404 like an unknown path.// POST /api/internal/board/add new room threads, each an item, needs given by keys of the same call// POST /api/internal/board/list the items of the rooms the bot is in// POST /api/internal/board/update the bot settles, asks about, sets aside, hands back or labels an item@@ -23,7 +23,7 @@ export interface BoardRoom {export interface BoardToolDeps {board: Pick<Board, "list" | "get" | "create" | "patch" | "move">;- /** A Team Cloud with `features.teamBoard` on. */+ /** A Team Cloud. */on(): boolean;requireActive(): void;botId(): string;@@ -36,8 +36,8 @@ export interface BoardToolDeps {roomOf(threadId: string): BoardRoom | null;/** Opens a room thread without making it the room's current one, with `text` as the bot's first line there. */openThread(groupId: string, title: string, text: string, botId: string): string;- /** Posts the question as the bot's line in the thread and reaches the person's inbox; `person` is the asked person's key. */- ask(botId: string, threadId: string, question: string, to: { name?: string; key?: string }): { ok: boolean; text: string; person?: string };+ /** Posts the question as the bot's line in the thread and reaches the person's inbox; `person` is the asked person's key and `name` their name. */+ ask(botId: string, threadId: string, question: string, to: { name?: string; key?: string }): { ok: boolean; text: string; person?: string; name?: string };/** The result an item gets when its bot sets it aside once too often. */tooManyLaters(threadId: string): string;/** A minute; tests shorten it. */@@ -105,6 +105,8 @@ export function createBoardToolRoutes(deps: BoardToolDeps): RouteHandler {}function add(botId: string, threadId: string, body: z.infer<typeof addSchema>): { status: number; text: string } {+ // A piece of work is never split again from inside: a bot handed one cannot turn it into more billed turns.+ if (deps.board.get(threadId)) return { status: 409, text: "This thread is already one piece of work: do it and finish with board_update instead of splitting it." };const room = roomFor(botId, threadId, body.room);if (typeof room === "string") return { status: 404, text: room };if (!room.memberIds.includes(botId)) return { status: 403, text: "You can add items only in a room you are in." };@@ -200,7 +202,7 @@ export function createBoardToolRoutes(deps: BoardToolDeps): RouteHandler {if (item.state !== "working" || item.holder?.botId !== botId) return { status: 409, text: `This item is ${item.state.replace("_", " ")} and not yours to ask about now.` };const to = body.person?.trim() ? { name: body.person.trim() } : item.createdBy.kind === "person" ? { key: item.createdBy.id } : {};const reached = deps.ask(botId, item.threadId, text, to);- deps.board.patch(item.threadId, { move: { move: "ask", question: text, ...(reached.person ? { person: reached.person } : {}) }, ...(body.labels !== undefined ? { labels: body.labels } : {}) }, actor);+ deps.board.patch(item.threadId, { move: { move: "ask", question: text, ...(reached.person ? { person: reached.person, ...(reached.name ? { name: reached.name } : {}) } : {}) }, ...(body.labels !== undefined ? { labels: body.labels } : {}) }, actor);return { status: 200, text: `${reached.text} The item waits on a person; end your turn now. When they answer in this thread you are started again here.` };}if (move === "later") {@@ -232,7 +234,7 @@ export function createBoardToolRoutes(deps: BoardToolDeps): RouteHandler {return async ({ res, path, method, json }) => {if (path !== BOARD_TOOL_PATH && !path.startsWith(`${BOARD_TOOL_PATH}/`)) return PASS;- if (!deps.on()) return json(res, 404, { error: "The board is off here. Ask an Owner or Admin to turn on Board in Settings → Features." });+ if (!deps.on()) return json(res, 404, { error: "Work items exist only on a Team Cloud." });if (method !== "POST") return json(res, 405, { error: "method not allowed" });deps.requireActive();const botId = deps.botId(), threadId = deps.threadId();diff --git a/server/routes/board.ts b/server/routes/board.tsindex 2ce968b04d..d3f3e4b4cf 100644--- a/server/routes/board.ts+++ b/server/routes/board.ts@@ -1,4 +1,4 @@-// The Team Board's routes, for every member and admin of a Team Cloud with the board switched on (docs/team-board.md).+// The Team Board's routes, for every member and admin of a Team Cloud (docs/team-board.md).// Anywhere else none of them exists: they answer 404 like any unknown path.// GET /api/board[?groupId=] the items the caller can see, oldest first// POST /api/board/items a new item, on a new room thread or on one the room has@@ -7,7 +7,7 @@// Security: an item is shown, changed or removed only for someone who can see its room thread, and anything that writes// needs what writing in the room needs (chat on every bot of it); an item they cannot see answers as a missing one.import { atLeast } from "../../shared/bot-access.ts";-import { BOARD_LIMITS, type BoardPersonMove } from "../../shared/board.ts";+import { BOARD_LIMITS, type BoardListResponse, type BoardPersonMove } from "../../shared/board.ts";import type { VisibleSet } from "../bot-visibility.ts";import type { Board } from "../board/host.ts";import { BoardError, type BoardMove } from "../board/state.ts";@@ -27,7 +27,7 @@ export interface BoardPerson {export interface BoardRouteDeps {board: Board;- /** A Team Cloud with `features.teamBoard` on. */+ /** A Team Cloud. */on(): boolean;/** The signed-in person; null for a session that is no one. */person(auth: RequestAuth): BoardPerson | null;@@ -72,7 +72,7 @@ export function createBoardRoutes(deps: BoardRouteDeps): RouteHandler {try {if (path === BOARD_PATH && method === "GET") {const groupId = url.searchParams.get("groupId") || undefined;- return json(res, 200, { items: deps.board.list({ groupId }).filter((item) => seen(item.groupId, item.threadId)) });+ return json(res, 200, { items: deps.board.list({ groupId }).filter((item) => seen(item.groupId, item.threadId)), you: person.person } satisfies BoardListResponse);}if (path === `${BOARD_PATH}/items` && method === "POST") {const body = record(await readBody(req));diff --git a/server/system-prompt.ts b/server/system-prompt.tsindex edc4551adf..a4fe10ef85 100644--- a/server/system-prompt.ts+++ b/server/system-prompt.ts@@ -307,6 +307,10 @@ export const THREADS_PROMPT =" A thread is one conversation with its own history and run, a row under its bot; several can run at once. start_thread opens one on yourself for separate work; coordinate_bots with thread \"new\" gives a teammate a job in a fresh one; list_threads shows how yours are going. Write a thread's title as #Title so it links. Never use a ticket comment, note or room post as a stand-in for a thread. When the person says to burst something, or a request is clearly many independent items in parallel, use burst: it shows a card, nothing runs until they press Run, and results come back here as one merged reply.";export const ROOM_CLOSE_PROMPT ="When the work in this thread is finished, close it with your final reply (close_thread with no thread_id). Leave it open only when you are waiting on a named person or thing, and say what.";+/** Team Clouds only, where every bot has the board tools: splitting, and showing where the work stands, are the person's+ * ask, never the bot's own idea. The view uses the statuses people see on the room's threads (src/lib/room-work.ts). */+export const ROOM_SPLIT_PROMPT =+ "When a person here asks you to split up or share out work, or hands you a goal with clearly separate parts, put the parts on board_add: each gets its own thread and a free bot of the room takes it. Otherwise just answer. Never split a small request or a piece you were handed. When someone asks to see the work or where it stands, call board_list and show it here with show_html as one compact page grouped as Up next, <Bot> working, Needs <name>, Done and Stopped; asked again, replace that page by its app_id. Never show it unasked.";export const WIDGET_PROMPT =" Unless the person asked (here or in your instructions) to check with them first, ask only what you cannot find or sensibly default, one thing at a time. For a pick among a few options (a time, a day, a choice), use show_widget: a Card with a Row of Buttons, one per option, whose onClickAction sends that option in one tap, at most six; the caption may say they can also type. To change something that exists (routine, reminder, booking, setting), show a form prefilled with its current values (each field's defaultValue), captioned as the current setting, with a confirm button that saves the change. Use a multi-field form only for that or when several required details truly cannot be defaulted. A plain yes or no needs no widget: ask in one short sentence; a word or 👍 on your message comes back as their reply, and a 👎 reaches you as a note with their next message. Data and comparisons go in a markdown table, not a widget.";const APPLIED_RESULT_PROMPT =diff --git a/src/components/ForkPanel.tsx b/src/components/ForkPanel.tsxindex 13a1abbf72..b8a6f9f4f7 100644--- a/src/components/ForkPanel.tsx+++ b/src/components/ForkPanel.tsx@@ -9,6 +9,7 @@ import { GroupView } from "./GroupView";import { ThreadPanelHeading } from "./room-feed/ThreadPanelHeading";import { useRoomFeedHere } from "./room-feed/use-room-feed";import { useThreadTurnStart } from "./room-feed/thread-turn-start";+import { useRoomWorkStatuses } from "./room-feed/use-room-work";import { FEED_MIN_WIDTH } from "./room-feed/feed-fit";import { PANEL_MIN_WIDTH, useComputerPanelResize } from "./computer-panel-resize";@@ -35,6 +36,7 @@ export function ForkPanel({ full = false }: { full?: boolean }) {}, [panel?.focusComposer, panel?.loadId, panel?.loading]);const panelGroup = panel?.kind === "group" ? state.groups.find((candidate) => candidate.id === panel.ownerId) : undefined;const turnStartedAt = useThreadTurnStart(panelGroup, panelGroup?.tasks?.find((candidate) => candidate.threadId === panel?.threadId));+ const work = useRoomWorkStatuses(panelGroup?.dm ? null : panelGroup?.id, state.bots).get(panel?.threadId ?? "") ?? null;if (!panel) return null;const bot = panel.kind === "bot" ? state.bots.find((candidate) => candidate.id === panel.ownerId) : undefined;const group = panel.kind === "group" ? state.groups.find((candidate) => candidate.id === panel.ownerId) : undefined;@@ -78,7 +80,7 @@ export function ForkPanel({ full = false }: { full?: boolean }) {<header className="flex shrink-0 items-center gap-2 py-2.5 ps-4 pe-3">{inPlace && group && <button type="button" aria-label={t("room.thread.backToFeed", { name: group.name })} title={t("room.thread.backToFeed", { name: group.name })}data-thread-back="" className="ui-icon-button shrink-0" onClick={close}><ArrowLeft size={16} aria-hidden="true" /></button>}- {!fork && group && groupTask ? <ThreadPanelHeading group={group} task={groupTask} messages={panel.messages} working={Boolean(openedGroup?.working || openedGroup?.busyBotId)} /> : <div className="min-w-0 flex-1">+ {!fork && group && groupTask ? <ThreadPanelHeading group={group} task={groupTask} messages={panel.messages} working={Boolean(openedGroup?.working || openedGroup?.busyBotId)} work={work} /> : <div className="min-w-0 flex-1"><h2 dir="auto" title={task?.title} className="truncate text-[15px] font-semibold leading-5 text-ink">{fork ? task?.title ?? label : label}</h2><p dir="auto" className="truncate text-[12px] leading-4 text-ink-secondary">{group?.name ?? bot?.name}</p></div>}diff --git a/src/components/room-feed/RoomFeedRow.dom.test.ts b/src/components/room-feed/RoomFeedRow.dom.test.tsindex 212e5e2be8..723ca77cc9 100644--- a/src/components/room-feed/RoomFeedRow.dom.test.ts+++ b/src/components/room-feed/RoomFeedRow.dom.test.ts@@ -71,6 +71,27 @@ describe("a room feed row", () => {expect(item().textContent).not.toContain("2 replies");});+ it("shows a work thread's one status beside its time, where Closed would be, and says it to a screen reader", () => {+ render(row({ work: { kind: "needs", label: "Needs you" }, closedBy: { botId: "kiwi", name: "Kiwi", at: NOW } }));+ const work = item().querySelector("[data-feed-work]")!;+ expect([work.getAttribute("data-feed-work"), work.textContent]).toEqual(["needs", "Needs you"]);+ expect(work.className).toContain("text-ink");+ expect(item().querySelector("[data-feed-closed]")).toBeNull();+ expect(item().querySelector("button")!.getAttribute("aria-label")).toBe("Ana, Plan the launch, No replies yet, Needs you");+ act(() => root!.unmount());+ render(row({ work: { kind: "next", label: "Up next" } }));+ expect(item().querySelector("[data-feed-work]")?.className).toContain("text-ink-tertiary");+ });++ it("says a bot is working on a work thread once: the line under it does while its turn runs", () => {+ render(row({ work: { kind: "working", label: "Kiwi working" }, working: true, workingBotId: "kiwi" }));+ expect(item().querySelector("[data-feed-work]")).toBeNull();+ expect(item().textContent).toContain("Kiwi is working…");+ act(() => root!.unmount());+ render(row({ work: { kind: "working", label: "Kiwi working" } }));+ expect(item().querySelector("[data-feed-work]")?.textContent).toBe("Kiwi working");+ });+it("fades a long line, ends a clipped one with an ellipsis, and names an attachment-only line", () => {render(row({ text: "word ".repeat(80), clipped: true }));const body = item().querySelector<HTMLElement>(".chat-text")!;diff --git a/src/components/room-feed/RoomFeedRow.tsx b/src/components/room-feed/RoomFeedRow.tsxindex 0f7ea72d25..e23fcac591 100644--- a/src/components/room-feed/RoomFeedRow.tsx+++ b/src/components/room-feed/RoomFeedRow.tsx@@ -7,6 +7,7 @@ import { splitTranscriptAttachments } from "@/lib/composer-attachments";import { opensRowMenuFromKey } from "@/lib/bulk-select";import { intlLocale, t } from "@/lib/i18n";import { MAUS_COLOR_NAMES } from "@/lib/mascot";+import { WORK_INK, type WorkStatus } from "@/lib/room-work";import type { Bot, ThreadCloser } from "@/state/store";import { stripLeakedSystemHarnessMessages } from "../../../shared/system-message-guard.ts";import { BotAvatar } from "../Avatar";@@ -37,6 +38,8 @@ export interface FeedRowData {archived?: boolean;/** Its work was marked finished; a new line opens it again. */closedBy?: ThreadCloser;+ /** Where its piece of work stands, when a bot split it off as one. */+ work?: WorkStatus | null;}/** What a thread row's menu does, the same as the sidebar's room thread rows. */@@ -121,7 +124,9 @@ export const RoomFeedRow = memo(function RoomFeedRow({ row, groupId, bots, you,const workingBot = row.workingBotId ? bots.find((bot) => bot.id === row.workingBotId) : undefined;const replies = row.replies === 1 ? t("room.feed.replyOne") : t("room.feed.replyMany", { count: row.replies });const markLabel = row.mark === "waiting" ? t("sidebar.preview.waiting") : row.mark === "unread" ? t("task.unread") : null;- const label = [speaker.name, text || t("room.feed.attachment"), row.replies > 0 ? replies : t("room.feed.noReplies"), row.closedBy ? t("task.closed") : null, markLabel].filter(Boolean).join(", ");+ // A work status stands where "Closed" would; a bot working on it now is already said by the line under it.+ const work = row.work && !row.archived && !(row.work.kind === "working" && row.working) ? row.work : null;+ const label = [speaker.name, text || t("room.feed.attachment"), row.replies > 0 ? replies : t("room.feed.noReplies"), work ? work.label : row.closedBy ? t("task.closed") : null, markLabel].filter(Boolean).join(", ");const quiet = row.archived || Boolean(row.closedBy);const openMenuAt = (x: number, y: number) => setMenu(threadMenuAt(x, y));const rename = (title: string | null) => {@@ -148,7 +153,8 @@ export const RoomFeedRow = memo(function RoomFeedRow({ row, groupId, bots, you,className="shrink-0 text-[12px] font-medium leading-4 text-ink-tertiary tabular-nums">{threadUpdatedLabel(row.at, now)}</time>{row.pinned && <Pin size={11} data-feed-pinned="" className="shrink-0 self-center text-ink-secondary" aria-label={t("sidebar.bot.pin")} />}{row.archived ? <span className="min-w-0 truncate text-[12px] leading-4 text-ink-tertiary">{t("task.archived")}</span>- : row.closedBy && <span data-feed-closed="" className="min-w-0 truncate text-[12px] leading-4 text-ink-tertiary">{t("task.closed")}</span>}+ : work ? <span data-feed-work={work.kind} className={cn("min-w-0 truncate text-[12px] leading-4", WORK_INK[work.kind])}>{work.label}</span>+ : row.closedBy && <span data-feed-closed="" className="min-w-0 truncate text-[12px] leading-4 text-ink-tertiary">{t("task.closed")}</span>}{markLabel && <span aria-hidden="true" data-feed-mark={row.mark} title={markLabel}className={cn("size-2 shrink-0 self-center rounded-full", row.mark === "waiting" ? "bg-warning" : "bg-accent")} />}</div>diff --git a/src/components/room-feed/RoomFeedView.tsx b/src/components/room-feed/RoomFeedView.tsxindex f91c674b5f..db179bcee5 100644--- a/src/components/room-feed/RoomFeedView.tsx+++ b/src/components/room-feed/RoomFeedView.tsx@@ -25,13 +25,15 @@ import { FeedComposer } from "./FeedComposer";import { useHiddenMark } from "./unread-offscreen";import { RoomFeedRow, type FeedRowActions, type FeedRowData } from "./RoomFeedRow";import { useRoomThreads, type FeedThread } from "./use-room-threads";+import { useRoomWorkStatuses } from "./use-room-work";+import type { WorkStatus } from "@/lib/room-work";/** How near the foot the feed counts as being read there, so a new thread keeps it at the foot. */const FOOT_PX = 48;/** Only the person scrolling takes the feed off its foot; a row opening beside it or a window resize never does. */const INTENT_MS = 1_000;-function toRow(group: Group, { task, summary }: FeedThread, bots: readonly Bot[]): FeedRowData {+function toRow(group: Group, { task, summary }: FeedThread, bots: readonly Bot[], work: WorkStatus | undefined): FeedRowData {const { waiting, unread } = roomThreadAttention(group, task, bots);return {threadId: task.threadId,@@ -42,13 +44,15 @@ function toRow(group: Group, { task, summary }: FeedThread, bots: readonly Bot[]replies: summary.replies,lastReplyAt: summary.lastReplyAt,repliers: summary.repliers,- mark: waiting ? "waiting" : unread ? "unread" : null,+ // A piece of work waiting on someone else does not wait on the viewer.+ mark: waiting && !work?.someoneElse ? "waiting" : unread ? "unread" : null,working: roomThreadWorking(group, task.threadId),workingBotId: roomThreadSpeakerId(group, task.threadId),title: task.title,pinned: task.pinned === true,archived: isArchived(task),closedBy: threadRowCloser(task),+ work,};}@@ -82,6 +86,8 @@ export function RoomFeedView({ group }: { group: Group }) {const deletable = (group.tasks?.length ?? 1) > 1;const [showArchived, setShowArchived] = useState(false);const { threads, failed, retry } = useRoomThreads(group, showArchived && hasArchived);+ const work = useRoomWorkStatuses(group.id, bots);+ const team = useStoreSelector((state) => Boolean(state.config?.team));const actions = useMemo<FeedRowActions>(() => {const room = roomThreadRowActions(group.id, dispatch);const leave = (threadId: string) => { if (store.state().forkPanel?.threadId === threadId) dispatch({ type: "closeForkPanel" }); };@@ -105,11 +111,11 @@ export function RoomFeedView({ group }: { group: Group }) {const rows = useMemo(() => {if (!threads) return null;- const listed = threads.map((thread) => toRow(group, thread, bots));+ const listed = threads.map((thread) => toRow(group, thread, bots, work.get(thread.task.threadId)));if (!pending || (pending.threadId && listed.some((row) => row.threadId === pending.threadId))) return listed;return [...listed, { threadId: pending.threadId ?? "", speaker: { person: {} }, text: pending.text, at: pending.at, replies: 0, lastReplyAt: null,repliers: [], mark: null, working: false, workingBotId: null } satisfies FeedRowData];- }, [threads, pending, group, bots]);+ }, [threads, pending, group, bots, work]);const items = useMemo(() => rows && foldClosedRuns(rows, (row) => folds(row, openThread), unfolded), [rows, openThread, unfolded]);const unfold = useCallback((threadIds: readonly string[]) => {// The fold stays where the person pressed it, and what it shows opens under it.@@ -177,7 +183,10 @@ export function RoomFeedView({ group }: { group: Group }) {</p>)) : rows.length === 0 ? (- <p className="py-6 text-center text-[13px] text-ink-secondary">{t("room.feed.empty")}</p>+ <div className="py-6 text-center text-[13px] leading-[18px]">+ <p className="text-ink-secondary">{t("room.feed.empty")}</p>+ {team && <p data-feed-split-hint="" className="mt-1 text-ink-tertiary">{t("room.feed.splitHint")}</p>}+ </div>) : (<ol aria-label={t("room.feed.aria", { name: group.name })} className="flex flex-col gap-0.5 py-2">{items.map((item) => item.kind === "fold" ? (diff --git a/src/components/room-feed/ThreadPanelHeading.dom.test.ts b/src/components/room-feed/ThreadPanelHeading.dom.test.tsindex 72f125a12f..d30483cdb7 100644--- a/src/components/room-feed/ThreadPanelHeading.dom.test.ts+++ b/src/components/room-feed/ThreadPanelHeading.dom.test.ts@@ -22,13 +22,28 @@ const group = { id: "room", name: "Launch room", threadId: "current", memberIds:let root: Root | null = null;afterEach(() => { act(() => root?.unmount()); root = null; document.body.innerHTML = ""; fixture.dispatch.mockClear(); fixture.find.mockClear(); });-const open = () => {+const show = (work?: { kind: "needs" | "done"; label: string }) => {root = createRoot(document.body.appendChild(document.createElement("header")));- act(() => root!.render(createElement(ThreadPanelHeading, { group, task, messages: [], working: false })));+ act(() => root!.render(createElement(ThreadPanelHeading, { group, task, messages: [], working: false, work })));+};+const open = () => {+ show();act(() => document.querySelector<HTMLButtonElement>("button[aria-expanded]")!.click());};const menuItem = (label: string) => [...document.querySelectorAll<HTMLButtonElement>("[data-thread-overlay] button")].find((button) => button.textContent?.trim() === label);+describe("the heading of a room thread beside its feed", () => {+ it("says where its piece of work stands after the room's name, and nothing for a thread that is not one", () => {+ show({ kind: "needs", label: "Needs Mira" });+ expect(document.querySelector("header p")!.textContent).toBe("Launch room · Needs Mira");+ expect(document.querySelector("[data-thread-work]")?.getAttribute("data-thread-work")).toBe("needs");+ act(() => root!.unmount());+ show();+ expect(document.querySelector("header p")!.textContent).toBe("Launch room");+ expect(document.querySelector("[data-thread-work]")).toBeNull();+ });+});+describe("the menu of a room thread beside its feed", () => {it("finds in that thread, not the room's current one", () => {open();diff --git a/src/components/room-feed/ThreadPanelHeading.tsx b/src/components/room-feed/ThreadPanelHeading.tsxindex de87a50242..ee0f55b168 100644--- a/src/components/room-feed/ThreadPanelHeading.tsx+++ b/src/components/room-feed/ThreadPanelHeading.tsx@@ -5,6 +5,7 @@ import { copyTranscriptToClipboard, downloadMarkdownTranscript, formatTranscriptimport { t } from "@/lib/i18n";import { localizedTaskTitle } from "@/lib/task-title";import { threadRowCloser } from "@/lib/room-thread-close";+import { WORK_INK, type WorkStatus } from "@/lib/room-work";import type { Group, GroupTask, Message } from "@/state/store";import { useStoreRef } from "@/state/store-ref";import { PRESET_TURN_LIMITS, useConversationTurnLimit } from "../ConversationTurnLimit";@@ -16,8 +17,8 @@ const ITEM = "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left te/** The title of a room thread open beside its feed, and its menu: what the feed row's menu offers, and what the room's* header and menu offered for its one thread before the feed: find, the export (its lines are loaded here) and its- * time per turn. */-export function ThreadPanelHeading({ group, task, messages, working }: { group: Group; task: GroupTask; messages: readonly Message[]; working: boolean }) {+ * time per turn. Under the title, where its piece of work stands when a bot split it off as one. */+export function ThreadPanelHeading({ group, task, messages, working, work }: { group: Group; task: GroupTask; messages: readonly Message[]; working: boolean; work?: WorkStatus | null }) {const store = useStoreRef();const dispatch = store.dispatch;const [menu, setMenu] = useState<ThreadMenuAt | null>(null);@@ -76,8 +77,12 @@ export function ThreadPanelHeading({ group, task, messages, working }: { group:{closer? <p data-thread-closed="" className="truncate text-[12px] leading-4 text-ink-tertiary">{t("room.thread.closedBy", { name: closer.name, when: threadUpdatedLabel(closer.at, now) })}+ {work && <> · <span data-thread-work={work.kind} className={WORK_INK[work.kind]}>{work.label}</span></>}</p>- : <p dir="auto" className="truncate text-[12px] leading-4 text-ink-secondary">{group.name}</p>}+ : <p className="truncate text-[12px] leading-4 text-ink-secondary">+ <span dir="auto">{group.name}</span>+ {work && <> · <span data-thread-work={work.kind} className={WORK_INK[work.kind]}>{work.label}</span></>}+ </p>}</div>{closer && <button type="button" data-thread-reopen="" className="ui-button ui-button-sm shrink-0" onClick={() => actions.onSetClosed(task, false)}>{t("task.reopenThread")}</button>}<button ref={moreRef} type="button" aria-label={t("task.actions", { title })} title={t("task.actions", { title })} aria-expanded={Boolean(menu)}diff --git a/src/components/room-feed/use-room-work.dom.test.ts b/src/components/room-feed/use-room-work.dom.test.tsnew file mode 100644index 0000000000..2e4a89b1bf--- /dev/null+++ b/src/components/room-feed/use-room-work.dom.test.ts@@ -0,0 +1,62 @@+// @vitest-environment happy-dom+import { act, createElement } from "react";+import { createRoot, type Root } from "react-dom/client";+import { afterEach, describe, expect, it, vi } from "vitest";+import type { BoardItem, BoardItemFrame } from "../../../shared/board";++(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true;+const fixture = vi.hoisted(() => ({+ config: {} as Record<string, unknown>,+ asked: [] as string[],+ answer: { items: [] as unknown[], you: "p_me" },+ listener: null as null | { onFrame: (frame: unknown) => void; onMissedFrames?: () => void },+}));+vi.mock("@/state/api", async (original) => ({ ...(await original<typeof import("@/state/api")>()),+ api: vi.fn(async (path: string) => { fixture.asked.push(path); return fixture.answer; }) }));+vi.mock("@/lib/live-events", () => ({ listenLiveFrames: (listener: typeof fixture.listener) => { fixture.listener = listener; return () => { fixture.listener = null; }; } }));+vi.mock("@/state/store-select", () => ({ useStoreSelector: (select: (state: unknown) => unknown) => select({ config: fixture.config }) }));++const { useRoomWorkStatuses } = await import("./use-room-work");++const item = (threadId: string, extra: Partial<BoardItem>): BoardItem => ({ threadId, groupId: "g1", title: threadId, state: "ready", needs: [], labels: {}, attempts: 0,+ createdBy: { kind: "bot", id: "lead", name: "Lead" }, createdAt: 1, updatedAt: 1, ...extra });+const BOTS = [{ id: "writer", name: "Writer" }];++let root: Root | null = null;+let seen: ReadonlyMap<string, { label: string }> = new Map();+function Probe({ groupId }: { groupId: string }) {+ seen = useRoomWorkStatuses(groupId, BOTS);+ return null;+}+const mount = async () => {+ root = createRoot(document.body.appendChild(document.createElement("div")));+ await act(async () => root!.render(createElement(Probe, { groupId: "g1" })));+};+const labels = () => Object.fromEntries([...seen].map(([threadId, status]) => [threadId, status.label]));+afterEach(() => { act(() => root?.unmount()); root = null; fixture.asked = []; fixture.listener = null; fixture.config = {}; });++describe("a room's work statuses", () => {+ it("asks for nothing off a Team Cloud", async () => {+ await mount();+ expect(fixture.asked).toEqual([]);+ expect(fixture.listener).toBeNull();+ expect(seen.size).toBe(0);+ });++ it("reads the room's items on a Team Cloud and follows its live frames, only for this room", async () => {+ fixture.config = { team: { id: "t", name: "Acme" } };+ fixture.answer = { items: [item("a", { state: "working", holder: { botId: "writer", since: 1 } }), item("b", { state: "cancelled" })], you: "p_me" };+ await mount();+ expect(fixture.asked).toEqual(["/api/board?groupId=g1"]);+ expect(labels()).toEqual({ a: "Writer working" });+ const frame = (threadId: string, next: BoardItem | null, groupId = "g1"): BoardItemFrame => ({ kind: "board.item", groupId, threadId, item: next });+ await act(async () => fixture.listener!.onFrame(frame("c", item("c", { state: "needs_person", question: { text: "?", askedAt: 1, person: "p_me" } }))));+ await act(async () => fixture.listener!.onFrame(frame("a", item("a", { state: "done" }))));+ await act(async () => fixture.listener!.onFrame(frame("x", item("x", {}), "g2")));+ expect(labels()).toEqual({ a: "Done", c: "Needs you" });+ await act(async () => fixture.listener!.onFrame(frame("c", null)));+ expect(labels()).toEqual({ a: "Done" });+ await act(async () => fixture.listener!.onMissedFrames!());+ expect(fixture.asked).toHaveLength(2);+ });+});diff --git a/src/components/room-feed/use-room-work.ts b/src/components/room-feed/use-room-work.tsnew file mode 100644index 0000000000..f0c6c3fc18--- /dev/null+++ b/src/components/room-feed/use-room-work.ts@@ -0,0 +1,58 @@+import { useEffect, useMemo, useState } from "react";+import type { BoardItem, BoardListResponse } from "../../../shared/board";+import { listenLiveFrames } from "@/lib/live-events";+import { workStatus, type WorkStatus } from "@/lib/room-work";+import { api } from "@/state/api";+import type { Bot } from "@/state/store";+import { useStoreSelector } from "@/state/store-select";++interface RoomWork {+ groupId: string | null;+ byThread: ReadonlyMap<string, BoardItem>;+ you: string | null;+}++const NONE: RoomWork = { groupId: null, byThread: new Map(), you: null };++/** The work items of one room on a Team Cloud (GET /api/board?groupId=), kept current by `board.item` frames and read+ * again after missed ones. Anywhere else there are none, and nothing is asked. */+export function useRoomWork(groupId: string | null | undefined): RoomWork {+ const team = useStoreSelector((state) => Boolean(state.config?.team));+ const [work, setWork] = useState<RoomWork>(NONE);+ useEffect(() => {+ if (!team || !groupId) return;+ let alive = true;+ const load = () => void api<BoardListResponse>(`/api/board?groupId=${encodeURIComponent(groupId)}`)+ .then((answer) => { if (alive) setWork({ groupId, byThread: new Map(answer.items.map((item) => [item.threadId, item])), you: answer.you ?? null }); })+ .catch(() => {});+ load();+ const stop = listenLiveFrames({+ onFrame: (frame) => {+ if (frame.kind !== "board.item" || frame.groupId !== groupId) return;+ setWork((current) => {+ const byThread = new Map(current.groupId === groupId ? current.byThread : []);+ if (frame.item) byThread.set(frame.threadId, frame.item);+ else byThread.delete(frame.threadId);+ return { groupId, byThread, you: current.groupId === groupId ? current.you : null };+ });+ },+ onMissedFrames: load,+ });+ return () => { alive = false; stop(); };+ }, [team, groupId]);+ return team && work.groupId === groupId ? work : NONE;+}++/** Each work thread's status in this room, by thread. */+export function useRoomWorkStatuses(groupId: string | null | undefined, bots: readonly Pick<Bot, "id" | "name">[]): ReadonlyMap<string, WorkStatus> {+ const { byThread, you } = useRoomWork(groupId);+ return useMemo(() => {+ const name = (botId: string) => bots.find((bot) => bot.id === botId)?.name;+ const statuses = new Map<string, WorkStatus>();+ for (const [threadId, item] of byThread) {+ const status = workStatus(item, you, name);+ if (status) statuses.set(threadId, status);+ }+ return statuses;+ }, [byThread, you, bots]);+}diff --git a/src/components/settings/SettingsWindow.test.ts b/src/components/settings/SettingsWindow.test.tsindex faa2a35e5f..28e2941948 100644--- a/src/components/settings/SettingsWindow.test.ts+++ b/src/components/settings/SettingsWindow.test.ts@@ -317,10 +317,10 @@ describe("Settings → Features", () => {expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, suggestedReplies: false });});- it("shows the Board switch only where the server reports it (a Team Cloud)", () => {+ it("shows no Board switch on a Team Cloud, even from an older server that still reports one", () => {fixture.config = { cloudHome: true, team: { name: "Acme" }, features: { skillBurger: true, threadTabs: false, teamBoard: false } };- expect(render("features")).toContain("Board");- expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, teamBoard: false });+ expect(render("features")).not.toContain("Board");+ expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false });});it("shows no switch its server doesn't know, and isn't offered to a team's member", () => {diff --git a/src/components/settings/pages/FeaturesPage.tsx b/src/components/settings/pages/FeaturesPage.tsxindex 69161214f0..26e73f370f 100644--- a/src/components/settings/pages/FeaturesPage.tsx+++ b/src/components/settings/pages/FeaturesPage.tsx@@ -9,11 +9,10 @@ import { SettingRow, SettingsGroup, SettingsRows, Switch } from "../../SettingsPconst COPY: Record<Feature, { title: LocaleKey; line: LocaleKey }> = {skillBurger: { title: "settings.features.skillBurger", line: "settings.features.skillBurgerLine" },threadTabs: { title: "settings.features.threadTabs", line: "settings.features.threadTabsLine" },- teamBoard: { title: "settings.features.teamBoard", line: "settings.features.teamBoardLine" },suggestedReplies: { title: "settings.features.suggestedReplies", line: "settings.features.suggestedRepliesLine" },};-/** One switch kept in this place's config.json; shown once its server says it knows the switch (the board: only a Team Cloud's). */+/** One switch kept in this place's config.json; shown once its server says it knows the switch. */function FeatureRow({ name }: { name: Feature }) {const on = useFeature(name);const known = useStoreSelector((state) => typeof state.config?.features?.[name] === "boolean");@@ -50,7 +49,6 @@ export function FeaturesPage() {<FeatureRow name="skillBurger" /><FeatureRow name="threadTabs" /><FeatureRow name="suggestedReplies" />- <FeatureRow name="teamBoard" /></SettingsRows></SettingsGroup>);diff --git a/src/lib/feature-flags.ts b/src/lib/feature-flags.tsindex ad01aa078b..f86d4e982d 100644--- a/src/lib/feature-flags.ts+++ b/src/lib/feature-flags.ts@@ -1,7 +1,7 @@import { t } from "./i18n";export interface FeatureFlagConfig {- features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean; skillBurger?: boolean; threadTabs?: boolean; roomFeed?: boolean; roomFeedSince?: number; teamBoard?: boolean; suggestedReplies?: boolean };+ features?: { skillAuthoring?: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; claudeUserSkills?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean; skillBurger?: boolean; threadTabs?: boolean; roomFeed?: boolean; roomFeedSince?: number; suggestedReplies?: boolean };browserEngine?: { kind: "engine" | "unavailable"; reason?: string; installable?: boolean; installing?: boolean; installError?: string };}@@ -118,7 +118,3 @@ export function threadTabsEnabled(config: FeatureFlagConfig | null | undefined):export function roomFeedEnabled(config: FeatureFlagConfig | null | undefined): boolean {return config?.features?.roomFeed === true || typeof config?.features?.roomFeedSince === "number";}--export function teamBoardEnabled(config: FeatureFlagConfig | null | undefined): boolean {- return config?.features?.teamBoard === true;-}diff --git a/src/lib/room-work.test.ts b/src/lib/room-work.test.tsnew file mode 100644index 0000000000..433e73cec4--- /dev/null+++ b/src/lib/room-work.test.ts@@ -0,0 +1,38 @@+import { describe, expect, it } from "vitest";+import type { BoardItem } from "../../shared/board";+import { workStatus } from "./room-work";++const item = (extra: Partial<BoardItem>): BoardItem => ({+ threadId: "t1", groupId: "g1", title: "Draft the post", state: "ready", needs: [], labels: {}, attempts: 0,+ createdBy: { kind: "bot", id: "lead", name: "Lead" }, createdAt: 1, updatedAt: 1, ...extra,+});+const names: Record<string, string> = { writer: "Writer" };+const status = (extra: Partial<BoardItem>, viewer: string | null = "p_me") => workStatus(item(extra), viewer, (id) => names[id]);++describe("a work thread's one status", () => {+ it("is Up next while it waits for a bot or for what it needs", () => {+ expect(status({ state: "ready" })).toEqual({ kind: "next", label: "Up next" });+ expect(status({ state: "waiting", needs: ["t0"] })).toEqual({ kind: "next", label: "Up next" });+ });++ it("names the bot working on it", () => {+ expect(status({ state: "working", holder: { botId: "writer", since: 1 } })).toEqual({ kind: "working", label: "Writer working" });+ expect(status({ state: "working", holder: { botId: "gone", since: 1 } })).toEqual({ kind: "working", label: "In progress" });+ });++ it("needs you when you were asked, or nobody in particular was; else names whom it needs", () => {+ const asked = { text: "Which date?", askedAt: 1 };+ expect(status({ state: "needs_person", question: { ...asked, person: "p_me", name: "Me" } })).toEqual({ kind: "needs", label: "Needs you" });+ expect(status({ state: "needs_person", question: asked })).toEqual({ kind: "needs", label: "Needs you" });+ expect(status({ state: "needs_person", question: { ...asked, person: "p_mira", name: "Mira" } })).toEqual({ kind: "needs", label: "Needs Mira", someoneElse: true });+ expect(status({ state: "needs_person", question: { ...asked, person: "p_mira" } }), "an item asked before names were kept").toEqual({ kind: "needs", label: "Needs an answer", someoneElse: true });+ expect(status({ state: "needs_person", question: { ...asked, person: "p_me" } }, null), "before the viewer is known").toEqual({ kind: "needs", label: "Needs an answer", someoneElse: true });+ });++ it("is Done or Stopped once settled, and nothing once cancelled or with no item", () => {+ expect(status({ state: "done", result: "Posted." })).toEqual({ kind: "done", label: "Done" });+ expect(status({ state: "failed" })).toEqual({ kind: "stopped", label: "Stopped" });+ expect(status({ state: "cancelled" })).toBeNull();+ expect(workStatus(undefined, "p_me", () => undefined)).toBeNull();+ });+});diff --git a/src/lib/room-work.ts b/src/lib/room-work.tsnew file mode 100644index 0000000000..f5e21c96eb--- /dev/null+++ b/src/lib/room-work.ts@@ -0,0 +1,47 @@+import type { BoardItem } from "../../shared/board";+import { t } from "@/lib/i18n";++/** Where a room thread's piece of work stands, in a few words: shown on its feed row and over it when it is open. Only a+ * thread a bot split off as work (a board item, docs/team-board.md) has one. */+export interface WorkStatus {+ kind: "next" | "working" | "needs" | "done" | "stopped";+ label: string;+ /** `needs` only: it waits on someone else, so it does not wait on the viewer. */+ someoneElse?: true;+}++/** Hierarchy from ink: what waits on a person reads first, a bot at work next, the rest quietly. */+export const WORK_INK: Record<WorkStatus["kind"], string> = {+ needs: "font-medium text-ink",+ working: "text-ink-secondary",+ next: "text-ink-tertiary",+ done: "text-ink-tertiary",+ stopped: "text-ink-tertiary",+};++/** The one status a work item shows. `viewer` is the viewer's person key, as `question.person` names whoever was asked:+ * a question to nobody in particular is for whoever sees it. A cancelled item shows nothing. */+export function workStatus(item: BoardItem | undefined, viewer: string | null, botName: (botId: string) => string | undefined): WorkStatus | null {+ if (!item) return null;+ switch (item.state) {+ case "waiting":+ case "ready":+ return { kind: "next", label: t("room.work.upNext") };+ case "working": {+ const name = item.holder ? botName(item.holder.botId) : undefined;+ return { kind: "working", label: name ? t("room.work.botWorking", { name }) : t("room.work.working") };+ }+ case "needs_person": {+ const asked = item.question?.person;+ if (!asked || asked === viewer) return { kind: "needs", label: t("room.work.needsYou") };+ const name = item.question?.name?.trim();+ return { kind: "needs", label: name ? t("room.work.needsName", { name }) : t("room.work.needsAnswer"), someoneElse: true };+ }+ case "done":+ return { kind: "done", label: t("room.work.done") };+ case "failed":+ return { kind: "stopped", label: t("room.work.stopped") };+ case "cancelled":+ return null;+ }+}diff --git a/src/lib/use-feature.ts b/src/lib/use-feature.tsindex 02fada5c29..04acfdfcfd 100644--- a/src/lib/use-feature.ts+++ b/src/lib/use-feature.ts@@ -1,14 +1,13 @@-import { skillBurgerEnabled, suggestedRepliesEnabled, teamBoardEnabled, threadTabsEnabled } from "@/lib/feature-flags";+import { skillBurgerEnabled, suggestedRepliesEnabled, threadTabsEnabled } from "@/lib/feature-flags";import type { ConfigStatus } from "@/state/store";import { useStoreSelector } from "@/state/store-select";/** Switches on Settings → Features, kept in the place's config.json (`features.<name>`), so its server reads them too. */-export type Feature = "skillBurger" | "threadTabs" | "teamBoard" | "suggestedReplies";+export type Feature = "skillBurger" | "threadTabs" | "suggestedReplies";const FEATURES: Record<Feature, (config: ConfigStatus | null | undefined) => boolean> = {skillBurger: skillBurgerEnabled,threadTabs: threadTabsEnabled,- teamBoard: teamBoardEnabled,suggestedReplies: suggestedRepliesEnabled,};diff --git a/src/locales/de.json b/src/locales/de.jsonindex 1a9319c82a..d370c788b8 100644--- a/src/locales/de.json+++ b/src/locales/de.json@@ -297,10 +297,10 @@"server.checkBack.started": "Hat {when} wieder nachgeschaut","server.checkBack.cancelled": "Nachschauen abgebrochen","server.checkBack.failed": "Konnte {when} nicht wieder nachschauen",- "server.board.sender": "Board",- "server.board.brief": "@{bot} Dieser Board-Eintrag gehört dir: „{title}“.\n\n{text}\n\nEr ist erledigt, wenn die Arbeit oben fertig ist und du sagen kannst, was daraus wurde. Schließe mit board_update ab: done oder failed (text: was daraus wurde), ask (text: deine Frage an eine Person), later (Minuten und eine Notiz, um dann wieder nachzusehen) oder release (um ihn zurückzugeben).",+ "server.board.sender": "Übergabe",+ "server.board.brief": "@{bot} Diese Aufgabe gehört dir: „{title}“.\n\n{text}\n\nSie ist erledigt, wenn die Arbeit oben fertig ist und du sagen kannst, was daraus wurde. Schließe mit board_update ab: done oder failed (text: was daraus wurde), ask (text: deine Frage an eine Person), later (Minuten und eine Notiz, um dann wieder nachzusehen) oder release (um sie zurückzugeben).","server.board.briefNeeds": "Worauf er gewartet hat:\n{results}",- "server.board.wake": "@{bot} Zurück zum Board-Eintrag „{title}“: {note}\n\nSchließe mit board_update ab: done, failed, ask, later oder release.",+ "server.board.wake": "@{bot} Zurück zu „{title}“: {note}\n\nSchließe mit board_update ab: done, failed, ask, later oder release.","server.board.stopped": "Nach {count} Versuchen gestoppt: Jeder Durchgang endete, ohne den Eintrag abzuschließen.","server.board.tooManyLaters": "{count}-mal zurückgestellt, ohne fertig zu werden, daher gestoppt.","server.board.askTitle": "{bot} fragt dich zu „{title}“",@@ -4478,6 +4478,15 @@"room.feed.attachment": "Ein Anhang","room.feed.you": "Du","room.feed.empty": "Noch keine Threads. Schreib unten, um einen zu beginnen.",+ "room.feed.splitHint": "Bitte einen Bot, große Aufgaben in Threads aufzuteilen.",+ "room.work.upNext": "Als Nächstes",+ "room.work.working": "In Arbeit",+ "room.work.botWorking": "{name} arbeitet",+ "room.work.needsYou": "Braucht dich",+ "room.work.needsName": "Braucht {name}",+ "room.work.needsAnswer": "Braucht eine Antwort",+ "room.work.done": "Erledigt",+ "room.work.stopped": "Gestoppt","room.feed.loadFailed": "Die Threads dieses Raums konnten nicht geladen werden.","room.feed.startFailed": "Der Thread konnte nicht begonnen werden. Prüfe deine Verbindung und versuche es erneut.","room.feed.showArchived": "Archivierte Threads anzeigen",@@ -4491,8 +4500,6 @@"room.thread.backToFeed": "Zurück zu {name}","room.thread.resize": "Thread-Breite ändern","room.thread.closedBy": "Abgeschlossen von {name} · {when}",- "settings.features.teamBoard": "Board",- "settings.features.teamBoardLine": "Verfolge Arbeit in Gruppenchats als Einträge mit Status, Labels und dem, worauf jeder wartet","settings.features.error": "Das konnte nicht gespeichert werden. Prüfe deine Verbindung und versuche es erneut.","skillBurger.pill.cooking": "Wird gekocht… {count}","skillBurger.pill.add": "Hinzufügen",diff --git a/src/locales/en.json b/src/locales/en.jsonindex 9b38674508..0530d8d6dc 100644--- a/src/locales/en.json+++ b/src/locales/en.json@@ -443,10 +443,10 @@"server.checkBack.started": "Checked back {when}","server.checkBack.cancelled": "Check-back cancelled","server.checkBack.failed": "Couldn't check back {when}",- "server.board.sender": "Board",- "server.board.brief": "@{bot} This board item is yours: \"{title}\".\n\n{text}\n\nIt is done when the work above is finished and you can say what came of it. Finish with board_update: done or failed (text: what came of it), ask (text: your question for a person), later (minutes and a note, to look again then) or release (to hand it back).",+ "server.board.sender": "Handoff",+ "server.board.brief": "@{bot} This piece of work is yours: \"{title}\".\n\n{text}\n\nIt is done when the work above is finished and you can say what came of it. Finish with board_update: done or failed (text: what came of it), ask (text: your question for a person), later (minutes and a note, to look again then) or release (to hand it back).","server.board.briefNeeds": "What it waited on:\n{results}",- "server.board.wake": "@{bot} Back to the board item \"{title}\": {note}\n\nFinish with board_update: done, failed, ask, later or release.",+ "server.board.wake": "@{bot} Back to \"{title}\": {note}\n\nFinish with board_update: done, failed, ask, later or release.","server.board.stopped": "Stopped after {count} tries: each turn ended without finishing the item.","server.board.tooManyLaters": "Set aside {count} times without finishing, so it stopped.","server.board.askTitle": "{bot} asks you about \"{title}\"",@@ -12162,6 +12162,15 @@"room.feed.attachment": "An attachment","room.feed.you": "You","room.feed.empty": "No threads yet. Write below to start one.",+ "room.feed.splitHint": "Ask a bot to split big work into threads.",+ "room.work.upNext": "Up next",+ "room.work.working": "In progress",+ "room.work.botWorking": "{name} working",+ "room.work.needsYou": "Needs you",+ "room.work.needsName": "Needs {name}",+ "room.work.needsAnswer": "Needs an answer",+ "room.work.done": "Done",+ "room.work.stopped": "Stopped","room.feed.loadFailed": "Couldn't load this room's threads.","room.feed.startFailed": "Couldn't start a thread. Check your connection and try again.","room.feed.showArchived": "Show archived threads",@@ -12175,8 +12184,6 @@"room.thread.backToFeed": "Back to {name}","room.thread.resize": "Resize thread","room.thread.closedBy": "Closed by {name} · {when}",- "settings.features.teamBoard": "Board",- "settings.features.teamBoardLine": "Track work in group chats as items with a state, labels and what each one waits for","settings.features.error": "Couldn't save that. Check your connection and try again.","skillBurger.pill.cooking": "Cooking… {count}","skillBurger.pill.add": "Add",diff --git a/src/locales/pt-br.json b/src/locales/pt-br.jsonindex b2fb9c2266..cf1d5c35b3 100644--- a/src/locales/pt-br.json+++ b/src/locales/pt-br.json@@ -424,10 +424,10 @@"server.checkBack.started": "Verificou de novo: {when}","server.checkBack.cancelled": "Verificação cancelada","server.checkBack.failed": "Não foi possível verificar de novo: {when}",- "server.board.sender": "Quadro",- "server.board.brief": "@{bot} Este item do quadro é seu: \"{title}\".\n\n{text}\n\nEle está concluído quando o trabalho acima estiver pronto e você puder dizer o que resultou dele. Termine com board_update: done ou failed (text: o que resultou), ask (text: sua pergunta para uma pessoa), later (minutos e uma nota, para olhar de novo depois) ou release (para devolvê-lo).",+ "server.board.sender": "Repasse",+ "server.board.brief": "@{bot} Esta parte do trabalho é sua: \"{title}\".\n\n{text}\n\nEla está concluída quando o trabalho acima estiver pronto e você puder dizer o que resultou dele. Termine com board_update: done ou failed (text: o que resultou), ask (text: sua pergunta para uma pessoa), later (minutos e uma nota, para olhar de novo depois) ou release (para devolvê-la).","server.board.briefNeeds": "O que ele esperava:\n{results}",- "server.board.wake": "@{bot} De volta ao item do quadro \"{title}\": {note}\n\nTermine com board_update: done, failed, ask, later ou release.",+ "server.board.wake": "@{bot} De volta a \"{title}\": {note}\n\nTermine com board_update: done, failed, ask, later ou release.","server.board.stopped": "Parado após {count} tentativas: cada vez terminou sem concluir o item.","server.board.tooManyLaters": "Adiado {count} vezes sem terminar, então parou.","server.board.askTitle": "{bot} pergunta a você sobre \"{title}\"",@@ -12162,6 +12162,15 @@"room.feed.attachment": "Um anexo","room.feed.you": "Você","room.feed.empty": "Nenhuma conversa ainda. Escreva abaixo para começar uma.",+ "room.feed.splitHint": "Peça a um bot para dividir trabalhos grandes em conversas.",+ "room.work.upNext": "A seguir",+ "room.work.working": "Em andamento",+ "room.work.botWorking": "{name} trabalhando",+ "room.work.needsYou": "Precisa de você",+ "room.work.needsName": "Precisa de {name}",+ "room.work.needsAnswer": "Precisa de uma resposta",+ "room.work.done": "Concluído",+ "room.work.stopped": "Parado","room.feed.loadFailed": "Não foi possível carregar as conversas deste grupo.","room.feed.startFailed": "Não foi possível começar a conversa. Verifique sua conexão e tente de novo.","room.feed.showArchived": "Mostrar conversas arquivadas",@@ -12175,8 +12184,6 @@"room.thread.backToFeed": "Voltar para {name}","room.thread.resize": "Redimensionar conversa","room.thread.closedBy": "Encerrada por {name} · {when}",- "settings.features.teamBoard": "Quadro",- "settings.features.teamBoardLine": "Acompanhe o trabalho nos chats em grupo como itens com status, rótulos e o que cada um espera","settings.features.error": "Não foi possível salvar. Verifique sua conexão e tente de novo.","skillBurger.pill.cooking": "Cozinhando… {count}","skillBurger.pill.add": "Adicionar",diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.jsonindex b6a700b1ee..12e3d9b73a 100644--- a/src/locales/source-hashes.json+++ b/src/locales/source-hashes.json@@ -4356,10 +4356,10 @@"server.allBotsSkill.delete.done": "e28df336c03f89e33c29fd6b318a83844592e588b92ef018ec2b0437f50a27b7","server.allBotsSkill.body": "708cadee1cefe4a47a99935f4234d1d80bce6ab72a131519a1c1202aecb5e2a9","server.allBotsSkill.deleteBody": "e9941c6f96e428bf5c9d61c81b079465fa20d3467d7604484eb58a11823bc1c9",- "server.board.sender": "4816cbfd74aa8297b9c9cdaae89e2f0d2ced6041e952dfcd114e01b4c82e9c6d",- "server.board.brief": "9e44c602e102a61ff28e7fccafae5ba8e5391c7872de85f69353397783ec9193",+ "server.board.sender": "f89e2d72da00888b27c938fff1eff1d138fd49fb664d0269527a69e746ced479",+ "server.board.brief": "c2eb49d854fcf8d5f7cf4936214c935dbf311b46da011d9cd4b3cd5444eeb185","server.board.briefNeeds": "c5f1055775cc6594a0f12440e9c12ce7e403574914d228da276b4da0a29dae48",- "server.board.wake": "995eea183216d52d7ecc9941e5d9332c98b2a78a951902991a3bbc34b6c8ceeb",+ "server.board.wake": "aa37ab8267336d57600ba0119ef12a4ef66024745654b59608110d229f1d6308","server.board.stopped": "e5e84882d975a1999a2165af1a773dd198997b887a38cfb81cb8e7f210c226ab","server.board.tooManyLaters": "98df25ed81df18f829e0636353ca56690b226d445ac52cd6e881931f74c9cf6b","server.board.askTitle": "4e7c97c9190ee30a8226c76d666b403297026088238aad2bb230c1b98836f6ed",@@ -4403,6 +4403,15 @@"room.feed.attachment": "8401a2d85c09f2821430e977f9f79e26d810dce8d280bf18ebf1a86b6386a657","room.feed.you": "08b041935798fbf6fd6ff51099ffedb140a475889986d14f5559ff8e7fc571dd","room.feed.empty": "108b77706ab9f172b2c8b8dccd31ad3e7ea80aec3b598b92e67781f9ea834bb3",+ "room.feed.splitHint": "d8645578c099685a08d2ccd9f6f32dcd06e32a576cc2587561f26f93ea5867ae",+ "room.work.upNext": "e31da5b25f8b7324861e9aadaf5c503e7fd43e739fa3be17ebe63e999fb13df1",+ "room.work.working": "c1f88e9d6c4145cf0530ae020155384d5688d70ed82a07a35d783bbc4b32238c",+ "room.work.botWorking": "0a8235a85a17f173e742f4c255f194a25cd52aa8ddb5c2d36742a2391c60b9ad",+ "room.work.needsYou": "74b6abdf59690fdffec2059089487cd63658249da5301cbf065e9977518fbd8f",+ "room.work.needsName": "5ba3be2c11df084fa7b3d76eb7af4c16ccb599a9ab938ba7d91500ee4f585f75",+ "room.work.needsAnswer": "d02bd7d7c1008440a90ef367d730b6b028e899529b9842da3a04bd85a42139da",+ "room.work.done": "11a6767d5674c7e45f7e00dc525762275b3a48491ad6045427d2609cc496c516",+ "room.work.stopped": "1a4f630ac1b69fd00728fa8a672ded71d0eae8516cb23e78f94529113399b79b","room.feed.loadFailed": "92d9c27a6e741b2869f47b01fde5a3b7fdd55fac874678fb6f545fe57539f788","room.feed.startFailed": "60c8ec0593bb4a845d7a8d332b6de37643d3c36483a32cf6f468c04d1f3b9fed","room.feed.showArchived": "43b4b3da90581a1da3e427f95f45a76d8162ee53fa17ff7e269e7e9b75249152",@@ -4410,8 +4419,6 @@"room.thread.panel": "5373c7f8a5a69019e959540ef127be3302afdd5e2313244e6d08cbd5e975d06d","room.thread.close": "5110caa6ca6c3ef28948a5962f370a17ad382c417453b260f2e2a080016eb7ac","room.thread.resize": "f2bb5d00ab741976eb3c1ffc6cc1b46e61c289cb6429ed4fd2dd2214a1bcceb1",- "settings.features.teamBoard": "4816cbfd74aa8297b9c9cdaae89e2f0d2ced6041e952dfcd114e01b4c82e9c6d",- "settings.features.teamBoardLine": "d86f4fb41e575b41112d425e469fe7db01fa186289dd72edc16c7566b3744fae","devices.reach.sameWifi": "f8d897a6943986b975d2d3ebd06d0a147717d6c1c6f817298c772b99a60e4e43","settings.nav.phoneConnected": "b6bbe67d625aafd3eb3e46aa70018ded8a058ba06359854069c0db658456bb3b","settings.nav.phoneNeedsYou": "63e1a7e403163a29e8f512cc9176fd27218bb719b052794d548ac0f0d3b3980b",@@ -39593,10 +39600,10 @@"server.allBotsSkill.delete.done": "e28df336c03f89e33c29fd6b318a83844592e588b92ef018ec2b0437f50a27b7","server.allBotsSkill.body": "708cadee1cefe4a47a99935f4234d1d80bce6ab72a131519a1c1202aecb5e2a9","server.allBotsSkill.deleteBody": "e9941c6f96e428bf5c9d61c81b079465fa20d3467d7604484eb58a11823bc1c9",- "server.board.sender": "4816cbfd74aa8297b9c9cdaae89e2f0d2ced6041e952dfcd114e01b4c82e9c6d",- "server.board.brief": "9e44c602e102a61ff28e7fccafae5ba8e5391c7872de85f69353397783ec9193",+ "server.board.sender": "f89e2d72da00888b27c938fff1eff1d138fd49fb664d0269527a69e746ced479",+ "server.board.brief": "c2eb49d854fcf8d5f7cf4936214c935dbf311b46da011d9cd4b3cd5444eeb185","server.board.briefNeeds": "c5f1055775cc6594a0f12440e9c12ce7e403574914d228da276b4da0a29dae48",- "server.board.wake": "995eea183216d52d7ecc9941e5d9332c98b2a78a951902991a3bbc34b6c8ceeb",+ "server.board.wake": "aa37ab8267336d57600ba0119ef12a4ef66024745654b59608110d229f1d6308","server.board.stopped": "e5e84882d975a1999a2165af1a773dd198997b887a38cfb81cb8e7f210c226ab","server.board.tooManyLaters": "98df25ed81df18f829e0636353ca56690b226d445ac52cd6e881931f74c9cf6b","server.board.askTitle": "4e7c97c9190ee30a8226c76d666b403297026088238aad2bb230c1b98836f6ed",@@ -39753,6 +39760,15 @@"room.feed.attachment": "8401a2d85c09f2821430e977f9f79e26d810dce8d280bf18ebf1a86b6386a657","room.feed.you": "08b041935798fbf6fd6ff51099ffedb140a475889986d14f5559ff8e7fc571dd","room.feed.empty": "108b77706ab9f172b2c8b8dccd31ad3e7ea80aec3b598b92e67781f9ea834bb3",+ "room.feed.splitHint": "d8645578c099685a08d2ccd9f6f32dcd06e32a576cc2587561f26f93ea5867ae",+ "room.work.upNext": "e31da5b25f8b7324861e9aadaf5c503e7fd43e739fa3be17ebe63e999fb13df1",+ "room.work.working": "c1f88e9d6c4145cf0530ae020155384d5688d70ed82a07a35d783bbc4b32238c",+ "room.work.botWorking": "0a8235a85a17f173e742f4c255f194a25cd52aa8ddb5c2d36742a2391c60b9ad",+ "room.work.needsYou": "74b6abdf59690fdffec2059089487cd63658249da5301cbf065e9977518fbd8f",+ "room.work.needsName": "5ba3be2c11df084fa7b3d76eb7af4c16ccb599a9ab938ba7d91500ee4f585f75",+ "room.work.needsAnswer": "d02bd7d7c1008440a90ef367d730b6b028e899529b9842da3a04bd85a42139da",+ "room.work.done": "11a6767d5674c7e45f7e00dc525762275b3a48491ad6045427d2609cc496c516",+ "room.work.stopped": "1a4f630ac1b69fd00728fa8a672ded71d0eae8516cb23e78f94529113399b79b","room.feed.loadFailed": "92d9c27a6e741b2869f47b01fde5a3b7fdd55fac874678fb6f545fe57539f788","room.feed.startFailed": "60c8ec0593bb4a845d7a8d332b6de37643d3c36483a32cf6f468c04d1f3b9fed","room.feed.showArchived": "43b4b3da90581a1da3e427f95f45a76d8162ee53fa17ff7e269e7e9b75249152",@@ -39760,8 +39776,6 @@"room.thread.panel": "5373c7f8a5a69019e959540ef127be3302afdd5e2313244e6d08cbd5e975d06d","room.thread.close": "5110caa6ca6c3ef28948a5962f370a17ad382c417453b260f2e2a080016eb7ac","room.thread.resize": "f2bb5d00ab741976eb3c1ffc6cc1b46e61c289cb6429ed4fd2dd2214a1bcceb1",- "settings.features.teamBoard": "4816cbfd74aa8297b9c9cdaae89e2f0d2ced6041e952dfcd114e01b4c82e9c6d",- "settings.features.teamBoardLine": "d86f4fb41e575b41112d425e469fe7db01fa186289dd72edc16c7566b3744fae","devicesPage.attention.item": "db29d8fc44e6b763583799ee7286b18341e37a6836ad3a6dedcf8f06957768eb","devicesPage.network.turnOff": "244e92b8c52ba582607591ec1caf2244fba17820880915f7839172f666947cc9","devicesPage.network.turnOffHint": "96f521a685ebb3b1d7b4103680cded999e94ff208dcb09c0ac7295f62bcc8d24",diff --git a/src/state/config-status.ts b/src/state/config-status.tsindex e0b88f5c49..d2375d98f5 100644--- a/src/state/config-status.ts+++ b/src/state/config-status.ts@@ -169,7 +169,7 @@ export interface ConfigStatus {/** What a paired phone calls this computer; "" uses the default. */computerName?: string;/** Opt-in flags. Absent means off. */- features?: { skillAuthoring: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean; skillBurger?: boolean; threadTabs?: boolean; roomFeed?: boolean; roomFeedSince?: number; teamBoard?: boolean; suggestedReplies?: boolean };+ features?: { skillAuthoring: boolean; skillReview?: boolean; skillReviewSteps?: number; showToolCalls?: boolean; browser?: boolean; sharedComputers?: boolean; claudeUserMcp?: boolean; skillsLibrary?: boolean; shareLearnedSkills?: "off" | "ask" | "auto"; roomMemoryCapture?: boolean; savedSteps?: boolean; savedStepsHere?: boolean; usbPhoneTakeover?: boolean; skillBurger?: boolean; threadTabs?: boolean; roomFeed?: boolean; roomFeedSince?: number; suggestedReplies?: boolean };/** First-run progress: whether the welcome tour was finished and which* one-time hints were dismissed. Server-owned so it follows the workspace. */onboarding?: OnboardingStatus;