English
core/worldmodel/types.ts
Generated from the exports of core/worldmodel/types.ts · npm run docs:gen
The neutral world model: what exists on the machine, read from the system map (alta.map/1). No universe word lives here: an entity has a neutral kind, and each universe decides how it looks and what it is called.
Standards that cite this file: No standard page cites this file yet.
Exports
Provenance type
ts
type Provenance = "measured" | "stale" | "declared" | "example" | "mock";EntityState type
ts
type EntityState =
| "running" | "building" | "degraded" | "incomplete" | "paused" | "dormant" | "archived"
| "available" | "declared" | "unknown"
| "ok" | "error" | "disabled" | "absent";ENTITY_KINDS const
Neutral kinds. Every universe must give each of them a label (tests/universe-contract.test.ts).
ts
const ENTITY_KINDS = [ "core", // the main agent at the centre (memory, the one you talk to) "agent", // one of the four core agents around …EntityKind type
ts
type EntityKind = (typeof ENTITY_KINDS)[number];AGENT_ROLES const
ts
const AGENT_ROLES = ["daemon", "architect", "operator", "reviewer", "guardian"] as constAgentRole type
ts
type AgentRole = (typeof AGENT_ROLES)[number];ELEMENTS const
ts
const ELEMENTS: Record<AgentRole, "Earth" | "Wood" | "Fire" | "Metal" | "Water">Source interface
ts
interface Source {
file?: string;
key?: string;
cmd?: string;
probe?: string;
}Entity interface
ts
interface Entity {
id: string;
kind: EntityKind;
/** The real name on the machine (module id, automation name). Never translated by a universe. */
name: string;
state: EntityState;
prov: Provenance;
src: Source | null;
/** Agent role for core/agent entities, or the agent an automation belongs to. */
role?: AgentRole;
/** Seconds between runs, for automations. */
periodS?: number | null;
enabled?: boolean;
/** Lines saying what is missing or failing, straight from the map. */
notes?: string[];
measuredAt?: string | null;
}Balance interface
ts
interface Balance {
/** 0 = calm water, 1 = every control pair over its limit. Null when nothing was measured. */
value: number | null;
pairs: { who: string; state: string; over: boolean }[];
}WorldState interface
ts
interface WorldState {
schema: string;
generatedAt: string | null;
owner: string | null;
/** True when the state comes from a demo fixture, not this machine. */
demo: boolean;
entities: Entity[];
balance: Balance;
counts: { measured: number; declared: number; mock: number; total: number };
}