# `core/universe/pack.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/universe/pack.ts"><code>core/universe/pack.ts</code></a> · <code>npm run docs:gen</code></p>

The universe pack (alta.universe/0.1, PLAN-V2 §2.4): a whole world as data, never code. A generated world (the world creator, lot W) or a store item gives words, colours, texts, a guide, scenes and an art direction; one parametric renderer (universes/_kit/parametric.ts, lot W) draws it. No TypeScript, no CSS, no address in a pack.

**Standards that cite this file**: [alta.universe/0.1: universe packs](https://docs.altasystem.ai/reference/advanced/specs/alta-universe-0.1)

## Exports

### `Fill` 
```ts
type Fill = keyof Palette | `#${string}`;
```

### `GLYPH_SHAPES` 
```ts
const GLYPH_SHAPES = ["orb", "ring", "poly", "star", "crystal", "blob", "spire", "shell", "leaf", "flame", "drop", "gear"] as const
```

### `Glyph` 
```ts
interface Glyph {
  shape: (typeof GLYPH_SHAPES)[number];
  size: number;                          // 8 to 120
  fill: Fill; stroke?: Fill; sides?: number /* 3 to 12 */; glow?: number /* 0 to 1 */;
  spin?: number; wobble?: number;        // -1 to 1
  layers?: Glyph[];                      // at most 3, one level
}
```

### `GROUND_STYLES` 
```ts
const GROUND_STYLES = ["void", "gradient", "bands", "grid", "noise"] as const
```

### `PARTICLES` 
```ts
const PARTICLES = ["dot", "streak", "flake", "bubble", "leaf", "ember"] as const
```

### `LINK_STYLES` 
```ts
const LINK_STYLES = ["line", "dash", "dots", "wave"] as const
```

### `ArtDirection` 
```ts
interface ArtDirection {
  schema: "alta.art/0.1";
  ground: { style: (typeof GROUND_STYLES)[number]; colors: Fill[];
            particles?: { shape: (typeof PARTICLES)[number]; count: number; drift: [number, number]; twinkle?: boolean } };
  core: Glyph; avatar: Glyph;
  agents: Record<Exclude<AgentRole, "daemon">, Glyph>;
  kinds: Record<Exclude<EntityKind, "core" | "agent">, Glyph>;
  links: Record<"flow" | "cycle" | "control", { style: (typeof LINK_STYLES)[number]; width: number; color: Fill }>;
  light?: { vignette?: number; fog?: number };
}
```

### `FONTS` 
```ts
const FONTS = ["grotesk", "serif", "mono", "rounded"] as const
```

### `SkinTokens` 
```ts
interface SkinTokens { radius: number; border: number; panelAlpha: number; font: (typeof FONTS)[number]; caps?: boolean }
```

### `UniversePack` 
```ts
interface UniversePack {
  schema: "alta.universe/0.1";
  manifest: UniverseManifest & { generated?: { by: string; at: string; forge: string; promptSha256: string } };
  vocabulary: Vocabulary;
  palette: Palette;
  copy: { en: Copy; fr?: Copy };
  art: ArtDirection;
  skin?: SkinTokens;
  onboarding: Onboarding;
  cinematics?: Cinematics;
}
```

### `MAX_PACK_BYTES` 
```ts
const MAX_PACK_BYTES = 256 * 1024
```

### `checkArt` 
Problems of an art direction (empty = drawable).

```ts
function checkArt(a: ArtDirection | undefined): string[]
```

### `words` 
Lower-case words of a text (letters and digits, accents kept).

```ts
const words = (s: string) => …
```

### `checkPack` 
Problems of a pack (empty = it can be loaded). `env.questUids`: the game's quests; `env.neutralTokens`: every word
of the neutral layers (core/, content/, client/): a distinctive word of the pack must not be one of them;
`env.otherNames`: names and ids of the universes already there; `env.denylist`: refused names (games, studios,
characters).

```ts
function checkPack(pk: unknown, env: { questUids: Set<string>; neutralTokens: Set<string>; otherNames: string[]; denylist: string[] }): string[]
```

### `universeFromPack` 
A pack as a universe: its art is drawn by the renderer the caller makes (the parametric renderer of lot W).

```ts
function universeFromPack(pk: UniversePack, makeRenderer: (art: ArtDirection) => Renderer): Universe
```
