registry

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 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"
	FakeCodexCLIPathSettingKey       = "fake_codex_cli_path"
	CodexAPIKeySettingKey            = "codex_api_key"
	AgentRunnerIDSettingKey          = "agent_runner_id"
	KBDefaultAgentRunnerIDSettingKey = "kb_default_agent_runner_id"
	ModelSettingKey                  = "model"
	ModelsByAgentRunnerSettingKey    = "models_by_agent_runner"
)
View Source
const (
	EnvCursorCLIPath    = "AGENT_RUNNER_CURSOR_PATH"
	EnvCodexCLIPath     = "AGENT_RUNNER_CODEX_PATH"
	EnvOpencodeCLIPath  = "AGENT_RUNNER_OPENCODE_PATH"
	EnvFakeCodexCLIPath = "AGENT_RUNNER_FAKE_CODEX_PATH"
)

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 LoadEnvCLIPath added in v0.0.12

func LoadEnvCLIPath(envKey string) string

func ResolveConfiguredCLIPath

func ResolveConfiguredCLIPath(settingsPath, settingKey, envKey, 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 AgentRunner added in v0.0.10

type AgentRunner struct {
	ID    AgentRunnerID
	Name  string
	Agent Agent
}

type AgentRunnerID added in v0.0.12

type AgentRunnerID string
const (
	AgentRunnerCodex     AgentRunnerID = "codex"
	AgentRunnerOpencode  AgentRunnerID = "opencode"
	AgentRunnerCursor    AgentRunnerID = "cursor"
	AgentRunnerFakeCodex AgentRunnerID = "fake-codex"
)

type AgentRunnerInfo added in v0.0.10

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

type AgentRunnerRegistry added in v0.0.10

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

func NewAgentRunnerRegistry added in v0.0.10

func NewAgentRunnerRegistry(defaultID string, runners []AgentRunner) (*AgentRunnerRegistry, error)

func (*AgentRunnerRegistry) DefaultID added in v0.0.10

func (r *AgentRunnerRegistry) DefaultID() string

func (*AgentRunnerRegistry) List added in v0.0.10

func (*AgentRunnerRegistry) Resolve added in v0.0.10

func (r *AgentRunnerRegistry) Resolve(id string) (AgentRunner, 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"`
	AgentRunnerID          string            `json:"agent_runner_id,omitempty"`
	KBDefaultAgentRunnerID string            `json:"kb_default_agent_runner_id,omitempty"`
	CursorCLIPath          string            `json:"cursor_cli_path,omitempty"`
	CodexCLIPath           string            `json:"codex_cli_path,omitempty"`
	OpencodeCLIPath        string            `json:"opencode_cli_path,omitempty"`
	FakeCodexCLIPath       string            `json:"fake_codex_cli_path,omitempty"`
	CodexAPIKey            string            `json:"codex_api_key,omitempty"`
	DisableSubAgents       bool              `json:"disable_sub_agents,omitempty"`
	ModelsByAgentRunner    map[string]string `json:"models_by_agent_runner,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