Root declarations: Activity and Agents
Every state, derive, resource, mutation and task that app.contract declares for the activity and agents packages, one line each.

This page lists the pkg:activity decl and pkg:agents decl blocks of the root contract. Both packages sign their requests with a time, so both carry clock state that only actions write.

Activity (lines 121-147)

Name

Kind

Meaning

activityEmail, activityEmailOwner, activityEmailServer

state

Email draft and the account and server it was typed for

activityTick

state

performanceNow() at the last ask, for relative times

activityAskServer, activityAskAccount, activityAskAt

state

The stamp one action writes. activityAskAt == 0 means "not asking"

activityActive

derive

nav.tab == "activity"

activityData

resource activityLoad(activityAskServer, activityAskAccount, activityAskAt > 0, time.utcOffset) with activityAskAt, ActivityPage

The signed inbox read. See Activity client

activityChanged

mutation, ActivityReply, refreshes activityData, then activityAfterChange

Mark read and email settings

activityReady

derive

The loaded page belongs to the current account and server

activityDraft

derive

The typed email when it belongs to this owner, else the saved one

activityError

derive

Message of a failed load

activitySaveError

derive

Error of the last mutation, only if its page is for the current owner

activityVerification

task, when active, ready and email pending or expired

every(3000, activityPoll)

activityWake

task, when activityActive, key server and account

after(1, activityAsk)

activitySleep

task, when not active and activityAskAt > 0

after(1, activityPark)

activityClock

task, when activityActive

every(60000, activityAsk)

Agents (lines 148-207)

Name

Kind

Meaning

agentServer

state, persist

Agents server URL, default https://agentic.seed.hyper.media

agentsTestAccount

state

Throwaway account id set by the /agents-test route

agentsDraft, agentsOptimistic, agentsOptimisticAfter

state

Composer text, the optimistic bubble, and the row count when it was sent

agentsName, agentsPrompt, agentsProvider, agentsModel

state

New agent form

agentsServerDraft

state

Server URL being edited

agentsRequestTime, agentsReadTime

state

performanceNow() stamps: the first keys streams and the session read, the second keys plain reads

agentsLiveTick

state

One second clock for run durations

agentsSessionPages

state

How many pages of 50 sessions to load

agentsReconnectAttempt, agentsReconnectDelay, agentsReconnectAt

state

Backoff bookkeeping

agentsAccount, agentsOwner

derive

Test account or currentAccount, and server|account

agentsActive

derive

nav.tab == "agents"

agentsAgentId, agentsSessionId

derive

The last agent and session entry on the stack

agentsData

resource agentsOverview(...), AgentsOverview

Health, agents, providers, one agent's detail and sessions

agentsModelData

resource agentsModels(...), AgentModels

Models of the chosen provider, only on new-agent

agentsThreadData

resource agentsSession(...), AgentThread

The HTTP session snapshot

agentsThread

resource agentsSessionStream(..., agentsThreadData), AgentThread

The live transcript

agentsRunData

resource agentsLoadRuns(..., agentsThread.revision, ...), AgentRuns

Run cards over HTTP

agentsLiveRuns

resource agentsRunStream(..., agentsRunData.rootId, ...), AgentRuns

The newest run tree, live

agentsAgentLive

resource agentsAgentStream(...), AgentLive

Change counter for one agent

agentsVisibleOptimistic

derive

Hides the optimistic bubble once the same text arrives as a row

agentsRuns

derive

Merges HTTP runs with the live root run when owner, root and version agree

agentsReady, agentsModelsReady, agentsThreadReady

derive

Owner checks on each reply

agentsError, agentsRunError, agentsSettingError, agentsProviderError

derive

Errors of commands, runs, the server form and the provider form

agentsChanged

mutation, AgentReply, refreshes agentsData, agentsRunData, then agentsAfterChange

Every command

agentsSetting

mutation, AgentSettingReply, then agentsAfterSetting

URL normalization

agentsTestKey

mutation, then agentsAfterTestKey

Mints the test identity

agentsProviderSaved

mutation, refreshes agentsData, then agentsAfterProvider

Saves a model provider

agentsServerForm, agentsNewForm, agentsDefaultModel

task, keyed on the visit or provider

after(1, ...) form initialisers

agentsRunClock

task, when a run is live

every(1000, agentsTick)

agentsVisit

task, key = top(nav).id

after(1, agentsStampVisit)

agentsAgentChanged

task, key = agentsAgentLive.revision

after(1, agentsRefreshList)

agentsHealth

task, when agentsActive

every(60000, agentsRefreshReads)

agentsReconnect

task, when a stream is down, key = agentsReconnectAttempt

every(1000, agentsMaybeReconnect)

The agents rows are explained in depth in Agents: sources, Agents: streams and Agents: screens.

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

Unsubscribe anytime