Documentation
¶
Overview ¶
Package profile persists the per-user wizard profile across Multiversa CLI invocations. The TOML file at `~/.multiversa/profile.toml` is the primary store; a best-effort mirror to Engram (`multiversa/profile` topic key) lets other agents on the user's machine surface the same context.
The profile is intentionally minimal: who the user is (level), what language to speak (locale), when we last saw them, and what engines they already have. Everything else stays in the engines' own state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectLocale ¶
DetectLocale extracts the BCP-47 family from a POSIX LANG value. Mapping rules:
- "es_*" → "es-LA" (Spanish Latin neutral, the Multiversa default)
- "en_*" → "en"
- empty / "C" → "en" (safe English fallback)
- anything else → "en" (Multiversa only ships EN/ES today)
func MirrorEngram ¶
MirrorEngram persists a JSON snapshot of the profile into Engram under topic_key "multiversa/profile". If the `engram` binary is not on PATH, the call is a no-op — Engram integration is opt-in and must never block the local TOML write.
Returns the engram CLI exit error if the call ran but failed, nil otherwise. Callers should ignore non-nil returns for routine flows; the function is logging-only.
Types ¶
type Layer ¶
type Layer string
Layer is one of the consultive configuration layers in the `multiversa lab` meta-wizard. Each layer groups a related set of Steps (e.g. detect/stack/init in Técnica) and is shown as a section in the sidebar.
Negocio (clients/billing/contracts) is intentionally absent here. It belongs to MultiversaGroup, the private commercial entity, not to the MIT Lab.
const ( // Tecnica covers the OS-level toolchain and curated engines. Tecnica Layer = "tecnica" // Identitaria covers the user's identity, brain, and private // workspace (SSH/GPG/repos/vault). Identitaria Layer = "identitaria" // Operacional covers operational artifacts that aren't strictly // dev-tool nor identity: encrypted USB, credits attribution, // housekeeping. Operacional Layer = "operacional" )
func AllLayers ¶
func AllLayers() []Layer
AllLayers returns the layers shown in `multiversa lab`, in the order they appear in the sidebar.
func (Layer) DisplayName ¶
DisplayName returns the human label rendered in the sidebar. Display names are always Spanish — the Lab tone is bilingual but the layer names themselves are part of the brand vocabulary.
type Level ¶
type Level string
Level expresses how much explanation the user wants per step. Maps to tui.Verbosity at render time.
type Profile ¶
type Profile struct {
Level Level `toml:"level"`
Locale string `toml:"locale"`
LastRun time.Time `toml:"last_run"`
InstalledEngines []string `toml:"installed_engines"`
}
Profile is the on-disk shape persisted as TOML.
func Default ¶
func Default() Profile
Default returns a freshly-initialized profile with the locale detected from the host environment. Callers should ask the user for their preferred Level on first run and overwrite the zero value before saving.
func Load ¶
Load reads the profile from ~/.multiversa/profile.toml. If the file does not exist, Load returns (Default(), os.ErrNotExist) so callers can distinguish "first run" from a real error.
func (Profile) HasEngine ¶
HasEngine reports whether the named engine appears in the installed-engines list.
func (*Profile) MarkInstalled ¶
MarkInstalled appends an engine id to InstalledEngines if it is not already present. The list stays sorted-by-insertion-order so the user can see what they installed in what order.