api

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfigItem added in v0.70.0

type AgentConfigItem struct {
	Name                 string         `json:"name"`
	Model                models.ModelID `json:"model"`
	MaxTokens            int64          `json:"maxTokens"`
	ReasoningEffort      string         `json:"reasoningEffort"`
	AutoCompact          bool           `json:"autoCompact"`
	AutoCompactThreshold float64        `json:"autoCompactThreshold"`
}

AgentConfigItem is the JSON representation of a single agent configuration.

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 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 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"`
}

ExecRequest is the body for POST /api/v1/terminal/exec.

type ExecResponse added in v0.60.0

type ExecResponse struct {
	Output   string `json:"output"`
	Error    string `json:"error,omitempty"`
	ExitCode int    `json:"exit_code"`
}

ExecResponse is the JSON result returned after executing a command.

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 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"`
}

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 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"`
	Tools   []MCPToolInfo     `json:"tools"`
}

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

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"`
	Description string   `json:"description"`
	Badges      []string `json:"badges"`
}

ModelInfo describes a model available for selection.

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 Server

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

func NewServer

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

func (*Server) GetToken

func (s *Server) GetToken() string

func (*Server) Shutdown

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

func (*Server) Start

func (s *Server) Start() error

type ServerConfig

type ServerConfig struct {
	Host    string
	Port    int
	Version string
	DB      *sql.DB
	CWD     string
}

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"`
}

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"`
}

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"`
	Name       string    `json:"name"`
	SessionID  string    `json:"session_id"`
	Type       string    `json:"type"`
	Status     string    `json:"status"`
	WorkingDir string    `json:"working_dir"`
	CreatedAt  time.Time `json:"created_at"`
	Size       int64     `json:"size"`
	FilesCount int       `json:"files_count"`
}

SnapshotResponse is the JSON representation of a snapshot for the web-UI.

type TaskResponse added in v0.60.0

type TaskResponse struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Agent     string    `json:"agent"`
	Model     string    `json:"model"`
	Status    string    `json:"status"`
	Progress  int       `json:"progress"`
	Tokens    int       `json:"tokens"`
	Output    string    `json:"output,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 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

	Context7Enabled bool `json:"context7Enabled"`

	BrowserEnabled     bool   `json:"browserEnabled"`
	BrowserHeadless    bool   `json:"browserHeadless"`
	BrowserTimeout     int    `json:"browserTimeout"`
	BrowserUserDataDir string `json:"browserUserDataDir"`
	BrowserMaxSessions int    `json:"browserMaxSessions"`
}

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

Jump to

Keyboard shortcuts

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