Documentation
¶
Overview ¶
Package agentrun composes the existing agent authorities for CLI and remote callers.
Index ¶
- func DecodeRequest(stdin io.Reader) (agents.RemoteRequest, error)
- func Handle(ctx context.Context, ops Operations, root string, stderr io.Writer, ...) error
- func Serve(ctx context.Context, ops Operations, root string, stdin io.Reader, ...) int
- type AwaitRequest
- type Awaiter
- type Dependencies
- type DispatchRequest
- type ListRequest
- type LogsRequest
- type LookupRequest
- type Operations
- type Service
- func (s *Service) Await(ctx context.Context, r AwaitRequest) (agents.Result, error)
- func (s *Service) Dispatch(ctx context.Context, r DispatchRequest) (agents.Result, error)
- func (s *Service) List(_ context.Context, r ListRequest) ([]agents.Result, error)
- func (s *Service) Logs(_ context.Context, r LogsRequest) (string, error)
- func (s *Service) Operations() Operations
- func (s *Service) PrepareDispatch(r DispatchRequest) (agents.Store, agents.DispatchDeps, error)
- func (s *Service) Status(_ context.Context, r LookupRequest) (agents.Result, error)
- func (s *Service) Stop(_ context.Context, r LookupRequest) (agents.Record, error)
- type TranscriptReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeRequest ¶
func DecodeRequest(stdin io.Reader) (agents.RemoteRequest, error)
func Handle ¶
func Handle(ctx context.Context, ops Operations, root string, stderr io.Writer, r agents.RemoteRequest, response *agents.RemoteResponse) error
Types ¶
type AwaitRequest ¶
type Awaiter ¶
type Awaiter struct {
Load func(string) (agents.Record, error)
Render func(agents.Record) agents.Result
Now func() time.Time
Wait func(context.Context, time.Duration) error
}
Awaiter observes durable records; a terminal observation wins over cancellation.
type Dependencies ¶
type Dependencies struct {
Root, EnsureRoot func(string) (string, error)
ConfigPath func() string
LoadConfig func(string) (agents.Config, error)
Dispatch func(context.Context, agents.DispatchRequest, agents.DispatchDeps) (agents.Record, error)
Stop func(agents.Store, string, agents.OwnerDeps) (agents.Record, error)
SpawnOwner func(string, func() (string, error)) (int, error)
Executable func() (string, error)
Now func() time.Time
Wait func(context.Context, time.Duration) error
BeforeCreate func(string, []string) error
AfterCreate func(string, io.Writer, string, []worktrees.CreateResult)
Transcripts TranscriptReader
}
func DefaultDependencies ¶
func DefaultDependencies() Dependencies
DefaultDependencies supplies real operations; composition binds the two creation callbacks.
type DispatchRequest ¶
type DispatchRequest struct {
ProjectsRoot string
Stderr io.Writer
Request agents.DispatchRequest
}
type ListRequest ¶
type ListRequest struct{ ProjectsRoot string }
type LogsRequest ¶
type LookupRequest ¶
type LookupRequest struct{ ProjectsRoot, AgentID string }
type Operations ¶
type Operations struct {
Dispatch func(context.Context, DispatchRequest) (agents.Result, error)
Status func(context.Context, LookupRequest) (agents.Result, error)
Await func(context.Context, AwaitRequest) (agents.Result, error)
List func(context.Context, ListRequest) ([]agents.Result, error)
Logs func(context.Context, LogsRequest) (string, error)
Stop func(context.Context, LookupRequest) (agents.Record, error)
}
Operations is the six concrete effects shared by command adapters and protocol handling.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(deps Dependencies) *Service
func (*Service) Operations ¶
func (s *Service) Operations() Operations
func (*Service) PrepareDispatch ¶
func (s *Service) PrepareDispatch(r DispatchRequest) (agents.Store, agents.DispatchDeps, error)
type TranscriptReader ¶
type TranscriptReader struct {
Stat func(string) (os.FileInfo, error)
Open func(string) (io.ReadCloser, error)
}
func DefaultTranscriptReader ¶
func DefaultTranscriptReader() TranscriptReader
Click to show internal directories.
Click to hide internal directories.