Documentation
¶
Overview ¶
Package app wires together the mnemos workspace layout, configuration, logger, and storage into a single App value shared across CLI commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
App holds the process-wide dependencies: the resolved workspace layout, parsed configuration, a structured logger, and an open database handle. Commands receive a built App rather than reaching for globals.
func Load ¶
func Load(opts LoadOptions) (*App, error)
Load resolves the workspace layout (the single MNEMOS_DIR and every path derived from it) and loads the mnemos.toml found there. It does NOT open the database; call OpenStore once the layout is known and the directory exists.
Every location — knowledge base, capture, index database, models — is a fixed subpath of the resolved MNEMOS_DIR, so the database, writes, and the URI namespace all anchor to one place regardless of the process working directory (which an MCP client does not guarantee).
func (*App) OpenStore ¶
OpenStore opens the workspace index database and runs migrations, storing the handle on the App. Callers are responsible for ensuring the parent directory exists.
allowCreate gates database creation. Write/populate commands (init, ingest, add, watch, okfy) pass true and may create a fresh database. Read commands (serve, search, ls, status, task, reindex, forget, mv) pass false: if the database is absent or empty, OpenStore returns an actionable error rather than letting the SQLite driver silently create an empty database — the failure mode that made a misconfigured MCP server return no results while appearing to work.
type LoadOptions ¶ added in v0.3.0
type LoadOptions struct {
// ConfigPath is --config: an explicit mnemos.toml whose directory becomes the
// MNEMOS_DIR. Empty means resolve by --mnemos-dir / $MNEMOS_DIR / project /
// default (see workspace.Resolve).
ConfigPath string
// MnemosDir is --mnemos-dir: an explicit MNEMOS_DIR.
MnemosDir string
Verbose bool
}
LoadOptions carries the workspace-selection inputs from the root flags.