cajonzero 0.1.3 → 0.2.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.
- package/LICENSE +21 -21
- package/README.md +36 -53
- package/dist/bin/cj0.js +2145 -1553
- package/dist/catalog-BRO-mQoP.d.ts +67 -0
- package/dist/{config-B32NDXlr.d.ts → config-glwUbUbx.d.ts} +1 -1
- package/dist/core.d.ts +10 -7
- package/dist/core.js +15035 -312
- package/dist/index.d.ts +7 -5
- package/dist/index.js +31958 -9898
- package/dist/maps.d.ts +182 -0
- package/dist/maps.js +14062 -0
- package/dist/{providers-BwJKzGkd.d.ts → providers-Bu0-iMVs.d.ts} +114 -58
- package/dist/quickjs.wasm +0 -0
- package/dist/scaffold.d.ts +18 -15
- package/dist/scaffold.js +67 -45
- package/dist/serve.d.ts +2 -1
- package/dist/serve.js +32749 -10689
- package/dist/ui/assets/index-Bf4Kjuyg.js +4404 -0
- package/dist/ui/assets/index-ZzhH55rc.css +2 -0
- package/dist/ui/assets/{main-DTcEV4JE.js → main-DB66UjcY.js} +4 -4
- package/dist/ui/assets/{voxel.worker-CvX1GY4o.js → voxel.worker-BFiKMi1W.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/package.json +103 -95
- package/dist/ui/assets/index-Bhv7LV8L.css +0 -2
- package/dist/ui/assets/index-CNHWg0_t.js +0 -4404
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cajonzero — the map catalog (`cajonzero/maps.json`).
|
|
3
|
+
*
|
|
4
|
+
* A map root is either:
|
|
5
|
+
*
|
|
6
|
+
* - a same-origin path (`/maps/<slug>/`) that lives in the deployment's static
|
|
7
|
+
* assets — `cj0 add` writes it there and the worker reads it through
|
|
8
|
+
* `env.ASSETS`; or
|
|
9
|
+
* - an absolute `http(s)://…/` URL for maps hosted on an external OSS/CDN
|
|
10
|
+
* (the manual/split-CDN escape hatch).
|
|
11
|
+
*
|
|
12
|
+
* Expected layout under `entry.root` (exactly the archive layout):
|
|
13
|
+
*
|
|
14
|
+
* ```text
|
|
15
|
+
* <root>/bundle.json
|
|
16
|
+
* <root>/worlds/<worldId>/manifest.json
|
|
17
|
+
* <root>/worlds/<worldId>/data/project-state.json
|
|
18
|
+
* <root>/worlds/<worldId>/data/blobs/<cid>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Worker path: URL handling + validation only, no Node globals.
|
|
22
|
+
*/
|
|
23
|
+
/** The only catalog version this build understands. */
|
|
24
|
+
declare const MAP_CATALOG_VERSION = 1;
|
|
25
|
+
/** One map in the catalog. */
|
|
26
|
+
interface MapEntry {
|
|
27
|
+
/** Stable room/catalog id (`omega`, `drift`, …). */
|
|
28
|
+
readonly slug: string;
|
|
29
|
+
/** Same-origin path (`/maps/<slug>/`) or absolute `http(s)://…/` map root. */
|
|
30
|
+
readonly root: string;
|
|
31
|
+
/** `worlds/<worldId>` directory name; derived from `bundle.json` when absent. */
|
|
32
|
+
readonly worldId?: string;
|
|
33
|
+
/** Display name (falls back to the map's own manifest). */
|
|
34
|
+
readonly name?: string;
|
|
35
|
+
readonly author?: string;
|
|
36
|
+
readonly version?: string;
|
|
37
|
+
/** Optional content revision (e.g. `v1.0.4`); invalidates precomputed seeds. */
|
|
38
|
+
readonly etag?: string;
|
|
39
|
+
/** Cover image URL for the lobby. */
|
|
40
|
+
readonly cover?: string;
|
|
41
|
+
/** Optional CDN root for browser assets; defaults to {@link root}. */
|
|
42
|
+
readonly assetRoot?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Project-relative private script pack (`cajonzero/private/<slug>.json.gz`).
|
|
45
|
+
* Written by `cj0 add/update`; `cj0 deploy` uploads it to KV and it is never
|
|
46
|
+
* served from `public/`.
|
|
47
|
+
*/
|
|
48
|
+
readonly scriptsFile?: string;
|
|
49
|
+
}
|
|
50
|
+
/** The `maps.json` document. */
|
|
51
|
+
interface MapCatalog {
|
|
52
|
+
readonly version: typeof MAP_CATALOG_VERSION;
|
|
53
|
+
readonly maps: readonly MapEntry[];
|
|
54
|
+
}
|
|
55
|
+
/** No maps configured (the scaffold default). */
|
|
56
|
+
declare const EMPTY_MAP_CATALOG: MapCatalog;
|
|
57
|
+
/**
|
|
58
|
+
* Validate a parsed `maps.json`.
|
|
59
|
+
*
|
|
60
|
+
* @throws {MapCatalogError} for a malformed document, entry, or duplicate slug.
|
|
61
|
+
*/
|
|
62
|
+
declare function parseMapCatalog(input: unknown): MapCatalog;
|
|
63
|
+
/** Look up a map by slug. */
|
|
64
|
+
declare function findMap(catalog: MapCatalog, slug: string): MapEntry | undefined;
|
|
65
|
+
|
|
66
|
+
export { EMPTY_MAP_CATALOG as E, findMap as f, parseMapCatalog as p };
|
|
67
|
+
export type { MapEntry as M, MapCatalog as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TimestampedClientInput, N as NetPublic,
|
|
1
|
+
import { T as TimestampedClientInput, N as NetPublic, I as NetSecret } from './providers-Bu0-iMVs.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* cajonzero — mudb protocol envelope (message-id tables + `raw` channel).
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
export { C as CajonzeroConfig, D as DEFAULT_CONFIG, G as GAME_NET_INBOUND_BASE, a as GAME_NET_OUTBOUND_BASE, I as INBOUND_LAYOUT, M as MAX_INBOUND_FRAME_BYTES, b as MapsConfig, N as NetCodec, c as NetCodecError, d as NetCodecErrorCode, e as NetCodecHandlers, f as NetCodecOptions, O as OFFICIAL_PREFIX, g as OUTBOUND_LAYOUT, P as ProtocolDirection, h as ProtocolLayout, i as ProtocolSchemaLike, R as RoomConfig, j as chainLayouts, l as layoutMessages, k as layoutProtocol, m as matchesLayout, n as messageIds, o as messageNameAt, r as readNetFrameHeader, p as readNetMessageType, q as resolveConfig } from './config-
|
|
1
|
+
import { W as WorldSeed } from './providers-Bu0-iMVs.js';
|
|
2
|
+
export { E as EnvProvider, c as Repos, R as Room, d as RoomOptions, e as RuntimeProviders, f as SETTINGS, g as SETTING_KEYS, a as SettingDefaults, h as SettingDefinition, i as Settings, j as SettingsError, k as SettingsErrorCode, l as SettingsService, m as StorageFactory, S as StorageSource, n as Store, o as WorldSeedReader, p as configureDefaultKV, q as createMemoryStore, r as createRepos, s as createSettingsService, t as createStore, u as getRuntimeProviders, v as isSettingKey, w as memoryDriver, x as resolveAdminToken, y as resolveEnvironment, z as resolveRooms, A as resolveSessionSecret, B as resolveSettingDefaults, C as resolveStore, F as setRuntimeProviders, G as setStorageFactory } from './providers-Bu0-iMVs.js';
|
|
3
|
+
export { C as CajonzeroConfig, D as DEFAULT_CONFIG, G as GAME_NET_INBOUND_BASE, a as GAME_NET_OUTBOUND_BASE, I as INBOUND_LAYOUT, M as MAX_INBOUND_FRAME_BYTES, b as MapsConfig, N as NetCodec, c as NetCodecError, d as NetCodecErrorCode, e as NetCodecHandlers, f as NetCodecOptions, O as OFFICIAL_PREFIX, g as OUTBOUND_LAYOUT, P as ProtocolDirection, h as ProtocolLayout, i as ProtocolSchemaLike, R as RoomConfig, j as chainLayouts, l as layoutMessages, k as layoutProtocol, m as matchesLayout, n as messageIds, o as messageNameAt, r as readNetFrameHeader, p as readNetMessageType, q as resolveConfig } from './config-glwUbUbx.js';
|
|
4
|
+
import { M as MapEntry } from './catalog-BRO-mQoP.js';
|
|
5
|
+
export { E as EMPTY_MAP_CATALOG, a as MapCatalog, f as findMap, p as parseMapCatalog } from './catalog-BRO-mQoP.js';
|
|
4
6
|
import 'unstorage';
|
|
5
7
|
import 'gl-matrix';
|
|
6
8
|
import 'zod';
|
|
@@ -14,10 +16,11 @@ import 'zod';
|
|
|
14
16
|
* voxel chunk blobs. Meshes/audio are never downloaded by the server — the
|
|
15
17
|
* browser loads those straight from the same root.
|
|
16
18
|
*
|
|
17
|
-
* The seed is resolved on demand from
|
|
18
|
-
*
|
|
19
|
-
* `seed.json[.gz]` pack (`cj0
|
|
20
|
-
* single request — which is what keeps room startup inside Worker
|
|
19
|
+
* The seed is resolved on demand from the map root: map bytes stay on the CDN
|
|
20
|
+
* or in static assets, never in the deployment KV. When a precomputed
|
|
21
|
+
* `seed.json[.gz]` pack is present (`cj0 add` writes one), the whole graph is
|
|
22
|
+
* replaced by a single request — which is what keeps room startup inside Worker
|
|
23
|
+
* quotas.
|
|
21
24
|
*
|
|
22
25
|
* Worker path: `fetch`, `AbortController`, `TextDecoder` only.
|
|
23
26
|
*/
|