tenant

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 6 Imported by: 0

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

This section is empty.

Variables

This section is empty.

Functions

func Active

func Active() string

Active returns the currently active tenant slug, or "" if none.

func Dir

func Dir(slug string) (string, error)

Dir returns the directory for a slug after validating it.

func Load

func Load(slug string) (*manifest.Manifest, string, error)

Load reads a tenant's manifest by slug.

func New

func New(slug, name, kind string) (*manifest.Manifest, string, error)

New scaffolds a tenant profile from a template. 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

func Root

func Root() (string, error)

Root returns ~/.multiversa/tenants.

func Template

func Template(kind string) *manifest.Manifest

Template returns the pre-filled DNA for a tenant kind. These are the replicable profiles: "agency" is the ElevatOS shape, "personal-brand" is the PulseOS shape, anything else gets the personal-os default.

func Use

func Use(slug string) error

Use marks slug as the active tenant. The tenant must exist.

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.

func Inspect

func Inspect(slug, active string) Info

Inspect builds the Info view for one slug. It reads the manifest but never enters the vault directory.

func List

func List() ([]Info, error)

List returns every tenant profile found under Root.

Jump to

Keyboard shortcuts

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