# @ferret/assets: API (continued)

### ModuleItem

*interface* · `packages/assets/src/library.ts:295`

```ts
interface ModuleItem extends ItemBase
```

A ready-made package of code: a package of kind `library` whose one ES module (`code.entry`) exports `install(ctx)` and the functions and classes a game
calls (a sea, a sky, a shader, a generator). The code reads the engine's other packages from the shared engine (`globalThis.Ferret`), so it carries only
its own code; `AssetLibrary.module(id)` runs it under the code policy and returns its exports.

- `type: 'module'`
- `exports: string[]` — what the module exports (names), so a list can show them without running it
- `engine?: string[]` — the engine's packages the code reads from the shared engine (`@ferret/terrain`): the game must have them
- `usage?: string` — one line that shows how it is used
- `docs?: string` — a README (Markdown) in the package
- `sources?: string[]` — the source files it was built from, for the record

### Moments

*interface* · `packages/assets/src/model-physics.ts:64`

```ts
interface Moments
```

Integrals over a solid of unit density, in the units of the geometry: volume, first moments and second moments about the origin.

- `v: number`
- `x: number`
- `y: number`
- `z: number`
- `xx: number`
- `yy: number`
- `zz: number`

### PackageEncryption

*interface* · `packages/assets/src/security.ts:25`

```ts
interface PackageEncryption
```

- `alg: 'AES-256-GCM'`
- `kdf: 'PBKDF2-SHA256' | 'none'`
- `salt?: string` — base64 (kdf PBKDF2)
- `iterations?: number`
- `check: string` — a sealed constant: opening it tells a wrong password from a damaged file (kdf none: the key's id)

### PackageInfo

*interface* · `packages/assets/src/package.ts:399`

```ts
interface PackageInfo
```

- `id: string`
- `name: string`
- `version: string`
- `kind: PackageKind`
- `format: number`
- `files: number`
- `bytes: number`
- `levels: string[]`
- `assets: string[]`
- `behaviours: string[]`
- `dependencies: Record<string, string>`
- `hasCode: boolean`
- `signed: boolean`
- `encrypted: boolean`
- `locked: boolean`
- `entry?: PackageManifest['entry']`
- `codeEntry?: string` — the module the code loader runs, if any (`code.entry`, else a game's `entry.code`)

### PackageIssue

*interface* · `packages/assets/src/package.ts:92`

```ts
interface PackageIssue
```

- `path: string`
- `message: string`

### PackageManifest

*interface* · `packages/assets/src/package.ts:38`

```ts
interface PackageManifest
```

- `format: number`
- `id: string` — lower case letters, digits, `.`, `_`, `-`
- `name: string`
- `version: string` — semver `major.minor.patch`
- `kind: PackageKind`
- `engine?: { ferret?: string; babylon?: string; /** the parts of Babylon the game loads at start, and the ones a feature may ask for later (stage P6; without them the full build is loaded) */ parts?: string[]; lazyParts?: string[]; /** a standalone game: the exact release whose engine files are inside the package, under `engine/` */ bundled?: string }` — the versions it was built and tested with
- `dependencies?: Record<string, string>` — other packages by id and version range (`1.2.0`, `^1.2.0`, `~1.2.0`, `>=1.2.0`, `*`)
- `catalogs?: string[]` — catalogs (`catalog.json`) where the player looks for the `dependencies` that are not open yet, in order: absolute URLs, or relative ones read from where this package itself was loaded. A dependency's own `catalogs` are searched for its dependencies, after these.
- `modules?: string[]` — a game only: the engine modules its code and levels use, written by the compiler (a project has none)
- `babylon?: string[]` — a game only: the Babylon parts it uses, written by the compiler
- `keep?: string[]` — a game or a project: files the compiler must keep although no literal path reaches them (globs, `*` within a folder, `**` across)
- `game?: GameBlock` — a game or a project: what `createGame` gets
- `for?: { game: string; version: string }` — a package of levels made for a game: which game and versions it fits
- `entry?: { code?: string; /** the level to start in; a game whose code builds its own world names none (then `code` is required) */ level?: string; spawn?: string; ui?: string }` — a game or a project: the code module (a game: built, under `code/`; a project: the source), the level to start in, the spawn, the UI fragment
- `code?: { entry: string }` — a game or a library: the code module the code loader runs (one bundled ES module under `code/` exporting `install`)
- `provides?: PackageProvides` — what it offers to others
- `files?: Record<string, string>` — sha256 (hex) of every file but this one
- `encryption?: PackageEncryption` — present when the files are encrypted (see ./security); `ferret.json` itself never is
- `signature?: PackageSignature` — a signature over the whole manifest (so over `files`) made by the publisher; checked by whoever decides to trust the code

### PackageProvides

*interface* · `packages/assets/src/package.ts:84`

```ts
interface PackageProvides
```

What a package offers, so that a level or a program can be resolved to the packages it needs without running their code. The
lists after `behaviours` are names a library's code registers: physics capabilities, actuator kinds, flow sources, forms of the
motion language, commands and level manifest keys.

- `levels?: string[]`
- `assets?: string[]`
- `behaviours?: { name: string; params?: Record<string, unknown> }[]`
- `capabilities?: string[]`
- `kinds?: string[]`
- `flowSources?: string[]`
- `forms?: string[]`
- `commands?: string[]`
- `levelKeys?: string[]`

### PackageSignature

*interface* · `packages/assets/src/security.ts:15`

```ts
interface PackageSignature
```

- `alg: 'ES256'`
- `key: string` — the public key, SPKI in base64
- `keyId: string` — first 16 bytes of the sha256 of the public key, in hex
- `value: string` — base64 of the raw (r || s) signature

### PackageSource

*interface* · `packages/assets/src/package.ts:307`

```ts
interface PackageSource
```

Reads the files of a package, whether it is a zip or a folder.

- `readonly kind: 'zip' | 'folder' | 'memory'`
- `list(): string[]` — every file path (the manifest included)
- `has(path: string): boolean`
- `size(path: string): number` — bytes of the file in the package (uncompressed); 0 when unknown
- `read(path: string): Promise<Uint8Array>`

### PackedPackage

*interface* · `packages/assets/src/catalog.ts:328`

```ts
interface PackedPackage
```

- `bytes?: Uint8Array` — the package file in memory; a package too big for that (`packPackageTo`) leaves this out and gives `file`
- `file?: { size: number; sha256: string; manifestSha256: string }` — a package written to disk by `packPackageTo`: its size, the sha256 of the whole file and of its `ferret.json`; the publisher puts the file at `publishedPath(sha256)` itself
- `manifest: PackageManifest`
- `tiers?: Record<string, Uint8Array>` — packed again for a device tier
- `ext?: string` — the extension of the published file

### PackOptions

*interface* · `packages/assets/src/package.ts:666`

```ts
interface PackOptions
```

Build a `.ferret` from a source (a folder, another package, a draft): the manifest gets the sha256 of every file, the levels
and assets it provides when they are not named, and the zip is written the same way every time (sorted, no dates). Files that
are compressed already are stored, so a reader slices them out without inflating.

- `manifest?: Partial<PackageManifest>`
- `engine?: PackageManifest['engine']`
- `encrypt?: KeyInput` — seal every file but the manifest (a password, or a 32-byte key in base64)
- `iterations?: number` — PBKDF2 rounds for a password (default 310000; tests use less)
- `sign?: { privateKey: string }` — sign the finished manifest with this private key (base64 PKCS8, from `generateSigningKey`)
- `decrypt?: boolean` — pack an encrypted package's files as plain ones (without it, repacking an encrypted package needs `encrypt`)

### PersistentCacheOptions

*interface* · `packages/assets/src/persist.ts:121`

```ts
interface PersistentCacheOptions
```

- `cap?: number` — Hard cap in bytes (defaults: 400 MB desktop, 200 MB phone, 100 MB console: the caller picks).
- `quota?: () => Promise<number | undefined>` — The browser's quota (`navigator.storage.estimate().quota`) when it has one; the cache stays under 80% of it.
- `now?: () => number`
- `partialMaxAgeMs?: number` — Partial downloads older than this are removed (24 h).

### PhysicsPlan

*interface* · `packages/assets/src/model-physics.ts:331`

```ts
interface PhysicsPlan
```

- `id: string`
- `bodies: PlanBody[]`
- `joints: PlanJoint[]`
- `mass: number`
- `charge: number`

### PlanBody

*interface* · `packages/assets/src/model-physics.ts:329`

```ts
interface PlanBody
```

A rigid body of the whole: its mass properties (true SI, in the whole's drawn frame), its shapes, and the instance it comes from (none for the whole's own).

- `name: string`
- `kind: 'static' | 'dynamic' | 'kinematic'`
- `mass: number`
- `charge: number`
- `centerOfMass: Vec3`
- `inertia: Vec3`
- `shapes: PlanShape[]`
- `instance?: string`
- `parts: string[]`

### PlanEdit

*interface* · `packages/assets/src/model-plan.ts:10`

```ts
interface PlanEdit
```

- `op: 'replace' | 'add' | 'hide' | 'material'`
- `node: string`
- `parent?: string` — `add`: the node of the level the new node goes under
- `from?: string` — `replace`, `add`: the qualified path of the glTF the node comes from, for this level
- `material?: string` — `material`: the name in the model's `materials`

### PlanInstance

*interface* · `packages/assets/src/model-plan.ts:21`

```ts
interface PlanInstance
```

- `name: string` — the instance's name, its address (`<instance>/<part>`)
- `include: string` — the name of the include this instance is of
- `id: string` — the id of the included model
- `placement: Omit<ModelPlacement, 'name' | 'overrides'>`
- `fuse: 'body' | 'rigid'`
- `level: number` — the level of the included model the instance is drawn on
- `plan: AssemblyPlan`

### PlanJoint

*interface* · `packages/assets/src/model-physics.ts:330`

```ts
interface PlanJoint
```

- `name: string`
- `between: [string, string]`
- `kind: 'fixed' | 'hinge' | 'ball' | 'slider'`
- `anchor?: Vec3`
- `axis?: Vec3`
- `limits?: number[]`
- `breakForce?: number`
- `breakTorque?: number`

### PlanShape

*interface* · `packages/assets/src/model-physics.ts:327`

```ts
interface PlanShape
```

A collision shape in a body's frame, with its physical material.

- `name: string`
- `shape: ModelCollisionShape['shape']`
- `size?: number[]`
- `center?: Vec3`
- `material?: string`
- `physical?: unknown`
- `frame: number[]`

### PreparedModel

*interface* · `packages/assets/src/model-pack.ts:19`

```ts
interface PreparedModel
```

- `files: Map<string, Uint8Array>` — the folder as it must be packed
- `written: string[]` — the files the preparation wrote (`model.json`, `description.json`, `description.md`), with what changed in `model.json`
- `changed: string[]`
- `issues: PackageIssue[]`

### RequireOptions

*interface* · `packages/assets/src/store.ts:36`

```ts
interface RequireOptions
```

- `priority?: StreamPriority`
- `signal?: AbortSignal`
- `sha256?: string` — sha256 (hex) from a signed catalog or package manifest. Without it the file is not verified (development only).
- `size?: number` — Size in bytes when the catalog knows it: the progress total is exact from the start.
- `mirrors?: string[]`
- `pkg?: string` — The package (or level) the file belongs to: the unit of eviction, pinning and `clear`.
- `version?: string`
- `group?: string` — Files asked with the same group add up into one progress (a travel).

### ResolvedInclude

*interface* · `packages/assets/src/model-resolve.ts:198`

```ts
interface ResolvedInclude
```

- `id: string`
- `version?: string` — the version of the package that was found
- `fuse: 'body' | 'rigid'`
- `optional?: boolean`
- `missing?: true` — an optional include whose package was not found
- `instances: ResolvedInstance[]`

### ResolvedInstance

*interface* · `packages/assets/src/model-resolve.ts:197`

```ts
interface ResolvedInstance
```

One place of an included model in the whole: its name (`<include>` for a single placement, `<include>.<index>` in a list, or the placement's own), where it sits, and the model resolved with the overlays.

- `name: string`
- `placement: Omit<ModelPlacement, 'name' | 'overrides'>`
- `resolved: ResolvedModel`

### ResolvedModel

*interface* · `packages/assets/src/model-resolve.ts:175`

```ts
interface ResolvedModel
```

- `fmdl: 1`
- `id: string`
- `abstract: boolean`
- `lineage: string[]` — the ids of the chain, the root ancestor first (SPEC 8.6)
- `chain: { id: string; version: string }[]` — the packages the chain was read from, with their versions
- `resolvedHash: string` — SPEC 8.5: what an impostor's `modelHash` is
- `model: ModelJson` — the merged model; its paths are qualified (`fmdl://<package>/<path>`)
- `description: ModelDescription` — the merged `description.json`, with `lineage`
- `texts?: { id: string; summary?: string; text?: string }[]` — what each member of the chain says of itself, the root first (`description.md` shows them in this order)
- `includes?: Record<string, ResolvedInclude>` — the included models, resolved (SPEC 8.4); absent when the model includes nothing
- `levelKeys: string[]` — the key of each level (SPEC 4.5): what a measurement of the level's thresholds is made of

### ResolveResult

*interface* · `packages/assets/src/model-resolve.ts:208`

```ts
interface ResolveResult
```

- `resolved?: ResolvedModel`
- `issues: PackageIssue[]`
- `read?: (qualified: string) => Promise<Uint8Array>` — reads a file of any package the model was made from (the whole chain and every included model) by its qualified path (`fmdl://<package>/<path>`)

### RubricNode

*interface* · `packages/assets/src/library.ts:786`

```ts
interface RubricNode extends LibraryRubric
```

- `count: number`
- `own: number`
- `children: RubricNode[]`

### SigningKey

*interface* · `packages/assets/src/security.ts:57`

```ts
interface SigningKey
```

- `publicKey: string`
- `privateKey: string`
- `keyId: string`

### Socket

*interface* · `packages/assets/src/library.ts:151`

```ts
interface Socket
```

A place on a body where something is held: a bone and an offset from it (metres, radians as a quaternion), kept in the item so every game puts a weapon in a hand the same way.

- `bone: string`
- `position?: [number, number, number]`
- `rotation?: [number, number, number, number]`
- `grip?: { point: [number, number, number]; axis: [number, number, number]; radius: number; spacing?: number; edge?: [number, number, number] }` — how the thing in this socket is held, in the frame of `bone`: the middle of the grip, its axis (toward the blade), its radius, the distance to the second hand (toward the pommel), and for a blade the way its edge faces (across the axis; a two-edged blade cuts along it either way)

### SoundFile

*interface* · `packages/assets/src/library.ts:259`

```ts
interface SoundFile
```

One file of a sound item: a WAV (exact, big) or an MP3 (small), the same sound.

- `file: string`
- `bytes: number`
- `bitrate?: number`

### SoundItem

*interface* · `packages/assets/src/library.ts:267`

```ts
interface SoundItem extends ItemBase
```

A sound: the same recording as a WAV and/or an MP3 (a device on the `low` or `mobile` tier takes the MP3 when there is one, the others the
WAV), with what a game needs to place it - how long it is, whether and where it loops, the bus it belongs on and how it falls with distance.

- `type: 'sound'`
- `files: Partial<Record<'wav' | 'mp3', SoundFile>>`
- `rate: number` — frames per second of the recording
- `channels: number`
- `duration: number` — seconds
- `peak?: number` — the largest sample, 0..1 (a game can raise the quiet ones)
- `loop?: boolean | { start: number; end: number }` — the sound repeats; `start` and `end` in seconds when only a part of it does (a WAV `smpl` loop)
- `bus?: SoundBus`
- `volume?: number` — 0..1
- `spatial?: { min?: number; max?: number; model?: 'linear' | 'inverse' | 'exponential'; rolloff?: number }` — how it falls with distance when played at a place (metres)
- `marks?: { name: string; time: number }[]` — moments named in the sound, seconds (cue marks of the WAV: `hit`, `step`)
- `wave?: number[]` — the shape of the wave for a picture of it: lowest and highest sample of equal parts, interleaved (min0, max0, min1, max1...)

### StoreOptions

*interface* · `packages/assets/src/store.ts:17`

```ts
interface StoreOptions
```

- `fetch?: typeof fetch`
- `origins?: string[]` — Origins files may come from (`https://cdn.example.com`). Empty or missing: any origin that passes the https rule.
- `base?: string` — Relative refs are resolved against this.
- `concurrency?: number`
- `stallMs?: number` — No bytes for this long: the attempt is abandoned and retried (resumed when it can).
- `retries?: number`
- `backoffMs?: number`
- `maxFileBytes?: number` — A file bigger than this is refused (the catalog's size is the usual limit; this is the engine's cap).
- `cache?: PersistentCache` — The persistent cache; without one every file lives in memory for the session.
- `random?: () => number`
- `sleep?: (ms: number, signal?: AbortSignal) => Promise<void>`

### StreamProgress

*interface* · `packages/assets/src/store.ts:15`

```ts
interface StreamProgress
```

- `loaded: number`
- `total: number`
- `files: number`
- `filesDone: number`
- `rate: number`
- `eta: number`

### TextureItem

*interface* · `packages/assets/src/library.ts:36`

```ts
interface TextureItem extends ItemBase
```

- `type: 'texture'`
- `maps: Partial<Record<TextureChannel, string>>` — the maps present: path inside the package per channel (`basecolor`, `normal`, `orm`, `emissive`, `height`), per tier a folder or file set
- `tiling?: number` — metres of the world one repeat of the texture covers; absent when unknown
- `seamless?: boolean`
- `size?: number` — pixels of the largest side at full size
- `tiers?: Partial<Record<LibraryTier, { bytes: number; side: number }>>`
- `aliases?: string[]` — other names of the same image (the same pixels exported under another name)
- `layers?: string[]` — the ground layers (`LAYER_SET` of

### TierFile

*interface* · `packages/assets/src/library.ts:18`

```ts
interface TierFile
```

- `file: string`
- `bytes: number`
- `triangles?: number`
- `texCap?: number`
- `bones?: number`

### Totals

*interface* · `packages/assets/src/model-physics.ts:180`

```ts
interface Totals
```

The mass properties of a resolved model as the whole sees them: stated, or the computed values (which must be written and fresh).

- `mass: number`
- `charge: number`
- `centerOfMass: Vec3`
- `inertia: Vec3`

### VerifyResult

*interface* · `packages/assets/src/package.ts:422`

```ts
interface VerifyResult
```

- `signed: boolean`
- `valid: boolean` — the signature matches the manifest (and, when files could be read, every file matches the manifest)
- `keyId?: string`
- `trusted: boolean` — valid, and the key is in (true for any valid signature when no list was given)
- `problems: string[]`

### VertexMasksDef

*interface* · `packages/assets/src/library.ts:89`

```ts
interface VertexMasksDef
```

`opacity`: the alpha of the surface is multiplied by the vertex colour's alpha (OpacityMask = texture alpha x vertex alpha); `ao`: ambient occlusion = the vertex colour's red channel.

- `opacity?: boolean`
- `ao?: boolean`

### VolumeItem

*interface* · `packages/assets/src/library.ts:337`

```ts
interface VolumeItem extends ItemBase
```

A sequence of density volumes (a baked smoke or fire), the near rung of the effect ladder: `frames` volumes of `resolution` voxels, one byte per voxel per
channel, laid out frame after frame, then z, then y, then x, then channel, in one file `file`. `channels` says what the bytes are (density, temperature) in order.

- `type: 'volume'`
- `resolution: [number, number, number]`
- `frames: number`
- `fps: number`
- `channels: Array<'density' | 'temperature'>`
- `voxel: number` — metres one voxel edge spans at the size it was made for
- `densityMax?: number` — what a full byte means: the density, and the temperature (kelvin) of the heat channel; `ambient` is the air's (a zero heat byte)
- `temperatureMax?: number`
- `ambient?: number`
- `file: string`
- `loop?: boolean`

### ZipEntryInfo

*interface* · `packages/assets/src/zip.ts:73`

```ts
interface ZipEntryInfo
```

- `path: string`
- `size: number`
- `compressedSize: number`
- `method: 0 | 8`
- `crc: number`
- `offset: number`

### ZipFile

*interface* · `packages/assets/src/zip.ts:224`

```ts
interface ZipFile
```

- `path: string`
- `data: Uint8Array`
- `compress?: boolean`

## Types

### AlphaMode

*type* · `packages/assets/src/library.ts:52`

```ts
type AlphaMode = 'opaque' | 'mask' | 'blend'
```

### CatalogFailure

*type* · `packages/assets/src/catalog.ts:117`

```ts
type CatalogFailure = 'invalid' | 'signature' | 'untrusted' | 'unsigned' | 'engine' | 'network'
```

### CatalogPackageSource

*type* · `packages/assets/src/catalog.ts:324`

```ts
type CatalogPackageSource = PackageSource & { manifest: PackageManifest; cached(paths: string[]): Promise<boolean>; /** `id@version`: the unit the cache evicts and pins */ tag: string }
```

### CharacterKind

*type* · `packages/assets/src/library.ts:12`

```ts
type CharacterKind = 'human' | 'animal' | 'creature' | 'part' | 'vehicle'
```

`vehicle`: a machine with moving parts (an aircraft with its gear and canopy) kept as a rigged model, not a person or an animal

### KeyInput

*type* · `packages/assets/src/security.ts:36`

```ts
type KeyInput = { password: string } | { key: string }
```

What opens an encrypted package: a password, or the 32-byte key in base64.

### Ktx2Target

*type* · `packages/assets/src/ktx2.ts:33`

```ts
type Ktx2Target = 'ASTC4x4' | 'BC7' | 'ETC2' | 'ETC1' | 'BC3' | 'BC1' | 'PVRTC' | 'RGBA8'
```

the block format a KTX2 map ends up in on a device

### LibraryItem

*type* · `packages/assets/src/library.ts:353`

```ts
type LibraryItem = TextureItem | MaterialItem | CharacterItem | ClipsItem | ModelItem | FmdlItem | SoundItem | ModuleItem | FlipbookItem | VolumeItem
```

### LibraryItemType

*type* · `packages/assets/src/library.ts:7`

```ts
type LibraryItemType = 'texture' | 'material' | 'character' | 'clips' | 'model' | 'fmdl' | 'sound' | 'module' | 'flipbook' | 'volume'
```

### LibraryTier

*type* · `packages/assets/src/library.ts:9`

```ts
type LibraryTier = 'desktop' | 'mobile' | 'low'
```

### MapSlot

*type* · `packages/assets/src/library.ts:53`

```ts
type MapSlot = 'baseColor' | 'normal' | 'orm' | 'emissive' | 'opacity'
```

### MaskChannel

*type* · `packages/assets/src/library.ts:95`

```ts
type MaskChannel = 'r' | 'g' | 'b' | 'a' | 'rgb'
```

Which channel of a mask picture a colour layer reads: one channel, or `rgb` (each colour channel mixed by its own channel of the picture).

### ModelLoader

*type* · `packages/assets/src/model-resolve.ts:26`

```ts
type ModelLoader = (id: string, range: string) => Promise<ModelSource | null> | ModelSource | null
```

Finds the package of a model by its id and a version range (the highest version that fits), or `null` when there is none.

### ModelResponse

*type* · `packages/assets/src/model.ts:49`

```ts
type ModelResponse = false | { class: string; [parameter: string]: string | number | boolean }
```

how a material answers a moving medium (`@ferret/physics-response`): one of its classes with the class's parameters, or `false` for no response

### ModelTier

*type* · `packages/assets/src/model.ts:18`

```ts
type ModelTier = 'desktop' | 'mobile' | 'low'
```

### NodeEdit

*type* · `packages/assets/src/model.ts:42`

```ts
type NodeEdit = | { op: 'replace'; node: string; from: string | Record<string, string>; levels?: number[] } | { op: 'add'; node: string; parent: string; from: string | Record<string, string>; levels?: number[] } | { op: 'hide'; node: string; levels?: number[] } | { op: 'material'; node: string; material: string; levels?: number[] }
```

### PackageInput

*type* · `packages/assets/src/package.ts:410`

```ts
type PackageInput = Blob | Uint8Array | ArrayBuffer | string | ByteSource | PackageSource
```

### PackageKind

*type* · `packages/assets/src/package.ts:13`

```ts
type PackageKind = 'game' | 'levels' | 'assets' | 'library' | 'project' | 'model'
```

### Quat

*type* · `packages/assets/src/model.ts:33`

```ts
type Quat = [number, number, number, number]
```

### SoundBus

*type* · `packages/assets/src/library.ts:261`

```ts
type SoundBus = 'music' | 'sfx' | 'ambient' | 'voice'
```

### StoreStatus

*type* · `packages/assets/src/store.ts:52`

```ts
type StoreStatus = 'missing' | 'queued' | 'loading' | 'cached' | 'failed'
```

### StreamFailure

*type* · `packages/assets/src/stream-error.ts:4`

```ts
type StreamFailure = 'network' | 'http' | 'timeout' | 'integrity' | 'origin' | 'aborted' | 'size' | 'build'
```

### StreamPriority

*type* · `packages/assets/src/store.ts:11`

```ts
type StreamPriority = 'high' | 'normal' | 'low' | 'idle'
```

### TextureChannel

*type* · `packages/assets/src/library.ts:34`

```ts
type TextureChannel = 'basecolor' | 'normal' | 'orm' | 'emissive' | 'height'
```

the channels of a texture item: `height` is one channel, 0..1 over the set's relief (ground sets blend their layers by it)

### Vec3

*type* · `packages/assets/src/model.ts:32`

```ts
type Vec3 = [number, number, number]
```

### ZipLimits

*type* · `packages/assets/src/zip.ts:93`

```ts
type ZipLimits = typeof ZIP_LIMITS
```

## Constants

### AUTHOR_MARKER

*const* · `packages/assets/src/model-describe.ts:17`

```ts
const AUTHOR_MARKER: "<!-- author -->"
```

### CATALOG_FORMAT

*const* · `packages/assets/src/catalog.ts:12`

```ts
const CATALOG_FORMAT: 1
```

### CATALOG_ZIP_LIMITS

*const* · `packages/assets/src/zip.ts:99`

```ts
const CATALOG_ZIP_LIMITS: { maxEntries: number; maxEntryBytes: number; maxTotalBytes: number; maxJsonBytes: number; }
```

The limits for the packages of a signed catalog (`openCatalogPackage`): what the signature vouches for is not a hostile package, and a big level (a streamed
town of thousands of cells, a castle's 400 MB scene) is the reason for the catalog. Every file is still checked against its hash, a file is read whole
(so it is capped at 1 GiB) and the declared sizes are still checked against what a deflate stream can give. Packages opened any other way keep `ZIP_LIMITS`.

### CHARACTER_KINDS

*const* · `packages/assets/src/library.ts:13`

```ts
const CHARACTER_KINDS: readonly CharacterKind[]
```

### DEFAULT_REF_VERSION

*const* · `packages/assets/src/catalog.ts:53`

```ts
const DEFAULT_REF_VERSION: "1.0.0"
```

The version a reference without a version means: the version of the move to the server, never "the latest".

### DESCRIPTION_FILE

*const* · `packages/assets/src/model.ts:15`

```ts
const DESCRIPTION_FILE: "description.json"
```

### DESCRIPTION_MD

*const* · `packages/assets/src/model.ts:16`

```ts
const DESCRIPTION_MD: "description.md"
```

### ELECTRON_VOLT

*const* · `packages/assets/src/model-physics.ts:19`

```ts
const ELECTRON_VOLT: 1.602176634e-19
```

One electron-volt in joules (the binding energies of nuclei are told in MeV).

### FMDL_FORMAT

*const* · `packages/assets/src/model.ts:13`

```ts
const FMDL_FORMAT: 1
```

### GAME_TIERS

*const* · `packages/assets/src/package.ts:36`

```ts
const GAME_TIERS: readonly ["desktop", "mobile", "low"]
```

### KTX2_BYTES_PER_TEXEL

*const* · `packages/assets/src/ktx2.ts:37`

```ts
const KTX2_BYTES_PER_TEXEL: Record<Ktx2Target, number>
```

video memory per texel (RGBA unless noted; BC1, ETC1 and PVRTC 4 bpp carry no alpha and take half a byte)

### KTX2_FILES

*const* · `packages/assets/src/ktx2.ts:20`

```ts
const KTX2_FILES: readonly ["babylon.ktx2Decoder.js", "msc_basis_transcoder.js", "msc_basis_transcoder.wasm", "zstddec.wasm", "uastc_astc.wasm", "uastc_bc7.wasm", "uastc_r8_unorm.wasm", "uastc_rg8_unorm.wasm", "uastc_rgba8_srgb_v2.wasm", "uastc_rgba8_unorm_v2.wasm"]
```

the files `ktx2/` holds, as the build copies them (tools/build.mjs, tools/modules/build.mjs, the game builds)

### LIBRARY_ITEM_TYPES

*const* · `packages/assets/src/library.ts:8`

```ts
const LIBRARY_ITEM_TYPES: readonly LibraryItemType[]
```

### LIBRARY_TIERS

*const* · `packages/assets/src/library.ts:10`

```ts
const LIBRARY_TIERS: readonly LibraryTier[]
```

### MANIFEST_FILE

*const* · `packages/assets/src/package.ts:12`

```ts
const MANIFEST_FILE: "ferret.json"
```

### MAP_SLOTS

*const* · `packages/assets/src/library.ts:54`

```ts
const MAP_SLOTS: readonly MapSlot[]
```

### MASK_CHANNELS

*const* · `packages/assets/src/library.ts:96`

```ts
const MASK_CHANNELS: readonly MaskChannel[]
```

### MODEL_FILE

*const* · `packages/assets/src/model.ts:14`

```ts
const MODEL_FILE: "model.json"
```

### MODEL_TIERS

*const* · `packages/assets/src/model.ts:19`

```ts
const MODEL_TIERS: readonly ModelTier[]
```

### PACKAGE_EXTENSIONS

*const* · `packages/assets/src/package.ts:20`

```ts
const PACKAGE_EXTENSIONS: Partial<Record<PackageKind, string>>
```

The file name extension a kind goes by. `.fex` is a finished game, `.fprj` a project in development, `.fmdl` a model
 and `.level` a level for a parent game; all are `.ferret` packages. A name ending in `.fex`, `.fprj`, `.fmdl` or `.level`
must carry the matching kind; other names (`.ferret`) are not checked, so a package of kind `levels` kept under `.ferret` stays valid.

### PACKAGE_FORMAT

*const* · `packages/assets/src/package.ts:11`

```ts
const PACKAGE_FORMAT: 1
```

### PROPULSOR_KINDS

*const* · `packages/assets/src/model.ts:53`

```ts
const PROPULSOR_KINDS: readonly ["ducted-fan", "rotor", "propeller", "nozzle", "exhaust"]
```

### PROVIDED_NAMES

*const* · `packages/assets/src/package.ts:90`

```ts
const PROVIDED_NAMES: readonly ["capabilities", "kinds", "flowSources", "forms", "commands", "levelKeys"]
```

The `provides` lists that are plain names.

### RESPONSE_CLASSES

*const* · `packages/assets/src/model.ts:52`

```ts
const RESPONSE_CLASSES: readonly ["rigid", "elastic", "membrane", "granular", "flake", "liquid-surface", "bed", "stone", "floating", "heat"]
```

the classes of the response of a material; `@ferret/physics-response` has the same list (its test compares the two)

### RUBRIC_PATH

*const* · `packages/assets/src/library.ts:781`

```ts
const RUBRIC_PATH: RegExp
```

a rubric path: lower case words joined by `/` (`vehicles/aircraft/bombers`); the first word is the top of the tree

### SEAL_OVERHEAD

*const* · `packages/assets/src/security.ts:174`

```ts
const SEAL_OVERHEAD: number
```

What a sealed file adds to its size.

### SPEED_OF_LIGHT

*const* · `packages/assets/src/model-physics.ts:16`

```ts
const SPEED_OF_LIGHT: 299792458
```

The speed of light, m/s: the mass of a binding energy is E / c^2.

### TEXTURE_CHANNELS

*const* · `packages/assets/src/library.ts:35`

```ts
const TEXTURE_CHANNELS: readonly TextureChannel[]
```

### ZIP_LIMITS

*const* · `packages/assets/src/zip.ts:92`

```ts
const ZIP_LIMITS: { maxEntries: number; maxEntryBytes: number; maxTotalBytes: number; maxJsonBytes: number; }
```

Limits that keep a hostile package from exhausting memory: a zip bomb is a few kilobytes that inflate to
gigabytes, or a directory of millions of entries. An engine cap, checked on the declared sizes when the directory is read and on
the real output while a file inflates. Change them before reading (a game with huge cooked files may raise `maxEntryBytes`).

