Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(office): Mission Control becomes its own modern office upstairs
rubenluetke10-beep38937e6fc5f5
diff --git a/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsx b/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsxnew file mode 100644index 0000000000..a8b9901279--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/CommandOffice.tsx@@ -0,0 +1,486 @@+/**+ * Mission Control, the coding floor's own office: a walnut slat wall with a+ * live video wall, and a desk with three live monitors and an executive chair.+ * Working it (E in the room, or a click on any of its screens) opens the+ * Mission Control panel: start new coding agents, brief several at once.+ *+ * Every screen is a live board of the floor, drawn from the same shared pane+ * poll the figures ride: the video wall shows each agent as a tile; the desk+ * shows the workspaces (left), the floor's counts and a "New agent" button+ * (centre) and the latest prompts (right).+ *+ * Pieces are built in local space centred on the origin, front facing +z, and+ * stay inside their FURNITURE_SIZE box.+ */+import { useEffect, useMemo, useRef, useState } from "react";+import type { ThreeEvent } from "@react-three/fiber";+import { CanvasTexture, CylinderGeometry, MeshBasicMaterial, MeshStandardMaterial, SRGBColorSpace } from "three";+import { useT } from "@/i18n";+import { useWorkspacePanesStore } from "@/store/workspacePanes";+import type { AgentRunState } from "../data";+import { Box, MAT, matte, Rounded } from "./OfficeFurniture";+import { paneOccupants } from "./codingFloor";+import { COMMAND_DESK, COMMAND_DESK_OFFSET, type Furniture, type FurnitureKind } from "./officeLayout";+import { useOfficeStore } from "./officeStore";++// ---------------------------------------------------------------------------+// Live data+// ---------------------------------------------------------------------------++export interface FloorAgent {+ name: string;+ state: AgentRunState;+ stateKey: string;+ cli: string;+ workspace: string;+ prompt: string;+ promptAt: number | null;+ topic: string;+}++export interface FloorData {+ counts: { total: number; working: number; waiting: number; idle: number };+ agents: FloorAgent[];+ workspaces: { name: string; total: number; working: number }[];+}++function useFloorData(): FloorData {+ const panes = useWorkspacePanesStore((s) => s.panes);+ return useMemo(() => {+ const counts = { total: 0, working: 0, waiting: 0, idle: 0 };+ const agents: FloorAgent[] = [];+ const byWorkspace = new Map<string, { name: string; total: number; working: number }>();+ for (const { agent, pane, stateKey } of paneOccupants(panes)) {+ counts.total += 1;+ if (agent.state === "working") counts.working += 1;+ else if (agent.state === "waiting") counts.waiting += 1;+ else counts.idle += 1;+ agents.push({+ name: agent.name, state: agent.state, stateKey, cli: pane.display_name || pane.agent,+ workspace: pane.workspace_name, prompt: pane.last_prompt.trim(), promptAt: pane.last_prompt_at, topic: pane.recap.trim(),+ });+ const ws = byWorkspace.get(pane.workspace_id) ?? { name: pane.workspace_name, total: 0, working: 0 };+ ws.total += 1;+ if (agent.state === "working") ws.working += 1;+ byWorkspace.set(pane.workspace_id, ws);+ }+ return { counts, agents, workspaces: [...byWorkspace.values()] };+ }, [panes]);+}++/** Everything the screens say, in the viewer's language. */+export interface ScreenLabels {+ title: string; agents: string; start: string; workspaces: string; activity: string; none: string;+ working: string; waiting: string; idle: string;+ state: (key: string) => string;+ since: (at: number | null) => string;+}++function useScreenLabels(): ScreenLabels {+ const t = useT();+ return {+ title: t("society.office.cp_mission"),+ agents: t("society.office.mission_screen_agents"),+ start: t("society.office.mission_screen_start"),+ workspaces: t("society.office.mission_screen_workspaces"),+ activity: t("society.office.mission_screen_activity"),+ none: t("society.office.mission_screen_none"),+ working: t("society.office.state_working"),+ waiting: t("society.office.state_waiting"),+ idle: t("society.office.state_idle"),+ state: (key) => t(`society.office.pane_state_${key}`),+ since: (at) => {+ if (!at) return "";+ const s = Math.max(0, Date.now() / 1000 - at);+ if (s < 60) return t("society.office.since_now");+ if (s < 3600) return t("society.office.since_minutes").replace("{0}", String(Math.floor(s / 60)));+ if (s < 86400) return t("society.office.since_hours").replace("{0}", String(Math.floor(s / 3600)));+ return t("society.office.since_days").replace("{0}", String(Math.floor(s / 86400)));+ },+ };+}++// ---------------------------------------------------------------------------+// Drawing: one quiet dark UI, white type, colour only for state.+// ---------------------------------------------------------------------------++const INK = "#f4f6f8", MUTED = "#8b929c", FAINT = "rgba(255,255,255,0.07)";+const FONT = "Inter, system-ui, -apple-system, 'Segoe UI', sans-serif";+const STATE: Record<AgentRunState, string> = { working: "#4ade80", waiting: "#fbbf24", idle: "#8b929c", paused: "#8b929c" };++type Ctx = CanvasRenderingContext2D;++function ground(ctx: Ctx, w: number, h: number): void {+ const bg = ctx.createLinearGradient(0, 0, 0, h);+ bg.addColorStop(0, "#15181d");+ bg.addColorStop(1, "#0b0d10");+ ctx.fillStyle = bg;+ ctx.fillRect(0, 0, w, h);+ ctx.textBaseline = "alphabetic";+ ctx.textAlign = "left";+}++/** `text` cut with an ellipsis so it fits `max` pixels in the current font. */+function fit(ctx: Ctx, text: string, max: number): string {+ if (ctx.measureText(text).width <= max) return text;+ let lo = 0, hi = text.length;+ while (lo < hi) {+ const mid = Math.ceil((lo + hi) / 2);+ if (ctx.measureText(`${text.slice(0, mid)}…`).width <= max) lo = mid; else hi = mid - 1;+ }+ return `${text.slice(0, lo)}…`;+}++function dot(ctx: Ctx, x: number, y: number, r: number, colour: string): void {+ ctx.fillStyle = colour;+ ctx.beginPath(); ctx.arc(x, y, r, 0, Math.PI * 2); ctx.fill();+}++function heading(ctx: Ctx, text: string, x: number, y: number): void {+ ctx.fillStyle = MUTED;+ ctx.font = `600 30px ${FONT}`;+ ctx.fillText(text, x, y);+}++/** Centre monitor: the one big number, three state rows and the "New agent" button. */+export function drawBoard(ctx: Ctx, w: number, h: number, data: FloorData, l: ScreenLabels): void {+ ground(ctx, w, h);+ const pad = 56, { counts } = data;+ heading(ctx, l.title, pad, pad + 26);+ dot(ctx, w - pad - 8, pad + 16, 8, STATE.working);+ ctx.fillStyle = INK;+ ctx.font = `700 200px ${FONT}`;+ ctx.fillText(String(counts.total), pad - 8, pad + 250);+ ctx.fillStyle = MUTED;+ ctx.font = `500 30px ${FONT}`;+ ctx.fillText(fit(ctx, l.agents, w * 0.5 - pad), pad, pad + 298);+ const x0 = w * 0.55;+ ([[l.working, counts.working, STATE.working], [l.waiting, counts.waiting, STATE.waiting], [l.idle, counts.idle, STATE.idle]] as const)+ .forEach(([label, n, colour], i) => {+ const y = pad + 90 + i * 78;+ ctx.fillStyle = FAINT;+ ctx.fillRect(x0, y - 50, w - pad - x0, 2);+ dot(ctx, x0 + 10, y - 12, 9, colour);+ ctx.fillStyle = INK;+ ctx.font = `500 32px ${FONT}`;+ ctx.fillText(fit(ctx, label, w - pad - x0 - 110), x0 + 36, y);+ ctx.textAlign = "right";+ ctx.font = `700 40px ${FONT}`;+ ctx.fillText(String(n), w - pad, y + 2);+ ctx.textAlign = "left";+ });+ const bw = 330, bh = 76, bx = pad, by = h - pad - bh;+ ctx.fillStyle = INK;+ ctx.beginPath(); ctx.roundRect(bx, by, bw, bh, 18); ctx.fill();+ ctx.strokeStyle = "#0b0d10";+ ctx.lineWidth = 5;+ ctx.lineCap = "round";+ const px = bx + 44, py = by + bh / 2;+ ctx.beginPath(); ctx.moveTo(px - 13, py); ctx.lineTo(px + 13, py); ctx.moveTo(px, py - 13); ctx.lineTo(px, py + 13); ctx.stroke();+ ctx.fillStyle = "#0b0d10";+ ctx.font = `600 32px ${FONT}`;+ ctx.fillText(fit(ctx, l.start, bw - 100), bx + 80, py + 11);+}++/** Left monitor: every workspace with how many of its agents work. */+export function drawWorkspaces(ctx: Ctx, w: number, h: number, data: FloorData, l: ScreenLabels): void {+ ground(ctx, w, h);+ const pad = 56;+ heading(ctx, l.workspaces, pad, pad + 26);+ if (data.workspaces.length === 0) { ctx.fillStyle = MUTED; ctx.font = `500 32px ${FONT}`; ctx.fillText(l.none, pad, pad + 120); return; }+ const rows = data.workspaces.slice(0, 5), rowH = (h - pad * 2 - 60) / 5;+ rows.forEach((ws, i) => {+ const y = pad + 110 + i * rowH;+ ctx.fillStyle = INK;+ ctx.font = `600 34px ${FONT}`;+ ctx.fillText(fit(ctx, ws.name, w * 0.5), pad, y);+ ctx.textAlign = "right";+ ctx.fillStyle = MUTED;+ ctx.font = `500 30px ${FONT}`;+ ctx.fillText(`${ws.working} / ${ws.total}`, w - pad, y);+ ctx.textAlign = "left";+ const bx = pad, by = y + 18, bw = w - pad * 2;+ ctx.fillStyle = FAINT;+ ctx.beginPath(); ctx.roundRect(bx, by, bw, 10, 5); ctx.fill();+ if (ws.working > 0) {+ ctx.fillStyle = STATE.working;+ ctx.beginPath(); ctx.roundRect(bx, by, Math.max(10, (bw * ws.working) / ws.total), 10, 5); ctx.fill();+ }+ });+}++/** Right monitor: the latest prompts, newest first. */+export function drawActivity(ctx: Ctx, w: number, h: number, data: FloorData, l: ScreenLabels): void {+ ground(ctx, w, h);+ const pad = 56;+ heading(ctx, l.activity, pad, pad + 26);+ const recent = data.agents.filter((a) => a.prompt).sort((a, b) => (b.promptAt ?? 0) - (a.promptAt ?? 0)).slice(0, 4);+ if (recent.length === 0) { ctx.fillStyle = MUTED; ctx.font = `500 32px ${FONT}`; ctx.fillText(l.none, pad, pad + 120); return; }+ const rowH = (h - pad * 2 - 50) / 4;+ recent.forEach((a, i) => {+ const y = pad + 100 + i * rowH;+ if (i > 0) { ctx.fillStyle = FAINT; ctx.fillRect(pad, y - 44, w - pad * 2, 2); }+ dot(ctx, pad + 8, y - 10, 8, STATE[a.state]);+ const age = l.since(a.promptAt);+ ctx.font = `500 26px ${FONT}`;+ const ageW = ctx.measureText(age).width;+ ctx.fillStyle = INK;+ ctx.font = `600 30px ${FONT}`;+ ctx.fillText(fit(ctx, a.name, w - pad * 2 - ageW - 60), pad + 30, y);+ ctx.textAlign = "right";+ ctx.fillStyle = MUTED;+ ctx.font = `500 26px ${FONT}`;+ ctx.fillText(age, w - pad, y);+ ctx.textAlign = "left";+ ctx.font = `400 26px ${FONT}`;+ ctx.fillText(fit(ctx, a.prompt.replace(/\s+/g, " "), w - pad * 2 - 30), pad + 30, y + 36);+ });+}++/** The video wall: a header with the time, then one tile per agent on the floor. */+export function drawVideoWall(ctx: Ctx, w: number, h: number, data: FloorData, l: ScreenLabels, clock: string): void {+ ground(ctx, w, h);+ const pad = 48;+ ctx.fillStyle = INK;+ ctx.font = `700 44px ${FONT}`;+ ctx.fillText(l.title, pad, pad + 38);+ ctx.textAlign = "right";+ ctx.font = `600 44px ${FONT}`;+ ctx.fillText(clock, w - pad, pad + 38);+ ctx.fillStyle = MUTED;+ ctx.font = `500 28px ${FONT}`;+ const { counts } = data;+ const summary = `${counts.working} ${l.working} · ${counts.waiting} ${l.waiting} · ${counts.idle} ${l.idle}`;+ ctx.fillText(summary, w - pad - ctx.measureText(clock).width - 60, pad + 34);+ ctx.textAlign = "left";+ const top = pad + 80, cols = 4, rows = 2, gap = 20;+ const tw = (w - pad * 2 - gap * (cols - 1)) / cols, th = (h - top - pad - gap * (rows - 1)) / rows;+ if (data.agents.length === 0) {+ ctx.fillStyle = MUTED;+ ctx.font = `500 40px ${FONT}`;+ ctx.textAlign = "center";+ ctx.fillText(l.none, w / 2, top + (h - top) / 2);+ ctx.textAlign = "left";+ return;+ }+ const order: Record<AgentRunState, number> = { waiting: 0, working: 1, idle: 2, paused: 3 };+ const tiles = [...data.agents].sort((a, b) => order[a.state] - order[b.state]).slice(0, cols * rows);+ tiles.forEach((a, i) => {+ const x = pad + (i % cols) * (tw + gap), y = top + Math.floor(i / cols) * (th + gap);+ ctx.fillStyle = "rgba(255,255,255,0.045)";+ ctx.beginPath(); ctx.roundRect(x, y, tw, th, 16); ctx.fill();+ ctx.fillStyle = STATE[a.state];+ ctx.beginPath(); ctx.roundRect(x, y, 6, th, [16, 0, 0, 16]); ctx.fill();+ const ix = x + 28, iw = tw - 48;+ ctx.fillStyle = INK;+ ctx.font = `600 32px ${FONT}`;+ ctx.fillText(fit(ctx, a.name, iw), ix, y + 50);+ ctx.fillStyle = MUTED;+ ctx.font = `500 24px ${FONT}`;+ ctx.fillText(fit(ctx, `${a.cli} · ${a.workspace}`, iw), ix, y + 86);+ dot(ctx, ix + 7, y + th - 34, 7, STATE[a.state]);+ ctx.fillStyle = INK;+ ctx.font = `500 26px ${FONT}`;+ ctx.fillText(fit(ctx, l.state(a.stateKey), iw - 24), ix + 22, y + th - 25);+ if (a.topic && th > 170) {+ ctx.fillStyle = MUTED;+ ctx.font = `400 24px ${FONT}`;+ ctx.fillText(fit(ctx, a.topic, iw), ix, y + 124);+ }+ });+}++// ---------------------------------------------------------------------------+// Live screens+// ---------------------------------------------------------------------------++/** A canvas-backed screen material that redraws whenever `key` changes. */+function useLiveScreen(width: number, height: number, key: string, draw: (ctx: Ctx, w: number, h: number) => void): MeshBasicMaterial {+ const canvas = useMemo(() => (typeof document !== "undefined" ? document.createElement("canvas") : null), []);+ const material = useMemo(() => {+ if (!canvas) return new MeshBasicMaterial({ color: "#0b0d10" });+ canvas.width = width;+ canvas.height = height;+ const texture = new CanvasTexture(canvas);+ texture.colorSpace = SRGBColorSpace;+ texture.anisotropy = 8;+ return new MeshBasicMaterial({ map: texture, toneMapped: false });+ }, [canvas, width, height]);+ const drawRef = useRef(draw);+ drawRef.current = draw;+ useEffect(() => {+ let ctx: Ctx | null = null;+ try { ctx = canvas?.getContext("2d") ?? null; } catch {+ // jsdom without the canvas package: the plain dark screen is the right fallback.+ ctx = null;+ }+ if (!ctx || !material.map) return;+ drawRef.current(ctx, width, height);+ material.map.needsUpdate = true;+ }, [key, canvas, material, width, height]);+ useEffect(() => () => { material.map?.dispose(); material.dispose(); }, [material]);+ return material;+}++/** Minutes change the clock; a timer ticks it without any network. */+function useClock(): string {+ const [now, setNow] = useState(() => new Date());+ useEffect(() => {+ const timer = setInterval(() => setNow(new Date()), 20_000);+ return () => clearInterval(timer);+ }, []);+ return now.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });+}++/** Opening Mission Control from anything in the office that is clicked. */+function useOpenMission() {+ const hovered = useRef(false);+ useEffect(() => () => { if (hovered.current) document.body.style.cursor = ""; }, []);+ return {+ onClick: (event: ThreeEvent<MouseEvent>) => {+ event.stopPropagation();+ useOfficeStore.getState().select({ kind: "checkpoint", id: "mission" });+ },+ onPointerOver: (event: ThreeEvent<PointerEvent>) => { event.stopPropagation(); hovered.current = true; document.body.style.cursor = "pointer"; },+ onPointerOut: () => { hovered.current = false; document.body.style.cursor = ""; },+ };+}++function Screen({ w, h, material }: { w: number; h: number; material: MeshBasicMaterial }) {+ return (+ <group>+ <Rounded size={[w + 0.03, h + 0.03, 0.028]} radius={0.01} position={[0, 0, 0]} material={MAT.monitor} />+ <mesh position={[0, 0, 0.0145]} material={material}>+ <planeGeometry args={[w, h]} />+ </mesh>+ </group>+ );+}++// ---------------------------------------------------------------------------+// The slat wall with the video wall+// ---------------------------------------------------------------------------++const CM = {+ felt: matte("#202328", { roughness: 1 }),+ walnut: matte("#5b3b27", { roughness: 0.7 }),+ // Light strips: lit from within, so they read as light in any scene lighting.+ cove: new MeshStandardMaterial({ color: "#ffe6c4", emissive: "#ffe6c4", emissiveIntensity: 1.1, toneMapped: false }),+ ice: new MeshStandardMaterial({ color: "#cfe9ff", emissive: "#cfe9ff", emissiveIntensity: 1.1, toneMapped: false }),+ speaker: matte("#1b1d21", { roughness: 0.6 }),+};+const SLAT_PITCH = 0.13;+const SLATS = Array.from({ length: Math.floor(7.7 / SLAT_PITCH) }, (_, i) => -3.85 + SLAT_PITCH / 2 + i * SLAT_PITCH);+const WALL_SCREEN = { w: 3.4, h: 1.36, y: 1.6 };+const WALL_CANVAS = { w: 1600, h: Math.round((1600 * 1.36) / 3.4) };++export function CommandWall() {+ const data = useFloorData();+ const labels = useScreenLabels();+ const clock = useClock();+ const key = JSON.stringify([data, clock, labels.title, labels.none, labels.working]);+ const screen = useLiveScreen(WALL_CANVAS.w, WALL_CANVAS.h, key, (ctx, w, h) => drawVideoWall(ctx, w, h, data, labels, clock));+ const open = useOpenMission();+ return (+ <group>+ {/* Dark felt backing, a full-height walnut slat screen, warm light in coves top and bottom. */}+ <Box size={[7.8, 2.7, 0.06]} position={[0, 1.35, -0.12]} material={CM.felt} />+ {SLATS.map((x) => <Box key={x} size={[0.06, 2.62, 0.06]} position={[x, 1.35, -0.06]} material={CM.walnut} cast={false} />)}+ <Box size={[7.7, 0.012, 0.02]} position={[0, 0.03, -0.02]} material={CM.cove} cast={false} />+ <Box size={[7.7, 0.012, 0.02]} position={[0, 2.67, -0.02]} material={CM.cove} cast={false} />+ {/* The video wall, flush on the slats; a floating oak shelf with a pair of speakers under it. */}+ <group position={[0, WALL_SCREEN.y, 0.02]} {...open}>+ <Screen w={WALL_SCREEN.w} h={WALL_SCREEN.h} material={screen} />+ </group>+ <Rounded size={[2.6, 0.045, 0.24]} radius={0.01} position={[0, 0.66, 0.02]} material={MAT.deskTop} />+ {[-1.05, 1.05].map((x) => <Rounded key={x} size={[0.16, 0.24, 0.16]} radius={0.02} position={[x, 0.805, 0.03]} material={CM.speaker} />)}+ </group>+ );+}++// ---------------------------------------------------------------------------+// The desk with three monitors, and its chair+// ---------------------------------------------------------------------------++const MONITOR = { w: 0.72, h: 0.42, y: 1.14 };+const MONITOR_CANVAS = { w: 1024, h: Math.round((1024 * 0.42) / 0.72) };+const DESK_Z = -COMMAND_DESK_OFFSET;+const CHAIR_Z = DESK_Z + COMMAND_DESK.chairZ;+const GAS = new CylinderGeometry(0.028, 0.028, 0.3, 12);+const MUG = new CylinderGeometry(0.04, 0.036, 0.1, 16);++function ExecutiveChair() {+ // The person faces north, towards the monitors: the chair's back is on its +z side.+ return (+ <group position={[0, 0, CHAIR_Z]}>+ {[0, 1, 2, 3, 4].map((i) => (+ <group key={i} rotation={[0, (i * Math.PI * 2) / 5, 0]}>+ <Box size={[0.05, 0.035, 0.3]} position={[0, 0.07, 0.15]} material={MAT.chair} />+ <Box size={[0.05, 0.05, 0.05]} position={[0, 0.025, 0.29]} material={MAT.steel} cast={false} />+ </group>+ ))}+ <mesh geometry={GAS} material={MAT.steel} position={[0, 0.25, 0]} castShadow />+ <Rounded size={[0.54, 0.08, 0.5]} radius={0.035} position={[0, 0.46, 0]} material={MAT.chairSeat} />+ <group position={[0, 0.9, 0.24]} rotation={[0.12, 0, 0]}>+ <Rounded size={[0.5, 0.66, 0.06]} radius={0.03} position={[0, 0, 0]} material={MAT.chairMesh} />+ <Rounded size={[0.34, 0.13, 0.07]} radius={0.03} position={[0, 0.42, 0.02]} material={MAT.chair} />+ </group>+ {[-0.29, 0.29].map((x) => (+ <group key={x}>+ <Box size={[0.04, 0.2, 0.04]} position={[x, 0.58, 0.04]} material={MAT.chair} />+ <Rounded size={[0.07, 0.03, 0.28]} radius={0.012} position={[x, 0.69, 0.0]} material={MAT.chair} />+ </group>+ ))}+ </group>+ );+}++export function CommandDesk() {+ const data = useFloorData();+ const labels = useScreenLabels();+ const key = JSON.stringify([data, labels.title, labels.none]);+ const board = useLiveScreen(MONITOR_CANVAS.w, MONITOR_CANVAS.h, key, (ctx, w, h) => drawBoard(ctx, w, h, data, labels));+ const spaces = useLiveScreen(MONITOR_CANVAS.w, MONITOR_CANVAS.h, key, (ctx, w, h) => drawWorkspaces(ctx, w, h, data, labels));+ const activity = useLiveScreen(MONITOR_CANVAS.w, MONITOR_CANVAS.h, key, (ctx, w, h) => drawActivity(ctx, w, h, data, labels));+ const open = useOpenMission();+ const { w, d } = COMMAND_DESK;+ return (+ <group>+ <group {...open}>+ {/* Oak top on black steel sled legs, a cable panel at the back and a thin light under the front edge. */}+ <Rounded size={[w, 0.04, d]} radius={0.012} position={[0, 0.74, DESK_Z]} material={MAT.deskTop} />+ {[-(w / 2 - 0.12), w / 2 - 0.12].map((x) => (+ <group key={x}>+ <Box size={[0.05, 0.72, d - 0.12]} position={[x, 0.36, DESK_Z]} material={MAT.deskLeg} />+ <Box size={[0.07, 0.025, d - 0.06]} position={[x, 0.012, DESK_Z]} material={MAT.deskLeg} />+ </group>+ ))}+ <Box size={[w - 0.4, 0.3, 0.02]} position={[0, 0.5, DESK_Z - d / 2 + 0.06]} material={MAT.deskLeg} />+ <Box size={[w - 0.1, 0.01, 0.012]} position={[0, 0.715, DESK_Z + d / 2 - 0.02]} material={CM.ice} cast={false} />+ {/* One triple arm: a post at the back and a bar carrying the three monitors, the outer two turned in. */}+ <Box size={[0.05, 0.38, 0.05]} position={[0, 0.94, DESK_Z - 0.32]} material={MAT.monitorArm} />+ <Box size={[1.7, 0.035, 0.035]} position={[0, MONITOR.y - 0.02, DESK_Z - 0.3]} material={MAT.monitorArm} />+ <group position={[0, MONITOR.y, DESK_Z - 0.26]}>+ <Screen w={MONITOR.w} h={MONITOR.h} material={board} />+ </group>+ <group position={[-0.76, MONITOR.y, DESK_Z - 0.17]} rotation={[0, 0.38, 0]}>+ <Screen w={MONITOR.w} h={MONITOR.h} material={spaces} />+ </group>+ <group position={[0.76, MONITOR.y, DESK_Z - 0.17]} rotation={[0, -0.38, 0]}>+ <Screen w={MONITOR.w} h={MONITOR.h} material={activity} />+ </group>+ {/* On the desk: keyboard, mouse, a mug. */}+ <Rounded size={[0.46, 0.018, 0.15]} radius={0.006} position={[0, 0.769, DESK_Z + 0.18]} material={MAT.keyboard} />+ <Rounded size={[0.06, 0.022, 0.1]} radius={0.01} position={[0.36, 0.771, DESK_Z + 0.18]} material={MAT.keyboard} />+ <mesh geometry={MUG} material={MAT.mug} position={[-0.95, 0.81, DESK_Z + 0.1]} castShadow />+ </group>+ <ExecutiveChair />+ </group>+ );+}++/** Mission Control's renderers; merged into OfficeProps' exhaustive table. */+export const COMMAND_RENDERERS = {+ commandWall: () => <CommandWall />,+ commandDesk: () => <CommandDesk />,+} satisfies Partial<Record<FurnitureKind, (props: { item: Furniture }) => JSX.Element>>;diff --git a/jarvis/ui/web/frontend/src/components/society/office/MissionConsole.tsx b/jarvis/ui/web/frontend/src/components/society/office/MissionConsole.tsxdeleted file mode 100644index 3960e550e5..0000000000--- a/jarvis/ui/web/frontend/src/components/society/office/MissionConsole.tsx+++ /dev/null@@ -1,177 +0,0 @@-/**- * Mission Control on the coding floor: one slim display on a floor stand, in- * the office's contemporary kit (black steel, a thin bezel, a low base plate).- * Its screen is a live board of the floor — how many coding agents there are- * and how many work, wait or idle — and invites starting a new one.- *- * Built in local space centred on the origin, front facing +z, and kept- * inside the `missionConsole` footprint. A click anywhere on it opens Mission- * Control.- */-import { useEffect, useMemo, useRef } from "react";-import type { ThreeEvent } from "@react-three/fiber";-import { CanvasTexture, MeshBasicMaterial, SRGBColorSpace } from "three";-import { useT } from "@/i18n";-import { useWorkspacePanesStore } from "@/store/workspacePanes";-import { Box, MAT, Rounded } from "./OfficeFurniture";-import { paneOccupants } from "./codingFloor";-import type { Furniture, FurnitureKind } from "./officeLayout";-import { useOfficeStore } from "./officeStore";--/** The display: a 55-inch-ish landscape panel, its centre height and backward tilt. */-const SCREEN_W = 1.3, SCREEN_H = 0.76, SCREEN_Y = 1.36, TILT = -0.07;-const CANVAS_W = 1024, CANVAS_H = Math.round((CANVAS_W * SCREEN_H) / SCREEN_W);--export interface FloorCounts { total: number; working: number; waiting: number; idle: number }--/** What the screen shows, in the viewer's language. */-export interface ScreenLabels { title: string; agents: string; working: string; waiting: string; idle: string; start: string }--const INK = "#f4f6f8", MUTED = "#8b929c", LINE = "rgba(255,255,255,0.08)";-const DOT = { working: "#4ade80", waiting: "#fbbf24", idle: "#8b929c" } as const;-const FONT = "Inter, system-ui, -apple-system, 'Segoe UI', sans-serif";--/** Draw the live board. Pure drawing: the same counts always give the same picture. */-export function drawMissionScreen(ctx: CanvasRenderingContext2D, w: number, h: number, counts: FloorCounts, labels: ScreenLabels): void {- const bg = ctx.createLinearGradient(0, 0, 0, h);- bg.addColorStop(0, "#15181d");- bg.addColorStop(1, "#0b0d10");- ctx.fillStyle = bg;- ctx.fillRect(0, 0, w, h);- const pad = 56;- ctx.textBaseline = "alphabetic";- ctx.textAlign = "left";-- // Header: the name, and a quiet live dot.- ctx.fillStyle = MUTED;- ctx.font = `600 30px ${FONT}`;- ctx.fillText(labels.title, pad, pad + 26);- ctx.fillStyle = DOT.working;- ctx.beginPath(); ctx.arc(w - pad - 8, pad + 16, 8, 0, Math.PI * 2); ctx.fill();-- // The one big number.- ctx.fillStyle = INK;- ctx.font = `700 200px ${FONT}`;- ctx.fillText(String(counts.total), pad - 8, pad + 250);- ctx.fillStyle = MUTED;- ctx.font = `500 32px ${FONT}`;- ctx.fillText(labels.agents, pad, pad + 300);-- // Three state rows on the right, divided by hairlines.- const x0 = w * 0.55, rowH = 78;- const rows: [string, number, string][] = [- [labels.working, counts.working, DOT.working], [labels.waiting, counts.waiting, DOT.waiting], [labels.idle, counts.idle, DOT.idle],- ];- rows.forEach(([label, n, colour], i) => {- const y = pad + 90 + i * rowH;- ctx.fillStyle = LINE;- ctx.fillRect(x0, y - 50, w - pad - x0, 2);- ctx.fillStyle = colour;- ctx.beginPath(); ctx.arc(x0 + 10, y - 12, 9, 0, Math.PI * 2); ctx.fill();- ctx.fillStyle = INK;- ctx.font = `500 32px ${FONT}`;- ctx.fillText(label, x0 + 36, y);- ctx.textAlign = "right";- ctx.font = `700 40px ${FONT}`;- ctx.fillText(String(n), w - pad, y + 2);- ctx.textAlign = "left";- });-- // The call to action along the bottom: a white button with a plus.- const bw = 330, bh = 76, bx = pad, by = h - pad - bh;- ctx.fillStyle = INK;- ctx.beginPath(); ctx.roundRect(bx, by, bw, bh, 18); ctx.fill();- ctx.strokeStyle = "#0b0d10";- ctx.lineWidth = 5;- ctx.lineCap = "round";- const px = bx + 44, py = by + bh / 2;- ctx.beginPath(); ctx.moveTo(px - 13, py); ctx.lineTo(px + 13, py); ctx.moveTo(px, py - 13); ctx.lineTo(px, py + 13); ctx.stroke();- ctx.fillStyle = "#0b0d10";- ctx.font = `600 32px ${FONT}`;- ctx.fillText(labels.start, bx + 80, py + 11);-}--/** The floor's live counts, from the same shared pane poll the figures ride. */-function useFloorCounts(): FloorCounts {- const panes = useWorkspacePanesStore((s) => s.panes);- return useMemo(() => {- const counts: FloorCounts = { total: 0, working: 0, waiting: 0, idle: 0 };- for (const { agent } of paneOccupants(panes)) {- counts.total += 1;- if (agent.state === "working") counts.working += 1;- else if (agent.state === "waiting") counts.waiting += 1;- else counts.idle += 1;- }- return counts;- }, [panes]);-}--function useScreenMaterial(counts: FloorCounts, labels: ScreenLabels): MeshBasicMaterial {- const canvas = useMemo(() => (typeof document !== "undefined" ? document.createElement("canvas") : null), []);- const material = useMemo(() => {- if (!canvas) return new MeshBasicMaterial({ color: "#0b0d10" });- canvas.width = CANVAS_W;- canvas.height = CANVAS_H;- const texture = new CanvasTexture(canvas);- texture.colorSpace = SRGBColorSpace;- texture.anisotropy = 8;- return new MeshBasicMaterial({ map: texture, toneMapped: false });- }, [canvas]);- const key = JSON.stringify([counts, labels]);- useEffect(() => {- let ctx: CanvasRenderingContext2D | null = null;- try { ctx = canvas?.getContext("2d") ?? null; } catch {- // jsdom without the canvas package: the plain dark screen is the right fallback.- ctx = null;- }- if (!ctx || !material.map) return;- drawMissionScreen(ctx, CANVAS_W, CANVAS_H, counts, labels);- material.map.needsUpdate = true;- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [key, canvas, material]);- useEffect(() => () => { material.map?.dispose(); material.dispose(); }, [material]);- return material;-}--export function MissionScreen() {- const t = useT();- const counts = useFloorCounts();- const labels: ScreenLabels = {- title: t("society.office.cp_mission"),- agents: t("society.office.mission_screen_agents"),- working: t("society.office.state_working"),- waiting: t("society.office.state_waiting"),- idle: t("society.office.state_idle"),- start: t("society.office.mission_screen_start"),- };- const screen = useScreenMaterial(counts, labels);- const hovered = useRef(false);- useEffect(() => () => { if (hovered.current) document.body.style.cursor = ""; }, []);- const open = (event: ThreeEvent<MouseEvent>) => {- event.stopPropagation();- useOfficeStore.getState().select({ kind: "checkpoint", id: "mission" });- };- const over = (event: ThreeEvent<PointerEvent>) => { event.stopPropagation(); hovered.current = true; document.body.style.cursor = "pointer"; };- const out = () => { hovered.current = false; document.body.style.cursor = ""; };-- return (- <group name="mission-screen" onClick={open} onPointerOver={over} onPointerOut={out}>- {/* Low base plate and a slim column, set back so the screen overhangs it a little. */}- <Rounded size={[0.64, 0.035, 0.42]} radius={0.015} position={[0, 0.018, -0.02]} material={MAT.steel} />- <Box size={[0.07, SCREEN_Y - 0.03, 0.05]} position={[0, (SCREEN_Y + 0.03) / 2, -0.09]} material={MAT.steel} />- {/* The display: rear housing, thin bezel, the live screen flush in front. */}- <group position={[0, SCREEN_Y, -0.04]} rotation={[TILT, 0, 0]}>- <Rounded size={[0.42, 0.3, 0.05]} radius={0.015} position={[0, 0, -0.045]} material={MAT.steel} />- <Rounded size={[SCREEN_W + 0.03, SCREEN_H + 0.03, 0.035]} radius={0.012} position={[0, 0, 0]} material={MAT.monitor} />- <mesh position={[0, 0, 0.0185]} material={screen}>- <planeGeometry args={[SCREEN_W, SCREEN_H]} />- </mesh>- </group>- </group>- );-}--/** Mission Control's renderers; merged into OfficeProps' exhaustive table. */-export const MISSION_RENDERERS = {- missionConsole: () => <MissionScreen />,-} satisfies Partial<Record<FurnitureKind, (props: { item: Furniture }) => JSX.Element>>;diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsxindex aa78196016..5b7b9f30c5 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeFullMap.tsx@@ -119,7 +119,7 @@ function FullMapDialog({ onClose, layout, agents, selectedId }: Omit<OfficeFullMwardrobe: t("society.office.room_wardrobe"),reception: t("society.office.room_reception"),break: t("society.office.room_break"),- focus: t("society.office.room_focus"),+ command: t("society.office.room_command"),server: t("society.office.room_server"),};const openSpace = t("society.office.open_space");diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsxindex 594a39a1e3..686b938f96 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeMinimap.tsx@@ -226,7 +226,7 @@ export function OfficeMinimap({ layout, agents, selectedId, onOpenMap }: OfficeMwardrobe: t("society.office.room_wardrobe"),reception: t("society.office.room_reception"),break: t("society.office.room_break"),- focus: t("society.office.room_focus"),+ command: t("society.office.room_command"),server: t("society.office.room_server"),};const youLabel = t("society.office.minimap_you");diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsxindex 7fdc8dac97..a6bf446a10 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeProps.tsx@@ -12,7 +12,7 @@ import { memo } from "react";import { CylinderGeometry, MeshStandardMaterial, SphereGeometry } from "three";import { canvasMaterial } from "./canvasMaterials";import { LEAD_RENDERERS } from "./LeadSuite";-import { MISSION_RENDERERS } from "./MissionConsole";+import { COMMAND_RENDERERS } from "./CommandOffice";import { Bookshelf, Box, Couch, GEO, MAT, matte, Plant, Rounded, Rug } from "./OfficeFurniture";import { FURNITURE_SIZE, type Furniture, type FurnitureKind } from "./officeLayout";import { PROP_COLOURS as P } from "./officePalette";@@ -733,7 +733,7 @@ export const PROP_RENDERERS: Record<FurnitureKind, (props: { item: Furniture })},elevator: () => <Elevator />,...LEAD_RENDERERS,- ...MISSION_RENDERERS,+ ...COMMAND_RENDERERS,};/** One furniture item, placed at (x, 0, z) and turned by `rotationY` (0 = front faces +z). */diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsxindex 5d6018fcde..807f123cbe 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeRooms.tsx@@ -25,7 +25,7 @@ function lcg(seed: number): () => number {}/** Metres covered by one repeat of each floor pattern. */-const PATTERN_METRES: Record<RoomKind, number> = { lead: 2.6, team: 2, wardrobe: 2, reception: 3.2, break: 2.4, focus: 2, server: 2 };+const PATTERN_METRES: Record<RoomKind, number> = { lead: 2.6, team: 2, wardrobe: 2, reception: 3.2, break: 2.4, command: 3.2, server: 2 };function drawFloor(kind: RoomKind, ctx: CanvasRenderingContext2D, w: number, h: number): void {const { base, accents } = ROOM_FLOOR_COLOURS[kind];@@ -74,7 +74,7 @@ function drawFloor(kind: RoomKind, ctx: CanvasRenderingContext2D, w: number, h:const s = 2 + rand() * 4;ctx.fillRect(Math.floor(rand() * w), Math.floor(rand() * h), s, s * (0.6 + rand() * 0.6));}- } else if (kind === "team" || kind === "focus") {+ } else if (kind === "team") {// Carpet grain: fine speckles in the accent tones, plus a faint weave.for (let i = 0; i < 2600; i += 1) {ctx.fillStyle = accents[Math.floor(rand() * accents.length)];@@ -82,6 +82,18 @@ function drawFloor(kind: RoomKind, ctx: CanvasRenderingContext2D, w: number, h:}ctx.fillStyle = "rgba(0,0,0,0.035)";for (let y = 0; y < h; y += 8) ctx.fillRect(0, y, w, 1);+ } else if (kind === "command") {+ // Mission Control: dark graphite microcement, soft clouds of lighter and+ // darker trowel marks and a faint sheen, no joints.+ for (let i = 0; i < 520; i += 1) {+ ctx.globalAlpha = 0.18 + rand() * 0.2;+ ctx.fillStyle = accents[Math.floor(rand() * accents.length)];+ const r = 6 + rand() * 22;+ ctx.beginPath();+ ctx.ellipse(rand() * w, rand() * h, r * (1 + rand()), r, rand() * Math.PI, 0, Math.PI * 2);+ ctx.fill();+ }+ ctx.globalAlpha = 1;} else {// Tiles: the server room's raised-floor grid, reception's large pale stone slabs.const tiles = kind === "server" ? 4 : 2;diff --git a/jarvis/ui/web/frontend/src/components/society/office/minimap.ts b/jarvis/ui/web/frontend/src/components/society/office/minimap.tsindex 60cb56f047..c18371331b 100644--- a/jarvis/ui/web/frontend/src/components/society/office/minimap.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/minimap.ts@@ -314,7 +314,7 @@ const FURNITURE_PAINT: Partial<Record<FurnitureKind, string>> = {kiosk: "#3a3f4b", lockers: "#5fa8a0", mirror: "#d6ecf8", coffeeBar: "#8a6240", waterCooler: "#6fb7ea", arcade: "#6a58b0",beanbag: "#e27d60", bookshelf: "#8a6240", plant: MAP_PAINT.plant, rug: MAP_PAINT.rug, elevator: "#c9ced6",leadWall: "#3a2416", executiveRug: "#26335a", guestChair: "#a9683c", chesterfield: "#7a2c22", loungeTable: "#d8ae52",- executiveBar: "#5b3a25", globe: "#5f8f96", floorLamp: "#d8ae52", missionConsole: "#2b3446",+ executiveBar: "#5b3a25", globe: "#5f8f96", floorLamp: "#d8ae52", commandWall: "#3a2a20", commandDesk: "#c9b79c",};export const STATE_RING: Record<MinimapAgentState, string> = {diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.tsindex 2e04d04d9b..fa9b3b200f 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.test.ts@@ -1,7 +1,7 @@import { describe, expect, it } from "vitest";import {allDesks, archPosts, buildOfficeLayout, countStates, departmentKey, FURNITURE_SIZE, footprint, groupDepartments,- MAX_DEPARTMENTS, MIN_DEPARTMENTS, MISSION_REACH, type OfficeAgentInput,+ MAX_DEPARTMENTS, MIN_DEPARTMENTS, COMMAND_DESK, COMMAND_REACH, type OfficeAgentInput,} from "./officeLayout";import { buildNavGrid, isWalkable } from "./officeNav";import { cameraHome, fitDistance, focusBounds } from "./officeCamera";@@ -117,16 +117,16 @@ describe("office layout", () => {expect(plain.checkpoints.map((c) => c.id)).toEqual(["create", "manage", "team", "wardrobe", "lead", "break", "elevator"]);});- it("builds the coding floor: workspaces as departments, focus zone and server room, no lead desks", () => {+ it("builds the coding floor: workspaces as departments, Mission Control and server room, no lead desks", () => {const roster = [agent("p1", "Personal Jarvis"), agent("p2", "Website"), agent("p3", "Personal Jarvis")];const layout = buildOfficeLayout(roster, { variant: "coding" });expect(layout.variant).toBe("coding");- expect(layout.rooms.map((r) => r.kind)).toEqual(["focus", "team", "server", "reception", "break"]);+ expect(layout.rooms.map((r) => r.kind)).toEqual(["command", "team", "server", "reception", "break"]);expect(layout.lead.desks).toEqual([]);expect(layout.checkpoints.map((c) => c.id)).toEqual(["mission", "elevator", "break"]);expect(layout.departments.map((d) => d.label)).toEqual(["Personal Jarvis", "Website", "", ""]);expect(layout.furniture.some((f) => f.room === "lead" || f.room === "wardrobe")).toBe(false);- expect(layout.spots.some((s) => s.room === "focus")).toBe(true);+ expect(layout.spots.some((s) => s.room === "command")).toBe(true);expect(layout.spots.some((s) => s.room === "server")).toBe(true);// Both floors share one footprint, and the elevator stands at the same spot on each.const below = buildOfficeLayout(roster);@@ -137,34 +137,43 @@ describe("office layout", () => {expect(layout.spawn.x - layout.bounds.minX).toBeCloseTo(below.spawn.x - below.bounds.minX);});- it("puts Mission Control in the middle of the coding floor, clear of every department", () => {+ it("builds Mission Control as its own office: slat wall, desk, lounge, and a ring round the desk", () => {const layout = buildOfficeLayout([agent("p1", "Personal Jarvis"), agent("p2", "Website")], { variant: "coding" });- const hub = layout.furniture.find((f) => f.kind === "missionConsole")!;+ const room = layout.rooms.find((r) => r.kind === "command")!;const stop = layout.checkpoints.find((c) => c.id === "mission")!;- expect(hub.x).toBe(0);- const depts = layout.departments;- expect(hub.z).toBeCloseTo((Math.min(...depts.map((d) => d.minZ)) + Math.max(...depts.map((d) => d.maxZ))) / 2);- // The whole ring the person can use from stays out of the departments.- for (const dept of depts) expect(stop.radius < Math.abs(dept.minX) && stop.radius < Math.abs(dept.maxX)).toBe(true);- expect(buildOfficeLayout([agent("a1", "codex")]).furniture.some((f) => f.kind === "missionConsole")).toBe(false);+ const inRoom = (p: { x: number; z: number }) => p.x > room.minX && p.x < room.maxX && p.z > room.minZ && p.z < room.maxZ;+ for (const kind of ["commandWall", "commandDesk", "couch", "coffeeTable", "bookshelf"] as const) {+ expect(layout.furniture.some((f) => f.kind === kind && f.room === "command" && inRoom(f)), kind).toBe(true);+ }+ expect(stop.room).toBe("command");+ expect(stop.radius).toBe(COMMAND_REACH);+ // The whole ring stays inside the room's walls.+ expect(stop.x - stop.radius).toBeGreaterThan(room.minX);+ expect(stop.x + stop.radius).toBeLessThan(room.maxX);+ expect(stop.z - stop.radius).toBeGreaterThan(room.minZ);+ expect(stop.z + stop.radius).toBeLessThan(room.maxZ);+ expect(buildOfficeLayout([agent("a1", "codex")]).furniture.some((f) => f.kind === "commandDesk")).toBe(false);});- it("makes Mission Control's screen usable from every side, with no invisible walls", () => {+ it("lets the person work Mission Control's desk from every side, with no invisible walls", () => {const layout = buildOfficeLayout([agent("p1", "Personal Jarvis")], { variant: "coding" });- const hub = layout.furniture.find((f) => f.kind === "missionConsole")!;const stop = layout.checkpoints.find((c) => c.id === "mission")!;- // The interaction ring is centred on the screen.- expect([stop.x, stop.z]).toEqual([hub.x, hub.z]);- expect(stop.radius).toBe(MISSION_REACH);- // Only the screen's own box is solid; standing right round it works, inside the ring, on every side.const grid = buildNavGrid(layout);+ // A loop round the desk and chair: free to stand on everywhere, and inside the ring.for (let i = 0; i < 16; i += 1) {const a = (i / 16) * Math.PI * 2;- const p = { x: hub.x + Math.cos(a) * 1.25, z: hub.z + Math.sin(a) * 1.25 };- expect(isWalkable(grid, p)).toBe(true);+ // An ellipse: the desk is long and shallow, so the path round it is too.+ const p = { x: stop.x + Math.cos(a) * 1.85, z: stop.z + Math.sin(a) * 1.6 };+ expect(isWalkable(grid, p), `angle ${i}`).toBe(true);expect(Math.hypot(p.x - stop.x, p.z - stop.z)).toBeLessThanOrEqual(stop.radius);}- expect(isWalkable(grid, { x: hub.x, z: hub.z })).toBe(false);+ // Only the desk top and the chair are solid: right beside the chair is open floor.+ const deskZ = stop.z - 0.3;+ const chairZ = deskZ + COMMAND_DESK.chairZ;+ expect(isWalkable(grid, { x: stop.x, z: deskZ })).toBe(false);+ expect(isWalkable(grid, { x: stop.x, z: chairZ })).toBe(false);+ expect(isWalkable(grid, { x: stop.x + 0.75, z: chairZ })).toBe(true);+ expect(isWalkable(grid, { x: stop.x - 0.75, z: chairZ })).toBe(true);expect(isWalkable(grid, stop.approach!)).toBe(true);});diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.tsindex 4046dd0025..b11cdd33b8 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officeLayout.ts@@ -13,12 +13,12 @@** The coding floor (variant "coding", one elevator ride up) keeps the same* frame: its departments are the Agentic IDE workspaces, and the north strip- * holds a quiet focus zone · the team room · a server room instead of the lead- * office and the wardrobe. It has no lead desks and only the elevator and- * break-room checkpoints — nothing there creates or dresses society agents.- * It has exactly the agents office's footprint; its centre aisle holds- * Mission Control: a screen on a floor stand between the two department- * columns, where new coding agents are started and several can be briefed at once.+ * holds Mission Control · the team room · a server room instead of the lead+ * office and the wardrobe. It has no lead desks. Mission Control is a modern+ * office: a walnut slat wall with a live video wall, a desk with three live+ * monitors and a lounge corner; working it starts new coding agents and+ * briefs several at once. Only it, the elevator and the break room are+ * checkpoints there.*/import type { AgentRunState, AgentTier } from "../data";@@ -57,8 +57,8 @@ export interface Department extends Rect {tint: number;}-/** "focus" and "server" only exist on the coding floor, in place of the lead office and the wardrobe. */-export type RoomKind = "lead" | "team" | "wardrobe" | "reception" | "break" | "focus" | "server";+/** "command" (Mission Control) and "server" only exist on the coding floor, in place of the lead office and the wardrobe. */+export type RoomKind = "lead" | "team" | "wardrobe" | "reception" | "break" | "command" | "server";/** Which floor a layout draws: the society agents' office, or the coding agents' floor above it. */export type OfficeVariant = "agents" | "coding";@@ -103,7 +103,8 @@ export type FurnitureKind =| "leadWall" | "executiveRug" | "guestChair" | "chesterfield" | "loungeTable" | "executiveBar" | "globe" | "floorLamp"| "dogBed" | "treatJar"// Coding floor: Mission Control's console ring.- | "missionConsole";+ // Coding floor: Mission Control's slat wall with the video wall, and its desk with three monitors and a chair.+ | "commandWall" | "commandDesk";/*** Footprint (x-extent × z-extent before rotation) and height of each piece.@@ -140,7 +141,9 @@ export const FURNITURE_SIZE: Record<FurnitureKind, { w: number; d: number; h: nudogBed: { w: 0.9, d: 0.72, h: 0.45, solid: true },treatJar: { w: 0.5, d: 0.5, h: 1.2, solid: true },// Mission Control: a display on a floor stand; the box is the screen's width and the base plate's depth.- missionConsole: { w: 1.4, d: 0.5, h: 1.8, solid: true },+ commandWall: { w: 7.8, d: 0.3, h: 2.7, solid: true },+ // Desk and chair together; not a solid box, navigation walks round commandDeskObstacles.+ commandDesk: { w: 2.8, d: 2.1, h: 1.45, solid: false },};export interface Furniture extends Point {@@ -162,7 +165,7 @@ export interface Spot extends Point { id: string; kind: SpotKind; pose: SpotPoseexport interface OfficeLayout {variant: OfficeVariant;departments: Department[];- /** Lead desks live in the lead office; the coding floor has none (its rect is the focus zone). */+ /** Lead desks live in the lead office; the coding floor has none (its rect is Mission Control). */lead: Rect & { desks: DeskSlot[] };rooms: Room[];walls: WallSegment[];@@ -199,8 +202,16 @@ const DEPT_MARGIN_X = 1.1;const DEPT_HEADER_Z = 1.8;const DEPT_FOOTER_Z = 0.8;const AISLE = 3.2;-/** How far round Mission Control's screen the person can use it, from its centre (metres). */-export const MISSION_REACH = 1.5;+/**+ * Mission Control's desk, in its own space (origin = desk centre, +z = south,+ * where the chair stands): the desk top and the chair the person works from.+ * The renderer and navigation both read these numbers.+ */+export const COMMAND_DESK = { w: 2.6, d: 0.86, chairZ: 0.72 } as const;+/** How far round Mission Control's desk the person can use it, from the desk's centre. */+export const COMMAND_REACH = 1.9;+/** The desk piece's origin sits this far south of the desk's centre: its box covers desk and chair. */+export const COMMAND_DESK_OFFSET = 0.5;const EDGE = 1.6;/*** How far a figure's centre stays from the slab edge. The railing stands 0.2 m@@ -313,6 +324,15 @@ export function chairRect(seat: Point, half = CHAIR_HALF): Rect {return { minX: seat.x - half, maxX: seat.x + half, minZ: seat.z - half, maxZ: seat.z + half };}+/** What a walker bumps into at Mission Control's desk: the desk top and the chair, nothing in between. */+export function commandDeskObstacles(desk: Point): Rect[] {+ const { w, d, chairZ } = COMMAND_DESK;+ return [+ { minX: desk.x - w / 2, maxX: desk.x + w / 2, minZ: desk.z - d / 2, maxZ: desk.z + d / 2 },+ chairRect({ x: desk.x, z: desk.z + chairZ }),+ ];+}+/** Axis-aligned footprint of a rotated piece (rotations are multiples of 90°). */export function footprint(item: Pick<Furniture, "x" | "z" | "kind" | "rotationY" | "size">): Rect {const base = item.size ?? FURNITURE_SIZE[item.kind];@@ -395,10 +415,10 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:const bottomZ = floorDepth / 2;// North strip: lead office · team room · wardrobe, each with a door facing the office.- // The coding floor puts a focus zone and a server room on the same footprints.+ // The coding floor puts Mission Control and a server room on the same footprints.const leadW = 8.2, teamW = 8.4;const northMaxZ = topZ + NORTH_DEPTH;- const westKind: RoomKind = coding ? "focus" : "lead";+ const westKind: RoomKind = coding ? "command" : "lead";const eastKind: RoomKind = coding ? "server" : "wardrobe";const leadRoom: Room = { id: westKind, kind: westKind, walled: true, minX, maxX: minX + leadW, minZ: topZ, maxZ: northMaxZ,doors: [{ side: "south", at: minX + leadW / 2, width: 1.6 }] };@@ -426,9 +446,6 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:}z += rowDepths[row] + AISLE;}- // Mission Control sits in the middle of the department block, on the centre aisle.- const departmentsMinZ = northMaxZ + AISLE;- const missionZ = (departmentsMinZ + (z - AISLE)) / 2;// South strip: an open reception/lobby in the west, a walled break room in the east.const southMinZ = bottomZ - SOUTH_DEPTH;@@ -481,23 +498,27 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:// Easter egg: the jar of dog treats next to the coffee bar.{ id: "break-treats", kind: "treatJar", x: breakRoom.minX + 9.95, z: breakRoom.minZ + 0.5, rotationY: 0, room: "break" },];- // Coding floor, west: a quiet focus zone — a wall of shelves, a couch facing- // them on a rug, a beanbag in each corner, palms beside the door.- const focusFurniture: Furniture[] = coding ? [- { id: "focus-shelf-w", kind: "bookshelf", x: lx0 + 1.6, z: lz0 + 0.35, rotationY: 0, room: "focus" },- { id: "focus-shelf-c", kind: "bookshelf", x: lx0 + leadW / 2, z: lz0 + 0.35, rotationY: 0, room: "focus" },- { id: "focus-shelf-e", kind: "bookshelf", x: lx0 + leadW - 1.6, z: lz0 + 0.35, rotationY: 0, room: "focus" },- { id: "focus-rug", kind: "rug", x: lx0 + leadW / 2, z: lz0 + 3.6, rotationY: 0, room: "focus", size: { w: 4.8, d: 2.6 } },- { id: "focus-couch", kind: "couch", x: lx0 + leadW / 2, z: lz0 + 4.4, rotationY: Math.PI, room: "focus" },- { id: "focus-beanbag-w", kind: "beanbag", x: lx0 + 1.3, z: lz0 + 3.0, rotationY: 0, room: "focus" },- { id: "focus-beanbag-e", kind: "beanbag", x: lx0 + leadW - 1.3, z: lz0 + 3.0, rotationY: 0, room: "focus" },- { id: "focus-plant", kind: "plant", x: lx0 + 0.55, z: northMaxZ - 0.55, rotationY: 0, room: "focus" },- { id: "focus-plant-e", kind: "plant", x: leadRoom.maxX - 0.55, z: northMaxZ - 0.55, rotationY: 0, room: "focus" },+ // Coding floor, west: Mission Control. The slat wall with the video wall+ // along the north side, the desk in front of it facing the wall (the person+ // works with their back to the door, so the screens face the camera), a+ // lounge corner with a sofa facing east, an open shelf on the east wall.+ const commandDeskAt = { x: lx0 + leadW / 2, z: lz0 + 2.35 };+ const commandFurniture: Furniture[] = coding ? [+ { id: "command-wall", kind: "commandWall", x: lx0 + leadW / 2, z: lz0 + 0.1 + FURNITURE_SIZE.commandWall.d / 2, rotationY: 0, room: "command" },+ // The piece's box is desk + chair; its origin sits between them.+ { id: "command-desk", kind: "commandDesk", x: commandDeskAt.x, z: commandDeskAt.z + COMMAND_DESK_OFFSET, rotationY: 0, room: "command" },+ { id: "command-rug", kind: "rug", x: lx0 + 1.55, z: lz0 + 5.1, rotationY: 0, room: "command", size: { w: 2.7, d: 2.6 } },+ { id: "command-sofa", kind: "couch", x: lx0 + 0.6, z: lz0 + 5.1, rotationY: Math.PI / 2, room: "command" },+ { id: "command-table", kind: "coffeeTable", x: lx0 + 1.9, z: lz0 + 5.1, rotationY: 0, room: "command" },+ { id: "command-shelf", kind: "bookshelf", x: leadRoom.maxX - 0.3, z: lz0 + 4.7, rotationY: -Math.PI / 2, room: "command" },+ { id: "command-plant-w", kind: "plant", x: lx0 + 0.5, z: lz0 + 0.95, rotationY: 0, room: "command" },+ { id: "command-plant-e", kind: "plant", x: leadRoom.maxX - 0.5, z: lz0 + 0.95, rotationY: 0, room: "command" },+ { id: "command-plant-s", kind: "plant", x: leadRoom.maxX - 0.55, z: northMaxZ - 0.55, rotationY: 0, room: "command" },] : [];const wx0 = wardrobeRoom.minX;const furniture: Furniture[] = [...leadFurniture,- ...focusFurniture,+ ...commandFurniture,// Team room: one long table, a board on the north wall.{ id: "team-table", kind: "meetingTable", x: tcx, z: tcz + 0.4, rotationY: 0, room: "team" },{ id: "team-board", kind: "teamBoard", x: tcx, z: topZ + 0.25, rotationY: 0, room: "team" },@@ -533,10 +554,6 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:{ id: "beanbag-b", kind: "beanbag", x: bx0 + 8.4, z: bz0 + 6.3, rotationY: 0, room: "break" },{ id: "break-shelf", kind: "bookshelf", x: bx0 + 2.2, z: bz0 + 0.3, rotationY: 0, room: "break" },{ id: "break-plant", kind: "plant", x: bx0 + 0.6, z: bottomZ - 0.6, rotationY: 0, room: "break" },- ...(coding ? [- // Mission Control: a screen on a stand, midway down the centre aisle, facing the camera.- { id: "mission-console", kind: "missionConsole", x: 0, z: missionZ, rotationY: 0, room: "floor" },- ] satisfies Furniture[] : []),];for (const dept of departments) {furniture.push({ id: `${dept.id}-plant-w`, kind: "plant", x: dept.minX + 0.45, z: dept.maxZ - 0.45, rotationY: 0, room: "floor" });@@ -558,13 +575,10 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:{ id: "beanbag-b", kind: "beanbag", pose: "sit", x: bx0 + 8.4, z: bz0 + 6.3, facing: Math.PI * 1.25, room: "break" },{ id: "shelf-break", kind: "shelf", pose: "stand", x: bx0 + 2.2, z: bz0 + 1.1, facing: Math.PI, room: "break" },...(coding ? [- // Focus zone: browsing the shelf wall, the couch facing it, a beanbag per corner.- { id: "shelf-focus-w", kind: "shelf", pose: "stand", x: lx0 + 1.6, z: lz0 + 1.15, facing: Math.PI, room: "focus" },- { id: "shelf-focus-e", kind: "shelf", pose: "stand", x: lx0 + leadW - 1.6, z: lz0 + 1.15, facing: Math.PI, room: "focus" },- { id: "couch-focus-1", kind: "couch", pose: "sit", x: lx0 + leadW / 2 - 0.6, z: lz0 + 4.25, facing: Math.PI, room: "focus" },- { id: "couch-focus-2", kind: "couch", pose: "sit", x: lx0 + leadW / 2 + 0.6, z: lz0 + 4.25, facing: Math.PI, room: "focus" },- { id: "beanbag-focus-w", kind: "beanbag", pose: "sit", x: lx0 + 1.3, z: lz0 + 3.0, facing: Math.PI * 0.75, room: "focus" },- { id: "beanbag-focus-e", kind: "beanbag", pose: "sit", x: lx0 + leadW - 1.3, z: lz0 + 3.0, facing: Math.PI * 1.25, room: "focus" },+ // Mission Control: the sofa facing east, the open shelf on the east wall.+ { id: "couch-command-1", kind: "couch", pose: "sit", x: lx0 + 0.75, z: lz0 + 4.55, facing: Math.PI / 2, room: "command" },+ { id: "couch-command-2", kind: "couch", pose: "sit", x: lx0 + 0.75, z: lz0 + 5.65, facing: Math.PI / 2, room: "command" },+ { id: "shelf-command", kind: "shelf", pose: "stand", x: leadRoom.maxX - 1.1, z: lz0 + 4.7, facing: Math.PI / 2, room: "command" },// Server room: a look at the consoles on either wall.{ id: "console-e", kind: "board", pose: "stand", x: wardrobeRoom.maxX - 1.2, z: topZ + 2.2, facing: Math.PI / 2, room: "server" },{ id: "console-w", kind: "board", pose: "stand", x: wx0 + 1.2, z: topZ + 2.2, facing: -Math.PI / 2, room: "server" },@@ -597,9 +611,9 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:// The elevator's doors face east into the lobby; its checkpoint is the floor in front of them.const elevatorStop: Checkpoint = { id: "elevator", room: "reception", x: elevator.x + 0.95, z: elevator.z, radius: 1.0 };const breakStop: Checkpoint = { id: "break", room: "break", x: bx0 + 5.6, z: bz0 + 2.6, radius: 1.8 };- // Mission Control's stop is a ring round the screen, usable from every side; "walk there" ends in front of it.- const missionStop: Checkpoint = { id: "mission", room: "floor", x: 0, z: missionZ, radius: MISSION_REACH, tokenY: 2.95,- approach: { x: 0, z: missionZ + 0.9 } };+ // Mission Control's stop is a ring round the desk, usable from every side; "walk there" ends behind the chair.+ const missionStop: Checkpoint = { id: "mission", room: "command", x: commandDeskAt.x, z: commandDeskAt.z + 0.3, radius: COMMAND_REACH,+ tokenY: 2.25, approach: { x: commandDeskAt.x, z: commandDeskAt.z + COMMAND_DESK.chairZ + 0.65 } };const checkpoints: Checkpoint[] = coding ? [missionStop, elevatorStop, breakStop] : [{ id: "create", room: "reception", x: reception.x, z: reception.z + 1.7, radius: 1.2 },{ id: "manage", room: "reception", x: kiosk.x, z: kiosk.z + 1.4, radius: 1.1 },@@ -622,6 +636,7 @@ export function buildOfficeLayout(agents: readonly OfficeAgentInput[], options:// Department sign walls along each department's north edge....departments.map((d) => ({ minX: d.minX + 0.2, maxX: d.maxX - 0.2, minZ: d.minZ + 0.02, maxZ: d.minZ + 0.2 })),...furniture.filter((f) => FURNITURE_SIZE[f.kind].solid).map(footprint),+ ...(coding ? commandDeskObstacles(commandDeskAt) : []),// The posts of an open room's name arch are solid too; nobody walks through them....rooms.filter((r) => !r.walled).flatMap(archPosts).map((p) => ({minX: p.x - ARCH.post / 2, maxX: p.x + ARCH.post / 2, minZ: p.z - ARCH.post / 2, maxZ: p.z + ARCH.post / 2,diff --git a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts b/jarvis/ui/web/frontend/src/components/society/office/officePalette.tsindex d98daf750c..60b141084b 100644--- a/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts+++ b/jarvis/ui/web/frontend/src/components/society/office/officePalette.ts@@ -160,7 +160,8 @@ export const ROOM_FLOOR_COLOURS = {wardrobe: { base: "#ece8e2", accents: ["#c9c2b8", "#9aa4ad", "#d9b8aa", "#aebcaa"] },reception: { base: "#e9e6e1", accents: ["#ece9e4", "#e5e2dc", "#efece8"] },break: { base: "#d9c09b", accents: ["#dcc39f", "#d2b791", "#e0c8a6", "#cfb48c"] },- focus: { base: "#b3c0ab", accents: ["#aebba6", "#b9c6b1", "#b0bda8"] },+ // Mission Control: dark graphite microcement.+ command: { base: "#454b54", accents: ["#3e444c", "#4d535c", "#41474f", "#51575f"] },server: { base: "#c3c8cf", accents: ["#c9ced4", "#bcc2c9"] },} as const;diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex 2d023423d4..e4161db893 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -941,6 +941,10 @@"mission_task_placeholder": "Woran soll er arbeiten? Leer lassen, um ihn nur zu öffnen.","mission_screen_agents": "Coding-Agents auf dieser Etage","mission_screen_start": "Neuer Agent",+ "room_command": "Mission Control",+ "mission_screen_workspaces": "Workspaces",+ "mission_screen_activity": "Letzte Aufträge",+ "mission_screen_none": "Noch keine Coding-Agents","mission_new_title": "Agent starten","mission_fewer": "Ein Agent weniger","mission_more": "Ein Agent mehr",@@ -984,7 +988,6 @@"room_wardrobe": "Garderobe","room_reception": "Empfang","room_break": "Pausenraum",- "room_focus": "Ruhezone","room_server": "Serverraum","dog_treat": "Knochen geben","dog_take_bone": "Leckerli nehmen",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex a8aa665abb..ae6f7be6f3 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -941,6 +941,10 @@"mission_task_placeholder": "What should it work on? Leave empty to just open it.","mission_screen_agents": "coding agents on this floor","mission_screen_start": "New agent",+ "room_command": "Mission Control",+ "mission_screen_workspaces": "Workspaces",+ "mission_screen_activity": "Latest prompts",+ "mission_screen_none": "No coding agents yet","mission_new_title": "Start an agent","mission_fewer": "One agent fewer","mission_more": "One agent more",@@ -984,7 +988,6 @@"room_wardrobe": "Wardrobe","room_reception": "Reception","room_break": "Break room",- "room_focus": "Focus zone","room_server": "Server room","dog_treat": "Give the bone","dog_take_bone": "Take a dog treat",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex 25155f1038..ed15f3a688 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -941,6 +941,10 @@"mission_task_placeholder": "¿En qué debe trabajar? Déjalo vacío para solo abrirlo.","mission_screen_agents": "agentes de código en esta planta","mission_screen_start": "Nuevo agente",+ "room_command": "Mission Control",+ "mission_screen_workspaces": "Espacios de trabajo",+ "mission_screen_activity": "Últimas instrucciones",+ "mission_screen_none": "Aún no hay agentes de código","mission_new_title": "Iniciar un agente","mission_fewer": "Un agente menos","mission_more": "Un agente más",@@ -984,7 +988,6 @@"room_wardrobe": "Vestuario","room_reception": "Recepción","room_break": "Sala de descanso",- "room_focus": "Zona de concentración","room_server": "Sala de servidores","dog_treat": "Darle el hueso","dog_take_bone": "Coger una golosina",