Documentation
¶
Overview ¶
Package ui renders the muster web UI with gomponents. It is dark-first (the document root carries the `dark` class), mobile-first, and driven by htmx + the htmx SSE extension so the pending-request list stays live without a custom client framework.
All request-derived content (commands, context output, project/host names) is treated as untrusted-ish and HTML-escaped by gomponents' Text/Textf nodes. Only the static, author-controlled scaffolding uses Raw.
Index ¶
- Constants
- Variables
- func AgentChatDraftKey(user int64, agent string, session int64) string
- func AgentDetailPage(v AgentDetailView, feat Features) g.Node
- func AgentHeaderPath(id int64) string
- func AgentListHref(name string, sessionID int64) string
- func AgentPath(name string) string
- func AgentSendPath(name string) string
- func AgentSessionHref(name string, sessionID int64) string
- func AgentTerminalDraftKey(user int64, agent string) string
- func AgentTerminalPage(v AgentTerminalView) g.Node
- func AgentTerminalPath(name string) string
- func AskerAsksBlock(inner, src string, viaHTMX bool) g.Node
- func AskerAsksHeading(n string) string
- func AskerAsksList(items string, n int) string
- func AskerAsksLive(src string) g.Node
- func AsksGroupLabel(id, label string, n int) string
- func AttentionBadgeHTML(n int) string
- func AttentionLiveScript(listID, src, event string) string
- func AwaitingApprovalBadge() g.Node
- func CCQueued(list []string) g.Node
- func ChatLogBody(v AgentDetailView) ([]byte, string, error)
- func ChatMessageHTML(role, content string) string
- func ChiefArchivePath(agentID, sid int64, archived bool) string
- func ChiefContextPath(name string, sid int64) string
- func ChiefFreshPrimaryPath(agentID int64) string
- func ChiefPanel() g.Node
- func ChiefPanelToggle() g.Node
- func ChiefSideChatButton(agentID int64, surface ChatSurface) g.Node
- func ChiefSideChatPath(agentID int64) string
- func ClampComposeBody(s string) string
- func ComposePage(feat Features, body string) g.Node
- func ComposeURL(body string) string
- func ConnectorForm(f ConnectorFormView) g.Node
- func ConnectorRequests(list []ConnectorRequestView) g.Node
- func ConnectorRotateForm(name, errMsg string) g.Node
- func Connectors(c ConnectorsContent) g.Node
- func ConnectorsPanel(active bool) g.Node
- func DictateControlHTML(path, inputID, noteID, buttonID string) string
- func DictateNoteHTML(path, noteID, class string) string
- func DictateOffControlHTML(id string) string
- func DictateScriptHTML(path string) string
- func DispatchAgentCard(c DispatchCard) g.Node
- func DispatchCardGuard() g.Node
- func DispatchCardHostSrc(id int64) string
- func DispatchCardRefusedSrc(sentence string) string
- func DispatchCardSrc(agentID int64) string
- func DocHeadHTML(b Brand) string
- func EndSessionCard(ref MirrorRef, x *EndView) g.Node
- func FeatureHref(id string) string
- func FocusAgeLabel(age FocusAge) string
- func FocusAgeSuffix(age FocusAge) string
- func FocusHistoryPath(subject, cursor string) string
- func HomeHref(list []AgentCardView, mirrors []MirrorCardView, refs []RecentRef) string
- func HomeLeavingMirrorPath(r MirrorRef) string
- func HomeLeavingPath(name string) string
- func HostIconFor(ranks map[string]int, host string) string
- func IdleSectionAfterLabel(d time.Duration) string
- func InIdleSection(now, activeAt time.Time, pinned bool, after time.Duration) bool
- func KickoffFailedRemedy(resendSafe bool, namespace, name string) string
- func LiveHeartbeat() time.Duration
- func LiveStale(hb time.Duration) time.Duration
- func LiveWakeStale(hb time.Duration) time.Duration
- func MarkIdle(agents []AgentCardView, mirrors []MirrorCardView, now time.Time, ...)
- func MarkdownHTML(src string) string
- func MirrorAskCall(rowID string, qs []askq.Question, extra ...g.Node) g.Node
- func MirrorAskLive(v MirrorAskLiveView) g.Node
- func MirrorAskResult(rowID string, qs []askq.Question, answers map[string]string, note string, ...) g.Node
- func MirrorAskRowID(toolID string) string
- func MirrorAsksLive(vs []MirrorAskLiveView) g.Node
- func MirrorAsksSrc(ref MirrorRef) string
- func MirrorCardHref(m MirrorCardView) string
- func MirrorDraftKey(user int64, view, host, session, window string) string
- func MirrorPromptID(line int64) string
- func MirrorTerminalPath(host, session string) string
- func MirrorTerminalWSPath(host, session string) string
- func MirrorViewOnlyNote(kind string) string
- func MirrorViewPage(v MirrorViewView) g.Node
- func MirrorViewPath(host, session string) string
- func MirrorViewWSPath(host, session string) string
- func NavAgentsList(list []AgentCardView, mirrors []MirrorCardView, currentURL string, ...) g.Node
- func NavDocument(v NavDocumentView) g.Node
- func NavWaitingBadgeHTML(n int) string
- func NavWaitingCount(list []AgentCardView, mirrors []MirrorCardView) int
- func NotesCards(v TasksView) g.Node
- func NotesEditModalBody(v NoteEditView) g.Node
- func NotesModalBody(directories []string, directoriesFailed bool) g.Node
- func NotesModalBodyWith(directories []string, directoriesFailed bool, prefill string) g.Node
- func NotesPanel(active bool, drawn *shellTasks) g.Node
- func Page(activeTab string, feat Features) g.Node
- func PageWith(activeTab string, feat Features, data ShellData) g.Node
- func ParseIdleSectionAfter(v string) (time.Duration, error)
- func ParseLiveHeartbeat(v string) (time.Duration, error)
- func PreviewButton(p mirror.WindowPreviews, place PreviewPlace) g.Node
- func PreviewButtonSrc(host, session, window string, place PreviewPlace) string
- func ProposalCard(ref MirrorRef, p ProposalView, extra ...g.Node) g.Node
- func ReadOwnerCardResult(output string) (int64, bool)
- func RenderAgentDetail(w io.Writer, v AgentDetailView, feat Features) error
- func RenderAgentHeader(w io.Writer, a AgentCardView) error
- func RenderAgentsHome(w io.Writer, feat Features) error
- func RenderChiefContextChip(w io.Writer, c *ContextView) error
- func RenderChiefPanelBody(w io.Writer, v ChiefPanelView) error
- func RenderChiefThreadRows(w io.Writer, v ChiefThreadsView) error
- func RenderComposePage(w io.Writer, feat Features, body string) error
- func RenderConnectorForm(w io.Writer, f ConnectorFormView) error
- func RenderConnectorRequests(w io.Writer, list []ConnectorRequestView) error
- func RenderConnectorRotateForm(w io.Writer, name, errMsg string) error
- func RenderConnectors(w io.Writer, c ConnectorsContent) error
- func RenderDispatchCard(w io.Writer, c DispatchCard) error
- func RenderDriftKept(w io.Writer) error
- func RenderEndSessionCard(ref MirrorRef, x *EndView) (string, error)
- func RenderFocusHistoryPage(w io.Writer, v FocusHistoryPageView) error
- func RenderNavAgents(w io.Writer, list []AgentCardView, mirrors []MirrorCardView, currentURL string, ...) error
- func RenderNavDocument(w io.Writer, v NavDocumentView) error
- func RenderNavWaiting(w io.Writer, list []AgentCardView, mirrors []MirrorCardView) error
- func RenderNoteCard(w io.Writer, v TaskCardView) error
- func RenderNotesCards(w io.Writer, v TasksView) error
- func RenderNotesEditModal(w io.Writer, v NoteEditView) error
- func RenderNotesModal(w io.Writer, directories []string, directoriesFailed bool, prefill string) error
- func RenderNotifications(w io.Writer, active []ActiveRow, unread []NotificationRow) error
- func RenderPage(w io.Writer, activeTab string, feat Features) error
- func RenderPageWith(w io.Writer, activeTab string, feat Features, data ShellData) error
- func RenderPreviewButton(w io.Writer, p mirror.WindowPreviews, place PreviewPlace) error
- func RenderRepoOptions(w io.Writer, repos []RepoView) error
- func RenderSessionTagsAnswer(w io.Writer, t SessionTagTarget, tags []string, back string, s *Switcher) error
- func RenderStatusIcon(w io.Writer, status string, awaitingApproval bool) error
- func RenderSuccessionCard(ref MirrorRef, x *SuccessionView) (string, error)
- func RenderSwitcherPin(w io.Writer, pinned bool, fields [][2]string, back string, s *Switcher) error
- func RenderTagDatalist(w io.Writer, vocab []notes.TagCount) error
- func RenderTaskDetail(w io.Writer, v TaskCardView, feat Features) error
- func RenderTaskModal(w io.Writer, v TaskModalView) error
- func RenderTaskNotFound(w io.Writer, id string, feat Features) error
- func SendAgainPage(v SendAgainView) g.Node
- func SendQueueAnsweredText(asker string) string
- func SendQueueCancelPath(id int64) string
- func SendQueueDeletePath(id int64) string
- func SendQueueEditAnsweredText(asker string) string
- func SendQueueEditCancelPath(id int64) string
- func SendQueueEditPath(id int64) string
- func SendQueueEditSavePath(id int64) string
- func SendQueueFullID(id int64) string
- func SendQueueList(v SendQueueListView) g.Node
- func SendQueueRetryConfirmPage(action, field, question, back string, brand Brand) g.Node
- func SendQueueRetryPath(id int64) string
- func SendQueueSendNowPath(id int64) string
- func SetFaroConfig(c FaroSettings)
- func SetHostPreferences(p HostPreferences) error
- func SetLiveHeartbeat(d time.Duration) error
- func ShellTab(tab string, feat Features) string
- func SnapPurgeHTML() string
- func SnapScript(f Features) g.Node
- func SnapScriptNow(f Features) g.Node
- func SourceTypeLabel(source string) string
- func StatusPollPath(id int64, awaiting bool, work mirror.WindowWork) string
- func StepUpDialog(s *StepUpView) g.Node
- func StepUpFormPage(v StepUpFormView) g.Node
- func StepUpWhy(window string) string
- func StoredOwnerCard(toolID string, st OwnerCardState) g.Node
- func SubagentTailFragment(v SubagentTailView) g.Node
- func SuccessionCard(ref MirrorRef, x *SuccessionView) g.Node
- func SwitcherPinToggle(pinned bool, fields [][2]string, back string) g.Node
- func TabKeys() []string
- func TabsScript() g.Node
- func TaskCompletePath(id int64) string
- func TaskDetailPage(v TaskCardView, feat Features) g.Node
- func TaskNotFoundPage(id string, feat Features) g.Node
- func TaskTitle(n notes.Note) string
- func ThemeHead() g.Node
- func ThemeHeadHTML() string
- func UploadFilePath(id string) string
- func UploadRevokePath(id string) string
- func UserMarker(f Features) g.Node
- func ViewToAgentLabel(agent string) string
- func ViewToChiefLabel(agent string) string
- func WorkPollToken(w mirror.WindowWork) string
- type ActiveRow
- type AgentBrief
- type AgentCardView
- type AgentDetailView
- type AgentTerminalView
- type Brand
- type CardAttention
- type ChatLine
- type ChatRelay
- type ChatSurface
- type ChiefChatBar
- type ChiefPanelView
- type ChiefThreadsView
- type ComboOption
- type ComposerChief
- type ComposerField
- type ComposerQueue
- type ComposerView
- type ConnectorAuditView
- type ConnectorFormView
- type ConnectorGrantView
- type ConnectorPresetView
- type ConnectorRequestView
- type ConnectorSharedView
- type ConnectorView
- type ConnectorsContent
- type ContextView
- type CuratedModel
- type DispatchCard
- type DispatchResult
- type EndView
- type FaroSettings
- type Features
- type FocusAge
- type FocusHistoryEntry
- type FocusHistoryPageView
- type FocusView
- type HostPreferences
- type IdentityTint
- type KindChoices
- type MirrorAskLiveView
- type MirrorCardView
- type MirrorComposerView
- type MirrorIndex
- type MirrorIndexItem
- type MirrorOp
- type MirrorRef
- func (r MirrorRef) ChiefLogPath() string
- func (r MirrorRef) ScrollForm() string
- func (r MirrorRef) SubagentPath() string
- func (r MirrorRef) SuccessorPath() string
- func (r MirrorRef) TerminalPath() string
- func (r MirrorRef) TerminalWSPath() string
- func (r MirrorRef) ViewPath() string
- func (r MirrorRef) ViewWSPath() string
- type MirrorTranscript
- func (t *MirrorTranscript) Ledger() cctranscript.ToolContext
- func (t *MirrorTranscript) Ops(events []cctranscript.Event) []MirrorOp
- func (t *MirrorTranscript) QueuedOps(list []string) []MirrorOp
- func (t *MirrorTranscript) Reset()
- func (t *MirrorTranscript) RestoreLedger(l cctranscript.ToolContext)
- func (t *MirrorTranscript) SetAgentContext(c *mirror.AgentContext)
- func (t *MirrorTranscript) SubagentOps(list []mirror.Subagent) []MirrorOp
- func (t *MirrorTranscript) TakeContext() *ContextView
- type MirrorViewView
- type NavApp
- type NavChrome
- type NavDocumentView
- type NoteEditView
- type NotificationRow
- type OwnerAsk
- type OwnerAskOption
- type OwnerCardState
- type PluginChip
- type PluginChips
- type PreviewPlace
- type ProposalView
- type QuickKey
- type RecentRef
- type Renamed
- type RepoView
- type SendAgainView
- type SendQueueItem
- type SendQueueListView
- type SessionDrift
- type SessionRuntimeView
- type SessionTagTarget
- type SessionView
- type ShellData
- type StepUpFormView
- type StepUpView
- type SubagentTailView
- type SuccessionView
- type Switcher
- type SwitcherCurrent
- type SwitcherItem
- type Tab
- type TabSet
- type TaskCardView
- type TaskModalComment
- type TaskModalView
- type TasksView
Constants ¶
const ( AgentStripID = "agent-strip" AgentMenuSlot = "agent-menu-slot" AgentNoticesID = "agent-notices" AgentMenuID = "agent-actions" AgentRenameID = "agent-rename" )
The elements the agent page's actions live in.
const ( FromListParam = "from" FromListValue = "list" )
FromListParam is the query parameter (value FromListValue) a LIST link adds to AgentSessionHref: "this names whatever was the agent's latest session when the list was drawn, not this particular session".
const ( HomeLeaveParam = "leave" HomeLeaveHostParam = "leave_host" HomeLeaveSessionParam = "leave_session" HomeLeaveWindowParam = "leave_window" )
The parameters on HomePath naming the session home must not open: the page the viewer is leaving — an agent by name (HomeLeaveParam, HomeLeavingPath), or a mirrored window by its address (the three below, HomeLeavingMirrorPath).
const ( // AsksGroupClass is one group's <li> (its label, then its <ul>). AsksGroupClass = "flex flex-col gap-2" // AsksGroupListClass is a group's own <ul> of cards. AsksGroupListClass = "flex flex-col gap-2" // AsksCardClass is a card that holds controls (an ask's answer form, a // draft's decision): a plain block, its head the link. AsksCardClass = "flex min-w-0 flex-col gap-2 rounded-xl bg-s1 p-3 ring-1 ring-inset ring-line" // AsksRowClass is a card that is ONE link as a whole: a waiting window, a // stalled session, a task to route. A real <a>, so it is keyboard- and // screen-reader-reachable as a link (never a div with a click handler). AsksRowClass = "" /* 203-byte string literal not displayed */ // AsksHeadLinkClass is a card's head when it links to the session: the // whole head row is the target. AsksHeadLinkClass = "" /* 166-byte string literal not displayed */ // AsksHeadClass is a card's head with nothing to open. AsksHeadClass = "flex min-w-0 items-center gap-3" // AsksHeadTextClass wraps the head's lines, beside the chevron. AsksHeadTextClass = "flex min-w-0 flex-1 flex-col" // AsksTitleClass is the head's first line: the session's name. AsksTitleClass = "truncate text-sm font-semibold text-fg" // AsksSubClass is the head's muted second line: host, age. AsksSubClass = "truncate text-xs text-fg2" // AsksTargetClass is the tmux target inside the sub line, small. AsksTargetClass = "font-mono text-[11px] text-muted" // AsksWaitLineClass is a waiting row's one line: what it waits on (its // pending call, a question's first line). AsksWaitLineClass = "truncate font-mono text-xs text-fg" // AsksTextClass is a card's question or message. AsksTextClass = "whitespace-pre-wrap break-words text-sm text-fg" // AsksMutedTextClass is a card's secondary line. AsksMutedTextClass = "truncate text-xs text-fg2" // AsksQuietCardClass dims a row that is held (a quiet episode). AsksQuietCardClass = "opacity-60" // THE ANSWER FORM, Asks-page variant: the options as full-width chips // first; the free-text box behind "Type an answer" (a <details>, so it // opens with no script and is a real disclosure for a screen reader); // Dismiss a small icon button. AsksOptionsClass = "flex flex-col gap-1.5" AsksOptionClass = "" /* 142-byte string literal not displayed */ // AsksTypeClass is the <details> holding the box; it reserves its shut // height itself, so a parse that yields between it and its <summary> // cannot draw the browser's default summary first (nav_agents.go navMore). AsksTypeClass = "group/type min-h-[44px] min-w-0" AsksTypeSummaryClass = "" /* 207-byte string literal not displayed */ AsksTypeBodyClass = "flex flex-col gap-1.5" // AsksActionsClass is the row of a card's actions: the primary one fills // it, the secondary ones are small beside it. AsksActionsClass = "flex min-w-0 items-center gap-2" // AsksIconButtonClass is a small secondary action drawn as an icon (a 44px // target): it MUST carry aria-label and title. AsksIconButtonClass = "" /* 194-byte string literal not displayed */ // AsksSecondaryButtonClass is a small secondary action with words. AsksSecondaryButtonClass = "" /* 195-byte string literal not displayed */ // AsksPrimaryButtonClass is a card's one primary action. AsksPrimaryButtonClass = "press min-h-[44px] w-full rounded-lg bg-accent px-3 py-2 text-base font-semibold text-on-accent transition hover:bg-accent/90" // AsksQuoteClass is quoted text from outside (a draft's inbound message). AsksQuoteClass = "flex min-w-0 flex-col gap-1 border-l-2 border-edge pl-3" // AsksDetailsClass / AsksDetailsSummaryClass fold a card's secondary // facts (a nudge's quote, classifier, reason) behind one small toggle. AsksDetailsClass = "group/more min-w-0" AsksDetailsSummaryClass = "" /* 179-byte string literal not displayed */ AsksDetailsBodyClass = "flex flex-col gap-1 pb-1" // AsksPillClass is a small status pill (a nudge's mode). AsksPillClass = "inline-flex shrink-0 items-center rounded-full bg-s2 px-2 py-0.5 text-[11px] font-semibold text-fg2" )
const ( AttachRemoveLabel = "Remove attachment" AttachRevokeLabel = "Revoke this link" AttachRevoked = "Link revoked" AttachUploading = "Uploading…" AttachFailed = "That file could not be attached." AttachStillUploading = "Wait for the attachment to finish uploading." )
The attach control's and chips' accessible names and inline messages.
const ( AskFormFitClass = "answer-fit" AskFormClass = "flex flex-col gap-1.5" AskFormOptionsClass = "flex flex-wrap gap-1.5" AskFormOptionClass = "" /* 151-byte string literal not displayed */ AskFormBoxRowClass = "flex items-end gap-2" AskFormInputClass = AskFormFitClass + " min-h-[44px] min-w-0 flex-1 resize-none rounded-md bg-bg px-3 py-2 text-base text-fg ring-1 ring-inset ring-edge placeholder:text-muted focus:outline-none focus:ring-2 focus:ring-focus" AskFormActionsClass = "flex items-center gap-2" AskFormAnswerClass = "press min-h-[44px] flex-1 rounded-md bg-accent px-3 py-2 text-base font-semibold text-on-accent transition hover:bg-accent/90" AskFormDismissClass = "" /* 132-byte string literal not displayed */ )
THE COMPACT ANSWER FORM's classes: an ask's card (internal/api's attentionItemsHTMLTo — the Asks queue's AND a session page's asks block, one form for both) draws its options, its answer box and its Answer / Dismiss row with these. They live here, not in internal/api, because the stylesheet scans internal/ui: a class written only in internal/api is never emitted.
The box starts ONE line and grows with what is typed (AskFormFitClass, web/css/input.css: field-sizing, capped, scrolling inside past the cap; a browser without field-sizing keeps the one line and scrolls). The options are ANSWERS, not calls to action: as wide as their words, left-aligned, in normal-weight small text, wrapping naturally (a live card's two "agent_dispatch on pod/…: start a new agent on it" options were bold, centred, full-width two-line buttons that pushed Answer below the fold); Answer (primary) and Dismiss (quiet) share one row. Dismiss SAYS "Dismiss" and is NAMED "Dismiss without answering" (aria-label, title): the long words on the button squeezed Answer to "Answe" in the queue's 286px card. Every target stays 44px (e2e layout.spec.ts).
const ( BrandLogoPath = "/brand/logo.png" BrandIcon192Path = "/brand/icon-192.png" BrandIcon512Path = "/brand/icon-512.png" )
The instance branding's public images (internal/api branding.go serves them; docs/branding.md). Spelled once, here, because both the pages (this package) and the routes (internal/api) name them.
const ( ChiefChatKindPrimary = "primary" ChiefChatKindSide = "side" ChiefChatKindArchived = "archived" )
The kinds a chat bar names (data-chief-chat-kind), and what it says.
const ( // DraftMaxChars is mirror.MaxPaste (16 KiB) in characters: a longer text // cannot be sent anyway. DraftMaxChars = 16384 DraftMaxCount = 50 DraftTTLDays = 7 )
The drafts' bounds.
const ( PendingSendingText = "Sending…" PendingSentText = "Sent" PendingStepUpText = "Confirm it's you to send" PendingQueuingText = "Queuing…" PendingFailedText = "Not sent" PendingUnknownText = "Not confirmed: it may or may not have been sent." // PendingUnknownPrefix leads the server's reason on a bubble that may // have been delivered. PendingUnknownPrefix = "Not confirmed — " PendingWaitingText = "Waiting — an earlier message wasn't sent" )
Pending sends' visible words. The e2e spec and the docs say these.
const ( DictateInsecure = "The microphone needs a secure (https) address. Open muster at its https address to dictate." DictateUnsupported = "This browser cannot record audio, so dictation is not available here." DictateDenied = "Microphone access was blocked. Allow it for this site in the browser's settings, then tap the mic again." // DictateDeniedApp replaces DictateDenied inside the Android app's WebView // (window[AppBridgeName] exists). There the block is Android's RECORD_AUDIO // permission for the app, not a site setting, and the WebView has no // browser settings to point at; the app's own "Open settings" dialog // names the same path. App versions 0.1.0 and 0.1.1 inject the bridge // but declare no RECORD_AUDIO, so they have no Microphone row; the page // cannot see the app's version, so the sentence says to update the app. DictateDeniedApp = "" /* 198-byte string literal not displayed */ DictateNoMic = "No microphone was found." DictateMicBusy = "The microphone is in use by another app." DictateNothing = "Nothing was heard in that recording. Try again, closer to the mic." DictateSignedOut = "You are signed out. Reload the page to sign in again." DictateEmpty = "Nothing was recorded." )
dictateMessages are the inline notes. Spelled once, here, and handed to the script, so a test can read the same sentence the page shows.
const ( DispatchStarting = "starting" DispatchWorking = "working" DispatchWaiting = "waiting" DispatchDone = "done" DispatchError = "error" // DispatchFailed and DispatchStuck are a RECORDED outcome // (internal/agentoutcome, the agent page's own "failed" / "stuck"): a turn of // the agent failed, or the silence watchdog saw nothing of it. The detail // says why. DispatchFailed = "failed" DispatchStuck = "stuck" )
The states a started agent's card shows (data-dispatch-state).
const ( FocusAgeShownAfter = 24 * time.Hour FocusStaleAfter = 4 * 24 * time.Hour )
🔴 THE FOCUS AGE RULE — ONE PLACE, ONE CLOCK. Every surface that shows a focus title says how old it is through FocusAgeOf, at the SERVER's clock (internal/api's s.now), and nothing else decides it:
- the owner's: the switcher dock's second line and the palette's results (SwitcherCurrent.Now), the sidebar's rows (NavAgentsList's now), the Asks list's rows, a chief notice's push body, and the attention summary's why (the push's first line);
- the chief's: fleet_list, sessions_overview and focus_search rows and attention_list items (internal/api's focusAgeFields), and the chief nudge's prompt (FocusAgeLabel, chiefnudge.Session.TitleAge).
Not here: focus_search with since_hours, fleet_report and the session hints, which list PAST titles each with the time it was written, not a current title's age; and a plugin message's pull-request author hint (internal/api's prAuthorHint), which uses the current title as the session's NAME beside its own last_seen time — named here so it is not mistaken for covered.
the dock and the palette draw in the browser, so the server computes the age at RENDER time and hands them the result as attributes (data-switcher-focus-age, data-switcher-focus-stale); their scripts only draw it and hold no threshold of their own.
A title summarises what the session was doing WHEN IT WAS WRITTEN; an idle session keeps its last one for days, and without an age it reads as current. So:
- older than FocusAgeShownAfter (a day): its age is shown after it, in whole days ("· 2d");
- older than FocusStaleAfter (four days): it is also marked stale and drawn muted (FocusStaleClass).
The age is UpdatedAt: when the title was last WRITTEN. A refresh that fails keeps the old title and leaves UpdatedAt where it was, so a title that stopped refreshing ages like any other. Problem plays no part: a refresh that failed minutes after a fresh title does not make that title old.
const ( MinIdleSectionAfter = time.Hour MaxIdleSectionAfter = 365 * 24 * time.Hour )
Bounds of a configured threshold (ParseIdleSectionAfter); 0 is "off".
const ( MinLiveHeartbeat = 250 * time.Millisecond MaxLiveHeartbeat = 5 * time.Minute )
MinLiveHeartbeat and MaxLiveHeartbeat bound MUSTER_LIVE_HEARTBEAT.
const ( LiveRetryBaseMs = 500 LiveRetryCapMs = 15000 )
LiveRetryBaseMs and LiveRetryCapMs shape a closed socket's backoff: base × 2^attempt, capped, then jittered to between half and all of it.
const ( MirrorAskPath = "/mirror/view/ask" MirrorAsksPath = "/mirror/view/asks" // MirrorAskCancelPath dismisses a card's picker in the terminal with one // Escape (POST). MirrorAskCancelPath = "/mirror/view/ask/cancel" // MirrorAskMessagePath sends a failed card's answer to the session as an // ordinary message (POST): "Send as a message". MirrorAskMessagePath = "/mirror/view/ask/message" )
MirrorAskPath takes a card's answers (POST); MirrorAsksPath is the window's live region (GET).
const ( AskStatePending = "pending" AskStateTyping = "typing" AskStateFailed = "failed" AskStateAnswered = "answered" AskStateAnsweredTerminal = "answered-terminal" AskStateDeclined = "declined" AskStateExpired = "expired" AskStateSuperseded = "superseded" AskStateHistory = "history" AskStateWaiting = "waiting" )
The states a card can be in, as data-ask-state carries them. AskStateHistory and AskStateWaiting are cards drawn from the transcript.
const ( // MirrorTitleID is mirrorTitleID, which a rename's answer swaps; // MirrorHeadingID the heading around it, which takes focus after. MirrorTitleID = mirrorTitleID MirrorHeadingID = "mv-heading" )
The rendered view's header title (mirrorViewTitle) and its popover. One of each per document.
const ( ViewRendered = "rendered" ViewTerminal = "terminal" )
The two views' names, as data-view-swap and the view frame spell them.
const ( ContextWarnPct = 70 ContextDangerPct = 90 ContextLevelWarn = "warn" ContextLevelDanger = "danger" )
The chip's tint thresholds, in percent of a known context window, and the separator between its name and count (the label's, and the page's when it draws the two as parts).
const ( NavFeatures = "features" )
The nav entries that are not tabs: each names a sidebar link a document can mark as the one it belongs to (sidebar's activeTab / currentTab).
const ( OwnerAskQuestionMax = 1000 OwnerAskOptionsMax = 8 OwnerAskLabelMax = 120 OwnerAskDescriptionMax = 300 // OwnerAskOtherMax caps the "Other" answer's box; the composer's own limit // still applies to what is sent. OwnerAskOtherMax = 2000 )
The bounds an ask_owner call must keep. internal/api refuses a call outside them (DecodeOwnerAsk), and the card relies on them to lay out on a phone.
const ( OwnerAskWaiting = "waiting" OwnerAskAnswered = "answered" )
The states an owner-ask card is drawn in (data-owner-ask-state).
const ( OwnerCardOpen = "open" OwnerCardAnswered = "answered" OwnerCardClosed = "closed" )
A stored card's ask, as the chat draws it (OwnerCardState.Status): the attention ask's own status, collapsed to what a card shows.
const ( PinPath = "/agents/pins" UnpinPath = "/agents/pins/delete" )
The pin routes (internal/api pins.go). The one toggle that posts here is the session switcher's (SwitcherPinToggle, the item of the bar's ⋯ menu): a form with hx-post, answered with the item in its new state and the bar's rows out of band. It also carries method/action, and without JavaScript the server sends the browser back to the session's page.
const ( SendQueueHeldText = "Being edited: held, and nothing queued for this window is sent until the edit is saved or cancelled." SendQueueHeldElsewhereText = "" /* 149-byte string literal not displayed */ SendQueueLapsedText = "An edit was not saved in time, so its hold ran out and the message kept its original text." SendQueueEditedText = "Edited." )
What a held, a lapsed and an edited message say under their preview.
const ( SendQueueSavedNote = "Saved." SendQueueEditCancelledNote = "Edit cancelled: the message is unchanged." )
What the list's script says when an edit is saved, and cancelled.
const ( SendQueueMenuLabel = "More actions for this queued message" SendQueueSendNowLabel = "Send now" SendQueueEditLabel = "Edit" SendQueueCopyLabel = "Copy message" SendQueueCancelLabel = "Cancel this queued message" )
The labels of a queued message's ⋯ menu.
const ( SendQueueEditTextLabel = "Edit this queued message" SendQueueEditSaveLabel = "Save" SendQueueEditCancelLabel = "Cancel editing; keep the message as it was" )
The edit form's labels.
const ( SessionRenameID = "session-rename" SessionRenameItemID = "switcher-rename" SessionRenameMenuLabel = "Rename…" )
The switcher ⋯ menu's rename item and the dialog it opens.
const ( SessionDriftID = "session-drift" SessionDriftStatusID = "session-drift-status" )
The drift offer's elements: SessionDriftID is the banner, SessionDriftStatusID the polite live region beside it, which says what a tap did once the banner is gone.
const ( SessionTagsPath = "/sessions/tags" SessionTagsRemovePath = "/sessions/tags/delete" )
The tag routes (internal/api session_tags.go): GET lists one subject's tags (JSON), POST adds one, POST …/delete removes one.
const ( SessionTagsEditorID = "session-tags-editor" SessionTagsInputID = "session-tags-input" SessionTagsHeadID = "session-tags-head" // SessionTagsItemID is the ⋯ menu's "Tags…" item. SessionTagsItemID = "switcher-tags" // SessionTagsMenuLabel is that item's words. SessionTagsMenuLabel = "Tags…" )
The editor's and the header's element ids.
const ( SessionTagsMax = 20 SessionTagMaxRunes = 64 )
SessionTagsMax and SessionTagMaxRunes are the store's bounds (sessiontags.MaxPerTarget / MaxTagRunes — this package does not import the store); internal/api's TestTheEditorSpellsTheStoresBounds pins them equal.
const ( SuggestPath = "/mirror/view/suggest" SuggestEventPath = "/mirror/view/suggest/event" )
SuggestPath is the window's current set (JSON); SuggestEventPath where the row reports what happened to it.
const ( SuggestMoreLabel = "Show full suggestion" SuggestFullLabel = "Full suggestion" )
SuggestMoreLabel names a chip's expand button; SuggestFullLabel its popover.
const ( SwitcherRecent = "recent" SwitcherWaiting = "waiting" SwitcherPins = "pins" SwitcherAll = "all" )
The switcher's views, as data-switcher-view and the storage value spell them, in the order the view menu lists them.
const ( // ScrollRefusalUnsupported: this host cannot scroll (an older or read-only // muster-mirror). The page unwires the gesture; Reconnect wires it again. ScrollRefusalUnsupported = "unsupported" // ScrollRefusalOffline: the host is not connected now (it is reconnecting). ScrollRefusalOffline = "offline" // ScrollRefusalMode: the pane is in another tmux mode (a menu, choose-tree). ScrollRefusalMode = "mode" // ScrollRefusalGone: the session or window is no longer on the host. ScrollRefusalGone = "gone" // ScrollRefusalRefused: the host refused for another reason. ScrollRefusalRefused = "refused" )
The scroll route's refusal codes (ScrollRefusalHeader).
const ( ScrollOfflineNote = "Host reconnecting. Drag again once it is back." ScrollModeNote = "The pane is in another mode (e.g. a tmux menu). Close it, then drag again." ScrollGoneNote = "This window is no longer on the host." ScrollRefusedNote = "The host refused the scroll. Drag again to retry." )
The notes the page shows for each refusal that keeps the gesture wired.
const ( // StatusConnected is the status of an attach whose keys go straight into // the session — LIVE KEYS ARE ALWAYS ON, so this is the ordinary state. StatusConnected = "Connected" // StatusConfirmToType is a mirrored session's attach while the sign-in is // not fresh: the first key pressed asks "Confirm it's you". StatusConfirmToType = "Connected · confirm it's you to type" // StatusNoKeys is a host that takes no keys (it did not advertise // -interactive). It never says "read-only": what the composer can send is // its own note. StatusNoKeys = "Connected · this host takes no keys" // StatusReconnecting is a socket that closed and is coming back by itself. StatusReconnecting = "Disconnected · reconnecting…" )
The status line's words. Exported so a test pins the page against the same strings rather than a copy of them.
const ( ViewChiefPlaceholder = "Ask the chief about this session…" ViewChiefAria = "Ask your chief about this session" // ViewChiefStripEmpty is the strip before anything was asked about the // session. ViewChiefStripEmpty = "Nothing asked about this session yet. Your chief answers here." )
The chief mode's words.
const ( ViewToAgent = "agent" ViewToChief = "chief" )
The mode's two values (the remembered mode).
const ( EndEnding = "ending" EndEnded = "ended" )
End-session states beyond the shared ones (SuccessionProposed, …Expired, …Declined, …Failed).
const ( ProposalBodyClass = "flex min-w-0 flex-col gap-1" ProposalBodyNoteClass = "text-xs text-fg2" ProposalKickoffClass = "max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-xl bg-s1 px-3 py-2 font-mono text-xs text-fg ring-1 ring-line" )
The classes of a proposal card's body (its kickoff) on the Attention view and the ask page, which internal/api draws (proposalBodyHTML). They live HERE because the stylesheet scans internal/ui, not that file: a class written only there would never be built.
const ( SuccessionProposed = "proposed" SuccessionExpired = "expired" SuccessionDeclined = "declined" SuccessionStarting = "starting" SuccessionRunning = "running" SuccessionFailed = "failed" SuccessionEnded = "ended" )
A succession's states as a view reads them.
const AgentContextTitle = "Context used by the latest model request: its input + cache read + cache write tokens, " +
"as the agent reports them (output is not counted: it is in the next request's input), of the model's context window."
AgentContextTitle is how a readout a runtime reported (SetAgentContext) is derived; the chip's popover shows it under the detail.
const AgentDispatchTool = "agent_dispatch"
AgentDispatchTool is the chief's tool that starts an agent.
const AgentSendFromTerminal = "terminal"
AgentSendFromTerminal is the `from` field of a send that came from the agent's Terminal page: where its answer returns the browser to. Anything else is the chat page.
const AgentSessionField = "agent_session"
AgentSessionField is the form field naming the agent session a view showed when a message was written on it (a hand-opened opencode pane's): a send, or the queued row it becomes, goes only while the window still shows that session (mirror.ShownSession).
const (
AgentTitleID = "agent-title"
)
agentTitlePopoverID is the header's full-title popover, AgentTitleID the title's box (agentTitle). One of each per document.
const AgentsAwaitingEvent = "agents:awaiting"
AgentsAwaitingEvent is the HX-Trigger the status poll answers with when what an agent page's strip was drawn with is no longer true — its awaiting-approval state, or its work chip (a new report, or one that expired with no POST to announce it); the strip re-fetches on it (agentStripTrigger).
const AppBridgeName = "musterApp"
AppBridgeName is the JavaScript object the Android app's WebView injects (WebViewCompat.addWebMessageListener), on muster's own origin only. Its presence is how a page knows it is inside the app; the page posts the pairing code and "open the app's notification settings" to it, and never receives a credential from it. The app repository uses the same name.
const AskNoCardNote = "Muster isn't tracking this question, so it can't answer it from here — answer it in the terminal. " +
"(It may no longer be on the terminal's screen, or its host may not report that the session is waiting.)"
AskNoCardNote is what a call the transcript holds with no result says (MirrorAskCall). The page shows it only while muster has NO live card for the call (askScript hides it behind one), so it says why muster cannot answer it here and where to. muster tracks a call it reads open in a WAITING session's transcript (internal/api's open-question scan), so a call it does not track is one no longer on screen (an interrupted call, an ended session) or one in a session its host does not report as waiting.
const AskerAsksID = "asker-asks"
AskerAsksID is the element id of a session page's asks block.
const AsksChevron = `` /* 227-byte string literal not displayed */
AsksChevron is the "opens" mark at a linked head's or row's end.
const AsksDismissIcon = `` /* 214-byte string literal not displayed */
AsksDismissIcon is Dismiss's glyph (the app's close mark).
const AsksTypeIcon = `` /* 299-byte string literal not displayed */
AsksTypeIcon is "Type an answer"'s glyph (a keyboard).
const AttachOffLabel = "File attachments are off on this server — how to turn them on"
AttachOffLabel is the muted paperclip's accessible name.
const AttentionBadgePath = "/attention/badge"
AttentionBadgePath is the badge fragment's route.
const AwaitingApprovalBadgeID = "awaiting-approval"
AwaitingApprovalBadgeID is the data attribute the badge carries, so tests and scripts find it by STATE, not by its wording.
const ChatLogRefetchEvent = "muster:chat-refetch"
ChatLogRefetchEvent is dispatched on #chat-log itself to re-fetch it: agentChatScript's owedRefetch, when a turn ends with a refetch owed.
const ChatLogSettle = "settle:0ms"
ChatLogSettle is #chat-log's swap modifier: settle in the swap's own task (see there).
const ChatLogVersionHeader = "Muster-Chat-Log-Version"
ChatLogVersionHeader carries the #chat-log version both ways: the server's version of the partial it sent (response), and the version the page holds (request). A refetch whose version still matches is answered 204, which htmx does not swap (its default responseHandling), so the page keeps its DOM.
const ChatSurfaceQueryParam = "surface"
ChatSurfaceQueryParam is the query-string name the chat-log partial reads its surface from. Exported because internal/api parses it and a second spelling there would silently answer with the page surface for ever.
const ChiefContextTitle = "Context used by this chat's latest turn: its last request's input + cache read + cache write tokens " +
"(output is not counted: it is in the next request's input), of the model's context window."
ChiefContextTitle is how the chief chip's number is derived.
const ClaudeContextTitle = "Context used by the latest request: its input + cache read + cache write tokens " +
"(output is not counted: it is in the next request's input)."
ClaudeContextTitle is how Claude Code's readout (a turn's usage) is derived; its popover shows it under the exact count.
const ComposerTextLabel = "Type a message"
ComposerTextLabel is the "Type a message" button's accessible name.
const CredentialsPath = "/account/credentials"
CredentialsPath is the page where a user adds their own credentials.
const DefaultIdleSectionAfter = 14 * 24 * time.Hour
DefaultIdleSectionAfter is how long an entry must be idle to be drawn in the section when MUSTER_AGENTS_IDLE_AFTER is unset.
const DefaultLiveHeartbeat = 15 * time.Second
DefaultLiveHeartbeat is how often a live stream's server sends a heartbeat when MUSTER_LIVE_HEARTBEAT is unset.
const DictateIdleEvent = "muster:dictate-idle"
DictateIdleEvent is dispatched (bubbling) on a mic when it returns to idle — recorded and transcribed, refused, or nothing heard. A live refresh the mic held back (askBusyFunc) runs then (AttentionLiveScript): without it, a recording that inserted nothing left the refresh pending until the next focusout, which a mic tap never causes.
const DictateMaxSeconds = 120
DictateMaxSeconds is how long one recording may run; the page stops it there and transcribes what it has.
const DictateOffLabel = "Dictation is off on this server — how to turn it on"
DictateOffLabel is the muted mic's accessible name.
const DictateRevealEvent = "muster:dictate-reveal"
DictateRevealEvent is the event a page dispatches (bubbling) on content it put on the page by itself — innerHTML, not an htmx swap, so no htmx:load — for dictateScript to show the mics in it. The Asks list's and a mirrored view's asks block's live refresh (AttentionLiveScript) is that case: without it every mic a refresh drew stayed hidden.
const DirectorySearchPath = "/api/directories"
DirectorySearchPath is the route the directory combobox searches against. It is a CONSTANT shared by the renderer and the route table so the two cannot drift — a picker pointed at a path nothing serves degrades to "seed only" with no error anywhere, which is the failure mode this whole component exists to stop happening twice.
const DispatchCardPath = "/ui/dispatch-card"
DispatchCardPath serves one card (GET ?agent=<id>, or ?refused=<sentence>).
const DispatchLiveAttr = "data-dispatch-live"
DispatchLiveAttr marks a card's refreshing wrapper (liveCard).
const DispatchVersionAttr = "data-dispatch-version"
DispatchVersionAttr is a card's version (DispatchCard.Version).
const DockID = "switcher-dock"
DockID is the dock dialog's id.
const DockTouchQuery = "(pointer: coarse)"
DockTouchQuery is the touch layout: the one media query the bar's script and the dock decide by (operator decision 3: "the touch layout is chosen by (pointer: coarse) alone, at any width").
const DraftKeyPrefix = "muster.draft.v2:"
DraftKeyPrefix starts every draft's localStorage key.
const FeaturesPagePath = "/account/features"
visibleTabs is the subset of musterTabs a document with these features may draw.
🔴 EVERY CONSUMER OF THE TAB REGISTRY THAT DRAWS SOMETHING GOES THROUGH HERE — the sidebar links, the shell's panels, and the values navRegistryJS hands the browser router. They must agree or the failure is silent in both directions: a link with no panel shows nothing when clicked, and a panel with no link is unreachable. ui.TabKeys() deliberately does NOT go through here; it feeds route registration, which is unconditional. FeaturesPagePath is the Features page (internal/api features.go): every feature this server runs or does not, with the line(s) that turn each on.
const FocusHistoryRoute = "/ui/focus/history"
FocusHistoryRoute is the history fragment's route.
const FocusStaleClass = "italic opacity-60"
FocusStaleClass is the muted style of a stale focus title wherever one is drawn. internal/api's Asks list uses it too; it is spelled here, in Tailwind's content globs, so its classes are always in the stylesheet.
const FreshPrimaryConfirm = "Start a fresh primary chat? This one is archived (its history is kept), " +
"the chief writes a short handover here and starts the new one with it, and every delivery " +
"goes to the new chat from now on."
FreshPrimaryConfirm is the fresh-primary action's confirmation.
const HomeEmptyID = "agents-empty"
HomeEmptyID is the onboarding page's content (agentsEmptyState).
const HomeFallbackPath = "/agents"
HomeFallbackPath is the retired Agents list page's URL, GET /agents: home's redirect, or — when home has nothing to open — the onboarding page (RenderAgentsHome).
const HomePath = "/"
HomePath is home: the chief's chat, or the session opened last (internal/api homeTarget). Marking a task complete from an agent's page lands there, on both the htmx and the no-JS path — it used to land on the Agents list page, which is retired.
const InstallGuideURL = "https://github.com/ZacxDev/muster/blob/main/INSTALL.md"
InstallGuideURL is INSTALL.md on GitHub, for a person to read.
const KickoffRemedyResendSafe = "Not retried automatically. The task never reached the agent, so " +
"re-sending cannot pay for the task twice: open this agent's chat and send the task again."
KickoffRemedyResendSafe is the remedy under a failed kickoff whose record proves the task never reached the agent (agents.KickoffResendSafe).
const LiveHeartbeatAttr = "data-heartbeat"
LiveHeartbeatAttr is appScript's tag attribute carrying LiveHeartbeat in milliseconds.
const LiveManualAfter = 3
LiveManualAfter is how many reconnects in a row may fail before a view offers its manual Reconnect (it keeps retrying on its own all the same).
const LivePingEvent = "muster.ping"
LivePingEvent is the /events stream's heartbeat event (its data is "{}").
const LivePingFrame = `{"type":"ping"}`
LivePingFrame is a socket's heartbeat, exactly as its server writes it (a text frame): a page takes it as "alive" and nothing else.
const LiveTickMs = 1000
LiveTickMs is how often a visible page's watchdog looks at its sockets.
const MirrorChiefLogPath = "/mirror/view/chief/log"
MirrorChiefLogPath is the view's chief strip: the chief's replies about the session.
const MirrorChiefPath = "/mirror/view/chief"
MirrorChiefPath is where the view's chief mode posts the owner's line.
const MirrorCompletePath = "/mirror/view/complete"
MirrorCompletePath is the Rendered view composer's menu data: the window's `/` commands and skills and `:` snippets, as JSON (internal/api's handleMirrorComplete), fetched by composerMenuScript.
const (
// MirrorComposeEmpty answers a Send with nothing typed: said, not swallowed.
MirrorComposeEmpty = "Type a message first."
)
The composer's own messages. The script shows them in #mv-note.
const MirrorOfflineText = "The host's muster-mirror is not connected, or the host no longer lists this tmux session."
MirrorOfflineText is what a mirrored window's own page says while its host is not serving it.
const MirrorProposalPath = "/mirror/view/proposal"
MirrorProposalPath is where a proposal card's buttons post the owner's tap.
const MirrorProposalReadPath = "/mirror/view/proposal"
MirrorProposalReadPath is a proposal's read by id (JSON: its state and its card), for a view whose window is gone.
const MirrorReadOnlyNote = "This host is read-only — its muster-mirror was not started with -interactive, so nothing can be sent from here."
MirrorReadOnlyNote is what a read-only host's composer says instead of accepting text.
const MirrorSendPath = "/mirror/view/send"
MirrorSendPath is where the rendered view's composer posts a message: into the session's Claude Code pane, and only that.
const MirrorSubagentPath = "/mirror/view/subagent"
MirrorSubagentPath is a subagent's recent steps, as an HTML fragment (?host&session&window&agent).
const MirrorSuccessorPath = "/mirror/view/successor"
MirrorSuccessorPath is the view's succession read (JSON: its state, its card, where the successor is).
const MirrorTerminalScrollPath = "/mirror/terminal/scroll"
MirrorTerminalScrollPath is where the Terminal view's drag-to-scroll posts (internal/api's handleMirrorTerminalScroll).
const MirrorTerminalSendPath = "/mirror/terminal/send"
MirrorTerminalSendPath is where the Terminal view's composer posts a message: into the session's active pane, whatever runs in it.
NavAgentsListID is the element the partial is swapped into.
NavAgentsPath is the sidebar list's partial.
NavIdleID is the sidebar's Idle group (navIdleGroup).
NavOpenEvent is what appScript's setOpen dispatches on document each time the sidebar opens.
NavSupersededID is the sidebar's Superseded group (navSupersededGroup).
NavWaitingBadgeID is the badge element (NavWaitingBadgeHTML).
NavWaitingPath is the ☰ button's badge partial.
const OnboardingPrompt = "Set up muster for me: read https://raw.githubusercontent.com/ZacxDev/muster/main/INSTALL.md " +
"and follow it step by step. Ask me everything you need in one go up front, then do the rest yourself."
OnboardingPrompt is THE one prompt: what a person pastes into their coding agent to have it set muster up (INSTALL.md), or connect another machine to one that runs.
🔴 IT IS STATED IN FOUR PLACES AND MUST BE BYTE-IDENTICAL IN ALL OF THEM: here (home's onboarding page, agentsEmptyState), the fenced block at the top of INSTALL.md, the one in docs/onboarding.md, and the README's own copy in its Quickstart. TestTheOnePromptIsTheSameEverywhere pins that, so a reword in one place fails until all four agree. Changing it is a public-facing change: people will have copied the old one.
const OwnerAskClosed = "closed"
OwnerAskClosed is a stored card that closed unanswered (data-owner-ask-state).
const OwnerAskMultiSep = "; "
OwnerAskMultiSep joins a multi-select card's picks into the one message sent.
const OwnerAskTool = "ask_owner"
OwnerAskTool is the tool's name; a claude-code chief's calls carry the MCP prefix (OwnerAskToolName reads both).
const OwnerCardAskIDKey = "ask_id"
OwnerCardAskIDKey is the key ask_owner's result names its stored card by (the attention ask's id); ReadOwnerCardResult reads it back.
const PaletteHistoryRoute = "/ui/palette/history"
PaletteHistoryRoute is the palette's server search (internal/api's handlePaletteHistory): every focus title in the retention, asked for once typing pauses on a query of PaletteServerMinRunes or more.
const (
PaletteServerMinRunes = 3
)
The palette's server search waits for typing to pause this long, and asks only for a query this long (focus.MinTitleQueryRunes, the server's own floor). PaletteServerMinRunes must equal focus.MinTitleQueryRunes (internal/api's TestThePaletteAsksOnlyWhatTheServerAnswers), and paletteServerMinRunesJS spell it (TestThePaletteSpellsItsServerFloor): the script is a constant, so it holds the number as text.
const PasskeyJS = `` /* 2217-byte string literal not displayed */
PasskeyJS is the WebAuthn helpers every passkey script on every page shares: the sign-in and account pages (internal/api) and the confirm dialog here. mpk* names keep them out of any other page script's way.
⚠ THE JSON <-> ArrayBuffer CONVERSION IS DONE BY HAND, not with PublicKeyCredential.parseRequestOptionsFromJSON / credential.toJSON(): those are missing from browsers muster's users still run (Safari before 18.x), and a page that works only where they exist would fail exactly on the phones the passkeys are for. GoTrue's options use base64url for every binary field.
const PasskeyPrefetchJS = `` /* 229-byte string literal not displayed */
PasskeyPrefetchJS: WebAuthn options are fetched BEFORE the tap and kept, so the tap's handler reaches navigator.credentials without a network round trip in between. WebKit grants WebAuthn only within a user gesture, and an await on fetch inside the click handler can outlive it (NotAllowedError on iOS). A prefetched challenge is single-use and GoTrue expires it after 5 minutes, so one older than mpkMaxAge, or one already spent, is fetched again. trigger, when given, is kept on the prefetch: why it was fetched (the confirm dialog's telemetry reports it).
const PluginChipSandbox = "allow-scripts allow-same-origin allow-forms allow-popups allow-downloads allow-modals"
PluginChipSandbox is the panel's frame's sandbox, exactly: no allow-top-navigation of any kind.
const PostgresPresetKey = "postgres"
PostgresPresetKey is the postgres connector preset's key (connectors.PostgresPreset): the form asks for the database settings instead of naming fixed hosts.
const (
PreviewBarToggleLabel = "Show message bar"
)
PreviewBarToggleLabel is the full screen's floating button's name while the message bar is hidden; previewBarHideLabel while it is shown.
const PreviewButtonPath = "/ui/mirror/preview-button"
PreviewButtonPath is the header button's refresh: GET with the window's host, session and window, answering PreviewButton for its counts NOW.
const PreviewFullAttr = "data-preview-full"
PreviewFullAttr marks the panel while it is full screen (the Android app only: its header's one hand-off control reads Full screen there).
const RenameEvent = "muster:renamed"
RenameEvent is the event an in-place answer fires after it settles (HX-Trigger-After-Settle), which renameScript handles.
const RestoreChipDelayMs = 1000
RestoreChipDelayMs is how long a restore catches up before its Updating… chip shows.
const RestoreMaxAwayMs = 10 * 60 * 1000
RestoreMaxAwayMs is how long a page may sit in the back/forward cache and still be shown as it was: past it, a restore reloads.
⚠ IN CHROMIUM THIS RULE ALMOST NEVER FIRES; IT IS KEPT FOR THE OTHERS. Chromium drops a cached page at 600 s by itself (kDefaultTimeToLiveInBackForwardCacheInSeconds; measured in Chromium 153: a static page 590 s away was restored, 610 s away it was not, and Back loaded it from the HTTP cache), so a Chromium restore is already under this bound. WebKit keeps an entry for 30 min (Settings.yaml BackForwardCacheExpirationInterval) and Firefox for 30 min (browser.sessionhistory.contentViewerTimeout): there a page away for 10 to 30 minutes IS restored, and this is what reloads it. That covers Safari and every browser on iOS. Not measured here: the WebKit and Firefox builds Playwright drives have their back/forward caches turned off.
const RestoreParticipantsVar = "__musterRestoreParts"
RestoreParticipantsVar is the window property a page's own script pushes its participant onto: {hide(event), show(reason) → optional Promise (caught up), wake(reason, staleMs) — reconnect if its socket is closed, or open but silent for over staleMs since its last heartbeat (live.go), alive() → false once the page's script has torn itself down}. A list rather than a call, so a script that runs before appScript joins all the same.
const RestoreRefreshAttr = "data-restore-refresh"
RestoreRefreshAttr marks a region a restore redraws from the page's own fresh copy: the element of the fresh document with the same value replaces this one's children. Every such region keeps its size (the switcher's rows are a fixed h-11), so the redraw moves nothing.
const ScrollGaveUpNote = "Scrolling is not reaching the host. Drag again to retry."
ScrollGaveUpNote is what the Terminal view says when scrolls stopped reaching the host and the page dropped what it had not sent.
const ScrollRefusalHeader = "X-Muster-Scroll-Refusal"
ScrollRefusalHeader names, on a scroll's refusal, WHICH refusal it is (one of the ScrollRefusal* codes), so the page acts on a code rather than on a status a proxy could also answer. Only ScrollRefusalUnsupported stops the gesture; every other one shows its note, keeps the gesture wired and clears once a scroll lands.
const SendAgainField = "again"
SendAgainField is the form field that says a send IS the person's explicit "Send again" of a message that may already have been delivered: the server refuses the same text to the same place without it (internal/api sendNonces.hold).
const SendAgainHeader = "X-Muster-Send-Again"
mirrorComposerScript sends the composer's text without leaving the page.
🔴 IT DOES NOT WAIT FOR THE ANSWER (composer_pending.go, which holds the script: mirrorComposerJS). The box empties and the message is drawn as pending at the press; the answer then settles it — sent (replaced by its transcript row), refused (failed, with the reason, Retry, and the text back in the box), or a step-up.
A 403 carrying X-Muster-Step-Up means the sign-in is not fresh: "Confirm it's you" is asked (window.musterStepUp, stepup_confirm.go) and on success the SAME request — the pending message's own text and nonce — is sent again. The page never decides freshness; the server does. Nothing typed → MirrorComposeEmpty rather than a Send that silently does nothing.
🔴 WHEN THIS SCRIPT'S WAY FAILS, THE BROWSER'S TAKES OVER (native()). Three cases, each of which used to end in nothing visible or in a guess:
- the request got NO ANSWER while the browser believes it is online — a sign-in redirect at an edge that a fetch cannot follow, a proxy's own error. The browser's own form submission CAN follow a redirect, and shows whatever the edge has to say;
- a stale sign-in on a page with no confirm dialog to ask through;
- anything this script throws.
Offline is the one failure it keeps for itself: it says so and keeps the text, because the browser's answer to a submit with no network is an error page in place of the conversation. SendAgainHeader marks a send's answer that MAY have been delivered (the host never confirmed it): the composer offers "Send again", which mints a new nonce; the same nonce is never delivered again (internal/api).
const SendQueueDeleteLabel = "Delete this message"
SendQueueDeleteLabel is a finished message's Delete, as a screen reader names it.
const SendQueueEditHoldMinutes = 10
SendQueueEditHoldMinutes is how long an edit holds its message, in minutes (sendqueue.EditHold; a test in internal/api holds the two together).
const SendQueueEditParam = "edit"
SendQueueEditParam is the query parameter that draws a held row open as its edit form, on the view (a no-script Edit's redirect) and on the list (the script's re-read after an Edit).
const SendQueueFullLabel = "Show the whole message"
SendQueueFullLabel is the start of what a screen reader names a row's preview, which a tap opens whole (sendQueuePreview).
const SendQueueHoldParam = "hold"
SendQueueHoldParam is the hold an Edit gave this device: the form is drawn only under it (a held row named under any other is being edited elsewhere).
const SendQueueLabel = "Queue for when idle"
SendQueueLabel is Queue's text in the caret menu.
const SendQueueMayHaveSentText = "May already have been sent."
SendQueueMayHaveSentText is what a failed message that may already have been sent says beside its Retry.
const SendQueuePath = "/send-queue"
SendQueuePath is the queue's route: POST queues a message, GET is a target's list (SendQueueList), drawn as a fragment.
const SendQueueWaitingFullID = "mv-queue-waiting-full"
SendQueueWaitingFullID is the popover that shows the waiting line whole.
const SessionDriftDismissPath = "/sessions/name/drift-dismiss"
SessionDriftDismissPath is the offer's "Keep" (internal/api name_drift.go).
const SessionNameMaxRunes = 60
SessionNameMaxRunes is the store's bound on a typed name (focus.MaxNameRunes — this package does not import the store); internal/api pins the two equal.
const SessionNamePath = "/sessions/name"
The rename route for a MIRRORED session (internal/api session_names.go); an agent is renamed at its own POST /agents/{id}/name.
const SidebarSearchID = "sidebar-search"
SidebarSearchID is the sidebar's magnifier (sidebarSearchButton).
const SnapStoreDB = "muster-snap"
SnapStoreDB is the IndexedDB database the store keeps snapshots in. The purge deletes it by this name; mirror-snap.js spells it once too, and TestTheSnapshotPurgeNamesTheStoresDatabase pins the two together.
const SuggestCutoff = 8 * time.Second
SuggestCutoff is how long after a turn ends its suggestions may still appear; past it they never do (and the server stops before spending).
const SuggestPausedText = "Suggested replies are paused: you rarely tapped them."
SuggestPausedText is the composer's line while the viewer's suggested replies are auto-paused.
const SuggestRowLabel = "AI-suggested replies"
SuggestRowLabel names the row (its group's accessible name).
const SwitcherID = "session-switcher"
SwitcherID is the bar's element id.
const (
// SwitcherMoreLabel is the ⋯ button's accessible name.
SwitcherMoreLabel = "More for this session"
)
The ⋯ menu and its button.
const SwitcherPinID = "switcher-pin"
SwitcherPinID is the pin's menu item (a submit button): one per page.
const SwitcherPinView = "switcher"
SwitcherPinView is the form field value that asks the pin routes to answer with the bar's pin item (internal/api pins.go) rather than an empty answer.
const SwitcherTmuxLineClass = switcherTmuxLineClass
SwitcherTmuxLineClass is switcherTmuxLineClass, for internal/api's tests.
const TermTitleID = "term-title"
TermTitleID is a Terminal page's header title (terminalTitle): what a rename's in-place answer swaps, and focuses (by script only: tabindex -1).
const ThemeColorDark = "#110F1C"
ThemeColorDark is the dark theme's background (`--mu-bg` on `.dark`). It is the default theme, so it is also the manifest's theme_color and background_color (internal/api serves the manifest from these values).
const ThemeColorLight = "#F6F4FB"
ThemeColorLight is the light theme's background (`--mu-bg` on `:root:not(.dark)`).
⚠ NOTHING RENDERS IT ANY MORE: the light theme is unreachable (the sidebar's toggle is gone and ThemeHead forces dark). The light tokens in input.css and their contrast tests stay until a later cleanup removes the light palette as a whole; this constant stays with them so TestThemeColorsAreTheBackgroundTokens still pins it to its token.
const TmuxOneLiner = "tmux new -A -s work claude"
TmuxOneLiner is how a coding agent is started so muster shows it: inside tmux, on a machine whose muster-mirror is connected.
const TranscribePath = "/transcribe"
TranscribePath is where a recording is posted.
const UpdatingChipAttr = "data-updating-chip"
UpdatingChipAttr marks a page's Updating… chip (updatingChip). A page with one is a VIEW page, and a restore re-requests it.
const UploadPath = "/uploads"
UploadPath is where the composer posts a file.
const UserMarkerName = "muster-user"
UserMarkerName is the <meta> every VIEW page carries naming its signed-in user (UserMarker).
const ViewChiefSwitchName = "Send to the chief"
ViewChiefSwitchName is the switch's fixed accessible name (and title); its checked state says whether it is on.
const ViewFrameAttr = "data-muster-view"
ViewFrameAttr marks the frame that holds the other view; its value is that view's name (ViewRendered, ViewTerminal).
Variables ¶
var AttentionKindIcons = map[string]struct{ Icon, Words string }{
"session": {"🔒", "a session waiting at a prompt"},
"question": {"💬", "a session asking a question"},
"ask": {"❓", "an agent's question"},
"plugin": {"✉️", "a reply draft to approve"},
}
AttentionKindIcons is each attention kind's badge icon and the words a screen reader hears for it. internal/api's TestEveryAttentionKindHasABadgeIcon pins that every kind an entry can count is here.
var QuickKeys = []QuickKey{
{ID: "esc", Label: "Esc", Aria: "Escape", Seq: "\x1b"},
{ID: "tab", Label: "Tab", Aria: "Tab", Seq: "\t"},
{ID: "stab", Label: "⇧Tab", Aria: "Shift Tab", Seq: "\x1b[Z"},
{ID: "ctrlc", Label: "^C", Aria: "Control C", Seq: "\x03"},
{ID: "enter", Label: "⏎", Aria: "Enter", Seq: "\r"},
{ID: "1", Label: "1", Aria: "1", Seq: "1"},
{ID: "up", Label: "↑", Aria: "Up arrow", Seq: "\x1b[A"},
{ID: "down", Label: "↓", Aria: "Down arrow", Seq: "\x1b[B"},
{ID: "left", Label: "←", Aria: "Left arrow", Seq: "\x1b[D"},
{ID: "right", Label: "→", Aria: "Right arrow", Seq: "\x1b[C"},
{ID: "2", Label: "2", Aria: "2", Seq: "2"},
{ID: "3", Label: "3", Aria: "3", Seq: "3"},
}
QuickKeys is the bar, in display order. The sequences are what xterm itself sends for the same keys in normal cursor mode; tmux parses them either way. The digits answer the TUI's numbered permission prompts, and Shift-Tab cycles its permission mode.
Functions ¶
func AgentChatDraftKey ¶
AgentChatDraftKey is the draft key of a dispatched agent's chat box, in chat session id.
func AgentDetailPage ¶
func AgentDetailPage(v AgentDetailView, feat Features) g.Node
AgentDetailPage renders the full agent detail document: live logs (SSE) and a chat box (WebSocket) to inject messages.
func AgentHeaderPath ¶ added in v0.110.0
AgentHeaderPath is the strip's refresh: GET /ui/agents/{id}/header.
func AgentListHref ¶
AgentListHref is a list's link to an agent (a sidebar row, a switcher pill, home's target, a task card's Open chat): AgentSessionHref on the session that was the agent's latest when the list was drawn, marked &from=list.
🔴 THE MARKER IS WHAT KEEPS THE ONE-HOP LINK FROM GOING STALE. The bare URL resolved the latest session at TAP time; a pinned ?session= is the latest at DRAW time, and a list can sit open (or in the back/forward cache) while another session becomes the latest. api.Server.handleAgentDetail sees the marker and, only when the named session is no longer the latest, 303s to the latest — so a fresh link costs one hop and a stale one costs the same two the bare URL always did. A link WITHOUT the marker (the session drawer, a redirect after opening a session) means that session and is never moved.
func AgentSendPath ¶
AgentSendPath is where a message for an agent is posted as a form: the composer on its Terminal page, and its chat form when the page's socket cannot carry the message.
func AgentSessionHref ¶
AgentSessionHref is THE in-app link to an agent session's page: /agents/{name}?session={id}, the exact URL a bare GET /agents/{name} answers with its 303 (api.Server.handleAgentDetail builds its Location with this same function, so the two cannot disagree).
🔴 EVERY IN-APP LINK TO AN AGENT'S PAGE GOES THROUGH HERE, AND IT NAMES THE SESSION WHENEVER THE CALLER KNOWS IT. The bare URL costs one extra round trip on every open: the browser fetches it, gets the 303, and only then fetches the page. Measured with an emulated phone (350 ms RTT, 4x CPU), the first bubble landed at 828/1203 ms through the bare link and 476/488 ms through this one. api.TestEveryAgentPageLinkGoesThroughAgentSessionHref ledgers every caller and fails when a link to the page is built anywhere else.
sessionID <= 0 (the caller has no session: the agent has none yet, or the read failed) gives the bare page, which still redirects — and creates the session — exactly as before. The bare URL itself keeps redirecting for bookmarks and links from outside the app.
func AgentTerminalDraftKey ¶
AgentTerminalDraftKey is the draft key of a dispatched agent's Terminal view message box (it sends to the agent's current chat session).
func AgentTerminalPage ¶
func AgentTerminalPage(v AgentTerminalView) g.Node
AgentTerminalPage is a full-height document: a header, the terminal, the quick-key bar, the message composer (when there is one) and the session switcher.
🔴 THE SWITCHER IS SERVER-RENDERED AT A FIXED HEIGHT, BEFORE THE TERMINAL'S SCRIPT, so the terminal's first measure of its box (agentTerminalScript's proposed()) is already the box with the bar's room taken: its arrival, its pending-until-whole visibility and a view switch in it change no layout, and so send no resize. (And no size the page could send shrinks the far side's window anyway: internal/termsize.)
🔴 LIVE KEYS ARE ALWAYS ON; THERE IS NO SWITCH (operator ask: "make live terminal keys always enabled and hide the button for it"). Keystrokes and the quick keys go straight into the session. ALWAYS-ON BYPASSES NO GATE:
- a mirrored session's live keys still need a FRESH sign-in (internal/stepup). The page attaches with them when it believes the sign-in is fresh; otherwise it attaches without and the first key pressed asks "Confirm it's you" (passkey or password). The server refuses an interactive attach on a stale sign-in whatever the page does;
- a host that did not advertise -interactive takes no keys: they are drawn disabled (ReadOnlyOnly), and the hub refuses an interactive attach to it.
A terminal hidden behind the other view (view_swap.go) keeps its attach as it is — its frame is inert there, so nothing can type into it — rather than re-attaching twice on every swap.
🔴 THE PAGE NEVER CALLS ITSELF "READ-ONLY" — the composer under the terminal sends whatever the keys can do. A host that genuinely cannot be sent to says so ONCE, in its composer's disabled note (MirrorReadOnlyNote).
🔴 IT IS ITS OWN DOCUMENT, NOT A PANEL OF THE AGENT PAGE. The agent page is hx-boost'ed and its chat script tears down and re-creates its socket on every boosted swap; a terminal living inside that lifecycle would be re-attached on every navigation. The links into this page opt out of boost, so it is always a real load with its own scripts. The Rendered | Terminal switch keeps that: it opens this page in a FRAME over the agent page — its own document still — rather than in the agent page's body (view_swap.go).
⚠ THE SERVER DECIDES INDEPENDENTLY: it attaches read-only for anything but mode=rw, and refuses mode=rw where the gates above say no.
🔴 A WIDER FAR SIDE IS SCROLLED, NOT SQUEEZED (internal/termsize). When the session's window is wider (or taller) than this page, the far side keeps its size and says so in-band; the page renders that size inside #term-scroll, which scrolls both ways and can be pinch-zoomed, and offers "Fit width".
func AgentTerminalPath ¶
AgentTerminalPath is the terminal page of an agent.
func AskerAsksBlock ¶
AskerAsksBlock is a session page's block of its asker's OPEN attention asks: inner, the content internal/api renders (the queue's own items and answer forms; "" for none, and then the block takes no room), refreshed from src. viaHTMX: the page is in the shell, whose htmx SSE refreshes it (the agent page); otherwise (the mirrored view, its own document) the page carries internal/api's attentionLiveScript, which refreshes it by its id.
Bounded and scrolling on its own (max-h, overflow-y-auto, flex-none), so on a phone it never pushes the conversation or the pinned composer off screen.
🔴 ONE QUESTION AT A TIME, EACH CLAMPED IN ITS OWN CARD (an operator report: the block "looks broken on mobile"). Seven long questions filled the block's scroll box with the first one's text, cut off mid-sentence at the box's edge, and left the conversation a sliver. Now the list (AskerAsksList) shows the first ask and keeps the rest behind one "Show N more"; each question's text is clamped to four lines (web/css/input.css, "The asker block") and its "Show more" is drawn INSIDE its card, opening it in place — see ONE AT A TIME, CLAMPED below. With the compact answer form (THE COMPACT ANSWER FORM) one card, its "Show N more" and the heading measure 378px at 412×915 — inside the 45vh cap (412px there); at 40vh (366px) it did not.
🔴 BUT A REAL CARD IS BIGGER THAN THAT FIXTURE'S, SO WHILE ONE CARD SHOWS THE BLOCK GROWS TO FIT IT (web/css/input.css, "The asker block": the cap rises to 65dvh) and the conversation's scroller shrinks instead. Live at 0.148.0 a chief's card with two long options and dictation's mic needed 504px at 412×915, the 45vh cap cut Answer and Dismiss at the block's scroll edge, and the spec — whose fixture had neither — stayed green. 65dvh still leaves the header, a strip of conversation and the composer on screen; a card taller even than that (a text opened by "Show more", a long typed answer, many options) scrolls inside, the one case left to the scroller. Once "Show N more" opens the list the cap is 45vh again: a list of cards scrolls. e2e chief-mobile.spec.ts measures the real card's fit at 412×915.
It carries "Hide until next ask" (AskerAsksHeading) and, after it, the chip that reopens it (askerAsksChip) — see HIDE UNTIL NEXT ASK below.
func AskerAsksHeading ¶
AskerAsksHeading is the block's heading row: the count (n, "1 question"), as "<n> waiting", and the hide button. internal/api's askerAsksHTML draws it above the items.
🔴 ONE LINE: the heading truncates and the hide is a quiet nowrap text button (a 44px tap target, no border). It was an uppercase "WAITING ON YOUR ANSWER: 7 QUESTIONS" that wrapped to two lines beside a bordered button.
func AskerAsksList ¶ added in v0.148.0
AskerAsksList is the block's list: items, the queue's own <li> cards for n asks (internal/api's attentionItemsHTMLTo), and — when there is more than one — the "Show N more" that reveals the rest (ONE AT A TIME, CLAMPED).
func AskerAsksLive ¶
AskerAsksLive is what keeps a block drawn with viaHTMX false live: the queue page's own script, on the block (nothing without a block).
func AsksGroupLabel ¶ added in v0.207.0
AsksGroupLabel is one group's label: its name and its count, as an <h2> with id — what the group's own list names as its aria-labelledby (the caller sets it). The count is its own element, so the label's words are the label's; a visually-hidden ", " between them makes a screen reader say "Questions, 2" rather than "Questions2".
func AttentionBadgeHTML ¶
AttentionBadgeHTML is the badge for n waiting items: hidden at zero. It is the slot's CONTENT and carries no htmx wiring of its own.
func AttentionLiveScript ¶
AttentionLiveScript keeps the element listID live: on the queue's SSE event (event: internal/api's EventAttentionChanged) it re-fetches src into it — unless the owner is typing an answer (askBusyFunc), in which case it waits until they leave the field. The /attention page's list and a mirrored window's asks block use it; each is its own document (no htmx), so it opens its own stream.
func AwaitingApprovalBadge ¶
AwaitingApprovalBadge is the small pill shown while an agent waits on a human to approve a tool call.
func CCQueued ¶ added in v0.129.0
CCQueued is the region with list in it — hidden, and empty, when list is empty. Each message is text (gomponents escapes it), the host's redacted, bounded copy (mirror.NormalizeQueued).
func ChatLogBody ¶
func ChatLogBody(v AgentDetailView) ([]byte, string, error)
ChatLogBody renders #chat-log's inner HTML for v and its version: a hash of exactly those bytes. The page (chatLogVersioned) and the partial (api.Server.handleAgentChatLog) both get theirs from here, so "unchanged" means "the server would draw the same bytes" — new messages, a status move (the provisioning row), the task banner and the surface all change it, with no list of inputs to keep in step.
🔴 WHY THE REFETCH IS CONDITIONAL: every open of an agent page sent its whole transcript TWICE. The document carries it, and then the htmx:sseOpen arm of chatLogTrigger re-fetched all of it (~72 KB at chatHistoryCap's 200 messages) the moment the event stream connected, and swapped it in again. That arm exists to catch a broadcast missed between render and connect, so it cannot simply go; with the version it costs a 204 unless something really did change.
func ChatMessageHTML ¶ added in v0.180.0
ChatMessageHTML is chatMessageBody as an HTML string: what the chat socket sends the page for a streamed reply's text so far and for the echo of a sent message. Escape-first (markdownHTML), so it is safe to assign to innerHTML.
func ChiefArchivePath ¶ added in v0.201.0
ChiefArchivePath is the archive (archived true) or unarchive route of chat sid.
func ChiefContextPath ¶ added in v0.201.0
ChiefContextPath is the context chip's partial for chat sid of agent name.
func ChiefFreshPrimaryPath ¶ added in v0.201.0
ChiefFreshPrimaryPath is the fresh-primary route.
func ChiefPanel ¶
ChiefPanel is the slide-out itself, rendered at BODY level by the shell.
🔴 BODY LEVEL IS WHAT SATISFIES CRITERION 3. #panel-tmux replaces its entire innerHTML every 60s and on every snapshot push; the other four tab panels swap independently. A panel rendered inside <main> would be destroyed by any of them — along with the operator's half-typed message and the live WebSocket — so it is a sibling of the FABs and popovers, which are body-level for exactly this reason.
func ChiefPanelToggle ¶
ChiefPanelToggle is the launcher, rendered by the tmux panel body.
⚠ IT IS RENDERED INSIDE A SWAP TARGET AND THAT IS FINE. It is a plain <button> carrying a data attribute; the handler is delegated on `document`, so a button destroyed and rebuilt on every panel refresh keeps working without a rebind. That is the whole reason constraint 3 is worth obeying.
func ChiefSideChatButton ¶ added in v0.201.0
func ChiefSideChatButton(agentID int64, surface ChatSurface) g.Node
ChiefSideChatButton is the labelled "New side chat" control on a chief's chat, for surface. 🔴 VISIBLE TEXT, NOT AN ICON: the icon-only + it replaces on the chief page carried its name only in aria-label, and the operator could not find it.
func ChiefSideChatPath ¶ added in v0.201.0
ChiefSideChatPath is the side chat route: POST opens a new side chat.
func ClampComposeBody ¶
ClampComposeBody cuts s to composeMaxBytes without splitting a UTF-8 sequence.
func ComposePage ¶
ComposePage is the tasks shell with the new-task sheet opening itself on load, pre-filled with body. It is what GET /share and the "New task" shortcut (/tasks?new=1) serve.
🔴 IT CREATES NOTHING. Opening the page only fills the form; the task is written by the operator pressing Save, through the SAME POST /tasks every other create uses — one write path, one session check, one broadcast. A GET that wrote would be a create-by-link.
func ComposeURL ¶
ComposeURL is the new-task sheet's body URL with an optional pre-filled body. The value is query-escaped here and attribute-escaped by gomponents.
func ConnectorForm ¶
func ConnectorForm(f ConnectorFormView) g.Node
ConnectorForm is the create / enter-credential form.
func ConnectorRequests ¶
func ConnectorRequests(list []ConnectorRequestView) g.Node
ConnectorRequests renders the pending-request cards (empty when none).
func ConnectorRotateForm ¶
ConnectorRotateForm replaces a connector's secret.
func ConnectorsPanel ¶
ConnectorsPanel is the tab's static shell; it lazy-loads /ui/connectors.
func DictateControlHTML ¶ added in v0.121.0
DictateControlHTML is dictateControl rendered to a string.
func DictateNoteHTML ¶ added in v0.121.0
DictateNoteHTML is dictateNote rendered to a string.
func DictateOffControlHTML ¶ added in v0.149.0
DictateOffControlHTML is dictateOffControl rendered to a string: the muted mic of an answer box built as HTML in internal/api.
func DictateScriptHTML ¶ added in v0.121.0
DictateScriptHTML is dictateScript rendered to a string: once per page, AFTER every mic the page draws at load (its first run reveals the mics then on the page; a later one is shown by htmx:load or DictateRevealEvent).
func DispatchAgentCard ¶ added in v0.161.0
func DispatchAgentCard(c DispatchCard) g.Node
DispatchAgentCard draws one card: a refusal's compact line, or a started agent's card.
func DispatchCardGuard ¶ added in v0.165.0
DispatchCardGuard is the guard's script element (dispatchCardGuardJS).
func DispatchCardHostSrc ¶ added in v0.170.0
DispatchCardHostSrc is a host dispatch's card URL, by its row id.
func DispatchCardRefusedSrc ¶ added in v0.161.0
DispatchCardRefusedSrc is a refusal's card URL (the live stream asks for it).
func DispatchCardSrc ¶ added in v0.161.0
DispatchCardSrc is the card's own URL: for a started agent, by its id.
func DocHeadHTML ¶ added in v0.188.0
DocHeadHTML is docHead as a raw string, for internal/api's hand-written documents (writeAuthDocument: sign-in, claim, invite, reset, notice), the way ThemeHeadHTML carries ThemeHead there. It renders docHead itself, so the link markup has one spelling.
The manifest link is included on those signed-out pages on purpose: the manifest is the same for every caller and needs no session (internal/api's TestPWAMetadataIsSessionIndependent), so linking it from a signed-out page exposes nothing. A link does not change what a forward-auth proxy lets through (docs/auth.md keeps /manifest.webmanifest behind its sign-in): the browser's fetch of it is answered by the proxy like any other.
func EndSessionCard ¶ added in v0.183.0
EndSessionCard is end_session x's card or line on the view at ref; nil when there is nothing to draw (declined).
func FeatureHref ¶ added in v0.149.0
FeatureHref is a feature's row on the Features page — where every hint beside a control that is hidden because its feature is off links to.
func FocusAgeLabel ¶ added in v0.152.0
FocusAgeLabel is age in words, for its element's title and aria-label: the focus age sits beside a waiting time drawn in the same "· 3m" shape, and must not be read as one. "" when there is no age.
func FocusAgeSuffix ¶ added in v0.157.0
FocusAgeSuffix is age as plain text after its title — " · 2d" — or "" when there is no age: the Asks list's age element and a notice's push body both spell it through here.
func FocusHistoryPath ¶
FocusHistoryPath is one page of subject's ("agent:12", "mirror:<sid>") history: the newest page for cursor "", else the page after cursor.
func HomeHref ¶ added in v0.110.0
func HomeHref(list []AgentCardView, mirrors []MirrorCardView, refs []RecentRef) string
HomeHref is where home (`/`, and the retired /agents) opens for a viewer with no chief to open (internal/api homeTarget): the session the viewer opened LAST that is still listed (refs, newest first — the switcher's Recent order), else the sidebar's first row (navOrder: whoever waits on the operator, then the most recently active), else "" — nothing to open, and home draws the onboarding page.
🔴 A CONVERSATION, NOT A PAGE OF CONVERSATIONS (operator decision: "make the default view open to the chief"). Without a chief, an empty page whose only way on is a drawer that starts shut on a phone would be a dead end; the last conversation is what a chat app opens.
func HomeLeavingMirrorPath ¶ added in v0.110.0
HomeLeavingMirrorPath is home, leaving the mirrored window at r out — where that window's Rendered view and terminal send their Home arrow. Opening the view records a visit, so without it home with no chief is this very window.
func HomeLeavingPath ¶ added in v0.110.0
HomeLeavingPath is home, leaving the agent named name out — where a page that sends the viewer away from that agent (Mark complete) sends them. Without it, home with no chief is the session opened last: the very page being left.
func HostIconFor ¶
HostIconFor is the icon key of a mirrored host: its named icon (HostPreferences.Icons) when it has one; else by its registration rank in ranks (mirror.RanksByRegistration) — rank r draws rankedIcons()[r mod N] — or, for a host ranks does not hold, by a hash of its name. A glyph named for a host is never drawn for another. This is the one rule; every surface that draws a host's icon is handed its result.
func IdleSectionAfterLabel ¶
IdleSectionAfterLabel is a threshold as the boot banner says it (the retired Agents list's Idle header said it too): whole days ("14 days"), else whole hours ("36 hours"), else the duration.
func InIdleSection ¶
InIdleSection is the ONE rule: whether an entry last active at activeAt is drawn in the Idle section, as of now. See the file header.
func KickoffFailedRemedy ¶
KickoffFailedRemedy is the remedy line under a failed kickoff. Nothing re-sends automatically: the deliverer stamps kicked_off before the paid turn so a turn is never run twice, and a turn that fails after the stamp is not retried (an operator decision).
🔴 IT TELLS THE OPERATOR TO CHECK BEFORE RE-SENDING UNLESS NOTHING WAS SENT. A shutdown, a timeout or a transport error after the request was written can leave the runtime still running the turn, and an empty reply can hide a turn the runtime retried and finished; re-sending then pays for the task twice. Only a connection that was never opened, or a runtime that refused the turn as not_ready for the whole delivery, proves otherwise (resendSafe).
⚠ ITS ONLY DYNAMIC PARTS ARE THE AGENT'S NAME AND NAMESPACE, which the agent's page and GET /api/agents already show. No part of the note or of kickoff_error is in it; api.TestAnOwedKickoffIsReportedWithoutTheNotesText scans the rendered remedy.
func LiveHeartbeat ¶
LiveHeartbeat is the interval every live stream's server sends a heartbeat at, and the one the page's staleness thresholds are derived from (the page reads it off appScript's tag, data-heartbeat).
func LiveStale ¶
LiveStale is how long a socket that has heard a heartbeat may go silent before the watchdog replaces it: two heartbeats missed, and a margin.
func LiveWakeStale ¶
LiveWakeStale is the same at a wake: one heartbeat missed, and a margin. A page waking from sleep has not been able to hear anything, so the bound is tighter than the watchdog's.
func MarkIdle ¶
func MarkIdle(agents []AgentCardView, mirrors []MirrorCardView, now time.Time, after time.Duration)
MarkIdle sets each view's Idle by InIdleSection over its last activity (listEntry.activeAt), in place. internal/api calls it once per build of the entries, after the pins are marked.
func MarkdownHTML ¶ added in v0.205.0
MarkdownHTML is the renderer for a DOCUMENT rather than a chat bubble: a shareable page's markdown block (internal/pages draws it inside the page's sandboxed document, which loads no app.css). The one difference from markdownHTML is that an ATX heading is a real <h1>…<h6>, not a styled div. Every author character is escaped; only the renderer's own tags are emitted.
func MirrorAskCall ¶
MirrorAskCall is a call the transcript holds with no result yet: its questions, read-only. Claude Code writes the call when its picker opens and its result once it is answered or dismissed (measured on 2.1.289), so this is drawn for every open question. 🔴 IT IS A FALLBACK, NOT THE QUESTION'S CARD: while the live region holds a card for the call (data-ask-row naming this row), the page hides this row (askScript), so the question is on the page once — answerable, or saying why not (a read-only, offline or older host). Only a call muster tracks nothing of shows it, with AskNoCardNote.
func MirrorAskLive ¶
func MirrorAskLive(v MirrorAskLiveView) g.Node
MirrorAskLive is one card of the live region.
func MirrorAskResult ¶
func MirrorAskResult(rowID string, qs []askq.Question, answers map[string]string, note string, extra ...g.Node) g.Node
MirrorAskResult is a call drawn from its result: read-only, with the answers it was given (none, when the result carries none — the picker was dismissed — and note says what the result said instead).
func MirrorAskRowID ¶
MirrorAskRowID is the element id the conversation gives the call toolID — a tool row's (toolRowID) — which the live region reads to know the conversation has drawn it.
func MirrorAsksLive ¶
func MirrorAsksLive(vs []MirrorAskLiveView) g.Node
MirrorAsksLive is the live region's content: one card per view.
func MirrorAsksSrc ¶
MirrorAsksSrc is the live region's URL for the window ref.
func MirrorCardHref ¶
func MirrorCardHref(m MirrorCardView) string
MirrorCardHref is where a mirrored entry opens: the rendered view for a Claude Code pane or an opencode one with a known session, the terminal for anything else.
func MirrorDraftKey ¶
MirrorDraftKey is user's draft key of a mirrored window's message box: view is "view" (Rendered) or "terminal", then the host, the tmux session and the window id ("" for a per-session host's session).
func MirrorPromptID ¶
MirrorPromptID is a mirrored prompt's element id, from its Event.Line: the ONE spelling both its bubble (Ops) and its prompt-index entry (NewMirrorIndex) use, so the message index finds the bubble a prompt has.
func MirrorTerminalPath ¶
MirrorTerminalPath is a mirrored session's terminal page (its active window).
func MirrorTerminalWSPath ¶
MirrorTerminalWSPath is that page's socket, before the page adds its mode and size.
func MirrorViewOnlyNote ¶
MirrorViewOnlyNote is the disabled composer of a window of kind, a runtime muster only views (opencode, docs/design/opencode.md).
func MirrorViewPage ¶
func MirrorViewPage(v MirrorViewView) g.Node
MirrorViewPage is the rendered view's document.
⚠ ITS OWN DOCUMENT, like the terminal page: a real load (the links into it opt out of boost), with its own socket and script.
func MirrorViewPath ¶
MirrorViewPath is a mirrored session's rendered view (its active window).
func MirrorViewWSPath ¶
MirrorViewWSPath is that page's transcript socket, before the page adds its resume point.
func NavAgentsList ¶
func NavAgentsList(list []AgentCardView, mirrors []MirrorCardView, currentURL string, now time.Time) g.Node
NavAgentsList is the partial: the entries in navOrder, the page's own session (currentURL, see navCurrent) marked.
func NavDocument ¶
func NavDocument(v NavDocumentView) g.Node
NavDocument is the document every server-authored signed-in page is: the navigation, the shell's header, and the page's own content in the column the bare pages use (max-w-sm), so the content reads as it did before.
🔴 <body> CARRIES NO hx-boost, unlike the shell's. These pages are made of plain forms — sign out, mint a token, revoke a device — whose POST answers with a redirect or a whole document; boosted, each would become an AJAX body swap of a page that was never written for one. The sidebar's links are therefore ordinary navigations here, as their own hx-boost="false" links already were.
func NavWaitingBadgeHTML ¶ added in v0.175.0
NavWaitingBadgeHTML is the badge for n waiting entries: hidden at zero. It is the slot's CONTENT and carries no htmx wiring of its own. Its text is the ☰ button's description (aria-describedby), so a screen reader hears "Open menu, 2 waiting on you".
func NavWaitingCount ¶ added in v0.175.0
func NavWaitingCount(list []AgentCardView, mirrors []MirrorCardView) int
NavWaitingCount is how many entries wait on the viewer (listEntry.waiting).
func NotesCards ¶
NotesCards is the /ui/tasks partial: the filter chip rows, then ONE flat list of task cards ordered strictly newest-activity-first, then the show-more control — morphed into #tasks-list.
🔴 IT USED TO BE THREE SECTIONS (In progress / Open / a collapsed Done <details>), and losing them is the point rather than a side effect. A section split orders by STATUS FIRST and time second, so the single most useful question a board answers — "what moved most recently?" — could not be read off it at all: a task an agent had been working for an hour sat below a task whose status happened to sort higher. Status is now a per-card attribute plus a filter chip row, which is strictly more information in less vertical space.
🔴 data-task-section IS GONE, AND WHAT REPLACES IT IS NOT A RENAME. The old attribute carried the HUMAN LABEL ("In progress"), which made every assertion over it a SPELLED guard: any feature that spelled those two words satisfied it, and a relabel would have silently emptied its coverage. Each CARD now carries `data-task-status="<raw status>"` — the enum the store persists — which cannot be satisfied by prose and survives any relabelling of the chips. Every assertion site migrated to it (internal/ui, e2e/tests/tasks.spec.ts, tasks-mobile.spec.ts, task-sse-regroup.spec.ts).
🔴 The two empty states are DELIBERATELY different: with a filter active, an empty result means "nothing matches this filter" (+ a Clear control), NOT the generic "no tasks yet" all-clear. Rendering all-clear under a filter is the classic trap — the user reads an empty queue when their work is merely hidden. "A filter is active" now includes a status chip, not only tags: a status-only filter that matched nothing used to fall through to the all-clear.
func NotesEditModalBody ¶
func NotesEditModalBody(v NoteEditView) g.Node
NotesEditModalBody is the /ui/tasks/{id}/edit partial: the EDIT-task form, pre-filled with the task's current directory/body/model/repo/branch, loaded into #task-modal-body when the card's Edit button is tapped. It posts (urlencoded) to /tasks/{id}/edit, morphs the refreshed single card into #task-{id}, and closes the modal on success. Only the EDITABLE fields appear — status, provenance, comments and attachments are not editable here. All values are escaped by g.Text / attribute encoding.
func NotesModalBody ¶
NotesModalBody is the /ui/tasks/new partial: the create-task form, loaded into #task-modal-body when the FAB is tapped. It posts multipart/form-data to /tasks, morphs the result into #tasks-list, and closes the modal on success.
func NotesModalBodyWith ¶
NotesModalBodyWith is NotesModalBody with the task text pre-filled — what a share or the "New task" shortcut opens (ComposePage). The text is a Textarea CHILD, so gomponents escapes it: shared markup arrives as inert characters.
func NotesPanel ¶
NotesPanel is the static shell for the Tasks tab. The + FAB (body-level, in Page) is the sole task-create path; only the inner #tasks-list refreshes. It refreshes from /ui/tasks on tasks:changed (a local create/edit), on sse:task.changed (an agent mutated a task out-of-band), on sse:agent.changed (a linked agent's status moved — so the card's status chip stays live without a reload) and on muster:resync. Its FIRST content is drawn (non-nil drawn: the Tasks tab's own document carries the board, tasks_list_ssr.go) or, on any other tab, the skeleton its own `load` request replaces. 🔴 IT TAKES NO PENDING COUNT, AND THE SEGMENTED CONTROL IS GONE WITH IT. Upstream rendered a [Requests | Tasks] segmented toggle at the top of this panel, carrying a live count of pending permission requests on the Requests half. muster has no permission-request surface, so the control would be a two-position switch with one position — and the count would be a badge permanently reading zero, which reads as "no requests" rather than "not a thing this service does".
func Page ¶
⚠ SEAM — THIS DOCUMENT REFERENCES SIX FILES UNDER /static/ THAT muster DOES NOT YET CARRY, AND EVERY ONE OF THEM FAILS SILENTLY.
WHAT: the head below loads /static/vendor/htmx.min.js, /static/vendor/idiomorph-ext.min.js, /static/vendor/sse.js, the two Faro scripts (conditionally) and /static/icons/icon-192.png. web/static/ holds exactly one file today — app.css, built by `make css` — so the other five are 404s, and /static/ is not even registered as a route yet. WHY IT IS NOT VISIBLE HERE: a missing <script src> does not error the page. It renders, styled, and then does nothing: no htmx means every panel stays a skeleton because no hx-get ever fires, no idiomorph means every `morph:` swap silently degrades to a destructive one, no sse.js means the page is write-only. Nothing in this package can observe that — these renderers emit markup, and the markup is correct. WHY THEY ARE NOT CARRIED IN THIS CHUNK: they are third-party binaries whose home is web/static/vendor/, served by a /static/ route this chunk deliberately does not register, and embedded by a web package that would make `go build ./...` depend on their presence. CLOSING CONDITION: the API carve lands the web package, vendors these five files, registers `GET /static/`, and a test asserts that every `/static/...` path this package emits resolves to a file the embed actually contains — derived by scanning the sources, not by listing the paths a second time. WHO CHECKS IT: the reviewer of the API-carve pull request, against that derived test.
func ParseIdleSectionAfter ¶
ParseIdleSectionAfter reads MUSTER_AGENTS_IDLE_AFTER: "" is the default; "0" or "off" turns the section off; otherwise a whole number of days ("14d") or a Go duration ("336h"), from MinIdleSectionAfter to MaxIdleSectionAfter.
func ParseLiveHeartbeat ¶
ParseLiveHeartbeat parses MUSTER_LIVE_HEARTBEAT: "" is 0 (keep the default), anything else a Go duration within the bounds.
func PreviewButton ¶ added in v0.194.0
func PreviewButton(p mirror.WindowPreviews, place PreviewPlace) g.Node
PreviewButton is the Preview button for a window's counts p at place: nil while it has nothing to preview. It carries no htmx wiring (the slot does), so a swapped-in button never re-arms a trigger. The two places' buttons have their own ids (preview-toggle, preview-toggle-row) and share data-preview-toggle, which the panel's script reads.
func PreviewButtonSrc ¶ added in v0.194.0
func PreviewButtonSrc(host, session, window string, place PreviewPlace) string
PreviewButtonSrc is PreviewButtonPath for one window's button at place.
func ProposalCard ¶ added in v0.183.0
ProposalCard is proposal p's card on the view at ref, extra being the attributes its kind's region reads (data-succession…).
func ReadOwnerCardResult ¶ added in v0.170.0
ReadOwnerCardResult reads the stored card's ask id out of an ask_owner result; ok false for a result that names none (a refusal, or a server with no attention store).
func RenderAgentDetail ¶
func RenderAgentDetail(w io.Writer, v AgentDetailView, feat Features) error
RenderAgentDetail writes the full agent detail page (logs + chat).
func RenderAgentHeader ¶ added in v0.110.0
func RenderAgentHeader(w io.Writer, a AgentCardView) error
RenderAgentHeader writes the strip's refresh (GET AgentHeaderPath): the strip's body (its #agent-status carries the status the ⋯ menu's lifecycle item follows) and — out of band — the notices.
func RenderAgentsHome ¶ added in v0.110.0
RenderAgentsHome writes the page home draws when it has nothing to open (agentsEmptyState), inside the navigation (NavDocument).
func RenderChiefContextChip ¶ added in v0.201.0
func RenderChiefContextChip(w io.Writer, c *ContextView) error
RenderChiefContextChip writes the context chip for c — nothing when c is nil (no turn of the chat has reported usage yet).
func RenderChiefPanelBody ¶
func RenderChiefPanelBody(w io.Writer, v ChiefPanelView) error
RenderChiefPanelBody writes the panel body partial.
func RenderChiefThreadRows ¶
func RenderChiefThreadRows(w io.Writer, v ChiefThreadsView) error
RenderChiefThreadRows writes the thread-row partial the search route answers with.
func RenderComposePage ¶
RenderComposePage writes ComposePage.
func RenderConnectorForm ¶
func RenderConnectorForm(w io.Writer, f ConnectorFormView) error
RenderConnectorForm writes the create / enter-credential form.
func RenderConnectorRequests ¶
func RenderConnectorRequests(w io.Writer, list []ConnectorRequestView) error
RenderConnectorRequests writes the /ui/connector-requests partial.
func RenderConnectorRotateForm ¶
RenderConnectorRotateForm writes the rotate form for one connector.
func RenderConnectors ¶
func RenderConnectors(w io.Writer, c ConnectorsContent) error
RenderConnectors writes the /ui/connectors partial.
func RenderDispatchCard ¶ added in v0.161.0
func RenderDispatchCard(w io.Writer, c DispatchCard) error
RenderDispatchCard writes one card (DispatchCardPath's answer).
func RenderDriftKept ¶ added in v0.205.0
RenderDriftKept is "Keep"'s answer for htmx: the banner goes, the live region says so. The page's name is unchanged, so nothing else is drawn.
func RenderEndSessionCard ¶ added in v0.183.0
RenderEndSessionCard is EndSessionCard as HTML.
func RenderFocusHistoryPage ¶
func RenderFocusHistoryPage(w io.Writer, v FocusHistoryPageView) error
RenderFocusHistoryPage writes one page as list rows: what the sentinel it was fetched for is replaced with.
func RenderNavAgents ¶
func RenderNavAgents(w io.Writer, list []AgentCardView, mirrors []MirrorCardView, currentURL string, now time.Time) error
RenderNavAgents writes NavAgentsList, its focus ages at now (the server's clock).
func RenderNavDocument ¶
func RenderNavDocument(w io.Writer, v NavDocumentView) error
RenderNavDocument writes NavDocument.
func RenderNavWaiting ¶ added in v0.175.0
func RenderNavWaiting(w io.Writer, list []AgentCardView, mirrors []MirrorCardView) error
RenderNavWaiting writes NavWaitingBadgeHTML for the entries.
func RenderNoteCard ¶
func RenderNoteCard(w io.Writer, v TaskCardView) error
RenderNoteCard writes a single task card, for outerHTML swaps of #task-<id> after a status change or new comment. The view carries the task plus its optional linked agent so the re-rendered card keeps its status chip.
func RenderNotesCards ¶
RenderNotesCards writes the /ui/tasks partial: the tag filter chip row plus the tasks as ONE flat list ordered by most recent activity, morphed into #tasks-list. The view carries each task with its optional linked agent (for the status chip), the tag vocabulary (the chip row), and the ACTIVE filter — the selection is server-rendered so an SSE-driven refresh preserves it.
func RenderNotesEditModal ¶
func RenderNotesEditModal(w io.Writer, v NoteEditView) error
RenderNotesEditModal writes the /ui/tasks/{id}/edit partial (the edit-task form body, pre-filled with the task's current values).
func RenderNotesModal ¶
func RenderNotesModal(w io.Writer, directories []string, directoriesFailed bool, prefill string) error
RenderNotesModal writes the /ui/notes/new partial (the create-note form body).
func RenderNotifications ¶
func RenderNotifications(w io.Writer, active []ActiveRow, unread []NotificationRow) error
RenderNotifications writes the notifications panel partial: an out-of-band FAB badge update (the total UNREAD count) followed by the panel body — an ACTIVE section (agents thinking/responding now or recently) above the existing UNREAD section. This is the GET /ui/notifications response — the FAB hx-gets it into #notif-list and the OOB #notif-badge updates the button badge in place.
func RenderPage ¶
RenderPage writes muster's full document shell to w. activeTab is the tab to show on first paint, derived from the request path for SPA-style deep-linking and clamped by normalizeTab, so an unknown path lands on the default tab rather than rendering a shell with nothing selected.
🔴 THE SIGNATURE IS NARROWER THAN UPSTREAM'S BY FOUR ARGUMENTS, AND EVERY ONE OF THEM WAS ROUTER-OWNED STATE. Upstream also took the pending permission requests (so the queue could be server-rendered into the first byte) and two auto-approve snapshots (so the banner would not grow mid-load and shove the page down). muster has neither surface: there is no request store here and no auto-approve machinery, so there is no state to render eagerly and nothing to reserve height for. Every panel in muster's shell fetches its own partial on `load`.
This file used to carry four more writers — the request list partial, the header popover's quick list, the post-decision card-removal fragment and a single-card render helper. All four take a store.Request, which is the permission router's type, and all four stay with it.
🔴 feat SAYS WHICH OPTIONAL SUBSYSTEMS THE CALLER BUILT, AND IT IS A PARAMETER SO THE ANSWER IS THE REQUEST'S OWN SERVER'S. See Features: the zero value draws the smallest honest shell, so a caller that forgets it under-draws rather than mounting a panel over nothing.
func RenderPageWith ¶
RenderPageWith is RenderPage with state drawn on the first paint (ShellData).
func RenderPreviewButton ¶ added in v0.194.0
func RenderPreviewButton(w io.Writer, p mirror.WindowPreviews, place PreviewPlace) error
RenderPreviewButton writes PreviewButton(p, place) (nothing at zero).
func RenderRepoOptions ¶
RenderRepoOptions writes the lazy-loaded repository combobox option list (swapped in over the skeleton).
func RenderSessionTagsAnswer ¶ added in v0.158.0
func RenderSessionTagsAnswer(w io.Writer, t SessionTagTarget, tags []string, back string, s *Switcher) error
RenderSessionTagsAnswer writes an add's or a remove's htmx answer: the editor's body, the header's chips out of band, and — when s is not nil — the bar's rows and counts out of band (switcherRefresh), whose words the palette and the dock's filter read.
func RenderStatusIcon ¶
RenderStatusIcon writes the compact status icon (the colored dot, no label) for a status. It is the exported render entry for the live-status poll endpoint (GET /ui/agents/{id}/status), reusing statusIcon so the polled icon matches the first-paint icon in the agent-detail / operator header exactly.
awaitingApproval adds the "awaiting approval" badge beside the dot: the agent's terminal is blocked on a permission prompt, or it has a request open on the operator's approval queue. 🔴 THE BADGE LIVES IN THIS POLLED RESPONSE ON PURPOSE — it is a live state, so the 10s poll is what both shows and clears it. It is the opposite of the owed-kickoff badge, which must sit OUTSIDE the polling span because this endpoint never rendered it.
func RenderSuccessionCard ¶ added in v0.183.0
func RenderSuccessionCard(ref MirrorRef, x *SuccessionView) (string, error)
RenderSuccessionCard is SuccessionCard as HTML (the read's card_html).
func RenderSwitcherPin ¶ added in v0.109.0
func RenderSwitcherPin(w io.Writer, pinned bool, fields [][2]string, back string, s *Switcher) error
RenderSwitcherPin writes the ⋯ menu's pin item in its new state and, when s is not nil, the bar's rows and counts out of band (switcherRefresh).
func RenderTagDatalist ¶
RenderTagDatalist writes the GET /ui/tags partial: a bare <datalist> of the tag vocabulary, used as the tag input's suggestion source in the edit modal.
func RenderTaskDetail ¶
func RenderTaskDetail(w io.Writer, v TaskCardView, feat Features) error
RenderTaskDetail writes the full GET /tasks/{id} document: the task rendered in DETAIL shape (body, attachments, session thread, comments, comment form) inside the app's chrome. The view is the SAME TaskCardView the board renders, so there is exactly one card renderer and no forked view.
func RenderTaskModal ¶
func RenderTaskModal(w io.Writer, v TaskModalView) error
RenderTaskModal renders the task-detail modal fragment (overlay + panel) that the header title's hx-get swaps into #task-modal.
func RenderTaskNotFound ¶
RenderTaskNotFound writes the styled GET /tasks/{id} 404 document (sidebar, one <h1>, an explanation and an unboosted link back to the board).
func SendAgainPage ¶
func SendAgainPage(v SendAgainView) g.Node
SendAgainPage is a whole document with one form: the browser's own answer to a send refused because the same message may already have been delivered, when no script ran. 🔴 WITHOUT IT A PAGE WITH NO SCRIPT IS LOCKED OUT: the refusal says "use Send again", and Send again is a button the composer's script draws (audit #275 round 1, Y2). This is that button, as a form.
func SendQueueAnsweredText ¶
SendQueueAnsweredText is what a queued message that answered asker's question when it was queued says under its preview.
func SendQueueCancelPath ¶
SendQueueCancelPath is where message id's Cancel posts.
func SendQueueDeletePath ¶
SendQueueDeletePath is where message id's Delete posts.
func SendQueueEditAnsweredText ¶
SendQueueEditAnsweredText is what the edit form of a message that answered asker's question when it was queued says before anything is typed: the answer stands, whatever the edit.
func SendQueueEditCancelPath ¶
SendQueueEditCancelPath is where an edit's Cancel posts (hold).
func SendQueueEditPath ¶
SendQueueEditPath is where message id's Edit posts: it HOLDS the message (the dispatcher sends nothing of its window while it is held), and then the row is drawn as its edit form (sendQueueEditRow).
func SendQueueEditSavePath ¶
SendQueueEditSavePath is where an edit's Save posts (hold, text).
func SendQueueFullID ¶ added in v0.125.0
SendQueueFullID is the popover holding message id's whole text.
func SendQueueList ¶
func SendQueueList(v SendQueueListView) g.Node
SendQueueList is the list's markup: what GET SendQueuePath answers, and what a composer draws inside its #mv-queue.
func SendQueueRetryConfirmPage ¶
SendQueueRetryConfirmPage is a whole document asking once before a message that may already have been sent is queued again: the browser's own answer to a Retry posted without the confirm (no script ran). It posts to action with field=1. brand is the instance's, for the page's favicon.
func SendQueueRetryPath ¶
SendQueueRetryPath is where message id's Retry posts.
func SendQueueSendNowPath ¶
SendQueueSendNowPath is where message id's Send now posts.
func SetFaroConfig ¶
func SetFaroConfig(c FaroSettings)
SetFaroConfig installs the Faro RUM config read by every page head. Called once from main at startup.
func SetHostPreferences ¶
func SetHostPreferences(p HostPreferences) error
SetHostPreferences installs p (Normalized). A refused p leaves the installed preferences as they were.
func SetLiveHeartbeat ¶
SetLiveHeartbeat sets LiveHeartbeat, process-wide. It refuses a value outside MinLiveHeartbeat–MaxLiveHeartbeat.
func ShellTab ¶
ShellTab is the tab a shell document for the path segment tab draws active — the same clamp the shell applies (`/` is the default tab), so the server builds first-paint state for the tab the reader will actually see.
func SnapPurgeHTML ¶
func SnapPurgeHTML() string
SnapPurgeHTML is the inline script every server-written auth page carries (internal/api writeAuthDocument, /login among them): it deletes every snapshot in this browser. A sign-out always ends there, and so does any sign in, so no user's snapshots outlive their session — even when the sign-out's own page never ran its script. Self-contained: no shared shell, no other script, so the login page stays independent of the rest of the UI.
func SnapScript ¶
SnapScript is the snapshot store's script, for a page that reads or warms snapshots: the rendered view, an agent's page. Deferred, so it runs before DOMContentLoaded and never blocks the parser. Nothing at all without a signed-in user.
func SnapScriptNow ¶
SnapScriptNow is the same tag WITHOUT defer, for the rendered view: placed before mirrorViewScript, it has run when that script is parsed, so the view reads its snapshot (and opens its socket) while the rest of the document is still loading, instead of at DOMContentLoaded. The file is immutable and small, and a parser-blocking script is fetched as early as the deferred one was (the preload scanner finds both).
func SourceTypeLabel ¶ added in v0.147.0
SourceTypeLabel maps a stored source_type producer id to a friendly display label. An unrecognized value falls back to the raw id (still escaped by g.Text at the call site), so a future producer isn't hidden.
func StatusPollPath ¶
func StatusPollPath(id int64, awaiting bool, work mirror.WindowWork) string
StatusPollPath is the agent page strip's status poll (agentStripBody): GET /ui/agents/{id}/status, with awaiting=1|0 saying whether the strip was drawn awaiting approval, and work=WorkPollToken saying which work chip it was drawn with.
func StepUpDialog ¶
func StepUpDialog(s *StepUpView) g.Node
StepUpDialog is the dialog and its script (window.musterStepUp) for a page other than the terminal and the rendered view — today /plugins, whose Approve asks before it submits. Nothing for nil.
func StepUpFormPage ¶
func StepUpFormPage(v StepUpFormView) g.Node
StepUpFormPage is a whole document with one form: the password again, and the pending send in hidden fields. No script is needed to use it — it exists for the page whose script did not run. (A passkey needs script; the dialog on a working page offers one.)
func StoredOwnerCard ¶ added in v0.170.0
func StoredOwnerCard(toolID string, st OwnerCardState) g.Node
StoredOwnerCard draws a card from its stored ask alone (a card muster raised for the chief: no ask_owner call holds its question).
func SubagentTailFragment ¶
func SubagentTailFragment(v SubagentTailView) g.Node
SubagentTailFragment is a card's steps, oldest first, as the fragment the page puts in its tail.
func SuccessionCard ¶ added in v0.183.0
func SuccessionCard(ref MirrorRef, x *SuccessionView) g.Node
SuccessionCard is the card (or line, or banner) of the succession of the view at ref; nil when there is nothing to draw (none, or declined).
func SwitcherPinToggle ¶ added in v0.109.0
SwitcherPinToggle is the ⋯ menu's pin item: a form posting fields (the subject) to PinPath — UnpinPath when pinned — with back, the page to return to without script. Its button is the menu item, named by its words: "Pin this session", or "Unpin this session" (data-pinned="true", in the accent) when pinned.
func TabKeys ¶
func TabKeys() []string
TabKeys returns the ordered tab keys, for a caller that must register one route per tab.
🔴 IT RETURNS A COPY. tabKeys is package state that every nav render reads; handing a caller the backing array would let an append in another package reorder or truncate the navigation. The cost is one small allocation per call, and the only caller calls it once at registration.
🔴 THIS EXISTS SO THE ROUTE TABLE IS DERIVED FROM THE NAV RATHER THAN TYPED BESIDE IT. Upstream those were two hand-written lists and its own comment records what that cost: a "sixth tab registry" no structural test could see, where a tab in the nav and absent from the routes still rendered — from the fallback branch, with the wrong heading, silently. A linked tab whose route does not exist is a 404 in the navigation; deriving one from the other makes that unrepresentable.
func TabsScript ¶
TabsScript is tabsScript for a page drawn outside this package's shell (the Asks page, internal/api): the same once-per-document script.
func TaskCompletePath ¶
TaskCompletePath is the no-JS Mark-complete form's action: a POST that completes the task and redirects to HomePath.
func TaskDetailPage ¶
func TaskDetailPage(v TaskCardView, feat Features) g.Node
TaskDetailPage renders the standalone GET /tasks/{id} document: the task's full body, attachments, session thread, comments and comment form, wrapped in the app's shared chrome.
It is an OFF-SHELL document (its own Doctype/HTML/Head/Body), like AgentDetailPage and sessionDetailPage — the shell's Page() is not reused, because the shell is the multi-panel SPA and this page has no panels.
🔴 hasPanels=false on the sidebar. With no #panel-* elements in this document the sidebar tabs must stay BOOSTED — there is nothing to toggle in place, so a boosted cross-document navigation IS the behaviour. TestSidebarTabBoostIs OwnedByThePanelOwner checks that against the panels actually rendered.
🔴 /tasks/{id} is deliberately NOT in tabFromPath. That switch is exact-match and only feeds handleIndex, which never serves this document — same as /agents/{name} and /suggestions/{id}, neither of which is in it either.
func TaskNotFoundPage ¶
TaskNotFoundPage is the styled 404 for GET /tasks/{id} when the task is dismissed or was never there.
🔴 IT EXISTS BECAUSE OF THE BACK BUTTON, not because a plain 404 is ugly. taskHashScript upgrades every legacy `/tasks#task-N` deeplink — and those are out in ClickUp comments, in ClickHouse activity.events and in several docs — using location.replace(), which CONSUMES the history entry it arrived on. Go's http.NotFound answers with a bare text/plain "404 page not found": no chrome, no sidebar, no link anywhere, and a Back press that leaves muster entirely because the entry the user came from was replaced. The board's old behaviour for the same link was to load and toast "Task #N is not on this board." — this page is that, on a URL that legitimately 404s.
It is an OFF-SHELL document like TaskDetailPage, and deliberately a MINIMAL one: the sidebar (so every other tab is one tap away), a real <h1> (axe page-has-heading-one applies to a 404 too), the explanation, and an unboosted link to the board. No htmx surface at all — there is nothing here to mutate, so there is nothing to keep live and no failure to toast.
func TaskTitle ¶
TaskTitle is the task's DISPLAY label: the explicit `title` (migration 0018) when set, falling back to `directory` — which is what every producer smuggled the title through while POST /api/tasks silently dropped a `title` key (PR #156). One helper so every label site agrees, and so producers can migrate to the real field at their own pace with no behaviour change.
EXPORTED because internal/api needs it too. It previously did not, and both (since deleted) dispatch-picker labels read n.Directory directly — so a producer that correctly sent `title` instead of smuggling it lost its heading in the picker, which is exactly where telling captures apart matters. Any new label site MUST use this, not n.Directory.
func ThemeHead ¶
ThemeHead is the document head's theme block: the theme-color meta that tints the phone's status bar, and the script that keeps the document dark.
🔴 DARK IS THE ONLY THEME. The `dark` class is server-rendered on every <html>; the script re-asserts it and deletes the opt-in the old toggle stored (themeStorageKey), so a device that had chosen light loads dark instead of keeping a preference nothing can change back. Storage access is in a try/catch: a private window or blocked storage must still render, not throw before the page has a body.
⚠ THE SCRIPT IS SYNCHRONOUS ON PURPOSE. It is a parser-blocking <script src> in the head (static_script.go), so it runs before the body is parsed; the sign-in page carries it inline (ThemeHeadHTML). There is no `storage` listener any more: it existed so one document followed a theme another (the view-swap frame, another tab) had set, and nothing sets one now.
func ThemeHeadHTML ¶
func ThemeHeadHTML() string
ThemeHeadHTML is ThemeHead as a raw string, for the sign-in page, which is a hand-written document in internal/api rather than a gomponents tree.
func UploadFilePath ¶
UploadFilePath is the owner's view of upload id (thumbnail, Open).
func UploadRevokePath ¶
UploadRevokePath is where the owner revokes upload id's link.
func UserMarker ¶
UserMarker names the page's signed-in user in its head, so a restored page that re-requests itself can tell an answer drawn for ANOTHER user (one device, another person signed in since) and reload rather than redraw any of it — the check that holds where Clear-Site-Data is not honoured (a plain-HTTP origin). Every view page draws it: the agent page, the Rendered view and both terminals. Nothing when there is no user.
func ViewToAgentLabel ¶ added in v0.181.0
ViewToAgentLabel and ViewToChiefLabel are the switch's accessible description in each mode: the current target, then what a press does.
func ViewToChiefLabel ¶ added in v0.181.0
ViewToChiefLabel is the switch's description in chief mode (see ViewToAgentLabel).
func WorkPollToken ¶
func WorkPollToken(w mirror.WindowWork) string
WorkPollToken is a work chip's state as the status poll carries it: "<subagents>.<shells>", with a trailing "p" for a lower bound ("1+ shell"); "0.0" for no chip. Two reports that draw the same chip have the same token.
Types ¶
type ActiveRow ¶
type ActiveRow struct {
Name string // the agent slug (the route key)
// SessionName: as NotificationRow's.
SessionName sessionname.Name
SessionID int64 // the session to deep-link to (0 → link to bare /agents/{name})
Phase string // "thinking" | "responding" | "queued" — the live phase
Since string // relative label for recently-active rows (e.g. "2m ago"); "" while in-flight
InFlight bool // true → show the live phase pill; false → show the Since label
}
ActiveRow is one agent currently streaming (thinking/responding) or active within the recency window. Distinct from NotificationRow: it carries a live phase + a "since" label instead of an unread count.
type AgentBrief ¶
type AgentBrief struct {
ID int64
Name string // slug — the /agents/{name} detail/chat link target
DisplayName string
Status string // pending|provisioning|running|stopped|error
// SessionID is the agent's latest session (agents.Store.LatestSessionIDs), 0
// when it has none or the read failed: the "Open chat" link names it
// (AgentSessionHref), so a tap skips the bare page's 303.
SessionID int64
}
AgentBrief is the minimal linked-agent info a task card renders: enough to show a status chip and link to the agent's chat, with NO live k8s call (the Status is the STORED agents.status, mirroring how the sidebar's agent list avoids per-agent pod lookups).
type AgentCardView ¶
type AgentCardView struct {
ID int64
// SessionID is the agent's latest session (agents.Store.LatestSessionIDs),
// 0 when it has none or the read failed. Every link drawn to this agent —
// the sidebar's row, the switcher's pill, home's target — names it (PageHref).
SessionID int64
// Kind and CCAccount are the agent's kind and Claude account name.
Kind string
CCAccount string
// WorkerPool is the machine-job worker pool the agent belongs to
// (agents.Agent.WorkerPool); "" for none. Nothing draws it from this view
// now (the retired Agents list's card drew a "pool" chip).
WorkerPool string
Name string
DisplayName string
// SessionName is the agent's name (internal/sessionname), resolved by
// internal/api; every surface draws it through sessionTitle.
SessionName sessionname.Name
Repo string
Status string // pending|provisioning|running|stopped|error
KickedOff bool
// KickoffOwed is agents.KickoffOwed for this agent: a kickoff message is
// stored and nothing delivered it. It renders as a badge BESIDE the status
// dot, never as a status value — see kickoffOwedBadge.
//
// 🔴 IT IS NOT DERIVED HERE, AND IT MUST NOT BE. The note text is not on this
// view at all (it is operator-authored instruction text; agents.Agent tags it
// `json:"-"` and this package would put it in HTML), so the boolean is
// composed in internal/api's cardViewIndexed from the stored row and arrives
// already decided.
KickoffOwed bool
// KickoffFailed is agents.KickoffFailed: the first turn was handed to a gateway
// (the row is stamped kicked_off, so KickoffOwed is false) and it did not
// complete. It renders as a "kickoff failed" badge beside the status dot plus the
// failure text and the remedy — see kickoffFailedBadge and kickoffFailureDetail.
// Mutually exclusive with KickoffOwed by construction.
KickoffFailed bool
// KickoffFailure is the text to show for a failed kickoff:
// agents.KickoffFailureText, composed in internal/api's cardViewIndexed with the
// pending note already SCRUBBED out (agents.ScrubNote). This package never sees
// the note and must not be handed raw kickoff_error.
KickoffFailure string
// KickoffResendSafe is agents.KickoffResendSafe: the failure proves nothing was
// sent, so the remedy may say re-sending is safe. Otherwise the remedy says to
// check whether the agent is already working first. See KickoffFailedRemedy.
KickoffResendSafe bool
// KickoffAwaitingGrant is agents.KickoffAwaitingGrant: the first turn is held,
// unsent, until the owner approves this agent's github connector request (its
// repository cannot be checked out before). It renders as a "waiting for your
// github approval" line linking to Connectors — see kickoffAwaitingGrantNotice.
// Composed in internal/api's cardViewIndexed; only the boolean crosses.
KickoffAwaitingGrant bool
// GitHubProblem is why the GitHub App cannot currently serve this agent's
// repository (its credentials refused at the token mint, a rate limit, the
// repository outside the installation), "" when nothing is known to be wrong
// or no App is configured. Composed in internal/api's cardViewIndexed from
// githubapp's operator-facing text, which never carries a token.
GitHubProblem string
// Outcome is how the work this agent was started on ended (agentoutcome:
// running|done|failed|stuck, "" untracked) and OutcomeReason why, scrubbed of
// the note. A failed or stuck outcome draws a badge on the strip, a notice
// above the transcript and a marker on the sidebar row (agent_outcome.go).
Outcome string
OutcomeReason string
// Namespace is the agent's stored namespace, used only to spell the log command
// in the failed-kickoff remedy.
Namespace string
// Model is the agent's configured model slug ("" = cluster default). Nothing
// draws it from this view now (the retired Agents list's card did, as a
// read-only line).
Model string
// NoteID is the source task this agent was dispatched from (nil = none).
// Nothing draws it from this view now (the retired Agents list's card drew a
// "Task #<id>" badge).
NoteID *int64
// CreatedAt is the agent's creation time. Nothing draws it from this view
// now (the retired Agents list's card printed it as a relative "age").
CreatedAt time.Time
UpdatedAt time.Time
// LastActiveAt is agents.LastActivity for this agent — the time the sidebar
// and the switcher order by (list_order.go) — and it is what the sidebar
// row's recency dot reads, so the order and the dot are one number. Composed
// in internal/api's cardViewIndexed; a zero value (a minimal test view) falls
// back to UpdatedAt.
LastActiveAt time.Time
// IsChief marks the fleet's chief agent; its ⋯ menu offers no Delete. It is
// the answer of internal/api's ONE chief predicate (isChiefAmong), composed in
// cardViewIndexed and never re-derived here — the server refuses the delete
// regardless, so this only keeps the UI from offering what it would refuse.
IsChief bool
// DeleteProtected: its ⋯ menu offers no Delete, like the chief's, without it
// being the chief — a declared officer's instance (internal/api's
// deleteProtection). The server refuses the delete regardless.
DeleteProtected bool
// PrimaryChief: this is THE chief the viewer is sent to — where `/` opens,
// and the agent the sidebar pins first (navBefore). internal/api's
// primaryChief decides it, for both; it is never re-derived here. At most
// one entry of a list carries it; IsChief may be true on more than one.
PrimaryChief bool
// Pinned: the viewing user pinned this agent (internal/pins). The switcher
// orders a pinned entry first (orderList) and its pin toggle reads it
// (switcher_pin.go); a pinned entry is never in the Idle section. Composed in
// cardViewIndexed.
Pinned bool
// Focus is what the agent is working on (internal/focus), nil for none.
// Composed in cardViewIndexed; the palette finds the entry by its title
// (switcherItems' Title).
Focus *FocusView
// PrevFocus is the agent's previous focus titles, newest first, its
// current one left out (internal/api's withPreviousTitles); the palette
// finds the entry by them after its current title (palette.go).
PrevFocus []string
// Tags is the VIEWER's own tags on the agent (internal/sessiontags; per
// user and private), sorted, nil for none — internal/api's
// withSessionTags. The palette and the dock's filter find the entry by
// them (switcherItems' Words), and the session switcher's ⋯ menu edits them.
Tags []string
// Attention is the entry's attention count (cards_attention.go), drawn on
// its sidebar row (navAttentionPill), nil for none. Composed in internal/api
// from the attention queue's own read.
Attention *CardAttention
// AwaitingApproval: the agent is blocked on a permission prompt (or has a
// request open on the approval queue) — internal/api's AwaitingApproval,
// the same answer the polled "awaiting approval" badge shows. It is NOT an
// attention item, so it is carried here: the waiting order and words read it
// (waitTokens), and the agent page's status poll asks for a strip refresh
// when it changes (agentStripBody, AgentsAwaitingEvent).
AwaitingApproval bool
// Work is what the agent's pod last reported it has running — subagents and
// background shells — internal/api's AgentWork, already expired when stale.
// It draws the agent page strip's work chip (workChip) and the sidebar row's
// count (navWork), and the status poll carries it (StatusPollPath) so a
// change or an expiry re-renders the strip. Zero: no chip.
Work mirror.WindowWork
// Idle: in the Idle section (idle_section.go's InIdleSection), composed by
// MarkIdle; the sidebar draws it in its Idle group (navIdleGroup).
Idle bool
}
AgentCardView is one agent as internal/api's cardViewIndexed composes it: what the sidebar's row, the session switcher's pill and the agent page's status strip, ⋯ menu and notices draw (agent_actions.go). The name is the retired Agents list's, whose card grid it was built for.
func (AgentCardView) Deletable ¶ added in v0.110.0
func (a AgentCardView) Deletable() bool
Deletable is whether the ⋯ menu offers Delete: not for the chief, not for a declared officer's instance (the server refuses either regardless). ONE predicate: the menu draws by it, and internal/api's tests ask it of the card the page composes.
func (AgentCardView) PageHref ¶
func (a AgentCardView) PageHref() string
PageHref is the link to the agent's page: AgentListHref on the agent's latest session, so a tap loads the page directly instead of the bare URL and its 303 (and is moved to the latest if it went stale). The sidebar's row, the switcher's pill and home's target (HomeHref) all use it.
type AgentDetailView ¶
type AgentDetailView struct {
ID int64
// Tags is the viewer's own tags on the agent (internal/sessiontags), drawn
// in the header after the title (sessionTagsHead); nil for none.
Tags []string
Name string
DisplayName string
// SessionName is the agent's name (internal/sessionname): the header and
// the <title> draw it (agentTitle, agentDocTitle).
SessionName sessionname.Name
// Drift is the page's rename offer (driftBanner), nil for none.
Drift *SessionDrift
Status string
Repo string
Model string // OpenRouter slug; "" = cluster default
// Kind is the agent's kind. A claude-code agent shows its kind and account
// instead of the model picker: it has no per-agent model (the server refuses
// one), so a picker there would be a control that can only fail.
Kind string
CCAccount string
// LastFailover is the agent's latest Claude account failover, one line
// ("from north · rate_limited · resets …"); "" when it has none.
LastFailover string
// WorkerPool is the agent's machine-job worker pool; "" for none.
WorkerPool string
Messages []ChatLine
// Sessions are the agent's chat sessions for the switcher (most-recently-active
// first); ActiveSessionID is the one whose transcript Messages holds.
Sessions []SessionView
ActiveSessionID int64
// DraftUser is the signed-in user, the first part of the chat box's draft
// key (composer_draft.go).
DraftUser int64
// Surface is where this pane is being rendered. See ChatSurface.
Surface ChatSurface
// TurnInFlight: a turn is running in this conversation right now (internal/api
// sessionTurnCount), so #chat-working is drawn SHOWING. A page opened or
// reloaded mid-turn then says the agent is working, and the chat.reply
// refetch that brings the reply draws it hidden again.
TurnInFlight bool
// ChiefChat is the chief chat's bar (chief_chats.go): set on the chief's
// chat only, nil on every other agent's — which keeps the header's + and
// draws no bar.
ChiefChat *ChiefChatBar
// DispatchCards is each agent_dispatch call's card, by its tool id
// (internal/api dispatchCardsFor); a call with none draws as a plain tool row.
DispatchCards map[string]DispatchCard
// OwnerCards is each STORED ask_owner card's state — its attention ask —
// by the call's tool id (internal/api ownerCardsFor). A call whose result
// names no stored ask draws from the transcript alone (a server with no
// attention store).
OwnerCards map[string]OwnerCardState
// Source task (Task 6): when this agent was dispatched from a Task, NoteID is
// its task id and TaskStatus its current lifecycle status. Both are populated
// best-effort by the handler; NoteID == nil (or a non-terminal status) means
// no completion banner is rendered.
NoteID *int64
TaskStatus string
// SendNonce names one message for the chat form's FALLBACK post (see
// agentChatPane and ComposerView.Nonce); "" = none. SendNotice is the
// outcome of such a post, drawn above the form when the page was reached by
// the redirect that answered it; SendNoticeOK says it is good news.
SendNonce string
SendNotice string
SendNoticeOK bool
// Dictate is where the chat form's microphone posts a recording
// (TranscribePath), or "" for none. See dictate.go.
Dictate string
// DictateOff: the server has no dictation, so the chat form draws the
// muted mic linking to its Features row (dictateOffControl) instead.
DictateOff bool
// FocusHistory is the agent's focus history, the newest page
// (FocusHistoryPath); "" = no focus store, and no header control for it.
FocusHistory string
// Asks is the agent's OPEN attention asks as the queue draws them, with
// their answer forms (internal/api attention_asker.go), "" for none; AsksSrc
// is that block's fragment URL, "" when the queue is not served (no block).
Asks string
AsksSrc string
// Switcher is the session switcher below the chat form (switcher.go), on
// the page surface only; nil for none.
Switcher *Switcher
// Card is the agent as its card was composed (internal/api's
// cardViewIndexed, the one composer): what the page's status strip, its ⋯
// menu and its notices draw (agent_actions.go). Zero (Card.ID 0) draws
// none of them — the chief panel's pane, and a minimal test view.
Card AgentCardView
}
AgentDetailView is the data the agent detail page renders.
type AgentTerminalView ¶
type AgentTerminalView struct {
// Plugins is the owner's viewer plugins and the window's preview counts:
// the header's Preview button and its panel (plugin_chip.go); nil for
// none.
Plugins *PluginChips
Name string
DisplayName string
// SessionName is the session's name (internal/sessionname): the header
// and the <title> draw it when it is a human one. The zero value draws
// DisplayName / Name.
SessionName sessionname.Name
// overlay — the terminal's width is the far side's geometry, so no rail
// takes from it) and its hamburger, framed by the view swap or not
// (nav_layout.go says why).
Nav NavChrome
// the page says so instead of opening a socket that would be refused.
Unavailable string
// BackHref is where the back arrow goes ("" = the agent's own page). A
// mirrored session has no agent page — its terminal is its page — so it goes
// back to the list.
BackHref string
// Badge is a short label beside the title ("Mirrored · <host>"); "" = none.
Badge string
// BadgeHost and BadgeHostIcon are the mirrored host the badge names and its
// icon key (HostIconFor): the badge leads with the icon its cards draw.
BadgeHost, BadgeHostIcon string
// RawName, when set, is the title's tooltip (mirrorSessionTitle): a
// mirrored session titled by its host's label ("mango:1") keeps its real
// tmux session name findable (no longer drawn beside it: the header's room
// is the tags'). "" = the title alone.
RawName string
// TitleQualifier, when set, is drawn right after the title as part of it
// (" · laptop") and added to <title>: a mirrored entry whose name another
// listed entry shares (mirror.SessionView.Qualifier). "" = the title alone.
TitleQualifier string
// Tags is the viewer's own tags on the session — the agent, or the mirrored
// tmux session (internal/sessiontags) — drawn in the header after the
// title (sessionTagsHead); nil for none.
Tags []string
// TagTarget is the session Tags are on — the agent, or the mirrored tmux
// session — which the header names (data-session-tags-for), so the editor's
// copy into the other live view lands only on the same session's header.
TagTarget SessionTagTarget
// WSPath is the socket the page opens, WITHOUT its query ("" = the agent's
// /agents/{name}/terminal/ws). A mirrored session's is
// /mirror/terminal/ws?host=…&session=…, and the page appends mode/cols/rows.
WSPath string
// ReadOnlyOnly turns the keys off: the far side cannot be typed into (a
// mirrored host that did not advertise -interactive). The server refuses an
// interactive attach regardless; this keeps the page from asking for one,
// and its keys are drawn disabled.
ReadOnlyOnly bool
// InteractiveNote, when set, is the tooltip of the status line and of the
// key bar: what typing into this terminal really reaches.
InteractiveNote string
// RenderedHref, when set, draws the Rendered | Terminal switch: the session
// also has a rendered view (a mirrored Claude Code pane), one tap away.
RenderedHref string
// TerminalOnly, when set, is why this session has NO rendered view
// (mirror.SessionView.TerminalOnlyReason), drawn as one line under the
// header: a mirrored window that opens in the terminal says why instead of
// silently falling back. Never set together with RenderedHref.
TerminalOnly string
// LiveCopy is the warning that this window's conversation also runs
// elsewhere under another session id (mirror.SessionView.LiveCopyWarning),
// "" for none: a banner under the header (livecopy.go).
LiveCopy string
// Offline and Note are a mirrored window's host state, as MirrorViewView's
// (mirrorHostBanner). Note is drawn only where TerminalOnly does not
// already say it.
Offline bool
Note string
// Switcher is the session switcher (switcher.go), the page's last row:
// below the composer — or below the key bar where there is no composer —
// spanning the screen, so the operator switches sessions without going
// back to the Rendered view. Its pin toggle is the page's pin: a window
// with no rendered view, whose only page this is, is pinned here too. It
// is drawn whether or not the composer can send. nil: none (no agent
// store, or the list could not be read).
Switcher *Switcher
// StepUp, when set, puts live keys behind a FRESH sign-in
// (internal/stepup): a mirrored session. The page attaches with live keys
// when the sign-in is fresh, and otherwise asks "Confirm it's you" at the
// first key pressed. nil = live keys at once (an agent pod's terminal).
StepUp *StepUpView
// Composer, when set, draws the message composer under the terminal: a
// mirrored session of an -interactive host (mirror_compose.go). It needs
// StepUp — a send refused as stale asks through the same dialog. nil = no
// composer (an agent pod's terminal, a read-only host).
Composer *MirrorComposerView
// ScrollForm, when set, turns on drag-to-scroll: a vertical drag on the
// terminal (and the mouse wheel) scrolls the session's pane through its
// tmux history, by POSTing ScrollForm plus `lines` to
// MirrorTerminalScrollPath. A host that cannot scroll (an older
// muster-mirror, a read-only host) leaves it "", and the page then has no
// gesture handlers at all — touch pans #term-scroll exactly as before.
ScrollForm string
}
AgentTerminalView is the data the terminal page renders.
type Brand ¶ added in v0.187.0
type Brand struct {
// Name is the display name, "" for none.
Name string
// ETag names the logo's images, "" for no logo. It is the ?v= on every
// link to them (Versioned), so a new logo is a new URL and no cache shows
// the old one: /brand/* is long-cached only at the URL whose v is the
// current ETag (internal/api serveBrandImage).
ETag string
// LogoShowsName is the admin's statement that the logo already spells
// the name (a wordmark): the pages then draw the logo alone. It means
// nothing while no logo is set.
LogoShowsName bool
}
Brand is the instance's branding as a page draws it: the admin's display name and the logo's ETag. The zero value is "nothing set", and every surface then draws exactly what it drew before branding existed — the wordmark, muster's own icons.
func (Brand) DrawsName ¶ added in v0.200.0
DrawsName reports whether the name is drawn as text beside the logo: a name is set, and no logo that already spells it (LogoShowsName) is. The one rule for the header, the sidebar and the sign-in page.
func (Brand) Icon192 ¶ added in v0.187.0
Icon192 is the 192 px icon a page links: the logo's, or muster's own.
type CardAttention ¶
type CardAttention struct {
// Count is the entry's items; the row's pill shows only for Count > 0.
Count int
// Kind is the most urgent item's kind ("session", "question", "ask",
// "plugin": internal/api's attention kinds), which picks the icon.
Kind string
// Href opens that item on the queue page (/attention#<its key>). Nothing
// draws it now: the retired card's badge was a link to it, and a sidebar row
// is itself a link, so its pill cannot be one.
Href string
// Keys are the entry's items' keys, newest first: what a test compares
// with the queue's.
Keys []string
// Kinds is every kind among the entry's items, each once, in the order
// first seen: what the waiting predicate reads (waitTokens). Kind alone is
// only the most urgent one.
Kinds []string
}
CardAttention is an entry's ATTENTION: how many items of the attention queue are this entry's (an agent's or a mirrored window's asks, its waiting session, its held question, its reply drafts), the most urgent one's kind, and where that item is on the queue page. The sidebar's row draws it (navAttentionPill); the name is the retired Agents list card's badge's.
🔴 IT IS NOT DERIVED HERE, AND IT MUST NOT BE. internal/api composes it from attentionItems — the ONE read the queue page, the sidebar badge and the chief's attention_list make — so an entry and the queue cannot disagree about what is waiting.
type ChatLine ¶
type ChatLine struct {
Role string // "user" | "assistant"
Content string
Kind string // "" | "text" | "tool_call" | "tool_result"
ToolID string
ToolName string
ToolOK bool
// ToolTarget is a tool_call's one-line summary (the file, the command). ""
// derives it from Content (the args) with cctranscript.ToolTarget — what a
// persisted row does; the mirrored view sets it from the host's own reading.
ToolTarget string
// ID is the persisted message's row id (0 = none): a bubble's
// data-msg-id, the same after the chat-log refresh redraws the transcript,
// so the bubble clamp keeps a message the reader opened open (bubble_clamp.go).
ID int64
// Typed: a person typed this user line into muster's chat (the stored row's
// typed_by) — not a plugin message, a hand-back or muster's own note. Only a
// typed line answers a question card (chiefToolCard).
Typed bool
// Relay is set on a user line muster wrote to relay a plugin message (or a
// task event) to the chief: drawn as a collapsed system row (relayRow),
// never as the person's bubble. nil for every other line — internal/api
// chatLinesOf (relayOf) sets it only on an untyped user row that carries a
// stored plugin-message link (migration 0096), or — a row from before
// 0096 — whose text is muster's own relay preface (plugins.ParseRelayTurn).
Relay *ChatRelay
}
ChatLine is one persisted chat message rendered in the detail transcript. For a structured assistant turn (0.7.64) a line is one PART: Kind 'text' renders a bubble; 'tool_call'/'tool_result' render the same collapsed tool chip the live stream shows (Content = args / output). Legacy rows carry an EMPTY Kind, or "text".
⚠ THE EMPTY CASE IS SPELLED OUT IN WORDS ON PURPOSE. It used to name the empty string with a pair of adjacent ASCII single quotes, and gofmt's doc-comment reformatting rewrites that pair into a closing curly DOUBLE quote — so the line silently stopped naming the empty string at all. Nothing errors and nothing fails; the comment just quietly means something else, and the only tell is a character that looks almost identical to what was typed.
type ChatRelay ¶ added in v0.175.0
type ChatRelay struct {
Source, Subject string
Task bool
// MessageID is the plugin message's id (the row's stored link, or the id
// its preface names); Source "" draws "a plugin" and, with no Subject, the
// id names it.
MessageID int64
}
ChatRelay is what a relay row names: the plugin it came through and the message's subject (a task event's title), "" for none. Task marks a task event.
type ChatSurface ¶
type ChatSurface string
ChatSurface names WHERE a chat pane is being rendered.
🔴 IT EXISTS BECAUSE agentChatPane IS RE-MOUNTED IN A TRANSFORMED ANCESTOR AND ONE OF ITS CHILDREN IS `position: fixed`. sessionDrawer is `fixed inset-y-0 right-0`, which resolves against the nearest ancestor that establishes a containing block — and ChiefPanel carries `translate-x-full` + `transition-transform`, so a transform on it makes the PANEL that ancestor. Inside the panel the drawer therefore sits at the panel's own right edge, and when the panel is shut it is translated off-screen and `inert` along with it: unreachable, with nothing on screen saying so. The panel gets a sub-view of its own column instead (chiefThreadList), which is what this field selects.
⚠ THE ZERO VALUE IS THE PAGE, DELIBERATELY. AgentDetailPage and OperatorPage construct this view in several places and none of them may change behaviour; a surface that had to be set explicitly would silently re-route one of them.
const ( // ChatSurfacePage is a standalone document — AgentDetailPage or OperatorPage. ChatSurfacePage ChatSurface = "" // ChatSurfaceChiefPanel is the chief slide-out inside the home shell. ChatSurfaceChiefPanel ChatSurface = "chief-panel" // ChatSurfaceViewStrip is the chief strip on a mirrored session's Rendered // view (view_chief.go): the chief's chat about that session, log only — no // form, no drawer — served by internal/api handleViewChiefLog. ChatSurfaceViewStrip ChatSurface = "view-strip" )
type ChiefChatBar ¶ added in v0.201.0
type ChiefChatBar struct {
AgentID int64
AgentName string
SessionID int64
// Primary: this chat is the chief's primary (its default session).
Primary bool
// Archived: this chat is archived (an old primary, or a side chat put away).
Archived bool
}
ChiefChatBar is the chat bar's view: set on a chief's chat only.
type ChiefPanelView ¶
type ChiefPanelView struct {
// Configured is false when no agent carries the chief display name. The panel
// then renders an honest explanation rather than an empty chat.
Configured bool
// Reason explains a missing chief, shown verbatim.
Reason string
// Chat is the chief's agent-detail view, re-used as-is.
Chat AgentDetailView
// ThreadsFailed says the SESSION-LIST read behind Chat.Sessions broke, so the
// panel's thread list must render the failure state instead of an answer.
//
// 🔴 IT IS ON *THIS* STRUCT AND NOT ON THE SHARED AgentDetailView, AND THAT IS
// WHAT KEEPS THE TWO PAGE SURFACES OUT OF IT. AgentDetailView is built by
// AgentDetailPage and OperatorPage in several places; a failure flag there would
// be a field those renderers could start reading, and the fix for the panel would
// have a surface area of three screens. Only chiefPanelBody constructs a
// ChiefPanelView, so this field can only ever change what the panel draws.
//
// 🔴 AND IT IS THE FREQUENT PATH, WHICH IS WHY IT EXISTS AT ALL. api.resolveSessions
// discarded the ListSessions error, so a failed read reached this renderer as an
// EMPTY list and #chief-panel-body — refetched on EVERY panel open — rendered
// "No threads yet.": the operator was told their whole thread history was gone
// because one read failed. The search route already said so (ChiefThreadsView.Failed);
// the first paint did not, and the first paint is the path the operator takes first
// and most often.
ThreadsFailed bool
// SessionRuntimes are the runtimes a NEW session may be started on, and
// ClaudeModels the Claude Code models offered; none: no picker
// (chief_sessions.go).
SessionRuntimes []SessionRuntimeView
ClaudeModels []string
}
ChiefPanelView is what the panel body needs.
type ChiefThreadsView ¶
type ChiefThreadsView struct {
// Threads are the rows to render, most-recently-active first. Every one of them
// is rendered: the panel applies no cap of its own, and a search answers with
// its own bounded set (agents.SearchSessionsMaxLimit).
//
// 🔴 SO THE FIRST PAINT IS UNCAPPED WHILE SEARCH IS CAPPED AT 50, AND THE
// MEASUREMENT THAT MAKES THAT SAFE BELONGS HERE RATHER THAN IN A SESSION'S HEAD.
// The first paint is the FREQUENT path — #chief-panel-body refetches on every
// open, and each of those renders this list in full — so "the cap only matters for
// search" would have been the wrong way round. MEASURED against a live database
// on the project muster was extracted from: the chief agent carried FOUR
// chat_sessions rows, two of which were empty recap rows deleted in that arc.
// ⚠ THAT IS A MEASUREMENT ON ANOTHER DEPLOYMENT, so it is the ORDER OF
// MAGNITUDE that carries across, not the number. Threads are created by an operator
// tapping New thread or by an agent's first webchat turn, so the row count is
// operator-paced, not fleet-paced — nothing on a loop writes one.
//
// ⚠ IT IS NOT BOUNDED HERE BECAUSE THE LIST IS NOT THIS RENDERER'S TO TRUNCATE.
// The rows come from api.resolveSessions, which also feeds the agent-detail and
// operator drawers; capping it would silently drop threads from three surfaces,
// and a cap with no "older threads" affordance hides history rather than bounding
// a cost. If the count ever does grow, the bound belongs in resolveSessions with
// an affordance beside it — and the search box above is already the way to reach
// an old thread.
Threads []SessionView
// Query is what was searched, echoed so the empty state can name it.
Query string
// Searched distinguishes "no threads at all" from "no MATCHES", which are
// different sentences and the reason this is not derived from Query != "".
Searched bool
// Failed says the server never got an answer — the read itself broke.
//
// 🔴 IT IS A THIRD STATE, NOT A FLAVOUR OF EMPTY, AND CONFLATING THEM IS THE
// DEFECT THIS FIELD EXISTS TO CLOSE. The search route deliberately answers 200
// with rows on every failure (htmx does not swap a non-2xx body, so a 500 leaves
// the PREVIOUS query's matches on screen as though they were the answer) — and
// that correct decision was rendering a Postgres error, a chief-resolution
// failure and a genuinely empty result set as one sentence, "No thread matches
// that.", traced only in a server log. The operator could not tell "nothing
// matched" from "search is broken", and on the blank-query path they were told
// their thread history was EMPTY when the list read had simply failed.
//
// ⚠ IT OUTRANKS Searched. A failed search has no result set to describe, so
// there is no answer to describe and the query text is echoed only to say what was
// being attempted.
//
// 🔴 IT ALSO OUTRANKS THE ROW COUNT, AND chiefThreadRows ENFORCES THAT RATHER THAN
// TRUSTING THE CALLER — which this comment used to do, and which failed. It read
// "Threads must be empty whenever this is set": a PRECONDITION, stated in prose,
// honoured by the search route (it discards the list on every failure) and violated
// by the first paint the moment that call site was added. api.resolveSessions returns
// `views, err` from one read, and agents.PGStore.ListSessions ends `return out, rows.Err()`
// — so a mid-stream failure (connection reset, server-side cancellation) hands the
// panel a TRUNCATED slice AND a non-nil error. That rendered as state="rows" with no
// failure sentence anywhere: a partial thread history presented as the whole of it.
// The renderer now answers the failure state at EVERY row count, so a caller cannot
// reintroduce it by forgetting; see chiefThreadRows for why the rows are dropped
// rather than shown alongside the sentence.
Failed bool
// Reason replaces the failure SENTENCE when the absence of an answer is not a
// transient read at all. Ignored unless Failed is set.
//
// 🔴 IT EXISTS BECAUSE "Try again." WAS A LIE IN ONE STATE. handleChiefThreadSearch
// renders the failure state when s.ext.Agents is nil — a muster booted with no
// database — and that read cannot succeed on a retry, not now and not ever: there is
// no store to ask. Telling the operator to try again is an instruction that can only
// waste their time. The STATE is still `error` (it is the absence of an answer, which
// is exactly what that state means); only the sentence differs.
Reason string
}
ChiefThreadsView is the thread ROWS the panel's list shows.
type ComboOption ¶
ComboOption is one option in a custom type-to-filter combobox. Value is the submitted value (carried by the hidden input); Label is the visible text the user filters against. For repos Value == Label; for notes they differ (Value is the note id, Label is the directory / body preview).
type ComposerChief ¶ added in v0.178.0
type ComposerChief struct {
// Agent names the agent segment ("Claude", "opencode").
Agent string
// LogSrc is the chief strip's URL (MirrorRef.ChiefLogPath).
LogSrc string
// ModeKey is the localStorage key the mode is remembered under, per
// window (MirrorDraftKey's scheme, view "chief").
ModeKey string
}
ComposerChief is a composer's chief mode (ComposerView.Chief).
type ComposerField ¶
type ComposerField struct{ Name, Value string }
ComposerField is one hidden field of a composer.
type ComposerQueue ¶
type ComposerQueue struct {
// Src is the list's URL (SendQueuePath with the window's address).
Src string
List SendQueueListView
// Disabled, when set, draws Queue disabled and says why under the list —
// a host whose muster-mirror does not report whether Claude Code is busy,
// a window that is not Claude Code. The server refuses such a queue
// regardless, and sends nothing to such a target.
Disabled string
}
ComposerQueue is a Rendered view composer's queue: the list's URL, and the list as it was when the page was drawn.
type ComposerView ¶
type ComposerView struct {
// SendPath is the route the form posts to.
SendPath string
// Host, Session and Window address a mirrored entry (hidden fields `host`,
// `session`, `window`); Window is "" for the session's active window. All
// empty for a composer that is not a mirrored entry's.
Host string
Session string
Window string
// Extra are further hidden fields, in order: what else the route needs to
// know where the message goes and where to come back to.
Extra []ComposerField
// Placeholder and Aria name what the text reaches ("Message Claude…").
Placeholder string
Aria string
// Disabled, when set, draws the composer disabled and is the reason shown
// under it — a read-only host, a muster-mirror too old to be sent to, an
// agent that is not running. The server refuses the send regardless.
Disabled string
// DisabledPlaceholder is the input's placeholder while Disabled.
DisabledPlaceholder string
// Notice, when set, is drawn in the status line when the page loads: the
// outcome of a send the BROWSER submitted (no script), which came back here
// as a redirect. NoticeOK says it is good news (it is styled as such).
Notice string
NoticeOK bool
// Nonce names ONE message for the server (hidden field `nonce`): a send
// repeated with the same nonce is delivered once. The server mints one per
// page; the script replaces it after each message that was sent.
//
// 🔴 IT IS WHAT MAKES "TRY AGAIN ANOTHER WAY" SAFE. When a send gets no
// answer the script hands the form to the browser, which posts it again —
// and the first post may have been DELIVERED with only its answer lost. A
// prompt typed into an agent twice is run twice. With the nonce the second
// post is recognised and answered as sent, without being pasted. "" = no
// such protection (the server then delivers every post).
Nonce string
// Dictate is where the microphone posts a recording (TranscribePath), or ""
// for no microphone — the server has no speech-to-text service. A disabled
// composer draws none either way: there is nothing its text could be sent
// to. See dictate.go.
Dictate string
// Upload is where the paperclip posts a file (UploadPath), or "" for no
// attachments — uploads are not configured. A disabled composer draws none
// either way. See attach.go.
Upload string
// DictateOff and UploadOff say the server has no dictation / no
// attachments (the feature is off, not merely this composer disabled): an
// enabled composer then draws a MUTED mic / paperclip in the same place,
// linking to that feature's row on the Features page (FeatureHref), so the
// control does not vanish without a word. False draws nothing — the zero
// value is the composer as it was.
DictateOff, UploadOff bool
// Pinned draws the composer position:fixed to the bottom of the VISIBLE
// viewport instead of as the last in-flow child of the page's column, and
// adds composerPinScript. The page must reserve the room it takes
// (pinnedShellClass on its body). See composerPinScript for why.
Pinned bool
// Queue, when set, draws the send queue: "Queue for when idle" behind a
// caret beside Send (composer_menu.go's sendSplit) and the window's queue
// above the input (send_queue.go). Only a mirrored window's
// Rendered view sets it; nil — no database, or any other composer — draws
// neither. A disabled composer draws neither either.
Queue *ComposerQueue
// DraftKey is the localStorage key its text is kept under as it is typed
// (composer_draft.go: MirrorDraftKey, AgentTerminalDraftKey); "" keeps no
// draft. A disabled composer keeps none either way.
DraftKey string
// Switcher, when set, draws the session switcher below the input row
// (switcher.go), spanning the screen as the composer's last row; nil draws
// none. The Rendered view sets it, and a Terminal view (AgentTerminalPage)
// on the composer it draws, where the composer is in flow, not Pinned.
Switcher *Switcher
// Suggest, when set, is the window's suggested-replies URL
// (SuggestPath with its address) and draws the chip row above the
// composer (suggest_row.go); "" draws none. Only a Claude Code window's
// Rendered view on an interactive host sets it — never a Terminal view,
// never another runtime's. A disabled composer draws none either way.
Suggest string
// SuggestPaused draws one line saying the viewer's suggested replies are
// paused (the auto-pause), with the way back on (Account). Drawn with the
// page, so it moves nothing.
SuggestPaused bool
// Collapsible draws the message box COLLAPSED on a touch screen (a coarse
// pointer): only a "Type a message" button beside the mic, which reveals
// it (composer_reveal.go). Only the Rendered view sets it. A disabled
// composer is never collapsed (there is nothing to type).
Collapsible bool
// MoreInRow draws the session switcher's ⋯ button in the button row, beside
// Send, instead of in the bar (switcherBarWith's moreElsewhere). Only the
// Rendered view sets it; it needs Switcher.
MoreInRow bool
// Chief, when set, draws the chief mode (view_chief.go): the "<agent> |
// Chief" switch, the chief's Send and the chief strip. Only a mirrored
// window's Rendered view sets it, and only for an owner whose chief is on;
// it is drawn whether or not the agent composer is Disabled — the chief is
// a write to the chief's chat, not to the pane.
Chief *ComposerChief
}
ComposerView is one composer.
type ConnectorAuditView ¶
type ConnectorAuditView struct {
At time.Time
Kind string
AgentName string
Connector string
Method string
Host string
Path string
Status int
Detail string
}
ConnectorAuditView is one audit line.
type ConnectorFormView ¶
type ConnectorFormView struct {
// RequestID, when set, approves that pending request in the same submit.
RequestID int64
AgentName string
Name string
Preset string // a preset key, or "custom"
Presets []ConnectorPresetView
Hosts string
Scheme string
Header string
Username string
Error string
// The postgres preset's fields (PostgresPresetKey): the database host,
// port, name, sslmode, whether TLS is required, and the statement timeout.
// The user is Username.
PGHost string
PGPort string
PGDatabase string
PGSSLMode string
PGRequireTLS bool
PGTimeoutMS string
}
ConnectorFormView is the create / enter-credential form.
type ConnectorGrantView ¶
type ConnectorGrantView struct {
ID int64
AgentName string
Status string // pending | approved
LastUsedAt *time.Time
RequestedAt time.Time
// DecidedFrom, when non-empty, is the mirrored session ("<host>/<session>")
// the operator approved it from over MCP (connector_request_decide,
// migration 0035) rather than on this tab. The host is proven by its mirror
// token; the session is the one the caller named.
DecidedFrom string
// StandingID, when non-zero, is the standing grant (shared approval) that
// approved it automatically: no one decided this request by hand.
StandingID int64
}
ConnectorGrantView is one agent's live grant on a connector.
type ConnectorPresetView ¶
ConnectorPresetView is a preset offered in the form.
type ConnectorRequestView ¶
type ConnectorRequestView struct {
ID int64
AgentName string
Connector string
Reason string
RequestedAt time.Time
// Exists is false when the agent asked for a connector nobody has configured:
// the operator's answer is then the form that creates it.
Exists bool
// Problem, when non-empty, is why the connector cannot currently serve this
// agent (a virtual connector's operator-facing failure, e.g. the GitHub App's
// credentials refused): approving still records the decision, but the agent's
// requests will fail until it is fixed.
Problem string
// other agents (a standing grant, migration 0043).
Shares string
// Grants, when non-empty, is the sentence saying what approving it grants — for the GitHub
// App, every repository the token may be minted for (an officer's own
// `repo` and each of its `read_repos`, each marked READ ONLY): the same
// text connector_requests_list returns as approving_grants.
Grants string
}
ConnectorRequestView is one pending request.
type ConnectorSharedView ¶
type ConnectorSharedView struct {
// Repo is the one repository a GitHub App approval is shared for; "" for a
// stored credential, shared for the connector.
Agents int
}
ConnectorSharedView is one shared approval (a standing grant).
type ConnectorView ¶
type ConnectorView struct {
Name string
Platform string
Hosts []string
Scheme string
HeaderName string
Username string
CreatedAt time.Time
RotatedAt *time.Time
LastUsedAt *time.Time
Grants []ConnectorGrantView
// 0043): approvals that every agent's matching request gets automatically.
Shared []ConnectorSharedView
// Managed, when non-empty, says the connector is provided by the server's
// configuration (a virtual connector: the GitHub App) and why it has no
// Rotate or Delete — the card shows it in their place.
Managed string
// Problem is a managed connector's current operator-facing failure, if any.
Problem string
}
ConnectorView is one connector's public description, with its grants.
type ConnectorsContent ¶
type ConnectorsContent struct {
// Unconfigured, when non-empty, is why this server has no connector store;
// the panel says so instead of rendering empty lists.
Unconfigured string
Notice string
Error string
Requests []ConnectorRequestView
Connectors []ConnectorView
Audit []ConnectorAuditView
// EditorForm, when set, is rendered into #connector-editor — a submit that
// failed validation comes back with its fields (never its secret) and the
// error, rather than losing what the operator typed.
EditorForm *ConnectorFormView
}
ConnectorsContent is the whole /ui/connectors partial.
type ContextView ¶
type ContextView struct {
Tokens int64 `json:"tokens"`
Limit int64 `json:"limit,omitempty"`
Model string `json:"model,omitempty"`
// Label is the chip's whole short text: "<name> · <count>", or <count>.
Label string `json:"label"`
// Name is the model without its provider prefix (contextModelName), ""
// with no model; the chip truncates it first.
Name string `json:"name,omitempty"`
// Count is "<tokens>/<window>" short ("29k/1M"), or "<tokens>" with no
// window known; the chip never truncates it.
Count string `json:"count"`
// Detail is the exact readout the chip's popover and tooltip show: the
// whole model id and the exact counts, with the share of a known window.
Detail string `json:"detail"`
// Level tints the chip as a known window fills: ContextLevelWarn,
// ContextLevelDanger, or "" (below ContextWarnPct, or no window known).
Level string `json:"level,omitempty"`
// Title is how the number is derived, "" when there is nothing to add.
Title string `json:"title,omitempty"`
}
ContextView is the header's context-usage readout (mirrorViewBatch.Context): the latest turn's context, as a count — and, from a runtime that reports them beside its events (opencode: SetAgentContext), its model and the model's context window. The count means one thing for every runtime: the tokens the latest model request was sent (input + cache read + cache write).
🔴 ONE RULE, ONE PLACE: contextView builds every field, for every runtime, and the page only places them (mirrorViewScript's setContext) — it never spells a label, a share or a threshold of its own.
func ChiefContextView ¶ added in v0.201.0
func ChiefContextView(tokens, window int64, model string) *ContextView
ChiefContextView is the chief chat's context readout: contextView, THE readout #601's chip draws for a mirrored session, so the chief's chip says the same thing the same way — the model then used/window, amber from ContextWarnPct, red from ContextDangerPct, the exact counts on tap.
type CuratedModel ¶
type CuratedModel struct {
Value string // submitted model slug; empty means "use the server default"
Label string // visible option text
}
CuratedModel is one option in the curated model dropdown.
type DispatchCard ¶ added in v0.161.0
type DispatchCard struct {
Refused string
AgentID int64
Name string
// SessionName is the agent's stable name (internal/sessionname), the
// card's title; the zero value draws the slug. (No DisplayName: the name
// rule is the card's only naming input.)
SessionName sessionname.Name
// Href opens the agent's page (AgentCardView.PageHref).
Href string
// Runtime is where it runs, in the owner's words: "Claude Code" or
// "Gateway · <model>".
Runtime string
Repo string
TaskID int64
// State is one of the Dispatch* states; Detail says more when there is more
// to say (an error's reason).
State string
Detail string
// Version orders this card against every other render of the same agent's
// card (data-dispatch-version): the server's clock, in microseconds, taken
// BEFORE it read the agent's state — so a higher version always shows state
// read later. 0 draws no version (and the guard leaves the card alone).
Version int64
// Gone: the agent no longer exists (destroyed). The card says so and links
// nowhere.
Gone bool // Unreadable: the agent could not be read just now (a failed read, not a
// missing row). The card says so, links nowhere, and stays refreshable.
Unreadable bool
// HostDispatchID keys a card that is NOT a pod agent row: a host dispatch
// (docs/design/chief-dispatch.md 3.7, "The live agent card"), which has no
// agent row until its window exists, and possibly never. When it is set,
// AgentID is 0 and the card is drawn from Host, Window and HostNote; State is
// one of the same Dispatch* states.
HostDispatchID int64
// Host is where the agent runs; Window its tmux window ("agents:@N"), ""
// until one is known.
Host string
Window string
// HostNote is the line a host card always carries: how the owner stops it
// (there is no Stop button for a host dispatch, decision 17).
HostNote string
}
DispatchCard is one agent_dispatch outcome as the card draws it, composed in internal/api (dispatchCardFor). Refused set: the start was refused, and it is the sentence why; nothing else is read.
type DispatchResult ¶ added in v0.161.0
type DispatchResult struct {
AgentID int64
// HostDispatchID: the start was a host dispatch (its host_dispatches row);
// AgentID is then 0.
HostDispatchID int64
Refused string
}
DispatchResult is what the card needs from an agent_dispatch result: the agent it started, or the refusal's sentence. ok is false for a result that is neither (a replay still starting, an already-dispatched answer with no agent): those draw as the plain tool row.
func ReadDispatchResult ¶ added in v0.161.0
func ReadDispatchResult(output string) (DispatchResult, bool)
ReadDispatchResult reads an agent_dispatch tool result. THE one reading: the api composes cards from it, and the page asks for a card with what it found.
type EndView ¶ added in v0.183.0
type EndView struct {
ID int64
State string
Runtime string
Detail string
// Card is the proposal card while it is open.
Card *ProposalView
}
EndView is one end_session proposal as a view draws it.
type FaroSettings ¶
type FaroSettings struct {
// URL is the Faro collect endpoint (MUSTER_FARO_URL). EMPTY DISABLES all
// telemetry — no script tags, no init are rendered (the e2e/local default).
URL string
// Key is the public Faro app API key (MUSTER_FARO_API_KEY); the SDK sends it
// as the x-api-key header.
Key string
// Version is the running build version, used as the Faro app version.
Version string
// Tracing enables the faro-web-tracing bundle + OTEL tracing instrumentation
// (frontend → Tempo spans). Off by default to keep the phone payload lean.
// On, the page's same-origin fetches and XHRs carry a traceparent (their
// server spans join the browser's trace), and each session open is a span
// of its own (musterOpen) parented on the document's server span.
Tracing bool
// Relay: URL is muster's own relay route (api.FaroRelayPath), posted to
// same-origin; the page makes it absolute from location.origin, because
// Faro's tracing ignores its own collector by exact URL and a relative
// one would trace every telemetry post.
Relay bool
}
FaroSettings holds the frontend RUM (Grafana Faro) configuration surfaced into the page head. It is set ONCE at startup from the environment (see main.go) and read by faroHead on every full-document render.
The API key is CLIENT-PUBLIC by design (it is shipped to every browser and only gates the public Faro collect endpoint), so it is a plain value, not a secret.
type Features ¶
type Features struct {
// Connectors is true when the server holds a connector store (an encryption
// key is configured). False removes the Connectors tab and its panel: the
// store is built only with a key.
//
// 🔴 FALSE IS THE SHIPPING DEFAULT, NOT AN EDGE CASE, which is why the zero
// value is the unbuilt state. A caller that forgets to populate this draws
// LESS than it could, which is the safe direction: the opposite default
// draws a tab over nothing.
Connectors bool
// Admin is true when the viewer is an admin and the admin pages are
// served (accounts PR 5). It draws the sidebar's Admin link and nothing
// else: the pages refuse a member on their own (requireAdmin).
Admin bool
// Push is true when the server holds VAPID keys and a subscription store
// (muster-native Web Push). False draws no Enable button, no "on" pill and
// no subscribe script: the routes behind them would only answer 503, and an
// Enable button over a 503 asks for the OS permission and then fails.
Push bool
// Attention is true when the server holds the attention queue's store
// (internal/attention). False draws no Attention link and no badge: the
// routes behind them would only answer 404.
Attention bool
// SnapUser and SnapBuild are the signed-in user and the running build: the
// key, and the check, of the mirrored view's snapshot store
// (mirror_snap.go). A zero SnapUser draws no snapshot script at all.
SnapUser int64
SnapBuild string
// Brand is the instance's logo and name (brand.go): the header's and the
// sidebar's brand, and the shell's favicon. The zero value draws the
// wordmark and muster's own icons.
Brand Brand
}
Features says which OPTIONAL subsystems the process rendering a document actually built. It is what lets a document show a surface only when there is something behind it.
🔴 IT IS A RENDER PARAMETER, NOT PACKAGE STATE, AND THE DIFFERENCE IS CORRECTNESS RATHER THAN TASTE. faroConfig is process-wide because telemetry is a property of the process; this is a property of the SERVER's extensions, and the only honest place to read it is the handler holding that server. A package global would also have to be written from a request path — every handler races every other one, and a test that renders one shape would decide what a concurrent test renders.
🔴 IT DOES NOT DECIDE WHICH ROUTES EXIST, AND IT MUST NEVER GROW INTO THAT. Route registration in internal/api is unconditional on purpose (see that package's routes.go): the recorded route set is a function of the code and never of a fixture. This type gates what a DOCUMENT draws — a link and a panel — while every route stays registered and answers its own unwired case. The two are independent claims and both are needed: without the handler's answer a stale page still reaches a dead route, and without this a live page mounts a panel whose only possible content is a refusal.
type FocusAge ¶ added in v0.152.0
FocusAge is how old a focus title is, as the surfaces show it: Text is "" (no age shown) or whole days ("2d"), and Stale marks it stale.
func FocusAgeOf ¶ added in v0.152.0
FocusAgeOf is the age at now of a focus title written at updatedAt. A zero updatedAt (no focus, or no known time) has none.
type FocusHistoryEntry ¶
FocusHistoryEntry is one past focus as the list shows it.
type FocusHistoryPageView ¶
type FocusHistoryPageView struct {
Entries []FocusHistoryEntry
Next string
First bool
}
FocusHistoryPageView is one fetched page: its entries, newest first, and the next page's URL ("" = this page reaches the oldest). First is true for the newest page, so an empty one says so instead of ending a list.
type FocusView ¶
type FocusView struct {
Title string
Description string
// UpdatedAt is when the title was last written: its age (FocusAgeOf).
UpdatedAt time.Time
// Problem is why the focus is missing (Title "") or stale (the latest
// refresh failed after it was written): a short, non-secret reason
// (focus.Reason), at ProblemAt. "" when the focus is current.
Problem string
ProblemAt time.Time
}
FocusView is a session's FOCUS (internal/focus): what the session is working on, and when that was last written. The palette finds an entry by its title (switcher.go focusTitle).
type HostPreferences ¶
HOST PREFERENCES: what the operator calls their own hosts, which this code cannot know. One setting, empty by default:
- Icons: a host's icon BY ITS NAME ("laptop" draws the laptop glyph), whatever its registration rank. No host picked by rank draws a glyph named here, so a named glyph means that host.
It is configuration (MUSTER_HOST_ICONS, read in cmd/muster-server) rather than a list in this file because host names are the operator's own, and a deployment's real ones must not be written into this repository.
func (HostPreferences) Normalized ¶
func (p HostPreferences) Normalized() (HostPreferences, error)
Normalized is p checked, with its host names lower-cased and trimmed: they are matched case-insensitively (the list's host field is lower-cased). It refuses:
- the cluster's own name (it draws clusterIcon);
- a name that is not a host name (hostNamePattern: no space, no separator);
- an icon that is not one of hostIconSet's keys, or one named for two hosts (it would no longer say which host it is).
type IdentityTint ¶
type IdentityTint struct {
BorderDark, BorderLight, TitleDark, TitleLight idRGB
}
IdentityTint is one colour's four variants: border and title, dark and light theme.
type KindChoices ¶
KindChoices is what a caller may create, by agent kind: the kinds the deployment enables (agents.Kinds order) and, for claude-code, the configured Claude account NAMES the caller may pin. Never a token. agent_dispatch's no-target refusal lists its targets from it (internal/api kindChoices); the dispatch form that drew it as a picker was deleted (docs/design/chief-dispatch.md phase 2).
🔴 Accounts ARE THE CALLER'S OWN. A member's list is the accounts they entered in Account → Credentials; the deployment's environment pool is the admin's and never appears for a member.
Unavailable maps a kind the caller has no credential for to the sentence saying what to add; the server refuses such a kind regardless (api.resolveKindAccount).
type MirrorAskLiveView ¶
type MirrorAskLiveView struct {
Ref MirrorRef
ToolID string
// State is one of the AskState* of a live card.
State string
Questions []askq.Question
// Answers is the answers recorded (answered) or being typed (typing).
Answers map[string]string
// Note is why typing failed (failed).
Note string
// Unanswerable, when set, is why this question cannot be answered from
// here (a read-only or older host): the card says it in place of a form.
Unanswerable string
// Error is a refused submit's reason, drawn above the form.
Error string
// Retry (failed) says the answer can be tried again from here: with
// Chosen, that answer is resent as it is (a fixed retry: the picker holds
// part of it, and muster continues it); without, the form is drawn again.
Retry bool
// Chosen is the answer muster typed part of (failed), one choice per
// question, as the picker takes them.
Chosen []askq.Choice
// CanCancel says the card offers "Cancel question" (pending, failed): the
// host is online, -interactive, and advertised it can dismiss a picker.
// WindowName is the window as the confirm dialog names it.
CanCancel bool
WindowName string
// Sent is a dismissal's note, on the card the dismissal answers with
// (not kept: the next poll's card is the server's, and the CLI's record
// of the call ending flips it): the Esc was sent. SentShowing says the
// picker was still on the terminal's screen after it: the card keeps its
// form and Cancel under the note; otherwise the picker went, and the
// card shows the question read-only. Either is data-ask-sent on the card,
// which the page's merge compares with the state, so the next poll's
// card replaces it.
Sent string
SentShowing bool
// Agent names who asks ("" is Claude): an opencode window's card says
// "opencode" (internal/api's opencode cards).
Agent string
// NoOther: the card offers no answer of one's own (an opencode
// permission request: Allow once or Reject only); NoOtherFor the same for
// question i alone (an opencode question that takes only its options).
NoOther bool
NoOtherFor []bool
// ByIndex: each option's value is its place in the question ("0", "1",
// …), not its label — an opencode card, answered by index.
ByIndex bool
// Record (failed) is the failure's own record on the Answers page: the
// card links to it.
Record string
// Message (failed) says the card offers "Send as a message": typing again
// cannot work (the picker is gone or unreadable), so the answer muster was
// typing is sent to the session as an ordinary message
// (MirrorAskMessagePath), the picker dismissed first if it is still there.
Message bool
}
MirrorAskLiveView is one question a window's session is asking (or asked lately), as the server knows it.
type MirrorCardView ¶
type MirrorCardView struct {
Host string
Session string
// Window is the tmux window id the entry is ("@12"); "" = a per-session
// host's session. With Session it is the entry's ADDRESS: what it links,
// keys and ids by. Never the window's index, which tmux renumbers.
Window string
// Title is what the entry is called when the host sent no Label:
// "<session>:<window index>" for a window. "" = the session name.
Title string
// Label is the host's display name for the entry ("mango:1"), "" for
// none. DISPLAY ONLY: the real name stays findable, as the palette finds an
// entry by its raw session name too (switcherItems' Words).
Label string
// SessionName is the entry's name (internal/sessionname), resolved by
// internal/api: its conversation's manual or auto name, else its Label or
// Title (a fallback, Human false). The zero value draws Label / Title.
SessionName sessionname.Name
// TmuxAt and TmuxCode are what "Show tmux sessions" (internal/api
// notify_prefs.go) adds to the entry's pill and dock row: TmuxAt the
// window as muster named it before sessions had names ("mango:1 @ atlas",
// mirror.SessionView.TitleAt), TmuxCode its codename alone ("mango:1",
// what a pill has room for). Both "" unless the viewer turned the switch on
// AND the entry is called by a human name — decided by internal/api's one
// rule (names.go tmuxPlace), never here: the ui only draws them.
TmuxAt, TmuxCode string
// ManualName is the conversation's manual name AS TYPED (stored, never
// plained), "" for none: what the rename dialog prefills, so a markdown
// name is edited as it was written, not as it draws.
ManualName string
// Qualifier is what tells this entry apart from another listed entry with
// the same title — its host, and/or its tmux address — "" when the title is
// already unique. Decided in ONE place over the whole list
// (mirror.SessionView.Qualifier); shown as part of the title.
Qualifier string
// Kind is what runs in the pane, as the list names it ("Claude Code",
// "opencode", "shell", or a command); "" = unknown. Searched (mirrorKind);
// Claude decides where the entry opens.
Kind string
// Note is the host's line about the window (mirror.SessionView.AgentNote):
// why it has no rendered view, or what its credential needs. "" for none.
// Nothing draws it from this view now (the retired Agents list's card did).
Note string
// LiveCopy is the warning that the window's conversation also runs
// elsewhere under another session id (mirror.SessionView.LiveCopyWarning),
// "" for none. Nothing draws it from this view now (the retired Agents
// list's card drew it under its title, livecopy.go).
LiveCopy string
// Online: the host is connected and still lists the session.
Online bool
// Interactive: the host ANNOUNCED -interactive, so its terminal page offers
// the Interactive switch (still behind a fresh sign-in: internal/stepup).
// Nothing reads it from this view now (the retired Agents list's filter
// had a mode:interactive field).
Interactive bool
// ActiveAt is when the host last saw the entry active
// (mirror.SessionView.Activity: Unix seconds, floored to a minute); zero =
// the host did not say. The sidebar row's recency dot reads it — the same
// number the entries are ordered by (orderList).
ActiveAt time.Time
// Claude: the host reports Claude Code in the session's pane, so the entry
// opens the RENDERED view by default (MirrorViewPath); otherwise it opens the
// terminal.
Claude bool
// AgentView: the host reports a non-Claude runtime with a view (opencode)
// in the pane AND names the conversation it shows
// (mirror.SessionView.AgentView), so the entry opens
// its read-only rendered view by default, as a Claude Code entry does.
AgentView bool
// Pinned: the viewing user pinned this entry's address (internal/pins). The
// switcher orders a pinned entry first (orderList) and its pin toggle reads
// it (switcher_pin.go); a pinned entry is never in the Idle section.
Pinned bool
// Focus is what the Claude Code session in the window is working on
// (internal/focus, keyed by its Claude session id), nil for none.
Focus *FocusView
// FocusKey is the key its focus is stored under (mirror.SessionView
// .SessionKey: the Claude session id, or "opencode:<id>"), "" when the host
// reports none — so it has no focus and no previous titles.
FocusKey string
// PrevFocus is the session's previous focus titles, newest first, its
// current one left out (internal/api's withPreviousTitles); the palette
// finds the entry by them after its current title (palette.go).
PrevFocus []string
// Tags is the VIEWER's own tags on the window's tmux SESSION
// (internal/sessiontags: keyed on host + session, so every window of a
// session carries the same), sorted, nil for none — internal/api's
// withSessionTags. AgentCardView.Tags says what reads them.
Tags []string
// Repo is the short name of the repository the window works in
// (mirror.SessionView.Repo: its git top level's name, else its cwd's),
// "" when the host did not say (an older muster-mirror). The palette finds
// the entry by it (switcherItems' Words); the entry's NAME is unchanged.
Repo string
// Attention is the entry's attention count (cards_attention.go), drawn on
// its sidebar row (navAttentionPill), nil for none.
Attention *CardAttention
// Work is what the window's Claude Code session has running now
// (mirror.SessionView.Work): its sidebar row's count (navWork), display only. The zero value — nothing running, or a host that did not
// say — draws no count.
Work mirror.WindowWork
// Previews is what the window has to preview now
// (mirror.SessionView.Previews): its sidebar row's preview mark
// (navPreview). The zero value — nothing, or a host that did not say —
// draws none.
Previews mirror.WindowPreviews
// Color is the window's tmux identity colour (mirror.SessionView.Color,
// lowercase #rrggbb), "" for none: the sidebar row's left edge is tinted
// with it (identity_color.go). None — or anything that is not a wire
// colour — draws a transparent edge.
Color string
// HostIcon is the key of Host's icon (HostIconFor, composed in
// internal/api from the host's registration rank); "" draws the hash
// fallback.
HostIcon string
// ChiefDispatch is the host dispatch the window was started for — an agent
// the chief started (mirror.SessionView.Dispatch) — 0 for none: its row
// carries the "chief" chip (navChiefChip).
ChiefDispatch int64
// Idle: in the Idle section (idle_section.go), composed by MarkIdle; the
// sidebar draws it in its Idle group (navIdleGroup).
Idle bool
// Superseded: a running successor REPLACED this session
// (docs/design/chief-in-agent-view.md 4.4, internal/api succession.go);
// the sidebar folds it into its collapsed Superseded group
// (navSupersededGroup). Collapse only: the window still runs and is listed.
Superseded bool
}
MirrorCardView is one MIRRORED entry of the sidebar and the session switcher: a tmux WINDOW (or, from a muster-mirror that registers per session, a whole session) on one of the operator's own machines, reported live by that machine's muster-mirror (internal/mirror). It is NOT an agent — there is no agents row, no chat, nothing to start, stop or delete — so it is its own view, not an AgentCardView with fields switched off. (The name is the retired Agents list card's.)
type MirrorComposerView ¶
type MirrorComposerView = ComposerView
MirrorComposerView is ComposerView under the name it had while only mirrored sessions had one.
type MirrorIndex ¶
type MirrorIndex struct {
Items []MirrorIndexItem `json:"items"`
More int `json:"more"`
}
MirrorIndex is the prompt index as the view's socket sends it: every prompt the host's transcript holds (the newest it kept), each with its bubble's element id, and how many earlier ones the host left out.
func NewMirrorIndex ¶
func NewMirrorIndex(refs []cctranscript.PromptRef, more int) *MirrorIndex
NewMirrorIndex is refs as the view's index.
type MirrorIndexItem ¶
MirrorIndexItem is one prompt: its bubble's id and its first line.
type MirrorOp ¶
type MirrorOp struct {
Op string `json:"op"` // "append" | "replace" | "wrap" | "attr" | "result" | "patch"
ID string `json:"id,omitempty"`
HTML string `json:"html,omitempty"`
Into string `json:"into,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
MirrorOp is one DOM operation the rendered view's page applies:
- append: add HTML to the conversation — or, with Into, to the element of that id (a tool-call group's body);
- replace: put HTML in place of the element with ID (a running tool row whose result arrived; a group's summary as its count ticks up);
- wrap: put HTML (a tool-call group) in place of the element with ID and move that element into the group's body — the second call of a run;
- attr: set attribute Name to Value on the element with ID (a group's state);
- result: a tool row's result for a call an EARLIER socket drew (Resumed): the row with ID takes HTML's status and output and keeps the rest; with no such row on the page, it is an append;
- patch: put HTML in place of the element with ID when the page has one, and do nothing when it does not (a subagent card's summary: never drawn anywhere but inside its card).
type MirrorRef ¶
MirrorRef addresses one mirrored entry: a host, a tmux session on it, and — for a host that registers per window — the window's tmux id. Every URL of a mirrored entry is built from one, so the pages, their sockets and their composer cannot name different windows.
Window == "" is "the session's ACTIVE window": the only address a per-session host has, and what every URL from before windows were addressable means.
func (MirrorRef) ChiefLogPath ¶ added in v0.178.0
ChiefLogPath is the entry's chief strip.
func (MirrorRef) ScrollForm ¶
ScrollForm is the entry's address as the body of a scroll request (MirrorTerminalScrollPath), before the page adds `lines`.
func (MirrorRef) SubagentPath ¶
SubagentPath is MirrorSubagentPath for this entry, before the page adds `agent`.
func (MirrorRef) SuccessorPath ¶ added in v0.183.0
SuccessorPath is the entry's succession read.
func (MirrorRef) TerminalPath ¶
TerminalPath is the entry's terminal page.
func (MirrorRef) TerminalWSPath ¶
TerminalWSPath is that page's socket, before the page adds its mode and size.
func (MirrorRef) ViewWSPath ¶
ViewWSPath is that page's transcript socket, before the page adds its resume point.
type MirrorTranscript ¶
type MirrorTranscript struct {
// Resumed says the page this socket draws for already holds a conversation
// drawn by an EARLIER socket (it reconnected with gen and offset, and no
// Reset came). This transcript has none of that page's calls, so a result
// for one of them is not an orphan to draw at the end: it is redrawn where
// the page has it (a `replace`), and no run is started from it.
//
// 🔴 WITHOUT IT A RESUME SCRAMBLED A RUN: calls a, b, c drawn as one group,
// the socket dropped and resumed, then results a, b, c arrived — each taken
// for an orphan and appended by the grouping rule, so b and c were MOVED out
// of the group into a new one at the end (the client's dedupe removes the old
// row before an append) under the SAME group id as the first: a duplicate id
// and a split, reordered run. The page refreshes a redrawn row's group count
// and state itself (toolGroupScript's refresh).
Resumed bool
// Subagents: the host reports subagents (the stream's SubagentList), so
// an Agent call is drawn as a subagent card (subagent_cards.go) — never
// for an older host, whose Agent calls stay plain tool rows. cards are
// the cards drawn, by tool id, and subs the latest summary of each (a
// summary can arrive before its card). Bounded with calls (forget).
Subagents bool
// contains filtered or unexported fields
}
MirrorTranscript is one rendered-view socket's drawing state: the tool calls on screen, so a result can redraw its call's row in place.
🔴 IN MEMORY, PER SOCKET, AND BOUNDED: it is dropped with the socket and reset with the view, and holds at most maxDrawnCalls calls (the oldest are forgotten; a result for one draws as its own row).
func (*MirrorTranscript) Ledger ¶
func (t *MirrorTranscript) Ledger() cctranscript.ToolContext
Ledger is a copy of the tool-context ledger as Ops has left it: a checkpoint a later socket resuming from the same place restores (RestoreLedger), so a call still running across a reconnect is still attributed when its next turn arrives.
func (*MirrorTranscript) Ops ¶
func (t *MirrorTranscript) Ops(events []cctranscript.Event) []MirrorOp
Ops renders events as the page's DOM operations, in order.
func (*MirrorTranscript) QueuedOps ¶ added in v0.129.0
func (t *MirrorTranscript) QueuedOps(list []string) []MirrorOp
QueuedOps is the host's queued-message list (mirror.Msg.Queued) as the page's DOM operation: the region redrawn ("patch") when the list differs from the one this socket drew last — and always the first time, so a list an earlier socket or a snapshot drew is replaced.
func (*MirrorTranscript) Reset ¶
func (t *MirrorTranscript) Reset()
Reset forgets every drawn call (the view starts over).
func (*MirrorTranscript) RestoreLedger ¶
func (t *MirrorTranscript) RestoreLedger(l cctranscript.ToolContext)
RestoreLedger resumes the ledger from a checkpoint (Ledger) taken at the very place this socket resumes from.
func (*MirrorTranscript) SetAgentContext ¶ added in v0.189.0
func (t *MirrorTranscript) SetAgentContext(c *mirror.AgentContext)
SetAgentContext records the context fill a runtime reported beside its events (mirror.Msg.Context, cleaned): the readout TakeContext reports next. nil leaves the readout as it is.
func (*MirrorTranscript) SubagentOps ¶
func (t *MirrorTranscript) SubagentOps(list []mirror.Subagent) []MirrorOp
SubagentOps is a subagent list (mirror.Msg.Subagents) as the page's DOM operations: each card whose summary changed is redrawn — its <summary> (a "patch": a page without that card draws nothing), and its state and agent attributes — and nothing else, so an opened card keeps its tail. A summary for a call this socket never drew is drawn only when the page may have it from an earlier socket (Resumed); otherwise it is kept for the card the call will draw.
func (*MirrorTranscript) TakeContext ¶
func (t *MirrorTranscript) TakeContext() *ContextView
TakeContext is the context readout when Ops (or SetAgentContext) has drawn a newer one since the last call, else nil — so a batch carries it only when it changed.
type MirrorViewView ¶
type MirrorViewView struct {
// DraftUser is the signed-in user, the first part of the message box's
// draft key (composer_draft.go).
DraftUser int64
// AgentSession is the agent session the view shows (a gated runtime's
// window, Window.AgentSession; "" for any other): the composer's
// AgentSessionField, which the page's script keeps equal to the session
// its stream draws.
AgentSession string
Host string
// HostIcon is Host's icon key (HostIconFor), the one its cards draw.
HostIcon string
Session string
// Window is the tmux window id the view is of; "" = the session's active
// window (a per-session host). With Session it is the page's ADDRESS: its
// socket and its composer name the same window.
Window string
// Title is what an entry with no Label is called ("<session>:<window
// index>"); "" = the session name.
Title string
// Label is the host's display name for the session ("mango:1"), "" for
// none: the page's title. Session stays the address.
Label string
// SessionName is the window's conversation's name (internal/sessionname):
// the header and the <title> draw it when it is a human one
// (mirrorDisplayName). The zero value draws Label / Title.
SessionName sessionname.Name
// Drift is the page's rename offer (driftBanner), nil for none.
Drift *SessionDrift
// Qualifier is what tells this entry apart from another listed entry of the
// same name ("" = none) — the SAME qualifier its Agents card shows
// (mirror.Qualified): part of the header's title and of <title>.
Qualifier string
// Tags is the viewer's own tags on the tmux session (internal/sessiontags),
// drawn in the header after the title (sessionTagsHead); nil for none.
Tags []string
// Interactive: the host advertised -interactive, so the composer is offered
// (each send is still gated on a fresh sign-in, server-side). False draws
// it disabled, saying why.
Interactive bool
// ViewOnly is the Kind of a runtime muster VIEWS but never sends to
// (opencode); "" otherwise. Its composer is drawn disabled saying why
// (MirrorViewOnlyNote), with no queue.
ViewOnly string
// ViewOnlyWhy is what the disabled composer of a ViewOnly window says
// (a gated send's refusal, mirror.SendBlocked); "" says
// MirrorViewOnlyNote.
ViewOnlyWhy string
// Agent is the Kind of a runtime other than Claude Code that this window
// SENDS to (launcher-bound opencode): the composer's words name it. "" for
// Claude Code, and for a ViewOnly window.
Agent string
// StepUp is the "Confirm it's you" wiring (stepup_confirm.go): a send
// refused as stale asks there — passkey or password — and retries. Unused
// (no dialog is drawn) on a read-only host, which cannot be sent to at all.
StepUp *StepUpView
// Notice, NoticeOK and Nonce are the composer's (ComposerView).
Notice string
NoticeOK bool
Nonce string
// Dictate is the composer's (ComposerView.Dictate).
Dictate string
// Upload is the composer's (ComposerView.Upload).
Upload string
// DictateOff and UploadOff are the composer's (ComposerView.DictateOff,
// ComposerView.UploadOff).
DictateOff, UploadOff bool
// Queue is the composer's send queue (ComposerView.Queue); nil for none.
Queue *ComposerQueue
// FocusHistory is the session's focus history, the newest page
// (FocusHistoryPath); "" when the host reports no Claude session for the
// window, which then has none. The index sheet's second tab.
FocusHistory string
// Asks and AsksSrc are the window's Claude sessions' OPEN attention asks
// and their fragment URL (AgentDetailView.Asks).
Asks string
AsksSrc string
// overlay — this page is sized to the window) and its hamburger, framed
// by the view swap or not (nav_layout.go says why).
Nav NavChrome
// Switcher is the session switcher below the composer (switcher.go); nil
// for none.
Switcher *Switcher
// Suggest is the suggested replies' URL (ComposerView.Suggest); "" for
// none — another runtime's window, a host with suggestions not wired.
Suggest string
// SuggestPaused: the viewer's suggestions are auto-paused here
// (ComposerView.SuggestPaused).
SuggestPaused bool
// LiveCopy is the warning that this conversation also runs elsewhere
// under another session id (mirror.SessionView.LiveCopyWarning), "" for
// none: a banner under the header (livecopy.go).
LiveCopy string
// Offline: the host is not serving the window now (its muster-mirror is
// not connected, or it no longer lists the session). Note is the host's
// line about the window (mirror.SessionView.AgentNote), "" for none. Both
// drawn under the header (mirrorHostBanner).
Offline bool
Note string
// Chief draws the composer's chief mode (view_chief.go): the owner has a
// chief that is on, and the window names a conversation the chief can be
// asked about. False draws the composer as it was.
Chief bool
// Succession is this session's newest succession (view_succession.go), nil
// for none; Predecessor the one this session's window continues, nil for
// none.
Succession, Predecessor *SuccessionView
// End is this session's newest proposal when it is an end_session's
// (view_end_session.go), drawn instead of Succession; nil otherwise.
End *EndView
// Plugins is the owner's viewer plugins and the window's preview counts:
// the header's Preview button and its panel (plugin_chip.go); nil for
// none.
Plugins *PluginChips
}
MirrorViewView is the data the rendered view's page renders.
type NavApp ¶
type NavApp struct {
NavApp is a NavDocument laid out as a PHONE APP SCREEN — the page a notification opens (the ask page, internal/api attention_ask_page.go): a top bar with a back arrow and the screen's name, the content scrolling between it and a composer PINNED to the bottom, above the on-screen keyboard and inside the safe-area insets. The column is one dynamic-viewport-high flex column (h-dvh; the viewport resizes its content when the keyboard opens), so the composer is its last row rather than position:fixed — nothing is laid over the content, and nothing can scroll the page sideways. On a desktop the side nav is beside it, as on every page.
type NavChrome ¶
type NavChrome struct {
}
NavChrome is what a page outside the shell needs to draw the navigation: which optional entries exist.
type NavDocumentView ¶
type NavDocumentView struct {
Title string
// Entry is the nav entry the page belongs to (a tab key, NavAttention,
// NavAccount, NavAdmin), or "" for a page with none (Plugins, Browser
// flows, a notice): no link is then highlighted or marked current.
// every value escaped there. It is placed as it is.
Main string
// invite link) or takes one (an OAuth token or API key typed in, a passkey
// ceremony). It loads no telemetry script — these pages never did, and a
// RUM script on the page a secret is rendered or typed in is a reader of it
// nobody needs. Every other page keeps the shell's (faroHead).
Secret bool
// of the column under the shell's header.
App *NavApp
}
NavDocumentView is a server-authored page drawn inside the navigation.
type NoteEditView ¶
type NoteEditView struct {
Note notes.Note
// Directories is the SEED set only (notes.DefaultDirectoryLimit most-recent
// paths), never the whole archive — the rest is reached through the picker's
// search route. See directoryCombobox.
Directories []string
// DirectoriesFailed reports that the directory READ ERRORED, as distinct from
// "there are no directories". The two used to render identically, which is how
// a picker that had been empty in production since it shipped stayed
// unnoticed. See directoryPickerFailed.
DirectoriesFailed bool
// Vocabulary backs the tag input's <datalist> suggestions, so the human reuses
// existing labels instead of minting near-duplicates.
Vocabulary []notes.TagCount
}
NoteEditView carries everything the edit form needs pre-resolved server-side: the task (its current values) and the directory picker options.
type NotificationRow ¶
type NotificationRow struct {
Name string // the agent slug (the route key)
// SessionName is the agent's stable name (internal/sessionname), what
// the row is called; the zero value draws the slug. (No DisplayName: the
// name rule is the row's only naming input.)
SessionName sessionname.Name
SessionID int64 // the session to deep-link to
Count int // unread assistant messages for this agent
}
NotificationRow is one agent's unread-replies entry in the notifications panel: the link target session, the agent's name, and the unread count.
type OwnerAsk ¶ added in v0.161.0
type OwnerAsk struct {
Question string `json:"question"`
Options []OwnerAskOption `json:"options"`
Multi bool `json:"multi,omitempty"`
}
OwnerAsk is an ask_owner call's arguments.
func DecodeOwnerAsk ¶ added in v0.161.0
DecodeOwnerAsk decodes and checks ask_owner's arguments: THE one reading of them, shared by the tool (which refuses on an error) and the card (which draws a plain tool row for anything it cannot read). Unknown fields are refused, text is trimmed, and the error says what to fix.
type OwnerAskOption ¶ added in v0.161.0
type OwnerAskOption struct {
Label string `json:"label"`
Description string `json:"description,omitempty"`
}
OwnerAskOption is one choice: its label (what is sent when tapped) and an optional description.
type OwnerCardState ¶ added in v0.170.0
type OwnerCardState struct {
AskID int64
// Status is OwnerCardOpen, OwnerCardAnswered or OwnerCardClosed (expired or
// withdrawn: Closed says which).
Status string
Answer string
// Phone: the answer came from the owner's paired phone (0092's door).
Phone bool
// Closed is why a closed card closed, in words ("expired", "withdrawn").
Closed string
// Expired: the ask lapsed unanswered. The chat then draws the card from
// the transcript, as #496 did (chiefToolCard), so a later typed reply
// still settles it there.
Expired bool
// Question and Options are the ask's own: what a card muster raised itself
// (a held mirrored dispatch's) is drawn from, having no ask_owner call.
Question string
Options []string
}
OwnerCardState is a stored card's state, composed in internal/api from its attention ask (ownerCardsFor): THE row every surface reads.
type PluginChip ¶ added in v0.186.0
PluginChip is one live viewer plugin the panel can open.
type PluginChips ¶ added in v0.186.0
type PluginChips struct {
MintPath string
Host, Session, Window string
Chips []PluginChip
// Previews is the window's counts when the page was drawn
// (mirror.SessionView.Previews): the button's first state.
Previews mirror.WindowPreviews
}
PluginChips is a session view's preview control: the owner's live viewer plugins (newest first), the mint route, the window every hand-off is aimed at, and what that window has to preview now. nil draws nothing.
type PreviewPlace ¶ added in v0.194.0
type PreviewPlace string
PreviewPlace is where a Preview button is drawn: the header row (from `sm` up) or the header's second row (below `sm`).
const ( PreviewInHeader PreviewPlace = "header" PreviewInRow PreviewPlace = "row" )
func PreviewPlaceOf ¶ added in v0.194.0
func PreviewPlaceOf(s string) PreviewPlace
PreviewPlaceOf is the place a query's `place` names; anything else is the header.
type ProposalView ¶ added in v0.183.0
type ProposalView struct {
ID int64
Kind string
// Heading is the question the card asks ("Start a new session that
// continues this one?").
Heading string
// Settings are its label/value rows, drawn in order; a blank value is
// left out.
Settings [][2]string
// BodyLabel and Body: what the action will carry, verbatim (a
// succession's kickoff), in an open disclosure; "" for none.
BodyLabel, Body string
// Options are the buttons, in order; the first is the primary one (two,
// when the card asks a choice of three).
Options []string
}
ProposalView is one proposal card as a view draws it.
type QuickKey ¶
type QuickKey struct {
ID string // data-key, the stable handle a test addresses
Label string
Aria string
Seq string // the bytes sent, as typed by a VT100-style terminal
}
QuickKey is one button on the terminal's quick-key bar: a key a phone's keyboard lacks, and the exact bytes it types.
type RecentRef ¶
RecentRef is one recently opened entry, as the store keys it: an agent by id (Mirror zero), or a mirrored entry by its address (AgentID 0).
type Renamed ¶ added in v0.205.0
Renamed is a rename answered IN PLACE on the page that posted it (every htmx rename: the drift offer's Rename and the rename dialogs' Save). Body is the out-of-band swaps — every place THAT page names the session, drawn by the helpers the page itself is drawn with, so the in-place name cannot differ from a reload's. Title is the page's new document title and Focus the id of the element focus moves to (the page's title), which the server sends as the muster:renamed event renameScript handles: the title is a JS string there, set exactly, never parsed as markup.
func AgentPageRenamed ¶ added in v0.205.0
func AgentPageRenamed(v AgentDetailView) Renamed
AgentPageRenamed is a rename answered on an agent's page, v the page's view with its NEW name: the banner, the header's title box (agentTitle — the whole box, so a name cleared back to the slug draws as the page would), the agent menu's rename dialog (v.Card) and the switcher; the <title> agentDocTitle; focus on the title.
func MirrorViewRenamed ¶ added in v0.205.0
func MirrorViewRenamed(v MirrorViewView) Renamed
MirrorViewRenamed is a rename answered on a window's Rendered view, v the page's view with its NEW name: the banner, the header's title button (the whole button: a human name, or the label it falls back to when the name is cleared) and its full-title popover, the switcher; the <title> mirrorViewDocTitle; focus on the heading (MirrorHeadingID — the button itself is disabled while the title fits, and a disabled button takes no focus).
func TerminalRenamed ¶ added in v0.205.0
func TerminalRenamed(v AgentTerminalView) Renamed
TerminalRenamed is a rename answered on a Terminal page (an agent's or a mirrored window's — one page, AgentTerminalPage), v its view with the NEW name: the header's title (terminalTitle) and the switcher; the <title> "Terminal · … · muster" (terminalDocTitle); focus on the title. It has no drift offer.
type RepoView ¶
RepoView is the minimal repo shape the dispatch dialog's repository picker renders (decoupled from the GitHub API client type).
type SendAgainView ¶
type SendAgainView struct {
// Action is the route the page posts to: the Send, Queue or Send now it
// answers, once more, with SendAgainField=1.
Action string
// Fields are what that post carries besides: the address, the text, a
// fresh nonce. Nothing for a Send now (its route names the message).
Fields []ComposerField
// Why is the refusal, in the server's words.
Why string
// Text is the message, shown so the person can tell which one it is.
Text string
// Button is the button's text ("Send again", "Queue it anyway"…).
Button string
// BackHref is where Cancel goes: the view it came from.
BackHref string
// Brand is the instance's branding, for the page's favicon and touch icon.
Brand Brand
}
SendAgainView is SendAgainPage's content.
type SendQueueItem ¶
type SendQueueItem struct {
ID int64
// State is the sendqueue state: queued, sending, sent, failed, cancelled.
State string
// Preview is the start of the message (the owner's own text).
Preview string
// Body is the whole message: what a tap on the preview shows
// (sendQueuePreview), and a queued one's Copy message. "" draws the
// preview alone, with nothing to open.
Body string
// Detail is the outcome in words, for a finished one.
Detail string
// Cancellable: still queued.
Cancellable bool
// Answered is the asker whose question this message already answered when
// it was queued, "" for none: its Cancel cannot take that answer back.
Answered string
// Retryable: it failed and has not been retried; drawn with a Retry.
Retryable bool
// Deletable: it is finished, so its owner may remove it from the list;
// drawn with a Delete. The list holds only failed ones among the finished
// (sendqueue.PGStore.List). Never a queued message (that is Cancel) or one
// being sent.
Deletable bool
// MayHaveDelivered: muster stopped while sending it, so it may have
// reached the window. Its Retry warns, and asks once before it queues it.
MayHaveDelivered bool
// Editable: queued, and a person's own (a routed message's text is the
// chief's); its menu has Edit.
Editable bool
// Held: held for an edit right now (here or on another device); nothing of
// the window's queue is sent until it is saved, cancelled or runs out.
Held bool
// HoldLapsed: an edit was opened and not saved in time; it kept its text.
HoldLapsed bool
// Edited: its text was changed by a saved edit.
Edited bool
// HeldElsewhere: this page asked for the row open, but its hold is not the
// one this page's Edit was given — another device took the edit over.
HeldElsewhere bool
// Editing: draw the row as its edit form (sendQueueEditRow), under
// HoldToken, the hold its Save and Cancel present. HoldLeftMS is how long
// the hold has left, which the list's script counts down.
Editing bool
HoldToken string
HoldLeftMS int64
}
SendQueueItem is one message of the list.
type SendQueueListView ¶
type SendQueueListView struct {
Items []SendQueueItem
// Waiting is what the next message is waiting for (sendqueue.Decide's
// reason), "" when nothing is queued or it is about to send.
Waiting string
// Held: the queue is held on how the window's latest turn failed — a usage
// limit, or the circuit breaker (sendqueue.Decision.Held). Waiting says
// why; Send now still sends one.
Held bool
// ResumeAt is when a held queue resumes — a usage limit's reset, the
// breaker's next retry — zero when it names none. Drawn after Waiting in
// the READER's zone (a <time data-clock> the list's script formats); the
// server, which does not know that zone, draws it in UTC, saying so.
ResumeAt time.Time
// Now is the server's clock when the view was drawn: whether ResumeAt is
// today decides whether its date is drawn (utcClock).
Now time.Time
// Error is why the list could not be read.
Error string
}
SendQueueListView is a target's queue.
type SessionDrift ¶ added in v0.170.0
SessionDrift is a session page's rename OFFER (internal/focus DriftOffer): its focus has moved on from its name, so the page offers the current focus title as the new name — one tap — or to keep the name. muster never renames on its own. Offer is the title offered; RenameAction the session's rename route; Fields the hidden fields naming the session (both forms post them); Back the page to return to without script.
type SessionRuntimeView ¶
SessionRuntimeView names a runtime the picker offers.
type SessionTagTarget ¶ added in v0.158.0
SessionTagTarget is the session a tag is for, as the editor posts it: an agent (AgentID), or a mirrored tmux session (Host, Session — Window is only the page's own window, for the switcher's rows in the answer; tags are not keyed on it).
func (SessionTagTarget) Query ¶ added in v0.158.0
func (t SessionTagTarget) Query() string
Query is the target as a query string (the list route's).
type SessionView ¶
type SessionView struct {
ID int64
// Runtime and Model are the session's (chief_sessions.go): Runtime "" is a
// session on the agent's own runtime, and draws no runtime line.
// RuntimeLabel is what the line calls the runtime.
Runtime, RuntimeLabel, Model string
// IsDefault marks the agent's default session; DefaultPath, when set, is
// where a non-default session's "Make default" control posts.
IsDefault bool
DefaultPath string
// Title is the session's name, derived by the store from its first user message.
//
// 🔴 AN EMPTY TITLE RENDERS DIFFERENTLY ON THE TWO SURFACES THAT DRAW THESE ROWS,
// AND THAT IS DELIBERATE RATHER THAN DRIFT: sessionDrawer (the agent-detail and
// operator pages) renders "New chat"; chiefThreadRows (the chief slide-out)
// renders "New thread". Each matches the noun its own surface uses everywhere else
// — the page's control is "New chat", the panel's is "New thread" and its list is
// headed "Threads" — so making them agree would leave one of the two surfaces
// naming a thing its own buttons do not. This comment is the only written answer
// to "what does an untitled session show", so it names both; the pair is pinned
// two-way by ui.TestAnUntitledSessionsPlaceholderIsPerSurfaceAndLedgered.
//
// 🔴 THAT GUARD DERIVES THE RENDERER SET FROM THE PACKAGE'S OWN AST rather than
// enumerating the two it knows about — but its reach is ONE SYNTACTIC SHAPE, and
// this comment is where that limit has to be stated because this is where the
// promise is made. What it matches is exactly the shape both renderers are written
// in: `title := x.Title`, then `if title == "" { title = "<word>" }`, inside a
// FuncDecl of package `ui`. MEASURED to pass it, i.e. NOT caught: a fallback keyed
// on the field directly (`if s.Title == "" { return "…" }`), one assigning a named
// constant instead of a literal, and one testing `len(title) == 0`. So a third
// renderer copying either of these two keeps the sentence honest; a third renderer
// written differently does not, and nothing here would say so.
//
// ⚠ THE EARLIER CLAIM WAS WIDER THAN THE CODE, TWICE OVER. Before round 2 this
// comment credited the guard with catching a third renderer while the test
// hard-coded two surfaces and two literals; round 2 derived the set but the comment
// then said the derivation "is what makes the promise true rather than merely
// intended", which the measurement above does not support. Widening the scan to
// every possible fallback shape is a parser nobody should own — the limit is worth
// naming, not closing.
Title string
Active bool
LastActive time.Time // session's last-active time (UpdatedAt), rendered relative
// Snippet is a short excerpt around a SEARCH match in this thread's message
// bodies. Empty on the plain list, and empty for a result matched by TITLE
// alone — the title is already on screen, so repeating it as a snippet would
// claim a body match that does not exist.
Snippet string
// Unread (a chief's chat, agents.ChatListing): a reply arrived since the
// chat was last opened — the switcher's unread dot. Archived: the chat is
// archived, listed apart under "Archived".
Unread, Archived bool
}
SessionView is one chat session in the switcher.
type ShellData ¶
type ShellData struct {
// contains filtered or unexported fields
}
ShellData is state a shell draws on its FIRST PAINT, rather than after the panel's own load, because drawing it later would move what is below it.
Only the Tasks tab draws anything here now (WithTasks). The retired Agents tab's document drew its LIST here (WithList, agents_list_ssr.go), and before that a "Recently viewed" strip, for the same reason — the strip measured 0.011 of layout shift when it arrived late.
type StepUpFormView ¶
type StepUpFormView struct {
// Action is the route the page posts to: it checks the password and, when
// it is right, performs the send that was waiting.
Action string
// Fields are the pending send, carried as hidden inputs — its address, its
// text, its nonce — so confirming completes it rather than asking for the
// message again.
Fields []ComposerField
// BackHref is the view the send came from (Cancel, and where the result is
// shown).
BackHref string
// Window is the freshness window as a person reads it ("12 hours").
Window string
// Error is why the last attempt was not accepted; "" on the first showing.
Error string
// Brand is the instance's branding, for the page's favicon and touch icon.
Brand Brand
}
StepUpFormView is the plain "Confirm it's you" page: the step-up for a send the BROWSER submitted (no script ran), which the dialog above cannot serve.
type StepUpView ¶
type StepUpView struct {
// ConfirmPath is the same-origin route that takes the password again.
ConfirmPath string
// PasskeyPath is the same-origin route PREFIX of the passkey confirm
// (<prefix>/options, <prefix>/verify); "" when this server has no passkeys
// (password mode, or GoTrue's passkeys off), and the dialog is then
// password-only. Whether THIS account has a passkey is asked when the dialog
// opens — never on page load, which would spend a GoTrue call on every view.
PasskeyPath string
// FreshFor is how many milliseconds the current sign-in stays fresh, as
// the SERVER measured it when it rendered the page (0 = not fresh). A
// duration rather than an instant, so the browser's clock does not matter.
FreshFor int64
// Window is the freshness window as a person reads it ("12 hours") —
// stepup.WindowText, passed in so this package states no window of its own.
Window string
// Why, when set, is the dialog's sentence about the gate in place of
// StepUpWhy's (which names typing into a session): a page gating something
// else says what. It should name Window too.
Why string
}
StepUpView is what a page needs to ask "Confirm it's you" before a gated action.
type SubagentTailView ¶
type SubagentTailView struct {
Tail mirror.SubagentTail
// Note replaces the steps when they could not be read: why.
Note string
}
SubagentTailView is one opened card's steps (MirrorSubagentPath).
type SuccessionView ¶ added in v0.183.0
type SuccessionView struct {
ID int64
State string
// Mode is replace or spinoff, "" while the owner has not chosen.
Mode string
Target, Model, Repo string
BaseNote string
SubjectTitle, PredPath string
Superseded bool
// Card is the proposal card while the succession is proposed.
Card *ProposalView
Host, Title, ViewPath string
Refusal string
}
SuccessionView is one succession as a view draws it.
type Switcher ¶
type Switcher struct {
Recent, Waiting, Pins, All []SwitcherItem
// RecentMore is the hrefs of Recent's entries switcherRecentMax+1 to
// dockRecentMax, in visit order: the dock's Recent tab draws them from the
// All row's pills (every one of them is one), after the bar's own.
RecentMore []string
// contains filtered or unexported fields
}
Switcher is the bar's content, resolved on the server: one list per view.
func NewSwitcher ¶
func NewSwitcher(list []AgentCardView, mirrors []MirrorCardView, refs []RecentRef, cur SwitcherCurrent) *Switcher
NewSwitcher resolves the bar against the entries (list, mirrors — internal/api builds them as it builds the sidebar's) and the viewer's recently opened refs (newest first).
type SwitcherCurrent ¶
type SwitcherCurrent struct {
AgentID int64
Mirror MirrorRef
// Back is the page itself, where the bar's pin toggle sends the browser
// back to after a post without script: a Terminal view names its own
// address, so a pin there does not land on the session's other view. ""
// is the session's own page (its sidebar row's link, newSwitcherPin).
Back string
// Now is the server's clock, which every pill's focus age is worked out at
// (FocusAgeOf): the clock the Asks list, a notice's push and the chief's
// tools age titles by. Zero: time.Now.
Now time.Time
}
SwitcherCurrent names the page's own session: an agent by id, or a mirrored window by its address (AgentID 0). A window addressed by its session alone (Window "") is the current one whichever of that session's windows an entry names.
type SwitcherItem ¶
type SwitcherItem struct {
Href, Label string
// Kind is "agent" or "mirror".
Kind string
// Current: the page's own session (drawn, not linked).
Current bool
// Waiting: the entry waits on the viewer (listEntry.waiting).
Waiting bool
// Attention is the entry's attention (its card's): with Waiting, what its
// waiting mark draws (entryWaitMark).
Attention *CardAttention
// Host and HostIcon are the entry's host and its icon key — its sidebar row's:
// the cluster for an agent, the window's host's otherwise. HostNamed: the
// label already spells the host (labelNamesHost), so the icon is
// decorative.
Host, HostIcon string
HostNamed bool
// Code and Title are what the search finds the entry by (palette.go's paletteBox):
// Code its tmux codename ("mango:2") for a window — its "<session>:<index>"
// title when the host named none — or its name for an agent; Title what it
// is called beyond that (its display name, its focus), "" for nothing more.
Code, Title string
// Words are what the search finds the entry by AFTER its codename and
// title, as plain words: its repository, its kind, — a window's — its
// raw tmux session name and host, and the viewer's own tags on it
// (sessionTagWords); "" for none. Space-separated, lower-cased.
Words string
// Prev is the entry's previous focus titles, newest first, one per line
// (switcherPrevTitles): what the search finds it by after its current
// title, and shows as "Previously: …" when that is why it matched.
Prev string
// Focus is the entry's current focus title, plained; "" for none. The
// dock's row draws it as its second line (data-switcher-focus): Title
// joins it with the display name, so it cannot be split back out.
Focus string
// FocusAge is how old Focus is (FocusAgeOf, at render time): the dock and
// the palette draw it beside the title (data-switcher-focus-age,
// data-switcher-focus-stale).
FocusAge FocusAge
// Named: the entry is called by a HUMAN name (internal/sessionname), so
// its technical ids — the host the dock writes beside the name — are
// left off the main surfaces (they stay in Tip and in Words).
Named bool
// TmuxAt and TmuxCode are the entry's MirrorCardView.TmuxAt / TmuxCode:
// the pill's second line (TmuxCode); and the line under the focus (TmuxAt,
// entryTmuxAttr's data-switcher-tmux) of the dock's row, the sidebar's row
// (navRowName) and the command palette's row; "" for none, and always for
// an agent.
TmuxAt, TmuxCode string
// Tip is the entry's tooltip: its Label, then — when it is called by a
// human name (internal/sessionname) — the technical id that name hides
// (an agent's slug; a window's codename, tmux address and host).
Tip string
}
SwitcherItem is one entry of a view.
type Tab ¶
type Tab struct {
// ID is the tab's name within its tablist: what is stored, and what the
// elements' ids end in. Plain [a-z0-9-].
ID string
Label string
Panel g.Node
}
Tab is one tab and its panel.
type TabSet ¶
TabSet is a tablist and its panels, drawn apart so the list can sit in a header beside other controls. They are tied by ids (aria-controls / aria-labelledby), not by nesting.
func Tabs ¶
Tabs is a tablist over tabs' panels, the first selected. id names the instance (element ids are id+"-tab-"+Tab.ID and id+"-panel-"+Tab.ID); key is what the choice is stored under ("" = not stored); label is the tablist's accessible name. Each panel is the scroll container of its own content.
func TabsSelected ¶
TabsSelected is Tabs with the tab whose ID is selected drawn selected — the first when selected names none of them. It is how a page whose tab is in its URL (the Asks page's ?tab=) draws that tab without a script: a stored choice (key) still wins on load, so such a page passes key "".
type TaskCardView ¶
type TaskCardView struct {
Note notes.Note
Agent *AgentBrief
// Detail switches the card from its BOARD shape (a compact summary whose
// title is a stretched link to /tasks/{id}) to its DETAIL shape (the full
// markdown body, attachments, session thread, comments and the comment form,
// with no navigation link because you are already on that page). It is the
// ONE predicate the two shapes differ on — see internal/api's renderNoteCard,
// which derives it from htmx's HX-Current-URL so every existing mutation
// route (status PATCH, comment POST/DELETE, tag add/remove, edit) re-renders
// the card in the shape of the document that asked, without duplicating a
// single route. It is deliberately NOT read from a header the page's markup
// stamps: internal/api/view.go records why that leaked onto the board.
//
// In detail shape the title is the document's ONE <h1>; on the board it is an
// <h3> inside the list.
Detail bool
// RefWrites are a plugin task REFERENCE's writes still on their way to the
// upstream (pending, claimed, failed), for the detail shape's thread. Nil
// for an ordinary task, and on the board, which does not read them.
RefWrites []notes.RefWrite
}
TaskCardView carries one task plus its (optional) most-recent linked agent, so the card can reflect the dispatch state (status chip + Open chat) instead of a bare Dispatch button. Agent is nil when the task has no linked agent.
type TaskModalComment ¶
type TaskModalComment struct {
Author string
Body string // markdown; always empty when Retracted
When string // preformatted timestamp label
// Retracted renders the tombstone instead of Body. This page carries no
// retraction CONTROL (retracting is done from the task card) and that
// asymmetry is deliberate — but it must never render a retracted comment's
// BODY, so the flag is carried here rather than assumed away.
Retracted bool
}
TaskModalComment is one comment in the task-detail modal, oldest-first.
type TaskModalView ¶
type TaskModalView struct {
ID int64
Status string
Body string // markdown
Repo string
Model string
Comments []TaskModalComment
}
TaskModalView is the data the task-detail modal renders (opened from the chat header title). It is a read-only view of the agent's linked task.
type TasksView ¶
type TasksView struct {
Cards []TaskCardView
Vocabulary []notes.TagCount
ActiveTags []string
// Projects is the `project:` vocabulary, rendered as its OWN filter row above
// the general tag chips so a project is not buried among descriptive tags.
Projects []notes.ProjectCount
// ActiveStatus is the selected task STATUS (one of taskstatus.All()), or ""
// for the All chip.
//
// ⚠ IT USED TO BE A "LANE" — a separate, coarser vocabulary in which
// in_progress and ready_for_review shared one bucket. That layer is deleted
// (internal/taskstatus/label.go); the chip's value is the status itself now,
// which is also what travels in ?status= and into the SQL predicate.
ActiveStatus string
// Limit is the cap the server actually applied (0 = unlimited), and Total is
// how many tasks matched BEFORE that cap. `len(Cards) < Total` is the exact
// condition for rendering the show-more control; both come from the same
// query, so they cannot disagree across a concurrent write.
Limit int
Total int
// NextLimit is the limit the show-more control requests, or 0 when there is no
// larger page to ask for (the list is already at maxTaskLimit — see
// nextTaskLimit in internal/api/tags.go). The SERVER computes it rather than
// the browser adding a page size because the server is the only side that
// knows Total and the only side that knows its own clamp.
//
// It lands in #tasks-list's hx-get URL, which — via tagScript's
// htmx:configRequest listener — is what an SSE-triggered refetch then asks
// for. This comment used to call the URL "the one place a value survives
// #tasks-list's SSE-triggered refetch"; that was false until the listener
// existed, and the tag filter had been silently resetting on the same channel
// for as long as it had shipped.
NextLimit int
}
TasksView is everything the /ui/tasks partial renders: the task cards, the tag vocabulary behind the filter chip row, and the ACTIVE filters. Every active filter is server-side state: the server reads it off the REQUEST URL and renders the chips from what it read, so the chips can never disagree with the list beside them.
🔴 THAT IS A CLAIM ABOUT CONSISTENCY, NOT ABOUT SURVIVAL. It used to read "so an SSE-driven list refresh can never silently drop it", which was false: server-rendered state is dropped by any refetch whose URL omits it, and until tagScript's htmx:configRequest listener landed that was EVERY trigger-driven refetch (htmx captures #tasks-list's verb path at process time, so writing hx-get moved the attribute and not the request). What preserves a filter across a refresh is that listener plus the hx-get URL, both in internal/ui/components.go — nothing in this struct.
Source Files
¶
- agent_actions.go
- agent_header_folded.go
- agent_href.go
- agent_outcome.go
- agents.go
- agents_detail.go
- asks_list.go
- attach.go
- attention.go
- brand.go
- bubble_clamp.go
- cards_attention.go
- cc_queued.go
- chat_index.go
- chief_chats.go
- chief_panel.go
- chief_sessions.go
- components.go
- composer_draft.go
- composer_fit.go
- composer_menu.go
- composer_pending.go
- composer_reveal.go
- connectors.go
- dictate.go
- dispatch_card.go
- faro.go
- features.go
- floating_menu.go
- focus.go
- focus_history.go
- host_icons.go
- host_prefs.go
- identity_color.go
- idle_section.go
- keyboard_viewport.go
- kinds.go
- list_order.go
- list_signals.go
- live.go
- livecopy.go
- markdown.go
- merge.go
- mirror.go
- mirror_ask.go
- mirror_compose.go
- mirror_snap.go
- mirror_view.go
- nav_agents.go
- nav_layout.go
- notes.go
- notifications.go
- onboarding.go
- owner_ask.go
- palette.go
- pins.go
- plugin_chip.go
- pwa.go
- rank_script.go
- recents.go
- render.go
- render_phase2.go
- restore.go
- send_again.go
- send_queue.go
- session_name.go
- session_tags.go
- static_script.go
- stepup_confirm.go
- subagent_cards.go
- suggest_row.go
- swap_inline.go
- switcher.go
- switcher_dock.go
- switcher_pin.go
- tabs.go
- tags.go
- task_claims.go
- task_detail.go
- task_not_found.go
- task_refs.go
- tasks_list_ssr.go
- terminal.go
- theme.go
- tool_context.go
- tool_groups.go
- view_chief.go
- view_end_session.go
- view_proposal.go
- view_succession.go
- view_swap.go
- work_chip.go