Agents: screens and components
Every shape and component in agents.contract, their testIds, the agents state, tasks and actions in app.contract, and the Contract tests that drive them.

agents.contract holds the Agents tab's shapes and views: six screens and five smaller components, 853 lines. It declares no data. Its state, resources, tasks and actions are the pkg:agents blocks of the root contract, which pass everything in as props.

Shapes

Declared at lines 7-137. Each matches what a source returns.

Shape

Returned by

Notes

AgentsOverview

agentsOverview

Contains AgentListRow[], AgentProvider[], AgentProviderOption[], AgentSessionRow[], plus owner, agentId, health, more, safeSecrets, error

AgentModels

agentsModels

AgentModel[], defaultId, owner

AgentThread

agentsSession, agentsSessionStream

rows: AgentChatRow[], streaming text, phase, status, connection, revision, parentId

AgentRuns

agentsLoadRuns, agentsRunStream

rows: AgentRun[] with AgentPlanStep[] and AgentChildRun[], rootId, version, connected

AgentLive

agentsAgentStream

revision, error

AgentReply

agentsCommand, agentsSaveProvider

id, command, error

AgentSettingReply

agentsNormalizeServer, agentsUseTestKey

id, url, error

AgentTimeline

built in the view

id, at, message: option<AgentChatRow>, run: option<AgentRun>

An atom agentDocument link="hm:" makes hm: links inside rendered Markdown tappable; the session screen's openDocument action forwards the tapped href to follow.

Screens

Component

Route

Presentation

Main testIds

AgentsScreen

agents

tab root

agents-placeholder (the list), agents-new, agents-server, agents-providers, agents-no-identity, agents-identity, agents-loading, agents-empty, agent-<id>

AgentDetailScreen

agent

pushed

agent-title, agent-session-list, agent-new-session, session-<id>, agents-more-sessions

AgentSessionScreen

session

pushed

agents-chat-title, agents-reconnect, agents-transcript, message-<id>, agents-activity, agents-stop, agents-retry-turn, agents-parent, agents-composer-bar, agents-composer, agents-send

AgentCreateScreen

new-agent

modal

agents-create-close, agents-create-save, agents-create-name, agents-provider-<id>, agents-model-<id>, agents-create-prompt, agents-create-error

AgentProvidersScreen

providers

modal

agents-providers-close, provider-<id>, agents-provider-type, agents-provider-name, agents-provider-url, agents-provider-endpoint, agents-provider-key, agents-provider-save, agents-provider-error

AgentServerScreen

agent-server

modal

agents-server-input, agents-server-save, agents-server-error

The agents-test route has no component: its fixture screen with the agents-test-key button is inline in app.contract.

Smaller components

Component

Draws

testIds

AgentError

A red message with Retry, only when the message is not empty

agents-error, agents-retry

AgentToolRow

A tool call card with local expanded state: title, status, summary, source chip, child conversation link, and on expand the input and output in monospace and an "Open source" button

tool-<id>, tool-status-<id>, source-<id>, tool-child-<id>, tool-detail-<id>, tool-input-<id>, tool-output-<id> and their -label- variants

AgentChildRow

A child run link, disabled when it has no session

child-<id>

AgentContextRow

An expandable row for trigger and raw rows

context-<id>, context-toggle-<id>, context-detail-<id>

AgentRunCard

A run card: title, Badge with the label (danger.fill when failed), plan steps with their children, note or "Waking in" countdown, duration and tokens, Answer or Resume, Cancel, Open conversation

run-<id>, step-<run>-<step>, answer-<id>, cancel-<id>

agentDuration(ms) formats Xh Ym, Xm Ys or Xs. agentProviderOption looks up a provider type's form metadata with a safe default.

The session screen in detail

The transcript is one virtualized list with scroll-start="end" and scrollFollowEnd=true. Its rows are computed by derives (lines 497-506):

    messageRows: every thread.rows entry.

    pendingRows: the optimistic bubble, with at just below the maximum safe integer so it sorts last.

    streamingRows: the partial assistant text thread.text, sorted after the optimistic bubble.

    unpinned runs, at their own at.

    timeline sorts all of those by at. tailRows then appends pinned runs, a tail-error row, and while thread.status == "streaming" a tail-status row reading "Replyingโ€ฆ", "Running a toolโ€ฆ" or "Thinkingโ€ฆ" with a Stop button.

The comment explains the tail: "Runs and status belong in the transcript so they remain reachable with the keyboard open". Each row is drawn by kind (see chat rows): tool rows, context rows, continuation, system text, errors with "Retry reply" on the last row only, and bubbles, mine right on brand.fill, the agent's left on the secondary background. A session with a parentId shows "Driven by a parent conversation. Open it to intervene." in place of the composer. The composer is a growing textarea (max height 140) with a filled Send button that keeps focus.

Root state, tasks and actions

The full declaration table is in Root declarations: Activity and Agents. The actions (lines 416-550):

Action

Effect

agentsNavigate(url)

Restamps clocks, clears draft and error, then routes: hm:// to the doc route, http(s) to openURL, anything else to go

agentsTick, agentsStampVisit, agentsRefreshReads, agentsRefreshList

Clock stamps; the visit stamp also resets backoff

agentsMoreSessions

One more page of sessions

agentsMaybeReconnect, agentsRetryConnection, agentsRefresh

Backoff and full refresh. See streams

agentsInitServer, agentsEditServer, agentsSaveServer, agentsAfterSetting

Server sheet: normalise, then store agentServer and go back

agentsSetupTest, agentsAfterTestKey

Test identity: set the account and mock URL, replace the route with agents

agentsInitCreate, agentsInitModel, agentsEditName, agentsEditPrompt, agentsPickProvider, agentsPickModel, agentsCreate

New agent form

agentsNewSession

create-session

agentsEdit, agentsSend

Composer. Send sets the optimistic bubble and refocuses agents-composer

agentsStop, agentsRetryTurn, agentsCancel(id), agentsSignal(id, signal)

Session and run commands

agentsAfterChange

Clears the optimistic text. On success: create-agent replaces the route with the agent, create-session goes to the session, send clears the draft, follows a continued session, and scrolls to the last row

agentsSaveProvider, agentsAfterProvider

Provider sheet

The default system prompt is the initial value of agentsPrompt: "You are a helpful assistant working inside Seed Hypermedia."

Contract tests

agents.test.contract starts every test at "/agents-test" with epoch now, taps agents-test-key, and waits for agentsData.health == "Online". Most tests first request POST "/dev/reset" on the mock agents server. The 15 tests:

    Agents list, configuration, providers and validated creation.

    Session opens newest and streams Markdown, tool results and run status.

    Agent server validates the URL before saving.

    A waiting run can be answered and a subsequent run can be stopped.

    Failed sends keep the draft and recover without duplicate user bubbles.

    A completed plan freezes before the closing reply.

    A provider can be configured with a fixture-only API key.

    Older conversations load through the server cursor.

    Nested runs group by stable plan step and child conversations navigate both ways.

    Trigger context, structured parts and source chips retain the message story.

    RetrySession recovers the failed assistant reply without duplicating the user message.

    A dropped stream reconnects and recovers the offline message once.

    Read clocks advance on an idle session without reopening any stream.

    Provider labels and default URLs follow metadata for hosted and local providers.

    Timer waits show a countdown and budget pauses resume through SignalRun.

app.test.contract adds one: the Me tab's agent server row opens this package's server sheet. See Contract UI tests.

User stories

The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Connections0
Linked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkLinked document ยท Outgoing linkAgents: screens and componentsAgents: screens and compoโ€ฆ
Citations 0Children & links 28

Loading child documentsโ€ฆ

Connections show where other documents or comments link to this document.

Related documents

Loading connectionsโ€ฆ