Documentation
¶
Index ¶
- Constants
- Variables
- func Serve(ctx context.Context, stop <-chan struct{}, paths platform.Paths, ...) error
- func StatePath(paths platform.Paths) string
- type Discovery
- type Server
- func (s *Server) ApplyChanges(ctx context.Context, req *connect.Request[v1.ApplyChangesRequest]) (*connect.Response[v1.ApplyChangesResponse], error)
- func (s *Server) AttachLaunch(ctx context.Context, req *connect.Request[v1.AttachLaunchRequest]) (*connect.Response[v1.AttachLaunchResponse], error)
- func (s *Server) CallTool(ctx context.Context, req *connect.Request[v1.CallToolRequest]) (*connect.Response[v1.CallToolResponse], error)
- func (s *Server) CompleteDirectory(_ context.Context, req *connect.Request[v1.CompleteDirectoryRequest]) (*connect.Response[v1.CompleteDirectoryResponse], error)
- func (s *Server) FinishLaunch(ctx context.Context, req *connect.Request[v1.FinishLaunchRequest]) (*connect.Response[v1.FinishLaunchResponse], error)
- func (s *Server) GetConfiguration(context.Context, *connect.Request[v1.GetConfigurationRequest]) (*connect.Response[v1.GetConfigurationResponse], error)
- func (s *Server) GetRuntime(ctx context.Context, req *connect.Request[v1.GetRuntimeRequest]) (*connect.Response[v1.GetRuntimeResponse], error)
- func (s *Server) GetSecretStatus(ctx context.Context, req *connect.Request[v1.GetSecretStatusRequest]) (*connect.Response[v1.GetSecretStatusResponse], error)
- func (s *Server) GetSkill(_ context.Context, req *connect.Request[v1.GetSkillRequest]) (*connect.Response[v1.GetSkillResponse], error)
- func (s *Server) InspectSource(ctx context.Context, req *connect.Request[v1.InspectSourceRequest]) (*connect.Response[v1.InspectSourceResponse], error)
- func (s *Server) Install(ctx context.Context, req *connect.Request[v1.InstallRequest], ...) error
- func (s *Server) ListDefinitions(context.Context, *connect.Request[v1.ListDefinitionsRequest]) (*connect.Response[v1.ListDefinitionsResponse], error)
- func (s *Server) ListMcpProcesses(_ context.Context, req *connect.Request[v1.ListMcpProcessesRequest]) (*connect.Response[v1.ListMcpProcessesResponse], error)
- func (s *Server) ListSessions(ctx context.Context, req *connect.Request[v1.ListSessionsRequest], ...) error
- func (s *Server) ListSourceRefs(ctx context.Context, req *connect.Request[v1.ListSourceRefsRequest]) (*connect.Response[v1.ListSourceRefsResponse], error)
- func (s *Server) ListTools(ctx context.Context, req *connect.Request[v1.ListToolsRequest]) (*connect.Response[v1.ListToolsResponse], error)
- func (s *Server) Login(ctx context.Context, req *connect.Request[v1.LoginRequest], ...) error
- func (s *Server) Logout(ctx context.Context, req *connect.Request[v1.LogoutRequest]) (*connect.Response[v1.LogoutResponse], error)
- func (s *Server) PlanChanges(ctx context.Context, req *connect.Request[v1.PlanChangesRequest]) (*connect.Response[v1.PlanChangesResponse], error)
- func (s *Server) PrepareLaunch(ctx context.Context, req *connect.Request[v1.PrepareLaunchRequest]) (*connect.Response[v1.PrepareLaunchResponse], error)
- func (s *Server) PrepareThreadLaunch(ctx context.Context, req *connect.Request[v1.PrepareThreadLaunchRequest]) (*connect.Response[v1.PrepareThreadLaunchResponse], error)
- func (s *Server) PreviewSource(ctx context.Context, req *connect.Request[v1.PreviewSourceRequest]) (*connect.Response[v1.PreviewSourceResponse], error)
- func (s *Server) ReadFile(_ context.Context, req *connect.Request[v1.ReadFileRequest]) (*connect.Response[v1.ReadFileResponse], error)
- func (s *Server) ReadPreviewFile(_ context.Context, req *connect.Request[v1.ReadPreviewFileRequest]) (*connect.Response[v1.ReadPreviewFileResponse], error)
- func (s *Server) RenewLaunch(ctx context.Context, req *connect.Request[v1.RenewLaunchRequest]) (*connect.Response[v1.RenewLaunchResponse], error)
- func (s *Server) Resolve(ctx context.Context, req *connect.Request[v1.ResolveRequest]) (*connect.Response[v1.ResolveResponse], error)
- func (s *Server) ResolveThread(ctx context.Context, req *connect.Request[v1.ResolveThreadRequest]) (*connect.Response[v1.ResolveThreadResponse], error)
- func (s *Server) RevokeLaunch(ctx context.Context, req *connect.Request[v1.RevokeLaunchRequest]) (*connect.Response[v1.RevokeLaunchResponse], error)
- func (s *Server) RotateSecret(ctx context.Context, req *connect.Request[v1.RotateSecretRequest]) (*connect.Response[v1.RotateSecretResponse], error)
- func (s *Server) SetSecret(ctx context.Context, req *connect.Request[v1.SetSecretRequest]) (*connect.Response[v1.SetSecretResponse], error)
- func (s *Server) Stop(ctx context.Context, req *connect.Request[v1.StopRequest]) (*connect.Response[v1.StopResponse], error)
- func (s *Server) StopMcpProcess(_ context.Context, req *connect.Request[v1.StopMcpProcessRequest]) (*connect.Response[v1.StopMcpProcessResponse], error)
- func (s *Server) Validate(ctx context.Context, req *connect.Request[v1.ValidateRequest]) (*connect.Response[v1.ValidateResponse], error)
- func (s *Server) WatchRuntime(ctx context.Context, req *connect.Request[v1.WatchRuntimeRequest], ...) error
Constants ¶
const ( // ShutdownGrace is how long a stopping daemon lets requests in flight finish when the stop // does not set a timeout. ShutdownGrace = 10 * time.Second // StoppingHeader marks an Unavailable error, or a 503 response, from a daemon that stops // taking new work; the caller retries with the daemon that discovery names next. StoppingHeader = "Agx-Daemon-Stopping" )
const EndedHeader = "Agx-Launch-Ended"
EndedHeader carries, on a renewal refused because the launch ended, how it ended: revoked, finished, or expired, so the wrapper can tell its user.
Variables ¶
ErrUnavailable marks ReadDiscovery errors that leave no daemon to reach: it is not running, or its discovery file is invalid.
var Version = "dev"
Version is set at build time with -ldflags "-X agx/internal/daemon.Version=..."; otherwise it is the main module's version, which go install module@version records.
Functions ¶
func Serve ¶
func Serve( ctx context.Context, stop <-chan struct{}, paths platform.Paths, registry adapters.Registry, builtins config.Builtins, ) error
Serve runs the daemon until stop closes or a stop request arrives, then shuts down gracefully: it takes no new launches or MCP sessions, lets requests in flight finish for the grace period, and lets its MCP servers exit. When ctx ends, it shuts down at once. Unless the stop forces, wrappers attach their launches to the next daemon. builtins must describe the adapters in registry.
Types ¶
type Discovery ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ApplyChanges ¶
func (*Server) AttachLaunch ¶
func (s *Server) AttachLaunch( ctx context.Context, req *connect.Request[v1.AttachLaunchRequest], ) (*connect.Response[v1.AttachLaunchResponse], error)
AttachLaunch takes a launch from its wrapper when this daemon does not hold it, or let it expire: after a restart, an upgrade, or a crash. The launch keeps its ID, grant, and lifecycle token, so its harness's MCP configuration stays valid, and gets its thread launches back. Attaching a launch the daemon holds attaches only the thread launches it misses.
func (*Server) CompleteDirectory ¶
func (*Server) FinishLaunch ¶
func (*Server) GetConfiguration ¶
func (*Server) GetRuntime ¶
func (*Server) GetSecretStatus ¶
func (*Server) InspectSource ¶
func (s *Server) InspectSource( ctx context.Context, req *connect.Request[v1.InspectSourceRequest], ) (*connect.Response[v1.InspectSourceResponse], error)
InspectSource checks a Git source out at its pins, for filling in a package's revision, hash, and subdirectory.
func (*Server) Install ¶
func (s *Server) Install( ctx context.Context, req *connect.Request[v1.InstallRequest], stream *connect.ServerStream[v1.InstallResponse], ) error
Install streams an installation's progress and then its result or failure. The installation goes on if the caller disconnects; a stopping daemon waits for it for its grace period, then cancels it.
func (*Server) ListDefinitions ¶
func (*Server) ListMcpProcesses ¶
func (*Server) ListSessions ¶
func (s *Server) ListSessions( ctx context.Context, req *connect.Request[v1.ListSessionsRequest], stream *connect.ServerStream[v1.ListSessionsResponse], ) error
func (*Server) ListSourceRefs ¶
func (s *Server) ListSourceRefs( ctx context.Context, req *connect.Request[v1.ListSourceRefsRequest], ) (*connect.Response[v1.ListSourceRefsResponse], error)
ListSourceRefs lists a Git source's branches and tags for picking a package's ref.
func (*Server) Login ¶
func (s *Server) Login( ctx context.Context, req *connect.Request[v1.LoginRequest], stream *connect.ServerStream[v1.LoginResponse], ) error
func (*Server) PlanChanges ¶
func (*Server) PrepareLaunch ¶
func (*Server) PrepareThreadLaunch ¶
func (*Server) PreviewSource ¶
func (*Server) ReadPreviewFile ¶
func (*Server) RenewLaunch ¶
func (*Server) ResolveThread ¶
func (*Server) RevokeLaunch ¶
func (*Server) RotateSecret ¶
func (*Server) Stop ¶
func (s *Server) Stop( ctx context.Context, req *connect.Request[v1.StopRequest], ) (*connect.Response[v1.StopResponse], error)
Stop makes the daemon stop; without force, wrappers attach its active launches to the next daemon.
func (*Server) StopMcpProcess ¶
func (*Server) WatchRuntime ¶
func (s *Server) WatchRuntime( ctx context.Context, req *connect.Request[v1.WatchRuntimeRequest], stream *connect.ServerStream[v1.WatchRuntimeResponse], ) error