Documentation
¶
Overview ¶
Package protocol provides the IPC protocol types for agnt daemon communication.
This package extends go-cli-server/protocol with agnt-specific verbs and types. The core protocol infrastructure (Parser, Writer, Command, Response) comes from go-cli-server, while this package adds agnt-specific extensions.
Index ¶
- Constants
- Variables
- type AlertQueryFilter
- type AlertReportPayload
- type AutomateBatchRequest
- type AutomateOptions
- type AutomateProcessRequest
- type AutomateProcessResponse
- type AutomationEvaluateConfig
- type AutomationNavigateConfig
- type AutomationScreenshotConfig
- type AutomationStartConfig
- type AutostartRunConfig
- type BrowserStartConfig
- type ChaosConfigPayload
- type ChaosRuleConfig
- type Command
- type DirectoryFilter
- type ErrUnknownCommand
- type ErrorCode
- type HookPayload
- type InboxStatsRecord
- type IncidentContext
- type IncidentQueryFilter
- type IncidentQueryResult
- type IncidentRecord
- type IncidentRemediation
- type LogQueryFilter
- type OutputFilter
- type Parser
- type ProxyStartConfig
- type Response
- type ResponseType
- type RunConfig
- type SessionHostCreateConfig
- type SessionHostCreateResult
- type SessionHostResizeConfig
- type SessionRegisterConfig
- type SessionScheduleConfig
- type StoreClearRequest
- type StoreDeleteRequest
- type StoreGetAllRequest
- type StoreGetRequest
- type StoreListRequest
- type StoreSetRequest
- type StreamEventFilter
- type StructuredError
- type ToastConfig
- type TunnelConfig
- type TunnelStartConfig
- type VerbRegistry
- type Writer
Constants ¶
const ( VerbProxy = "PROXY" VerbProxyLog = "PROXYLOG" VerbCurrentPage = "CURRENTPAGE" VerbTunnel = "TUNNEL" VerbBrowser = "BROWSER" VerbAutomation = "AUTOMATION" // chromedp-based browser automation sessions VerbChaos = "CHAOS" VerbDetect = "DETECT" VerbOverlay = "OVERLAY" VerbStatus = "STATUS" // Full daemon status (Hub's INFO is minimal) VerbStore = "STORE" VerbAutomate = "AUTOMATE" // Agent-based automation processing VerbAlerts = "ALERTS" // Process output alert queries VerbScript = "SCRIPT" // Script registry queries and control VerbDoctor = "DOCTOR" // Health check / diagnostic report VerbAutostart = "AUTOSTART" // Resolve port conflicts and resume autostart VerbStreamEvents = "STREAM-EVENTS" // Long-lived event stream VerbHook = "HOOK" // Claude Code hook dispatcher enqueue VerbIncidents = "INCIDENTS" // Incident inbox query + mark-read VerbPorts = "PORTS" // Listening-port inventory + orphan pgid management VerbSessionHost = "SESSION-HOST" // Daemon-owned detachable PTY sessions (see docs/superpowers/specs/2026-07-03-remote-ssh-design.md §1) )
Agnt-specific command verbs (beyond those in go-cli-server).
const ( SubVerbExec = "EXEC" SubVerbToast = "TOAST" SubVerbQuery = "QUERY" SubVerbStats = "STATS" SubVerbActivity = "ACTIVITY" SubVerbOutputPreview = "OUTPUT-PREVIEW" SubVerbForwarding = "FORWARDING" // Pause/resume agent-inbound push for a session SubVerbEnable = "ENABLE" SubVerbDisable = "DISABLE" SubVerbAddRule = "ADD-RULE" SubVerbRemoveRule = "REMOVE-RULE" SubVerbListRules = "LIST-RULES" SubVerbPreset = "PRESET" SubVerbReset = "RESET" SubVerbSend = "SEND" SubVerbSchedule = "SCHEDULE" SubVerbCancel = "CANCEL" SubVerbTasks = "TASKS" SubVerbFind = "FIND" SubVerbAttach = "ATTACH" SubVerbURL = "URL" // Report detected URL from agnt run session SubVerbGetAll = "GET-ALL" // Get all entries in a scope SubVerbDelete = "DELETE" // Delete an entry from a scope SubVerbRunGroup = "RUN-GROUP" // Launch a multi-process startup group with depends_on ordering SubVerbProcess = "PROCESS" // Process a single automation task SubVerbBatch = "BATCH" // Process multiple automation tasks SubVerbRestart = "RESTART" // Restart a process or proxy SubVerbScreenshot = "SCREENSHOT" // Take screenshot in automation session SubVerbEvaluate = "EVALUATE" // Evaluate JavaScript in automation session SubVerbReport = "REPORT" // Report alert matches from agnt run SubVerbStartupLog = "STARTUP-LOG" // Query startup log (successes and failures) SubVerbClearPorts = "CLEAR-PORTS" // Kill port blockers and resume autostart SubVerbContinue = "CONTINUE" // Resume autostart without killing blockers SubVerbAutostartRun = "RUN" // Run autostart from MCP InitializedHandler (non-interactive) SubVerbReconcile = "RECONCILE" // Live-apply .agnt.kdl changes to running scripts/proxies SubVerbCleanOrphans = "CLEAN-ORPHANS" // Reap orphaned process groups (PORTS verb) SubVerbCreate = "CREATE" // Create a session-host session (SESSION-HOST verb) SubVerbKill = "KILL" // Explicit termination of a session-host session SubVerbDetach = "DETACH" // Client-initiated clean detach (SESSION-HOST ATTACH stream) SubVerbResize = "RESIZE" // Out-of-band window-size renegotiation (SESSION-HOST) )
Agnt-specific sub-verbs (beyond those in go-cli-server).
const ( ResponseOK = hubprotocol.ResponseOK ResponseErr = hubprotocol.ResponseErr ResponseData = hubprotocol.ResponseData ResponseJSON = hubprotocol.ResponseJSON ResponseChunk = hubprotocol.ResponseChunk ResponseEnd = hubprotocol.ResponseEnd ResponsePong = hubprotocol.ResponsePong )
Re-export response type constants.
const ( ErrNotFound = hubprotocol.ErrNotFound ErrAlreadyExists = hubprotocol.ErrAlreadyExists ErrInvalidState = hubprotocol.ErrInvalidState ErrShuttingDown = hubprotocol.ErrShuttingDown ErrPortInUse = hubprotocol.ErrPortInUse ErrInvalidArgs = hubprotocol.ErrInvalidArgs ErrInvalidAction = hubprotocol.ErrInvalidAction ErrInvalidCommand = hubprotocol.ErrInvalidCommand ErrMissingParam = hubprotocol.ErrMissingParam ErrTimeout = hubprotocol.ErrTimeout ErrInternal = hubprotocol.ErrInternal )
Re-export error code constants.
const ( CommandTerminator = hubprotocol.CommandTerminator DataMarker = hubprotocol.DataMarker )
Re-export protocol constants.
const ( VerbRun = hubprotocol.VerbRun VerbRunJSON = hubprotocol.VerbRunJSON VerbProc = hubprotocol.VerbProc VerbSession = hubprotocol.VerbSession VerbPing = hubprotocol.VerbPing VerbInfo = hubprotocol.VerbInfo VerbShutdown = hubprotocol.VerbShutdown )
Re-export core verb constants from hub.
const ( SubVerbStatus = hubprotocol.SubVerbStatus SubVerbOutput = hubprotocol.SubVerbOutput SubVerbStop = hubprotocol.SubVerbStop SubVerbList = hubprotocol.SubVerbList SubVerbCleanupPort = hubprotocol.SubVerbCleanupPort SubVerbRegister = hubprotocol.SubVerbRegister SubVerbUnregister = hubprotocol.SubVerbUnregister SubVerbHeartbeat = hubprotocol.SubVerbHeartbeat SubVerbGet = hubprotocol.SubVerbGet SubVerbStart = hubprotocol.SubVerbStart SubVerbClear = hubprotocol.SubVerbClear SubVerbSet = hubprotocol.SubVerbSet )
Re-export core sub-verb constants from hub.
Variables ¶
var ( NewParser = hubprotocol.NewParser NewParserWithRegistry = hubprotocol.NewParserWithRegistry NewWriter = hubprotocol.NewWriter NewVerbRegistry = hubprotocol.NewVerbRegistry FormatCommand = hubprotocol.FormatCommand FormatOK = hubprotocol.FormatOK FormatErr = hubprotocol.FormatErr FormatPong = hubprotocol.FormatPong FormatJSON = hubprotocol.FormatJSON FormatData = hubprotocol.FormatData FormatChunk = hubprotocol.FormatChunk FormatEnd = hubprotocol.FormatEnd // ErrJSONInsteadOfCommand indicates JSON was sent instead of a protocol command. ErrJSONInsteadOfCommand = hubprotocol.ErrJSONInsteadOfCommand // DefaultRegistry is the global verb registry. DefaultRegistry = hubprotocol.DefaultRegistry )
Re-export functions from hub.
Functions ¶
This section is empty.
Types ¶
type AlertQueryFilter ¶ added in v0.12.0
type AlertQueryFilter struct {
Since string `json:"since,omitempty"` // RFC3339 or duration like "5m"
ProcessID string `json:"process_id,omitempty"` // Filter to specific process
Severity string `json:"severity,omitempty"` // Filter by severity
Limit int `json:"limit,omitempty"` // Max results (0 = all)
Global bool `json:"global,omitempty"` // Bypass session scope (cross-project)
SessionCode string `json:"session_code,omitempty"` // Explicit session to scope to
Directory string `json:"directory,omitempty"` // Explicit project directory to scope to
}
AlertQueryFilter filters for ALERTS QUERY.
Scoping fields (Global / SessionCode / Directory) feed the session-scope chokepoint on the daemon side: by default the query is scoped to the caller's project; Global bypasses the scope (cross-project); SessionCode / Directory let an MCP client that is not session-bound on its daemon connection name the project explicitly (mirrors DirectoryFilter).
type AlertReportPayload ¶ added in v0.12.0
type AlertReportPayload struct {
PatternID string `json:"pattern_id"`
Severity string `json:"severity"` // "error", "warning", "info"
Category string `json:"category"` // "go", "dotnet", "webpack", "generic", "custom"
Description string `json:"description"` // Pattern description
Line string `json:"line"` // Matched output line
ScriptID string `json:"script_id"` // Process that produced the line
ProjectPath string `json:"project_path,omitempty"`
Timestamp string `json:"timestamp"` // RFC3339
}
AlertReportPayload is sent from agnt run to daemon when alert patterns match.
type AutomateBatchRequest ¶ added in v0.8.0
type AutomateBatchRequest struct {
Tasks []AutomateProcessRequest `json:"tasks"`
}
AutomateBatchRequest represents an AUTOMATE BATCH command.
type AutomateOptions ¶ added in v0.8.0
type AutomateOptions struct {
Model string `json:"model,omitempty"` // Model to use (haiku, sonnet)
MaxTokens int `json:"max_tokens,omitempty"` // Max response tokens
Temperature float64 `json:"temperature,omitempty"` // 0.0-1.0
}
AutomateOptions configures automation task processing.
type AutomateProcessRequest ¶ added in v0.8.0
type AutomateProcessRequest struct {
Type string `json:"type"` // Task type (audit_process, summarize, etc.)
Data map[string]interface{} `json:"data"` // Task-specific input data
Context map[string]interface{} `json:"context"` // Additional context
Options AutomateOptions `json:"options,omitempty"`
}
AutomateProcessRequest represents an AUTOMATE PROCESS command.
type AutomateProcessResponse ¶ added in v0.8.0
type AutomateProcessResponse struct {
Success bool `json:"success"`
Result interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Tokens int `json:"tokens_used"`
CostUSD float64 `json:"cost_usd"`
Duration string `json:"duration"`
}
AutomateProcessResponse represents the response from AUTOMATE PROCESS.
type AutomationEvaluateConfig ¶ added in v0.11.1
type AutomationEvaluateConfig struct {
SessionID string `json:"session_id"` // Session ID (required)
Script string `json:"script"` // JavaScript to evaluate (required)
}
AutomationEvaluateConfig represents configuration for an AUTOMATION EVALUATE command.
type AutomationNavigateConfig ¶ added in v0.11.1
type AutomationNavigateConfig struct {
}
AutomationNavigateConfig represents configuration for an AUTOMATION NAVIGATE command.
type AutomationScreenshotConfig ¶ added in v0.11.1
type AutomationScreenshotConfig struct {
SessionID string `json:"session_id"` // Session ID (required)
Type string `json:"type,omitempty"` // viewport, fullpage, element, clip
Label string `json:"label,omitempty"` // Optional label for filename
Selector string `json:"selector,omitempty"` // CSS selector for element type
Viewport string `json:"viewport,omitempty"` // Viewport preset name
X float64 `json:"x,omitempty"` // Clip X
Y float64 `json:"y,omitempty"` // Clip Y
Width float64 `json:"width,omitempty"` // Clip width
Height float64 `json:"height,omitempty"` // Clip height
}
AutomationScreenshotConfig represents configuration for an AUTOMATION SCREENSHOT command.
type AutomationStartConfig ¶ added in v0.11.1
type AutomationStartConfig struct {
ID string `json:"id,omitempty"` // Session ID (auto-generated if empty)
URL string `json:"url,omitempty"` // URL to open
ProxyID string `json:"proxy_id,omitempty"` // Proxy to use
Headless *bool `json:"headless,omitempty"` // Default: true
}
AutomationStartConfig represents configuration for an AUTOMATION START command.
type AutostartRunConfig ¶ added in v0.12.44
type AutostartRunConfig struct {
ProjectPath string `json:"project_path"`
NonInteractive bool `json:"non_interactive"`
}
AutostartRunConfig is the JSON payload for AUTOSTART RUN. Sent from the MCP InitializedHandler to trigger project autostart in non-interactive (channel) mode where there is no PTY session. When NonInteractive is true, the port-conflict "prompt" policy falls back to "skip" with a warning because there is no stdin to present the prompt to.
type BrowserStartConfig ¶ added in v0.11.1
type BrowserStartConfig struct {
ID string `json:"id,omitempty"` // Browser ID (auto-generated if empty)
URL string `json:"url,omitempty"` // URL to open
ProxyID string `json:"proxy_id,omitempty"` // Proxy to use (auto-starts if needed)
Headless *bool `json:"headless,omitempty"` // Default: true
BinaryPath string `json:"binary_path,omitempty"` // Optional Chrome path
}
BrowserStartConfig represents configuration for a BROWSER START command.
type ChaosConfigPayload ¶
type ChaosConfigPayload struct {
Enabled bool `json:"enabled"`
Rules []*ChaosRuleConfig `json:"rules,omitempty"`
GlobalOdds float64 `json:"global_odds,omitempty"` // 0.0-1.0
Seed int64 `json:"seed,omitempty"` // For reproducible chaos
LoggingMode int `json:"logging_mode,omitempty"` // 0=silent, 1=testing, 2=coordinated
}
ChaosConfigPayload represents the full chaos configuration for SET command.
type ChaosRuleConfig ¶
type ChaosRuleConfig struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type"` // latency, out_of_order, slow_drip, disconnect, http_error, truncate, etc.
Enabled bool `json:"enabled"`
URLPattern string `json:"url_pattern,omitempty"`
Methods []string `json:"methods,omitempty"`
Probability float64 `json:"probability,omitempty"` // 0.0-1.0, default 1.0
// Latency config
MinLatencyMs int `json:"min_latency_ms,omitempty"`
MaxLatencyMs int `json:"max_latency_ms,omitempty"`
JitterMs int `json:"jitter_ms,omitempty"`
// Slow-drip config
BytesPerMs int `json:"bytes_per_ms,omitempty"`
ChunkSize int `json:"chunk_size,omitempty"`
// Connection drop config
DropAfterPercent float64 `json:"drop_after_percent,omitempty"`
DropAfterBytes int64 `json:"drop_after_bytes,omitempty"`
// Error injection config
ErrorCodes []int `json:"error_codes,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
// Truncation config
TruncatePercent float64 `json:"truncate_percent,omitempty"`
// Out-of-order config
ReorderMinRequests int `json:"reorder_min_requests,omitempty"`
ReorderMaxWaitMs int `json:"reorder_max_wait_ms,omitempty"`
// Stale config
StaleDelayMs int64 `json:"stale_delay_ms,omitempty"`
}
ChaosRuleConfig represents configuration for a CHAOS ADD-RULE command.
type Command ¶
type Command = hubprotocol.Command
Command represents a parsed command from the client.
type DirectoryFilter ¶
type DirectoryFilter = hubprotocol.DirectoryFilter
DirectoryFilter represents directory scoping for list operations.
type ErrUnknownCommand ¶
type ErrUnknownCommand = hubprotocol.ErrUnknownCommand
ErrUnknownCommand indicates an unknown command verb was sent.
type HookPayload ¶ added in v0.12.44
type HookPayload struct {
Event string `json:"event"`
Payload json.RawMessage `json:"payload,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
HookPayload is sent from the `agnt hook` CLI dispatcher to the daemon when a Claude Code (or other agent) hook fires. The wire shape is intentionally tiny so the CLI can enqueue-and-exit in ~fork+write+ack time: the hook is synchronous from Claude's perspective and any added latency is directly visible to the user.
`Event` is the hook name (PreToolUse, Notification, Stop, …). `Payload` is the raw JSON blob Claude Code wrote to stdin, preserved verbatim so downstream consumers can read any future fields without the CLI knowing about them. `Tags` carries caller-provided key/value context — project path, agent id, session code — so the daemon can filter and route without re-parsing the opaque payload.
type InboxStatsRecord ¶ added in v0.13.0
type InboxStatsRecord struct {
Critical int `json:"critical"`
Error int `json:"error"`
Warning int `json:"warning"`
Info int `json:"info"`
Dropped int64 `json:"dropped"`
New int `json:"new"` // unread entries
}
InboxStatsRecord is the wire shape for inbox health summary.
type IncidentContext ¶ added in v0.13.0
type IncidentContext struct {
ProcessID string `json:"process_id,omitempty"`
ProxyID string `json:"proxy_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
ProjectPath string `json:"project_path,omitempty"`
URL string `json:"url,omitempty"`
PID int `json:"pid,omitempty"`
Port int `json:"port,omitempty"`
}
IncidentContext is the wire shape for incident context fields.
type IncidentQueryFilter ¶ added in v0.13.0
type IncidentQueryFilter struct {
Severities []string `json:"severities,omitempty"` // critical/error/warning/info; empty = all
Since string `json:"since,omitempty"` // RFC3339 timestamp for lower bound
Fingerprints []string `json:"fingerprints,omitempty"` // limit to specific fps
Sources []string `json:"sources,omitempty"` // filter by Source enum values
ProxyID string `json:"proxy_id,omitempty"`
ProcessID string `json:"process_id,omitempty"`
Detail string `json:"detail,omitempty"` // "summary" (default) | "full"
MarkRead bool `json:"mark_read,omitempty"`
Limit int `json:"limit,omitempty"` // 0 → 20; max 100
}
IncidentQueryFilter is the request payload for INCIDENTS QUERY.
type IncidentQueryResult ¶ added in v0.13.0
type IncidentQueryResult struct {
Incidents []IncidentRecord `json:"incidents"`
InboxStats InboxStatsRecord `json:"inbox_stats"`
Cursor string `json:"cursor,omitempty"` // RFC3339 of last-seen for resumable pulls
Truncated bool `json:"truncated"`
// PipelineEnabled reports whether the caller's session actually has an
// incident pipeline (alerts.incident-pipeline). True only when a session
// pipeline exists — distinguishes "pipeline on, inbox empty" from "pipeline
// off". get_errors uses this to decide whether to shim over the inbox.
PipelineEnabled bool `json:"pipeline_enabled"`
}
IncidentQueryResult is the response payload for INCIDENTS QUERY.
type IncidentRecord ¶ added in v0.13.0
type IncidentRecord struct {
ID string `json:"id"`
Fingerprint string `json:"fingerprint"`
FirstSeen string `json:"first_seen"` // RFC3339
LastSeen string `json:"last_seen"` // RFC3339
Count int `json:"count"`
Severity string `json:"severity"`
Source string `json:"source"`
Category string `json:"category,omitempty"`
Summary string `json:"summary,omitempty"`
Payload *string `json:"payload,omitempty"` // set when detail="full"
Context IncidentContext `json:"context,omitempty"`
Remediation IncidentRemediation `json:"remediation,omitempty"`
Read bool `json:"read"`
}
IncidentRecord is the wire shape for a single incident in a query result.
type IncidentRemediation ¶ added in v0.13.0
type IncidentRemediation struct {
PrimaryTool string `json:"primary_tool,omitempty"`
PrimaryArgs map[string]any `json:"primary_args,omitempty"`
FallbackTool string `json:"fallback_tool,omitempty"`
SkillHint string `json:"skill_hint,omitempty"`
}
IncidentRemediation is the wire shape for remediation hints.
type LogQueryFilter ¶
type LogQueryFilter struct {
Types []string `json:"types,omitempty"`
Methods []string `json:"methods,omitempty"`
URLPattern string `json:"url_pattern,omitempty"`
StatusCodes []int `json:"status_codes,omitempty"`
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
Limit int `json:"limit,omitempty"`
// ErrorsOnly filters to error-class entries (HTTP 4xx/5xx, JS errors,
// error-level diagnostics) across all sources.
ErrorsOnly bool `json:"errors_only,omitempty"`
// DiagnosticLevels filters diagnostic entries by level (info, warning, error).
DiagnosticLevels []string `json:"diagnostic_levels,omitempty"`
}
LogQueryFilter represents filters for PROXYLOG QUERY command.
type OutputFilter ¶
type OutputFilter = hubprotocol.OutputFilter
OutputFilter represents filters for PROC OUTPUT command.
type Parser ¶
type Parser = hubprotocol.Parser
Parser handles parsing of protocol commands and responses.
type ProxyStartConfig ¶
type ProxyStartConfig struct {
ID string `json:"id"`
TargetURL string `json:"target_url"`
Port int `json:"port"`
MaxLogSize int `json:"max_log_size,omitempty"`
BindAddress string `json:"bind_address,omitempty"` // "127.0.0.1" (default) or "0.0.0.0" (all interfaces)
PublicURL string `json:"public_url,omitempty"` // Public URL for tunnels (e.g., "https://abc.trycloudflare.com")
Tunnel *TunnelConfig `json:"tunnel,omitempty"`
}
ProxyStartConfig represents configuration for a PROXY START command.
type Response ¶
type Response = hubprotocol.Response
Response represents a response from the daemon.
type ResponseType ¶
type ResponseType = hubprotocol.ResponseType
ResponseType indicates the type of response.
type RunConfig ¶
type RunConfig = hubprotocol.RunConfig
RunConfig represents configuration for a RUN command.
type SessionHostCreateConfig ¶ added in v0.13.30
type SessionHostCreateConfig struct {
Name string `json:"name,omitempty"`
ProjectPath string `json:"project_path"`
Command string `json:"command"`
Args []string `json:"args,omitempty"`
Cols int `json:"cols"`
Rows int `json:"rows"`
Env map[string]string `json:"env,omitempty"`
}
SessionHostCreateConfig is the payload for SESSION-HOST CREATE. See docs/superpowers/specs/2026-07-03-remote-ssh-design.md §1.2.
type SessionHostCreateResult ¶ added in v0.13.30
type SessionHostCreateResult struct {
SessionID string `json:"session_id"`
SessionPGID int `json:"session_pgid"`
}
SessionHostCreateResult is the response to SESSION-HOST CREATE.
type SessionHostResizeConfig ¶ added in v0.13.30
type SessionHostResizeConfig struct {
SessionID string `json:"session_id"`
Cols int `json:"cols"`
Rows int `json:"rows"`
}
SessionHostResizeConfig is the payload for a "resize" frame on SESSION-HOST ATTACH, and for the SESSION-HOST RESIZE convenience command.
type SessionRegisterConfig ¶ added in v0.7.0
type SessionRegisterConfig struct {
OverlayPath string `json:"overlay_path"` // Unix socket path for overlay
ProjectPath string `json:"project_path"` // Directory where session was started
Command string `json:"command"` // Command being run (e.g., "claude")
Args []string `json:"args,omitempty"` // Command arguments
SessionPGID int `json:"session_pgid,omitempty"` // POSIX process group ID of the PTY child (session leader); 0 on Windows or when unavailable
SessionJobHandle uint64 `json:"session_job_handle,omitempty"` // Windows Job Object handle for the PTY child subtree; 0 on Unix or when unavailable. Handles are per-process on Windows — this is a best-effort hint for daemon cleanup, not a stable cross-process identifier.
}
SessionRegisterConfig represents configuration for a SESSION REGISTER command. This extends the base hub SessionRegisterConfig with agnt-specific fields.
type SessionScheduleConfig ¶ added in v0.7.0
type SessionScheduleConfig struct {
SessionCode string `json:"session_code"` // Target session
Duration string `json:"duration"` // Go duration string (e.g., "5m", "1h30m")
Message string `json:"message"` // Message to deliver
ProjectPath string `json:"project_path"` // For project-scoped storage
}
SessionScheduleConfig represents configuration for a SESSION SCHEDULE command.
type StoreClearRequest ¶ added in v0.8.0
StoreClearRequest represents a STORE CLEAR command.
type StoreDeleteRequest ¶ added in v0.8.0
type StoreDeleteRequest struct {
Scope string `json:"scope"`
ScopeKey string `json:"scope_key"`
Key string `json:"key"`
}
StoreDeleteRequest represents a STORE DELETE command.
type StoreGetAllRequest ¶ added in v0.8.0
StoreGetAllRequest represents a STORE GET_ALL command.
type StoreGetRequest ¶ added in v0.8.0
type StoreGetRequest struct {
Scope string `json:"scope"`
ScopeKey string `json:"scope_key"`
Key string `json:"key"`
}
StoreGetRequest represents a STORE GET command.
type StoreListRequest ¶ added in v0.8.0
StoreListRequest represents a STORE LIST command.
type StoreSetRequest ¶ added in v0.8.0
type StoreSetRequest struct {
Scope string `json:"scope"`
ScopeKey string `json:"scope_key"`
Key string `json:"key"`
Value interface{} `json:"value"`
Metadata map[string]any `json:"metadata,omitempty"`
}
StoreSetRequest represents a STORE SET command.
type StreamEventFilter ¶ added in v0.12.36
type StreamEventFilter struct {
Types []string `json:"types,omitempty"` // Log entry types: error, http, panel_message, process, etc.
ProxyID string `json:"proxy_id,omitempty"` // Filter to specific proxy
ProjectPath string `json:"project_path,omitempty"` // Filter to proxies belonging to this project directory
ProcessID string `json:"process_id,omitempty"` // Filter to specific process output
Severity string `json:"severity,omitempty"` // Filter by severity: error, warning, info
Grep string `json:"grep,omitempty"` // Substring match on process output lines
GrepStream string `json:"grep_stream,omitempty"` // Filter process output stream: "stdout" or "stderr"
}
StreamEventFilter filters events for STREAM-EVENTS command.
type StructuredError ¶
type StructuredError = hubprotocol.StructuredError
StructuredError contains programmatic error details.
type ToastConfig ¶
type ToastConfig struct {
Type string `json:"type"` // success, error, warning, info
Title string `json:"title,omitempty"` // Toast title (optional)
Message string `json:"message"` // Toast message
Duration int `json:"duration,omitempty"` // Duration in ms (0 for default)
}
ToastConfig represents configuration for a PROXY TOAST command.
type TunnelConfig ¶
type TunnelConfig struct {
// Provider is the tunnel provider: "ngrok", "cloudflared", "tailscale", or "custom"
Provider string `json:"provider"`
// Command is used when Provider is "custom" - the full command to run
Command string `json:"command,omitempty"`
// Args are additional arguments for the tunnel command
Args []string `json:"args,omitempty"`
// AuthToken is the authentication token (for ngrok)
AuthToken string `json:"auth_token,omitempty"`
// Region is the tunnel region (optional)
Region string `json:"region,omitempty"`
}
TunnelConfig represents configuration for starting a tunnel alongside a proxy.
type TunnelStartConfig ¶
type TunnelStartConfig struct {
ID string `json:"id"` // Tunnel ID (usually same as proxy ID)
Provider string `json:"provider"` // "cloudflare" or "ngrok"
LocalPort int `json:"local_port"` // Local port to tunnel
LocalHost string `json:"local_host,omitempty"` // Local host (default: localhost)
BinaryPath string `json:"binary_path,omitempty"` // Optional path to tunnel binary
ProxyID string `json:"proxy_id,omitempty"` // Optional proxy ID to auto-configure public_url
}
TunnelStartConfig represents configuration for a TUNNEL START command.
type VerbRegistry ¶ added in v0.8.0
type VerbRegistry = hubprotocol.VerbRegistry
VerbRegistry tracks registered command verbs.
type Writer ¶
type Writer = hubprotocol.Writer
Writer provides methods for writing protocol messages.