Documentation
¶
Overview ¶
Package client implements the workspace-bound side of the runner protocol.
Index ¶
- type ConfigLoader
- type DirectWorkspaceInstanceProvider
- type EnvironmentFactory
- type ExecutionInstance
- type ExecutionInstanceProvider
- type ExecutionInstanceSpec
- type Peer
- type Runner
- type RunnerConfig
- type RuntimeProvider
- type Service
- func (s *Service) AbortActiveRun(ctx context.Context) error
- func (s *Service) AppendTranscript(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UITranscriptAppendResponse, error)
- func (s *Service) Attach(peer Peer)
- func (s *Service) CleanupExtensionUI(extensions.UIExtensionOwner)
- func (s *Service) Close() error
- func (s *Service) CloseSurface(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- func (s *Service) Confirm(ctx context.Context, request extensions.UIConfirmRequest) (extensions.UIInputResponse, error)
- func (s *Service) HandleNotification(ctx context.Context, method string, params json.RawMessage)
- func (s *Service) HandleRequest(ctx context.Context, method string, params json.RawMessage) (any, *protocol.RPCError)
- func (s *Service) HeartbeatSnapshot() (protocol.RunnerState, string, string)
- func (s *Service) HeartbeatSnapshotRuns() (protocol.RunnerState, []string, string)
- func (s *Service) Input(ctx context.Context, request extensions.UIInputRequest) (extensions.UIInputResponse, error)
- func (s *Service) Notify(ctx context.Context, request extensions.UINotifyRequest) (extensions.UIInputResponse, error)
- func (s *Service) OpenSurface(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- func (s *Service) ProbeManifest(ctx context.Context, environmentProfile string) (runnerpayload.Manifest, error)
- func (s *Service) ProbeManifestDigest(ctx context.Context) (string, error)
- func (s *Service) RemoveWidget(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- func (s *Service) Select(ctx context.Context, request extensions.UISelectRequest) (extensions.UIInputResponse, error)
- func (s *Service) SetRegistration(result protocol.RegisterResult) error
- func (s *Service) SetWidget(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- func (s *Service) UpdateSurface(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- func (s *Service) UpdateWidget(ctx context.Context, source extensions.UIExtensionSource, ...) (extensions.UIFrameResponse, error)
- type ServiceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigLoader ¶
ConfigLoader loads runner-owned configuration for an optional conversation profile.
type DirectWorkspaceInstanceProvider ¶
type DirectWorkspaceInstanceProvider struct {
// contains filtered or unexported fields
}
DirectWorkspaceInstanceProvider creates per-run handles backed by the runner's registered workspace. It provides lifecycle symmetry for future providers but no filesystem, process, network, or port isolation.
func NewDirectWorkspaceInstanceProvider ¶
func NewDirectWorkspaceInstanceProvider(workspace string) (*DirectWorkspaceInstanceProvider, error)
NewDirectWorkspaceInstanceProvider creates the initial non-isolating execution-instance provider.
func (*DirectWorkspaceInstanceProvider) Create ¶
func (p *DirectWorkspaceInstanceProvider) Create(ctx context.Context, _ ExecutionInstanceSpec) (ExecutionInstance, error)
Create returns a fresh lifecycle handle to the same direct workspace.
type EnvironmentFactory ¶
type EnvironmentFactory func(workingDirectory string, runtime *extensions.Runtime) agentenv.Environment
EnvironmentFactory creates one agent environment inside a provisioned execution instance.
type ExecutionInstance ¶
ExecutionInstance is the concrete filesystem/process/network backing for one runner environment. The direct-workspace implementation is not isolated; future providers can provision ephemeral backing.
type ExecutionInstanceProvider ¶
type ExecutionInstanceProvider interface {
Create(ctx context.Context, spec ExecutionInstanceSpec) (ExecutionInstance, error)
}
ExecutionInstanceProvider creates the backing used before runner configuration, extensions, and tools are discovered.
type ExecutionInstanceSpec ¶
ExecutionInstanceSpec identifies one run or idle manifest probe that needs runner-side resources.
type Peer ¶
type Peer interface {
Call(ctx context.Context, method string, params any, result any) error
Notify(ctx context.Context, method string, params any) error
NotifyUpdate(method string, params any) error
}
Peer is the symmetric runner connection used for updates and reverse UI calls.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner maintains one workspace lock, stable identity, and reconnecting control connection.
func NewRunner ¶
func NewRunner(ctx context.Context, config RunnerConfig) (*Runner, error)
NewRunner validates configuration and acquires no external resources.
func (*Runner) AcquireWorkspaceLock ¶
AcquireWorkspaceLock claims this host workspace before it is registered.
type RunnerConfig ¶
type RunnerConfig struct {
Server string
AuthToken string
Workspace string
DisplayName string
ServiceOptions ServiceOptions
Store *localstate.Store
ReconnectMin time.Duration
ReconnectMax time.Duration
ManifestInterval time.Duration
ManifestProbeTimeout time.Duration
OnRegistered func(protocol.RegisterResult)
OnRetry func(error, time.Duration)
}
RunnerConfig configures one long-running workspace-bound runner process.
type RuntimeProvider ¶
type RuntimeProvider interface {
RuntimeWithConfigAndCallContext(ctx context.Context, cwd, variant string, config extensions.Config, callContext extensions.ExtensionCallContext) (*extensions.Runtime, error)
}
RuntimeProvider supplies the persistent extension runtime for the bound workspace.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles control-plane requests for one workspace-bound runner process.
func NewService ¶
NewService creates a runner-side request handler bound to one canonical workspace.
func (*Service) AbortActiveRun ¶
AbortActiveRun releases all local run resources after a connection loss.
func (*Service) AppendTranscript ¶
func (s *Service) AppendTranscript(ctx context.Context, source extensions.UIExtensionSource, request extensions.UITranscriptAppendRequest) (extensions.UITranscriptAppendResponse, error)
func (*Service) Attach ¶
Attach installs the current symmetric connection used by runner-originated calls.
func (*Service) CleanupExtensionUI ¶
func (s *Service) CleanupExtensionUI(extensions.UIExtensionOwner)
CleanupExtensionUI is best-effort; the control plane also closes run-scoped UI when the run ends.
func (*Service) Close ¶
Close releases an active environment and any runtime manager owned by the service.
func (*Service) CloseSurface ¶
func (s *Service) CloseSurface(ctx context.Context, source extensions.UIExtensionSource, request extensions.UISurfaceCloseRequest) (extensions.UIFrameResponse, error)
func (*Service) Confirm ¶
func (s *Service) Confirm(ctx context.Context, request extensions.UIConfirmRequest) (extensions.UIInputResponse, error)
func (*Service) HandleNotification ¶
HandleNotification implements protocol.NotificationHandler for client UI events.
func (*Service) HandleRequest ¶
func (s *Service) HandleRequest(ctx context.Context, method string, params json.RawMessage) (any, *protocol.RPCError)
HandleRequest implements protocol.RequestHandler for control-plane requests.
func (*Service) HeartbeatSnapshot ¶
func (s *Service) HeartbeatSnapshot() (protocol.RunnerState, string, string)
HeartbeatSnapshot returns the legacy singular-run heartbeat shape.
func (*Service) HeartbeatSnapshotRuns ¶
func (s *Service) HeartbeatSnapshotRuns() (protocol.RunnerState, []string, string)
HeartbeatSnapshotRuns returns current application health and all active run IDs.
func (*Service) Input ¶
func (s *Service) Input(ctx context.Context, request extensions.UIInputRequest) (extensions.UIInputResponse, error)
func (*Service) Notify ¶
func (s *Service) Notify(ctx context.Context, request extensions.UINotifyRequest) (extensions.UIInputResponse, error)
func (*Service) OpenSurface ¶
func (s *Service) OpenSurface(ctx context.Context, source extensions.UIExtensionSource, request extensions.UISurfaceOpenRequest) (extensions.UIFrameResponse, error)
func (*Service) ProbeManifest ¶
func (s *Service) ProbeManifest(ctx context.Context, environmentProfile string) (runnerpayload.Manifest, error)
ProbeManifest snapshots runner resources for command and capability discovery without reserving a control-plane run.
func (*Service) ProbeManifestDigest ¶
ProbeManifestDigest snapshots idle runner resources without reserving a control-plane run.
func (*Service) RemoveWidget ¶
func (s *Service) RemoveWidget(ctx context.Context, source extensions.UIExtensionSource, request extensions.UIWidgetRemoveRequest) (extensions.UIFrameResponse, error)
func (*Service) Select ¶
func (s *Service) Select(ctx context.Context, request extensions.UISelectRequest) (extensions.UIInputResponse, error)
func (*Service) SetRegistration ¶
func (s *Service) SetRegistration(result protocol.RegisterResult) error
SetRegistration applies the stable ID and generation returned by runner.register.
func (*Service) SetWidget ¶
func (s *Service) SetWidget(ctx context.Context, source extensions.UIExtensionSource, request extensions.UIWidgetSetRequest) (extensions.UIFrameResponse, error)
func (*Service) UpdateSurface ¶
func (s *Service) UpdateSurface(ctx context.Context, source extensions.UIExtensionSource, request extensions.UISurfaceFrameRequest) (extensions.UIFrameResponse, error)
func (*Service) UpdateWidget ¶
func (s *Service) UpdateWidget(ctx context.Context, source extensions.UIExtensionSource, request extensions.UIWidgetFrameRequest) (extensions.UIFrameResponse, error)
type ServiceOptions ¶
type ServiceOptions struct {
RuntimeProvider RuntimeProvider
ConfigLoader ConfigLoader
EnvironmentFactory EnvironmentFactory
ExecutionInstanceProvider ExecutionInstanceProvider
CleanupTimeout time.Duration
// SnapshotWaitTimeout optionally bounds admission to the serialized snapshot
// pipeline. Zero lets the caller's context own the deadline.
SnapshotWaitTimeout time.Duration
}
ServiceOptions configures the runner-side request service.