Documentation
¶
Overview ¶
Package peercoord runs session-local peer listeners. Only typed messages and task records cross the server boundary; Host operations are strictly local.
Index ¶
- Constants
- func BoardKey(c peer.Connection) string
- func CheckRunner(ctx context.Context, runner string) error
- func Directory(root, session string) string
- func IsCommand(args []string) bool
- func RunAgent(path string) error
- func RunnerArgs(spec RunnerSpec, conversation, prompt string) ([]string, io.Reader, error)
- func ShellQuote(s string) string
- func WriteJSON(path string, value any) error
- type Arguments
- type Attention
- type Board
- type CommandContext
- type Control
- type ControlReply
- type Disk
- type Endpoint
- type Execution
- type Host
- type HostRequest
- type HostResponse
- type Outgoing
- type Project
- type RunnerSpec
- type Runtime
- type Summary
- type TurnResult
Constants ¶
const Usage = `` /* 1423-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func BoardKey ¶
func BoardKey(c peer.Connection) string
func CheckRunner ¶
CheckRunner uses provider-supported status commands. It never reads or copies login files and never includes authentication output in peer messages.
func RunAgent ¶
RunAgent is a local, interactive supervisor. The provider CLI runs a structured turn; the pane stays open between turns and can pause/resume automatic delivery. No shared transcript, pane subscription, or remote shell channel is involved.
func RunnerArgs ¶
func ShellQuote ¶
Types ¶
type Board ¶
type Board struct {
Recent []pc.Event `json:"recent"`
AdmissionErrors map[string]string `json:"admission_errors,omitempty"`
Connection peer.Connection `json:"connection"`
Workspace string `json:"local_workspace"`
PeerID string `json:"peer_id"`
Token string `json:"token"`
Incarnation string `json:"incarnation"`
Listening bool `json:"listening"`
Draining bool `json:"draining"`
Cursor int64 `json:"cursor"`
Projects map[string]Project `json:"projects"`
Endpoints map[string]*Endpoint `json:"endpoints"`
Executions map[string]*Execution `json:"executions"`
Inbox []pc.Event `json:"inbox"`
Outbox []Outgoing `json:"outbox"`
State pc.State `json:"state"`
LastContact time.Time `json:"last_contact"`
LastError string `json:"last_error,omitempty"`
Rejoined bool `json:"-"`
}
type CommandContext ¶
type CommandContext struct{ Socket, Execution, Token, Pane, Session string }
type Control ¶
type Control struct {
CostUSD float64 `json:"cost_usd,omitempty"`
Args []string `json:"args,omitempty"`
Text string `json:"text,omitempty"`
Execution string `json:"execution"`
Token string `json:"token"`
Pane string `json:"pane"`
Op string `json:"op"`
DeliveryID string `json:"delivery_id,omitempty"`
Conversation string `json:"conversation,omitempty"`
Error string `json:"error,omitempty"`
}
type ControlReply ¶
type ControlReply struct {
BudgetRemaining float64 `json:"budget_remaining,omitempty"`
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
Prompt string `json:"prompt,omitempty"`
DeliveryID string `json:"delivery_id,omitempty"`
Conversation string `json:"conversation,omitempty"`
Stop bool `json:"stop"`
Paused bool `json:"paused"`
Done bool `json:"done"`
}
type Endpoint ¶
type Endpoint struct {
LastProbe time.Time `json:"-"`
SetupError string `json:"setup_error,omitempty"`
Enrolled bool `json:"enrolled"`
Agent pc.Agent `json:"agent"`
Origin string `json:"origin"`
Mode string `json:"mode"`
AcceptedLeaders []string `json:"accepted_leaders"`
Permission string `json:"permission"`
Model string `json:"model,omitempty"`
MaxRuntime int `json:"max_runtime"`
MaxTurns int `json:"max_turns"`
MaxBudgetUSD float64 `json:"max_budget_usd"`
LeaderExecution string `json:"leader_execution,omitempty"`
}
type Execution ¶
type Execution struct {
SpentUSD float64 `json:"spent_usd"`
CommandToken string `json:"command_token"`
LastDeliveryID string `json:"last_delivery_id,omitempty"`
ID string `json:"id"`
AgentID string `json:"agent_id"`
TaskID string `json:"task_id,omitempty"`
AttemptID string `json:"attempt_id,omitempty"`
Token string `json:"token"`
PaneID string `json:"pane_id"`
Directory string `json:"directory"`
Branch string `json:"branch"`
Base string `json:"base"`
Phase string `json:"phase"`
CreatedAt time.Time `json:"created_at"`
Deadline time.Time `json:"deadline"`
LastSeen time.Time `json:"last_seen"`
Incarnation string `json:"incarnation"`
Conversation string `json:"conversation,omitempty"`
Inbox []pc.Event `json:"inbox"`
Delivery []pc.Event `json:"delivery"`
DeliveryID string `json:"delivery_id,omitempty"`
Turns int `json:"turns"`
Paused bool `json:"paused"`
Error string `json:"error,omitempty"`
InitialPrompt string `json:"initial_prompt"`
}
type Host ¶
type Host func(context.Context, HostRequest) HostResponse
type HostRequest ¶
type HostResponse ¶
type RunnerSpec ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) SetConnected ¶
type Summary ¶
type Summary struct {
Board string `json:"board"`
AsOf time.Time `json:"as_of"`
AgentLimit int `json:"agent_limit"`
RegisteredAgents int `json:"registered_agents"`
ReadyAgents int `json:"ready_agents"`
RegisteredAccounts int `json:"registered_accounts"`
Runners map[string]int `json:"runners"`
Tasks map[string]int `json:"tasks"`
Leader string `json:"leader"`
Term int64 `json:"term"`
Listening bool `json:"local_listening"`
Attention []Attention `json:"attention"`
}
Summary deliberately excludes conversation transcripts, local credentials, task result bodies and provider configuration. Accounts are not human counts.