// Dashboard view
function Dashboard({ openTask }) {
const G = window.Gastronaut;
const liveActivity = G?.useActivityFeed(mockActivityFeed) || { items: mockActivityFeed, status: "mock" };
const activityFeed = liveActivity.items;
const livePreviews = G?.useAgents(null);
const agentPreviews = (livePreviews && livePreviews.length ? livePreviews : mockAgentPreviews).slice(0, 3);
const liveQuotes = G?.useQuotes();
const kpis = G?.useKpis ? G.useKpis(null) : null;
const now = new Date();
const dateLabel = `Overview · ${now.toLocaleDateString(undefined, { day: "2-digit", month: "short", year: "numeric" })} · ${now.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" })}`;
return (
}
/>
{/* KPI strip — editorial, large numerals */}
{/* Two-column grid */}
{/* Activity stream */}
Live activity
System stream
STREAMING
{activityFeed.map((a, i) => (
))}
{/* Right stack */}
{/* Trading mini widget — with Privacy Fog */}
{/* Today's priorities */}
Today · Charter
Ship the Tadpole landing page
and monitor the Friday gold fix. Maintain an editorial tone in Creative Director outputs.
{["landing-v3", "gold-friday-fix", "content-calendar", "incident-p3"].map(t => (
#{t}
))}
{/* Agent cards row */}
The Team
Sub-agents, by domain
{agentPreviews.map((a) =>
)}
);
}
// --- pieces ---
function Kpi({ label, value, delta, unit, spark, color = "var(--accent)", good = false, live = false }) {
return (
{value}
{delta && (
{delta}
)}
);
}
const mockActivityFeed = [
{ agent: "Market Sentry", color: "gold", action: "Flagged elevated XAG realized vol", time: "2s", detail: "1m vol 38.2% · threshold 35%", level: "warn" },
{ agent: "Creative Director", color: "cyan", action: "Drafted hero copy · landing-v3", time: "28s", detail: "3 variants written · awaiting review", level: "info" },
{ agent: "Research Specialist", color: "cyan", action: "Finished brief: ‘Gastronaut OEM sourcing’", time: "1m", detail: "14 sources · 4 citations pinned", level: "ok" },
{ agent: "Ops Steward", color: "cyan", action: "Rotated VPS backup key", time: "4m", detail: "next rotation · 28 Apr 04:00 UTC", level: "info" },
{ agent: "Market Sentry", color: "gold", action: "Executed paper order · XAU long 0.25", time: "8m", detail: "entry 2,384.10 · stop 2,368.00", level: "info" },
{ agent: "Scribe", color: "cyan", action: "Committed 3 files to claude-code-vps", time: "12m", detail: "feat(sidebar): add pinned agents", level: "ok" },
{ agent: "Research Specialist", color: "cyan", action: "Skimmed 42 papers on agentic evals", time: "19m", detail: "4 relevant · summary queued", level: "info" },
{ agent: "Market Sentry", color: "gold", action: "Daily LBMA fix logged", time: "31m", detail: "AM 2,391.05 · PM pending", level: "info" },
];
function relTime(t) {
if (!t) return "";
const s = Math.max(0, (Date.now() - new Date(t).getTime()) / 1000);
if (s < 1) return "now";
if (s < 60) return `${Math.floor(s)}s`;
if (s < 3600) return `${Math.floor(s / 60)}m`;
if (s < 86400) return `${Math.floor(s / 3600)}h`;
return `${Math.floor(s / 86400)}d`;
}
function ActivityRow({ agent, color, action, time, t, detail, level }) {
const displayTime = time ?? relTime(t);
const dotColor = color === "gold" ? "var(--gold)" : "var(--accent)";
return (
e.currentTarget.style.background = "rgba(255,255,255,0.02)"}
onMouseLeave={(e) => e.currentTarget.style.background = "transparent"}
>
{agent}
·
{action}
{level === "warn" && ALERT}
{detail}
{displayTime} ago
);
}
const mockAgentPreviews = [
{ name: "Market Sentry", role: "Markets & risk", status: "live", color: "gold", load: 0.68, tasks: 4, summary: "Watches XAU/XAG tape, flags regime shifts, runs paper orders only." },
{ name: "Creative Director", role: "Brand & copy", status: "working", color: "cyan", load: 0.42, tasks: 2, summary: "Writes landing pages and product decks in the Gastronaut voice." },
{ name: "Research Specialist", role: "Primary research", status: "live", color: "cyan", load: 0.31, tasks: 3, summary: "Reads widely, cites narrowly. Pins sources; never invents numbers." },
];
function AgentCard({ name, role, status, color, load, tasks, summary }) {
const c = color === "gold" ? "var(--gold)" : "var(--accent)";
return (
{summary}
);
}
// Orb — our signature node
function Orb({ size = 80, color = "var(--accent)", small = false }) {
return (
);
}
// Trading mini widget (dashboard) with privacy fog
function TradingMini({ quotes }) {
const [reveal, setReveal] = useState(false);
const xau = quotes?.XAU || { price: 2384.10, change: 0.42 };
const xag = quotes?.XAG || { price: 28.91, change: -0.18 };
const fmt = (n) => Number(n).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
const pct = (n) => (n >= 0 ? "+" : "") + Number(n).toFixed(2) + "%";
return (
setReveal(true)}
onMouseLeave={() => setReveal(false)}
>
Trading · Spot
XAU · XAG · live tape
= 0}/>
= 0}/>
Astrological transit · Mercury sq. Jupiter · noted, not traded
{!reveal && (
)}
);
}
function MiniQuote({ sym, price, change, up }) {
return (
);
}
window.Dashboard = Dashboard;
window.Orb = Orb;