commands

package
v1.0.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Root string `help:"Agent root directory (FHS layout)" default:"/"`

	// Provider/model wiring is operator-controlled, kept on the CLI
	// surface so dev invocations of the runtime binary outside the
	// daemon can still run a one-shot chat. Inside the daemon
	// they're set from agent.yaml + the provider catalog.
	Model   string `help:"Model identifier (e.g. anthropic/claude-sonnet-4-20250514)" optional:""`
	Name    string `help:"Agent name" default:"agent"`
	APIKey  string `help:"API key for the provider" optional:""`
	APIBase string `help:"Custom API base URL for the provider" optional:""`
	Addr    string `help:"gRPC listen address" default:":8080"`

	// Runtime tunables — never CLI flags. Populated from agent.yaml's
	// `configs:` block by loadAgentConfig. Plain Go fields with
	// `kong:"-"` so Kong leaves them untouched.
	MaxTokens     int               `kong:"-"`
	MaxIterations int               `kong:"-"`
	Memory        MemoryServeConfig `kong:"-"`
	Notes         NotesServeConfig  `kong:"-"`

	// Provider sampling knobs. Pointer types so "unset" stays
	// distinguishable from a deliberately-zero value (temperature: 0
	// means deterministic, not "use the default"). Forwarded to
	// fantasy only when non-nil.
	Temperature      *float64 `kong:"-"`
	TopP             *float64 `kong:"-"`
	TopK             *int64   `kong:"-"`
	PresencePenalty  *float64 `kong:"-"`
	FrequencyPenalty *float64 `kong:"-"`

	// Persisted-config inputs from agent.yaml: tools list and the
	// ordered context files. Also never CLI flags.
	Tools   []ToolConfig        `kong:"-" yaml:"tools,omitempty" json:"tools,omitempty"`
	Context []agent.ContextFile `kong:"-" yaml:"context,omitempty" json:"context,omitempty"`
}

type MemoryServeConfig

type MemoryServeConfig struct {
	Strategy    string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
	MaxMessages int    `json:"max_messages,omitempty" yaml:"max_messages,omitempty"`
	MaxTokens   int    `json:"max_tokens,omitempty" yaml:"max_tokens,omitempty"`
}

MemoryServeConfig holds the compactor's tunables. Populated from agent.yaml's configs: block via loadAgentConfig — kebab-case keys (`memory-strategy`, `memory-max-messages`, `memory-max-tokens`) match the Agentfile's CONFIG directive shape 1:1.

type NotesServeConfig

type NotesServeConfig struct {
	MaxBytesPer   int    `json:"max_bytes_per,omitempty" yaml:"max_bytes_per,omitempty"`
	MaxCount      int    `json:"max_count,omitempty"      yaml:"max_count,omitempty"`
	PromptSection string `json:"prompt_section,omitempty" yaml:"prompt_section,omitempty"`
}

NotesServeConfig holds the notes-tool quotas + the prompt-section placement switch. Like MemoryServeConfig, populated from agent.yaml's configs: block — keys `notes-max-bytes-per`, `notes-max-count`, `notes-prompt-section`.

type Prompt

type Prompt struct {
	AgentConfig `embed:""`
	Message     string `arg:"" help:"Message to send to the agent"`
}

func (*Prompt) Run

func (p *Prompt) Run(
	ctx context.Context,
	common *cmd.Commons,
	sqlite *cmd.SQLite,
) error

type Serve

type Serve struct {
	AgentConfig `embed:""`
}

func (*Serve) Run

func (s *Serve) Run(
	ctx context.Context,
	common *cmd.Commons,
	sqlite *cmd.SQLite,
) error

type ToolConfig

type ToolConfig struct {
	Name        string   `json:"name" yaml:"name"`
	Description string   `json:"description" yaml:"description"`
	Binary      string   `json:"binary" yaml:"binary"`
	Args        []string `json:"args,omitempty" yaml:"args,omitempty"`
	Usage       string   `json:"usage,omitempty" yaml:"usage,omitempty"`
}

ToolConfig mirrors a tools[] entry in the agent.yaml shape produced by the daemon's materialise. Usage is a path (absolute from agent root) to the USAGE.md the loader reads when assembling the model-facing tool description.

Jump to

Keyboard shortcuts

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