runtime

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package runtime turns a workspace configuration into a live amoxtli.Codex, owning (and closing) the resources the library constructors require: the document store, the index backends and the LLM client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	// contains filtered or unexported fields
}

Lock is an exclusive per-workspace lock file. The bleve index directory can only be opened by one process at a time; taking an explicit lock first turns the cryptic backend error into an actionable message.

func (*Lock) Release

func (l *Lock) Release() error

Release removes the lock file.

type Runtime

type Runtime struct {
	Codex *amoxtli.Codex
	Store *gormStore.Store
	// contains filtered or unexported fields
}

Runtime is a live Codex together with the resources the CLI owns.

func Open

func Open(ctx context.Context, ws *workspace.Workspace, cfg *config.Config, command string) (rt *Runtime, err error)

Open acquires the workspace lock and wires the configuration into a Codex. command names the caller in the lock file for diagnostics.

func (*Runtime) Close

func (r *Runtime) Close() error

Close releases everything in reverse dependency order: the Codex first (drains the task runner), then the indexes, the store and the lock.

func (*Runtime) ResolveCollection

func (r *Runtime) ResolveCollection(ctx context.Context, ref string, create bool) (model.CollectionID, error)

ResolveCollection resolves a collection reference (ID or label) to its ID. When create is true, an unknown reference is created as a new collection labelled ref.

func (*Runtime) ResolveCollections

func (r *Runtime) ResolveCollections(ctx context.Context, refs []string, create bool) ([]model.CollectionID, error)

ResolveCollections resolves a list of collection references.

Jump to

Keyboard shortcuts

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