boot

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package boot initializes and assembles all components of the OK agent: config, providers, tools, plugins, permissions, hooks, memory, semantic search, and the controller. It is the composition root: every other package is wired together here so the frontends (CLI, HTTP, Desktop) only need one call to Build().

Package boot wires the i18n translation resolver chain into the application.

The resolver chain is:

  1. PrecompiledResolver — compiled-in Messages catalogs (30+ languages)
  2. LiveResolver — runtime LLM translation for any other language
  3. English fallback — always works

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, opts Options) (*control.Controller, error)

func NewProvider

func NewProvider(e *config.ProviderEntry) (provider.Provider, error)

func PluginSpecs

func PluginSpecs(entries []config.PluginEntry) []plugin.Spec

func WireI18n

func WireI18n(prov provider.Provider, lang string)

WireI18n installs the translation resolver chain for the given language. The chain order: compiled catalog → LiveResolver → English fallback. This should be called once during boot, after the provider is created.

Types

type Options

type Options struct {
	Model      string
	MaxSteps   int
	RequireKey bool
	Sink       event.Sink
}

Options carries the per-run knobs a frontend chooses; everything else is read from configuration. Model "" falls back to the configured default_model; MaxSteps 0 uses the config/default. RequireKey forces the executor's API key to be present (run/serve pass true so a missing key fails fast; chat/desktop pass false so the UI is reachable before a key is set). Sink receives the agent's typed event stream.

Jump to

Keyboard shortcuts

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