agentctl

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package agentctl provides a unix-socket control channel between the wick MCP stdio process and the wick HTTP daemon. The daemon owns the agent pool; stdio processes send commands (switch_provider, kill) and receive a JSON response.

Socket path: ~/.<app>/agents/agentctl.sock (same dir as gate.sock)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SocketPath

func SocketPath() string

SocketPath returns the platform path for the agentctl unix socket.

Types

type Cmd

type Cmd struct {
	Op           string `json:"op"`                      // "switch_provider" | "kill"
	SessionID    string `json:"session_id,omitempty"`    // empty = auto-resolve from active pool
	AgentName    string `json:"agent_name,omitempty"`    // empty = "main"
	ProviderType string `json:"provider_type,omitempty"` // for switch_provider
	ProviderName string `json:"provider_name,omitempty"` // for switch_provider
}

Cmd is the command sent from stdio → daemon.

type Reply

type Reply struct {
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
	// Fields echoed on success.
	SessionID    string `json:"session_id,omitempty"`
	AgentName    string `json:"agent_name,omitempty"`
	ProviderType string `json:"provider_type,omitempty"`
	ProviderName string `json:"provider_name,omitempty"`
}

Reply is the daemon's response.

func Send

func Send(cmd Cmd) (Reply, error)

Send connects to the daemon socket, sends cmd, and returns the reply. Used by the stdio MCP handler.

type Server

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

Server listens on the agentctl unix socket and dispatches commands to the agent pool. Start it in a goroutine after the pool is ready.

func NewServer

func NewServer(pool *agentpool.Pool, layout agentconfig.Layout) *Server

func (*Server) Listen

func (s *Server) Listen(ctx context.Context) error

Listen binds the socket and serves until ctx is cancelled.

Jump to

Keyboard shortcuts

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