Documentation
¶
Overview ¶
Package workspaceagent is the public-contract Workspace Agent application. Its approval inbox consumes only the SDK; sandbox execution remains visibly unavailable until a protected Workspace profile has retained isolation evidence.
Index ¶
- func HTML(approval agentruntime.Approval) string
- func NewWebHandler(inbox *Inbox) (http.Handler, error)
- func NewWorkspaceWebHandler(app *App, inbox *Inbox) (http.Handler, error)
- func RunTerminal(ctx context.Context, inbox *Inbox, input io.Reader, output io.Writer) error
- func RunWorkspaceTerminal(ctx context.Context, app *App, inbox *Inbox, input io.Reader, output io.Writer) error
- func SandboxStatus() string
- func Terminal(approval agentruntime.Approval) string
- type App
- func (app *App) Cancel(ctx context.Context, sessionID agentruntime.SessionID, ...) (agentruntime.Turn, error)
- func (app *App) NewSession(ctx context.Context, revision agentruntime.AgentRevisionID) (agentruntime.Session, error)
- func (app *App) ReadOutput(ctx context.Context, sessionID agentruntime.SessionID, ...) (Output, error)
- func (app *App) Reconnect(ctx context.Context, sessionID agentruntime.SessionID, ...) (agentruntime.EventPage, error)
- func (app *App) Request(ctx context.Context, sessionID agentruntime.SessionID, text string) (agentruntime.SendInputResult, error)
- func (app *App) Resume(ctx context.Context, sessionID agentruntime.SessionID) (agentruntime.SessionView, error)
- type ApprovalClient
- type Inbox
- func (inbox *Inbox) Cancel(ctx context.Context, approval agentruntime.Approval, key string) (agentruntime.Turn, error)
- func (inbox *Inbox) Decide(ctx context.Context, approvalID agentruntime.ApprovalID, ...) (agentruntime.Approval, error)
- func (inbox *Inbox) List(ctx context.Context) (agentruntime.ApprovalPage, error)
- type KeySource
- type Output
- type RandomKeys
- type SessionClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTML ¶
func HTML(approval agentruntime.Approval) string
HTML renders one escaped approval row for the Workspace Agent browser UI.
func NewWebHandler ¶
NewWebHandler creates the loopback Workspace Agent approval inbox UI.
func NewWorkspaceWebHandler ¶
NewWorkspaceWebHandler creates the loopback Workspace Agent work and approval UI.
func RunTerminal ¶
RunTerminal runs the public-contract Workspace Agent approval TUI.
func RunWorkspaceTerminal ¶
func RunWorkspaceTerminal(ctx context.Context, app *App, inbox *Inbox, input io.Reader, output io.Writer) error
RunWorkspaceTerminal runs the durable Workspace Agent work view alongside the approval inbox. It has no direct sandbox-control client.
func SandboxStatus ¶
func SandboxStatus() string
SandboxStatus is the truthful Workspace execution status. No UI path treats this text as a successful Firecracker workspace.
func Terminal ¶
func Terminal(approval agentruntime.Approval) string
Terminal renders a bounded safe approval row for the Workspace Agent TUI.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App coordinates Workspace Agent's public Session workflow.
func NewApp ¶
func NewApp(client SessionClient, keys KeySource) (*App, error)
NewApp constructs a Workspace Agent controller from public-contract seams.
func (*App) Cancel ¶
func (app *App) Cancel(ctx context.Context, sessionID agentruntime.SessionID, turnID agentruntime.TurnID) (agentruntime.Turn, error)
Cancel records a durable cancellation request for one public Turn.
func (*App) NewSession ¶
func (app *App) NewSession(ctx context.Context, revision agentruntime.AgentRevisionID) (agentruntime.Session, error)
NewSession creates one Session pinned to the supplied public Agent revision.
func (*App) ReadOutput ¶
func (app *App) ReadOutput(ctx context.Context, sessionID agentruntime.SessionID, turnID agentruntime.TurnID) (Output, error)
ReadOutput verifies that a downloaded artifact is the exact text output referenced by the requested Turn before projecting it into the UI.
func (*App) Reconnect ¶
func (app *App) Reconnect(ctx context.Context, sessionID agentruntime.SessionID, after agentruntime.Cursor) (agentruntime.EventPage, error)
Reconnect resumes event observation from the caller's last opaque cursor.
func (*App) Request ¶
func (app *App) Request(ctx context.Context, sessionID agentruntime.SessionID, text string) (agentruntime.SendInputResult, error)
Request appends one bounded workspace request behind preceding durable work.
func (*App) Resume ¶
func (app *App) Resume(ctx context.Context, sessionID agentruntime.SessionID) (agentruntime.SessionView, error)
Resume reads current durable state after an application restart.
type ApprovalClient ¶
type ApprovalClient interface {
ListApprovals(context.Context) (agentruntime.ApprovalPage, error)
InspectApproval(context.Context, agentruntime.ApprovalID) (agentruntime.Approval, error)
DecideApproval(context.Context, agentruntime.DecideApprovalRequest) (agentruntime.Approval, error)
CancelTurn(context.Context, agentruntime.CancelTurnRequest) (agentruntime.Turn, error)
}
ApprovalClient is the narrow public SDK capability used by the approval UI.
type Inbox ¶
type Inbox struct {
// contains filtered or unexported fields
}
Inbox presents safe approval state and never renders model arguments, capability data, or sandbox descriptors.
func NewInbox ¶
func NewInbox(client ApprovalClient) (*Inbox, error)
NewInbox constructs the Workspace Agent public approval surface.
func (*Inbox) Cancel ¶
func (inbox *Inbox) Cancel(ctx context.Context, approval agentruntime.Approval, key string) (agentruntime.Turn, error)
Cancel refuses further progress for the exact Turn backing a pending approval.
func (*Inbox) Decide ¶
func (inbox *Inbox) Decide(ctx context.Context, approvalID agentruntime.ApprovalID, decision agentruntime.ApprovalState, key string) (agentruntime.Approval, error)
Decide records one owner approval or denial with the caller-supplied durable idempotency key.
func (*Inbox) List ¶
func (inbox *Inbox) List(ctx context.Context) (agentruntime.ApprovalPage, error)
List returns the caller-owned bounded approval inbox.
type Output ¶
type Output struct {
Artifact agentruntime.ArtifactReference
Text string
}
Output is a bounded UTF-8 projection of one finalized owner-readable model output.
type RandomKeys ¶
type RandomKeys struct{}
RandomKeys creates opaque idempotency keys without deriving them from a workspace request or model output.
type SessionClient ¶
type SessionClient interface {
CreateSession(context.Context, agentruntime.CreateSessionRequest) (agentruntime.Session, error)
SendInput(context.Context, agentruntime.SendInputRequest) (agentruntime.SendInputResult, error)
InspectSession(context.Context, agentruntime.SessionID) (agentruntime.SessionView, error)
InspectTurn(context.Context, agentruntime.SessionID, agentruntime.TurnID) (agentruntime.Turn, error)
Events(context.Context, agentruntime.SessionID, agentruntime.Cursor, int) (agentruntime.EventPage, error)
CancelTurn(context.Context, agentruntime.CancelTurnRequest) (agentruntime.Turn, error)
ReadArtifact(context.Context, agentruntime.ArtifactID) (agentruntime.ArtifactDownload, error)
}
SessionClient is the narrow public SDK surface Workspace Agent needs for its durable work view. It intentionally has no sandbox-control methods.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
workspace-agent
command
Command workspace-agent runs the public Workspace Agent approval UI.
|
Command workspace-agent runs the public Workspace Agent approval UI. |