registry

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CursorCLIPathSettingKey       = "cursor_cli_path"
	CodexCLIPathSettingKey        = "codex_cli_path"
	OpencodeCLIPathSettingKey     = "opencode_cli_path"
	CodexAPIKeySettingKey         = "codex_api_key"
	ProviderIDSettingKey          = "provider_id"
	KBDefaultProviderIDSettingKey = "kb_default_provider_id"
	ModelSettingKey               = "model"
	ModelsByProviderSettingKey    = "models_by_provider"
)

Variables

This section is empty.

Functions

func LoadConfiguredCLIPath

func LoadConfiguredCLIPath(settingsPath string, settingKey string) string

func LoadConfiguredStringMapSetting

func LoadConfiguredStringMapSetting(settingsPath string, settingKey string) map[string]string

func LoadConfiguredStringSetting

func LoadConfiguredStringSetting(settingsPath string, settingKey string) string

func ResolveConfiguredCLIPath

func ResolveConfiguredCLIPath(settingsPath string, settingKey string, defaultPath string, fallback func() (string, error)) (string, error)

Types

type Agent

type Agent interface {
	Ask(ctx context.Context, question string, opts *AskOptions, onDelta DeltaCallback) (fullAnswer string, err error)
	ListModels(ctx context.Context) ([]ModelInfo, error)
}

type AgentProvider

type AgentProvider struct {
	ID    string
	Name  string
	Agent Agent
}

type AgentProviderInfo

type AgentProviderInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type AgentProviderRegistry

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

func NewAgentProviderRegistry

func NewAgentProviderRegistry(defaultID string, providers []AgentProvider) (*AgentProviderRegistry, error)

func (*AgentProviderRegistry) DefaultID

func (r *AgentProviderRegistry) DefaultID() string

func (*AgentProviderRegistry) List

func (*AgentProviderRegistry) Resolve

func (r *AgentProviderRegistry) Resolve(id string) (AgentProvider, error)

type AskOptions

type AskOptions struct {
	Model            string
	RawLog           io.Writer
	Workspace        string
	AgentMode        bool
	DisableSubAgents bool
	SandboxMode      string
	OnToolCall       ToolCallCallback
}

type DeltaCallback

type DeltaCallback func(delta string)

type FileChange

type FileChange struct {
	Path string `json:"path"`
	Kind string `json:"kind,omitempty"`
}

type ModelInfo

type ModelInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Settings

type Settings struct {
	Model               string            `json:"model,omitempty"`
	AgentID             string            `json:"agent_id,omitempty"`
	ProviderID          string            `json:"provider_id,omitempty"`
	KBDefaultProviderID string            `json:"kb_default_provider_id,omitempty"`
	CursorCLIPath       string            `json:"cursor_cli_path,omitempty"`
	CodexCLIPath        string            `json:"codex_cli_path,omitempty"`
	OpencodeCLIPath     string            `json:"opencode_cli_path,omitempty"`
	CodexAPIKey         string            `json:"codex_api_key,omitempty"`
	DisableSubAgents    bool              `json:"disable_sub_agents,omitempty"`
	ModelsByProvider    map[string]string `json:"models_by_provider,omitempty"`
}

func LoadSettingsMap

func LoadSettingsMap(settingsPath string) Settings

type ToolCallCallback

type ToolCallCallback func(event ToolCallEvent)

type ToolCallEvent

type ToolCallEvent struct {
	Subtype        string       `json:"subtype"`
	CallID         string       `json:"call_id,omitempty"`
	ToolName       string       `json:"tool_name"`
	Summary        string       `json:"summary"`
	Kind           string       `json:"kind,omitempty"`
	Status         string       `json:"status,omitempty"`
	FileChanges    []FileChange `json:"file_changes,omitempty"`
	ReplaceSummary bool         `json:"replace_summary,omitempty"`
}

Jump to

Keyboard shortcuts

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