Documentation
¶
Overview ¶
Package node implements the enrolled execution service. A node can coordinate work as an orchestrator and execute requested work as a worker. These are roles within an operation, not distinct runtime types. AI agents are optional providers.
Index ¶
- Variables
- func Bridge(ctx context.Context, a, b net.Conn)
- func HTTPServer(address string, handler http.Handler) *http.Server
- type APICall
- type Command
- type Config
- type Execution
- type Node
- func (n *Node) Call(ctx context.Context, target, method string, params any, result any) error
- func (n *Node) Capabilities() []model.Capability
- func (n *Node) Close() error
- func (n *Node) ConfigureUpdates(info buildinfo.Info, apply func(string) error) error
- func (n *Node) Download(ctx context.Context, a model.Artifact, offset int64, dest io.Writer) (err error)
- func (n *Node) FollowTaskLogs(ctx context.Context, target, id string, offset int64, ...) error
- func (n *Node) Handler() http.Handler
- func (n *Node) OpenTCP(ctx context.Context, target, address string) (net.Conn, error)
- func (n *Node) OpenTCPListener(ctx context.Context, target, listen string) (net.Conn, string, error)
- func (n *Node) Register(p Provider) error
- func (n *Node) SetShutdown(stop func())
- func (n *Node) Start(ctx context.Context) error
- func (n *Node) Unregistered() bool
- func (n *Node) WaitTask(ctx context.Context, target, id string) (model.Task, error)
- type Provider
- type WorkflowStep
Constants ¶
This section is empty.
Variables ¶
var ErrUnregistered = errors.New("machine was unregistered by its fleet owner")
Functions ¶
Types ¶
type Command ¶
type Command struct {
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Env map[string]string `json:"env,omitempty"`
Dir string `json:"dir,omitempty"`
Description string `json:"description,omitempty"`
InputSchema json.RawMessage `json:"inputSchema,omitempty"`
URL string `json:"url,omitempty"`
}
type Config ¶
type Config struct {
Name string `json:"name"`
Gateway string `json:"gateway"`
Token string `json:"token,omitempty"`
DataDir string `json:"dataDir"`
WorkDir string `json:"workDir"`
Listen string `json:"listen,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
RelayOnly bool `json:"relayOnly,omitempty"`
ICEServers []webrtc.ICEServer `json:"iceServers"`
MaxTasks int `json:"maxTasks,omitempty"`
MetricsIntervalSeconds int `json:"metricsIntervalSeconds,omitempty"`
// TaskRetentionHours keeps terminal task records, logs, and workspaces for
// reconciliation. Zero selects 168 hours; -1 disables age-based pruning.
TaskRetentionHours int `json:"taskRetentionHours,omitempty"`
// MaxRetainedTasks bounds retained terminal tasks. Zero selects 10000; -1
// disables count-based pruning.
MaxRetainedTasks int `json:"maxRetainedTasks,omitempty"`
// Zero preserves unlimited artifact storage; a positive value caps blobs,
// import staging and resumable partials together. Owned content is never evicted.
MaxArtifactBytes int64 `json:"maxArtifactBytes,omitempty"`
ArtifactReserveBytes uint64 `json:"artifactReserveBytes,omitempty"`
PartialRetentionHours int `json:"partialRetentionHours,omitempty"`
// Allow maps caller IDs, names, *, or @orchestrator to method glob patterns.
// An omitted map permits same-fleet discovery and account-client execution.
// An empty map denies incoming calls without a valid instruction/artifact grant.
// Neither rules nor grants bypass fleet membership or task ownership.
Allow map[string][]string `json:"allow,omitempty"`
Providers map[string]Command `json:"providers,omitempty"`
Agents map[string]Command `json:"agents,omitempty"`
MCP map[string]Command `json:"mcp,omitempty"`
// RPA opts into desktop access through a configured version-1 helper.
RPA *Command `json:"rpa,omitempty"`
}
func LoadConfig ¶
type Node ¶
type Node struct {
Config Config
Identity *identity.Identity
Peer *transport.Peer
// contains filtered or unexported fields
}
Node owns a machine's capabilities, tasks, artifacts, and peer connections.
func (*Node) Capabilities ¶
func (n *Node) Capabilities() []model.Capability
func (*Node) ConfigureUpdates ¶
ConfigureUpdates is called by the executable before Start. Libraries/tests cannot accidentally replace their own test runner through an update message.
func (*Node) FollowTaskLogs ¶
func (*Node) Handler ¶
Handler is the authenticated local API used by CLI and MCP clients. Bind it to loopback; it carries the local node's authority, not a remote caller's.
func (*Node) OpenTCPListener ¶
func (n *Node) OpenTCPListener(ctx context.Context, target, listen string) (net.Conn, string, error)
OpenTCPListener keeps the local node out of maintenance while it relays a process-owned remote listener, including periods without active sockets.
func (*Node) SetShutdown ¶
func (n *Node) SetShutdown(stop func())
SetShutdown configures local service control before Start.
func (*Node) Unregistered ¶
Unregistered reports whether the node durably received identity retirement.
type Provider ¶
type Provider interface {
Capability() model.Capability
Run(context.Context, json.RawMessage, Execution) (any, error)
}
Providers share this interface whether built in or backed by a subprocess.
type WorkflowStep ¶
type WorkflowStep = model.WorkflowStep
Source Files
¶
- activity.go
- api.go
- artifact_pins.go
- artifact_retention.go
- artifacts.go
- clipboard.go
- config.go
- connectiontest.go
- delegation.go
- diagnostics.go
- health.go
- leases.go
- lifecycle.go
- listener.go
- logs.go
- maintenance.go
- mcp.go
- node.go
- process_unix.go
- providers.go
- retention.go
- rpa.go
- secrets.go
- task_page.go
- tasks.go
- tunnel.go
- wire.go
- workflow.go