A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
feat(web): show reported program status in the Agents panel
RoversXeb37c4d74c42
diff --git a/thinkterm-web/ui/src/AgentsPanel.svelte b/thinkterm-web/ui/src/AgentsPanel.svelteindex 5daec4b9..d2dc8388 100644--- a/thinkterm-web/ui/src/AgentsPanel.svelte+++ b/thinkterm-web/ui/src/AgentsPanel.svelte@@ -11,8 +11,17 @@import SnippetsBar from './SnippetsBar.svelte';import SnippetsList from './SnippetsList.svelte';import { handle } from './client';- import { refreshViews, s, views } from './client.svelte';- import { agentIcon, circleAlert, circleCheck, iconByName, loaderCircle } from './icons';+ import { refreshViews, s, sCount, views } from './client.svelte';+ import {+ agentIcon,+ chevronDown,+ chevronRight,+ circleAlert,+ circleCheck,+ circleX,+ iconByName,+ loaderCircle,+ } from './icons';// The desktop's segmented mode selector. Which tabs exist, which this// browser can open and what each is called are the model's@@ -23,6 +32,26 @@const heading = $derived(tabs.find((tab) => tab.id === active)?.label ?? s('web-agents-title'));const rows = $derived(views.agents.rows);++ // The desktop's state icons (`agent_state_icon`): a spinner for working,+ // amber for waiting, a red cross for an error, a green tick for a result+ // nobody has seen, a muted one for idle; unknown gets none.+ function stateIcon(state: string): string {+ switch (state) {+ case 'working':+ return `<span class="st spin">${loaderCircle}</span>`;+ case 'blocked':+ return `<span class="st alert">${circleAlert}</span>`;+ case 'error':+ return `<span class="st err">${circleX}</span>`;+ case 'done':+ return `<span class="st done">${circleCheck}</span>`;+ case 'idle':+ return `<span class="st idle">${circleCheck}</span>`;+ default:+ return '';+ }+ }const summary = $derived(views.agents.summary);// The mark on the body is what makes the tab row, the canvas and the pane@@ -56,6 +85,16 @@if (mode !== active && handle.client?.set_right_panel(mode)) refreshViews();return;}+ // The sub-tasks' fold line is a target of its own inside the row: it+ // opens or folds the list rather than revealing the pane.+ const fold = target.closest('.fold')?.getAttribute('data-fold');+ if (fold !== null && fold !== undefined) {+ const pane = Number(fold);+ if (!Number.isSafeInteger(pane) || pane < 0) return;+ ev.preventDefault();+ if (handle.client?.agent_toggle_subtasks(pane)) refreshViews();+ return;+ }const raw = target.closest('.ag')?.getAttribute('data-pane');if (raw === null || raw === undefined) return;const pane = Number(raw);@@ -194,14 +233,30 @@<span class="tx"><span class="n">{row.name}{#if row.title !== ''}<span class="d"> · {row.title}</span>{/if}</span><span class="p">{row.state_label}{#if row.place !== ''} · {row.place}{/if}</span>+ <!-- What the program said about itself, as the desktop's panel+ shows it: the waiting reason as a pill before its words, how+ far it got, its sub-tasks. -->+ {#if row.kind !== null || row.said !== null}+ <span class="said" class:err={row.state === 'error'}>{#if row.kind !== null}<span class="kind">{row.kind}</span>{/if}{row.said ?? ''}</span>+ {/if}+ {#if row.progress !== null}+ <span class="bar"><i style="width: {row.progress}%"></i></span>+ {/if}+ {#if row.subtasks_summary !== ''}+ <span class="fold" data-fold={row.pane}>{@html row.subtasks_open ? chevronDown : chevronRight}<span class="sl">{row.subtasks_summary}</span></span>+ {#if row.subtasks_open}+ <span class="subs">+ {#each row.subtasks as sub, i (i)}+ <span class="subt">{@html stateIcon(sub.state)}<span class="sl">{sub.label}</span></span>+ {/each}+ {#if row.more_subtasks > 0}+ <span class="p">{sCount('right-agents-more-subtasks', row.more_subtasks)}</span>+ {/if}+ </span>+ {/if}+ {/if}</span>- {#if row.state === 'working'}- <span class="st spin">{@html loaderCircle}</span>- {:else if row.state === 'blocked'}- <span class="st alert">{@html circleAlert}</span>- {:else if row.state === 'idle'}- <span class="st idle">{@html circleCheck}</span>- {/if}+ {@html stateIcon(row.state)}</div>{/each}</div>diff --git a/thinkterm-web/ui/src/icons.ts b/thinkterm-web/ui/src/icons.tsindex d84591b9..d2e7e1a2 100644--- a/thinkterm-web/ui/src/icons.ts+++ b/thinkterm-web/ui/src/icons.ts@@ -19,6 +19,7 @@ import chevronDown from '../../../third_party/lucide/icons/chevron-down.svg?raw'import chevronRight from '../../../third_party/lucide/icons/chevron-right.svg?raw';import circleAlert from '../../../third_party/lucide/icons/circle-alert.svg?raw';import circleCheck from '../../../third_party/lucide/icons/circle-check.svg?raw';+import circleX from '../../../third_party/lucide/icons/circle-x.svg?raw';import circlePlus from '../../../third_party/lucide/icons/circle-plus.svg?raw';import codeXml from '../../../third_party/lucide/icons/code-xml.svg?raw';import clipboardPaste from '../../../third_party/lucide/icons/clipboard-paste.svg?raw';@@ -113,6 +114,7 @@ export {chevronRight,circleAlert,circleCheck,+ circleX,circlePlus,clipboardPaste,codeXml,@@ -179,6 +181,7 @@ const BY_NAME: Record<string, string> = {'chevron-right': chevronRight,'circle-alert': circleAlert,'circle-check': circleCheck,+ 'circle-x': circleX,'circle-plus': circlePlus,'clipboard-paste': clipboardPaste,copy,diff --git a/thinkterm-web/ui/src/model.ts b/thinkterm-web/ui/src/model.tsindex 4ed638b1..1bf90f64 100644--- a/thinkterm-web/ui/src/model.ts+++ b/thinkterm-web/ui/src/model.ts@@ -175,7 +175,7 @@ export type PaletteOutcome = { handled: boolean; page: string | null; recent: st// The right-hand Agents panel (thinkterm-web/src/agents.rs `AgentRow`,// `AgentsView`): one row per pane an agent runs in, and the line above them.-export type AgentState = 'working' | 'blocked' | 'idle' | 'unknown';+export type AgentState = 'working' | 'blocked' | 'error' | 'done' | 'idle' | 'unknown';export type AgentRow = {pane: number;@@ -192,6 +192,18 @@ export type AgentRow = {place: string;/** `brand-claude`, `brand-copilot` or `bot`. */icon: string;+ /** What the program said about itself (OSC 7501), when it did. */+ kind: string | null;+ said: string | null;+ progress: number | null;+ /** "7 sub-tasks \u00b7 5 working": the one line the sub-tasks fold+ into; empty when there are none. */+ subtasks_summary: string;+ /** Whether that line is open, listing them. */+ subtasks_open: boolean;+ /** While it is open: the sub-tasks listed, and how many more there are. */+ subtasks: { state: AgentState; label: string }[];+ more_subtasks: number;};/** `summary` is the line above the rows; "No agents detected" when empty. */diff --git a/thinkterm-web/ui/src/tokens.css b/thinkterm-web/ui/src/tokens.cssindex 957dd1c7..9131ec54 100644--- a/thinkterm-web/ui/src/tokens.css+++ b/thinkterm-web/ui/src/tokens.css@@ -276,6 +276,25 @@ body[data-side=off]:not([data-mobile]) #side .list { top: var(--tabs); }#agents .st.spin { color: var(--open); }#agents .st.alert { color: var(--warn); }#agents .st.idle { color: var(--muted); }+#agents .st.err { color: var(--danger); }+#agents .st.done { color: var(--done); }+/* What the program reported: its words with the waiting reason as an amber+ pill before them, a progress bar, and its sub-tasks with smaller icons. */+#agents .said { display: flex; align-items: center; gap: 6px; color: var(--text2); line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+#agents .said.err { color: var(--danger); }+#agents .kind { flex: none; padding: 0 8px; border-radius: 999px; line-height: 18px; font-size: 11px; color: var(--warn); background: color-mix(in srgb, var(--warn) 18%, transparent); }+#agents .bar { display: block; height: 3px; border-radius: 2px; background: var(--sep); overflow: hidden; }+#agents .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }+/* The sub-tasks fold to one line that counts them; a click on it opens+ the list under its words, a level in. */+#agents .fold { display: flex; align-items: center; gap: 6px; color: var(--text2); line-height: 20px; min-width: 0; cursor: pointer; }+#agents .fold:hover { color: var(--text); }+#agents .fold svg { flex: none; width: 12px; height: 12px; color: var(--muted); }+#agents .fold .sl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+#agents .subs { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; min-width: 0; }+#agents .subt { display: flex; align-items: center; gap: 6px; color: var(--text2); line-height: 18px; min-width: 0; }+#agents .subt .st, #agents .subt .st svg { width: 12px; height: 12px; }+#agents .subt .sl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }/* A tab of the selector that can be opened lifts under the pointer. */#agents .mode:not(.on):not(.off):hover { color: var(--text); }/* The Snippets tab (SnippetsBar, SnippetsList), as the desktop draws it: