cmd

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 57 Imported by: 0

Documentation

Index

Constants

View Source
const GUIEnrollmentFile = "gui_enrollments.json"

GUIEnrollmentFile is the name of the file storing enrolled GUI origins.

Variables

This section is empty.

Functions

func ExecuteWithVersionInfo

func ExecuteWithVersionInfo(version, buildID, buildTime, platform string)

func NewRootCmd

func NewRootCmd(version string, vi serve.VersionInfo) *cobra.Command

func WriteAgentConfig

func WriteAgentConfig(agentID, binaryPath string) (string, func(), error)

WriteAgentConfig writes the appropriate MCP config file for the agent. Returns the path to the config file and a cleanup function (if any).

Types

type ApprovalResult

type ApprovalResult struct {
	ApprovalURL string    `json:"approval_url,omitempty"`
	Content     []Content `json:"content,omitempty"`
}

ApprovalResult represents a tool call result requiring L3 approval.

type CallToolRequest

type CallToolRequest struct {
	Name      string          `json:"name"`
	Arguments json.RawMessage `json:"arguments,omitempty"`
}

CallToolRequest is the params object for tools/call.

type Content

type Content struct {
	Type string      `json:"type"`
	Text string      `json:"text,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

Content represents a content item in an MCP response.

type DemoEmitter

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

DemoEmitter translates demo scenario events into TUI messages. When --tui is not active, demoEmitter is nil and all methods are no-ops.

func NewDemoEmitter

func NewDemoEmitter(p *tea.Program) *DemoEmitter

NewDemoEmitter creates a DemoEmitter backed by the given bubbletea program.

func (*DemoEmitter) Consensus

func (e *DemoEmitter) Consensus(member constants.ConsensusMember, decision, signed bool, quorum, total int, result tui.ConsensusResult, hash string)

Consensus emits an L2 consensus update to the TUI.

func (*DemoEmitter) Ledger

func (e *DemoEmitter) Ledger(level tui.LedgerLevel, message string)

Ledger emits a ledger entry to the TUI.

func (*DemoEmitter) Pipeline

func (e *DemoEmitter) Pipeline(stage tui.PipelineStage, status tui.PipelineStatus, txID, detail string)

Pipeline emits a pipeline stage update to the TUI.

type Enroller

type Enroller interface {
	Enroll(ctx context.Context, opts auth.EnrollmentOptions) (*auth.EnrollmentResult, error)
}

Enroller is the interface satisfied by *auth.EnrollmentCoordinator. The command layer depends on this interface rather than the concrete type so tests can inject a mock coordinator that records calls and returns canned EnrollmentResults without network I/O, sudo, or browser launches.

type GUIEnrollment

type GUIEnrollment struct {
	Origins []string `json:"origins"`
}

GUIEnrollment holds the persisted list of enrolled frontend origins.

type GatewayFlags

type GatewayFlags struct {
	Posture            string
	HTTPPort           int
	HTTPSPort          int
	DataDir            string
	PKIDir             string
	SecretsDir         string
	VaultDir           string
	VaultKeyPath       string
	PasskeyRpID        string
	PasskeyRpName      string
	PasskeyRpOrigins   []string
	RateLimitRPS       float64
	RateLimitBurst     int
	LogLevel           string
	CertIdentityMode   string
	ConsensusID        string
	ConsensusURL       string
	ConsensusBootstrap string
	MCPDownstreamURL   string
	A2ADownstreamURL   string
	PublicBaseURL      string
	AllowedOrigins     []string
	DoctrineDir        string
}

GatewayFlags holds all gateway CLI flag values shared by gatewayStartCmd. It is populated by addGatewayFlags and converted to serve.GatewayConfig via gatewayFlagsToServeConfig.

type InitializeResult

type InitializeResult struct {
	ProtocolVersion string          `json:"protocolVersion"`
	Capabilities    MCPCapabilities `json:"capabilities"`
	ServerInfo      ServerInfo      `json:"serverInfo"`
}

InitializeResult is the result payload for initialize.

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      interface{}     `json:"id"`
	Method  string          `json:"method"`
	Params  json.RawMessage `json:"params,omitempty"`
}

JSONRPCRequest represents a JSON-RPC 2.0 request.

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      interface{} `json:"id"`
	Result  interface{} `json:"result,omitempty"`
	Error   *RPCError   `json:"error,omitempty"`
}

JSONRPCResponse represents a JSON-RPC 2.0 response.

type MCPCapabilities

type MCPCapabilities struct {
	Tools MCPToolsCapability `json:"tools"`
}

MCPCapabilities represents the capabilities object in the MCP initialize response.

type MCPToolsCapability

type MCPToolsCapability struct{}

MCPToolsCapability declares the tools capability for the MCP initialize handshake.

type RPCError

type RPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

RPCError represents a JSON-RPC error object.

type ServerInfo

type ServerInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

ServerInfo contains server information for initialize.

type Tool

type Tool struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	InputSchema *mcp.InputSchema `json:"inputSchema"`
}

Tool represents a single MCP tool descriptor.

type ToolsListResult

type ToolsListResult struct {
	Tools []Tool `json:"tools"`
}

ToolsListResult is the result payload for tools/list.

Jump to

Keyboard shortcuts

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