workspaceagent

package
v0.0.0-...-804b954 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 19 Imported by: 0

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

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

func NewWebHandler(inbox *Inbox) (http.Handler, error)

NewWebHandler creates the loopback Workspace Agent approval inbox UI.

func NewWorkspaceWebHandler

func NewWorkspaceWebHandler(app *App, inbox *Inbox) (http.Handler, error)

NewWorkspaceWebHandler creates the loopback Workspace Agent work and approval UI.

func RunTerminal

func RunTerminal(ctx context.Context, inbox *Inbox, input io.Reader, output io.Writer) error

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

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 KeySource

type KeySource interface {
	Next(string) (string, error)
}

KeySource creates an opaque idempotency key for a user action.

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.

func (RandomKeys) Next

func (RandomKeys) Next(action string) (string, error)

Next returns one bounded opaque idempotency key.

type SessionClient

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL