node

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 39 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultWSPath = "/api/aop/node/ws"

Variables

This section is empty.

Functions

func BroadcastPTYSessions

func BroadcastPTYSessions(router *terminal.Router, send func(*ptypb.ProtocolMessage))

BroadcastPTYSessions sends the current PTY session list to all active streams.

func BuildHello

func BuildHello(name string, reg *commands.CommandRegistry, nodeID string, runtimeInfo *aop.AgentRuntimeInfo) (*aop.AgentHello, error)

BuildHello builds the AOP core agent registration message.

func HTTPToWS

func HTTPToWS(rawURL string) string

HTTPToWS converts an HTTP(S) URL to a WS(S) URL.

func NewPTYRouter

func NewPTYRouter(reg *commands.CommandRegistry) *terminal.Router

NewPTYRouter creates the tool-node fallback router. Agent transports receive their router directly from AgentRuntime and do not inspect the bash tool.

func RegistryPTYManager

func RegistryPTYManager(reg *commands.CommandRegistry) *tmux.Manager

RegistryPTYManager extracts the tmux Manager from the "bash" tool in the command registry, if available.

func RunToolNode

func RunToolNode(ctx context.Context, cfg ToolNodeConfig) error

RunToolNode connects to the hub as a tool-only node and serves until ctx is done, reconnecting with backoff on connection loss.

func RunWebSocket

func RunWebSocket(ctx context.Context, option *cfg.Option, logger telemetry.Logger) error

func SplitAccessKey

func SplitAccessKey(rawURL string) (dialURL, token string)

SplitAccessKey lifts the access token out of a URL's userinfo (http://<token>@host...), returning a userinfo-free URL plus the token. A URL without userinfo (or an unparseable one) comes back unchanged with an empty token.

func SubscribePTYSessions

func SubscribePTYSessions(ctx context.Context, mgr *tmux.Manager, router *terminal.Router, send func(*ptypb.ProtocolMessage)) func()

SubscribePTYSessions subscribes to PTY session changes and broadcasts session state to all active PTY streams.

Types

type AgentStatsTracker

type AgentStatsTracker struct {
	// contains filtered or unexported fields
}

AgentStatsTracker tracks agent event statistics for the WebSocket connection.

func NewAgentStatsTracker

func NewAgentStatsTracker() *AgentStatsTracker

NewAgentStatsTracker creates a new stats tracker.

func (*AgentStatsTracker) Observe

func (t *AgentStatsTracker) Observe(e *aop.Event) (*aop.AgentStats, bool)

Observe records an AOP event and returns updated stats if the stats changed.

func (*AgentStatsTracker) Snapshot

func (t *AgentStatsTracker) Snapshot() *aop.AgentStats

Snapshot returns the current stats snapshot.

type ToolNodeConfig

type ToolNodeConfig struct {
	ServerURL string
	WSPath    string
	// ID is the stable node identity used by Cairn as the runner primary key.
	ID       string
	Token    string
	Registry *commands.CommandRegistry
	Events   *eventbus.Bus[*aop.Event]
	Progress *eventbus.Bus[*toolpb.Progress]
	Logger   telemetry.Logger
	Version  string
	// JSONFrames switches the hub wire to standard ProtoJSON text frames;
	// hubs expecting binary protobuf (AIScan) leave it false.
	JSONFrames bool
	// DisableCommandCatalog prevents the AIScan-specific command namespace from
	// being sent to generic AOP hubs. Tool definitions remain in AgentHello.
	DisableCommandCatalog bool
	// FileAudit is the file-access trail the registry's tools report into. When
	// set, every observation is streamed to the hub on the file namespace.
	FileAudit *commands.FileAudit
	// ExtraNamespaces lets a host register additional AOP namespaces on the
	// connection mux (e.g. the traffic namespace backed by the host's proxy
	// hub). Each registrar is applied after the built-in namespaces.
	ExtraNamespaces []func(*aop.NamespaceMux) error
}

ToolNodeConfig configures a tool-only runner: an outbound WebSocket connection exposing Command, native file RPCs, PTY, progress and raw tool artifacts, with no LLM provider, agent loop, or IOA dependency.

Jump to

Keyboard shortcuts

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