Documentation
¶
Overview ¶
Package tenant manages isolated tenant profiles under ~/.multiversa/tenants/<slug>/. One tenant = one manifest (the brand DNA) + one vault (0700, never read by any Multiversa surface) + one memory/graph home. Switching tenants swaps the whole context safely: nothing from one tenant's dir is ever read while another is active.
Index ¶
- Constants
- func Active() string
- func Dir(slug string) (string, error)
- func Load(slug string) (*manifest.Manifest, string, error)
- func New(slug, name, kind string, pillars ...manifest.Pillar) (*manifest.Manifest, string, error)
- func Root() (string, error)
- func SecretsPath(slug string) (string, error)
- func SetSecret(slug, key, value string) (int, error)
- func Template(kind string) *manifest.Manifest
- func Use(slug string) error
- type Info
Constants ¶
const SecretsFileName = "secrets.env"
SecretsFileName is the env-style file inside a tenant's vault that holds its connection keys (ElevenLabs voice, its own backend, …). It lives inside the 0700 vault and is itself 0600. It is a real .env file so a local runtime can source it; it is never serialized into the manifest, synced, or shown to an agent — that is the vault invariant, enforced by the vault-leak test.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New scaffolds a unique project OS from neutral technical defaults. It never overwrites: an existing tenant dir is an error, keeping profiles append-only.
Layout created:
~/.multiversa/tenants/<slug>/ multiversa.toml the tenant's DNA (template pre-filled) vault/ 0700 — secrets live here, never serialized graph/ knowledge graph home (anchored to identity) memory/ Engram home for this tenant
Pillars given here replace the template's defaults; passing none keeps them. It is variadic so every existing three-argument call still compiles — and so that the Tauri installer can delegate tenant creation here instead of writing its own multiversa.toml, which is how the two implementations drifted apart.
func SecretsPath ¶ added in v0.8.0
SecretsPath returns the path to a tenant's vault secrets file. It does not require the file to exist.
func SetSecret ¶ added in v0.8.0
SetSecret writes or updates one KEY=value entry in the tenant's vault secrets file, creating it 0600 inside the 0700 vault. Existing entries are preserved; a repeated key is updated in place. Returns the number of keys stored afterward.
The value is treated as opaque and is never logged by this package. Callers (the CLI command, the installer) must not print it either.
Types ¶
type Info ¶
type Info struct {
Slug string `json:"slug"`
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
Owner string `json:"owner,omitempty"`
Dir string `json:"dir"`
Active bool `json:"active"`
VaultOK bool `json:"vault_ok"` // vault dir exists with 0700
Manifest bool `json:"manifest"` // multiversa.toml present and parseable
}
Info is the JSON-safe view of a tenant profile. Vault contents are never included — only the path and whether the layout is intact.