@wildshard/shard-format 0.15.0 → 0.17.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/package.json +36 -3
- package/src/format/assetAdmission.ts +5 -2
- package/src/format/baked-terrain.golden.json +2760 -0
- package/src/format/colliders.golden.json +1619 -0
- package/src/format/colliders.ts +568 -0
- package/src/format/contentBounds.ts +6 -0
- package/src/format/creature-perch-admission.ts +86 -0
- package/src/format/creature-perch.ts +269 -0
- package/src/format/creatures.ts +11 -8
- package/src/format/forest-placement.golden.json +4588 -0
- package/src/format/forest-placement.ts +385 -0
- package/src/format/geometry-layout.golden.json +180 -0
- package/src/format/grass-field.ts +287 -0
- package/src/format/headless-sections.ts +49 -0
- package/src/format/interact-table.golden.json +340 -0
- package/src/format/interact-table.ts +541 -0
- package/src/format/item-catalogue.golden.json +2310 -0
- package/src/format/item-catalogue.ts +148 -0
- package/src/format/mover-pose.ts +46 -0
- package/src/format/native-geometry-channels.ts +64 -0
- package/src/format/noise.ts +106 -0
- package/src/format/road-light.ts +47 -0
- package/src/format/seeded-rng.golden.json +857 -0
- package/src/format/seeded-rng.ts +111 -0
- package/src/format/shardSchema.ts +3 -0
- package/src/format/small-laws.golden.json +57 -0
- package/src/format/terrain-field.golden.json +3998 -0
- package/src/format/terrain-field.ts +405 -0
- package/src/format/whole-partition.ts +170 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/shard-format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The raw shardfile format: the spec, the validator and a validate CLI. The public, versioned contract every other repo builds on.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,17 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"src/format/*.ts",
|
|
20
20
|
"!src/format/*.test.ts",
|
|
21
|
+
"!src/format/*.golden-specs.ts",
|
|
21
22
|
"src/format/memoryGates.json",
|
|
23
|
+
"src/format/seeded-rng.golden.json",
|
|
24
|
+
"src/format/terrain-field.golden.json",
|
|
25
|
+
"src/format/baked-terrain.golden.json",
|
|
26
|
+
"src/format/forest-placement.golden.json",
|
|
27
|
+
"src/format/geometry-layout.golden.json",
|
|
28
|
+
"src/format/colliders.golden.json",
|
|
29
|
+
"src/format/small-laws.golden.json",
|
|
30
|
+
"src/format/interact-table.golden.json",
|
|
31
|
+
"src/format/item-catalogue.golden.json",
|
|
22
32
|
"src/tools/runtime-hosts.json",
|
|
23
33
|
"packages/wire/src/net-command.ts",
|
|
24
34
|
"src/cli/*.ts",
|
|
@@ -94,6 +104,7 @@
|
|
|
94
104
|
"./contracts": "./src/format/contracts.ts",
|
|
95
105
|
"./coverAppearance": "./src/format/coverAppearance.ts",
|
|
96
106
|
"./creatures": "./src/format/creatures.ts",
|
|
107
|
+
"./creaturePerch": "./src/format/creature-perch.ts",
|
|
97
108
|
"./creatureLayers": "./src/format/creature-layers.ts",
|
|
98
109
|
"./creatureSkeletons": "./src/format/creature-skeletons.ts",
|
|
99
110
|
"./crowdPresentation": "./src/format/crowdPresentation.ts",
|
|
@@ -400,7 +411,29 @@
|
|
|
400
411
|
"./worldUpdates": "./src/format/worldUpdates.ts",
|
|
401
412
|
"./incomingCapPolicy": "./src/format/incoming-cap-policy.ts",
|
|
402
413
|
"./strikeDebris": "./src/format/strike-debris.ts",
|
|
403
|
-
"./harvestRows": "./src/format/harvest-rows.ts"
|
|
414
|
+
"./harvestRows": "./src/format/harvest-rows.ts",
|
|
415
|
+
"./seededRng": "./src/format/seeded-rng.ts",
|
|
416
|
+
"./seeded-rng.golden.json": "./src/format/seeded-rng.golden.json",
|
|
417
|
+
"./noise": "./src/format/noise.ts",
|
|
418
|
+
"./terrainField": "./src/format/terrain-field.ts",
|
|
419
|
+
"./terrain-field.golden.json": "./src/format/terrain-field.golden.json",
|
|
420
|
+
"./forestPlacement": "./src/format/forest-placement.ts",
|
|
421
|
+
"./grassField": "./src/format/grass-field.ts",
|
|
422
|
+
"./forest-placement.golden.json": "./src/format/forest-placement.golden.json",
|
|
423
|
+
"./nativeGeometryChannels": "./src/format/native-geometry-channels.ts",
|
|
424
|
+
"./wholePartition": "./src/format/whole-partition.ts",
|
|
425
|
+
"./geometry-layout.golden.json": "./src/format/geometry-layout.golden.json",
|
|
426
|
+
"./colliders": "./src/format/colliders.ts",
|
|
427
|
+
"./colliders.golden.json": "./src/format/colliders.golden.json",
|
|
428
|
+
"./headlessSections": "./src/format/headless-sections.ts",
|
|
429
|
+
"./roadLight": "./src/format/road-light.ts",
|
|
430
|
+
"./moverPose": "./src/format/mover-pose.ts",
|
|
431
|
+
"./small-laws.golden.json": "./src/format/small-laws.golden.json",
|
|
432
|
+
"./interactTable": "./src/format/interact-table.ts",
|
|
433
|
+
"./interact-table.golden.json": "./src/format/interact-table.golden.json",
|
|
434
|
+
"./itemCatalogue": "./src/format/item-catalogue.ts",
|
|
435
|
+
"./item-catalogue.golden.json": "./src/format/item-catalogue.golden.json",
|
|
436
|
+
"./baked-terrain.golden.json": "./src/format/baked-terrain.golden.json"
|
|
404
437
|
},
|
|
405
438
|
"engines": {
|
|
406
439
|
"node": ">=24.18.0"
|
|
@@ -408,7 +441,7 @@
|
|
|
408
441
|
"packageManager": "pnpm@10.34.9",
|
|
409
442
|
"scripts": {
|
|
410
443
|
"pnpm:devPreinstall": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && git config core.hooksPath .githooks || true",
|
|
411
|
-
"typecheck": "npr tsc -p kit/tsconfig.json && npr tsc -p src/format/tsconfig.json && npr tsc -p src/format/tsconfig.lib.json",
|
|
444
|
+
"typecheck": "npr tsc -p kit/tsconfig.json && npr tsc -p src/format/tsconfig.json && npr tsc -p src/format/tsconfig.lib.json && npr tsc -p tsconfig.browser-tools.json",
|
|
412
445
|
"lint": "node kit/scripts/lint.mjs --type-aware --deny-warnings --no-error-on-unmatched-pattern --ignore-pattern '.githooks/**' --ignore-pattern '.agents/**' --ignore-pattern 'scripts/agent-parity.mjs' --ignore-pattern 'scripts/agent-sync.mjs' --ignore-pattern 'scripts/scratch-dir*' --ignore-pattern 'scripts/scratch-sweep*' --ignore-pattern 'scripts/lane-live*' --ignore-pattern 'scripts/leftovers-report*' --ignore-pattern 'scripts/keep-copy*' --ignore-pattern 'scripts/disk-audit*' --ignore-pattern 'test/tooling/disk-land.test.mjs' --ignore-pattern 'test/tooling/land-fixture.mjs' --ignore-pattern 'test/tooling/owned-scratch.mjs' --ignore-pattern 'test/tooling/lane-live.test.mjs' --ignore-pattern 'test/tooling/keep-copy.test.mjs' --ignore-pattern 'test/tooling/leftovers-report.test.mjs' --ignore-pattern 'test/tooling/reap-report.test.mjs' --ignore-pattern 'tmp/**' --ignore-pattern 'src/format/**' --ignore-pattern 'scripts/chromium-keychain*' --ignore-pattern 'scripts/worktree-ignore*' --ignore-pattern 'scripts/land*' --ignore-pattern 'scripts/main-push*' --ignore-pattern 'scripts/worktree.mjs' --ignore-pattern 'scripts/worktree-reap.mjs' --ignore-pattern 'scripts/pid-lock*' --ignore-pattern 'scripts/apfs-clone.mjs' --ignore-pattern 'scripts/assert-store-layout.mjs' --ignore-pattern 'test/tooling/worktree-guard.test.mjs' --ignore-pattern 'scripts/vite-tmp*' --ignore-pattern 'vitest.config.ts' --ignore-pattern 'test/tooling/chrome-keychain.test.mjs' --ignore-pattern 'packages/wire/frozen/**' --ignore-pattern 'packages/wire/lib/**'",
|
|
413
446
|
"lint:fix": "node kit/scripts/lint.mjs --type-aware --fix --ignore-pattern '.githooks/**' --ignore-pattern '.agents/**' --ignore-pattern 'scripts/agent-parity.mjs' --ignore-pattern 'scripts/agent-sync.mjs' --ignore-pattern 'scripts/scratch-dir*' --ignore-pattern 'scripts/scratch-sweep*' --ignore-pattern 'scripts/lane-live*' --ignore-pattern 'scripts/leftovers-report*' --ignore-pattern 'scripts/keep-copy*' --ignore-pattern 'scripts/disk-audit*' --ignore-pattern 'test/tooling/disk-land.test.mjs' --ignore-pattern 'test/tooling/land-fixture.mjs' --ignore-pattern 'test/tooling/owned-scratch.mjs' --ignore-pattern 'test/tooling/lane-live.test.mjs' --ignore-pattern 'test/tooling/keep-copy.test.mjs' --ignore-pattern 'test/tooling/leftovers-report.test.mjs' --ignore-pattern 'test/tooling/reap-report.test.mjs' --ignore-pattern 'tmp/**' --ignore-pattern 'src/format/**'",
|
|
414
447
|
"lint:format": "node src/tools/format-ratchet.ts",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { acceptsShardfileCost, textureLibrarySource } from './deviceMemoryCost.ts';
|
|
2
|
+
import { creaturePerchAdmissionRows } from './creature-perch.ts';
|
|
2
3
|
import { admitScriptContract, decisionModuleContracts, type ScriptAdmissionRows } from './scriptContract.ts';
|
|
3
4
|
import type { TextureTranscodeSupport } from './contentBounds.ts';
|
|
4
5
|
import { admitScript } from './scriptAdmission.ts';
|
|
@@ -89,7 +90,9 @@ interface AssetAdmission {
|
|
|
89
90
|
function assetAdmission(input: unknown, memory: MemoryAdmission | undefined, scripts: ScriptAdmissionRows, sections?: ReadonlyMap<string, unknown>): AssetAdmission {
|
|
90
91
|
preflightShardfile(input);
|
|
91
92
|
const s = parseShardfile(input, sections), files = new Map(s.files.map((f) => [f.hash, f]));
|
|
92
|
-
const
|
|
93
|
+
const perchRows = creaturePerchAdmissionRows(s.creatures.perchBodies ?? [], scripts);
|
|
94
|
+
const combined = [...scripts, ...perchRows];
|
|
95
|
+
const contracts = decisionModuleContracts(combined, s.files);
|
|
93
96
|
const legacyModules = new Set([...s.sim.scripts, ...s.clientScripts.bindings.map(row => row.module), ...s.movers.filter(row => row.execution !== 'native').map(row => row.module)]);
|
|
94
97
|
if ([...contracts.keys()].some(hash => legacyModules.has(hash))) throw new Error('Decision module cannot also use a legacy script host');
|
|
95
98
|
preflightAssetGraph(s);
|
|
@@ -115,7 +118,7 @@ function assetAdmission(input: unknown, memory: MemoryAdmission | undefined, scr
|
|
|
115
118
|
const propMaterials = s.props?.materials;
|
|
116
119
|
const propModels = new Set([...s.props?.tiles ?? [], ...s.props?.panels ?? [], ...s.props?.models ?? []].map(row => row.file));
|
|
117
120
|
if (s.props?.far !== undefined && s.props.far !== null) propModels.add(s.props.far);
|
|
118
|
-
return { shard: s, files, contracts, declared, closure, sum, commons: 0, commonsCosts, admissions, propMaterials, propModels, scripts };
|
|
121
|
+
return { shard: s, files, contracts, declared, closure, sum, commons: 0, commonsCosts, admissions, propMaterials, propModels, scripts: combined };
|
|
119
122
|
}
|
|
120
123
|
|
|
121
124
|
/** The pinned commons: present, of their wire size and hash, and of their pinned costs. */
|