control

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package control exposes local HTTP and stream handlers for Codog sessions.

Package control serves Codog's local HTTP control API for remote clients, editor bridge integrations, background tasks, and workspace operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Code      string    `json:"code,omitempty"`
	Message   string    `json:"message"`
	Retryable bool      `json:"retryable,omitempty"`
	At        time.Time `json:"at,omitempty"`
}

Failure records the latest remote client failure reported to the control API.

type RouteSpec

type RouteSpec struct {
	Path        string   `json:"path"`
	Methods     []string `json:"methods"`
	Description string   `json:"description"`
	Public      bool     `json:"public,omitempty"`
	Streaming   bool     `json:"streaming,omitempty"`
}

RouteSpec describes one public control API route for discovery and docs.

func RouteSpecs

func RouteSpecs() []RouteSpec

RouteSpecs returns the stable list of routes served by the control API.

type Server

type Server struct {
	Sessions    *session.Store
	ConfigHome  string
	Workspace   string
	AuthToken   string
	MaxSessions int
	Hooks       config.HookConfig
	MCPServers  map[string]config.MCPServerConfig
	LeaseTTL    time.Duration
	Executable  string
	EditorToken string
	RemoteEnv   []string
	Now         func() time.Time
}

Server owns the dependencies and policy required to serve the control API.

func (Server) Handler

func (s Server) Handler() http.Handler

Handler builds the HTTP mux for all control API routes.

type State

type State struct {
	HeartbeatAt     time.Time  `json:"heartbeat_at,omitempty"`
	LastError       string     `json:"last_error,omitempty"`
	Failure         *Failure   `json:"failure,omitempty"`
	UpdatedAt       time.Time  `json:"updated_at,omitempty"`
	LeaseTTLSeconds int        `json:"lease_ttl_seconds,omitempty"`
	LeaseExpiresAt  *time.Time `json:"lease_expires_at,omitempty"`
	LeaseExpired    bool       `json:"lease_expired,omitempty"`
}

State is the remote client heartbeat and lease status exposed by /state.

Jump to

Keyboard shortcuts

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