Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachResult ¶
type CommandSender ¶ added in v0.13.0
CommandSender is an optional runtime capability for provider-native control commands. Unlike Send, a control command does not represent a model turn and must not change the agent's activity.
type DispatchRequest ¶
type FileReader ¶ added in v0.11.0
type FileReader interface {
ReadAgentFile(ctx context.Context, id, path string) (io.ReadCloser, error)
}
FileReader is an optional runtime capability: read a file on the machine an agent is running on.
An agent's transcript is written by its provider, beside its repository, on its own host — so the path in an agent's record names a file this process may have no way to open. The runtime knows which daemon holds the agent, which makes it the only layer that can answer.
type HistoryReader ¶ added in v0.11.0
HistoryReader is an optional runtime capability: hand over the conversation log of each machine this runtime spans.
The log is written where the agent ran — its provider's hooks report to the Stormlight on that host, which appends to that host's file — so a conversation that happened on another machine is recorded there and nowhere else. Reading it is the only way the history browser can offer to reopen it.
Keyed by host so a dashboard spanning several can tell them apart; this machine's own log is the service's business, not the runtime's.
type Launch ¶
type Launch struct {
// Path is the provider resolved on this machine.
Path string `json:"path"`
// Program is the name it was resolved from — `codex`, `claude`, or
// whatever a custom provider spec names.
//
// Path answers "where is it here", which is the wrong question for a
// machine that is not here: /Users/someone/.toolbox/bin/codex is a
// macOS path, and a Linux daemon handed it can only report that no
// such file exists. The name is the part that travels.
Program string `json:"program,omitempty"`
Args []string `json:"args"`
}
type Overlay ¶ added in v0.9.0
type Overlay interface {
TerminalStream
Exited() <-chan int
// Result is the answer the program left behind, read after it exits
// and before Close takes the session with it. Empty means it left
// none: a picker the user quit without choosing.
//
// The answer comes back through the session rather than through a
// file, because the program runs on the machine it is choosing from
// and a file it wrote there is not one this process can read. The
// session is the one thing both ends already hold.
Result(ctx context.Context) (string, error)
}
Overlay is one running overlay program: its terminal stream plus the exit the dashboard waits on. Close always destroys the hosting session — an overlay must never persist into the roster.
type OverlayHost ¶ added in v0.9.0
type OverlayHost interface {
StartOverlay(ctx context.Context, request OverlayRequest) (Overlay, error)
}
OverlayHost is an optional runtime capability: run a short-lived interactive program on a runtime-owned PTY and stream its terminal, so the dashboard can float it in a popup instead of surrendering the screen.
type OverlayRequest ¶ added in v0.9.0
type OverlayRequest struct {
// Host is the machine to run it on; empty is this one. An overlay
// browses a filesystem, so it belongs on the machine that has it.
Host string
Path string
Args []string
Dir string
Cols int
Rows int
}
OverlayRequest describes a short-lived interactive program the dashboard wants floated over itself rather than handed the whole screen: the Yazi picker, the Neovim task editor.
type Runtime ¶
type Runtime interface {
ListAgents(context.Context) ([]agent.Agent, error)
Dispatch(context.Context, DispatchRequest) (agent.Agent, error)
Capture(context.Context, string, int) (string, error)
Attach(context.Context, string) (AttachResult, error)
Send(context.Context, string, string) error
Interrupt(context.Context, string) error
Delete(context.Context, string) error
Rename(context.Context, string, string) error
Update(context.Context, string, Update) error
SetWorkspace(context.Context, string, workspace.Context) error
}
type TerminalStream ¶ added in v0.9.0
TerminalStream is one live attachment to one agent's terminal: an exact seed, then an ordered stream of output, resizes and resyncs.
It is the widget's transport by definition rather than by coincidence. The two were separate interfaces of identical shape, which meant every change had to be made twice and any drift between them was a compile error somewhere unrelated.
type TerminalStreamer ¶ added in v0.9.0
type TerminalStreamer interface {
AttachTerminal(ctx context.Context, id string, cols, rows int) (TerminalStream, error)
}
TerminalStreamer is an optional runtime capability: a runtime whose terminals can be attached to directly — an exact state snapshot followed by the live byte stream, with input and resize flowing back.
type Update ¶
type Update struct {
Activity agent.Activity
Attention agent.Attention
Summary string
// DashboardAction queues a request for a dashboard to run a
// user-installed action plugin. It is refused with
// agent.ErrDashboardActionsFull when the agent's queue is at its limit.
DashboardAction *agent.DashboardActionRequest
// ClaimDashboardAction takes one queued request for the dashboard
// named in it. It is refused with agent.ErrDashboardActionGone when no
// such request is queued and agent.ErrDashboardActionHeld when another
// live dashboard holds it; a stale claim is taken over.
ClaimDashboardAction *agent.DashboardActionClaim
// ClearDashboardAction retires the request with this id. Naming the id
// matters: the agent may have queued more since, and those stay.
ClearDashboardAction string
// SessionID records the provider's own conversation id when an event
// carries it; empty means "leave as is".
SessionID string
// SessionName records a provider-side name write; empty means "leave as
// is". It is separate from Name, Stormlight's desired display name.
SessionName string
// TranscriptPath records the provider's own transcript file when a
// hook reports it; empty means "leave as is".
TranscriptPath string
// TurnEnded marks an update produced by the provider's end-of-turn
// event; it may downgrade urgent attention, because a finished turn
// proves any pending prompt was resolved.
TurnEnded bool
// ClearAttention removes any attention state without touching the
// rest of the record; an empty Attention alone means "leave as is".
ClearAttention bool
// Mark records the human's own reading of the agent; empty means
// "leave as is", so removing one takes ClearMark.
Mark agent.Mark
// ClearMark removes any mark without touching the rest of the record.
ClearMark bool
}