app

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 18 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, OpenAI, Ollama, and AWS Bedrock are implemented natively. 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 opens the durable state backend, running forward migrations on the way up. SQLite (the zero-config file the user owns) is the default; setting RISKKERNEL_DATABASE_URL selects the opt-in Postgres backend instead, for multi-instance / HA deployments.

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
	Slack     *approval.SlackNotifier // nil when the Slack channel isn't configured
	MCP       *mcp.Gateway            // nil when no upstream is configured
	Memory    *memory.Reader
	Ingress   *otel.Ingress // nil unless the OTLP trace receiver is enabled
}

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