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(agents): talk to agents on the office map by voice or text, with thought and speech bubbles
rubenluetke10-beep03f29cdbb4c1
diff --git a/jarvis/ui/web/frontend/src/components/society/office/AgentTalkPanel.tsx b/jarvis/ui/web/frontend/src/components/society/office/AgentTalkPanel.tsxnew file mode 100644index 0000000000..7c27873980--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/AgentTalkPanel.tsx@@ -0,0 +1,314 @@+/**+ * The agent panel in the office: a walkie-talkie to that agent.+ *+ * Speak (hold T, or hold / tap the microphone) or type; the words go into the+ * agent's own chat and it answers over its head. The panel keeps the last few+ * exchanges readable, and the map actions (walk there, call over, show,+ * team up, open the full chat) sit in one icon row underneath.+ *+ * Voice uses the app's existing in-app dictation (`stt_dictate`): the final+ * transcript is delivered into the focused field (lib/dictationTarget.ts), so+ * the panel focuses its own box before listening and sends whatever lands+ * there once the microphone is closed. The global `dictating` flag is left+ * alone on purpose — composers elsewhere mirror every partial while it is+ * set, and the Agents workspace keeps one mounted behind the map.+ */+import { useCallback, useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type PointerEvent } from "react";+import { useQueryClient } from "@tanstack/react-query";+import { ArrowUp, Footprints, Hand, LocateFixed, Maximize2, Mic, Square, UserPlus } from "lucide-react";+import { useT } from "@/i18n";+import { getWSClient } from "@/hooks/useWebSocket";+import { useEventStore } from "@/store/events";+import type { TimelineItem } from "@/components/agentchat/reduce";+import type { SocietyAgent } from "../data";+import { player, useOfficeStore } from "./officeStore";+import { agentPositions } from "./walkerRegistry";+import { ownsKeyboard } from "./OfficePlayer";+import { useBubbleLabels } from "./OfficeBubbles";+import { bubbleText, itemsFor, talkStoreFor, turnBubble, useOfficeTalk } from "./officeTalk";+import "./officeTalk.css";++/** How long called or gathered agents stay before they drift back to their day. */+export const CALL_MS = 25_000;+/** A press on the microphone longer than this is push-to-talk: releasing sends. */+const HOLD_MS = 350;+/** After the microphone closes, the transcript usually lands within a few seconds. */+const FINAL_WAIT_MS = 15_000;+/** Quiet time after the transcript lands before it is sent on its own. */+const SETTLE_MS = 350;+/** Exchanges the panel keeps on screen; the full chat has the rest. */+const RECENT_ITEMS = 6;++export interface TalkActions {+ onOpenAgent: (id: string) => void;+}++async function bindAgentChat(agentId: string): Promise<void> {+ const res = await fetch(`/api/society/agents/${encodeURIComponent(agentId)}/chat`, { method: "POST" });+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+}++function sendDictation(mode: "start" | "stop") {+ getWSClient()?.send({ type: "command", action: "stt_dictate", payload: { mode } });+}++function StateDot({ state }: { state: SocietyAgent["state"] }) {+ return <i className="office-dot" data-state={state} aria-hidden />;+}++function LogEntry({ item }: { item: TimelineItem }) {+ const labels = useBubbleLabels();+ if (item.type === "user") return <li className="office-talk-msg" data-from="you"><p>{item.text}</p></li>;+ if (item.type === "error") return <li className="office-talk-msg" data-from="error"><p>{bubbleText(item.text, 300)}</p></li>;+ if (item.type !== "turn") return null;+ if (item.status === "running") {+ const live = turnBubble(item, labels);+ return (+ <li className="office-talk-msg" data-from="agent" data-live>+ <p>{live.text}<span className="office-bubble-dots" aria-hidden><i /><i /><i /></span></p>+ </li>+ );+ }+ const text = [...item.blocks].reverse().find((b) => b.kind === "text" && b.text.trim());+ const body = text && text.kind === "text" ? bubbleText(text.text, 900) : turnBubble(item, labels).text;+ return <li className="office-talk-msg" data-from={item.status === "error" ? "error" : "agent"}><p>{body}</p></li>;+}++export function AgentTalkPanel({ agent, actions, onClose }: { agent: SocietyAgent; actions: TalkActions; onClose: () => void }) {+ const t = useT();+ const headingId = useId();+ const client = useQueryClient();+ const office = useOfficeStore();+ const useChat = talkStoreFor(agent);+ const timeline = useChat((s) => s.timeline);+ const activeSessionId = useChat((s) => s.activeSessionId);+ const busy = useChat((s) => s.busy);+ const lastError = useChat((s) => s.lastError);+ const connected = useEventStore((s) => s.connected);+ const listening = useOfficeTalk((s) => s.listening);+ const interim = useEventStore((s) => (listening ? s.dictationText : ""));+ const [value, setValue] = useState("");+ const [bindError, setBindError] = useState<string | null>(null);+ const [called, setCalled] = useState(false);+ const panel = useRef<HTMLElement>(null);+ const input = useRef<HTMLTextAreaElement>(null);+ const log = useRef<HTMLOListElement>(null);++ const isLead = agent.tier === "lead";+ const ready = isLead || (!!agent.chatSessionId && agent.chatSessionId === activeSessionId);+ const items = itemsFor(agent, activeSessionId, timeline);+ const recent = useMemo(() => items.filter((i) => i.type === "user" || i.type === "turn" || i.type === "error").slice(-RECENT_ITEMS), [items]);+ const last = recent[recent.length - 1];+ const running = last?.type === "user" || (last?.type === "turn" && last.status === "running");+ const approvals = ready ? timeline.pendingApprovals.length : 0;+ const inDraft = office.teamDraft.includes(agent.agentId);+ const where = agentPositions.get(agent.agentId);++ // This agent is the one the office listens to now; its bubble follows this chat.+ useEffect(() => { useOfficeTalk.getState().setAgent(agent.agentId); setCalled(false); setValue(""); }, [agent.agentId]);+ useEffect(() => { panel.current?.focus({ preventScroll: true }); }, [agent.agentId]);++ // Open the agent's own chat. Bind is idempotent; it creates the session a+ // brand-new agent does not have yet, and the roster then carries its id.+ useEffect(() => {+ const chat = useChat.getState();+ if (isLead) { if (!chat.activeSessionId) void chat.loadSessions(); return; }+ let alive = true;+ setBindError(null);+ if (agent.chatSessionId) chat.openSession(agent.chatSessionId);+ void bindAgentChat(agent.agentId)+ .then(() => { if (alive && !agent.chatSessionId) void client.invalidateQueries({ queryKey: ["society", "roster"] }); })+ .catch((err) => { if (alive) setBindError(err instanceof Error ? err.message : String(err)); });+ return () => { alive = false; };+ }, [agent.agentId, agent.chatSessionId, isLead, useChat, client]);++ // Newest exchange in view.+ useEffect(() => { log.current?.scrollTo({ top: log.current.scrollHeight }); }, [recent]);++ const submit = useCallback(async (text: string) => {+ const content = text.trim();+ if (!content || !ready) return;+ setValue("");+ useOfficeTalk.getState().say(bubbleText(content, 160));+ await useChat.getState().send(content);+ }, [ready, useChat]);++ // --- voice -------------------------------------------------------------+ const awaiting = useRef(false);+ const awaitTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);+ const settleTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);+ const startVoice = useCallback(() => {+ if (!connected || !ready || useOfficeTalk.getState().listening) return;+ clearTimeout(settleTimer.current);+ awaiting.current = false;+ useEventStore.getState().setDictationInterim("");+ // The final transcript goes to whatever field has focus: make that this box.+ input.current?.focus({ preventScroll: true });+ useOfficeTalk.getState().setListening(true);+ sendDictation("start");+ }, [connected, ready]);+ const stopVoice = useCallback(() => {+ if (!useOfficeTalk.getState().listening) return;+ sendDictation("stop");+ useOfficeTalk.getState().setListening(false);+ input.current?.focus({ preventScroll: true });+ awaiting.current = true;+ clearTimeout(awaitTimer.current);+ awaitTimer.current = setTimeout(() => { awaiting.current = false; }, FINAL_WAIT_MS);+ }, []);+ const voice = useRef({ startVoice, stopVoice });+ voice.current = { startVoice, stopVoice };++ // Closing the panel (or switching agents) never leaves the microphone open.+ useEffect(() => () => {+ clearTimeout(awaitTimer.current);+ clearTimeout(settleTimer.current);+ if (useOfficeTalk.getState().listening) { sendDictation("stop"); useOfficeTalk.getState().setListening(false); }+ }, [agent.agentId]);++ // Hold T to talk, anywhere on the map (a text field keeps its own T).+ useEffect(() => {+ let held = false;+ const down = (event: globalThis.KeyboardEvent) => {+ if (event.code !== "KeyT" || event.ctrlKey || event.metaKey || event.altKey) return;+ // Key repeats while held land in the focused box; they must not type there.+ if (held) { event.preventDefault(); return; }+ if (event.repeat || ownsKeyboard(event.target)) return;+ event.preventDefault();+ held = true;+ voice.current.startVoice();+ };+ const up = (event: globalThis.KeyboardEvent) => {+ if (event.code !== "KeyT" || !held) return;+ held = false;+ event.preventDefault();+ voice.current.stopVoice();+ };+ const release = () => { if (held) { held = false; voice.current.stopVoice(); } };+ window.addEventListener("keydown", down, true);+ window.addEventListener("keyup", up, true);+ window.addEventListener("blur", release);+ return () => {+ window.removeEventListener("keydown", down, true);+ window.removeEventListener("keyup", up, true);+ window.removeEventListener("blur", release);+ };+ }, []);++ // The microphone button: a long press is push-to-talk, a tap toggles.+ const press = useRef<{ at: number; wasListening: boolean } | null>(null);+ const onMicDown = (event: PointerEvent<HTMLButtonElement>) => {+ if (event.button !== 0) return;+ event.preventDefault();+ press.current = { at: Date.now(), wasListening: useOfficeTalk.getState().listening };+ if (!press.current.wasListening) startVoice();+ };+ const onMicUp = () => {+ const p = press.current;+ press.current = null;+ if (!p) return;+ if (p.wasListening || Date.now() - p.at > HOLD_MS) stopVoice();+ };+ const onMicKey = (event: KeyboardEvent<HTMLButtonElement>) => {+ if (event.key !== "Enter" && event.key !== " ") return;+ event.preventDefault();+ if (useOfficeTalk.getState().listening) stopVoice(); else startVoice();+ };++ const onChange = (next: string) => {+ setValue(next);+ if (!awaiting.current) return;+ // The spoken words just landed: send them once the box stops changing.+ clearTimeout(settleTimer.current);+ settleTimer.current = setTimeout(() => {+ awaiting.current = false;+ clearTimeout(awaitTimer.current);+ void submit(input.current?.value ?? next);+ panel.current?.focus({ preventScroll: true });+ }, SETTLE_MS);+ };++ const status = !ready+ ? bindError ? `${t("society.card.chat_bind_failed")} (${bindError})` : t("society.office.talk_connecting")+ : listening ? (interim || t("society.office.talk_listening")) : t("society.office.talk_hint");++ return (+ <aside ref={panel} className="office-card office-panel office-talk" data-office-ui aria-labelledby={headingId} tabIndex={-1}>+ <header className="office-talk-head">+ <span className="office-talk-avatar" style={{ background: agent.palette.primary }} aria-hidden>+ {isLead ? "★" : agent.name.slice(0, 1).toUpperCase()}+ </span>+ <div className="office-talk-who">+ <h2 id={headingId}>{agent.name}</h2>+ <span><StateDot state={agent.state} />{t(`society.office.state_${agent.state}`)}{agent.title || agent.providerLabel ? ` · ${agent.title || agent.providerLabel}` : ""}</span>+ </div>+ <button type="button" className="office-icon-button" onClick={onClose} aria-label={t("society.office.close")}>×</button>+ </header>++ <ol ref={log} className="office-talk-log" aria-live="polite" aria-label={t("society.office.talk_log").replace("{0}", agent.name)}>+ {recent.length === 0+ ? <li className="office-talk-empty">{t("society.office.talk_empty").replace("{0}", agent.name)}</li>+ : recent.map((item) => <LogEntry key={item.id} item={item} />)}+ </ol>++ {approvals > 0 && (+ <p className="office-talk-alert" role="status">+ {t("society.office.talk_approval").replace("{0}", agent.name)}+ <button type="button" className="office-link" onClick={() => actions.onOpenAgent(agent.agentId)}>{t("society.office.talk_review")}</button>+ </p>+ )}+ {lastError && ready && <p role="alert" className="office-talk-error">{lastError}</p>}++ <div className="office-talk-composer" data-listening={listening || undefined}>+ <button type="button" className="office-talk-mic" data-jarvis-dictation-trigger aria-pressed={listening}+ disabled={!connected || !ready}+ aria-label={listening ? t("society.office.talk_mic_stop") : t("society.office.talk_mic_start")}+ title={listening ? t("society.office.talk_mic_stop") : t("society.office.talk_mic_start")}+ onPointerDown={onMicDown} onPointerUp={onMicUp} onPointerLeave={() => { if (press.current && Date.now() - press.current.at > HOLD_MS) onMicUp(); }}+ onKeyDown={onMicKey}>+ {listening ? <Square aria-hidden /> : <Mic aria-hidden />}+ </button>+ <textarea ref={input} rows={1} value={value} maxLength={4000}+ placeholder={t("society.office.talk_placeholder").replace("{0}", agent.name)}+ aria-label={t("society.office.talk_placeholder").replace("{0}", agent.name)}+ onChange={(e) => onChange(e.target.value)}+ onKeyDown={(e) => {+ if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); void submit(value); }+ // Escape leaves the box so the arrow keys walk again; a second Escape closes the panel.+ else if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); panel.current?.focus({ preventScroll: true }); }+ }} />+ {running && !value.trim() && !listening+ ? <button type="button" className="office-talk-send" data-stop onClick={() => void useChat.getState().cancel()}+ aria-label={t("society.office.talk_cancel")} title={t("society.office.talk_cancel")}><Square aria-hidden /></button>+ : <button type="button" className="office-talk-send" disabled={!ready || busy || !value.trim()} onClick={() => void submit(value)}+ aria-label={t("society.office.talk_send")} title={t("society.office.talk_send")}><ArrowUp aria-hidden /></button>}+ </div>+ <p className="office-talk-status" data-listening={listening || undefined} aria-live="polite">{status}</p>++ <div className="office-talk-tools" role="toolbar" aria-label={t("society.office.talk_tools")}>+ <button type="button" disabled={!where} onClick={() => where && office.requestWalk(where)} title={t("society.office.action_walk")}>+ <Footprints aria-hidden /><span>{t("society.office.tool_walk")}</span>+ </button>+ <button type="button" onClick={() => { office.summon([agent.agentId], { x: player.x, z: player.z }, CALL_MS); setCalled(true); }} title={t("society.office.action_call")}>+ <Hand aria-hidden /><span>{t("society.office.tool_call")}</span>+ </button>+ <button type="button" disabled={!where} onClick={() => where && office.focusOn(where)} title={t("society.office.action_focus")}>+ <LocateFixed aria-hidden /><span>{t("society.office.tool_focus")}</span>+ </button>+ <button type="button" aria-pressed={inDraft} onClick={() => office.toggleDraft(agent.agentId)}+ title={t(inDraft ? "society.office.action_undraft" : "society.office.action_draft")}>+ <UserPlus aria-hidden /><span>{t("society.office.tool_team")}</span>+ </button>+ <button type="button" onClick={() => actions.onOpenAgent(agent.agentId)} title={t("society.office.action_chat")}>+ <Maximize2 aria-hidden /><span>{t("society.office.tool_chat")}</span>+ </button>+ </div>+ {called && <p className="office-hint office-talk-note" role="status">{t("society.office.call_sent").replace("{0}", agent.name)}</p>}+ {office.teamDraft.length > 0 && (+ <button type="button" className="office-link office-talk-note" onClick={() => office.select({ kind: "checkpoint", id: "team" })}>+ {t("society.office.draft_count").replace("{0}", String(office.teamDraft.length))}+ </button>+ )}+ </aside>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeAgents.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeAgents.tsxindex e931d1d99c..5b90c2b4e6 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeAgents.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeAgents.tsx@@ -29,6 +29,10 @@ import { stepMover, stepMoverAvoiding, turnToward, WALK_SPEED, type Mover } fromimport { createRng, planFor, type ActivityKind, type Plan, type Pose, type SpotBook } from "./officeBehavior";import { player, useOfficeStore } from "./officeStore";import { agentPositions, bodiesExcept, seatedAtDesk } from "./walkerRegistry";+import { AgentBubble } from "./OfficeBubbles";+import type { ChatLine } from "./deskChat";+import type { DeskChat } from "./useDeskChats";+import { officeTalkChat, useOfficeTalk } from "./officeTalk";/** The agent's symbol walks behind it as a little pet, about a fifth of its height. */export const PET_SIZE_M = 0.26;@@ -107,9 +111,9 @@ export interface WalkerContext {spawn: Point;}-function Walker({ agent, desk, ctx, arrivesByElevator, awake, reduced, selected, onSelect }: {+function Walker({ agent, desk, ctx, arrivesByElevator, awake, reduced, selected, lines, onSelect }: {agent: SocietyAgent; desk: DeskSlot | null; ctx: WalkerContext; arrivesByElevator: boolean;- awake: boolean; reduced: boolean; selected: boolean; onSelect: (id: string) => void;+ awake: boolean; reduced: boolean; selected: boolean; lines: readonly ChatLine[] | undefined; onSelect: (id: string) => void;}) {const look = useMemo(() => toyLookFor(agent.figure, agent.agentId), [agent.figure, agent.agentId]);const group = useRef<Group>(null);@@ -223,6 +227,8 @@ function Walker({ agent, desk, ctx, arrivesByElevator, awake, reduced, selected,{!isGigi && <ToyFigure look={look} drive={drive} paused={!awake} heightM={OFFICE_FIGURE_HEIGHT_M} seatHeight={seatHeight} />}</group><Nameplate agent={agent} activity={activity} selected={selected} onSelect={onSelect} height={isGigi ? 1.75 : undefined} />+ <AgentBubble agent={agent} lines={lines} selected={selected} onSelect={onSelect}+ height={(isGigi ? 1.75 : OFFICE_FIGURE_HEIGHT_M + 0.35) + 0.14} /></group>{isGigi? <GigiFlyer owner={mover} mode={gigiModeFor(gigiPose.pose, gigiPose.travelling)} speaking={speaking} paused={!awake} reduced={reduced} />@@ -231,17 +237,19 @@ function Walker({ agent, desk, ctx, arrivesByElevator, awake, reduced, selected,);}-export function OfficeAgents({ desks, agents, ctx, newcomers, awake, reduced, selectedId, onSelect }: {+export function OfficeAgents({ desks, agents, ctx, newcomers, awake, reduced, selectedId, chats, onSelect }: {desks: DeskSlot[]; agents: ReadonlyMap<string, SocietyAgent>; ctx: WalkerContext; newcomers: ReadonlySet<string>;- awake: boolean; reduced: boolean; selectedId: string | null; onSelect: (id: string) => void;+ awake: boolean; reduced: boolean; selectedId: string | null; chats?: ReadonlyMap<string, DeskChat>; onSelect: (id: string) => void;}) {const deskOf = useMemo(() => new Map(desks.filter((d) => d.agentId).map((d) => [d.agentId as string, d])), [desks]);+ // Leaving the office hangs up: the talk socket closes, the chat keeps running on the server.+ useEffect(() => () => { officeTalkChat.getState().disconnect(); useOfficeTalk.getState().setAgent(null); }, []);return (<group>{[...agents.values()].map((agent) => (<Walker key={agent.agentId} agent={agent} desk={deskOf.get(agent.agentId) ?? null} ctx={ctx}arrivesByElevator={newcomers.has(agent.agentId)} awake={awake} reduced={reduced}- selected={selectedId === agent.agentId} onSelect={onSelect} />+ selected={selectedId === agent.agentId} lines={chats?.get(agent.agentId)?.lines} onSelect={onSelect} />))}</group>);diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeBubbles.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeBubbles.tsxnew file mode 100644index 0000000000..ed96ce8505--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeBubbles.tsx@@ -0,0 +1,132 @@+/**+ * Comic bubbles over heads in the office: a thought cloud while an agent+ * works, a speech bubble with its reply, a "?" bubble when it waits for the+ * person — and the person's own words over their character.+ *+ * In-world, like the nameplates: one dark look in both themes, scaled by+ * camera distance. Ambient bubbles (agents nobody is talking to) hide when+ * the camera is far away, so the overview never turns into a wall of text.+ */+import { useEffect, useMemo, useRef, useState } from "react";+import { Html } from "@react-three/drei";+import { useFrame } from "@react-three/fiber";+import { Vector3, type Group } from "three";+import { useT } from "@/i18n";+import { useEventStore } from "@/store/events";+import type { SocietyAgent } from "../data";+import type { ChatLine } from "./deskChat";+import { player } from "./officeStore";+import { plateScale } from "./OfficeAgents";+import {+ ambientBubble, conversationBubble, itemsFor, PLAYER_LINE_MS, REPLY_LINGER_MS, talkStoreFor, useOfficeTalk,+ type Bubble, type BubbleLabels,+} from "./officeTalk";++/** Ambient bubbles only show within this camera distance (metres). */+const AMBIENT_RANGE_M = 20;++export function useBubbleLabels(): BubbleLabels {+ const t = useT();+ return useMemo(() => ({+ thinking: t("society.office.bubble_thinking"),+ tool: t("society.office.bubble_tool"),+ failed: t("society.office.bubble_failed"),+ cancelled: t("society.office.bubble_cancelled"),+ done: t("society.office.bubble_done"),+ approval: t("society.office.bubble_approval"),+ waiting: t("society.office.bubble_waiting"),+ }), [t]);+}++/** Re-renders once a second while `active`, so a settled bubble can expire. */+function useClock(active: boolean): number {+ const [now, setNow] = useState(() => Date.now());+ useEffect(() => {+ if (!active) return;+ const id = window.setInterval(() => setNow(Date.now()), 1000);+ return () => window.clearInterval(id);+ }, [active]);+ return now;+}++/** The bubble itself, anchored `height` metres above its parent group. */+export function BubbleView({ bubble, height, range = Infinity, onClick }: {+ bubble: Bubble; height: number; range?: number; onClick?: () => void;+}) {+ const anchor = useRef<Group>(null);+ const box = useRef<HTMLDivElement>(null);+ const world = useMemo(() => new Vector3(), []);+ const last = useRef({ scale: 0, hidden: false });+ useFrame(({ camera }) => {+ if (!anchor.current || !box.current) return;+ const distance = camera.position.distanceTo(anchor.current.getWorldPosition(world));+ const hidden = distance > range;+ const scale = plateScale(distance);+ if (hidden !== last.current.hidden) {+ last.current.hidden = hidden;+ box.current.style.visibility = hidden ? "hidden" : "visible";+ }+ if (Math.abs(scale - last.current.scale) < 0.02) return;+ last.current.scale = scale;+ box.current.style.transform = `translateX(-50%) scale(${scale.toFixed(2)})`;+ });+ return (+ <group ref={anchor} position={[0, height, 0]}>+ <Html zIndexRange={[22, 0]} style={{ pointerEvents: "none" }}>+ <div ref={box} className="office-bubble" data-kind={bubble.kind} data-live={bubble.live || undefined} data-office-ui+ role={onClick ? "button" : undefined} onClick={onClick ? (e) => { e.stopPropagation(); onClick(); } : undefined}+ style={{ pointerEvents: onClick ? "auto" : "none" }}>+ <p>{bubble.text}{bubble.live && bubble.kind !== "ask" ? <span className="office-bubble-dots" aria-hidden><i /><i /><i /></span> : null}</p>+ {bubble.kind === "thought"+ ? <span className="office-bubble-puffs" aria-hidden><i /><i /></span>+ : <span className="office-bubble-tail" aria-hidden />}+ </div>+ </Html>+ </group>+ );+}++/**+ * The agent's bubble: its live conversation when the person talks to it,+ * otherwise what it is busy with (from the desk-monitor tail).+ */+export function AgentBubble({ agent, lines, selected, height, onSelect }: {+ agent: SocietyAgent; lines: readonly ChatLine[] | undefined; selected: boolean; height: number; onSelect: (id: string) => void;+}) {+ const labels = useBubbleLabels();+ const talking = useOfficeTalk((s) => s.agentId === agent.agentId);+ const useStore = talkStoreFor(agent);+ const timeline = useStore((s) => (talking ? s.timeline : null));+ const activeSessionId = useStore((s) => (talking ? s.activeSessionId : null));+ const talk = useMemo(() => {+ if (!timeline) return null;+ return conversationBubble(itemsFor(agent, activeSessionId, timeline), timeline.pendingApprovals.length, labels);+ }, [timeline, activeSessionId, agent, labels]);+ const lingering = !!talk && !talk.live && !selected;+ const now = useClock(lingering);+ const open = () => onSelect(agent.agentId);+ if (talk && (talk.live || selected || now - talk.atMs < REPLY_LINGER_MS)) {+ return <BubbleView bubble={talk} height={height} onClick={open} />;+ }+ const ambient = ambientBubble(agent.state, lines, labels);+ return ambient ? <BubbleView bubble={ambient} height={height} range={AMBIENT_RANGE_M} onClick={open} /> : null;+}++/** The person's own words over their character: the live transcript while speaking, then the sent line. */+export function PlayerBubble({ height }: { height: number }) {+ const t = useT();+ const group = useRef<Group>(null);+ const listening = useOfficeTalk((s) => s.listening);+ const line = useOfficeTalk((s) => s.playerLine);+ const interim = useEventStore((s) => (listening ? s.dictationText : ""));+ const now = useClock(!!line && !listening);+ useFrame(() => { group.current?.position.set(player.x, 0, player.z); });+ let bubble: Bubble | null = null;+ if (listening) bubble = { kind: "speech", text: interim || t("society.office.bubble_listening"), live: true, atMs: 0 };+ else if (line && now - line.atMs < PLAYER_LINE_MS) bubble = { kind: "speech", text: line.text, live: false, atMs: line.atMs };+ return (+ <group ref={group}>+ {bubble ? <BubbleView bubble={bubble} height={height} /> : null}+ </group>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsxindex 99b8c5a3b3..2664550a1f 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficePanels.tsx@@ -12,10 +12,10 @@ import type { SocietyAgent } from "../data";import type { CheckpointKind, OfficeLayout, Point } from "./officeLayout";import { player, useOfficeStore } from "./officeStore";import { agentPositions } from "./walkerRegistry";-import { HAIR_STYLES, playerLook, withHairStyle, withShuffledColours, type PlayerProfile } from "./playerProfile";+import { AgentTalkPanel, CALL_MS } from "./AgentTalkPanel";+import type { PlayerProfile } from "./playerProfile";+import { WardrobePanel } from "./WardrobePanel";-/** How long called or gathered agents stay before they drift back to their day. */-const CALL_MS = 25_000;export interface OfficeActions {onOpenAgent: (id: string) => void;@@ -55,39 +55,9 @@ function spotCentre(layout: OfficeLayout, kind: "meeting" | "couch"): Point {return { x: spots.reduce((s, p) => s + p.x, 0) / spots.length, z: spots.reduce((s, p) => s + p.z, 0) / spots.length };}+/** The agent panel is a walkie-talkie to that agent (AgentTalkPanel). */export function AgentPanel({ agent, actions, onClose }: { agent: SocietyAgent; actions: OfficeActions; onClose: () => void }) {- const t = useT();- const store = useOfficeStore();- const inDraft = store.teamDraft.includes(agent.agentId);- const where = agentPositions.get(agent.agentId);- const [called, setCalled] = useState(false);- // A new agent in the same panel starts without the previous "coming over" note.- useEffect(() => setCalled(false), [agent.agentId]);- const subtitle = agent.title || agent.providerLabel;- return (- <PanelShell title={agent.name} subtitle={subtitle} onClose={onClose}>- <p className="office-panel-status"><StateDot state={agent.state} />{t(`society.office.state_${agent.state}`)}- {agent.providerLabel && agent.providerLabel !== subtitle ? <span> · {agent.providerLabel}</span> : null}</p>- <div className="office-actions">- <button type="button" className="office-action office-action-primary" onClick={() => actions.onOpenAgent(agent.agentId)}>{t("society.office.action_chat")}</button>- <button type="button" className="office-action" disabled={!where} onClick={() => where && store.requestWalk(where)}>{t("society.office.action_walk")}</button>- <button type="button" className="office-action" onClick={() => {- store.summon([agent.agentId], { x: player.x, z: player.z }, CALL_MS);- setCalled(true);- }}>{t("society.office.action_call")}</button>- <button type="button" className="office-action" disabled={!where} onClick={() => where && store.focusOn(where)}>{t("society.office.action_focus")}</button>- <button type="button" className="office-action" aria-pressed={inDraft} onClick={() => store.toggleDraft(agent.agentId)}>- {t(inDraft ? "society.office.action_undraft" : "society.office.action_draft")}- </button>- </div>- {called && <p className="office-hint" role="status">{t("society.office.call_sent").replace("{0}", agent.name)}</p>}- {store.teamDraft.length > 0 && (- <button type="button" className="office-link" onClick={() => store.select({ kind: "checkpoint", id: "team" })}>- {t("society.office.draft_count").replace("{0}", String(store.teamDraft.length))}- </button>- )}- </PanelShell>- );+ return <AgentTalkPanel agent={agent} actions={actions} onClose={onClose} />;}function CreatePanel({ actions }: { actions: OfficeActions }) {@@ -210,29 +180,6 @@ function TeamPanel({ agents, layout, sample, actions }: { agents: SocietyAgent[]);}-function WardrobePanel({ profile, onProfile }: { profile: PlayerProfile; onProfile: (next: PlayerProfile) => void }) {- const t = useT();- const bodiesId = useId();- return (- <>- <label className="office-field">- <span>{t("society.office.wardrobe_name")}</span>- <input value={profile.name} maxLength={40} placeholder={t("society.office.you")} autoComplete="off" spellCheck={false}- onChange={(e) => onProfile({ ...profile, name: e.target.value })} />- <span>{t("society.office.wardrobe_saved")}</span>- </label>- <p className="office-subhead" id={bodiesId}>{t("society.office.wardrobe_body")}</p>- <div className="office-chips" role="group" aria-labelledby={bodiesId}>- {HAIR_STYLES.map((style) => (- <button key={style} type="button" className="office-chip" aria-pressed={playerLook(profile).hairStyle === style} onClick={() => onProfile(withHairStyle(profile, style))}>- {t(`society.office.hair_${style}`)}- </button>- ))}- </div>- <button type="button" className="office-action" onClick={() => onProfile(withShuffledColours(profile))}>{t("society.office.wardrobe_shuffle")}</button>- </>- );-}function LeadPanel({ agents, actions }: { agents: SocietyAgent[]; actions: OfficeActions }) {const t = useT();@@ -249,7 +196,9 @@ function LeadPanel({ agents, actions }: { agents: SocietyAgent[]; actions: Offic<div key={lead.agentId}><p className="office-panel-status"><StateDot state={lead.state} />{lead.name} · {t(`society.office.state_${lead.state}`)}</p><div className="office-actions">- <button type="button" className="office-action office-action-primary" aria-label={named(t("society.office.action_chat"), lead.name)}+ <button type="button" className="office-action office-action-primary" aria-label={named(t("society.office.action_talk"), lead.name)}+ onClick={() => store.select({ kind: "agent", id: lead.agentId })}>{t("society.office.action_talk")}</button>+ <button type="button" className="office-action" aria-label={named(t("society.office.action_chat"), lead.name)}onClick={() => actions.onOpenAgent(lead.agentId)}>{t("society.office.action_chat")}</button><button type="button" className="office-action" aria-label={named(t("society.office.action_call"), lead.name)}onClick={() => store.summon([lead.agentId], { x: player.x, z: player.z }, CALL_MS)}>{t("society.office.action_call")}</button>@@ -295,7 +244,7 @@ export function CheckpointPanel({ id, agents, layout, sample, profile, onProfile{id === "create" && <CreatePanel actions={actions} />}{id === "manage" && <ManagePanel agents={agents} actions={actions} />}{id === "team" && <TeamPanel agents={agents} layout={layout} sample={sample} actions={actions} />}- {id === "wardrobe" && <WardrobePanel profile={profile} onProfile={onProfile} />}+ {id === "wardrobe" && <WardrobePanel profile={profile} onProfile={onProfile} agents={agents} sample={sample} />}{id === "lead" && <LeadPanel agents={agents} actions={actions} />}{id === "break" && <BreakPanel agents={agents} layout={layout} />}</PanelShell>diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsxindex b93eb11ff0..54344ebd68 100644--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeScene.tsx@@ -17,8 +17,9 @@ import type { DeskChat } from "./useDeskChats";import { FurniturePiece, MeetingChairs } from "./OfficeProps";import { RoomFloors, RoomSign, RoomWalls } from "./OfficeRooms";import { CheckpointMarker, type CheckpointIcon } from "./CheckpointMarker";-import { OfficeAgents, type WalkerContext } from "./OfficeAgents";+import { OFFICE_FIGURE_HEIGHT_M, OfficeAgents, type WalkerContext } from "./OfficeAgents";import { OfficePlayer } from "./OfficePlayer";+import { PlayerBubble } from "./OfficeBubbles";import { OfficeCameraRig } from "./OfficeCameraRig";import { allDesks, type CheckpointKind, type Department, type OfficeLayout, type Point } from "./officeLayout";import type { NavGrid } from "./officeNav";@@ -164,7 +165,8 @@ export function OfficeScene({ layout, grid, walkers, agents, newcomers, awake, ranimate={awake && !reduced} onActivate={() => select({ kind: "checkpoint", id: cp.id })} />))}<OfficePlayer layout={layout} grid={grid} look={player.look} name={player.name} awake={awake} reduced={reduced} />- <OfficeAgents desks={desks} agents={agents} ctx={walkers} newcomers={newcomers} awake={awake} reduced={reduced}+ <PlayerBubble height={OFFICE_FIGURE_HEIGHT_M + 0.49} />+ <OfficeAgents desks={desks} agents={agents} ctx={walkers} newcomers={newcomers} awake={awake} reduced={reduced} chats={chats}selectedId={selection?.kind === "agent" ? selection.id : null} onSelect={(id) => select({ kind: "agent", id })} /><OfficeCameraRig layout={layout} overview={overview} /></>diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeTalk.css b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.cssnew file mode 100644index 0000000000..bbd720f2c1--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.css@@ -0,0 +1,75 @@+/* Talking in the office: the walkie-talkie panel (theme tokens, light + dark) and the+ in-world comic bubbles (part of the diorama, one light-paper look in both modes). */++/* ---- bubbles ---------------------------------------------------------- */+.office-bubble { position:absolute; left:0; bottom:10px; transform:translateX(-50%); transform-origin:center bottom; width:max-content; max-width:240px; padding:7px 11px; border-radius:14px; background:#fffdf7; color:#1c1917; border:1.5px solid #1c1917; box-shadow:0 3px 10px rgb(0 0 0 / .35); font-size:12px; line-height:1.35; font-weight:600; font-family:inherit; cursor:pointer; user-select:none; animation:office-bubble-pop .22s cubic-bezier(.2,1.4,.5,1) both; }+.office-bubble p { margin:0; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }+.office-bubble-tail { position:absolute; left:50%; bottom:-8px; width:12px; height:12px; margin-left:-6px; background:inherit; border-right:1.5px solid #1c1917; border-bottom:1.5px solid #1c1917; transform:rotate(45deg) skew(8deg, 8deg); border-bottom-right-radius:3px; }+/* Thought: a soft cloud with two puffs trailing down to the head. */+.office-bubble[data-kind="thought"] { border-radius:18px; background:#f1f5ff; border-style:dashed; border-color:#475569; color:#334155; font-weight:500; font-style:italic; max-width:200px; }+.office-bubble-puffs i { position:absolute; left:50%; border-radius:50%; background:#f1f5ff; border:1.5px dashed #475569; }+.office-bubble-puffs i:nth-child(1) { width:10px; height:10px; bottom:-13px; margin-left:-9px; }+.office-bubble-puffs i:nth-child(2) { width:6px; height:6px; bottom:-21px; margin-left:-3px; }+/* Asking: the agent waits for the person. */+.office-bubble[data-kind="ask"] { background:#fff4d6; border-color:#b45309; color:#451a03; }+.office-bubble[data-kind="ask"] .office-bubble-tail { border-color:#b45309; }+.office-bubble[data-kind="ask"] p::before { content:"?"; display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-right:6px; border-radius:50%; background:#f59e0b; color:#1c1917; font-size:11px; font-weight:800; font-style:normal; vertical-align:-2px; }+.office-bubble[data-kind="error"] { background:#fff1f2; border-color:#be123c; color:#4c0519; }+.office-bubble[data-kind="error"] .office-bubble-tail { border-color:#be123c; }+.office-bubble-dots { display:inline-flex; gap:3px; margin-left:6px; vertical-align:middle; }+.office-bubble-dots i { width:4px; height:4px; border-radius:50%; background:currentColor; opacity:.35; animation:office-bubble-dot 1.2s infinite ease-in-out; }+.office-bubble-dots i:nth-child(2) { animation-delay:.2s; }+.office-bubble-dots i:nth-child(3) { animation-delay:.4s; }+@keyframes office-bubble-dot { 0%, 80%, 100% { opacity:.25; transform:translateY(0); } 40% { opacity:1; transform:translateY(-2px); } }+@keyframes office-bubble-pop { from { opacity:0; margin-bottom:-6px; } to { opacity:1; margin-bottom:0; } }+@media (prefers-reduced-motion:reduce) { .office-bubble, .office-bubble-dots i { animation:none; } .office-bubble-dots i { opacity:.7; } }++/* ---- the walkie-talkie panel ------------------------------------------ */+.office-talk { gap:0; }+.office-talk-head { display:flex; align-items:center; gap:10px; padding:10px 10px 8px 12px; border-bottom:1px solid hsl(var(--border)); }+.office-talk-avatar { display:inline-flex; flex:none; align-items:center; justify-content:center; width:32px; height:32px; color:#fff; font-size:14px; font-weight:800; clip-path:polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }+.office-talk-who { flex:1; min-width:0; }+.office-talk-who h2 { margin:0; font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.office-talk-who span { display:flex; align-items:center; gap:6px; margin-top:2px; font-size:11px; color:hsl(var(--muted-foreground)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.office-talk-log { list-style:none; margin:0; padding:10px 12px; display:flex; flex-direction:column; gap:6px; flex:1 1 auto; min-height:56px; max-height:260px; overflow:auto; font-size:12px; line-height:1.45; }+.office-talk-empty { margin:auto 0; color:hsl(var(--muted-foreground)); text-align:center; font-size:12px; }+.office-talk-msg { display:flex; }+.office-talk-msg p { margin:0; max-width:88%; padding:6px 10px; border-radius:12px; white-space:pre-wrap; overflow-wrap:anywhere; }+.office-talk-msg[data-from="you"] { justify-content:flex-end; }+.office-talk-msg[data-from="you"] p { background:hsl(var(--primary)); color:hsl(var(--primary-foreground)); border-bottom-right-radius:4px; }+.office-talk-msg[data-from="agent"] p { background:hsl(var(--secondary)); color:hsl(var(--foreground)); border-bottom-left-radius:4px; }+.office-talk-msg[data-live] p { color:hsl(var(--muted-foreground)); font-style:italic; }+.office-talk-msg[data-from="error"] p { background:hsl(var(--destructive) / .12); color:hsl(var(--destructive)); }+.office-talk-alert { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 12px 8px; padding:6px 9px; border-radius:9px; font-size:12px; background:hsl(var(--warning) / .15); color:hsl(var(--foreground)); }+.office-talk-error { margin:0 12px 6px; font-size:11px; color:hsl(var(--destructive)); }+.office-talk-composer { display:flex; align-items:flex-end; gap:6px; margin:0 10px; padding:5px; border:1px solid hsl(var(--border-strong, var(--border))); border-radius:14px; background:hsl(var(--background)); transition:box-shadow .15s, border-color .15s; }+.office-talk-composer:focus-within { box-shadow:0 0 0 2px hsl(var(--ring) / .5); }+.office-talk-composer[data-listening] { border-color:hsl(var(--success)); box-shadow:0 0 0 3px hsl(var(--success) / .25); }+.office-talk-composer textarea { flex:1; min-width:0; min-height:34px; max-height:120px; resize:none; border:0; padding:8px 4px; background:transparent; color:hsl(var(--foreground)); font:inherit; font-size:13px; line-height:1.35; field-sizing:content; }+.office-talk-composer textarea:focus { outline:none; }+.office-talk-composer textarea::placeholder { color:hsl(var(--muted-foreground)); }+.office-talk-mic, .office-talk-send { display:inline-flex; flex:none; align-items:center; justify-content:center; width:34px; height:34px; border:0; border-radius:10px; cursor:pointer; touch-action:none; }+.office-talk-mic svg, .office-talk-send svg { width:17px; height:17px; }+.office-talk-mic { background:hsl(var(--secondary)); color:hsl(var(--foreground)); }+.office-talk-mic:hover:not(:disabled) { background:hsl(var(--secondary) / .7); }+.office-talk-mic[aria-pressed="true"] { background:hsl(var(--success)); color:hsl(var(--background)); animation:office-talk-live 1.4s ease-in-out infinite; }+.office-talk-send { background:hsl(var(--primary)); color:hsl(var(--primary-foreground)); }+.office-talk-send[data-stop] { background:hsl(var(--secondary)); color:hsl(var(--foreground)); }+.office-talk-send[data-stop] svg { width:13px; height:13px; }+.office-talk-mic:disabled, .office-talk-send:disabled { opacity:.45; cursor:not-allowed; }+.office-talk-mic:focus-visible, .office-talk-send:focus-visible, .office-talk-tools button:focus-visible { outline:2px solid hsl(var(--ring)); outline-offset:2px; }+@keyframes office-talk-live { 0%, 100% { box-shadow:0 0 0 0 hsl(var(--success) / .45); } 50% { box-shadow:0 0 0 6px hsl(var(--success) / 0); } }+.office-talk-status { margin:5px 14px 0; min-height:16px; font-size:11px; color:hsl(var(--muted-foreground)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.office-talk-status[data-listening] { color:hsl(var(--success)); font-weight:600; }+.office-talk-tools { display:grid; grid-template-columns:repeat(5, 1fr); gap:2px; margin:8px 6px 8px; padding-top:6px; border-top:1px solid hsl(var(--border)); }+.office-talk-tools button { display:flex; flex-direction:column; align-items:center; gap:3px; min-width:0; padding:6px 2px; border:0; border-radius:9px; background:none; color:hsl(var(--muted-foreground)); font-size:10px; font-weight:600; cursor:pointer; }+.office-talk-tools button svg { width:16px; height:16px; }+.office-talk-tools button span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }+.office-talk-tools button:hover:not(:disabled) { background:hsl(var(--secondary)); color:hsl(var(--foreground)); }+.office-talk-tools button[aria-pressed="true"] { color:hsl(var(--primary)); background:hsl(var(--secondary)); }+.office-talk-tools button:disabled { opacity:.4; cursor:not-allowed; }+.office-talk-note { margin:0 14px 10px; }+@media (prefers-reduced-motion:reduce) { .office-talk-mic[aria-pressed="true"] { animation:none; } }+/* The light-mode wallpaper halo (index.css) rings every glyph in ivory; on filled chips with light+ ink — your own messages, the in-world bubbles and name pills — that ring smears the letters. */+.office-talk-msg[data-from="you"] p, .office-talk-mic, .office-talk-send, .office-bubble, .office-plate, .office-checkpoint { text-shadow:none; }diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeTalk.test.ts b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.test.tsnew file mode 100644index 0000000000..29ccb3e955--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.test.ts@@ -0,0 +1,83 @@+import { describe, expect, it } from "vitest";+import type { TimelineItem, TurnItem } from "@/components/agentchat/reduce";+import { EMPTY_TIMELINE } from "@/components/agentchat/reduce";+import { ambientBubble, bubbleText, conversationBubble, itemsFor, type BubbleLabels } from "./officeTalk";++const LABELS: BubbleLabels = {+ thinking: "Thinking", tool: "Using {0}", failed: "Failed", cancelled: "Stopped", done: "Done", approval: "Need OK", waiting: "Waiting",+};++function turn(patch: Partial<TurnItem>): TurnItem {+ return {+ type: "turn", id: "t1", provider: "p", model: "m", effort: "", runner: "api", status: "done", blocks: [],+ startedMs: 1000, durationMs: 500, usage: null, liveUsage: null, costUsd: null, error: null, ...patch,+ };+}++const user: TimelineItem = { type: "user", id: "u1", text: "Hi", attachments: [], tsMs: 900 };++describe("bubbleText", () => {+ it("strips markdown and flattens whitespace", () => {+ expect(bubbleText("## Plan\n- **Fix** the `login` [bug](http://x)\n\n```js\ncode()\n```")).toBe("Plan Fix the login bug");+ });++ it("cuts long text at a word boundary with an ellipsis", () => {+ const out = bubbleText("word ".repeat(80), 40);+ expect(out.length).toBeLessThanOrEqual(40);+ expect(out.endsWith("…")).toBe(true);+ expect(out).not.toMatch(/\s…$/);+ });+});++describe("conversationBubble", () => {+ it("is empty before anything was said", () => {+ expect(conversationBubble([], 0, LABELS)).toBeNull();+ });++ it("thinks while the sent message waits for its turn", () => {+ expect(conversationBubble([user], 0, LABELS)).toMatchObject({ kind: "thought", text: "Thinking", live: true });+ });++ it("names the running tool in a thought bubble", () => {+ const running = turn({ status: "running", blocks: [{ kind: "tool", callId: "c", name: "mcp__jarvis__web_search", input: {}, output: null, isError: false, durationMs: null, approval: null, startedMs: 1 }] });+ expect(conversationBubble([user, running], 0, LABELS)).toMatchObject({ kind: "thought", text: "Using web_search", live: true });+ });++ it("speaks the streaming text live, then the finished reply", () => {+ const streaming = turn({ status: "running", blocks: [{ kind: "text", id: "x", text: "Working on **it**" }] });+ expect(conversationBubble([user, streaming], 0, LABELS)).toMatchObject({ kind: "speech", text: "Working on it", live: true });+ const done = turn({ blocks: [{ kind: "text", id: "x", text: "All done." }] });+ expect(conversationBubble([user, done], 0, LABELS)).toEqual({ kind: "speech", text: "All done.", live: false, atMs: 1500 });+ });++ it("reports a failed turn and asks when an approval is pending", () => {+ expect(conversationBubble([turn({ status: "error", error: "Rate limited" })], 0, LABELS)).toMatchObject({ kind: "error", text: "Rate limited" });+ expect(conversationBubble([user], 1, LABELS)).toMatchObject({ kind: "ask", text: "Need OK" });+ });+});++describe("itemsFor", () => {+ const timeline = { ...EMPTY_TIMELINE, items: [user] };+ it("reads a specialist's items only from its own open session", () => {+ expect(itemsFor({ tier: "specialist", chatSessionId: "s1" }, "s1", timeline)).toEqual([user]);+ expect(itemsFor({ tier: "specialist", chatSessionId: "s1" }, "s2", timeline)).toEqual([]);+ expect(itemsFor({ tier: "specialist", chatSessionId: null }, null, timeline)).toEqual([]);+ });++ it("reads the lead from the Jarvis chat", () => {+ expect(itemsFor({ tier: "lead", chatSessionId: null }, "any", timeline)).toEqual([user]);+ });+});++describe("ambientBubble", () => {+ it("lets working agents think about their current step", () => {+ expect(ambientBubble("working", [{ kind: "tool", text: "read_file" }], LABELS)).toMatchObject({ kind: "thought", text: "Using read_file" });+ expect(ambientBubble("working", undefined, LABELS)).toMatchObject({ kind: "thought", text: "Thinking" });+ });++ it("lets waiting agents ask, and keeps idle agents quiet", () => {+ expect(ambientBubble("waiting", [{ kind: "agent", text: "Which repo?" }, { kind: "tool", text: "x" }], LABELS)).toMatchObject({ kind: "ask", text: "Which repo?" });+ expect(ambientBubble("waiting", [], LABELS)).toMatchObject({ kind: "ask", text: "Waiting" });+ expect(ambientBubble("idle", [{ kind: "agent", text: "hi" }], LABELS)).toBeNull();+ });+});diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeTalk.ts b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.tsnew file mode 100644index 0000000000..1b3a7b525b--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/office/officeTalk.ts@@ -0,0 +1,144 @@+/**+ * Talking to an agent inside the office, without leaving the map.+ *+ * The person picks an agent and speaks (or types); the words go into that+ * agent's own canonical chat — the same session the chat view shows — and the+ * answer comes back as a bubble over the agent's head: a thought bubble while+ * it works, a speech bubble with its reply once it is done.+ *+ * Specialists share one office-only chat store (its own socket through the+ * shared connect budget), so the chat the rest of the app has open is never+ * switched underneath it. The lead is Jarvis itself and answers in the Jarvis+ * chat store, exactly like the lead's card does.+ *+ * The bubble text is derived here, pure and tested (`officeTalk.test.ts`).+ */+import { create } from "zustand";+import { createAgentChatStore, useAgentChatStore, type AgentChatStoreHook } from "@/store/agentChat";+import type { Timeline, TimelineItem, TurnItem } from "@/components/agentchat/reduce";+import type { SocietyAgent } from "../data";+import { toolLabel, type ChatLine } from "./deskChat";++/** One socket for every specialist the person talks to in the office. */+export const officeTalkChat: AgentChatStoreHook = createAgentChatStore("society", "office-talk");++/** The chat store an agent answers in: the lead speaks through Jarvis's own chat. */+export function talkStoreFor(agent: Pick<SocietyAgent, "tier">): AgentChatStoreHook {+ return agent.tier === "lead" ? useAgentChatStore : officeTalkChat;+}++/** A spoken line the person's character shows over its head. */+export interface PlayerLine { text: string; atMs: number }++interface TalkState {+ /** The agent the person is talking to right now; its bubble follows that chat. */+ agentId: string | null;+ /** The microphone is open for the office (push-to-talk or tap). */+ listening: boolean;+ /** Last thing the person said, shown over their character for a moment. */+ playerLine: PlayerLine | null;+ setAgent: (agentId: string | null) => void;+ setListening: (listening: boolean) => void;+ say: (text: string) => void;+}++export const useOfficeTalk = create<TalkState>((set) => ({+ agentId: null,+ listening: false,+ playerLine: null,+ setAgent: (agentId) => set((s) => (s.agentId === agentId ? s : { agentId })),+ setListening: (listening) => set((s) => (s.listening === listening ? s : { listening })),+ say: (text) => set({ playerLine: { text, atMs: Date.now() } }),+}));++/** How long a finished reply stays over the agent's head once its panel is closed. */+export const REPLY_LINGER_MS = 20_000;+/** How long the person's own line stays over their character. */+export const PLAYER_LINE_MS = 7_000;++export type BubbleKind = "thought" | "speech" | "ask" | "error";++export interface Bubble {+ kind: BubbleKind;+ text: string;+ /** Still streaming or working: the bubble shows its "…" and never expires. */+ live: boolean;+ /** When the content was last settled; a finished bubble expires from here. */+ atMs: number;+}++/**+ * Plain text for a small bubble: markdown marks, code fences and link targets+ * removed, whitespace flattened, cut at a word boundary with an ellipsis.+ */+export function bubbleText(raw: string, max = 220): string {+ const plain = raw+ .replace(/```[\s\S]*?```/g, " ")+ .replace(/`([^`]*)`/g, "$1")+ .replace(/!\[[^\]]*]\([^)]*\)/g, " ")+ .replace(/\[([^\]]+)]\([^)]*\)/g, "$1")+ .replace(/^\s{0,3}(#{1,6}|>|[-*+]|\d+\.)\s+/gm, "")+ .replace(/(\*\*|__|~~|\*|_)(?=\S)([^*_~]+?)\1/g, "$2")+ .replace(/\s+/g, " ")+ .trim();+ if (plain.length <= max) return plain;+ const cut = plain.slice(0, max - 1);+ const space = cut.lastIndexOf(" ");+ return `${(space > max * 0.6 ? cut.slice(0, space) : cut).replace(/[\s,.;:]+$/, "")}…`;+}++/** The items the office may read: only the agent's own session, never whatever else the store holds. */+export function itemsFor(agent: Pick<SocietyAgent, "tier" | "chatSessionId">, activeSessionId: string | null, timeline: Timeline): TimelineItem[] {+ if (agent.tier === "lead") return timeline.items;+ return agent.chatSessionId && agent.chatSessionId === activeSessionId ? timeline.items : [];+}++export function turnBubble(turn: TurnItem, labels: BubbleLabels): Bubble {+ const last = turn.blocks[turn.blocks.length - 1];+ if (turn.status === "running") {+ if (last?.kind === "text" && last.text.trim()) return { kind: "speech", text: bubbleText(last.text, 160), live: true, atMs: turn.startedMs };+ if (last?.kind === "tool") return { kind: "thought", text: labels.tool.replace("{0}", toolLabel(last.name)), live: true, atMs: turn.startedMs };+ const thinking = last?.kind === "reasoning" && last.text.trim() ? bubbleText(last.text.slice(-240), 90) : "";+ return { kind: "thought", text: thinking || labels.thinking, live: true, atMs: turn.startedMs };+ }+ const settled = turn.startedMs + (turn.durationMs ?? 0);+ if (turn.status === "error") return { kind: "error", text: bubbleText(turn.error || labels.failed, 140), live: false, atMs: settled };+ const text = [...turn.blocks].reverse().find((b) => b.kind === "text" && b.text.trim());+ if (text && text.kind === "text") return { kind: "speech", text: bubbleText(text.text), live: false, atMs: settled };+ if (turn.status === "cancelled") return { kind: "thought", text: labels.cancelled, live: false, atMs: settled };+ return { kind: "speech", text: labels.done, live: false, atMs: settled };+}++export interface BubbleLabels { thinking: string; tool: string; failed: string; cancelled: string; done: string; approval: string; waiting: string }++/** What the agent the person talks to shows over its head, from its live chat. */+export function conversationBubble(items: readonly TimelineItem[], pendingApprovals: number, labels: BubbleLabels): Bubble | null {+ if (pendingApprovals > 0) return { kind: "ask", text: labels.approval, live: true, atMs: Date.now() };+ for (let i = items.length - 1; i >= 0; i -= 1) {+ const item = items[i];+ if (item.type === "turn") return turnBubble(item, labels);+ // Sent, and the turn has not started yet: the agent is already mulling it over.+ if (item.type === "user") return { kind: "thought", text: labels.thinking, live: true, atMs: item.tsMs };+ if (item.type === "error") return { kind: "error", text: bubbleText(item.text, 140), live: false, atMs: item.tsMs };+ }+ return null;+}++/**+ * What every other agent thinks out loud, from the tail its desk monitor+ * already polls: working agents think about their current step, waiting+ * agents ask. Idle agents keep quiet — the office must not turn into noise.+ */+export function ambientBubble(state: SocietyAgent["state"], lines: readonly ChatLine[] | undefined, labels: Pick<BubbleLabels, "tool" | "thinking" | "waiting">): Bubble | null {+ const last = lines && lines.length > 0 ? lines[lines.length - 1] : null;+ if (state === "working") {+ if (last?.kind === "tool") return { kind: "thought", text: labels.tool.replace("{0}", bubbleText(last.text, 48)), live: true, atMs: 0 };+ if (last?.kind === "agent") return { kind: "thought", text: bubbleText(last.text, 70), live: true, atMs: 0 };+ return { kind: "thought", text: labels.thinking, live: true, atMs: 0 };+ }+ if (state === "waiting") {+ const asked = lines ? [...lines].reverse().find((l) => l.kind === "agent") : undefined;+ return { kind: "ask", text: asked ? bubbleText(asked.text, 90) : labels.waiting, live: true, atMs: 0 };+ }+ return null;+}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.jsonindex 9eb8aa8bdb..ba77e88e5f 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json@@ -735,7 +735,7 @@"open_agent": "{0} öffnen","overview": "Übersicht","ledger": "Agentenliste",- "help": "WASD / Pfeile laufen · Shift rennt · Boden anklicken zum Hingehen · E interagiert · Ziehen dreht · Scrollen zoomt · M öffnet die Karte",+ "help": "WASD / Pfeile laufen · Shift rennt · Boden anklicken zum Hingehen · E interagiert · T halten zum Sprechen · Ziehen dreht · Scrollen zoomt · M öffnet die Karte","sample": "Beispiel-Agenten – das Backend ist noch nicht erreichbar.","overflow": "Nur die ersten {0} Agenten haben einen Schreibtisch; die Liste zeigt alle.","open_space": "Open Space",@@ -762,7 +762,7 @@"team_gather": "Versammeln","wardrobe_name": "Dein Name","you": "Du",- "wardrobe_body": "Wähle Frisur oder Kopfbedeckung – die Farben kannst du mischen.",+ "wardrobe_body": "Kleide dich oder einen Agenten ein: Outfit, Farben, Frisur und Brille.","wardrobe_shuffle": "Farben mischen","lead_empty": "Noch kein Chef-Agent.","lead_body": "Dein Chef-Agent koordiniert die anderen. Sprich hier mit ihm.",@@ -844,7 +844,78 @@"map_title": "Büroplan","map_hint": "Klicke irgendwohin, um dorthin zu laufen. Esc oder M schließt die Karte.","map_close": "Karte schließen",- "map_aria": "Großer Büroplan. Klicke auf eine Stelle, um dorthin zu laufen."+ "map_aria": "Großer Büroplan. Klicke auf eine Stelle, um dorthin zu laufen.",+ "action_talk": "Sprechen",+ "bubble_thinking": "Denkt nach",+ "bubble_tool": "Nutzt {0}",+ "bubble_failed": "Da ist etwas schiefgelaufen.",+ "bubble_cancelled": "Abgebrochen.",+ "bubble_done": "Erledigt.",+ "bubble_approval": "Ich brauche dein OK.",+ "bubble_waiting": "Wartet auf dich",+ "bubble_listening": "Hört zu",+ "talk_log": "Gespräch mit {0}",+ "talk_empty": "Sag {0}, was zu tun ist – T oder das Mikrofon halten und sprechen, oder tippen.",+ "talk_placeholder": "Nachricht an {0}",+ "talk_hint": "T oder Mikrofon halten zum Sprechen · Enter sendet",+ "talk_listening": "Hört zu – loslassen zum Senden",+ "talk_connecting": "Verbinde mit dem Chat…",+ "talk_mic_start": "Sprechen (halten oder antippen)",+ "talk_mic_stop": "Stoppen und senden",+ "talk_send": "Senden",+ "talk_cancel": "Antwort stoppen",+ "talk_approval": "{0} braucht deine Freigabe, um weiterzumachen.",+ "talk_review": "Im Chat prüfen",+ "talk_tools": "Aktionen auf der Karte",+ "tool_walk": "Hingehen",+ "tool_call": "Rufen",+ "tool_focus": "Zeigen",+ "tool_team": "Team",+ "tool_chat": "Ganzer Chat",+ "wardrobe_who": "Wen einkleiden?",+ "wardrobe_you": "Dich",+ "wardrobe_outfit": "Outfit",+ "wardrobe_colourway": "Farben",+ "wardrobe_hair_colour": "Haarfarbe",+ "wardrobe_skin": "Hautton",+ "wardrobe_eyewear": "Brille",+ "wardrobe_random": "Zufälliger Look",+ "wardrobe_save_agent": "Look für {0} speichern",+ "wardrobe_saved_agent": "{0} trägt jetzt den neuen Look.",+ "wardrobe_save_error": "Der Look konnte nicht gespeichert werden. Deine Änderungen bleiben erhalten – versuch es noch einmal.",+ "wardrobe_sample_hint": "Beispiel-Agenten lassen sich nicht speichern. Lege am Empfang einen echten Agenten an.",+ "outfit_tee": "T-Shirt",+ "outfit_hoodie": "Hoodie",+ "outfit_suit": "Anzug",+ "outfit_leather": "Lederjacke",+ "outfit_vest": "Fleeceweste",+ "outfit_turtleneck": "Rollkragen",+ "outfit_blazer": "Blazer",+ "outfit_quarterzip": "Troyer",+ "colourway_black": "Schwarz",+ "colourway_cognac": "Cognac",+ "colourway_oxblood": "Ochsenblut",+ "colourway_charcoal": "Anthrazit",+ "colourway_navy": "Marine",+ "colourway_tuxedo": "Smoking",+ "colourway_linen": "Leinen",+ "colourway_old_money": "Old Money",+ "colourway_camel": "Camel",+ "colourway_forest": "Waldgrün",+ "colourway_oat": "Hafer",+ "colourway_grey": "Grau",+ "colourway_sage": "Salbei",+ "colourway_white": "Weiß",+ "colourway_green": "Grün",+ "colourway_coral": "Koralle",+ "colourway_cream": "Creme",+ "eyewear_none": "Keine",+ "eyewear_glasses": "Brille",+ "eyewear_shades": "Sonnenbrille",+ "hair_slick": "Zurückgegelt",+ "hair_sidepart": "Seitenscheitel",+ "hair_buzz": "Buzz Cut",+ "hair_ponytail": "Pferdeschwanz"}}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.jsonindex 0a30de46b3..02aa42b039 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json@@ -735,7 +735,7 @@"open_agent": "Open {0}","overview": "Overview","ledger": "Agents list",- "help": "WASD / arrows walk · Shift runs · Click the floor to walk there · E interacts · Drag rotates · Scroll zooms · M opens the map",+ "help": "WASD / arrows walk · Shift runs · Click the floor to walk there · E interacts · Hold T to speak · Drag rotates · Scroll zooms · M opens the map","sample": "Sample agents — the backend is not reachable yet.","overflow": "Only the first {0} agents have a desk; the list shows everyone.","open_space": "Open space",@@ -762,7 +762,7 @@"team_gather": "Gather","wardrobe_name": "Your name","you": "You",- "wardrobe_body": "Pick a hairstyle or hat — colours can be shuffled.",+ "wardrobe_body": "Dress yourself or an agent: outfit, colours, hair and glasses.","wardrobe_shuffle": "Shuffle colours","lead_empty": "No lead agent yet.","lead_body": "Your lead coordinates the other agents. Talk to it here.",@@ -844,7 +844,78 @@"map_title": "Office map","map_hint": "Click anywhere to walk there. Esc or M closes the map.","map_close": "Close map",- "map_aria": "Full office map. Click a spot to walk there."+ "map_aria": "Full office map. Click a spot to walk there.",+ "action_talk": "Talk",+ "bubble_thinking": "Thinking",+ "bubble_tool": "Using {0}",+ "bubble_failed": "Something went wrong.",+ "bubble_cancelled": "Stopped.",+ "bubble_done": "Done.",+ "bubble_approval": "I need your OK.",+ "bubble_waiting": "Waiting for you",+ "bubble_listening": "Listening",+ "talk_log": "Conversation with {0}",+ "talk_empty": "Say what {0} should do — hold T or the microphone and speak, or type.",+ "talk_placeholder": "Message {0}",+ "talk_hint": "Hold T or the microphone to speak · Enter sends",+ "talk_listening": "Listening — release to send",+ "talk_connecting": "Connecting to the chat…",+ "talk_mic_start": "Speak (hold, or tap to start)",+ "talk_mic_stop": "Stop and send",+ "talk_send": "Send",+ "talk_cancel": "Stop the answer",+ "talk_approval": "{0} needs your approval to go on.",+ "talk_review": "Review in the chat",+ "talk_tools": "Map actions",+ "tool_walk": "Go to",+ "tool_call": "Call over",+ "tool_focus": "Show",+ "tool_team": "Team",+ "tool_chat": "Full chat",+ "wardrobe_who": "Who gets dressed?",+ "wardrobe_you": "You",+ "wardrobe_outfit": "Outfit",+ "wardrobe_colourway": "Colours",+ "wardrobe_hair_colour": "Hair colour",+ "wardrobe_skin": "Skin tone",+ "wardrobe_eyewear": "Glasses",+ "wardrobe_random": "Random look",+ "wardrobe_save_agent": "Save look for {0}",+ "wardrobe_saved_agent": "{0} is wearing the new look.",+ "wardrobe_save_error": "Could not save the look. Your changes are kept; try again.",+ "wardrobe_sample_hint": "Sample agents cannot be saved. Create a real agent at reception.",+ "outfit_tee": "T-shirt",+ "outfit_hoodie": "Hoodie",+ "outfit_suit": "Suit",+ "outfit_leather": "Leather jacket",+ "outfit_vest": "Fleece vest",+ "outfit_turtleneck": "Turtleneck",+ "outfit_blazer": "Blazer",+ "outfit_quarterzip": "Quarter-zip",+ "colourway_black": "Black",+ "colourway_cognac": "Cognac",+ "colourway_oxblood": "Oxblood",+ "colourway_charcoal": "Charcoal",+ "colourway_navy": "Navy",+ "colourway_tuxedo": "Tuxedo",+ "colourway_linen": "Linen",+ "colourway_old_money": "Old money",+ "colourway_camel": "Camel",+ "colourway_forest": "Forest green",+ "colourway_oat": "Oat",+ "colourway_grey": "Grey",+ "colourway_sage": "Sage",+ "colourway_white": "White",+ "colourway_green": "Green",+ "colourway_coral": "Coral",+ "colourway_cream": "Cream",+ "eyewear_none": "None",+ "eyewear_glasses": "Glasses",+ "eyewear_shades": "Sunglasses",+ "hair_slick": "Slicked back",+ "hair_sidepart": "Side part",+ "hair_buzz": "Buzz cut",+ "hair_ponytail": "Ponytail"}}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.jsonindex cf3bbf2bf2..d59f0012e7 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json@@ -735,7 +735,7 @@"open_agent": "Abrir {0}","overview": "Vista general","ledger": "Lista de agentes",- "help": "WASD / flechas para andar · Shift corre · Clic en el suelo para ir · E interactúa · Arrastrar gira · Rueda para zoom · M abre el mapa",+ "help": "WASD / flechas para andar · Shift corre · Clic en el suelo para ir · E interactúa · Mantén T para hablar · Arrastrar gira · Rueda para zoom · M abre el mapa","sample": "Agentes de ejemplo: el backend aún no está disponible.","overflow": "Solo los primeros {0} agentes tienen escritorio; la lista muestra a todos.","open_space": "Espacio abierto",@@ -762,7 +762,7 @@"team_gather": "Reunir","wardrobe_name": "Tu nombre","you": "Tú",- "wardrobe_body": "Elige peinado o sombrero; los colores se pueden mezclar.",+ "wardrobe_body": "Viste a tu personaje o a un agente: atuendo, colores, peinado y gafas.","wardrobe_shuffle": "Mezclar colores","lead_empty": "Aún no hay agente líder.","lead_body": "Tu líder coordina a los demás agentes. Habla con él aquí.",@@ -844,7 +844,78 @@"map_title": "Plano de la oficina","map_hint": "Haz clic en cualquier sitio para ir allí. Esc o M cierra el mapa.","map_close": "Cerrar mapa",- "map_aria": "Plano completo de la oficina. Haz clic en un sitio para ir allí."+ "map_aria": "Plano completo de la oficina. Haz clic en un sitio para ir allí.",+ "action_talk": "Hablar",+ "bubble_thinking": "Pensando",+ "bubble_tool": "Usando {0}",+ "bubble_failed": "Algo salió mal.",+ "bubble_cancelled": "Detenido.",+ "bubble_done": "Hecho.",+ "bubble_approval": "Necesito tu visto bueno.",+ "bubble_waiting": "Te está esperando",+ "bubble_listening": "Escuchando",+ "talk_log": "Conversación con {0}",+ "talk_empty": "Dile a {0} qué hacer: mantén T o el micrófono y habla, o escribe.",+ "talk_placeholder": "Mensaje para {0}",+ "talk_hint": "Mantén T o el micrófono para hablar · Enter envía",+ "talk_listening": "Escuchando: suelta para enviar",+ "talk_connecting": "Conectando con el chat…",+ "talk_mic_start": "Hablar (mantén o toca para empezar)",+ "talk_mic_stop": "Detener y enviar",+ "talk_send": "Enviar",+ "talk_cancel": "Detener la respuesta",+ "talk_approval": "{0} necesita tu aprobación para seguir.",+ "talk_review": "Revisar en el chat",+ "talk_tools": "Acciones en el mapa",+ "tool_walk": "Ir",+ "tool_call": "Llamar",+ "tool_focus": "Mostrar",+ "tool_team": "Equipo",+ "tool_chat": "Chat completo",+ "wardrobe_who": "¿A quién vestir?",+ "wardrobe_you": "A ti",+ "wardrobe_outfit": "Atuendo",+ "wardrobe_colourway": "Colores",+ "wardrobe_hair_colour": "Color de pelo",+ "wardrobe_skin": "Tono de piel",+ "wardrobe_eyewear": "Gafas",+ "wardrobe_random": "Look aleatorio",+ "wardrobe_save_agent": "Guardar look para {0}",+ "wardrobe_saved_agent": "{0} ya lleva el nuevo look.",+ "wardrobe_save_error": "No se pudo guardar el look. Tus cambios se conservan; inténtalo de nuevo.",+ "wardrobe_sample_hint": "Los agentes de ejemplo no se pueden guardar. Crea un agente real en recepción.",+ "outfit_tee": "Camiseta",+ "outfit_hoodie": "Sudadera",+ "outfit_suit": "Traje",+ "outfit_leather": "Chaqueta de cuero",+ "outfit_vest": "Chaleco polar",+ "outfit_turtleneck": "Cuello alto",+ "outfit_blazer": "Blazer",+ "outfit_quarterzip": "Media cremallera",+ "colourway_black": "Negro",+ "colourway_cognac": "Coñac",+ "colourway_oxblood": "Burdeos",+ "colourway_charcoal": "Antracita",+ "colourway_navy": "Marino",+ "colourway_tuxedo": "Esmoquin",+ "colourway_linen": "Lino",+ "colourway_old_money": "Old money",+ "colourway_camel": "Camel",+ "colourway_forest": "Verde bosque",+ "colourway_oat": "Avena",+ "colourway_grey": "Gris",+ "colourway_sage": "Salvia",+ "colourway_white": "Blanco",+ "colourway_green": "Verde",+ "colourway_coral": "Coral",+ "colourway_cream": "Crema",+ "eyewear_none": "Ninguna",+ "eyewear_glasses": "Gafas",+ "eyewear_shades": "Gafas de sol",+ "hair_slick": "Hacia atrás",+ "hair_sidepart": "Raya al lado",+ "hair_buzz": "Rapado",+ "hair_ponytail": "Coleta"}}}