Documentation
¶
Overview ¶
Package control is deploy's control-plane composition root beneath main.
The package owns the wiring between the operator controller, the durable store, and the Warden fleet view: the lifecycle hooks that turn controller events into durable receipts, the persistence-fault gate that refuses operator work while PostgreSQL is unreachable, and the projection of controller and fleet state into the WebUI snapshot contract.
Core produces every snapshot the browser renders, so the operator-visible identity is a Runtime setting rather than something the presentation layer discovers: WithBrand supplies the product and agent names this package stamps into each snapshot.
Callers may rely on Runtime satisfying the operator transport's backend contract, including webui.ISnapshotProvider, and on every operator-visible mutation being proven durable before it is acknowledged. Runtime owns no HTTP surface, no agent harness, and no schema; those belong to httpapi, operator, and store respectively.
Index ¶
- type Option
- type Runtime
- func (r *Runtime) Abort(ctx context.Context) error
- func (r *Runtime) AbortRun(ctx context.Context, sessionID, runID string) error
- func (r *Runtime) Health(ctx context.Context) error
- func (r *Runtime) RecordFleetContext(parent context.Context, snapshot fleet.Snapshot)
- func (r *Runtime) ResolveApproval(id, decision string) error
- func (r *Runtime) Send(ctx context.Context, prompt string) (string, error)
- func (r *Runtime) SendToClaw(ctx context.Context, sessionID, expectedRunID, prompt string, ...) (string, error)
- func (r *Runtime) Snapshot(ctx context.Context) (*deployv1.WebUISnapshot, error)
- func (r *Runtime) Subscribe() (<-chan struct{}, func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(settings *runtimeOptions) error
Option changes one public Runtime policy.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is the user-facing control-plane composition root below main.
func NewRuntime ¶
func NewRuntime( controlStore *store.Store, fleetClient *fleet.Client, controller *operator.Controller, labels map[string]map[string]string, persistence *deployv1.PersistenceTiming, version string, functionalOptions ...Option, ) (*Runtime, error)
NewRuntime installs durable lifecycle hooks on the controller.
func (*Runtime) Abort ¶
Abort stops the current agent turn without discarding its persisted session.
func (*Runtime) Health ¶
Health checks the durable dependency and any sticky write fault that must be repaired before accepting more work.
func (*Runtime) RecordFleetContext ¶
RecordFleetContext persists one coalesced Warden observation within the owning fleet worker's lifecycle so shutdown cannot leave a database callback running after the store closes.
func (*Runtime) ResolveApproval ¶
ResolveApproval records one first-answer-wins operator decision. Approving a mutation fails closed without Warden quorum; rejection is always possible.
func (*Runtime) SendToClaw ¶
func (r *Runtime) SendToClaw( ctx context.Context, sessionID, expectedRunID, prompt string, delivery deployv1.HarnessDelivery, ) (string, error)
SendToClaw fences a browser message to the rendered harness session and run. An active run is steered in place; an idle completed run becomes a new turn in the same harness session.