Documentation
¶
Index ¶
- Constants
- func BroadcastPTYSessions(router *terminal.Router, send func(*ptypb.ProtocolMessage))
- func BuildHello(name string, reg *commands.CommandRegistry, nodeID string, ...) (*aop.AgentHello, error)
- func HTTPToWS(rawURL string) string
- func NewPTYRouter(reg *commands.CommandRegistry) *terminal.Router
- func RegistryPTYManager(reg *commands.CommandRegistry) *tmux.Manager
- func RunToolNode(ctx context.Context, cfg ToolNodeConfig) error
- func RunWebSocket(ctx context.Context, option *cfg.Option, logger telemetry.Logger) error
- func SplitAccessKey(rawURL string) (dialURL, token string)
- func SubscribePTYSessions(ctx context.Context, mgr *tmux.Manager, router *terminal.Router, ...) func()
- type AgentStatsTracker
- type ToolNodeConfig
Constants ¶
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 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 SplitAccessKey ¶
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
}
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.