agentrun

package
v0.182.6 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package agentrun composes the existing agent authorities for CLI and remote callers.

Index

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

func Serve

func Serve(ctx context.Context, ops Operations, root string, stdin io.Reader, stdout, stderr io.Writer) int

Serve reports refusals inside the response; only encoding failure exits nonzero.

Types

type AwaitRequest

type AwaitRequest struct {
	ProjectsRoot, AgentID string
	WaitTimeout           time.Duration
}

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.

func (Awaiter) Await

func (a Awaiter) Await(ctx context.Context, id string, deadline time.Time) (agents.Result, error)

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 LogsRequest struct {
	ProjectsRoot, AgentID string
	Tail                  int
	Raw                   bool
}

type LookupRequest

type LookupRequest struct{ ProjectsRoot, AgentID string }

type Operations

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) Await

func (s *Service) Await(ctx context.Context, r AwaitRequest) (agents.Result, error)

func (*Service) Dispatch

func (s *Service) Dispatch(ctx context.Context, r DispatchRequest) (agents.Result, error)

func (*Service) List

func (s *Service) List(_ context.Context, r ListRequest) ([]agents.Result, error)

func (*Service) Logs

func (s *Service) Logs(_ context.Context, r LogsRequest) (string, error)

func (*Service) Operations

func (s *Service) Operations() Operations

func (*Service) PrepareDispatch

func (s *Service) PrepareDispatch(r DispatchRequest) (agents.Store, agents.DispatchDeps, error)

func (*Service) Status

func (s *Service) Status(_ context.Context, r LookupRequest) (agents.Result, error)

func (*Service) Stop

type TranscriptReader

type TranscriptReader struct {
	Stat func(string) (os.FileInfo, error)
	Open func(string) (io.ReadCloser, error)
}

func DefaultTranscriptReader

func DefaultTranscriptReader() TranscriptReader

func (TranscriptReader) Read

func (r TranscriptReader) Read(record agents.Record, tail int, raw bool) (string, error)

Jump to

Keyboard shortcuts

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