api

package
v0.60.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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 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 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 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.

Jump to

Keyboard shortcuts

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