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(deck): the wiki in space, and a HUD frame language for the deck
Haraldc18e443ad7f9
diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckActivityCards.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckActivityCards.tsxindex 0a3a4c2227..9c81fb32e2 100644--- a/jarvis/ui/web/frontend/src/components/deck/DeckActivityCards.tsx+++ b/jarvis/ui/web/frontend/src/components/deck/DeckActivityCards.tsx@@ -5,7 +5,6 @@ import {FolderOpen,Gauge,MessagesSquare,- Notebook,Terminal,} from "lucide-react";import { useEventStore } from "@/store/events";@@ -13,7 +12,6 @@ import { useDeckStore } from "@/store/deck";import { useRuns } from "@/hooks/useRuns";import { useOutputsList, type OutputSummary } from "@/hooks/useOutputs";import { fetchIdeState, fetchTerminalActivity, type IdeState, type ActivityResponse } from "@/lib/agenticIdeApi";-import { fetchWikiGraph, fetchWikiTree } from "@/lib/wikiApi";import { useCommandActivityStore } from "@/store/commandActivity";import type { ThinkingStep } from "@/lib/thinkingSteps";import type { RunListItem } from "@/components/runs/types";@@ -51,6 +49,7 @@ export function FlowCard({ steps, className }: { steps: ThinkingStep[]; classNamtitle={t("deck.card_flow")}meta={active > 0 ? active : undefined}live={active > 0}+ variant="rail"onOpen={() => setActiveSection("run_inspector")}openLabel={t("deck.open_section")}className={className}@@ -138,6 +137,7 @@ export function RunsCard({ className }: { className?: string }) {title={t("deck.card_runs")}meta={runs.data ? runs.data.length : undefined}live={live}+ variant="chamfer"onOpen={() => setActiveSection("run_inspector")}openLabel={t("deck.open_section")}className={className}@@ -192,6 +192,7 @@ export function OutputsCard({ className }: { className?: string }) {title={t("deck.card_outputs")}meta={running > 0 ? running : outputs.data ? outputs.data.length : undefined}live={running > 0}+ variant="chamfer"onOpen={() => setActiveSection("outputs")}openLabel={t("deck.open_section")}className={className}@@ -290,6 +291,7 @@ export function IdeGridCard({ className }: { className?: string }) {: undefined}live={working > 0}+ variant="bracket"onOpen={() => setActiveSection("agentic-ide")}openLabel={t("deck.open_section")}className={className}@@ -373,6 +375,7 @@ export function TerminalsCard({ className }: { className?: string }) {title={t("deck.card_terminals")}meta={running > 0 ? running : undefined}live={running > 0}+ variant="rail"onOpen={() => setActiveSection("clis")}openLabel={t("deck.open_section")}className={className}@@ -393,120 +396,3 @@ export function TerminalsCard({ className }: { className?: string }) {</DeckCard>);}--// -----------------------------------------------------------------------// Wiki — the memory, as a small constellation-// ------------------------------------------------------------------------/**- * A miniature of the wiki graph: real nodes and edges from `/api/wiki/graph`,- * laid out on a deterministic spiral (no physics — the full graph view has- * that; here it would cost a worker for a thumbnail). Pages that changed- * this session glow. Capped so it stays a constellation, not a hairball.- */-const WIKI_NODE_CAP = 90;--export function WikiCard({ className }: { className?: string }) {- const t = useT();- const setActiveSection = useEventStore((s) => s.setActiveSection);- const changes = useDeckStore((s) => s.wikiChanges);- const canvasRef = useRef<HTMLCanvasElement | null>(null);-- const tree = useQuery({ queryKey: ["deck", "wiki-tree"], queryFn: fetchWikiTree, refetchInterval: 60_000, retry: false });- const graph = useQuery({ queryKey: ["deck", "wiki-graph"], queryFn: fetchWikiGraph, refetchInterval: 60_000, retry: false });-- const pages = tree.data?.stats?.total_pages;- const links = tree.data?.stats?.total_links;- const changedSlugs = useMemo(() => new Set(changes.map((c) => c.slug)), [changes]);-- useEffect(() => {- const canvas = canvasRef.current;- const nodes = graph.data?.nodes ?? [];- const edges = graph.data?.edges ?? [];- if (!canvas || nodes.length === 0) return;- const rect = canvas.getBoundingClientRect();- if (rect.width < 10 || rect.height < 10) return;- const dpr = Math.min(2, window.devicePixelRatio || 1);- canvas.width = Math.round(rect.width * dpr);- canvas.height = Math.round(rect.height * dpr);- const ctx = canvas.getContext("2d");- if (!ctx) return;- ctx.setTransform(dpr, 0, 0, dpr, 0, 0);- ctx.clearRect(0, 0, rect.width, rect.height);-- const cs = getComputedStyle(document.documentElement);- const primary = `hsl(${cs.getPropertyValue("--primary").trim()})`;- const muted = `hsl(${cs.getPropertyValue("--muted-foreground").trim()})`;-- // Most-linked pages first, so the cap keeps the hubs.- const degree = new Map<string, number>();- for (const e of edges) {- degree.set(e.source, (degree.get(e.source) ?? 0) + 1);- degree.set(e.target, (degree.get(e.target) ?? 0) + 1);- }- const kept = [...nodes]- .sort((a, b) => (degree.get(b.id) ?? 0) - (degree.get(a.id) ?? 0))- .slice(0, WIKI_NODE_CAP);- const cx = rect.width / 2, cy = rect.height / 2;- const maxR = Math.min(cx, cy) - 6;- const pos = new Map<string, [number, number]>();- kept.forEach((n, i) => {- // Fermat spiral: hubs at the centre, leaves at the rim, evenly spread.- const r = maxR * Math.sqrt((i + 0.5) / kept.length);- const a = i * 2.39996; // golden angle- pos.set(n.id, [cx + r * Math.cos(a), cy + r * Math.sin(a)]);- });-- ctx.lineWidth = 0.6;- ctx.strokeStyle = muted;- ctx.globalAlpha = 0.28;- for (const e of edges) {- const a = pos.get(e.source), b = pos.get(e.target);- if (!a || !b) continue;- ctx.beginPath(); ctx.moveTo(a[0], a[1]); ctx.lineTo(b[0], b[1]); ctx.stroke();- }- ctx.globalAlpha = 1;- for (const n of kept) {- const p = pos.get(n.id);- if (!p) continue;- const hot = changedSlugs.has(n.id);- const d = degree.get(n.id) ?? 0;- ctx.beginPath();- ctx.arc(p[0], p[1], hot ? 3 : Math.min(2.6, 1 + d * 0.15), 0, Math.PI * 2);- ctx.fillStyle = hot ? primary : muted;- ctx.globalAlpha = hot ? 1 : 0.7;- ctx.fill();- if (hot) {- ctx.beginPath(); ctx.arc(p[0], p[1], 6, 0, Math.PI * 2);- ctx.strokeStyle = primary; ctx.globalAlpha = 0.45; ctx.lineWidth = 1; ctx.stroke();- }- }- ctx.globalAlpha = 1;- }, [graph.data, changedSlugs]);-- return (- <DeckCard- icon={Notebook}- title={t("deck.card_wiki")}- meta={typeof pages === "number" ? `${pages}${typeof links === "number" ? ` · ${links}` : ""}` : undefined}- live={changes.length > 0}- onOpen={() => setActiveSection("memory")}- openLabel={t("deck.open_section")}- className={className}- bodyClassName="p-0"- >- {graph.isError || (graph.data && graph.data.ok === false) ? (- <p className="px-2.5 py-2 text-[11px] text-muted-foreground">{t("deck.unavailable")}</p>- ) : (- <div className="relative h-full min-h-[5rem] w-full">- <canvas ref={canvasRef} className="absolute inset-0 h-full w-full" aria-hidden />- {changes.length > 0 && (- <div className="absolute bottom-1 left-2 right-2 truncate font-mono text-[9px] text-primary">- {changes.slice(0, 3).map((c) => c.slug).join(" · ")}- </div>- )}- </div>- )}- </DeckCard>- );-}diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckCard.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckCard.tsxindex 2daf33dd25..19c01c1912 100644--- a/jarvis/ui/web/frontend/src/components/deck/DeckCard.tsx+++ b/jarvis/ui/web/frontend/src/components/deck/DeckCard.tsx@@ -1,19 +1,21 @@import type { ReactNode } from "react";import type { LucideIcon } from "lucide-react";import { ArrowUpRight } from "lucide-react";+import { HudFrameOverlay, HudLamp, useElementSize, type HudVariant } from "@/components/deck/HudFrame";import { cn } from "@/lib/utils";/**- * One panel on the deck.+ * One instrument on the deck.** Deliberately NOT a filled box: the app's convention (index.css, "Frontend* theming") is that the wallpaper shines through untinted and the stage's- * text halo keeps ink readable on it. So a card is a hairline, an eyebrow- * that names it in plain words, and its content — nothing that could hide- * the artwork behind a slab.+ * text halo keeps ink readable on it. So a card is a HUD frame (see+ * HudFrame.tsx — bracket, chamfer or rail, chosen per card so the stage does+ * not read as a grid of identical rectangles), a title strip in plain words+ * with a status lamp, and its content.*- * `onOpen` makes the whole eyebrow a jump into the section the card is a- * window onto; the arrow says so.+ * `onOpen` makes the title a jump into the section the card is a window onto;+ * `actions` sits at the right of the strip (expand, centre, …).*/export function DeckCard({icon: Icon,@@ -22,6 +24,8 @@ export function DeckCard({onOpen,openLabel,live,+ variant = "chamfer",+ actions,className,bodyClassName,children,@@ -32,62 +36,98 @@ export function DeckCard({meta?: ReactNode;onOpen?: () => void;openLabel?: string;- /** Something is happening in here right now — the eyebrow lights up. */+ /** Something is happening in here right now — the frame and lamp light up. */live?: boolean;+ variant?: HudVariant;+ /** Extra controls at the right of the title strip. */+ actions?: ReactNode;className?: string;bodyClassName?: string;children: ReactNode;}) {+ const [ref, size] = useElementSize<HTMLElement>();+const head = (<>+ <HudLamp on={Boolean(live)} /><Icon className={cn("h-3 w-3 shrink-0", live ? "text-primary" : "text-muted-foreground")} /><spanclassName={cn("truncate font-mono text-[10px] uppercase tracking-[0.2em]",- live ? "text-primary" : "text-muted-foreground",+ live ? "text-primary" : "text-foreground/80",)}>{title}</span>{meta !== undefined && (- <span className="ml-auto shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground">+ <span className="ml-1 shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground">{meta}</span>)}{onOpen && (- <ArrowUpRight- className={cn(- "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100",- meta === undefined && "ml-auto",- )}- />+ <ArrowUpRight className="ml-auto h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover/card:opacity-100" />)}</>);return (<section- className={cn(- "group/card flex min-h-0 flex-col rounded-lg border border-border/70",- live && "border-primary/40",- className,- )}+ ref={ref}+ className={cn("group/card relative flex min-h-0 flex-col", variant === "rail" ? "pl-2" : "", className)}>- {onOpen ? (- <button- type="button"- onClick={onOpen}- title={openLabel}- className="flex w-full items-center gap-2 border-b border-border/60 px-2.5 py-1.5 text-left transition-colors hover:bg-primary/5"- >- {head}- </button>- ) : (- <div className="flex items-center gap-2 border-b border-border/60 px-2.5 py-1.5">{head}</div>- )}- <div className={cn("min-h-0 flex-1 overflow-hidden px-2.5 py-2", bodyClassName)}>+ <HudFrameOverlay variant={variant} w={size.w} h={size.h} live={live} />++ <div className="relative flex items-center gap-1.5 px-2.5 py-1.5">+ {onOpen ? (+ <button+ type="button"+ onClick={onOpen}+ title={openLabel}+ className="flex min-w-0 flex-1 items-center gap-1.5 text-left transition-colors hover:[&_span]:text-primary"+ >+ {head}+ </button>+ ) : (+ <div className="flex min-w-0 flex-1 items-center gap-1.5">{head}</div>+ )}+ {actions && <div className="ml-auto flex shrink-0 items-center gap-1">{actions}</div>}+ </div>++ <div className={cn("relative min-h-0 flex-1 overflow-hidden px-2.5 pb-2", bodyClassName)}>{children}</div></section>);}++/** A small square control for the title strip (expand, centre, close). */+export function DeckIconButton({+ icon: Icon,+ label,+ onClick,+ active,+ className,+}: {+ icon: LucideIcon;+ label: string;+ onClick: () => void;+ active?: boolean;+ className?: string;+}) {+ return (+ <button+ type="button"+ onClick={onClick}+ title={label}+ aria-label={label}+ className={cn(+ "flex h-5 w-5 items-center justify-center border border-border/70 text-muted-foreground transition-colors",+ "hover:border-primary/60 hover:text-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/60",+ active && "border-primary/60 text-primary",+ className,+ )}+ >+ <Icon className="h-3 w-3" />+ </button>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsxindex 42d3d48a11..4a3e082ed2 100644--- a/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx+++ b/jarvis/ui/web/frontend/src/components/deck/DeckOrb.tsx@@ -6,28 +6,35 @@ import type { ThinkingStep } from "@/lib/thinkingSteps";import { cn } from "@/lib/utils";/**- * The centre of the deck: the voice orb with the mascot inside it, ringed by- * one arc per running step.+ * The centre of the deck: the voice orb with the mascot inside it, set in a+ * reticle — a dial ring, corner brackets, one bright arc per running step,+ * and four small readouts at the compass points.** The orb is the app's own (`agentic/VoiceOrb`), driven by the real voice* state — it breathes, listens and speaks the way it does everywhere else in- * the product, so the deck's centre is recognisably the assistant and not a- * new mascot. The mascot sits on top of it; the arcs are the deck's addition:- * every active reasoning step (a tool, a worker, a look at the screen) is one- * bright arc, so parallel work is visible as parallel arcs.- *- * Motion only while something runs. An idle orb still breathes (that is the- * VoiceOrb's own idle), but the sweep and the arcs stop.+ * the product, so the deck's centre is recognisably the assistant. The+ * reticle is the deck's addition, and every part of it carries information:+ * the arcs are parallel work made visible, the sweep turns only while+ * something runs, the readouts are live values the caller sources.*/+export interface OrbReadouts {+ nw: string;+ ne: string;+ sw: string;+ se: string;+}+export function DeckOrb({steps,busy,- size = 260,+ size = 240,+ readouts,className,}: {steps: ThinkingStep[];busy: boolean;size?: number;+ readouts?: OrbReadouts;className?: string;}) {const voiceState = useEventStore((s) => s.voiceState);@@ -36,7 +43,6 @@ export function DeckOrb({[],);- // A slow sweep that only turns while something runs.const [sweep, setSweep] = useState(0);const raf = useRef<number | null>(null);useEffect(() => {@@ -54,7 +60,7 @@ export function DeckOrb({}, [busy, reduced]);const R = size / 2;- const orbSize = Math.round(size * 0.62);+ const orbSize = Math.round(size * 0.58);const point = (deg: number, r: number): [number, number] => {const rad = ((deg - 90) * Math.PI) / 180;return [R + r * Math.cos(rad), R + r * Math.sin(rad)];@@ -64,27 +70,38 @@ export function DeckOrb({const span = 320 / Math.max(1, all.length);const a0 = -160 + i * span + 3;const a1 = a0 + span - 6;- const [x0, y0] = point(a0, R * 0.86);- const [x1, y1] = point(a1, R * 0.86);+ const [x0, y0] = point(a0, R * 0.84);+ const [x1, y1] = point(a1, R * 0.84);return {id: step.id,- d: `M ${x0} ${y0} A ${R * 0.86} ${R * 0.86} 0 ${a1 - a0 > 180 ? 1 : 0} 1 ${x1} ${y1}`,+ d: `M ${x0} ${y0} A ${R * 0.84} ${R * 0.84} 0 ${a1 - a0 > 180 ? 1 : 0} 1 ${x1} ${y1}`,note: step.kind === "note",};});- const [sx, sy] = point(sweep, R * 0.95);- const [ex, ey] = point(sweep + 36, R * 0.95);+ const [sx, sy] = point(sweep, R * 0.94);+ const [ex, ey] = point(sweep + 36, R * 0.94);+ const B = 16; // bracket armreturn (<div className={cn("relative shrink-0", className)} style={{ width: size, height: size }}><svg viewBox={`0 0 ${size} ${size}`} className="absolute inset-0 h-full w-full" aria-hidden>- {/* Scale ring: 60 ticks, brighter every 15° — a dial, not a decoration:- it is what the arcs and the sweep are read against. */}- {Array.from({ length: 60 }, (_, i) => {- const deg = i * 6;- const [ax, ay] = point(deg, R * 0.72);- const [bx, by] = point(deg, R * 0.76);+ {/* corner brackets — the reticle's bounds */}+ {[+ `M 0.5 ${B} V 0.5 H ${B}`,+ `M ${size - B} 0.5 H ${size - 0.5} V ${B}`,+ `M ${size - 0.5} ${size - B} V ${size - 0.5} H ${size - B}`,+ `M ${B} ${size - 0.5} H 0.5 V ${size - B}`,+ ].map((d) => (+ <path key={d} d={d} fill="none" stroke="hsl(var(--primary))" strokeWidth={1.5} opacity={0.6} />+ ))}++ {/* outer dial: 72 ticks, long every 15° */}+ {Array.from({ length: 72 }, (_, i) => {+ const deg = i * 5;+ const long = i % 3 === 0;+ const [ax, ay] = point(deg, R * 0.94);+ const [bx, by] = point(deg, R * (long ? 0.885 : 0.91));return (<linekey={deg}@@ -94,19 +111,30 @@ export function DeckOrb({y2={by}stroke="hsl(var(--primary))"strokeWidth={1}- opacity={i % 5 === 0 ? 0.45 : 0.14}+ opacity={long ? 0.5 : 0.18}/>);})}+ {/* crosshair ticks at the compass points, outside the dial */}+ {[0, 90, 180, 270].map((deg) => {+ const [ax, ay] = point(deg, R * 0.96);+ const [bx, by] = point(deg, R * 1.0);+ return <line key={deg} x1={ax} y1={ay} x2={bx} y2={by} stroke="hsl(var(--primary))" strokeWidth={1.5} opacity={0.7} />;+ })}++ {/* inner scale ring around the orb */}+ <circle cx={R} cy={R} r={R * 0.84} fill="none" stroke="hsl(var(--border))" strokeWidth={1} opacity={0.7} /><circlecx={R}cy={R}- r={R * 0.86}+ r={R * 0.66}fill="none"- stroke="hsl(var(--border))"+ stroke="hsl(var(--primary))"strokeWidth={1}- opacity={0.6}+ strokeDasharray="2 6"+ opacity={0.35}/>+{arcs.map((a) => (<pathkey={a.id}@@ -114,18 +142,18 @@ export function DeckOrb({fill="none"stroke={a.note ? "hsl(var(--muted-foreground))" : "hsl(var(--primary))"}strokeWidth={3}- strokeLinecap="round"- opacity={0.9}+ strokeLinecap="butt"+ opacity={0.95}/>))}{busy && !reduced && (<path- d={`M ${sx} ${sy} A ${R * 0.95} ${R * 0.95} 0 0 1 ${ex} ${ey}`}+ d={`M ${sx} ${sy} A ${R * 0.94} ${R * 0.94} 0 0 1 ${ex} ${ey}`}fill="none"stroke="hsl(var(--primary))"- strokeWidth={1.5}- strokeLinecap="round"- opacity={0.55}+ strokeWidth={2}+ strokeLinecap="butt"+ opacity={0.6}/>)}</svg>@@ -134,10 +162,32 @@ export function DeckOrb({<div className="relative" style={{ width: orbSize, height: orbSize }}><VoiceOrb state={voiceState} size={orbSize} className="absolute inset-0" /><div className="absolute inset-0 grid place-items-center">- <MascotGigi size={Math.round(orbSize * 0.42)} reactToVoice enableComments={false} />+ <MascotGigi size={Math.round(orbSize * 0.46)} reactToVoice enableComments={false} /></div></div></div>++ {readouts && (+ <>+ <Readout className="left-1 top-1 text-left" text={readouts.nw} />+ <Readout className="right-1 top-1 text-right" text={readouts.ne} />+ <Readout className="bottom-1 left-1 text-left" text={readouts.sw} />+ <Readout className="bottom-1 right-1 text-right" text={readouts.se} />+ </>+ )}</div>);}++function Readout({ text, className }: { text: string; className?: string }) {+ return (+ <span+ className={cn(+ "pointer-events-none absolute max-w-[42%] truncate px-1.5 font-mono text-[9px] uppercase tracking-[0.16em] text-primary/90",+ className,+ )}+ >+ {text}+ </span>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckSignalCards.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckSignalCards.tsxindex 15f4734469..aee471a4d2 100644--- a/jarvis/ui/web/frontend/src/components/deck/DeckSignalCards.tsx+++ b/jarvis/ui/web/frontend/src/components/deck/DeckSignalCards.tsx@@ -4,6 +4,7 @@ import { useEventStore } from "@/store/events";import { useDeckStore } from "@/store/deck";import { countWords } from "@/lib/deckState";import { DeckCard } from "@/components/deck/DeckCard";+import { HudGauge, HudLamp } from "@/components/deck/HudFrame";import { cn } from "@/lib/utils";import { useT } from "@/i18n";@@ -36,6 +37,7 @@ export function ComputerUseCard({ className }: { className?: string }) {title={t("deck.card_cu")}meta={cu.active ? `#${cu.stepIdx}` : cu.frames > 0 ? t("deck.cu_done") : undefined}live={cu.active}+ variant="bracket"onOpen={() => setActiveSection("run_inspector")}openLabel={t("deck.open_section")}className={className}@@ -66,20 +68,30 @@ export function ComputerUseCard({ className }: { className?: string }) {</div>{/* Phase strip: observe → plan → act → verify. */}- <div className="flex items-center gap-1 border-t border-border/60 px-2 py-1">- {CU_PHASES.map((ph) => (- <span- key={ph}- className={cn(- "flex-1 truncate text-center font-mono text-[8px] uppercase tracking-wider",- cu.active && cu.phase === ph- ? "text-primary"- : "text-muted-foreground/70",- )}- >- {ph}- </span>- ))}+ <div className="flex items-stretch gap-px border-t border-border/60 px-2 py-1">+ {CU_PHASES.map((ph, i) => {+ const on = cu.active && cu.phase === ph;+ const passed = cu.active && (CU_PHASES as readonly string[]).indexOf(cu.phase) > i;+ return (+ <span+ key={ph}+ className={cn(+ "flex flex-1 flex-col items-center gap-0.5 font-mono text-[8px] uppercase tracking-wider",+ on ? "text-primary" : "text-muted-foreground/70",+ )}+ >+ <span+ className={cn(+ "h-1 w-full",+ on ? "bg-primary shadow-[0_0_6px_hsl(var(--primary)/0.7)]" : passed ? "bg-primary/40" : "bg-border",+ )}+ style={{ clipPath: "polygon(0 0, calc(100% - 3px) 0, 100% 100%, 3px 100%)" }}+ aria-hidden+ />+ <span className="truncate">{ph}</span>+ </span>+ );+ })}</div>{(cu.lastActionKind || cu.windowTitle) && (<div className="flex items-center gap-2 border-t border-border/60 px-2 py-1 font-mono text-[10px]">@@ -146,6 +158,7 @@ export function AppShotCard({ className }: { className?: string }) {title={t("deck.card_shot")}meta={fresh && capture ? `${capture.width}×${capture.height}` : undefined}live={Boolean(fresh)}+ variant="bracket"className={className}bodyClassName="p-0">@@ -199,15 +212,24 @@ export function ApiStatsCard({ className }: { className?: string }) {const usage = useDeckStore((s) => s.usage);const setActiveSection = useEventStore((s) => s.setActiveSection);const models = useMemo(- () => Object.entries(usage.byModel).sort((a, b) => b[1].costUsd - a[1].costUsd || b[1].turns - a[1].turns).slice(0, 4),+ () => Object.entries(usage.byModel).sort((a, b) => b[1].costUsd - a[1].costUsd || b[1].turns - a[1].turns).slice(0, 3),[usage.byModel],);+ const total = usage.tokensIn + usage.tokensOut;+ // Gauge scales are honest and self-referential: the token gauge shows the+ // OUTPUT share of everything sent and received (a real ratio), the cost+ // gauge shows this session against one US dollar — a fixed, stated scale,+ // not a budget the app pretends to know.+ const outShare = total > 0 ? usage.tokensOut / total : 0;+ const costOfDollar = Math.min(1, usage.costUsd / 1);return (<DeckCardicon={Coins}title={t("deck.card_api")}meta={usage.turns > 0 ? `${usage.turns} ${t("deck.turns")}` : undefined}+ live={usage.lastTurnTs !== null && Date.now() - usage.lastTurnTs < 15_000}+ variant="chamfer"onOpen={() => setActiveSection("apikeys")}openLabel={t("deck.open_section")}className={className}@@ -215,30 +237,32 @@ export function ApiStatsCard({ className }: { className?: string }) {{usage.turns === 0 ? (<p className="text-[11px] text-muted-foreground">{t("deck.api_empty")}</p>) : (- <div className="flex h-full flex-col gap-2">- <div className="grid grid-cols-3 gap-2">- <Stat label={t("deck.api_in")} value={fmtTokens(usage.tokensIn)} />- <Stat label={t("deck.api_out")} value={fmtTokens(usage.tokensOut)} />- <Stat label={t("deck.api_cost")} value={fmtUsd(usage.costUsd)} hot />+ <div className="flex h-full min-h-0 items-center gap-3">+ <HudGauge value={outShare} size={62} label={t("deck.api_out")} readout={fmtTokens(total)} />+ <HudGauge value={costOfDollar} size={62} label={t("deck.api_cost")} readout={fmtUsd(usage.costUsd)} />+ <div className="flex min-w-0 flex-1 flex-col gap-1">+ <div className="grid grid-cols-2 gap-x-3">+ <Stat label={t("deck.api_in")} value={fmtTokens(usage.tokensIn)} />+ <Stat label={t("deck.api_out")} value={fmtTokens(usage.tokensOut)} />+ </div>+ {models.length > 0 && (+ <ul className="space-y-0.5 border-t border-border/60 pt-1">+ {models.map(([name, m]) => (+ <li key={name} className="flex items-center gap-2 font-mono text-[9.5px]">+ <HudLamp on={name === usage.lastModel} />+ <span className="min-w-0 flex-1 truncate text-foreground">{name}</span>+ <span className="shrink-0 tabular-nums text-muted-foreground">{m.turns}×</span>+ <span className="shrink-0 tabular-nums text-primary">{fmtUsd(m.costUsd)}</span>+ </li>+ ))}+ </ul>+ )}+ {usage.lastCacheHit && (+ <span className="font-mono text-[9px] uppercase tracking-wider text-emerald-400">+ {t("deck.api_cache_hit")}+ </span>+ )}</div>- {models.length > 0 && (- <ul className="space-y-0.5 border-t border-border/60 pt-1.5">- {models.map(([name, m]) => (- <li key={name} className="flex items-center gap-2 font-mono text-[10px]">- <span className="min-w-0 flex-1 truncate text-foreground">{name}</span>- <span className="shrink-0 tabular-nums text-muted-foreground">- {m.turns}× · {fmtTokens(m.tokensIn + m.tokensOut)}- </span>- <span className="shrink-0 tabular-nums text-primary">{fmtUsd(m.costUsd)}</span>- </li>- ))}- </ul>- )}- {usage.lastCacheHit && (- <span className="font-mono text-[9px] uppercase tracking-wider text-emerald-400">- {t("deck.api_cache_hit")}- </span>- )}</div>)}</DeckCard>@@ -297,7 +321,11 @@ export function LiveCounter({ className }: { className?: string }) {const listening = voiceState === "listening";return (- <div className={cn("flex items-baseline gap-3", className)}>+ <div+ className={cn("relative flex items-baseline gap-2.5 border border-border/70 px-3 py-1", className)}+ style={{ clipPath: "polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px)" }}+ >+ <HudLamp on={listening} className="self-center" /><spanclassName={cn("font-mono text-2xl font-semibold tabular-nums leading-none transition-colors",diff --git a/jarvis/ui/web/frontend/src/components/deck/DeckWiki.tsx b/jarvis/ui/web/frontend/src/components/deck/DeckWiki.tsxnew file mode 100644index 0000000000..651a3d49fc--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/deck/DeckWiki.tsx@@ -0,0 +1,294 @@+import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";+import { createPortal } from "react-dom";+import { useQuery } from "@tanstack/react-query";+import { Crosshair, Maximize2, Minimize2, Notebook, X } from "lucide-react";+import type { NodeObject } from "react-force-graph-3d";+import { useEventStore } from "@/store/events";+import { useDeckStore } from "@/store/deck";+import { fetchWikiTree } from "@/lib/wikiApi";+import { toGraphData, type RenderEdge, type RenderNode, type WikiGraphPayload } from "@/lib/wikiGraph";+import { detectWebgl } from "@/lib/graphDimension";+import { edgeDetails, escapeTooltipText, nodeDetails } from "@/components/wiki/WikiGraph";+import { DeckCard, DeckIconButton } from "@/components/deck/DeckCard";+import { HudLamp, useElementSize } from "@/components/deck/HudFrame";+import { cn } from "@/lib/utils";+import { useT } from "@/i18n";++/**+ * The wiki on the deck — the vault's memory map, in space.+ *+ * This is the SAME scene the Wiki section draws (`components/wiki/WikiGraph3D`):+ * the same request, the same nodes, colours and size rule, the same ambient+ * orbit. The deck adds three things a front page needs: it fits into a card+ * and keeps working there, it can expand to the whole window on one click,+ * and pages that changed this session glow so the newest memory is the one+ * the eye lands on.+ *+ * The WebGL scene is the largest dependency in the app; it is loaded lazily+ * so the deck paints first and the network fades in a moment later. A machine+ * without WebGL gets the flat map instead — degraded honestly, never blank.+ *+ * Only ONE scene is ever mounted: while the expanded overlay is open, the card+ * shows a placeholder, so there is one WebGL context and one orbit.+ */+const WikiGraph3D = lazy(() =>+ import("@/components/wiki/WikiGraph3D").then((m) => ({ default: m.WikiGraph3D })),+);+const WikiGraph2D = lazy(() =>+ import("@/components/wiki/WikiGraph").then((m) => ({ default: m.WikiGraph })),+);++const GRAPH_QUERY_KEY = ["wiki", "graph"] as const; // shared with the Wiki section's map++async function fetchGraph(): Promise<WikiGraphPayload> {+ const res = await fetch("/api/wiki/graph");+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ return res.json();+}++/**+ * The scene itself, sized to its container. Shared by the card and the+ * expanded overlay so both are literally the same map.+ */+function DeckWikiScene({+ graphData,+ highlightSlug,+ resetSignal,+ onNodeClick,+ className,+}: {+ graphData: { nodes: RenderNode[]; links: RenderEdge[] };+ highlightSlug?: string;+ resetSignal: number;+ onNodeClick: (slug: string) => void;+ className?: string;+}) {+ const t = useT();+ const [ref, size] = useElementSize<HTMLDivElement>();+ const webgl = useMemo(() => detectWebgl(), []);++ const titles = useMemo(+ () => new Map(graphData.nodes.map((n) => [n.id, n.title])),+ [graphData.nodes],+ );+ const tRef = useRef(t);+ tRef.current = t;+ const nodeLabel = useCallback(+ (node: NodeObject<RenderNode>) => escapeTooltipText(nodeDetails(node as RenderNode, tRef.current)),+ [],+ );+ const linkLabel = useCallback(+ (link: RenderEdge) => escapeTooltipText(edgeDetails(link, titles)),+ [titles],+ );++ const ready = size.w > 20 && size.h > 20;++ return (+ <div ref={ref} className={cn("relative h-full w-full overflow-hidden", className)}>+ {ready && (+ <Suspense+ fallback={+ <div className="flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.2em] text-muted-foreground">+ {t("wiki_graph.loading_3d")}+ </div>+ }+ >+ {webgl ? (+ <WikiGraph3D+ graphData={graphData}+ width={size.w}+ height={size.h}+ highlightSlug={highlightSlug}+ onNodeClick={onNodeClick}+ resetSignal={resetSignal}+ nodeLabel={nodeLabel}+ linkLabel={linkLabel}+ />+ ) : (+ <WikiGraph2D onNodeClick={onNodeClick} highlightSlug={highlightSlug} />+ )}+ </Suspense>+ )}+ </div>+ );+}++export function WikiCard({ className }: { className?: string }) {+ const t = useT();+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ const requestWikiPage = useEventStore((s) => s.requestWikiPage);+ const changes = useDeckStore((s) => s.wikiChanges);+ const [expanded, setExpanded] = useState(false);+ const [resetTick, setResetTick] = useState(0);++ const graph = useQuery({ queryKey: GRAPH_QUERY_KEY, queryFn: fetchGraph, staleTime: 30_000, retry: false });+ const tree = useQuery({ queryKey: ["deck", "wiki-tree"], queryFn: fetchWikiTree, refetchInterval: 60_000, retry: false });++ const graphData = useMemo(() => {+ if (!graph.data?.ok) return { nodes: [] as RenderNode[], links: [] as RenderEdge[] };+ return toGraphData(graph.data);+ }, [graph.data]);++ const pages = tree.data?.stats?.total_pages ?? graphData.nodes.length;+ const links = tree.data?.stats?.total_links ?? graphData.links.length;+ const highlightSlug = changes[0]?.slug;++ const openPage = useCallback(+ (slug: string) => {+ requestWikiPage(slug);+ setActiveSection("memory");+ },+ [requestWikiPage, setActiveSection],+ );++ // Esc closes the expanded map — the one keyboard promise an overlay makes.+ useEffect(() => {+ if (!expanded) return;+ const onKey = (e: KeyboardEvent) => {+ if (e.key === "Escape") setExpanded(false);+ };+ window.addEventListener("keydown", onKey);+ return () => window.removeEventListener("keydown", onKey);+ }, [expanded]);++ const empty = graph.isError || (graph.data && graph.data.ok === false) || graphData.nodes.length === 0;++ return (+ <>+ <DeckCard+ icon={Notebook}+ title={t("deck.card_wiki")}+ meta={`${pages} · ${links}`}+ live={changes.length > 0}+ variant="bracket"+ onOpen={() => setActiveSection("memory")}+ openLabel={t("deck.open_section")}+ actions={+ <>+ <DeckIconButton icon={Crosshair} label={t("wiki_graph.center")} onClick={() => setResetTick((n) => n + 1)} />+ <DeckIconButton icon={Maximize2} label={t("deck.wiki_expand")} onClick={() => setExpanded(true)} />+ </>+ }+ className={className}+ bodyClassName="p-0"+ >+ {empty ? (+ <p className="px-2.5 py-2 text-[11px] text-muted-foreground">+ {graph.isLoading ? t("wiki_graph.loading_3d") : t("deck.unavailable")}+ </p>+ ) : expanded ? (+ <div className="flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.2em] text-muted-foreground">+ {t("deck.wiki_expanded_note")}+ </div>+ ) : (+ <DeckWikiScene+ graphData={graphData}+ highlightSlug={highlightSlug}+ resetSignal={resetTick}+ onNodeClick={openPage}+ />+ )}+ {changes.length > 0 && !expanded && (+ <div className="pointer-events-none absolute bottom-1.5 left-2.5 right-2.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-primary">+ <HudLamp on />+ <span className="truncate">{changes.slice(0, 3).map((c) => c.slug).join(" · ")}</span>+ </div>+ )}+ </DeckCard>++ {expanded &&+ createPortal(+ <WikiExpanded+ graphData={graphData}+ highlightSlug={highlightSlug}+ pages={pages}+ links={links}+ recent={changes.map((c) => c.slug)}+ onClose={() => setExpanded(false)}+ onOpenSection={() => {+ setExpanded(false);+ setActiveSection("memory");+ }}+ onNodeClick={(slug) => {+ setExpanded(false);+ openPage(slug);+ }}+ />,+ document.body,+ )}+ </>+ );+}++/**+ * The map at the whole window. A HUD overlay, not a modal dialog: a thin+ * bracket frame, a title strip with the counts, and the scene — the wallpaper+ * still shows through the WebGL background the way it does everywhere else.+ */+function WikiExpanded({+ graphData,+ highlightSlug,+ pages,+ links,+ recent,+ onClose,+ onOpenSection,+ onNodeClick,+}: {+ graphData: { nodes: RenderNode[]; links: RenderEdge[] };+ highlightSlug?: string;+ pages: number;+ links: number;+ recent: string[];+ onClose: () => void;+ onOpenSection: () => void;+ onNodeClick: (slug: string) => void;+}) {+ const t = useT();+ const [resetTick, setResetTick] = useState(0);+ return (+ <div+ role="dialog"+ aria-modal="true"+ aria-label={t("deck.card_wiki")}+ className="fixed inset-0 z-[60] flex flex-col bg-background/80 backdrop-blur-sm"+ >+ <div className="flex items-center gap-3 border-b border-primary/40 px-4 py-2">+ <HudLamp on />+ <Notebook className="h-3.5 w-3.5 text-primary" />+ <span className="font-mono text-[11px] uppercase tracking-[0.22em] text-primary">+ {t("deck.card_wiki")}+ </span>+ <span className="font-mono text-[10px] tabular-nums text-muted-foreground">+ {pages} {t("deck.wiki_pages")} · {links} {t("deck.wiki_links")}+ </span>+ {recent.length > 0 && (+ <span className="ml-2 truncate font-mono text-[10px] text-primary">+ {t("deck.wiki_recent")}: {recent.slice(0, 4).join(" · ")}+ </span>+ )}+ <div className="ml-auto flex items-center gap-1.5">+ <DeckIconButton icon={Crosshair} label={t("wiki_graph.center")} onClick={() => setResetTick((n) => n + 1)} />+ <button+ type="button"+ onClick={onOpenSection}+ className="border border-border/70 px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.14em] text-muted-foreground transition-colors hover:border-primary/60 hover:text-primary"+ >+ {t("deck.open_section")}+ </button>+ <DeckIconButton icon={Minimize2} label={t("deck.wiki_collapse")} onClick={onClose} />+ <DeckIconButton icon={X} label={t("deck.close")} onClick={onClose} />+ </div>+ </div>+ <div className="relative min-h-0 flex-1">+ <DeckWikiScene+ graphData={graphData}+ highlightSlug={highlightSlug}+ resetSignal={resetTick}+ onNodeClick={onNodeClick}+ />+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/deck/HudFrame.tsx b/jarvis/ui/web/frontend/src/components/deck/HudFrame.tsxnew file mode 100644index 0000000000..5009e0b1bb--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/deck/HudFrame.tsx@@ -0,0 +1,282 @@+import { useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from "react";+import { cn } from "@/lib/utils";++/**+ * The deck's frame language — what makes a card read as an instrument on a+ * mission deck rather than a box on a web page.+ *+ * Three silhouettes, chosen per card so the stage is not a grid of identical+ * rectangles (the maintainer's complaint of 2026-08-17):+ *+ * - `bracket` — no full border. Four corner brackets and faint edges between+ * them. The lightest frame; for pictures and anything that should float.+ * - `chamfer` — a full hairline outline with the top-right and bottom-left+ * corners cut, and a tick ruler along the bottom. For readouts and lists.+ * - `rail` — a bright left rail with tick marks and a faint top rule. For+ * scrolling streams (the reasoning trace, terminals).+ *+ * All of it is ONE SVG overlay drawn from the measured size, so the strokes+ * stay hairlines at any width, take their colour from theme tokens (gold on+ * both grounds), and never hide the artwork behind the card. Nothing here is+ * decorative for its own sake: the tick rulers give the eye a scale, the+ * corner brackets say "this is a bounded instrument", the lamp says whether+ * it is live.+ */+export type HudVariant = "bracket" | "chamfer" | "rail";+export type HudTone = "primary" | "destructive" | "muted";++export function useElementSize<T extends HTMLElement>(): [RefObject<T>, { w: number; h: number }] {+ const ref = useRef<T>(null);+ const [size, setSize] = useState({ w: 0, h: 0 });+ useLayoutEffect(() => {+ const el = ref.current;+ if (!el) return;+ const measure = () => {+ const r = el.getBoundingClientRect();+ setSize((s) =>+ Math.abs(s.w - r.width) < 1 && Math.abs(s.h - r.height) < 1 ? s : { w: r.width, h: r.height },+ );+ };+ measure();+ if (typeof ResizeObserver === "undefined") return;+ const ro = new ResizeObserver(measure);+ ro.observe(el);+ return () => ro.disconnect();+ }, []);+ return [ref, size];+}++const CUT = 10; // px — chamfer size+const BRACKET = 14; // px — corner bracket arm length+const TICK_STEP = 24; // px — ruler tick spacing++function ticksAlong(length: number, step = TICK_STEP): number[] {+ const out: number[] = [];+ for (let x = step; x < length - step / 2; x += step) out.push(x);+ return out;+}++function toneStroke(tone: HudTone): string {+ if (tone === "destructive") return "hsl(var(--destructive))";+ if (tone === "muted") return "hsl(var(--muted-foreground))";+ return "hsl(var(--primary))";+}++export function HudFrameOverlay({+ variant,+ w,+ h,+ live,+ tone = "primary",+}: {+ variant: HudVariant;+ w: number;+ h: number;+ live?: boolean;+ tone?: HudTone;+}) {+ if (w < 4 || h < 4) return null;+ const stroke = toneStroke(tone);+ const faint = "hsl(var(--border))";+ const main = live ? 0.95 : 0.55;++ return (+ <svg+ className="pointer-events-none absolute inset-0 h-full w-full"+ viewBox={`0 0 ${w} ${h}`}+ preserveAspectRatio="none"+ aria-hidden+ >+ {variant === "bracket" && (+ <>+ {[+ `M 0.5 ${BRACKET} V 0.5 H ${BRACKET}`,+ `M ${w - BRACKET} 0.5 H ${w - 0.5} V ${BRACKET}`,+ `M ${w - 0.5} ${h - BRACKET} V ${h - 0.5} H ${w - BRACKET}`,+ `M ${BRACKET} ${h - 0.5} H 0.5 V ${h - BRACKET}`,+ ].map((d) => (+ <path key={d} d={d} fill="none" stroke={stroke} strokeWidth={1.5} opacity={main} />+ ))}+ <path d={`M ${BRACKET + 4} 0.5 H ${w - BRACKET - 4}`} stroke={faint} strokeWidth={1} opacity={0.7} />+ <path d={`M ${BRACKET + 4} ${h - 0.5} H ${w - BRACKET - 4}`} stroke={faint} strokeWidth={1} opacity={0.5} />+ </>+ )}++ {variant === "chamfer" && (+ <>+ <path+ d={`M 0.5 0.5 H ${w - CUT} L ${w - 0.5} ${CUT} V ${h - 0.5} H ${CUT} L 0.5 ${h - CUT} Z`}+ fill="none"+ stroke={stroke}+ strokeWidth={1}+ opacity={main}+ />+ <path d={`M ${w - CUT} 0.5 L ${w - 0.5} ${CUT}`} stroke={stroke} strokeWidth={2} opacity={0.9} />+ <path d={`M ${CUT} ${h - 0.5} L 0.5 ${h - CUT}`} stroke={stroke} strokeWidth={2} opacity={0.9} />+ {ticksAlong(w).map((x) => (+ <line+ key={x}+ x1={x}+ y1={h - 1}+ x2={x}+ y2={h - (x % (TICK_STEP * 4) === 0 ? 6 : 3)}+ stroke={stroke}+ strokeWidth={1}+ opacity={0.35}+ />+ ))}+ </>+ )}++ {variant === "rail" && (+ <>+ <line x1={1} y1={0} x2={1} y2={h} stroke={stroke} strokeWidth={2} opacity={main} />+ {ticksAlong(h, 18).map((y) => (+ <line+ key={y}+ x1={2}+ y1={y}+ x2={y % 72 === 0 ? 9 : 5}+ y2={y}+ stroke={stroke}+ strokeWidth={1}+ opacity={0.4}+ />+ ))}+ <path d={`M 2 0.5 H ${w - 0.5}`} stroke={faint} strokeWidth={1} opacity={0.7} />+ <path d={`M ${w - 0.5} 0.5 V ${Math.min(h, 22)}`} stroke={stroke} strokeWidth={1} opacity={0.6} />+ </>+ )}+ </svg>+ );+}++/** A tiny square status lamp — the deck's "is this live" idiom. */+export function HudLamp({+ on,+ tone = "primary",+ className,+}: {+ on: boolean;+ tone?: HudTone;+ className?: string;+}) {+ return (+ <span+ aria-hidden+ className={cn(+ "inline-block h-1.5 w-1.5 shrink-0",+ on+ ? tone === "destructive"+ ? "bg-destructive shadow-[0_0_6px_1px_hsl(var(--destructive)/0.6)]"+ : "bg-primary shadow-[0_0_6px_1px_hsl(var(--primary)/0.6)]"+ : "bg-muted-foreground/40",+ className,+ )}+ />+ );+}++/**+ * An arc gauge — the deck's way to show one bounded quantity at a glance.+ * `value` in 0..1; the readout in the middle is the caller's, and it must be+ * a real number: a gauge with an invented value is worse than no gauge.+ */+export function HudGauge({+ value,+ size = 64,+ label,+ readout,+ className,+}: {+ value: number;+ size?: number;+ label: string;+ readout: string;+ className?: string;+}) {+ const v = Math.max(0, Math.min(1, value));+ const r = size / 2 - 4;+ const c = size / 2;+ const start = -135;+ const sweep = 270;+ const point = (deg: number, rad: number): [number, number] => {+ const a = ((deg - 90) * Math.PI) / 180;+ return [c + rad * Math.cos(a), c + rad * Math.sin(a)];+ };+ const [sx, sy] = point(start, r);+ const [ex, ey] = point(start + sweep, r);+ const [vx, vy] = point(start + sweep * v, r);+ const ticks = Array.from({ length: 10 }, (_, i) => start + (sweep * i) / 9);+ return (+ <div className={cn("flex flex-col items-center", className)}>+ <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} aria-hidden>+ <path+ d={`M ${sx} ${sy} A ${r} ${r} 0 1 1 ${ex} ${ey}`}+ fill="none"+ stroke="hsl(var(--border))"+ strokeWidth={3}+ />+ {v > 0.005 && (+ <path+ d={`M ${sx} ${sy} A ${r} ${r} 0 ${sweep * v > 180 ? 1 : 0} 1 ${vx} ${vy}`}+ fill="none"+ stroke="hsl(var(--primary))"+ strokeWidth={3}+ />+ )}+ {ticks.map((deg) => {+ const [ax, ay] = point(deg, r - 6);+ const [bx, by] = point(deg, r - 9);+ return (+ <line+ key={deg}+ x1={ax}+ y1={ay}+ x2={bx}+ y2={by}+ stroke="hsl(var(--muted-foreground))"+ strokeWidth={1}+ opacity={0.6}+ />+ );+ })}+ <text+ x={c}+ y={c + 4}+ textAnchor="middle"+ className="fill-foreground font-mono"+ style={{ fontSize: size * 0.2 }}+ >+ {readout}+ </text>+ </svg>+ <span className="mt-0.5 font-mono text-[9px] uppercase tracking-[0.16em] text-muted-foreground">+ {label}+ </span>+ </div>+ );+}++/** Measures itself and draws the frame overlay behind its children. */+export function HudFrame({+ variant,+ live,+ tone,+ className,+ children,+}: {+ variant: HudVariant;+ live?: boolean;+ tone?: HudTone;+ className?: string;+ children: ReactNode;+}) {+ const [ref, size] = useElementSize<HTMLDivElement>();+ return (+ <div ref={ref} className={cn("relative", className)}>+ <HudFrameOverlay variant={variant} w={size.w} h={size.h} live={live} tone={tone} />+ {children}+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/components/wiki/WikiGraph.tsx b/jarvis/ui/web/frontend/src/components/wiki/WikiGraph.tsxindex 8e30b8ffd2..6d7c31064e 100644--- a/jarvis/ui/web/frontend/src/components/wiki/WikiGraph.tsx+++ b/jarvis/ui/web/frontend/src/components/wiki/WikiGraph.tsx@@ -67,7 +67,7 @@ async function fetchGraph(): Promise<WikiGraphPayload> {return res.json();}-function escapeTooltipText(value: string): string {+export function escapeTooltipText(value: string): string {return value.replace(/&/g, "&").replace(/</g, "<")@@ -76,7 +76,7 @@ function escapeTooltipText(value: string): string {.replace(/'/g, "'");}-function nodeDetails(node: RenderNode, t: (key: string) => string): string {+export function nodeDetails(node: RenderNode, t: (key: string) => string): string {const backlinks = node.backlinkCount ?? 0;const suffix = t(backlinks === 1 ? "wiki_graph.backlink_one" : "wiki_graph.backlink_many",@@ -88,7 +88,7 @@ function nodeDetails(node: RenderNode, t: (key: string) => string): string {.replace("{3}", suffix);}-function edgeDetails(+export function edgeDetails(edge: RenderEdge,titles: ReadonlyMap<string, string>,): string {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 3ef4325b50..8185d52348 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -4331,11 +4331,11 @@"deck": {"sections": "Sektionen","running": "Läuft gerade",- "running_empty": "Nichts läuft. Sag dein Wake-Word oder tippe unten.",+ "running_empty": "Nichts läuft. Sag dein Wake-Word.","thinking_now": "Denkt gerade","thinking_starting": "Startet…",- "idle_headline": "Bereit. Sag dein Wake-Word oder tippe einfach los.",- "warming": "Startet gerade. Tippen geht schon, sprechen gleich.",+ "idle_headline": "Bereit. Sag dein Wake-Word.",+ "warming": "Startet gerade. Sprechen geht gleich.","mood_ready": "bereit","mood_busy": "arbeitet","mood_listening": "hört zu",@@ -4375,6 +4375,19 @@"words_live": "Wörter · live","words_session": "Wörter · Sitzung","words_today": "{0} heute",- "mood_speaking": "spricht"+ "mood_speaking": "spricht",+ "wiki_expand": "Karte vergrößern",+ "wiki_collapse": "Karte verkleinern",+ "close": "Schließen",+ "wiki_expanded_note": "Karte ist vergrößert",+ "wiki_pages": "Seiten",+ "wiki_links": "Links",+ "wiki_recent": "Gerade geändert",+ "lamp_link": "Link",+ "lamp_voice": "Stimme",+ "lamp_brain": "Hirn",+ "lamp_cu": "Steuerung",+ "orb_steps": "Schritte",+ "orb_words": "Wörter"}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex efd01b0ad0..10f5a52a8d 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -4331,11 +4331,11 @@"deck": {"sections": "Sections","running": "Running now",- "running_empty": "Nothing running. Say your wake word or type below.",+ "running_empty": "Nothing running. Say your wake word.","thinking_now": "Thinking","thinking_starting": "Starting…",- "idle_headline": "Ready. Say your wake word, or just type.",- "warming": "Starting up. You can already type — speaking works in a moment.",+ "idle_headline": "Ready. Say your wake word.",+ "warming": "Starting up. Speaking works in a moment.","mood_ready": "ready","mood_busy": "working","mood_listening": "listening",@@ -4375,6 +4375,19 @@"words_live": "words · live","words_session": "words · session","words_today": "{0} today",- "mood_speaking": "speaking"+ "mood_speaking": "speaking",+ "wiki_expand": "Expand map",+ "wiki_collapse": "Shrink map",+ "close": "Close",+ "wiki_expanded_note": "Map is expanded",+ "wiki_pages": "pages",+ "wiki_links": "links",+ "wiki_recent": "Just changed",+ "lamp_link": "link",+ "lamp_voice": "voice",+ "lamp_brain": "brain",+ "lamp_cu": "control",+ "orb_steps": "steps",+ "orb_words": "words"}}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex bb0e1bf057..7f8211aed1 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -4331,11 +4331,11 @@"deck": {"sections": "Secciones","running": "En marcha",- "running_empty": "Nada en marcha. Di tu palabra de activación o escribe abajo.",+ "running_empty": "Nada en marcha. Di tu palabra de activación.","thinking_now": "Pensando","thinking_starting": "Empezando…",- "idle_headline": "Listo. Di tu palabra de activación o simplemente escribe.",- "warming": "Arrancando. Ya puedes escribir; hablar funcionará enseguida.",+ "idle_headline": "Listo. Di tu palabra de activación.",+ "warming": "Arrancando. Hablar funcionará enseguida.","mood_ready": "listo","mood_busy": "trabajando","mood_listening": "escuchando",@@ -4375,6 +4375,19 @@"words_live": "palabras · en vivo","words_session": "palabras · sesión","words_today": "{0} hoy",- "mood_speaking": "hablando"+ "mood_speaking": "hablando",+ "wiki_expand": "Ampliar mapa",+ "wiki_collapse": "Reducir mapa",+ "close": "Cerrar",+ "wiki_expanded_note": "El mapa está ampliado",+ "wiki_pages": "páginas",+ "wiki_links": "enlaces",+ "wiki_recent": "Recién cambiado",+ "lamp_link": "enlace",+ "lamp_voice": "voz",+ "lamp_brain": "cerebro",+ "lamp_cu": "control",+ "orb_steps": "pasos",+ "orb_words": "palabras"}}diff --git a/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsxindex c890c548dc..98a6ab1054 100644--- a/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx+++ b/jarvis/ui/web/frontend/src/views/MissionDeckView.tsx@@ -1,16 +1,17 @@import { useMemo, type ReactNode } from "react";import { useEventStore, type VoiceState } from "@/store/events";+import { useDeckStore } from "@/store/deck";import { VoiceWaveform, type WaveformPhase } from "@/components/overlay/VoiceWaveform";import { voiceInputLevelRef } from "@/lib/voiceInputLevel";import { DeckDock } from "@/components/deck/DeckDock";import { DeckOrb } from "@/components/deck/DeckOrb";+import { HudLamp } from "@/components/deck/HudFrame";import {FlowCard,IdeGridCard,OutputsCard,RunsCard,TerminalsCard,- WikiCard,} from "@/components/deck/DeckActivityCards";import {ApiStatsCard,@@ -18,6 +19,7 @@ import {ComputerUseCard,LiveCounter,} from "@/components/deck/DeckSignalCards";+import { WikiCard } from "@/components/deck/DeckWiki";import { useVoiceReadiness } from "@/hooks/useVoiceReadiness";import { writeDeckMode } from "@/lib/deckMode";import { cn } from "@/lib/utils";@@ -29,21 +31,23 @@ import { useT } from "@/i18n";* One stage that shows everything the assistant is and does, without a* single navigation step. You talk to it by voice; the typed composer lives* on the classic chat surface, not here (maintainer decision 2026-08-18).- * The layout follows the maintainer's sketch of 2026-08-17:+ * The layout follows the maintainer's sketch of 2026-08-17 (photographed+ * rotated; read upright):*- * ┌ voice bars · live word counter ───────────────── name · brain · switch ┐- * │ dock │ flow / runs ORB computer-use / api stats │- * │ │ ide grid terminals · wiki app-shot / outputs │- * └──────┴─────────────────────────────────────────────────────────────────┘+ * ┌ voice bars · lamps · live counter ─────────── name · brain · switch ┐+ * │ dock │ [right now] [computer use][api] [ WIKI — 3D, tall ] │+ * │ │ ( ORB ) [ ] │+ * │ │ [outputs][run] [app shot] [terminals] [ide grid] │+ * └──────┴───────────────────────────────────────────────────────────────┘** Every card is a window onto a section and reads that section's own data;- * clicking its eyebrow jumps there. The dock on the left is the ONLY place- * the sections are listed — the sidebar steps aside while the deck is up- * (App.tsx), so nothing appears twice.+ * its title jumps there. The dock on the left is the ONLY place the sections+ * are listed — the sidebar steps aside while the deck is up (App.tsx).*- * Nothing on this screen is invented. A number the store cannot source is- * not shown, because a deck whose figures are decorative teaches the person- * reading it to stop.+ * The frames differ on purpose (HudFrame.tsx): brackets for pictures and the+ * map, chamfers for readouts, rails for streams — a deck of instruments, not+ * a grid of identical boxes. Nothing on this screen is invented: a number the+ * store cannot source is not shown.*/export function MissionDeckView({headerAccessory,@@ -56,11 +60,14 @@ export function MissionDeckView({const brainProvider = useEventStore((s) => s.brainProvider);const brainModel = useEventStore((s) => s.brainModel);const connected = useEventStore((s) => s.connected);+ const voiceReady = useEventStore((s) => s.voiceReady);const voiceState = useEventStore((s) => s.voiceState);const chatThinking = useEventStore((s) => s.chatThinking);const thinkingSteps = useEventStore((s) => s.thinkingSteps);const messages = useEventStore((s) => s.messages);const setActiveSection = useEventStore((s) => s.setActiveSection);+ const cuActive = useDeckStore((s) => s.cu.active);+ const wordsSession = useDeckStore((s) => s.wordsSession);const { warming } = useVoiceReadiness();const running = useMemo(@@ -93,8 +100,9 @@ export function MissionDeckView({return (<div className="flex h-full min-h-0 flex-col">- {/* Header strip: voice bars + live counter left, identity + brain right. */}- <header className="flex flex-wrap items-center gap-x-5 gap-y-2 border-b border-border/70 px-4 py-2">+ {/* Status bar: voice bars, lamps and the live counter left; identity,+ brain and the surface switch right. A thin bracket rule underneath. */}+ <header className="relative flex flex-wrap items-center gap-x-5 gap-y-2 px-4 py-2"><div className="flex items-center gap-3"><VoiceWaveformlevelRef={voiceInputLevelRef}@@ -102,12 +110,25 @@ export function MissionDeckView({count={14}className="h-6"/>- <span className="font-mono text-[10px] uppercase tracking-[0.18em] text-primary">+ <span+ className={cn(+ "font-mono text-[10px] uppercase tracking-[0.18em]",+ mood === "fail" ? "text-destructive" : "text-primary",+ )}+ >{t(`deck.mood_${mood}`)}</span></div>- <LiveCounter className="ml-2" />+ {/* Lamp row: the things that have to be true for a voice turn. */}+ <div className="flex items-center gap-3 font-mono text-[9px] uppercase tracking-[0.14em] text-muted-foreground">+ <Lamp on={connected} label={t("deck.lamp_link")} />+ <Lamp on={voiceReady} label={t("deck.lamp_voice")} />+ <Lamp on={Boolean(brainProvider)} label={t("deck.lamp_brain")} />+ <Lamp on={cuActive} label={t("deck.lamp_cu")} />+ </div>++ <LiveCounter /><div className="ml-auto flex flex-wrap items-center gap-x-5 gap-y-1"><span className="font-display text-sm font-bold uppercase tracking-[0.18em]">@@ -126,49 +147,78 @@ export function MissionDeckView({/>{headerAccessory}</div>++ <svg+ className="pointer-events-none absolute inset-x-3 bottom-0 h-2 w-[calc(100%-1.5rem)]"+ preserveAspectRatio="none"+ viewBox="0 0 100 8"+ aria-hidden+ >+ <path+ d="M 0 0 V 8 M 0 7.5 H 100 M 100 0 V 8"+ fill="none"+ stroke="hsl(var(--primary))"+ strokeWidth={1}+ opacity={0.5}+ vectorEffect="non-scaling-stroke"+ />+ </svg></header>- {/* Stage: dock on the left edge, cards around the orb. */}+ {/* Stage */}<div className="flex min-h-0 flex-1">- <DeckDock className="border-r border-border/60" />+ <DeckDock />- <div className="grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-y-auto p-3 lg:grid-cols-[minmax(200px,3fr)_minmax(0,6fr)_minmax(200px,3fr)] lg:grid-rows-[minmax(0,1fr)_minmax(0,0.85fr)] lg:overflow-hidden">- {/* Row 1 — left: flow over runs */}+ <div className="grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-y-auto p-3 lg:grid-cols-[minmax(200px,3fr)_minmax(0,6fr)_minmax(240px,4fr)] lg:grid-rows-[minmax(0,1fr)_minmax(0,0.6fr)] lg:overflow-hidden">+ {/* LEFT top: what is happening right now */}+ <FlowCard steps={thinkingSteps} className="min-h-0" />++ {/* CENTRE top: computer use + api on a strip, the orb underneath */}<div className="flex min-h-0 flex-col gap-3">- <FlowCard steps={thinkingSteps} className="min-h-0 flex-1" />- <RunsCard className="max-h-[38%] shrink-0" />+ <div className="grid shrink-0 grid-cols-2 gap-3" style={{ height: "36%" }}>+ <ComputerUseCard className="min-h-0" />+ <ApiStatsCard className="min-h-0" />+ </div>+ <div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-2 text-center">+ <DeckOrb+ steps={running}+ busy={busy}+ size={236}+ readouts={{+ nw: t(`deck.mood_${mood}`),+ ne: `${running.length} ${t("deck.orb_steps")}`,+ sw: brainProvider || "—",+ se: `${wordsSession} ${t("deck.orb_words")}`,+ }}+ />+ <p className="max-w-[44ch] text-pretty text-sm leading-relaxed text-foreground">+ {headline}+ </p>+ </div></div>- {/* Row 1 — centre: the orb and the headline */}- <div className="flex min-h-0 flex-col items-center justify-center gap-3 px-2 text-center">- <DeckOrb steps={running} busy={busy} size={250} />- <p className="max-w-[46ch] text-pretty text-sm leading-relaxed text-foreground">- {headline}- </p>- </div>+ {/* RIGHT top: the wiki, in space, tall */}+ <WikiCard className="min-h-0" />- {/* Row 1 — right: computer use over api stats */}- <div className="flex min-h-0 flex-col gap-3">- <ComputerUseCard className="min-h-0 flex-1" />- <ApiStatsCard className="shrink-0" />+ {/* LEFT bottom: outputs and runs */}+ <div className="grid min-h-[8rem] grid-cols-2 gap-3">+ <OutputsCard className="min-h-0" />+ <RunsCard className="min-h-0" /></div>- {/* Row 2 — left: the coding workspace, shrunk */}- <IdeGridCard className="min-h-[9rem]" />-- {/* Row 2 — centre: terminals and the wiki side by side */}- <div className="grid min-h-[9rem] grid-cols-1 gap-3 sm:grid-cols-[3fr_2fr]">- <TerminalsCard className="min-h-0" />- <WikiCard className="min-h-0" />+ {/* CENTRE bottom: the last capture, centred and not too wide */}+ <div className="flex min-h-[8rem] items-stretch justify-center">+ <AppShotCard className="w-full max-w-[28rem]" /></div>- {/* Row 2 — right: the last capture over the outputs */}- <div className="flex min-h-[9rem] flex-col gap-3">- <AppShotCard className="min-h-0 flex-1" />- <OutputsCard className="max-h-[48%] shrink-0" />+ {/* RIGHT bottom: terminals and the coding workspace */}+ <div className="grid min-h-[8rem] grid-cols-2 gap-3">+ <TerminalsCard className="min-h-0" />+ <IdeGridCard className="min-h-0" /></div></div></div>+</div>);}@@ -193,6 +243,15 @@ function waveformPhase(state: VoiceState, connected: boolean): WaveformPhase {}}+function Lamp({ on, label }: { on: boolean; label: string }) {+ return (+ <span className="flex items-center gap-1">+ <HudLamp on={on} />+ <span className={on ? "text-foreground/80" : undefined}>{label}</span>+ </span>+ );+}+function HeaderStat({label,value,@@ -250,7 +309,8 @@ export function SurfaceSwitch({onChange(next);}}title={label}- className="flex items-center gap-1.5 rounded-lg border border-border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary"+ className="flex items-center gap-1.5 border border-border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.12em] text-muted-foreground transition-colors hover:border-primary/50 hover:text-primary"+ style={{ clipPath: "polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px)" }}>{label}</button>