api

package
v0.700.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 81 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmbeddedWebUI added in v0.230.0

func EmbeddedWebUI() (fs.FS, error)

Types

type AgentConfigItem added in v0.70.0

type AgentConfigItem struct {
	Name                 string              `json:"name"`
	Model                models.ModelID      `json:"model"`
	MaxTokens            int64               `json:"maxTokens"`
	ResolvedMaxTokens    int64               `json:"resolvedMaxTokens,omitempty"` // effective value after auto-budget resolution
	ReasoningEffort      string              `json:"reasoningEffort"`
	ThinkingMode         config.ThinkingMode `json:"thinkingMode,omitempty"`
	AutoCompact          bool                `json:"autoCompact"`
	AutoCompactThreshold float64             `json:"autoCompactThreshold"`
	// ContextControls reports whether the token-budget / auto-compaction knobs
	// above are meaningful for this agent (see config.AgentExposesContextControls).
	// The web-UI hides them when false; the values are still returned so a TOML
	// override remains inspectable, and PUT ignores them for those agents.
	ContextControls bool `json:"contextControls"`
}

AgentConfigItem is the JSON representation of a single agent configuration.

type BackgroundSessionManager added in v0.302.0

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

BackgroundSessionManager runs agent sessions in background goroutines that are independent of HTTP connections. Clients can connect and disconnect at any time; the session keeps running and new subscribers receive a replay of the buffered events followed by live updates.

func NewBackgroundSessionManager added in v0.302.0

func NewBackgroundSessionManager() *BackgroundSessionManager

NewBackgroundSessionManager creates a manager and starts the background cleanup goroutine that purges stale completed sessions.

func (*BackgroundSessionManager) Cancel added in v0.302.0

func (m *BackgroundSessionManager) Cancel(sessionID string)

Cancel cancels the background run for sessionID. No-op if unknown.

func (*BackgroundSessionManager) IsBusy added in v0.302.0

func (m *BackgroundSessionManager) IsBusy(sessionID string) bool

IsBusy reports whether the session is actively processing (not yet done).

func (*BackgroundSessionManager) IsRunning added in v0.302.0

func (m *BackgroundSessionManager) IsRunning(sessionID string) bool

IsRunning reports whether the session has an active (or recently completed) background run whose replay buffer is still available.

func (*BackgroundSessionManager) Submit added in v0.302.0

func (m *BackgroundSessionManager) Submit(
	sessionID string,
	agentRunFn func(ctx context.Context) (<-chan agent.AgentEvent, error),
) error

Submit starts an agent run for sessionID in the background. agentRunFn is called with a background-derived context and must return the event channel produced by agent.Service.Run(). Returns agent.ErrSessionBusy if the session is already actively running.

func (*BackgroundSessionManager) Subscribe added in v0.302.0

func (m *BackgroundSessionManager) Subscribe(sessionID string) (events <-chan agent.AgentEvent, unsubscribe func(), ok bool)

Subscribe returns:

  • events: a channel that first delivers buffered events then live events.
  • unsubscribe: call this when done to remove the subscriber (safe to call multiple times; if the session is already done it is a no-op).
  • ok: false when no session with that ID exists in the manager.

If the session is already done the channel is closed after the replay.

type BasicAuthStatusResponse added in v0.627.0

type BasicAuthStatusResponse struct {
	Enabled bool                    `json:"enabled"`
	Users   []BasicAuthUserResponse `json:"users"`
	// Enforced reports whether credentials are actually being demanded right now.
	// Basic auth is inert while the server is bound to a loopback address.
	Enforced bool `json:"enforced"`
	// BindHost is the address the server is listening on, so the panel can explain
	// why the setting is inert.
	BindHost string `json:"bindHost"`
}

BasicAuthStatusResponse is the payload of the WebUI Access panel.

type BasicAuthUserResponse added in v0.627.0

type BasicAuthUserResponse struct {
	Username string `json:"username"`
}

BasicAuthUserResponse describes a configured credential without its password.

type BrowserInstallInfo added in v0.291.0

type BrowserInstallInfo struct {
	Type        string `json:"type"`
	Label       string `json:"label"`
	Executable  string `json:"executable"`
	UserDataDir string `json:"userDataDir,omitempty"`
}

type ChatRequest

type ChatRequest struct {
	SessionID string `json:"sessionId"`
	Prompt    string `json:"prompt"`
	Model     string `json:"model,omitempty"`
}

type ChatResponse

type ChatResponse struct {
	SessionID string `json:"sessionId"`
	MessageID string `json:"messageId"`
	Response  string `json:"response"`
}

type CreateCronJobRequest added in v0.244.0

type CreateCronJobRequest struct {
	Name     string   `json:"name"`
	Schedule string   `json:"schedule"`
	Prompt   string   `json:"prompt"`
	Enabled  bool     `json:"enabled"`
	Engine   string   `json:"engine,omitempty"`
	Model    string   `json:"model,omitempty"`
	WorkDir  string   `json:"workDir,omitempty"`
	Tags     []string `json:"tags,omitempty"`
	Timeout  string   `json:"timeout,omitempty"`
}

CreateCronJobRequest is the body for POST /api/v1/cronjobs.

type CreateTaskRequest added in v0.60.0

type CreateTaskRequest struct {
	Prompt       string   `json:"prompt"`
	WorkDir      string   `json:"work_dir,omitempty"`
	Model        string   `json:"model,omitempty"`
	Engine       string   `json:"engine,omitempty"`
	Tags         []string `json:"tags,omitempty"`
	Dependencies []string `json:"dependencies,omitempty"`
	Background   bool     `json:"background"`
}

CreateTaskRequest is the body for POST /api/v1/orchestrator/tasks.

type CronJobResponse added in v0.244.0

type CronJobResponse struct {
	Name     string    `json:"name"`
	Schedule string    `json:"schedule"`
	Enabled  bool      `json:"enabled"`
	Prompt   string    `json:"prompt,omitempty"`
	Engine   string    `json:"engine,omitempty"`
	Model    string    `json:"model,omitempty"`
	WorkDir  string    `json:"workDir,omitempty"`
	Tags     []string  `json:"tags,omitempty"`
	Timeout  string    `json:"timeout,omitempty"`
	NextRun  time.Time `json:"nextRun,omitempty"`
}

CronJobResponse is the JSON representation of a cronjob returned by the API.

type DesignArtifactResponse added in v0.700.0

type DesignArtifactResponse struct {
	design.Artifact
	// URL, BridgeURL and FileURL come from the presentation; they are empty
	// when the entry document is missing (a half-deleted artifact directory).
	URL       string `json:"url,omitempty"`
	BridgeURL string `json:"bridge_url,omitempty"`
	FileURL   string `json:"file_url,omitempty"`
	Slides    int    `json:"slides,omitempty"`
	Entry     string `json:"entry,omitempty"`
}

DesignArtifactResponse is one artifact plus everything a surface needs to show it without a second round trip.

type DesignStatusResponse added in v0.700.0

type DesignStatusResponse struct {
	Enabled bool `json:"enabled"`
	// Preview reports that artifacts can be served over HTTP. It is false when
	// the guard refuses (an exposed listener with no basic auth), which is a
	// different failure from the subsystem being off.
	Preview bool `json:"preview"`
	// PreviewReason explains a false Preview so the UI can say why instead of
	// showing an empty frame.
	PreviewReason string `json:"preview_reason,omitempty"`
	// Renderer reports that a headless browser was found, without which render,
	// screenshot and export do nothing.
	Renderer  bool     `json:"renderer"`
	Kinds     []string `json:"kinds"`
	OutputDir string   `json:"output_dir,omitempty"`
}

DesignStatusResponse tells a client whether the Design Studio is usable in this process, and with what.

type DesignSystemResponse added in v0.700.0

type DesignSystemResponse struct {
	System design.DesignSystem `json:"system"`
	// Exists is false when the project has never committed a system and the
	// values shown are the defaults.
	Exists     bool   `json:"exists"`
	Tokens     string `json:"tokens_path"`
	Stylesheet string `json:"stylesheet_path"`
	Contract   string `json:"contract_path"`
}

DesignSystemResponse is the design system plus everything a settings screen needs to explain it: whether it was ever committed, and where its files live.

type EvaluatorMetrics added in v0.60.0

type EvaluatorMetrics struct {
	TotalSessions  int64   `json:"total_sessions"`
	TotalTemplates int64   `json:"total_templates"`
	AvgReward      float64 `json:"avg_reward"`
	ActiveSkills   int64   `json:"active_skills"`
	IsEnabled      bool    `json:"is_enabled"`
}

EvaluatorMetrics is the JSON representation of aggregated evaluator statistics.

type EvaluatorSessionResponse added in v0.60.0

type EvaluatorSessionResponse struct {
	ID              string  `json:"id"`
	SessionID       string  `json:"session_id"`
	TemplateID      string  `json:"template_id,omitempty"`
	Reward          float64 `json:"reward"`
	SuccessScore    float64 `json:"success_score"`
	EfficiencyScore float64 `json:"efficiency_score"`
	MessageCount    int64   `json:"message_count"`
	EvaluatedAt     int64   `json:"evaluated_at"`
}

EvaluatorSessionResponse is the JSON representation of a evaluated session score.

type ExecRequest added in v0.60.0

type ExecRequest struct {
	Command   string `json:"command"`
	Dir       string `json:"dir,omitempty"`
	SessionID string `json:"session_id,omitempty"`
}

type ExecResponse added in v0.60.0

type ExecResponse struct {
	Output    string `json:"output"`
	Error     string `json:"error,omitempty"`
	ExitCode  int    `json:"exit_code"`
	SessionID string `json:"session_id,omitempty"`
	Shell     string `json:"shell,omitempty"`
	Dir       string `json:"dir,omitempty"`
}

type ExtensionsConfigResponse added in v0.70.0

type ExtensionsConfigResponse struct {
	Skills        config.SkillsConfig        `json:"skills"`
	SkillsCatalog config.SkillsCatalogConfig `json:"skillsCatalog"`
	Lua           config.LuaConfig           `json:"lua"`
}

ExtensionsConfigResponse groups Skills, SkillsCatalog, and Lua engine configuration.

type ExtensionsLicenseResponse added in v0.700.0

type ExtensionsLicenseResponse struct {
	// Gated is true when a license provider is compiled into this build. When
	// false, nothing here is gated and the rest of the fields are empty.
	Gated bool `json:"gated"`
	// Status is the provider's report. Absent when Gated is false.
	Status *extension.LicenseStatus `json:"status,omitempty"`
	// Unlicensed lists the extensions the gate refused, with the reason.
	Unlicensed []UnlicensedExtension `json:"unlicensed"`
}

ExtensionsLicenseResponse reports the licensing state of this build.

Licensed is false in two very different situations — no licensing machinery in this build, and licensing present but unhappy — so the two are separate fields. A UI that collapsed them would tell an open-source user their perfectly valid build is unlicensed.

type ExternalAccessStatus added in v0.700.0

type ExternalAccessStatus struct {
	// Enabled reports that the listener is bound to a non-loopback address.
	Enabled bool `json:"enabled"`
	// BindHost is the address currently bound.
	BindHost string `json:"bindHost"`
	// Port is the port the listener uses; it never changes when toggling.
	Port int `json:"port"`
	// CanToggle is false when the startup mode owns no HTTP surface, or when the
	// process was started already exposed (e.g. `pando serve --host 0.0.0.0`):
	// the bind is then the operator's choice and the UI must not take it away.
	CanToggle bool `json:"canToggle"`
	// BasicAuthReady reports that credentials exist and are enabled, which is
	// required before the agent may be exposed to the network.
	BasicAuthReady bool `json:"basicAuthReady"`
	// URLs lists the reachable addresses of this instance, for sharing.
	URLs []string `json:"urls"`
}

ExternalAccessStatus describes whether the running server is reachable from outside this machine, and whether the toggle may be flipped.

type InstalledSkillResponse added in v0.200.0

type InstalledSkillResponse struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
	Source      string `json:"source"`  // "owner/repo" from lock, or "(local)"
	Scope       string `json:"scope"`   // "global", "project", or "(local)"
	Active      bool   `json:"active"`  // loaded in SkillManager
	SkillID     string `json:"skillId"` // from lock, may be empty
}

InstalledSkillResponse represents a skill installed on disk.

type LSPConfigItem added in v0.70.0

type LSPConfigItem struct {
	Language  string   `json:"language"`
	Disabled  bool     `json:"disabled"`
	Command   string   `json:"command"`
	Args      []string `json:"args"`
	Languages []string `json:"languages"`
	// Filenames are base names handled regardless of extension (Dockerfile).
	Filenames []string `json:"filenames,omitempty"`
	Autostart bool     `json:"autostart"`
}

LSPConfigItem is the JSON representation of a single LSP configuration entry.

type LogEntry added in v0.60.0

type LogEntry struct {
	ID        string `json:"id"`
	Timestamp string `json:"timestamp"`
	Level     string `json:"level"`
	Source    string `json:"source"`
	Message   string `json:"message"`
	Details   string `json:"details,omitempty"`
}

LogEntry is the JSON representation of a log message returned by the API.

type MCPServerAuthItem added in v0.631.1

type MCPServerAuthItem struct {
	Type        string              `json:"type,omitempty"`
	Token       string              `json:"token,omitempty"` // write-only
	HasToken    bool                `json:"hasToken"`
	Username    string              `json:"username,omitempty"`
	Password    string              `json:"password,omitempty"` // write-only
	HasPassword bool                `json:"hasPassword"`
	HeaderName  string              `json:"headerName,omitempty"`
	OAuth       *MCPServerOAuthItem `json:"oauth,omitempty"`
}

MCPServerAuthItem is the JSON representation of config.MCPAuth. Token and Password are write-only (accepted on PUT, never returned on GET); the GET path instead reports HasToken/HasPassword. An empty Token/Password/ OAuth.ClientSecret on a PUT request means "leave the stored secret unchanged", so the WebUI never needs to round-trip a decrypted value.

type MCPServerAuthStatusItem added in v0.631.1

type MCPServerAuthStatusItem struct {
	Type                  string     `json:"type"`
	HasTokens             bool       `json:"hasTokens"`
	Expired               bool       `json:"expired"`
	ExpiresAt             *time.Time `json:"expiresAt,omitempty"`
	ClientID              string     `json:"clientID,omitempty"`
	DynamicallyRegistered bool       `json:"dynamicallyRegistered"`
}

MCPServerAuthStatusItem is the JSON representation of mcpauth.StatusInfo, computed live from the on-disk credential store — never from the config file — so it always reflects the current login state.

type MCPServerConfigItem added in v0.70.0

type MCPServerConfigItem struct {
	Name    string            `json:"name"`
	Command string            `json:"command"`
	Args    []string          `json:"args"`
	Env     []string          `json:"env"`
	Type    config.MCPType    `json:"type"`
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
	Running bool              `json:"running"`
	Tools   []MCPToolInfo     `json:"tools"`
	// Auth describes the authentication mechanism configured for this server.
	// Secret fields (Token, Password, OAuth.ClientSecret) are write-only: GET
	// responses never populate them, only the corresponding HasXxx booleans.
	Auth *MCPServerAuthItem `json:"auth,omitempty"`
	// AuthStatus is a computed, read-only snapshot of the current OAuth state
	// (populated only for Auth.Type == "oauth"); nil for other auth types.
	AuthStatus *MCPServerAuthStatusItem `json:"authStatus,omitempty"`
}

MCPServerConfigItem is the JSON representation of a single MCP server entry.

type MCPServerOAuthItem added in v0.631.1

type MCPServerOAuthItem struct {
	ClientID              string   `json:"clientID,omitempty"`
	ClientSecret          string   `json:"clientSecret,omitempty"` // write-only; empty means "keep existing"
	HasClientSecret       bool     `json:"hasClientSecret"`
	Scopes                []string `json:"scopes,omitempty"`
	RedirectURI           string   `json:"redirectURI,omitempty"`
	CallbackPort          int      `json:"callbackPort,omitempty"`
	AuthServerMetadataURL string   `json:"authServerMetadataURL,omitempty"`
}

MCPServerOAuthItem is the JSON representation of config.MCPOAuthConfig. ClientSecret is write-only (accepted on PUT, never returned on GET); the GET path instead reports HasClientSecret.

type MCPToolInfo added in v0.100.0

type MCPToolInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

MCPToolInfo is a lightweight tool descriptor returned alongside server config.

type ModelInfo added in v0.60.0

type ModelInfo struct {
	ID                      string   `json:"id"`
	Name                    string   `json:"name"`
	Provider                string   `json:"provider"`
	AccountID               string   `json:"accountId,omitempty"`
	Description             string   `json:"description"`
	Badges                  []string `json:"badges"`
	CanReason               bool     `json:"canReason"`
	SupportsReasoningEffort bool     `json:"supportsReasoningEffort"`
	SupportsAttachments     bool     `json:"supportsAttachments"`
	ContextWindow           int64    `json:"contextWindow,omitempty"`
	MaxOutputTokens         int64    `json:"maxOutputTokens,omitempty"`
	CostPer1MIn             float64  `json:"costPer1MIn,omitempty"`
	CostPer1MOut            float64  `json:"costPer1MOut,omitempty"`
	Knowledge               string   `json:"knowledge,omitempty"`
	ReleaseDate             string   `json:"releaseDate,omitempty"`
}

ModelInfo describes a model available for selection. The pricing and limit fields are populated from the provider's listing API when it reports them and from the models.dev catalog otherwise; both are absent (zero) when neither source knows the model, and the UI must render that as "unknown", not free.

type ProviderConfigItem added in v0.70.0

type ProviderConfigItem struct {
	Name     string `json:"name"`
	APIKey   string `json:"apiKey"` // masked in GET responses
	BaseURL  string `json:"baseUrl"`
	Disabled bool   `json:"disabled"`
	UseOAuth bool   `json:"useOAuth"`
}

ProviderConfigItem is the JSON representation of a provider configuration.

type ProviderConfigUpdateRequest added in v0.70.0

type ProviderConfigUpdateRequest struct {
	Providers []ProviderConfigItem `json:"providers"`
}

ProviderConfigUpdateRequest is the body for PUT /api/v1/config/providers. APIKey is only applied if non-empty.

type ProviderStatus added in v0.60.0

type ProviderStatus struct {
	Name      string `json:"name"`
	Enabled   bool   `json:"enabled"`
	HasAPIKey bool   `json:"has_api_key"`
	BaseURL   string `json:"base_url,omitempty"`
	UseOAuth  bool   `json:"use_oauth,omitempty"`
}

ProviderStatus describes a configured provider and whether it has an API key set.

type ProviderTypeInfo added in v0.254.0

type ProviderTypeInfo struct {
	Type                 string `json:"type"`
	DisplayName          string `json:"displayName"`
	RequiresAPIKey       bool   `json:"requiresAPIKey"`
	RequiresBaseURL      bool   `json:"requiresBaseUrl"`
	SupportsOAuth        bool   `json:"supportsOAuth"`
	SupportsExtraHeaders bool   `json:"supportsExtraHeaders"`
}

ProviderTypeInfo describes a supported provider type and its requirements.

type Server

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

func NewServer

func NewServer(ctx context.Context, cfg ServerConfig) (*Server, error)

func (*Server) BindHost added in v0.700.0

func (s *Server) BindHost() string

BindHost returns the host the server is currently listening on. It falls back to the configured host so a Server built without NewServer (tests) still reports the right bind.

func (*Server) GetToken

func (s *Server) GetToken() string

func (*Server) InitialHost added in v0.700.0

func (s *Server) InitialHost() string

InitialHost returns the host the process was started with.

func (*Server) InjectRuntimeConfig added in v0.230.0

func (s *Server) InjectRuntimeConfig(html []byte) []byte

func (*Server) IsTLS added in v0.302.0

func (s *Server) IsTLS() bool

IsTLS reports whether the server is configured to use TLS.

func (*Server) PandoApp added in v0.303.0

func (s *Server) PandoApp() *app.App

PandoApp returns the underlying app.App instance. This is used by serve/app/desktop commands to set up the IPC bus after the server is created.

func (*Server) Rebind added in v0.700.0

func (s *Server) Rebind(host string) error

Rebind moves the listener to another host without dropping the process. The old listener must be closed before the new one is bound: 0.0.0.0 and 127.0.0.1 collide on the same port. On failure the previous host is restored when it can still be bound, and the error is returned either way.

func (*Server) Shutdown

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

func (*Server) Start

func (s *Server) Start() error

Start binds the listener and serves until shutdown. The listener can be swapped underneath the loop by SetExternalAccess, which closes the current one and hands over a replacement bound to a different host; Serve returning because of that swap is not an error.

type ServerConfig

type ServerConfig struct {
	Host    string
	Port    int
	Version string
	DB      *sql.DB
	// Querier overrides the db.Querier passed to app.New. When non-nil it is
	// used instead of db.New(cfg.DB). Secondary instances supply a DBProxy here
	// so all writes are forwarded to the primary via ZMQ RPC.
	Querier     db.Querier
	CWD         string
	StaticFS    fs.FS
	OpenUI      bool
	UIBaseURL   string
	TLSCertFile string
	TLSKeyFile  string
	StartupMode string

	// IPC identity fields populated by Bootstrap so the /api/ipc/status
	// endpoint can report them without re-reading the lock file.
	InstanceID string
	Role       string
	PubPort    int
	RPCPort    int
}

type ServicesConfigResponse added in v0.70.0

type ServicesConfigResponse struct {
	Mesnada      config.MesnadaConfig      `json:"mesnada"`
	Remembrances config.RemembrancesConfig `json:"remembrances"`
	Snapshots    config.SnapshotsConfig    `json:"snapshots"`
	Server       config.APIServerConfig    `json:"server"`
}

ServicesConfigResponse groups Mesnada, Remembrances, Snapshots, and API Server configuration.

type SettingsResponse added in v0.60.0

type SettingsResponse struct {
	HomeDirectory    string `json:"home_directory"`
	WorkingDirectory string `json:"working_directory"`
	DefaultModel     string `json:"default_model"`
	DefaultProvider  string `json:"default_provider"`
	Theme            string `json:"theme"`
	Debug            bool   `json:"debug"`
	LogFile          string `json:"log_file,omitempty"`
	AutoCompact      bool   `json:"auto_compact"`
	SkillsEnabled    bool   `json:"skills_enabled"`
	DataDirectory    string `json:"data_directory"`
	ShowHiddenFiles  bool   `json:"show_hidden_files"`
	NerdFonts        bool   `json:"nerd_fonts"`
	LLMCacheEnabled  bool   `json:"llm_cache_enabled"`
	// ModelsDevEnabled controls the models.dev catalog that completes model
	// pricing/limits the providers do not report.
	ModelsDevEnabled bool `json:"models_dev_enabled"`
	// ImageAutoResize toggles the image resize/recompress pipeline before send.
	ImageAutoResize bool `json:"image_auto_resize"`
	// ImageUseFilesAPI opts into the Anthropic beta Messages API + Files API
	// (uploads images once, references by file_id across turns).
	ImageUseFilesAPI bool   `json:"image_use_files_api"`
	EvaluatorEnabled bool   `json:"evaluator_enabled"`
	JudgeModel       string `json:"judge_model"`
	// OutputFilterEnabled is the inverse of Bash.OutputFilterDisabled: RTK-style
	// command-output compression. True means compression is on (the default).
	OutputFilterEnabled bool `json:"output_filter_enabled"`
	// CavemanDefaultMode is the global output-brevity default ("" = off, or
	// lite|full|ultra). Sessions that ran /caveman keep their own choice.
	CavemanDefaultMode string `json:"caveman_default_mode"`

	ToolDiscoveryEnabled        bool   `json:"tool_discovery_enabled"`
	ToolDiscoveryMode           string `json:"tool_discovery_mode"`
	ToolDiscoveryMaxDirectTools int    `json:"tool_discovery_max_direct_tools"`
	ToolDiscoverySearchLimit    int    `json:"tool_discovery_search_limit"`

	// Delegation (mesnada delegated-task conclusions + agent-loop resurrection).
	DelegationEnabled                  bool   `json:"delegation_enabled"`
	DelegationInjectIntoLiveLoop       bool   `json:"delegation_inject_into_live_loop"`
	DelegationResurrectIdleLoop        bool   `json:"delegation_resurrect_idle_loop"`
	DelegationSynthesizeFallback       bool   `json:"delegation_synthesize_fallback"`
	DelegationMaxResurrections         int    `json:"delegation_max_resurrections"`
	DelegationMaxDepth                 int    `json:"delegation_max_depth"`
	DelegationMaxConcurrent            int    `json:"delegation_max_concurrent"`
	DelegationResurrectionTimeout      string `json:"delegation_resurrection_timeout"`
	DelegationReuseWarmInstances       bool   `json:"delegation_reuse_warm_instances"`
	DelegationAutoStartWarm            bool   `json:"delegation_auto_start_warm"`
	DelegationWarmIdleTimeout          string `json:"delegation_warm_idle_timeout"`
	DelegationWarmQueueDepth           int    `json:"delegation_warm_queue_depth"`
	DelegationAllowExternalWarmTargets bool   `json:"delegation_allow_external_warm_targets"`
	DelegationAcceptDelegations        bool   `json:"delegation_accept_delegations"`
	// Integrity gate + anti-thrash breaker. Exposed as positive "enabled" flags
	// for the UI even though the config stores them inverted (…Disabled).
	DelegationConclusionGate      bool   `json:"delegation_conclusion_gate"`
	DelegationBreaker             bool   `json:"delegation_breaker"`
	DelegationMaxTaskRetries      int    `json:"delegation_max_task_retries"`
	DelegationRateLimitCooldown   string `json:"delegation_rate_limit_cooldown"`
	DelegationRecentSuccessWindow string `json:"delegation_recent_success_window"`
	// Durable delegation event log, also exposed as a positive flag.
	DelegationEventLog           bool `json:"delegation_event_log"`
	DelegationEventLogMaxEntries int  `json:"delegation_event_log_max_entries"`
	// Claim-lease dispatcher (orchestrator scheduling).
	OrchestratorMaxParallel      int    `json:"orchestrator_max_parallel"`
	OrchestratorMaxPerEngine     int    `json:"orchestrator_max_per_engine"`
	OrchestratorClaimTTL         string `json:"orchestrator_claim_ttl"`
	OrchestratorDispatchInterval string `json:"orchestrator_dispatch_interval"`
}

SettingsResponse is the JSON representation of current application settings.

type SettingsUpdateRequest added in v0.60.0

type SettingsUpdateRequest struct {
	DefaultModel        *string `json:"default_model,omitempty"`
	DefaultProvider     *string `json:"default_provider,omitempty"`
	Theme               *string `json:"theme,omitempty"`
	Debug               *bool   `json:"debug,omitempty"`
	AutoCompact         *bool   `json:"auto_compact,omitempty"`
	SkillsEnabled       *bool   `json:"skills_enabled,omitempty"`
	ShowHiddenFiles     *bool   `json:"show_hidden_files,omitempty"`
	NerdFonts           *bool   `json:"nerd_fonts,omitempty"`
	LLMCacheEnabled     *bool   `json:"llm_cache_enabled,omitempty"`
	ModelsDevEnabled    *bool   `json:"models_dev_enabled,omitempty"`
	ImageAutoResize     *bool   `json:"image_auto_resize,omitempty"`
	ImageUseFilesAPI    *bool   `json:"image_use_files_api,omitempty"`
	EvaluatorEnabled    *bool   `json:"evaluator_enabled,omitempty"`
	JudgeModel          *string `json:"judge_model,omitempty"`
	OutputFilterEnabled *bool   `json:"output_filter_enabled,omitempty"`
	CavemanDefaultMode  *string `json:"caveman_default_mode,omitempty"`

	ToolDiscoveryEnabled        *bool   `json:"tool_discovery_enabled,omitempty"`
	ToolDiscoveryMode           *string `json:"tool_discovery_mode,omitempty"`
	ToolDiscoveryMaxDirectTools *int    `json:"tool_discovery_max_direct_tools,omitempty"`
	ToolDiscoverySearchLimit    *int    `json:"tool_discovery_search_limit,omitempty"`

	DelegationEnabled                  *bool   `json:"delegation_enabled,omitempty"`
	DelegationInjectIntoLiveLoop       *bool   `json:"delegation_inject_into_live_loop,omitempty"`
	DelegationResurrectIdleLoop        *bool   `json:"delegation_resurrect_idle_loop,omitempty"`
	DelegationSynthesizeFallback       *bool   `json:"delegation_synthesize_fallback,omitempty"`
	DelegationMaxResurrections         *int    `json:"delegation_max_resurrections,omitempty"`
	DelegationMaxDepth                 *int    `json:"delegation_max_depth,omitempty"`
	DelegationMaxConcurrent            *int    `json:"delegation_max_concurrent,omitempty"`
	DelegationResurrectionTimeout      *string `json:"delegation_resurrection_timeout,omitempty"`
	DelegationReuseWarmInstances       *bool   `json:"delegation_reuse_warm_instances,omitempty"`
	DelegationAutoStartWarm            *bool   `json:"delegation_auto_start_warm,omitempty"`
	DelegationWarmIdleTimeout          *string `json:"delegation_warm_idle_timeout,omitempty"`
	DelegationWarmQueueDepth           *int    `json:"delegation_warm_queue_depth,omitempty"`
	DelegationAllowExternalWarmTargets *bool   `json:"delegation_allow_external_warm_targets,omitempty"`
	DelegationAcceptDelegations        *bool   `json:"delegation_accept_delegations,omitempty"`
	DelegationConclusionGate           *bool   `json:"delegation_conclusion_gate,omitempty"`
	DelegationBreaker                  *bool   `json:"delegation_breaker,omitempty"`
	DelegationMaxTaskRetries           *int    `json:"delegation_max_task_retries,omitempty"`
	DelegationRateLimitCooldown        *string `json:"delegation_rate_limit_cooldown,omitempty"`
	DelegationRecentSuccessWindow      *string `json:"delegation_recent_success_window,omitempty"`
	DelegationEventLog                 *bool   `json:"delegation_event_log,omitempty"`
	DelegationEventLogMaxEntries       *int    `json:"delegation_event_log_max_entries,omitempty"`

	OrchestratorMaxParallel      *int    `json:"orchestrator_max_parallel,omitempty"`
	OrchestratorMaxPerEngine     *int    `json:"orchestrator_max_per_engine,omitempty"`
	OrchestratorClaimTTL         *string `json:"orchestrator_claim_ttl,omitempty"`
	OrchestratorDispatchInterval *string `json:"orchestrator_dispatch_interval,omitempty"`
}

SettingsUpdateRequest contains the fields that can be updated via PUT /api/v1/settings.

type SkillResponse added in v0.60.0

type SkillResponse struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	TaskType    string  `json:"task_type"`
	Confidence  float64 `json:"confidence"`
	Uses        int64   `json:"uses"`
}

SkillResponse is the JSON representation of a skill library entry.

type SnapshotResponse added in v0.60.0

type SnapshotResponse struct {
	ID         string    `json:"id"`
	ShortID    string    `json:"short_id"`
	Name       string    `json:"name"`
	SessionID  string    `json:"session_id"`
	ParentID   string    `json:"parent_id,omitempty"`
	Type       string    `json:"type"`
	Status     string    `json:"status"`
	CreatedAt  time.Time `json:"created_at"`
	Size       int64     `json:"size"`
	FilesCount int       `json:"files_count"`
	TreeSize   int64     `json:"tree_size"`
	TreeFiles  int       `json:"tree_files"`
	IsBaseline bool      `json:"is_baseline"`
}

SnapshotResponse is the JSON representation of a commit for the web-UI. Field names preserve backward compatibility with the old snapshot API.

type SteerRequest added in v0.502.2

type SteerRequest struct {
	Prompt string `json:"prompt"`
}

SteerRequest is the body accepted by POST /api/v1/sessions/{id}/steer.

type TaskResponse added in v0.60.0

type TaskResponse struct {
	ID          string                    `json:"id"`
	Name        string                    `json:"name"`
	Prompt      string                    `json:"prompt"`
	Agent       string                    `json:"agent"`
	Model       string                    `json:"model"`
	Persona     string                    `json:"persona,omitempty"`
	Status      string                    `json:"status"`
	Progress    int                       `json:"progress"`
	Tokens      int                       `json:"tokens"`
	Output      string                    `json:"output,omitempty"`
	CurrentTool string                    `json:"current_tool,omitempty"`
	ToolCalls   []*mesnadaModels.ToolCall `json:"tool_calls,omitempty"`
	CreatedAt   time.Time                 `json:"created_at"`
	UpdatedAt   time.Time                 `json:"updated_at"`
}

TaskResponse is the JSON representation of an orchestrator task returned by the API.

type TemplateResponse added in v0.60.0

type TemplateResponse struct {
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	Section   string  `json:"section"`
	UCBScore  float64 `json:"ucb_score"`
	WinRate   float64 `json:"win_rate"`
	Uses      int64   `json:"uses"`
	IsDefault bool    `json:"is_default"`
}

TemplateResponse is the JSON representation of a prompt template with UCB stats.

type TokenOptimizationConfigResponse added in v0.608.1

type TokenOptimizationConfigResponse struct {
	config.TokenOptimizationConfig
	OutputFilterEnabled bool     `json:"outputFilterEnabled"`
	OutputFilterPaths   []string `json:"outputFilterPaths,omitempty"`
}

TokenOptimizationConfigResponse is the DTO for the Token Optimization settings section. It carries the dedicated TokenOptimization config plus the existing RTK shell-output filter knobs from Bash, which the section *surfaces* (the fields are not moved out of BashConfig). OutputFilterEnabled is the inverse of Bash.OutputFilterDisabled, presented as a friendly "enable compression" toggle.

type ToolsConfigResponse added in v0.70.0

type ToolsConfigResponse struct {
	FetchEnabled   bool `json:"fetchEnabled"`
	FetchMaxSizeMB int  `json:"fetchMaxSizeMB"`

	GoogleSearchEnabled  bool   `json:"googleSearchEnabled"`
	GoogleAPIKey         string `json:"googleApiKey"` // masked
	GoogleSearchEngineID string `json:"googleSearchEngineId"`

	BraveSearchEnabled bool   `json:"braveSearchEnabled"`
	BraveAPIKey        string `json:"braveApiKey"` // masked

	PerplexitySearchEnabled bool   `json:"perplexitySearchEnabled"`
	PerplexityAPIKey        string `json:"perplexityApiKey"` // masked

	ExaSearchEnabled bool   `json:"exaSearchEnabled"`
	ExaAPIKey        string `json:"exaApiKey"` // masked

	SourcegraphEnabled bool   `json:"sourcegraphEnabled"`
	SourcegraphToken   string `json:"sourcegraphToken"` // masked

	Context7Enabled bool `json:"context7Enabled"`

	BrowserType        string `json:"browserType"`
	BrowserExecutable  string `json:"browserExecutable"`
	BrowserEnabled     bool   `json:"browserEnabled"`
	BrowserHeadless    bool   `json:"browserHeadless"`
	BrowserTimeout     int    `json:"browserTimeout"`
	BrowserUserDataDir string `json:"browserUserDataDir"`
	BrowserMaxSessions int    `json:"browserMaxSessions"`

	DesktopEnabled            bool     `json:"desktopEnabled"`
	DesktopBackend            string   `json:"desktopBackend"`
	DesktopAllowPhysicalInput bool     `json:"desktopAllowPhysicalInput"`
	DesktopMaxNodes           int      `json:"desktopMaxNodes"`
	DesktopDefaultDepth       int      `json:"desktopDefaultDepth"`
	DesktopActionTimeout      int      `json:"desktopActionTimeout"`
	DesktopSnapshotTTL        int      `json:"desktopSnapshotTTL"`
	DesktopScreenshotScale    float64  `json:"desktopScreenshotScale"`
	DesktopAllowedApps        []string `json:"desktopAllowedApps"`
	DesktopDeniedApps         []string `json:"desktopDeniedApps"`
}

ToolsConfigResponse is the GET response for /api/v1/config/tools. API keys are masked.

type UIManifestResponse added in v0.700.0

type UIManifestResponse struct {
	// Panels is never nil in the response, so the shell can iterate without a
	// null check on the standard build, where it is simply empty.
	Panels []extensions.Panel `json:"panels"`
}

UIManifestResponse is what the WebUI shell fetches at boot to discover the panels this build contributes.

Not to be confused with /api/v1/config/extensions, which is the settings screen for skills and Lua hooks. This one describes compiled-in extension modules (pkg/extension).

type UnlicensedExtension added in v0.700.0

type UnlicensedExtension struct {
	ID     string `json:"id"`
	Name   string `json:"name,omitempty"`
	Reason string `json:"reason"`
}

UnlicensedExtension is one extension the gate refused to load.

type UpdateCronJobRequest added in v0.244.0

type UpdateCronJobRequest struct {
	Enabled  *bool    `json:"enabled,omitempty"`
	Prompt   *string  `json:"prompt,omitempty"`
	Schedule *string  `json:"schedule,omitempty"`
	Engine   *string  `json:"engine,omitempty"`
	Model    *string  `json:"model,omitempty"`
	WorkDir  *string  `json:"workDir,omitempty"`
	Tags     []string `json:"tags,omitempty"`
	Timeout  *string  `json:"timeout,omitempty"`
}

UpdateCronJobRequest is the body for PUT /api/v1/cronjobs/{name}.

Jump to

Keyboard shortcuts

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