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.
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) (_ *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 ¶
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.