agent

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package agent invokes the user's own coding-agent CLI for one-shot prompted tasks — the inference seam behind features like lesson distillation. Seamark never holds credentials and never speaks a model API: it shells out to a CLI the user already has and has already authenticated, the same trust boundary as `gh` for review mining. An absent or failing CLI degrades to an error the caller surfaces as a note, never a broken feature.

The adapter layer keeps every caller agnostic: nothing outside this package knows which agent is configured. "claude" is the first preset; other agent CLIs arrive either as presets here or, today, through the custom argv escape hatch in the config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(cfg *Config) (name string, argv []string, err error)

Resolve maps the config to the exact argv it would run, erroring on an unknown preset or an empty custom command — but without requiring the binary on PATH, so the pre-flight disclosure works even when the CLI is missing. The returned name identifies the adapter for provenance.

Types

type Config

type Config struct {
	Agent struct {
		// CLI names a preset ("claude"). Ignored when Argv is set.
		CLI string `yaml:"cli"`
		// Argv is the escape hatch for any other agent: the exact
		// command to run, prompt delivered on stdin.
		Argv []string `yaml:"argv"`
	} `yaml:"agent"`
}

Config selects the agent CLI (`agent:` in .seamark/config.yaml — committed, like every seamark overlay, so a team shares one choice). An absent section means the claude preset.

func LoadConfig

func LoadConfig(root string) (*Config, error)

LoadConfig reads the agent section of <root>/.seamark/config.yaml. The file is shared with the indexing options; each package reads its own section. A missing file yields defaults; a malformed one is an error (the same contract as everywhere else: a typo'd config must not be silently ignored).

type Invoker

type Invoker interface {
	// Invoke sends prompt on the agent's stdin and returns its text
	// reply. The context bounds the run: a distillation batch is worth
	// minutes, not hours.
	Invoke(ctx context.Context, prompt string) (string, error)
	// Name identifies the adapter for provenance ("distilled by …").
	Name() string
}

Invoker runs one prompted task against the configured agent CLI.

func New

func New(cfg *Config) (Invoker, error)

New resolves the configured agent into an Invoker. It fails fast — unknown preset, empty custom argv, or a binary not on PATH — so the caller can say "distill unavailable: …" before any work is done.

Jump to

Keyboard shortcuts

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