Documentation
¶
Index ¶
- type Config
- type Deps
- type Service
- func (s *Service) AckAttrs() map[string]any
- func (s *Service) AttachRegistry(registry *sessions.Registry)
- func (s *Service) Handle(conn *agui.Conn, frame []byte) bool
- func (s *Service) LaunchWorker(key sessionsdomain.ThreadKey, opts sessionsdomain.ThreadOptions) (sessionsdomain.Worker, error)
- func (s *Service) StopSession(ctx context.Context, key sessionsdomain.ThreadKey)
- func (s *Service) Suspend(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Identity string
WorkspaceRoot string
IdleExit time.Duration
Version string
StorageID string
Handshake agui.Handshake
Entries []config.ExecutorEntry
// Denies reports whether the sandbox policy keeps a project file out of a
// checkpoint.
Denies func(projectDir, absPath string) bool
}
Config is what the daemon tells the service about itself.
type Deps ¶
type Deps struct {
Leases agentdomain.LeaseStore
Executors []agentdomain.Executor
Keyring *agentinfra.Keyring
Launch sessionsdomain.LaunchWorker
}
Deps are the collaborators the service orchestrates.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs agents on executors: it decides where a thread's worker runs (the launch seam the registry calls), moves sessions between executors, and receives the sessions other daemons move here.
func New ¶
New builds the service. AttachRegistry must follow once the registry exists, since the registry itself is built over LaunchWorker.
func (*Service) AttachRegistry ¶
AttachRegistry hands the service the thread registry its transfers quiesce, ask and notify.
func (*Service) Handle ¶
Handle claims the executors and transfers frames: the client requests, and the peer frames when the connection is another daemon's.
func (*Service) LaunchWorker ¶
func (s *Service) LaunchWorker(key sessionsdomain.ThreadKey, opts sessionsdomain.ThreadOptions) (sessionsdomain.Worker, error)
LaunchWorker is the seam the registry launches threads through. It answers at once with a worker that connects in the background: to a process here when this daemon owns the session or nobody does, to the owning executor's daemon when another one does. The registry holds its lock while launching, so nothing here may block.
func (*Service) StopSession ¶
func (s *Service) StopSession(ctx context.Context, key sessionsdomain.ThreadKey)
StopSession handles a client dropping a session: when a remote executor owns it, the executor's runtime is deleted and the lease released.