registry

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package registry maps config type names to implementations. It is the only package that knows the concrete agents and speech providers; adding one means adding a line here.

Index

Constants

View Source
const None = "none"

None disables a speech provider.

Variables

View Source
var Agents = map[string]agent.Factory{
	"acp":         acp.New,
	"claude-code": claudecode.New,
	"command":     command.New,
}

Agents are the agent adapters, by config type.

View Source
var Presets = []Preset{
	{
		Name:     "aider",
		Requires: []string{"aider"},
		Config: `type: command
command: [aider, --message, "{prompt}", --yes-always, --no-pretty, --no-stream]
model_args: [--model, "{model}"]
image_args: ["{path}"]
timeout: 30m`,
		Login: "aider",
	},
	{
		Name:     "claude-code",
		Requires: []string{"claude"},
		Config: `type: claude-code
command: claude
models: [opus, sonnet, haiku]`,
		Login: "claude",
	},
	{
		Name:     "codex",
		Requires: []string{"codex", "npx"},
		Config: `type: acp
command: [npx, -y, "@zed-industries/codex-acp"]`,
		Login: "codex login",
	},
	{Name: "copilot", Requires: []string{"copilot"}, Config: "type: acp\ncommand: [copilot, --acp, --stdio]", Login: "copilot"},
	{Name: "cursor", Requires: []string{"cursor-agent"}, Config: "type: acp\ncommand: [cursor-agent, acp]", Login: "cursor-agent login"},
	{Name: "gemini", Requires: []string{"gemini"}, Config: "type: acp\ncommand: [gemini, --acp]", Login: "gemini"},
	{Name: "goose", Requires: []string{"goose"}, Config: "type: acp\ncommand: [goose, acp]", Login: "goose configure"},
	{Name: "kiro", Requires: []string{"kiro-cli"}, Config: "type: acp\ncommand: [kiro-cli, acp]", Login: "kiro-cli login"},
	{Name: "opencode", Requires: []string{"opencode"}, Config: "type: acp\ncommand: [opencode, acp]", Login: "opencode auth login"},
}
View Source
var Speakers = map[string]tts.Factory{
	"command": tts.NewCommand,
	"http":    tts.NewHTTP,
	"say":     tts.NewSay,
}

Speakers are the text-to-speech providers, by config type.

View Source
var Transcribers = map[string]stt.Factory{
	"command":     stt.NewCommand,
	"http":        stt.NewHTTP,
	"whisper-cpp": stt.NewWhisperCpp,
}

Transcribers are the speech-to-text providers, by config type.

Functions

func Names

func Names[F any](m map[string]F) []string

Names returns the keys of a registry map, sorted.

func NewAgent

func NewAgent(name string, c config.Agent) (agent.Agent, error)

NewAgent builds the agent configured under name.

func NewSpeaker

func NewSpeaker(p config.Provider) (tts.Speaker, error)

NewSpeaker returns nil when voice replies are off.

func NewTranscriber

func NewTranscriber(p config.Provider) (stt.Transcriber, error)

NewTranscriber returns nil when transcription is off.

Types

type Preset

type Preset struct {
	Name     string
	Requires []string // executables that must be on PATH
	Config   string   // YAML body for the agent entry
	Login    string   // how to log in, shown by doctor
}

Preset is a known agent that `init` can detect and configure. Presets are data, sorted by name; none is preferred over another.

func FindPreset

func FindPreset(name string) (Preset, bool)

FindPreset returns the preset with the given name.

Jump to

Keyboard shortcuts

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