app

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package app holds bootstrap wiring shared across CLI subcommands — building the provider registry, run manager, pricing table, and gateway from config. It contains no enforcement logic; that lives in the governor and related internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRegistry

func BuildRegistry(cfg *config.Config) (*provider.Registry, error)

BuildRegistry constructs the provider registry from config. Anthropic and OpenAI are implemented natively; Bedrock/Ollama are stubs config can reference. The default provider must be usable.

func NewLogger

func NewLogger() *slog.Logger

NewLogger returns the daemon's structured logger writing to stderr.

func OpenStore

func OpenStore(cfg *config.Config, log *slog.Logger) (storage.Store, error)

OpenStore creates the data directory and opens the SQLite store (the file the user owns), running forward migrations on the way up.

Types

type Deps

type Deps struct {
	Config    *config.Config
	Log       *slog.Logger
	Providers *provider.Registry
	Pricing   *pricing.Table
	Runs      *runs.Manager
	Gateway   *gateway.Gateway
	Store     storage.Store
	Tracer    *otel.Tracer
	Approvals *approval.Gate
	MCP       *mcp.Gateway // nil when no upstream is configured
	Memory    *memory.Reader
}

Deps holds the constructed dependency graph for the daemon and CLI.

func Build

func Build(cfg *config.Config) (*Deps, error)

Build constructs the full dependency graph from config, opening and migrating the durable store.

func (*Deps) Close

func (d *Deps) Close() error

Close releases dependencies that hold resources (the tracer's buffered spans, then the store).

Jump to

Keyboard shortcuts

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