toolcatalog

package
v0.8.19 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package toolcatalog describes local CLI launch profiles without coupling them to terminal backends, provider APIs, credentials, or model selection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(request LaunchRequest) (agent.Spec, error)

Resolve creates an agent.Spec using exact argv supplied by the caller. A known profile may provide only its executable name; it never adds flags. The caller remains responsible for canonical agent.ValidateSpec validation in the context of its configuration directory and default backend.

Types

type Descriptor

type Descriptor struct {
	ID                 ProfileID
	Name               string
	Executables        []string
	DefaultAdapter     string
	RequiresExecutable bool
	MinimumArguments   int
	ArgumentPrefix     []string
}

Descriptor contains only non-sensitive launch metadata. A descriptor is not a claim that Relayer has a vendor-specific adapter for the named tool.

func Descriptors

func Descriptors() []Descriptor

Descriptors returns the built-in profiles in stable display order. The result and every mutable field are independent from the package catalogue.

func Lookup

func Lookup(id ProfileID) (Descriptor, bool)

Lookup returns an independent copy of the requested descriptor. IDs are matched case-insensitively after trimming surrounding whitespace.

type Detection

type Detection struct {
	Status       InstallStatus
	Executable   string
	Path         string
	Version      string
	VersionKnown bool
}

Detection is local installation metadata. Version is optional and is populated only by an explicitly injected, non-executing metadata source.

func Detect

func Detect(
	ctx context.Context,
	id ProfileID,
	executableOverride string,
	detector Detector,
) (Detection, error)

Detect resolves installation state for a profile. An explicit executable replaces the descriptor candidates. A profile with no candidate and no override is unknown rather than misleadingly reported as not installed.

type Detector

type Detector interface {
	Detect(context.Context, []string) (Detection, error)
}

Detector discovers one of a set of executable candidates without retaining or mutating the caller's slice.

func DefaultDetector

func DefaultDetector() Detector

DefaultDetector returns the passive production detector.

type InstallStatus

type InstallStatus string

InstallStatus describes only local executable discovery. It does not imply that a vendor-specific adapter or authentication is available.

const (
	InstallUnknown      InstallStatus = "unknown"
	InstallInstalled    InstallStatus = "installed"
	InstallNotInstalled InstallStatus = "not_installed"
)

type LaunchRequest

type LaunchRequest struct {
	ProfileID  ProfileID
	AgentID    string
	Name       string
	Executable string
	Args       []string
	Cwd        string
	Adapter    string
	Backend    string
}

LaunchRequest resolves one profile to Relayer's existing process contract. Args are literal argv entries. No provider, model, shell, environment, or credential fields are accepted or inferred by this package.

type LookPathFunc

type LookPathFunc func(string) (string, error)

LookPathFunc resolves an executable name without executing it.

type PathDetector

type PathDetector struct {
	LookPath      LookPathFunc
	VersionLookup VersionLookupFunc
}

PathDetector performs passive PATH discovery. A nil LookPath uses exec.LookPath. VersionLookup must itself be a trusted, non-executing metadata source; when omitted, version remains unknown.

func (PathDetector) Detect

func (detector PathDetector) Detect(ctx context.Context, candidates []string) (Detection, error)

Detect passively searches PATH in candidate order and never starts a child process. Unexpected lookup failures, including exec.ErrDot, are surfaced.

type ProfileID

type ProfileID string

ProfileID is the stable identifier of a declarative CLI launch profile.

const (
	Aider           ProfileID = "aider"
	ClaudeCode      ProfileID = "claude-code"
	CodexCLI        ProfileID = "codex-cli"
	GooseCLI        ProfileID = "goose"
	OpenInterpreter ProfileID = "open-interpreter"
	MimoCode        ProfileID = "mimo-code"
	Ollama          ProfileID = "ollama"
	Custom          ProfileID = "custom"
)

type VersionLookupFunc

type VersionLookupFunc func(string) (version string, ok bool)

VersionLookupFunc reads version metadata for an already resolved path. It is intentionally injected: toolcatalog never invokes an executable with a --version flag or any other command to obtain this value.

Jump to

Keyboard shortcuts

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