an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions
HTML agent-harnessagent-orchestrationagentsai-agentsautonomous-agentsclaude-codecodexcoding-agentsdesktop-appdeveloper-toolselectrongemini-cliharnessharness-engineeringlocal-firstmemorymulti-agentopencodeorchestrationtypescript
feat: doing-note on the avatar card + task detail as a floor-wide overlay
Gulume10c83ed36ed
diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsxindex 497a5189..1c8977e6 100644--- a/src/renderer/src/App.tsx+++ b/src/renderer/src/App.tsx@@ -18,6 +18,7 @@ import { Icon } from '@/components/Icon';import { SidebarSplitter } from '@/components/SidebarSplitter';import { acquireTerminal } from '@/components/terminalPool';import { FullscreenTerminal } from '@/components/FullscreenTerminal';+import { TaskDetailOverlay } from '@/components/TaskDetailOverlay';import { FullscreenFileEditor } from '@/components/FullscreenFileEditor';import brandLogo from '@brand/logo.png?url';@@ -261,6 +262,7 @@ export function App() {{fullscreenAgentId && <FullscreenTerminal />}{fullscreenFilePath && <FullscreenFileEditor />}+ <TaskDetailOverlay /></div>);}diff --git a/src/renderer/src/components/AgentCard.tsx b/src/renderer/src/components/AgentCard.tsxindex 115b0353..19473831 100644--- a/src/renderer/src/components/AgentCard.tsx+++ b/src/renderer/src/components/AgentCard.tsx@@ -23,13 +23,18 @@ export interface AgentCardProps {/** The prep assistant. Same size as every other card (no special sizing). */isAssistant?: boolean;onClick?: () => void;+ /** Number of ledger tasks this agent is actively DOING — rendered as a blue+ * sticky note stuck to the card. Clicking it opens the first task's detail. */+ doingCount?: number;+ onTaskNoteClick?: () => void;}const fmtK = (n: number): string => `${Math.round(n / 1000)}k`;export function AgentCard({name, character, accent, status, project, action, progress = 0,- contextTokens, contextLimit, selected, isGod, onClick+ contextTokens, contextLimit, selected, isGod, onClick,+ doingCount = 0, onTaskNoteClick}: AgentCardProps) {// The god is always framed (stands out from the row); others only when selected.const framed = isGod || selected;@@ -40,9 +45,30 @@ export function AgentCard({className="cth-titlebar-nodrag"style={{width: 220, minWidth: 220, height: 96,- padding: 0, border: 'none', background: 'transparent', cursor: 'pointer', textAlign: 'left'+ padding: 0, border: 'none', background: 'transparent', cursor: 'pointer', textAlign: 'left',+ position: 'relative'}}>+ {/* The taken note, stuck to the card like on the desk: this worker is+ actively DOING a ledger task. Click → the task's detail overlay. */}+ {doingCount > 0 && (+ <span+ title={`actively working ${doingCount} task${doingCount === 1 ? '' : 's'} — click to open`}+ onClick={(e) => { e.stopPropagation(); onTaskNoteClick?.(); }}+ style={{+ position: 'absolute', right: -4, bottom: -5, zIndex: 2,+ width: 22, height: 20,+ background: 'var(--cth-sky)',+ boxShadow: 'inset 0 0 0 1px var(--cth-ink-900), 2px 2px 0 rgba(26,19,32,0.25)',+ transform: 'rotate(4deg)',+ display: 'flex', alignItems: 'center', justifyContent: 'center',+ fontFamily: 'var(--cth-font-display)', fontSize: 9, color: 'var(--cth-ink-900)',+ cursor: 'pointer'+ }}+ >+ {doingCount > 1 ? doingCount : '✎'}+ </span>+ )}<PixelPanelvariant={framed ? 'active' : 'default'}accent={framed ? accent : undefined}diff --git a/src/renderer/src/components/AgentStrip.tsx b/src/renderer/src/components/AgentStrip.tsxindex ad27f787..91784abc 100644--- a/src/renderer/src/components/AgentStrip.tsx+++ b/src/renderer/src/components/AgentStrip.tsx@@ -1,4 +1,4 @@-import { useState } from 'react';+import { useEffect, useState } from 'react';import { AgentCard } from './AgentCard';import { PixelButton } from './PixelButton';import { Icon } from './Icon';@@ -17,7 +17,30 @@ export function AgentStrip({ config }: AgentStripProps) {const selectedId = useStore(s => s.selectedId);const select = useStore(s => s.select);const setAddAgentOpen = useStore(s => s.setAddAgentOpen);+ const openTaskDetail = useStore(s => s.openTaskDetail);const [restoring, setRestoring] = useState(false);+ // Each worker's actively-DOING ledger tasks, polled from hive/tasks.json —+ // rendered as a sticky note on the avatar card (click → task detail).+ const [doingByAgent, setDoingByAgent] = useState<Record<string, string[]>>({});+ useEffect(() => {+ let cancelled = false;+ const poll = async () => {+ try {+ const raw = await window.cth.hiveTasks() as { tasks?: Array<{ id?: string; status?: string; assignee?: string }> } | null;+ if (cancelled) return;+ const map: Record<string, string[]> = {};+ for (const t of (raw && Array.isArray(raw.tasks)) ? raw.tasks : []) {+ if (t?.status === 'doing' && typeof t.assignee === 'string' && t.assignee && typeof t.id === 'string') {+ (map[t.assignee] = map[t.assignee] ?? []).push(t.id);+ }+ }+ setDoingByAgent(map);+ } catch { /* keep last good */ }+ };+ void poll();+ const iv = setInterval(() => { void poll(); }, 5000);+ return () => { cancelled = true; clearInterval(iv); };+ }, []);/** Respawn every worker from the previous session with its ORIGINAL agent id,* cwd, model and command — the hive workspace (memory.md, inbox, registry@@ -97,6 +120,11 @@ export function AgentStrip({ config }: AgentStripProps) {isGod={a.isGod}isAssistant={a.isAssistant}onClick={() => select(a.id)}+ doingCount={doingByAgent[a.id]?.length ?? 0}+ onTaskNoteClick={() => {+ const first = doingByAgent[a.id]?.[0];+ if (first) openTaskDetail(first);+ }}/>))}{restorableAgents.length > 0 && (diff --git a/src/renderer/src/components/CommandCenterPanel.tsx b/src/renderer/src/components/CommandCenterPanel.tsxindex 38b8fde5..a9bd4728 100644--- a/src/renderer/src/components/CommandCenterPanel.tsx+++ b/src/renderer/src/components/CommandCenterPanel.tsx@@ -93,10 +93,15 @@ export function CommandCenterPanel({ agent }: { agent: Agent }) {setTab(ccTabRequest.tab as CCTab);}}, [ccTabRequest]);- // A task-card "assign" pre-fills the Floor dispatch box and jumps to it. The- // counter bumps so re-assigning the same card re-seeds the textarea (the seed- // string alone wouldn't change). { seq } makes every assign distinct.+ // A task-detail "assign" pre-fills the Floor dispatch box and jumps to it.+ // Seeded via the store one-shot (the detail overlay lives app-wide now);+ // { seq } makes every assign distinct so identical text re-seeds.const [dispatchSeed, setDispatchSeed] = useState<{ text: string; seq: number }>({ text: '', seq: 0 });+ const dispatchSeedRequest = useStore((s) => s.dispatchSeedRequest);+ useEffect(() => {+ if (!dispatchSeedRequest) return;+ setDispatchSeed({ text: dispatchSeedRequest.text, seq: dispatchSeedRequest.seq });+ }, [dispatchSeedRequest]);// Lifted so the memory-graph tab can jump to a specific agent's memory file.const [selectedMemoryAgent, setSelectedMemoryAgent] = useState<string | null>(null);const updateAgent = useStore((s) => s.updateAgent);@@ -191,14 +196,7 @@ export function CommandCenterPanel({ agent }: { agent: Agent }) {))}{tab === 'floor' && <FloorTab seed={dispatchSeed} />}- {tab === 'tasks' && (- <TasksKanban- onAssign={(prefill) => {- setDispatchSeed((s) => ({ text: prefill, seq: s.seq + 1 }));- setTab('floor');- }}- />- )}+ {tab === 'tasks' && <TasksKanban />}{tab === 'human' && <AskMeTab />}{tab === 'memory' && (<MemoryTab godId={agent.id} who={selectedMemoryAgent ?? undefined} onWho={setSelectedMemoryAgent} />diff --git a/src/renderer/src/components/TaskDetailOverlay.tsx b/src/renderer/src/components/TaskDetailOverlay.tsxnew file mode 100644index 00000000..1e6651ab--- /dev/null+++ b/src/renderer/src/components/TaskDetailOverlay.tsx@@ -0,0 +1,75 @@+import { useCallback, useEffect, useRef, useState } from 'react';+import { useStore } from '@/store/store';+import { TaskDetail, type HiveTask } from './TasksKanban';++/**+ * App-wide host for the task detail: whoever calls store.openTaskDetail(id) —+ * a kanban card, the sticky note on an agent's strip card, a floor prop —+ * gets the SAME big overlay rendered over the office floor. Keeps its own+ * 5s ledger poll so an open detail stays fresh while the god edits cards.+ */++const POLL_MS = 5000;++function parse(raw: unknown): HiveTask[] {+ const list = (raw && typeof raw === 'object' && Array.isArray((raw as { tasks?: unknown }).tasks))+ ? (raw as { tasks: HiveTask[] }).tasks+ : [];+ return list.filter((t) => !!t && typeof t === 'object' && typeof (t as { id?: unknown }).id === 'string');+}++export function TaskDetailOverlay() {+ const taskDetailId = useStore((s) => s.taskDetailId);+ const closeTaskDetail = useStore((s) => s.closeTaskDetail);+ const agents = useStore((s) => s.agents);+ const restorable = useStore((s) => s.restorableAgents);+ const [tasks, setTasks] = useState<HiveTask[]>([]);+ const timer = useRef<ReturnType<typeof setInterval> | null>(null);++ const refresh = useCallback(async () => {+ try { setTasks(parse(await window.cth.hiveTasks())); } catch { /* keep last good */ }+ }, []);++ useEffect(() => {+ if (!taskDetailId) return;+ void refresh();+ timer.current = setInterval(() => { void refresh(); }, POLL_MS);+ return () => { if (timer.current) clearInterval(timer.current); };+ }, [taskDetailId, refresh]);++ if (!taskDetailId) return null;+ const task = tasks.find((t) => t.id === taskDetailId);+ if (!task) return null;++ const nameFor = (id?: string): string | undefined =>+ id ? (agents.find((a) => a.id === id)?.name ?? restorable.find((a) => a.id === id)?.name ?? id) : undefined;++ const move = async (status: HiveTask['status']) => {+ const next = tasks.map((t) => (t.id === task.id ? { ...t, status } : t));+ setTasks(next); // optimistic+ try { await window.cth.hiveWriteTasks(next); } catch { void refresh(); }+ };++ const assign = () => {+ // Route through the Command Center's dispatch box (which mails the god —+ // the human never writes into a worker's inbox directly).+ const st = useStore.getState();+ const god = st.agents.find((a) => a.isGod);+ if (god) st.select(god.id);+ const desc = task.description?.trim() ? task.description.trim() : '(no description)';+ st.requestDispatchSeed(`Task: ${task.title}\nContext: ${desc}\n`);+ st.requestCommandCenterTab('floor');+ closeTaskDetail();+ };++ return (+ <TaskDetail+ task={task}+ all={tasks}+ assigneeName={nameFor(task.assignee)}+ onMove={(s) => void move(s)}+ onAssign={assign}+ onClose={closeTaskDetail}+ />+ );+}diff --git a/src/renderer/src/components/TasksKanban.tsx b/src/renderer/src/components/TasksKanban.tsxindex 76ca1057..88e5cb37 100644--- a/src/renderer/src/components/TasksKanban.tsx+++ b/src/renderer/src/components/TasksKanban.tsx@@ -107,14 +107,15 @@ function parseTasks(raw: unknown): HiveTask[] {* (assignee from the live roster, priority, dependsOn), and "assign" a card —* which pre-fills the Floor tab's dispatch box and switches to it.*/-export function TasksKanban({ onAssign }: { onAssign: (prefill: string) => void }) {+export function TasksKanban() {const agents = useStore((s) => s.agents);const [tasks, setTasks] = useState<HiveTask[]>([]);const [adding, setAdding] = useState(false);// Detail view: cards show just the title — clicking one opens the full- // breakdown (description contract, assignee, deps, controls). Stored as the- // task ID so the 5s poll keeps the open detail fresh.- const [detailId, setDetailId] = useState<string | null>(null);+ // breakdown as an APP-WIDE overlay over the office floor (see+ // TaskDetailOverlay) — the content grows (contracts, deps, human Q&A), so it+ // gets the big stage instead of the narrow side panel.+ const openTaskDetail = useStore((s) => s.openTaskDetail);const timer = useRef<ReturnType<typeof setInterval> | null>(null);const refresh = useCallback(async () => {@@ -137,15 +138,6 @@ export function TasksKanban({ onAssign }: { onAssign: (prefill: string) => voidsetAdding(false);}, [tasks, persist]);- const moveTask = useCallback((id: string, status: Status) => {- persist(tasks.map((t) => (t.id === id ? { ...t, status } : t)));- }, [tasks, persist]);-- const assign = useCallback((t: HiveTask) => {- const desc = t.description?.trim() ? t.description.trim() : '(no description)';- onAssign(`Task: ${t.title}\nContext: ${desc}\n`);- }, [onAssign]);-const restorableAgents = useStore((s) => s.restorableAgents);/** Resolve an assignee id to a display name — falls back to the restorable* roster so a done card keeps its author's name even after that worker's@@ -217,7 +209,7 @@ export function TasksKanban({ onAssign }: { onAssign: (prefill: string) => voidtask={t}accent={col.accent}assigneeName={nameFor(t.assignee)}- onOpen={() => setDetailId(t.id)}+ onOpen={() => openTaskDetail(t.id)}/>))}</div>@@ -225,21 +217,6 @@ export function TasksKanban({ onAssign }: { onAssign: (prefill: string) => void);})}</div>-- {detailId && (() => {- const t = tasks.find((x) => x.id === detailId);- if (!t) return null;- return (- <TaskDetail- task={t}- all={tasks}- assigneeName={nameFor(t.assignee)}- onMove={(s) => moveTask(t.id, s)}- onAssign={() => { assign(t); setDetailId(null); }}- onClose={() => setDetailId(null)}- />- );- })()}</div>);}@@ -294,10 +271,13 @@ function TaskCard({ task, accent, assigneeName, onOpen }: {// ─── Detail view ─────────────────────────────────────────────────────────────// The full breakdown of one task: status, assignee, priority, the complete// description (the god writes 4-part dispatch contracts in there — preserved-// line by line), dependencies resolved to their titles, and the move/assign-// controls that used to crowd every card.+// line by line), dependencies resolved to their titles, the human Q&A trail,+// and the move/assign controls that used to crowd every card. Rendered as an+// APP-WIDE overlay (over the office floor) — this content grows, so it gets+// the big stage instead of the narrow side panel. Exported for App's+// TaskDetailOverlay; opened via the store's openTaskDetail from anywhere.-function TaskDetail({ task, all, assigneeName, onMove, onAssign, onClose }: {+export function TaskDetail({ task, all, assigneeName, onMove, onAssign, onClose }: {task: HiveTask;all: HiveTask[];assigneeName?: string;@@ -314,12 +294,12 @@ function TaskDetail({ task, all, assigneeName, onMove, onAssign, onClose }: {<divonClick={onClose}style={{- position: 'absolute', inset: 0, zIndex: 50,- background: 'rgba(26, 19, 32, 0.55)',- display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 16+ position: 'fixed', inset: 0, zIndex: 280,+ background: 'rgba(26, 19, 32, 0.6)',+ display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 24}}>- <div onClick={(e) => e.stopPropagation()} style={{ width: 460, maxWidth: '94%', maxHeight: '92%', display: 'flex' }}>+ <div onClick={(e) => e.stopPropagation()} style={{ width: 720, maxWidth: '94vw', maxHeight: '90vh', display: 'flex' }}><PixelPanel variant="dialog" title="TASK" noPadding style={{ display: 'flex', flexDirection: 'column', width: '100%', minHeight: 0 }}><div style={{ padding: 14, display: 'flex', flexDirection: 'column', gap: 10, minHeight: 0, overflowY: 'auto' }}>{/* Title under a status-colored bar */}diff --git a/src/renderer/src/store/store.ts b/src/renderer/src/store/store.tsindex 489fc720..33130d99 100644--- a/src/renderer/src/store/store.ts+++ b/src/renderer/src/store/store.ts@@ -151,6 +151,15 @@ interface State {* task board → 'tasks'). `seq` makes repeated identical requests distinct. */ccTabRequest: { tab: string; seq: number } | null;requestCommandCenterTab: (tab: string) => void;+ /** The task whose detail overlay is open (rendered app-wide over the office+ * floor — the card content grows: contracts, deps, the human Q&A trail). */+ taskDetailId: string | null;+ openTaskDetail: (id: string) => void;+ closeTaskDetail: () => void;+ /** One-shot prefill for the Command Center's dispatch box (a task detail's+ * "assign" from anywhere in the app). seq-keyed like ccTabRequest. */+ dispatchSeedRequest: { text: string; seq: number } | null;+ requestDispatchSeed: (text: string) => void;/** Unsent composer drafts, per agent — so switching agents (which remounts the* composer) doesn't eat what the user was typing. */drafts: Record<string, string>;@@ -441,6 +450,12 @@ export const useStore = create<State>((set) => ({ccTabRequest: null,requestCommandCenterTab: (tab) =>set((s) => ({ ccTabRequest: { tab, seq: (s.ccTabRequest?.seq ?? 0) + 1 } })),+ taskDetailId: null,+ openTaskDetail: (id) => set({ taskDetailId: id }),+ closeTaskDetail: () => set({ taskDetailId: null }),+ dispatchSeedRequest: null,+ requestDispatchSeed: (text) =>+ set((s) => ({ dispatchSeedRequest: { text, seq: (s.dispatchSeedRequest?.seq ?? 0) + 1 } })),drafts: {},setDraft: (agentId, text) =>set((s) => ({ drafts: { ...s.drafts, [agentId]: text } })),