agent

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package agent runs (agent) task bodies by driving an installed agent CLI (claude/codex/copilot/…) behind a vendor-neutral Provider interface (Principle VII / FR-030). The CLI owns its own authentication; no API keys are ever read from the Runefile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError

type AuthError struct {
	Name string
	Err  error
}

AuthError reports that the agent CLI ran but failed, commonly because it is not authenticated.

func (*AuthError) Error

func (e *AuthError) Error() string

func (*AuthError) Unwrap

func (e *AuthError) Unwrap() error

type CLIProvider

type CLIProvider struct{}

CLIProvider drives an installed agent CLI. It is the v1 concrete Provider.

func (CLIProvider) Run

func (CLIProvider) Run(ctx context.Context, prompt string, opts Options) (string, error)

Run resolves the configured agent CLI, hands it the prompt and (if present) the in-process MCP endpoint so it can call back into allowed tasks, and returns its final stdout as the task output.

type NotConfiguredError

type NotConfiguredError struct{}

NotConfiguredError reports that no agent command is configured (never invent credentials, FR-027).

func (*NotConfiguredError) Error

func (e *NotConfiguredError) Error() string

type NotInstalledError

type NotInstalledError struct{ Name string }

NotInstalledError reports that the configured agent CLI is not on PATH.

func (*NotInstalledError) Error

func (e *NotInstalledError) Error() string

type Options

type Options struct {
	AgentCmd     []string // e.g. ["claude", "-p"]; the prompt is appended
	AllowedTasks []string // tasks the agent may call back into (non-destructive by default)
	MCPURL       string   // in-process MCP endpoint the agent can call (if any)
	MCPToken     string   // bearer token for the MCP endpoint
	Dir          string
	Env          []string
	Stdin        io.Reader
	Stderr       io.Writer // agent progress/diagnostics stream here
}

Options configures an agent run.

type Provider

type Provider interface {
	Run(ctx context.Context, prompt string, opts Options) (finalText string, err error)
}

Provider runs a prompt and returns the agent's final text output. The interface stays vendor-neutral so a direct hosted-API provider can be added later without changing core.

Jump to

Keyboard shortcuts

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