@yali-engine/world 0.0.0-stage → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,114 @@
1
+ /** "YCEL", little-endian. */
2
+ export declare const CELL_MAGIC = 1279607641;
3
+ export declare const CELL_VERSION = 1;
4
+ /** A mesh as the archive stores it (the render plugin's `MeshData` without LODs or skins). */
5
+ export interface ArchiveMesh {
6
+ readonly positions: Float32Array;
7
+ readonly normals: Float32Array;
8
+ readonly uvs?: Float32Array | null;
9
+ readonly indices: Uint32Array;
10
+ }
11
+ /** A material by value (the standard PBR knobs). */
12
+ export interface ArchiveMaterial {
13
+ readonly baseColor: readonly [number, number, number, number];
14
+ readonly roughness: number;
15
+ readonly metalness?: number;
16
+ }
17
+ /** An entity: a mesh and a material at a world transform (f64 position). */
18
+ export interface ArchiveInstance {
19
+ readonly mesh: number;
20
+ readonly material: number;
21
+ readonly t: readonly [number, number, number];
22
+ readonly r?: readonly [number, number, number, number];
23
+ readonly s?: number;
24
+ }
25
+ /** What `writeCellArchive` cuts into cells. */
26
+ export interface WorldInput {
27
+ /** Cell size, metres (default 128, DESIGN §15). */
28
+ readonly cell?: number;
29
+ /** The world's origin (f64; default the origin): cell (0, 0)'s corner. */
30
+ readonly origin?: readonly [number, number, number];
31
+ readonly meshes: readonly ArchiveMesh[];
32
+ readonly materials: readonly ArchiveMaterial[];
33
+ readonly instances: readonly ArchiveInstance[];
34
+ }
35
+ /** A blob's entry in the table of contents. */
36
+ export interface BlobEntry {
37
+ /** SHA-256 of its bytes, the first 16 bytes in hex: the same content, the same id, stored once. */
38
+ readonly id: string;
39
+ readonly offset: number;
40
+ readonly length: number;
41
+ readonly kind: 'mesh';
42
+ }
43
+ /** A cell's entry: its index, the blobs its entities use, and the entities (position relative to the cell's corner). */
44
+ export interface CellEntry {
45
+ readonly x: number;
46
+ readonly z: number;
47
+ readonly blobs: readonly number[];
48
+ /** Per entity: blob, material, tx, ty, tz (from the corner), rx, ry, rz, rw, s. */
49
+ readonly instances: readonly (readonly number[])[];
50
+ /** The cell's bounds relative to its corner (min xyz, max xyz): what streaming and culling test. */
51
+ readonly bounds: readonly number[];
52
+ }
53
+ export interface CellToc {
54
+ readonly version: number;
55
+ readonly cell: number;
56
+ readonly origin: readonly [number, number, number];
57
+ readonly materials: readonly ArchiveMaterial[];
58
+ readonly blobs: readonly BlobEntry[];
59
+ readonly cells: readonly CellEntry[];
60
+ }
61
+ /** A mesh's blob: magic, vertex and index counts, whether it has UVs, then positions, normals, (UVs), indices. */
62
+ export declare function encodeMesh(m: ArchiveMesh): Uint8Array<ArrayBuffer>;
63
+ /** `encodeMesh`'s blob back to arrays (views on a copy aligned for them). */
64
+ export declare function decodeMesh(bytes: Uint8Array): ArchiveMesh;
65
+ /**
66
+ * Cuts `world` into cells by each entity's position and writes the archive. Meshes are stored once each (by content), only
67
+ * those some cell uses.
68
+ */
69
+ export declare function writeCellArchive(world: WorldInput): Promise<Uint8Array<ArrayBuffer>>;
70
+ /** Reads bytes [start, end) of the archive (an HTTP `Range` request, a file, a test buffer). */
71
+ export type RangeRead = (start: number, end: number) => Promise<Uint8Array>;
72
+ /** `RangeRead` over HTTP: `Range: bytes=start-(end−1)`; a server that ignores Range (200, whole file) is refused by name. */
73
+ export declare function httpRange(url: string, init?: RequestInit): RangeRead;
74
+ /** What `loadCell` returns: the cell's meshes (by blob index), its entities with world positions, its corner. */
75
+ export interface LoadedCell {
76
+ readonly x: number;
77
+ readonly z: number;
78
+ /** The cell's corner (f64, world). */
79
+ readonly corner: readonly [number, number, number];
80
+ readonly meshes: ReadonlyMap<number, ArchiveMesh>;
81
+ /** Per entity: its blob (mesh), material, world position (f64), rotation, scale. */
82
+ readonly instances: readonly {
83
+ blob: number;
84
+ material: number;
85
+ t: [number, number, number];
86
+ r: [number, number, number, number];
87
+ s: number;
88
+ }[];
89
+ }
90
+ /**
91
+ * An archive opened by its header and table of contents (two reads); cells load on demand, their missing blobs fetched in
92
+ * coalesced ranges and kept (`dropCell` releases a cell's own).
93
+ *
94
+ * @example
95
+ * const world = await CellArchive.open(httpRange('/worlds/coast.cells'));
96
+ * const cell = await world.loadCell(0, -1);
97
+ */
98
+ export declare class CellArchive {
99
+ #private;
100
+ readonly toc: CellToc;
101
+ /** Ranges read so far, and their bytes (for budgets and tests). */
102
+ reads: number;
103
+ bytesRead: number;
104
+ private constructor();
105
+ static open(read: RangeRead): Promise<CellArchive>;
106
+ /** The cell holding a world point, as [x, z] (whether or not the archive has it). */
107
+ cellAt(x: number, z: number): [number, number];
108
+ /** Whether the archive holds cell (x, z). */
109
+ has(x: number, z: number): boolean;
110
+ /** Cell (x, z): its blobs not yet held are read in as few ranges as gaps under 64 KB allow. */
111
+ loadCell(x: number, z: number): Promise<LoadedCell>;
112
+ /** Releases the meshes only cell (x, z) used among the cells still `kept` (a set of "x,z" keys). */
113
+ dropCell(x: number, z: number, kept: ReadonlySet<string>): void;
114
+ }
@@ -0,0 +1,293 @@
1
+ // The cell archive (M3 increment 1, ADR-0201; DESIGN §15): a world cut into square cells (128 m by default), stored as
2
+ // one file read by HTTP `Range`, never whole.
3
+ //
4
+ // header (64 bytes) magic "YCEL", version, cell size, the world's origin (f64), where the table of contents is
5
+ // table of contents JSON: materials, blobs (a content id, offset, length, kind) and per cell its blobs and entities
6
+ // blobs content-addressed: a mesh a thousand rocks share is stored once
7
+ //
8
+ // A cell's entities carry their position relative to the cell's corner (f32 is exact there, ADR-0008); the cell's corner
9
+ // is the origin plus its index × the cell size, in f64. The table of contents maps onto a 3D Tiles 1.1 tileset (a tile
10
+ // per cell, its content the cell's blobs) for interchange; that exporter is a later step (the user's decision, M3.md).
11
+ /** "YCEL", little-endian. */
12
+ export const CELL_MAGIC = 0x4c454359;
13
+ export const CELL_VERSION = 1;
14
+ const HEADER_BYTES = 64;
15
+ /** "YMSH": a mesh blob. */
16
+ const MESH_MAGIC = 0x48534d59;
17
+ function archiveError(code, message, path) {
18
+ return Object.assign(new Error(`${code}: ${message}`), { code, path });
19
+ }
20
+ async function sha256Id(bytes) {
21
+ const digest = new Uint8Array(await crypto.subtle.digest('SHA-256', bytes));
22
+ let hex = '';
23
+ for (const b of digest.subarray(0, 16))
24
+ hex += b.toString(16).padStart(2, '0');
25
+ return hex;
26
+ }
27
+ /** A mesh's blob: magic, vertex and index counts, whether it has UVs, then positions, normals, (UVs), indices. */
28
+ export function encodeMesh(m) {
29
+ const v = m.positions.length / 3;
30
+ const uv = m.uvs && m.uvs.length === v * 2 ? m.uvs : null;
31
+ const bytes = 16 + v * 12 * 2 + (uv ? v * 8 : 0) + m.indices.length * 4;
32
+ const out = new Uint8Array(bytes);
33
+ const u = new Uint32Array(out.buffer, 0, 4);
34
+ u.set([MESH_MAGIC, v, m.indices.length, uv ? 1 : 0]);
35
+ let o = 16;
36
+ for (const a of uv ? [m.positions, m.normals, uv] : [m.positions, m.normals]) {
37
+ out.set(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), o);
38
+ o += a.byteLength;
39
+ }
40
+ out.set(new Uint8Array(m.indices.buffer, m.indices.byteOffset, m.indices.byteLength), o);
41
+ return out;
42
+ }
43
+ /** `encodeMesh`'s blob back to arrays (views on a copy aligned for them). */
44
+ export function decodeMesh(bytes) {
45
+ const b = bytes.byteOffset % 4 === 0 ? bytes : bytes.slice();
46
+ const u = new Uint32Array(b.buffer, b.byteOffset, 4);
47
+ if (u[0] !== MESH_MAGIC)
48
+ throw archiveError('CELL_FORMAT', 'a mesh blob without its YMSH magic', 'blob');
49
+ const [, v, n, hasUv] = u;
50
+ let o = b.byteOffset + 16;
51
+ const take = (count) => {
52
+ const a = new Float32Array(b.buffer, o, count);
53
+ o += count * 4;
54
+ return a;
55
+ };
56
+ const positions = take(v * 3);
57
+ const normals = take(v * 3);
58
+ const uvs = hasUv ? take(v * 2) : null;
59
+ if (o + n * 4 > b.byteOffset + b.byteLength)
60
+ throw archiveError('CELL_FORMAT', `a mesh blob cut off (${v} vertices, ${n} indices)`, 'blob');
61
+ return { positions, normals, uvs, indices: new Uint32Array(b.buffer, o, n) };
62
+ }
63
+ /** A mesh's bounds (min xyz, max xyz) under a uniform scale and rotation: its rotated box's, conservatively a sphere. */
64
+ function meshRadius(m) {
65
+ let r = 0;
66
+ for (let i = 0; i < m.positions.length; i += 3)
67
+ r = Math.max(r, Math.hypot(m.positions[i], m.positions[i + 1], m.positions[i + 2]));
68
+ return r;
69
+ }
70
+ /**
71
+ * Cuts `world` into cells by each entity's position and writes the archive. Meshes are stored once each (by content), only
72
+ * those some cell uses.
73
+ */
74
+ export async function writeCellArchive(world) {
75
+ const cell = world.cell ?? 128;
76
+ if (!(cell > 0))
77
+ throw archiveError('CELL_SIZE', `a cell of ${cell} m`, 'cell');
78
+ const origin = world.origin ?? [0, 0, 0];
79
+ // Blobs by content: identical meshes share one.
80
+ const blobs = [];
81
+ const blobOfMesh = [];
82
+ const byId = new Map();
83
+ const radius = [];
84
+ for (let m = 0; m < world.meshes.length; m++) {
85
+ const bytes = encodeMesh(world.meshes[m]);
86
+ const id = await sha256Id(bytes);
87
+ let b = byId.get(id);
88
+ if (b === undefined) {
89
+ b = blobs.length;
90
+ byId.set(id, b);
91
+ blobs.push({ id, bytes });
92
+ }
93
+ blobOfMesh.push(b);
94
+ radius.push(meshRadius(world.meshes[m]));
95
+ }
96
+ // Entities into cells (x, z) by their position.
97
+ const cells = new Map();
98
+ world.instances.forEach((e, i) => {
99
+ if (!(e.mesh >= 0 && e.mesh < world.meshes.length))
100
+ throw archiveError('CELL_INSTANCE', `entity ${i} names mesh ${e.mesh} of ${world.meshes.length}`, `instances.${i}.mesh`);
101
+ if (!(e.material >= 0 && e.material < world.materials.length))
102
+ throw archiveError('CELL_INSTANCE', `entity ${i} names material ${e.material} of ${world.materials.length}`, `instances.${i}.material`);
103
+ const x = Math.floor((e.t[0] - origin[0]) / cell);
104
+ const z = Math.floor((e.t[2] - origin[2]) / cell);
105
+ const key = `${x},${z}`;
106
+ let c = cells.get(key);
107
+ if (!c) {
108
+ c = { x, z, instances: [], blobs: new Set(), lo: [Infinity, Infinity, Infinity], hi: [-Infinity, -Infinity, -Infinity] };
109
+ cells.set(key, c);
110
+ }
111
+ const corner = [origin[0] + x * cell, origin[1], origin[2] + z * cell];
112
+ const local = [e.t[0] - corner[0], e.t[1] - corner[1], e.t[2] - corner[2]];
113
+ const s = e.s ?? 1;
114
+ const r = e.r ?? [0, 0, 0, 1];
115
+ const blob = blobOfMesh[e.mesh];
116
+ c.blobs.add(blob);
117
+ c.instances.push([blob, e.material, ...local, ...r, s]);
118
+ const reach = radius[e.mesh] * s;
119
+ for (let k = 0; k < 3; k++) {
120
+ c.lo[k] = Math.min(c.lo[k], local[k] - reach);
121
+ c.hi[k] = Math.max(c.hi[k], local[k] + reach);
122
+ }
123
+ });
124
+ // Lay the blobs out in the order cells first use them (a cell's blobs sit together: fewer, larger ranges).
125
+ const order = [];
126
+ const placed = new Set();
127
+ const cellList = [...cells.values()].sort((a, b) => a.z - b.z || a.x - b.x);
128
+ for (const c of cellList) {
129
+ for (const b of [...c.blobs].sort((p, q) => p - q)) {
130
+ if (!placed.has(b)) {
131
+ placed.add(b);
132
+ order.push(b);
133
+ }
134
+ }
135
+ }
136
+ const newIndex = new Map(order.map((b, i) => [b, i]));
137
+ let offset = 0;
138
+ const entries = order.map((b) => {
139
+ // 16-byte alignment: a decoded mesh's arrays are views on the fetched bytes.
140
+ const e = { id: blobs[b].id, offset, length: blobs[b].bytes.byteLength, kind: 'mesh' };
141
+ offset += Math.ceil(blobs[b].bytes.byteLength / 16) * 16;
142
+ return e;
143
+ });
144
+ const toc = {
145
+ version: CELL_VERSION,
146
+ cell,
147
+ origin: [origin[0], origin[1], origin[2]],
148
+ materials: world.materials,
149
+ blobs: entries,
150
+ cells: cellList.map((c) => ({
151
+ x: c.x,
152
+ z: c.z,
153
+ blobs: [...c.blobs].map((b) => newIndex.get(b)).sort((p, q) => p - q),
154
+ instances: c.instances.map((r) => [newIndex.get(r[0]), ...r.slice(1)]),
155
+ bounds: [...c.lo, ...c.hi],
156
+ })),
157
+ };
158
+ const tocBytes = new TextEncoder().encode(JSON.stringify(toc));
159
+ const blobStart = Math.ceil((HEADER_BYTES + tocBytes.byteLength) / 16) * 16;
160
+ const out = new Uint8Array(blobStart + offset);
161
+ const view = new DataView(out.buffer);
162
+ view.setUint32(0, CELL_MAGIC, true);
163
+ view.setUint32(4, CELL_VERSION, true);
164
+ view.setFloat32(8, cell, true);
165
+ view.setUint32(12, cells.size, true);
166
+ for (let k = 0; k < 3; k++)
167
+ view.setFloat64(16 + k * 8, origin[k], true);
168
+ view.setUint32(40, HEADER_BYTES, true);
169
+ view.setUint32(44, tocBytes.byteLength, true);
170
+ view.setUint32(48, blobStart, true);
171
+ out.set(tocBytes, HEADER_BYTES);
172
+ for (const [i, b] of order.entries())
173
+ out.set(blobs[b].bytes, blobStart + entries[i].offset);
174
+ return out;
175
+ }
176
+ /** `RangeRead` over HTTP: `Range: bytes=start-(end−1)`; a server that ignores Range (200, whole file) is refused by name. */
177
+ export function httpRange(url, init) {
178
+ return async (start, end) => {
179
+ const res = await fetch(url, { ...init, headers: { ...init?.headers, Range: `bytes=${start}-${end - 1}` } });
180
+ if (res.status !== 206)
181
+ throw archiveError('CELL_RANGE', `${url} answered ${res.status} to a Range request (206 expected): the server must serve byte ranges`, 'url');
182
+ return new Uint8Array(await res.arrayBuffer());
183
+ };
184
+ }
185
+ /** Requests closer than this many bytes are merged into one range (the bytes between are read and dropped). */
186
+ const COALESCE_GAP = 64 * 1024;
187
+ /**
188
+ * An archive opened by its header and table of contents (two reads); cells load on demand, their missing blobs fetched in
189
+ * coalesced ranges and kept (`dropCell` releases a cell's own).
190
+ *
191
+ * @example
192
+ * const world = await CellArchive.open(httpRange('/worlds/coast.cells'));
193
+ * const cell = await world.loadCell(0, -1);
194
+ */
195
+ export class CellArchive {
196
+ toc;
197
+ #read;
198
+ #blobStart;
199
+ #cells = new Map();
200
+ #meshes = new Map();
201
+ /** Ranges read so far, and their bytes (for budgets and tests). */
202
+ reads = 0;
203
+ bytesRead = 0;
204
+ constructor(read, toc, blobStart) {
205
+ this.#read = read;
206
+ this.toc = toc;
207
+ this.#blobStart = blobStart;
208
+ for (const c of toc.cells)
209
+ this.#cells.set(`${c.x},${c.z}`, c);
210
+ }
211
+ static async open(read) {
212
+ const head = await read(0, HEADER_BYTES);
213
+ if (head.byteLength < HEADER_BYTES)
214
+ throw archiveError('CELL_FORMAT', `a ${head.byteLength}-byte header (64 expected)`, 'header');
215
+ const view = new DataView(head.buffer, head.byteOffset, head.byteLength);
216
+ if (view.getUint32(0, true) !== CELL_MAGIC)
217
+ throw archiveError('CELL_FORMAT', 'not a cell archive (no YCEL magic)', 'header');
218
+ const version = view.getUint32(4, true);
219
+ if (version !== CELL_VERSION)
220
+ throw archiveError('CELL_FORMAT', `version ${version}, this reader knows ${CELL_VERSION}`, 'header.version');
221
+ const tocAt = view.getUint32(40, true);
222
+ const tocLength = view.getUint32(44, true);
223
+ const blobStart = view.getUint32(48, true);
224
+ const tocBytes = await read(tocAt, tocAt + tocLength);
225
+ const toc = JSON.parse(new TextDecoder().decode(tocBytes));
226
+ const a = new CellArchive(read, toc, blobStart);
227
+ a.reads = 2;
228
+ a.bytesRead = HEADER_BYTES + tocLength;
229
+ return a;
230
+ }
231
+ /** The cell holding a world point, as [x, z] (whether or not the archive has it). */
232
+ cellAt(x, z) {
233
+ return [Math.floor((x - this.toc.origin[0]) / this.toc.cell), Math.floor((z - this.toc.origin[2]) / this.toc.cell)];
234
+ }
235
+ /** Whether the archive holds cell (x, z). */
236
+ has(x, z) {
237
+ return this.#cells.has(`${x},${z}`);
238
+ }
239
+ /** Cell (x, z): its blobs not yet held are read in as few ranges as gaps under 64 KB allow. */
240
+ async loadCell(x, z) {
241
+ const c = this.#cells.get(`${x},${z}`);
242
+ if (!c)
243
+ throw archiveError('CELL_MISSING', `the archive has no cell (${x}, ${z})`, 'cell');
244
+ const missing = c.blobs.filter((b) => !this.#meshes.has(b)).sort((p, q) => this.toc.blobs[p].offset - this.toc.blobs[q].offset);
245
+ // Coalesce: runs of blobs whose gaps are small become one read.
246
+ let i = 0;
247
+ while (i < missing.length) {
248
+ let j = i;
249
+ const start = this.toc.blobs[missing[i]].offset;
250
+ let end = start + this.toc.blobs[missing[i]].length;
251
+ while (j + 1 < missing.length && this.toc.blobs[missing[j + 1]].offset - end < COALESCE_GAP) {
252
+ j++;
253
+ end = this.toc.blobs[missing[j]].offset + this.toc.blobs[missing[j]].length;
254
+ }
255
+ const bytes = await this.#read(this.#blobStart + start, this.#blobStart + end);
256
+ this.reads++;
257
+ this.bytesRead += bytes.byteLength;
258
+ for (let k = i; k <= j; k++) {
259
+ const b = this.toc.blobs[missing[k]];
260
+ this.#meshes.set(missing[k], decodeMesh(bytes.subarray(b.offset - start, b.offset - start + b.length)));
261
+ }
262
+ i = j + 1;
263
+ }
264
+ const corner = [this.toc.origin[0] + x * this.toc.cell, this.toc.origin[1], this.toc.origin[2] + z * this.toc.cell];
265
+ return {
266
+ x,
267
+ z,
268
+ corner,
269
+ meshes: new Map(c.blobs.map((b) => [b, this.#meshes.get(b)])),
270
+ instances: c.instances.map((r) => ({
271
+ blob: r[0],
272
+ material: r[1],
273
+ t: [corner[0] + r[2], corner[1] + r[3], corner[2] + r[4]],
274
+ r: [r[5], r[6], r[7], r[8]],
275
+ s: r[9],
276
+ })),
277
+ };
278
+ }
279
+ /** Releases the meshes only cell (x, z) used among the cells still `kept` (a set of "x,z" keys). */
280
+ dropCell(x, z, kept) {
281
+ const c = this.#cells.get(`${x},${z}`);
282
+ if (!c)
283
+ return;
284
+ const still = new Set();
285
+ for (const k of kept)
286
+ for (const b of this.#cells.get(k)?.blobs ?? [])
287
+ still.add(b);
288
+ for (const b of c.blobs)
289
+ if (!still.has(b))
290
+ this.#meshes.delete(b);
291
+ }
292
+ }
293
+ //# sourceMappingURL=archive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive.js","sourceRoot":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AAC;gBAC3B,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aACR,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;IAED,oGAAoG;IACpG,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,IAAyB;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,CAAC;YAAE,OAAO;QACf,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAChC,KAAK,MAAM,CAAC,IAAI,IAAI;YAAE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE;gBAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACpF,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;gBAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export { type ArchiveInstance, type ArchiveMaterial, type ArchiveMesh, type BlobEntry, CELL_MAGIC, CELL_VERSION, CellArchive, type CellEntry, type CellToc, decodeMesh, encodeMesh, httpRange, type LoadedCell, type RangeRead, type WorldInput, writeCellArchive } from './archive.ts';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // `@yali-engine/world` (M3, ADR-0201): worlds larger than memory, in cells read by HTTP Range.
2
+ export { CELL_MAGIC, CELL_VERSION, CellArchive, decodeMesh, encodeMesh, httpRange, writeCellArchive } from "./archive.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,EAAgF,UAAU,EAAE,YAAY,EAAE,WAAW,EAAgC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAoD,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@yali-engine/world",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.11.0",
4
+ "description": "Yali worlds: the cell archive (header, table of contents, content-addressed blobs) read by HTTP Range (M3, ADR-0201).",
5
+ "license": "MIT OR Apache-2.0",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {},
21
+ "scripts": {
22
+ "typecheck": "tsc -p tsconfig.json",
23
+ "test": "node --experimental-strip-types --no-warnings --test \"test/*.test.ts\""
24
+ }
6
25
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.