@wildshard/sdk 0.0.0 → 0.2.3
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/GUIDE.md +790 -0
- package/README.md +14 -4
- package/bin/wildshard.mjs +38 -0
- package/lint/declaration-config.d.mts +2 -0
- package/lint/declaration-config.mjs +19 -0
- package/lint/engine-plugin.d.mts +2 -0
- package/lint/engine-plugin.mjs +40 -0
- package/lint/host-callbacks.d.mts +6 -0
- package/lint/host-callbacks.mjs +123 -0
- package/lint/host-files.d.mts +1 -0
- package/lint/host-files.mjs +7 -0
- package/lint/layer-exports.d.mts +2 -0
- package/lint/layer-exports.mjs +21 -0
- package/lint/legacy-line-basis.json +995 -0
- package/lint/nine-tiling-baseline.json +35 -0
- package/lint/ratchet.json +11 -0
- package/lint/runtime-files.d.mts +12 -0
- package/lint/runtime-files.json +16 -0
- package/lint/runtime-files.mjs +69 -0
- package/lint/runtime-performance.d.mts +6 -0
- package/lint/runtime-performance.mjs +184 -0
- package/lint/sdk-plugin.d.mts +4 -0
- package/lint/sdk-plugin.mjs +134 -0
- package/lint/shardfile-boundaries.d.mts +10 -0
- package/lint/shardfile-boundaries.mjs +122 -0
- package/lint/tile-bake-debt.json +556 -0
- package/package.json +371 -4
- package/scripts/agent-parity.mjs +1524 -0
- package/scripts/agent-sync.mjs +518 -0
- package/scripts/apfs-clone.mjs +67 -0
- package/scripts/assert-store-layout.mjs +23 -0
- package/scripts/astc6-phone-cap.d.mts +3 -0
- package/scripts/astc6-phone-cap.mjs +137 -0
- package/scripts/audit-assets.d.mts +10 -0
- package/scripts/audit-assets.mjs +151 -0
- package/scripts/bake/coatFiles.d.mts +6 -0
- package/scripts/bake/coatFiles.mjs +37 -0
- package/scripts/bake/environment.d.mts +2 -0
- package/scripts/bake/environment.mjs +58 -0
- package/scripts/bake/far-proxies.mjs +45 -0
- package/scripts/bake/keyed-sky.d.mts +4 -0
- package/scripts/bake/keyed-sky.mjs +34 -0
- package/scripts/bake/movers.mjs +56 -0
- package/scripts/bake/nativeWorld.d.mts +6 -0
- package/scripts/bake/nativeWorld.mjs +43 -0
- package/scripts/bake/navmeshGround.ts +22 -0
- package/scripts/bake/near-placeholder.mjs +331 -0
- package/scripts/bake/placeholderShards.mjs +41 -0
- package/scripts/bake/skins.mjs +15 -0
- package/scripts/bake/template-skins.mjs +33 -0
- package/scripts/bake/viewmodelBytes.ts +26 -0
- package/scripts/bake/viewmodelPage.ts +11 -0
- package/scripts/bake/worldHost.d.mts +35 -0
- package/scripts/bake/worldHost.mjs +110 -0
- package/scripts/bake-astc6.cache.json +80 -0
- package/scripts/bake-astc6.far-reach.cache.json +23 -0
- package/scripts/bake-astc6.list.json +111 -0
- package/scripts/bake-astc6.mjs +279 -0
- package/scripts/bake-astc6.nalati-grasslands.cache.json +42 -0
- package/scripts/bake-catalogue.mjs +44 -0
- package/scripts/bake-check.mjs +54 -0
- package/scripts/bake-chunk.mjs +124 -0
- package/scripts/bake-cloud-field.mjs +24 -0
- package/scripts/bake-coats.mjs +110 -0
- package/scripts/bake-data-maps.d.mts +24 -0
- package/scripts/bake-data-maps.mjs +72 -0
- package/scripts/bake-entry-programs.mjs +117 -0
- package/scripts/bake-geometry.mjs +106 -0
- package/scripts/bake-hybrid-tiles.mjs +28 -0
- package/scripts/bake-ktx2.cache.json +276 -0
- package/scripts/bake-ktx2.list.json +365 -0
- package/scripts/bake-ktx2.mjs +477 -0
- package/scripts/bake-map-glb.mjs +127 -0
- package/scripts/bake-map-rest.d.mts +7 -0
- package/scripts/bake-map-rest.mjs +50 -0
- package/scripts/bake-maps.mjs +200 -0
- package/scripts/bake-navmesh.mjs +259 -0
- package/scripts/bake-packs.mjs +129 -0
- package/scripts/bake-pickups.mjs +102 -0
- package/scripts/bake-query-terrain.mjs +64 -0
- package/scripts/bake-recurve-pool.mjs +16 -0
- package/scripts/bake-section-schemas.d.mts +3 -0
- package/scripts/bake-template-shardfile.mjs +32 -0
- package/scripts/bake-textures.mjs +80 -0
- package/scripts/bake-viewmodel-sets.json +45 -0
- package/scripts/bake-viewmodel-sets.mjs +137 -0
- package/scripts/bake-voxel-ao.mjs +119 -0
- package/scripts/bake-water-ripples.mjs +25 -0
- package/scripts/blender/README.md +129 -0
- package/scripts/blender/build.sh +166 -0
- package/scripts/blender/lib/export-scene.mjs +129 -0
- package/scripts/blender/lib/glb-digest.mjs +188 -0
- package/scripts/blender/lib/glb.py +68 -0
- package/scripts/blender/lib/save_blend.py +17 -0
- package/scripts/blender/lib/world_fixture.py +55 -0
- package/scripts/blender/targets.json +591 -0
- package/scripts/build-sdk.mjs +95 -0
- package/scripts/build-shardfiles.d.mts +7 -0
- package/scripts/build-shardfiles.mjs +206 -0
- package/scripts/capture-hero.mjs +137 -0
- package/scripts/check-lift-review.mjs +23 -0
- package/scripts/chromium-keychain-check.mjs +139 -0
- package/scripts/chromium-keychain.d.mts +1 -0
- package/scripts/chromium-keychain.mjs +5 -0
- package/scripts/compile-script.d.mts +3 -0
- package/scripts/compile-script.mjs +8 -0
- package/scripts/creature-color.mjs +255 -0
- package/scripts/decide/calibrate.py +127 -0
- package/scripts/decide/calibration/2026-10-03/labels-s1.tsv +281 -0
- package/scripts/decide/calibration/2026-10-03/labels-s2.tsv +97 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3.tsv +48 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3b.tsv +26 -0
- package/scripts/decide/calibration/2026-10-03/res-capture-status-v1.jsonl +376 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-strings.jsonl +48 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-v1.jsonl +73 -0
- package/scripts/decide/decide.py +262 -0
- package/scripts/decide/decide.sh +50 -0
- package/scripts/decide/layer-purity-pilot.mjs +41 -0
- package/scripts/decide/sets/capture-status.json +46 -0
- package/scripts/decide/sets/layer-purity.json +28 -0
- package/scripts/decide/sets/text-garbled.json +17 -0
- package/scripts/decide/test_decide.py +37 -0
- package/scripts/docs.mjs +15 -0
- package/scripts/entry-reads/crawl.ts +152 -0
- package/scripts/entry-reads/tsconfig.json +25 -0
- package/scripts/gen-format-schema.d.mts +2 -0
- package/scripts/gen-format-schema.mjs +21 -0
- package/scripts/gen-host-catalogue.d.mts +14 -0
- package/scripts/gen-host-catalogue.mjs +108 -0
- package/scripts/gen-shard-layout-doc.d.mts +4 -0
- package/scripts/gen-shard-layout-doc.mjs +55 -0
- package/scripts/gen-shards.d.mts +17 -0
- package/scripts/gen-shards.mjs +311 -0
- package/scripts/goldens/capture-inputs.d.mts +4 -0
- package/scripts/goldens/capture-inputs.mjs +34 -0
- package/scripts/goldens/colour_shift.py +27 -0
- package/scripts/goldens/native-residency.d.mts +10 -0
- package/scripts/goldens/native-residency.mjs +104 -0
- package/scripts/goldens/plot-inputs.d.mts +12 -0
- package/scripts/goldens/plot-inputs.mjs +46 -0
- package/scripts/gpu-texmem.mjs +98 -0
- package/scripts/horizon-matte/config.py +24 -0
- package/scripts/horizon-matte/encode.py +91 -0
- package/scripts/horizon-matte/key.py +141 -0
- package/scripts/horizon-matte/mkjobs.py +33 -0
- package/scripts/horizon-matte/mkjobs_day2.py +11 -0
- package/scripts/horizon-matte/overlap.py +80 -0
- package/scripts/horizon-matte/run_codex.py +57 -0
- package/scripts/horizon-matte/stitch.py +133 -0
- package/scripts/img2mesh/CC0.md +105 -0
- package/scripts/img2mesh/README.md +209 -0
- package/scripts/img2mesh/ab_board.py +102 -0
- package/scripts/img2mesh/birds/birds.json +255 -0
- package/scripts/img2mesh/birds/birds_atlas.py +150 -0
- package/scripts/img2mesh/birds/birds_fix_preview.mjs +103 -0
- package/scripts/img2mesh/birds/birds_fix_render.py +75 -0
- package/scripts/img2mesh/birds/birds_pack.py +110 -0
- package/scripts/img2mesh/birds/birds_phone_b.py +112 -0
- package/scripts/img2mesh/birds/birds_post.py +550 -0
- package/scripts/img2mesh/birds/birds_render.py +125 -0
- package/scripts/img2mesh/birds/birds_sheet.py +33 -0
- package/scripts/img2mesh/birds/birds_view.py +60 -0
- package/scripts/img2mesh/board.py +100 -0
- package/scripts/img2mesh/build_cc0.sh +52 -0
- package/scripts/img2mesh/build_driftwood.sh +12 -0
- package/scripts/img2mesh/build_faces.sh +53 -0
- package/scripts/img2mesh/build_props.py +81 -0
- package/scripts/img2mesh/cc0_export.py +186 -0
- package/scripts/img2mesh/driftwood_post.py +571 -0
- package/scripts/img2mesh/e304_faces.sh +67 -0
- package/scripts/img2mesh/face_remaster.py +911 -0
- package/scripts/img2mesh/face_views.py +95 -0
- package/scripts/img2mesh/faces-e304.json +9 -0
- package/scripts/img2mesh/faces.json +30 -0
- package/scripts/img2mesh/head_cut.py +100 -0
- package/scripts/img2mesh/hi3d_paint.py +94 -0
- package/scripts/img2mesh/hi3d_refine.py +161 -0
- package/scripts/img2mesh/hunyuan_cpu_rasterizer.sh +42 -0
- package/scripts/img2mesh/pine_hollow_phone.sh +13 -0
- package/scripts/img2mesh/props/coral-arch.json +32 -0
- package/scripts/img2mesh/props/ember-furnace.json +30 -0
- package/scripts/img2mesh/props/night-market-gate.json +10 -0
- package/scripts/img2mesh/render_still.py +86 -0
- package/scripts/img2mesh/rig_strip.mjs +46 -0
- package/scripts/img2mesh/rig_transfer.mjs +104 -0
- package/scripts/img2mesh/split_sheet.py +48 -0
- package/scripts/img2mesh/trellis_batch.py +110 -0
- package/scripts/img2mesh/versus_board.py +114 -0
- package/scripts/import-bundle.d.mts +2 -0
- package/scripts/import-bundle.mjs +20 -0
- package/scripts/ktx2-ab-board.py +133 -0
- package/scripts/ktx2-ab.mjs +111 -0
- package/scripts/ktx2-settings.mjs +18 -0
- package/scripts/land.d.mts +14 -0
- package/scripts/land.mjs +809 -0
- package/scripts/lint-dispatch.mjs +14 -0
- package/scripts/map-bake-frames.d.mts +4 -0
- package/scripts/map-bake-frames.mjs +23 -0
- package/scripts/map-geometry.d.mts +9 -0
- package/scripts/map-geometry.mjs +29 -0
- package/scripts/map-world.mjs +162 -0
- package/scripts/mockup-local.sh +46 -0
- package/scripts/music/export-midi.mjs +68 -0
- package/scripts/music/gen/analyze.py +308 -0
- package/scripts/music/gen/audio_jobs.py +46 -0
- package/scripts/music/gen/briefs.json +51 -0
- package/scripts/music/gen/build_page.py +334 -0
- package/scripts/music/gen/folk.json +3187 -0
- package/scripts/music/gen/gen_ace_step.py +156 -0
- package/scripts/music/gen/gen_heartmula.py +187 -0
- package/scripts/music/gen/gen_minimax.py +143 -0
- package/scripts/music/gen/gen_sao.py +122 -0
- package/scripts/music/gen/gen_sao_small.py +104 -0
- package/scripts/music/gen/gen_sfx.py +98 -0
- package/scripts/music/gen/gen_sfx_ezaudio.py +112 -0
- package/scripts/music/gen/gen_sfx_moss.py +112 -0
- package/scripts/music/gen/models.json +61 -0
- package/scripts/music/gen/nalati-jobs.json +104 -0
- package/scripts/music/gen/nalati-score-build.json +119 -0
- package/scripts/music/gen/nalati-score.json +3448 -0
- package/scripts/music/gen/ob7-fit-decisions.json +38 -0
- package/scripts/music/gen/ob7-score-jobs.json +152 -0
- package/scripts/music/gen/ob7-sfx-jobs.json +897 -0
- package/scripts/music/gen/ob7_build.py +469 -0
- package/scripts/music/gen/ob7_generate.py +67 -0
- package/scripts/music/gen/ob7_run.sh +42 -0
- package/scripts/music/gen/orchestral.json +3187 -0
- package/scripts/music/gen/own_score.py +486 -0
- package/scripts/music/gen/ph-jobs.json +27 -0
- package/scripts/music/gen/ph_page.py +222 -0
- package/scripts/music/gen/piano.json +3175 -0
- package/scripts/music/gen/rank_v3.py +248 -0
- package/scripts/music/gen/sfx-best.json +2486 -0
- package/scripts/music/gen/sfx-ezaudio.json +4082 -0
- package/scripts/music/gen/sfx-jobs.json +57 -0
- package/scripts/music/gen/sfx-minimax-jobs.json +16 -0
- package/scripts/music/gen/sfx-minimax.json +289 -0
- package/scripts/music/gen/sfx-moss.json +4082 -0
- package/scripts/music/gen/sfx-nalati-b3-jobs.json +17 -0
- package/scripts/music/gen/sfx-nalati-jobs.json +338 -0
- package/scripts/music/gen/sfx-nalati.json +11202 -0
- package/scripts/music/gen/sfx-nd-jobs.json +57 -0
- package/scripts/music/gen/sfx-nd-moss.json +2097 -0
- package/scripts/music/gen/sfx-nd-sa3-medium.json +2097 -0
- package/scripts/music/gen/sfx-nd-summary.json +38 -0
- package/scripts/music/gen/sfx-peaks.json +7 -0
- package/scripts/music/gen/sfx-ph-jobs.json +169 -0
- package/scripts/music/gen/sfx-ph-moss.json +6564 -0
- package/scripts/music/gen/sfx-ph-sa3-medium.json +7239 -0
- package/scripts/music/gen/sfx-ph-summary.json +63 -0
- package/scripts/music/gen/sfx-sa3-medium.json +4082 -0
- package/scripts/music/gen/sfx-sa3.json +4082 -0
- package/scripts/music/gen/sfx-summary.json +107 -0
- package/scripts/music/gen/sfx_build.py +332 -0
- package/scripts/music/gen/sfx_merge.py +255 -0
- package/scripts/music/gen/sfx_minimax.py +61 -0
- package/scripts/music/gen/sfx_nalati.py +331 -0
- package/scripts/music/gen/sfx_sprite.py +424 -0
- package/scripts/music/gen/stems.py +539 -0
- package/scripts/music/gen/test_loop_meter.py +29 -0
- package/scripts/music/gen/test_ob7_provenance.py +77 -0
- package/scripts/music/gen/v3-folk-build.json +148 -0
- package/scripts/music/gen/v3-folk.json +1818 -0
- package/scripts/music/gen/v3-jobs.json +145 -0
- package/scripts/music/gen/v3-orchestral-build.json +148 -0
- package/scripts/music/gen/v3-orchestral.json +1813 -0
- package/scripts/music/gen/v3-ph-folk-build.json +94 -0
- package/scripts/music/gen/v3-ph-folk.json +1806 -0
- package/scripts/music/gen/v3-ph-orchestral-build.json +94 -0
- package/scripts/music/gen/v3-ph-orchestral.json +1824 -0
- package/scripts/music/gen/v3-ph-piano-build.json +94 -0
- package/scripts/music/gen/v3-ph-piano.json +1818 -0
- package/scripts/music/gen/v3-piano-build.json +148 -0
- package/scripts/music/gen/v3-piano.json +1813 -0
- package/scripts/music/wildshard-theme.mid +0 -0
- package/scripts/music/wildshard-trailer30.mid +0 -0
- package/scripts/named-blob-output.d.mts +8 -0
- package/scripts/named-blob-output.mjs +48 -0
- package/scripts/pack-all.mjs +15 -0
- package/scripts/pid-lock.d.mts +1 -0
- package/scripts/pid-lock.mjs +63 -0
- package/scripts/practice/bake_dummy.py +53 -0
- package/scripts/practice/build_dummies.sh +43 -0
- package/scripts/practice/dummy_parts.py +568 -0
- package/scripts/practice/dummy_rig_gate.py +139 -0
- package/scripts/practice/gate_sheet.py +36 -0
- package/scripts/practice/generate_dummy_unimate.py +132 -0
- package/scripts/practice/pack_dummy.mjs +59 -0
- package/scripts/practice/repair_dummy_weights.mjs +68 -0
- package/scripts/practice/rig_dummy.py +828 -0
- package/scripts/practice/verify_unimate_skin.mjs +356 -0
- package/scripts/preparation-seed.mjs +15 -0
- package/scripts/prepare-basis-tool.mjs +6 -0
- package/scripts/prepare-product.d.mts +14 -0
- package/scripts/prepare-product.mjs +101 -0
- package/scripts/product-build-tools.d.mts +3 -0
- package/scripts/product-build-tools.json +3 -0
- package/scripts/product-build-tools.mjs +31 -0
- package/scripts/publish-public.mjs +7 -0
- package/scripts/push-tables.d.mts +1 -0
- package/scripts/push-tables.mjs +28 -0
- package/scripts/record-shard-mounts.mjs +133 -0
- package/scripts/sdk-externals.d.mts +2 -0
- package/scripts/sdk-externals.mjs +2 -0
- package/scripts/section-inventory.ts +209 -0
- package/scripts/select-candidate.mjs +15 -0
- package/scripts/shard-build-pool.d.mts +4 -0
- package/scripts/shard-build-pool.mjs +53 -0
- package/scripts/shard-line-baseline.json +17 -0
- package/scripts/shard-milestones.d.mts +15 -0
- package/scripts/shard-milestones.mjs +105 -0
- package/scripts/shard-output-report.d.mts +9 -0
- package/scripts/shard-output-report.mjs +85 -0
- package/scripts/shard-platform-cli.mjs +93 -0
- package/scripts/shard-progress.mjs +212 -0
- package/scripts/shard-timelapse.py +102 -0
- package/scripts/shardfile-cold-boot.mjs +79 -0
- package/scripts/shardfile-vite.d.mts +4 -0
- package/scripts/shardfile-vite.mjs +20 -0
- package/scripts/simplify-models.mjs +24 -0
- package/scripts/site-facts.mjs +88 -0
- package/scripts/test-template-gate.mjs +44 -0
- package/scripts/test_golden_compare.py +68 -0
- package/scripts/tex-tiers.cache.json +181 -0
- package/scripts/tex-tiers.mjs +240 -0
- package/scripts/texmem-probe.mjs +184 -0
- package/scripts/unused-assets.mjs +173 -0
- package/scripts/vite-tmp.d.mts +23 -0
- package/scripts/vite-tmp.mjs +157 -0
- package/scripts/wave-line-baselines.json +32 -0
- package/scripts/wildshard.d.mts +4 -0
- package/scripts/wildshard.mjs +105 -0
- package/scripts/witness-checkpoints.d.mts +10 -0
- package/scripts/witness-checkpoints.mjs +84 -0
- package/scripts/witness-generation.d.mts +10 -0
- package/scripts/witness-generation.mjs +45 -0
- package/scripts/witness-manifests.d.mts +8 -0
- package/scripts/witness-manifests.mjs +157 -0
- package/scripts/worktree-ignore.d.mts +4 -0
- package/scripts/worktree-ignore.mjs +36 -0
- package/scripts/worktree-reap.mjs +214 -0
- package/scripts/worktree.mjs +396 -0
- package/scripts/worldclaw/capture-front.sh +28 -0
- package/scripts/worldclaw/design-template.md +62 -0
- package/scripts/worldclaw/spec-map.py +92 -0
- package/scripts/worldclaw/spec.ts +96 -0
- package/skills/wildshard/SKILL.md +50 -0
- package/skills/wildshard-goldens/SKILL.md +54 -0
- package/skills/wildshard-mockup-to-model/SKILL.md +56 -0
- package/skills/wildshard-upgrade/SKILL.md +46 -0
- package/src/.oxfmtrc.json +50 -0
- package/src/.oxlintrc.json +173 -0
- package/src/cli/account/account.ts +199 -0
- package/src/cli/account/command.ts +193 -0
- package/src/cli/account/key.ts +154 -0
- package/src/cli/args.ts +97 -0
- package/src/cli/audio/audio.ts +24 -0
- package/src/cli/bin.mjs +8 -0
- package/src/cli/delete/delete.ts +258 -0
- package/src/cli/help.ts +196 -0
- package/src/cli/hero/adopt.ts +103 -0
- package/src/cli/hero/hero.ts +112 -0
- package/src/cli/hero/stamp.ts +298 -0
- package/src/cli/main.ts +292 -0
- package/src/cli/report.ts +16 -0
- package/src/cli/shardfile/command.ts +50 -0
- package/src/cli/shardfile/shardfile.ts +192 -0
- package/src/cli/upload/api.ts +246 -0
- package/src/cli/upload/compress.ts +55 -0
- package/src/cli/upload/hero.ts +62 -0
- package/src/cli/upload/placement.ts +115 -0
- package/src/cli/upload/provenance.ts +192 -0
- package/src/cli/upload/signature.ts +30 -0
- package/src/cli/upload/upload.ts +269 -0
- package/src/cli/upload/validate.ts +74 -0
- package/src/cli/upload/wire.ts +147 -0
- package/src/cli/version.ts +63 -0
- package/src/commons/bake/portableMath.ts +187 -0
- package/src/commons/catalogue.ts +10 -0
- package/src/commons/courseProgram.ts +32 -0
- package/src/commons/practiceCourse.ts +16 -0
- package/src/commons/scripts/abi.as +14 -0
- package/src/commons/scripts/bridge.as +14 -0
- package/src/commons/scripts/course.as +63 -0
- package/src/scripts/ask-new.sh +29 -0
- package/src/scripts/asks.mjs +141 -0
- package/src/scripts/herdr-prompt.sh +34 -0
- package/src/scripts/herdr-question-open.sh +67 -0
- package/src/scripts/md-wrap.mjs +229 -0
- package/src/server/app.ts +19 -0
- package/src/server/serve.ts +49 -0
- package/src/sharddev/admission.ts +7 -0
- package/src/sharddev/arenaView.ts +15 -0
- package/src/sharddev/as/groupBankV2.ts +36 -0
- package/src/sharddev/as/groupStepV2.ts +13 -0
- package/src/sharddev/as/ws.ts +30 -0
- package/src/sharddev/as/wsV2.ts +180 -0
- package/src/sharddev/assemblyscriptCompiler.d.mts +5 -0
- package/src/sharddev/assemblyscriptCompiler.mjs +14 -0
- package/src/sharddev/assetHandle.ts +84 -0
- package/src/sharddev/assetOwner.ts +70 -0
- package/src/sharddev/assetScope.ts +30 -0
- package/src/sharddev/assets.ts +21 -0
- package/src/sharddev/audio.ts +9 -0
- package/src/sharddev/audioEncode.ts +211 -0
- package/src/sharddev/author.ts +3 -0
- package/src/sharddev/authorError.ts +28 -0
- package/src/sharddev/authorManifest.ts +39 -0
- package/src/sharddev/bake/annulus.ts +19 -0
- package/src/sharddev/bake/assemblyscriptMemo.ts +76 -0
- package/src/sharddev/bake/assemblyscriptMemoPort.ts +4 -0
- package/src/sharddev/bake/authoredWorld.ts +201 -0
- package/src/sharddev/bake/basisEncoder.ts +95 -0
- package/src/sharddev/bake/basisGlb.ts +85 -0
- package/src/sharddev/bake/basisTool.ts +74 -0
- package/src/sharddev/bake/basisToolInputs.ts +476 -0
- package/src/sharddev/bake/byteCodec.ts +33 -0
- package/src/sharddev/bake/canvasAtlas.ts +406 -0
- package/src/sharddev/bake/coarseCopy.ts +59 -0
- package/src/sharddev/bake/colliders.ts +87 -0
- package/src/sharddev/bake/compactGlb.ts +224 -0
- package/src/sharddev/bake/compileScript.ts +119 -0
- package/src/sharddev/bake/compileScriptV2.ts +75 -0
- package/src/sharddev/bake/contactRows.ts +84 -0
- package/src/sharddev/bake/creaturePlacement.ts +117 -0
- package/src/sharddev/bake/export.ts +67 -0
- package/src/sharddev/bake/facetedGeometry.ts +379 -0
- package/src/sharddev/bake/farImpostor.ts +120 -0
- package/src/sharddev/bake/forest.ts +100 -0
- package/src/sharddev/bake/format-hook.mjs +2 -0
- package/src/sharddev/bake/generatorGlb.ts +23 -0
- package/src/sharddev/bake/geometryBounds.ts +77 -0
- package/src/sharddev/bake/geometryError.ts +48 -0
- package/src/sharddev/bake/glb.ts +355 -0
- package/src/sharddev/bake/glbCompression.ts +143 -0
- package/src/sharddev/bake/gltfSource.ts +59 -0
- package/src/sharddev/bake/groundMap.ts +142 -0
- package/src/sharddev/bake/image.ts +20 -0
- package/src/sharddev/bake/isleMap.ts +64 -0
- package/src/sharddev/bake/json.mjs +84 -0
- package/src/sharddev/bake/keyedSky.ts +47 -0
- package/src/sharddev/bake/keyedSkyMemo.ts +39 -0
- package/src/sharddev/bake/kinds.ts +137 -0
- package/src/sharddev/bake/lightSources.ts +31 -0
- package/src/sharddev/bake/mapAssembly.ts +84 -0
- package/src/sharddev/bake/mapRaster.ts +173 -0
- package/src/sharddev/bake/mapRest.ts +57 -0
- package/src/sharddev/bake/mapScenes.ts +234 -0
- package/src/sharddev/bake/materialGraph.ts +32 -0
- package/src/sharddev/bake/meadow.ts +27 -0
- package/src/sharddev/bake/meshoptChoiceMemo.ts +34 -0
- package/src/sharddev/bake/nativeInteractionFacts.ts +5 -0
- package/src/sharddev/bake/nativeLattice.ts +178 -0
- package/src/sharddev/bake/nativeRaster.ts +106 -0
- package/src/sharddev/bake/nativeTerrainField.ts +11 -0
- package/src/sharddev/bake/navigation-json.mjs +38 -0
- package/src/sharddev/bake/navigation.ts +113 -0
- package/src/sharddev/bake/navigationAsset.ts +18 -0
- package/src/sharddev/bake/nearPlaceholder.ts +206 -0
- package/src/sharddev/bake/normalizeRig.ts +80 -0
- package/src/sharddev/bake/phoneAstc.ts +93 -0
- package/src/sharddev/bake/placeholders.ts +581 -0
- package/src/sharddev/bake/placement.ts +80 -0
- package/src/sharddev/bake/portableBytes.ts +18 -0
- package/src/sharddev/bake/portableBytesMemo.ts +50 -0
- package/src/sharddev/bake/practiceCourse.ts +49 -0
- package/src/sharddev/bake/primitives.ts +96 -0
- package/src/sharddev/bake/props.ts +443 -0
- package/src/sharddev/bake/questPlacement.ts +98 -0
- package/src/sharddev/bake/rawTexture.ts +26 -0
- package/src/sharddev/bake/riderArms.ts +97 -0
- package/src/sharddev/bake/rig.ts +95 -0
- package/src/sharddev/bake/riggedHullRecipes.ts +40 -0
- package/src/sharddev/bake/signPlacements.ts +25 -0
- package/src/sharddev/bake/simplifier.ts +52 -0
- package/src/sharddev/bake/skinned.ts +312 -0
- package/src/sharddev/bake/slabChunks.ts +149 -0
- package/src/sharddev/bake/slabs.ts +263 -0
- package/src/sharddev/bake/source-loader.mjs +55 -0
- package/src/sharddev/bake/sourceMetadata.ts +54 -0
- package/src/sharddev/bake/species.ts +368 -0
- package/src/sharddev/bake/specimenCatalogue.ts +47 -0
- package/src/sharddev/bake/splatGround.ts +141 -0
- package/src/sharddev/bake/staticMaterials.ts +171 -0
- package/src/sharddev/bake/terrain.ts +195 -0
- package/src/sharddev/bake/texture.ts +33 -0
- package/src/sharddev/bake/textureWasm.ts +81 -0
- package/src/sharddev/bake/tileEncoder.ts +11 -0
- package/src/sharddev/bake/tileGrid.ts +62 -0
- package/src/sharddev/bake/v2Finite.ts +160 -0
- package/src/sharddev/bake/v2Fuel.ts +71 -0
- package/src/sharddev/bake/wholePartition.ts +74 -0
- package/src/sharddev/bake/wholePieceJoin.ts +147 -0
- package/src/sharddev/bake/world.ts +173 -0
- package/src/sharddev/bake/worldCollision.ts +128 -0
- package/src/sharddev/bake/worldGeometry.ts +237 -0
- package/src/sharddev/bake/worldGlb.ts +123 -0
- package/src/sharddev/bake/worldImage.ts +12 -0
- package/src/sharddev/bake/worldLod.ts +128 -0
- package/src/sharddev/bake/worldRows.ts +102 -0
- package/src/sharddev/bake/worldTextureMemo.ts +63 -0
- package/src/sharddev/bake/zstdBytesMemo.ts +52 -0
- package/src/sharddev/bake.ts +193 -0
- package/src/sharddev/bakePublication.ts +31 -0
- package/src/sharddev/behaviourSource.ts +94 -0
- package/src/sharddev/bin/wildshard.mjs +7 -0
- package/src/sharddev/blobBytes.ts +65 -0
- package/src/sharddev/blobs.ts +138 -0
- package/src/sharddev/bootInventory.ts +129 -0
- package/src/sharddev/bossProfiles.ts +18 -0
- package/src/sharddev/buildBehaviour.ts +77 -0
- package/src/sharddev/buildCacheMetrics.ts +17 -0
- package/src/sharddev/buildDecisionScripts.ts +122 -0
- package/src/sharddev/check.ts +117 -0
- package/src/sharddev/checkProject.ts +126 -0
- package/src/sharddev/cli.ts +191 -0
- package/src/sharddev/clientChannels.ts +169 -0
- package/src/sharddev/clientScripts.ts +10 -0
- package/src/sharddev/commons.ts +77 -0
- package/src/sharddev/commonsCosts.ts +11 -0
- package/src/sharddev/compileMovers.ts +11 -0
- package/src/sharddev/configBoundary.ts +6 -0
- package/src/sharddev/cookInput.ts +40 -0
- package/src/sharddev/crowds.ts +6 -0
- package/src/sharddev/decisionBindingMap.ts +11 -0
- package/src/sharddev/decisionScriptBindings.ts +117 -0
- package/src/sharddev/decisionScripts.ts +28 -0
- package/src/sharddev/decisionSource.ts +51 -0
- package/src/sharddev/dev.ts +113 -0
- package/src/sharddev/director.ts +26 -0
- package/src/sharddev/directorAbi.ts +77 -0
- package/src/sharddev/discoveryDocument.ts +97 -0
- package/src/sharddev/draft.ts +11 -0
- package/src/sharddev/eliteEntryRows.ts +29 -0
- package/src/sharddev/entries.ts +76 -0
- package/src/sharddev/entryReads.ts +73 -0
- package/src/sharddev/executeBundle.ts +55 -0
- package/src/sharddev/finds.ts +5 -0
- package/src/sharddev/formatJsonSchema.ts +3 -0
- package/src/sharddev/generationCache.ts +257 -0
- package/src/sharddev/generationRecipe.ts +94 -0
- package/src/sharddev/handwritten.ts +110 -0
- package/src/sharddev/immutable.ts +14 -0
- package/src/sharddev/interactions.ts +38 -0
- package/src/sharddev/kit/bakedGeometry.ts +16 -0
- package/src/sharddev/kit/geometryPack.ts +110 -0
- package/src/sharddev/ledger.ts +13 -0
- package/src/sharddev/looks/tileField.ts +67 -0
- package/src/sharddev/materialGraphFiles.ts +57 -0
- package/src/sharddev/materials.ts +574 -0
- package/src/sharddev/measure.ts +18 -0
- package/src/sharddev/modes.ts +115 -0
- package/src/sharddev/moverPrograms.ts +213 -0
- package/src/sharddev/movers.ts +75 -0
- package/src/sharddev/nativePopulationRows.ts +46 -0
- package/src/sharddev/newProject.ts +247 -0
- package/src/sharddev/noise.ts +54 -0
- package/src/sharddev/outputProduct.ts +188 -0
- package/src/sharddev/outputRuntime.ts +66 -0
- package/src/sharddev/performancePolicy.ts +18 -0
- package/src/sharddev/phasedBoss.ts +34 -0
- package/src/sharddev/physics.ts +194 -0
- package/src/sharddev/platformSections.ts +42 -0
- package/src/sharddev/plumbing.ts +8 -0
- package/src/sharddev/productOutput.ts +128 -0
- package/src/sharddev/project.ts +337 -0
- package/src/sharddev/projectCompilerIdentity.ts +94 -0
- package/src/sharddev/projectDecisions.ts +66 -0
- package/src/sharddev/projectEntryProof.ts +32 -0
- package/src/sharddev/projectGeneration.ts +219 -0
- package/src/sharddev/projectInputFiles.ts +47 -0
- package/src/sharddev/projectManifest.ts +108 -0
- package/src/sharddev/projectMap.ts +35 -0
- package/src/sharddev/projectOutput.ts +242 -0
- package/src/sharddev/projectPolicy.ts +17 -0
- package/src/sharddev/projectSections.ts +27 -0
- package/src/sharddev/questGraph.ts +25 -0
- package/src/sharddev/quests.ts +65 -0
- package/src/sharddev/random.ts +61 -0
- package/src/sharddev/refusals.ts +234 -0
- package/src/sharddev/reportCard.ts +13 -0
- package/src/sharddev/returnProjectionV2.ts +81 -0
- package/src/sharddev/rows.ts +192 -0
- package/src/sharddev/runtimeImports.ts +38 -0
- package/src/sharddev/runtimeMirrors.ts +39 -0
- package/src/sharddev/runtimePerformance.ts +38 -0
- package/src/sharddev/scene.ts +321 -0
- package/src/sharddev/sceneAnimation.ts +54 -0
- package/src/sharddev/sceneAudio.ts +64 -0
- package/src/sharddev/sceneDeclarations.ts +100 -0
- package/src/sharddev/sceneGraph.ts +139 -0
- package/src/sharddev/sceneTransform.ts +12 -0
- package/src/sharddev/schemaValidation.ts +61 -0
- package/src/sharddev/sections.ts +47 -0
- package/src/sharddev/shardSource.ts +59 -0
- package/src/sharddev/sourceReader.ts +26 -0
- package/src/sharddev/spawns.ts +38 -0
- package/src/sharddev/species/clips.ts +24 -0
- package/src/sharddev/species.ts +29 -0
- package/src/sharddev/speciesBrains.ts +19 -0
- package/src/sharddev/synth.ts +66 -0
- package/src/sharddev/test/compileDualScriptV2.ts +71 -0
- package/src/sharddev/test/compileSimV2.ts +21 -0
- package/src/sharddev/test/diskScriptScenario.ts +86 -0
- package/src/sharddev/test/scriptScenario.ts +249 -0
- package/src/sharddev/test/scriptSource.ts +12 -0
- package/src/sharddev/version.ts +4 -0
- package/src/sharddev/weapons/bowProfile.ts +20 -0
- package/src/sharddev/weapons/firearmRows.ts +11 -0
- package/src/sharddev/weapons/meleeProfile.ts +71 -0
- package/src/sharddev/weapons/thrownProfile.ts +10 -0
- package/src/sharddev/worldScenes.ts +308 -0
- package/src/sharddev/worldSource.ts +82 -0
- package/src/shards/_template/README.md +78 -0
- package/src/shards/_template/assets/2bf489fdb15f1734ddb4c4f32d500ec6da85c765ec7a4eb28dc6781160e7ec8c +0 -0
- package/src/shards/_template/assets/97ec4d8f75f5fa6239ee919444d6dc19fd35896bb305930c1f050ac6e0e0e6a6 +1 -0
- package/src/shards/_template/assets/a6a587a31327f936b1b04c05ade818c73fc8964260918662db43539465e27586 +0 -0
- package/src/shards/_template/assets/b4fbde0422e125b498c3dc8b9a5cc2516c8598f09e9d0e5f6b639b32f98179e6 +0 -0
- package/src/shards/_template/assets/bfa4dfc9c18979f904557ee8deab0058b8a399be10266f5fb1578b403f482fd4 +1 -0
- package/src/shards/_template/assets/ef3b7ff4fd22715771cb7d68a3977a903c5e7c3dc293542687d04b3ef3ace2cb +0 -0
- package/src/shards/_template/assets/f2db05998615ce1cb79ea96be32c168842eb6a2b34ec01feb86d36404603ee54 +0 -0
- package/src/shards/_template/assets/fef98ebb7fce6f66b26e78ac699e5c90f9bdcfaf8cabeb2b58125347eea8b4ab +0 -0
- package/src/shards/_template/behaviour/boss.as +39 -0
- package/src/shards/_template/behaviour/door.as +32 -0
- package/src/shards/_template/behaviour/hooks.json +129 -0
- package/src/shards/_template/behaviour/idle.as +75 -0
- package/src/shards/_template/behaviour/items.as +22 -0
- package/src/shards/_template/card/landscape.jpg +0 -0
- package/src/shards/_template/card/portrait.jpg +0 -0
- package/src/shards/_template/card/thumb.jpg +0 -0
- package/src/shards/_template/data/audio.json +45 -0
- package/src/shards/_template/data/bossDecision.json +83 -0
- package/src/shards/_template/data/budgets.json +70 -0
- package/src/shards/_template/data/card.json +281 -0
- package/src/shards/_template/data/clientScripts.json +987 -0
- package/src/shards/_template/data/creatures.json +65 -0
- package/src/shards/_template/data/director.json +39 -0
- package/src/shards/_template/data/encounters.json +96 -0
- package/src/shards/_template/data/items.json +172 -0
- package/src/shards/_template/data/layout.json +66 -0
- package/src/shards/_template/data/ledger.json +32 -0
- package/src/shards/_template/data/look.json +521 -0
- package/src/shards/_template/data/map.json +64 -0
- package/src/shards/_template/data/moves.json +16 -0
- package/src/shards/_template/data/placeholder.json +8 -0
- package/src/shards/_template/data/plumbing.json +32 -0
- package/src/shards/_template/data/quests.json +223 -0
- package/src/shards/_template/data/rows.json +423 -0
- package/src/shards/_template/data/skins.json +66 -0
- package/src/shards/_template/data/spawn.json +6 -0
- package/src/shards/_template/data/targets.json +150 -0
- package/src/shards/_template/data/text.json +12 -0
- package/src/shards/_template/data/ui.json +33 -0
- package/src/shards/_template/data/water.json +13 -0
- package/src/shards/_template/generators/behaviour.ts +34 -0
- package/src/shards/_template/generators/boss.ts +29 -0
- package/src/shards/_template/generators/buildOptions.ts +2 -0
- package/src/shards/_template/generators/cell.ts +224 -0
- package/src/shards/_template/generators/districts.ts +215 -0
- package/src/shards/_template/generators/farLook.ts +15 -0
- package/src/shards/_template/generators/generate.ts +27 -0
- package/src/shards/_template/generators/ground.ts +15 -0
- package/src/shards/_template/generators/kit.ts +69 -0
- package/src/shards/_template/generators/landscape.ts +59 -0
- package/src/shards/_template/generators/landscapeNoise.ts +62 -0
- package/src/shards/_template/generators/mapInputs.ts +10 -0
- package/src/shards/_template/generators/product.ts +100 -0
- package/src/shards/_template/generators/productOutput.ts +18 -0
- package/src/shards/_template/generators/props.ts +9 -0
- package/src/shards/_template/generators/templatePropsSource.ts +58 -0
- package/src/shards/_template/generators/terrain.ts +17 -0
- package/src/shards/_template/generators/world.ts +630 -0
- package/src/shards/_template/hero.json +10 -0
- package/src/shards/_template/look/entry-reads.json +20 -0
- package/src/shards/_template/manifest.json +281 -0
- package/src/shards/_template/shard.config.ts +10 -0
- package/src/shared/health.ts +10 -0
- package/src/tools/build-web.ts +59 -0
- package/src/tsconfig.json +30 -0
- package/src/web/app.tsx +53 -0
- package/src/web/index.html +12 -0
- package/src/web/main.tsx +10 -0
- package/src/web/tsconfig.json +13 -0
- package/tsconfig.author.json +23 -0
- package/tsconfig.commons.json +21 -0
- package/tsconfig.json +47 -0
- package/tsconfig.sharddev.json +20 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { parseWorldScenePage } from '@wildshard/format/worldScenePages';
|
|
2
|
+
import { SceneModelSourceSchema, SceneBakeSourceSchema } from '@wildshard/format/sceneSources';
|
|
3
|
+
import type { BakedPlacementPlan } from '@wildshard/format/bakedTiles';
|
|
4
|
+
import { isJsonData } from '@wildshard/format/json';
|
|
5
|
+
import { namedJsonSchema, registeredJsonSchema } from '@wildshard/engine/host/formatJsonSchema';
|
|
6
|
+
import type { RegisteredScenePageJsonName, RegisteredPlacementPageJsonName } from '@wildshard/format/registeredJson';
|
|
7
|
+
import { parseWorldScene, parseWorldSceneBindings, parsePrivateScene, type WorldSceneRecipe } from '@wildshard/format/clientChannels';
|
|
8
|
+
import { CaveInteriorSchema, type CaveInteriorRows } from '@wildshard/format/caveInterior';
|
|
9
|
+
import { parseSceneBuffers } from '@wildshard/format/sceneBuffers';
|
|
10
|
+
import { WorldSceneWeldSchema, parseWorldSceneWeld, type WorldSceneWeld } from '@wildshard/format/worldSceneWeld';
|
|
11
|
+
import { parseWorldScenes, type WorldScenesSection } from '@wildshard/format/worldScenes';
|
|
12
|
+
import { parseWorldSceneModels } from '@wildshard/format/worldSceneModels';
|
|
13
|
+
import { WorldSceneSurfaceSchema, type WorldSceneSurface } from '@wildshard/format/worldSceneSurface';
|
|
14
|
+
import { parseWorldScenePlacement,parseWorldScenePlacementPage } from '@wildshard/format/worldScenePlacement';
|
|
15
|
+
import { parse, record, string, strictObject, array, boolean, object, exactOptional, picklist, pipe, unknown, transform, number, finite, regex, type GenericSchema, type ArraySchema, type StrictObjectSchema, type InferOutput } from 'valibot';
|
|
16
|
+
import { SceneDrawsSchema, type SceneDrawsRows } from '@wildshard/format/sceneDraws';
|
|
17
|
+
import type { SceneModelSource, SceneBakeSource } from '@wildshard/engine/game/shardfile/sceneSources';
|
|
18
|
+
import { nameBlob, type NamedBlob } from './blobs';
|
|
19
|
+
import { ForestPageSchema, LivingPageInputSchema, type LivingPageInputRows, type ForestPageRows } from '@wildshard/format/forestPage';
|
|
20
|
+
import { AdmissionLateSchema, type LateFile } from '@wildshard/format/admissionLate';
|
|
21
|
+
import { BakedBuildingLookSchema, parseBuildingLifeRows as nativeBuildingLifeRows, emptyBuildingLifeRows as nativeEmptyBuildingLifeRows,
|
|
22
|
+
admitBuildingAssembly, type BuildingAssemblyRows, type BakedBuildingLookRows, type BuildingCloudRow } from '@wildshard/format/buildings';
|
|
23
|
+
import type { OutputFile } from '@wildshard/format/outputIndex';
|
|
24
|
+
import { WorldAssemblySchema } from '@wildshard/format/worldAssembly';
|
|
25
|
+
import { parseWorldEntry } from '@wildshard/format/worldEntry';
|
|
26
|
+
import { parseSceneMotion } from '@wildshard/format/sceneMotion';
|
|
27
|
+
import type { WorldUpdatesRows } from '@wildshard/format/worldUpdates';
|
|
28
|
+
import { parseToonLook } from '@wildshard/format/toonLook';
|
|
29
|
+
import { parseWorldTargets } from '@wildshard/format/worldTargets';
|
|
30
|
+
import { parseLightEmitters } from '@wildshard/format/lightEmitters';
|
|
31
|
+
import { parseEasedFields } from '@wildshard/format/easedFields';
|
|
32
|
+
import { parseColourFunction } from '@wildshard/format/colourFunction';
|
|
33
|
+
|
|
34
|
+
/** Admit complete authored toon presentation, keeping its native plain-data and resource checks. */
|
|
35
|
+
export function toonSceneLook(input: unknown): ReturnType<typeof parseToonLook> { return parseToonLook(input); }
|
|
36
|
+
|
|
37
|
+
/** Admit complete contact/scan laws before authoring world target bindings. */
|
|
38
|
+
export function worldTargetRows(input: unknown): ReturnType<typeof parseWorldTargets> { return parseWorldTargets(input); }
|
|
39
|
+
/** Admit ordered emitter draws, references and light waves without creating an effect owner. */
|
|
40
|
+
export function worldLightEmitters(input: unknown): ReturnType<typeof parseLightEmitters> { return parseLightEmitters(input); }
|
|
41
|
+
/** Admit bounded first-match field targets and their exact continuation/easing law. */
|
|
42
|
+
export function worldEasedFields(input: unknown): ReturnType<typeof parseEasedFields> { return parseEasedFields(input); }
|
|
43
|
+
|
|
44
|
+
/** Admit complete authored colour expressions through the native finite grammar. */
|
|
45
|
+
export function worldColourFunction(input: unknown): ReturnType<typeof parseColourFunction> { return parseColourFunction(input); }
|
|
46
|
+
|
|
47
|
+
/** A source geometry's ordered tile files and its resident ownership flag. */
|
|
48
|
+
export interface AuthorSceneTileGroup { files: string[]; resident: boolean }
|
|
49
|
+
/** Admit owned source tile groups before constructing model aliases or borrowing geometry. */
|
|
50
|
+
export function worldSceneTileGroups(input: unknown): Record<string, AuthorSceneTileGroup> {
|
|
51
|
+
return parse(record(string(), strictObject({ files: array(string()), resident: boolean() })), input);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Ordered source geometry file ownership before publication; unrelated tile metadata is stripped. */
|
|
55
|
+
export interface AuthorSceneTileFiles { file: string; additionalFiles?: string[] }
|
|
56
|
+
/** Admit main/additional source files without deduplicating or borrowing any byte payload. */
|
|
57
|
+
export function worldSceneTileFiles(input: unknown): AuthorSceneTileFiles[] {
|
|
58
|
+
return parse(array(object({ file: string(), additionalFiles: exactOptional(array(string())) })), input);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Admit ordered entry blocks and their native resource/variant checks before constructing a world. */
|
|
62
|
+
export function worldEntryRows(input: unknown): ReturnType<typeof parseWorldEntry> { return parseWorldEntry(input); }
|
|
63
|
+
|
|
64
|
+
/** Admit ordered world construction stages and their original resource/variant rules.
|
|
65
|
+
* The result is data only; no scene, lifetime or runtime handle is constructed. */
|
|
66
|
+
export function worldAssemblyRows(input: unknown): ReturnType<typeof parse<typeof WorldAssemblySchema>> {
|
|
67
|
+
return parse(WorldAssemblySchema, input);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Source-owned effect declarations retain the platform field contract. */
|
|
71
|
+
export interface SceneEffectField {
|
|
72
|
+
readonly name: string;
|
|
73
|
+
readonly shape: 'point' | 'streak' | 'flake';
|
|
74
|
+
readonly count: number;
|
|
75
|
+
readonly palette?: readonly number[];
|
|
76
|
+
readonly life?: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Admit a bounded private world recipe before source publication; no runtime is installed. */
|
|
80
|
+
export function worldSceneRecipe(input: unknown): WorldSceneRecipe { return parseWorldScene(input); }
|
|
81
|
+
|
|
82
|
+
/** Admit complete private scene nodes and material ports before publication, without a scene host. */
|
|
83
|
+
export function privateSceneRows(input: unknown): ReturnType<typeof parsePrivateScene> { return parsePrivateScene(input); }
|
|
84
|
+
|
|
85
|
+
/** Admit finite typed transform/material/anchor ports using the defining platform grammar. */
|
|
86
|
+
export function worldSceneBindings(input: unknown): ReturnType<typeof parseWorldSceneBindings> { return parseWorldSceneBindings(input); }
|
|
87
|
+
|
|
88
|
+
/** Admit the complete data-only scene section with its original identity and reference checks. */
|
|
89
|
+
export function worldSceneRows(input: unknown): ReturnType<typeof parseWorldScenes> { return parseWorldScenes(input); }
|
|
90
|
+
|
|
91
|
+
/** Authored scene sections before admission fills lent resources and uniform defaults. */
|
|
92
|
+
export type AuthorWorldScenes = WorldScenesSection;
|
|
93
|
+
/** Complete native private hierarchy and materials before runtime installation. */
|
|
94
|
+
export type AuthorPrivateScene = ReturnType<typeof parsePrivateScene>;
|
|
95
|
+
/** Complete scene recipe, including imports and reference/placement contracts. */
|
|
96
|
+
export type AuthorWorldSceneRecipe = WorldSceneRecipe;
|
|
97
|
+
/** Complete admitted copy placement, including drawn-elsewhere ownership. */
|
|
98
|
+
export type AuthorWorldScenePlacement = ReturnType<typeof parseWorldScenePlacement>;
|
|
99
|
+
/** Ordered construction/checkpoint metadata before a world is installed. */
|
|
100
|
+
export type AuthorWorldConstruction = NonNullable<InferOutput<typeof WorldAssemblySchema>['construction']>;
|
|
101
|
+
/** Complete entry block map and one native ordered step. */
|
|
102
|
+
export type AuthorWorldEntry = ReturnType<typeof parseWorldEntry>;
|
|
103
|
+
export type AuthorWorldEntryStep = AuthorWorldEntry['blocks'][string][number];
|
|
104
|
+
/** Complete rope-deck site metadata accepted by native assembly. */
|
|
105
|
+
export type AuthorRopeDeckSite = Extract<InferOutput<typeof WorldAssemblySchema>['stages'][number], { kind: 'rope-deck' }>['site'];
|
|
106
|
+
/** Complete ordered native update declarations; clocks and owners stay runtime-side. */
|
|
107
|
+
export type AuthorWorldUpdates = WorldUpdatesRows;
|
|
108
|
+
/** Complete detached native motion/channel binding declaration. */
|
|
109
|
+
export type AuthorSceneMotion = ReturnType<typeof parseSceneMotion>;
|
|
110
|
+
/** Admit original native scene motion, retaining plain-data and owner/target checks. */
|
|
111
|
+
export function worldSceneMotion(input: unknown): AuthorSceneMotion { return parseSceneMotion(input); }
|
|
112
|
+
|
|
113
|
+
/** Admit a static model catalogue with the original identity, choice, LOD and plain-data checks. */
|
|
114
|
+
export function worldSceneModels(input: unknown): ReturnType<typeof parseWorldSceneModels> { return parseWorldSceneModels(input); }
|
|
115
|
+
|
|
116
|
+
/** Admit an original PBR/graph surface, including its explicit resident/placement intake hint. */
|
|
117
|
+
export function worldSceneSurface(input: unknown): WorldSceneSurface { return parse(WorldSceneSurfaceSchema, input); }
|
|
118
|
+
|
|
119
|
+
/** Admit an authored placement through the same finite layout and collider grammar as the client. */
|
|
120
|
+
export function worldScenePlacement(input: unknown): ReturnType<typeof parseWorldScenePlacement> { return parseWorldScenePlacement(input); }
|
|
121
|
+
|
|
122
|
+
/** Admit a forest page through its existing finite plant, building and landmark grammar. */
|
|
123
|
+
export function forestPageRows(input: unknown): ForestPageRows { return parse(ForestPageSchema, input); }
|
|
124
|
+
|
|
125
|
+
/** Schedule explicitly off-view material variants without changing inventory,
|
|
126
|
+
* costs or tier choice. Any critical or otherwise selected alias stays early. */
|
|
127
|
+
export function lateSceneMaterialFiles(files: readonly Pick<OutputFile, 'hash' | 'variantOf' | 'critical'>[],
|
|
128
|
+
hints: readonly { readonly variantOf: string; readonly at: readonly [number, number] }[]): readonly LateFile[] {
|
|
129
|
+
const sites = new Map(hints.map(row => [row.variantOf, row.at]));
|
|
130
|
+
if (sites.size !== hints.length || hints.some(row => row.variantOf.length === 0 || !files.some(file => file.variantOf === row.variantOf)))
|
|
131
|
+
throw new Error('Late material variants require unique declared groups');
|
|
132
|
+
const early = new Set(files.filter(file => file.critical || file.variantOf === undefined || !sites.has(file.variantOf)).map(file => file.hash));
|
|
133
|
+
const selected = new Map<string, LateFile>();
|
|
134
|
+
for (const file of files) {
|
|
135
|
+
const at = file.variantOf === undefined ? undefined : sites.get(file.variantOf);
|
|
136
|
+
if (at === undefined || early.has(file.hash)) continue;
|
|
137
|
+
const prior = selected.get(file.hash);
|
|
138
|
+
if (prior !== undefined && (prior.at?.[0] !== at[0] || prior.at[1] !== at[1])) throw new Error('Late material aliases require one position');
|
|
139
|
+
selected.set(file.hash, { hash: file.hash, at: [at[0], at[1]] });
|
|
140
|
+
}
|
|
141
|
+
return parse(AdmissionLateSchema, [...selected.values()]);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Admit named typed channels, shared attributes and ordered buffered draws before publication. */
|
|
145
|
+
export function worldSceneBuffers(input: unknown): ReturnType<typeof parseSceneBuffers> { return parseSceneBuffers(input); }
|
|
146
|
+
|
|
147
|
+
/** Admit frozen scene topology, exact transform words and ordered hosted cull lanes. */
|
|
148
|
+
export function worldSceneWeldRows(input: unknown): ReturnType<typeof parseWorldSceneWeld> { return parseWorldSceneWeld(input); }
|
|
149
|
+
|
|
150
|
+
/** Admit an owned author draft with the same grammar, before runtime admission freezes it. */
|
|
151
|
+
export function worldSceneWeldData(input: unknown): ReturnType<typeof parseWorldSceneWeld> { return parse(WorldSceneWeldSchema, input); }
|
|
152
|
+
|
|
153
|
+
/** Publish the complete native weld without rewriting authored JSON or lending an owner. */
|
|
154
|
+
export function worldSceneWeldFile(name: string, input: unknown): NamedBlob {
|
|
155
|
+
parseWorldSceneWeld(input);
|
|
156
|
+
return nameBlob(name, 'json', new TextEncoder().encode(JSON.stringify(input)), {
|
|
157
|
+
jsonSchema: namedJsonSchema(WorldSceneWeldSchema, { provenance: true }),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Admit the defining finite surface properties without inventing a material or resource owner. */
|
|
162
|
+
export function worldSceneSurfaceProperties(input: unknown): WorldSceneSurface['properties'] { return parse(WorldSceneSurfaceSchema.entries.properties, input); }
|
|
163
|
+
|
|
164
|
+
/** Admit bounded cave ownership, frame, packed roof and material ports before publication. */
|
|
165
|
+
export function caveInteriorRows(input: unknown): CaveInteriorRows { return parse(CaveInteriorSchema, input); }
|
|
166
|
+
|
|
167
|
+
/** Complete authored building assembly grammar; no building instance or resource service is lent. */
|
|
168
|
+
export type AuthorBuildingAssembly<K extends string = string, P extends string = string> = BuildingAssemblyRows<K, P>;
|
|
169
|
+
/** Numeric cloud geometry/material references before any particle owner is constructed. */
|
|
170
|
+
export type AuthorBuildingCloud = BuildingCloudRow;
|
|
171
|
+
/** Check complete building resource bindings through the native strict grammar, without assembling it. */
|
|
172
|
+
export function checkBuildingAssembly(input: unknown): void { admitBuildingAssembly(input); }
|
|
173
|
+
|
|
174
|
+
/** Admit original building material, particle, door and lantern policy before baking. */
|
|
175
|
+
export function buildingLookRows(input: unknown): BakedBuildingLookRows { return parse(BakedBuildingLookSchema, input); }
|
|
176
|
+
|
|
177
|
+
/** Admit bounded moving doors, wheels, lights and site bindings through their defining checks. */
|
|
178
|
+
export function buildingLifeRows(input: unknown): ReturnType<typeof nativeBuildingLifeRows> { return nativeBuildingLifeRows(input); }
|
|
179
|
+
|
|
180
|
+
/** A fresh native empty life batch; authored assembly owns every returned list. */
|
|
181
|
+
export function emptyBuildingLifeRows(): ReturnType<typeof nativeEmptyBuildingLifeRows> { return nativeEmptyBuildingLifeRows(); }
|
|
182
|
+
|
|
183
|
+
/** Admit complete authored effect draws through their existing geometry/material port grammar. */
|
|
184
|
+
export function sceneDrawRows(input: unknown): SceneDrawsRows { return parse(SceneDrawsSchema, input); }
|
|
185
|
+
|
|
186
|
+
/** Publish source-owned model/rig/held declarations with the native inventory limits.
|
|
187
|
+
* Preserve JSON property order and numeric spelling; runtime resource admission stays authoritative. */
|
|
188
|
+
export function modelSceneSourceFile(name: string, input: SceneModelSource): NamedBlob {
|
|
189
|
+
if (input.rows.meshes.length > 256 || input.rows.hd.length > 256) throw new Error('Invalid declared model source');
|
|
190
|
+
return nameBlob(name, 'json', new TextEncoder().encode(JSON.stringify(input)), { jsonSchema: namedJsonSchema(SceneModelSourceSchema, { provenance: true }) });
|
|
191
|
+
}
|
|
192
|
+
/** Publish source-owned baked kinds, bindings and contacts with the native kind-table limit. */
|
|
193
|
+
export function bakedSceneSourceFile(name: string, input: SceneBakeSource): NamedBlob {
|
|
194
|
+
if (Object.keys(input.rows).length > 128) throw new Error('Invalid declared bake source');
|
|
195
|
+
return nameBlob(name, 'json', new TextEncoder().encode(JSON.stringify(input)), { jsonSchema: namedJsonSchema(SceneBakeSourceSchema, { provenance: true }) });
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Complete admitted living-scene profile, before any geometry or door owner is installed. */
|
|
199
|
+
export interface AuthorLivingSceneProfile {
|
|
200
|
+
tier: 'phone' | 'desktop'; shadow: boolean; shared: boolean; file: string;
|
|
201
|
+
graph: ReturnType<typeof worldSceneWeldData>;
|
|
202
|
+
life: ReturnType<typeof buildingLifeRows>;
|
|
203
|
+
geometry: { key: string; id: string; source: { library: string; model: string } }[];
|
|
204
|
+
}
|
|
205
|
+
/** Admit ordered living-scene bake metadata through the defining graph and life
|
|
206
|
+
* grammars. Unused bake hashes strip as before; no resource reader is lent. */
|
|
207
|
+
export function worldSceneLivingBakeRows(input: unknown): {
|
|
208
|
+
blobs: { name: string; kind: 'glb' | 'json'; source: string }[];
|
|
209
|
+
profiles: AuthorLivingSceneProfile[];
|
|
210
|
+
geometry: { id: string; library: string; file: string; attributes: Record<string, string> }[];
|
|
211
|
+
} {
|
|
212
|
+
const id = string(), geometry = object({ key: id, id, source: object({ library: id, model: id }) });
|
|
213
|
+
const profile = object({ tier: picklist(['phone', 'desktop']), shadow: boolean(), shared: boolean(), file: id,
|
|
214
|
+
graph: pipe(unknown(), transform(worldSceneWeldData)), life: pipe(unknown(), transform(buildingLifeRows)), geometry: array(geometry) });
|
|
215
|
+
return parse(object({ blobs: array(object({ name: id, kind: picklist(['glb', 'json']), source: id })),
|
|
216
|
+
profiles: array(profile), geometry: array(object({ id, library: id, file: id, attributes: record(id, id) })) }), input);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Admit a complete source row book with finite word records and hashed tile
|
|
220
|
+
* ownership. The caller's defining row grammar still owns every local field. */
|
|
221
|
+
export function worldSceneSourceRecords<Schema extends GenericSchema>(schema: Schema, input: unknown): InferOutput<StrictObjectSchema<{
|
|
222
|
+
readonly rows: Schema;
|
|
223
|
+
readonly records: ArraySchema<GenericSchema<unknown, number>, undefined>;
|
|
224
|
+
readonly wholeTiles: GenericSchema<unknown, Record<string, AuthorSceneTileGroup>>;
|
|
225
|
+
}, undefined>> {
|
|
226
|
+
return parse(strictObject({ rows: schema, records: array(pipe(number(), finite())),
|
|
227
|
+
wholeTiles: record(string(), strictObject({ files: array(pipe(string(), regex(/^[a-f0-9]{64}$/u))), resident: boolean() })) }), input);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
/** Ordered placement references over small complete native pages. Pages never mix
|
|
232
|
+
* device membership, so the original tier filter also excludes their transport.
|
|
233
|
+
* Admission checks every original row; encoding retains its authored key order. */
|
|
234
|
+
export function worldScenePlacementPages(id: string, input: readonly unknown[]): {
|
|
235
|
+
files: NamedBlob[]; placements: { id: string; file: string; member: number; tier?: 'phone' | 'desktop' }[];
|
|
236
|
+
} {
|
|
237
|
+
if (!/^[A-Za-z0-9_-][A-Za-z0-9_.-]{0,140}$/u.test(id) || input.length > 128)
|
|
238
|
+
throw new Error('Placement pages require a bounded id and at most 128 placements');
|
|
239
|
+
const rows = input.map(parseWorldScenePlacement);
|
|
240
|
+
const sources = new Map(rows.map((row, index) => [row.id, input[index]]));
|
|
241
|
+
if (new Set(rows.map(row => row.id)).size !== rows.length) throw new Error('Placement identities must be unique');
|
|
242
|
+
const files: NamedBlob[] = [], references = new Map<string, { id: string; file: string; member: number; tier?: 'phone' | 'desktop' }>();
|
|
243
|
+
for (const tier of [undefined, 'phone', 'desktop'] as const) {
|
|
244
|
+
const active = rows.filter(row => row.tier === tier);
|
|
245
|
+
for (let at = 0, part = 0; at < active.length; part++) {
|
|
246
|
+
// Match individual JSON files: matrix arithmetic's signed zeros encode as 0.
|
|
247
|
+
let count = Math.min(16, active.length - at);
|
|
248
|
+
let encodedPage = JSON.stringify({ version: 1, rows: active.slice(at, at + count) });
|
|
249
|
+
let wirePage: unknown = JSON.parse(encodedPage);
|
|
250
|
+
while (count > 1 && !isJsonData(wirePage)) {
|
|
251
|
+
count--;
|
|
252
|
+
encodedPage = JSON.stringify({ version: 1, rows: active.slice(at, at + count) });
|
|
253
|
+
wirePage = JSON.parse(encodedPage);
|
|
254
|
+
}
|
|
255
|
+
const page = parseWorldScenePlacementPage(wirePage);
|
|
256
|
+
const name: RegisteredPlacementPageJsonName = `world/placement-pages/${id}.${tier ?? 'shared'}.${part}.json`;
|
|
257
|
+
const wire = { version: 1, rows: page.rows.map(row => sources.get(row.id)) };
|
|
258
|
+
files.push(nameBlob(name, 'json', new TextEncoder().encode(JSON.stringify(wire)), { jsonSchema: registeredJsonSchema(name) }));
|
|
259
|
+
for (const [member, row] of page.rows.entries()) references.set(row.id, { id: row.id, file: name, member, ...(tier === undefined ? {} : { tier }) });
|
|
260
|
+
at += count;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return { files, placements: rows.map(row => {
|
|
264
|
+
const reference = references.get(row.id);
|
|
265
|
+
if (reference === undefined) throw new Error('Missing placement page member');
|
|
266
|
+
return reference;
|
|
267
|
+
}) };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** Complete authored baked placement data; no geometry or collider is allocated. */
|
|
271
|
+
export type AuthorBakedPlacementPlan = BakedPlacementPlan;
|
|
272
|
+
|
|
273
|
+
/** Pack complete native variants into streamed pages. Equal nodes share storage;
|
|
274
|
+
* loading expands the original ordered graphs before native admission. */
|
|
275
|
+
export function worldSceneGraphPages(id: string, kind: 'weld' | 'living', input: readonly { name: string; row: WorldSceneWeld | LivingPageInputRows }[]): {
|
|
276
|
+
files: NamedBlob[]; references: ReadonlyMap<string, { file: string; member: number }>;
|
|
277
|
+
} {
|
|
278
|
+
if (!/^[A-Za-z0-9_-][A-Za-z0-9_.-]{0,140}$/u.test(id) || input.length > 128 || new Set(input.map(row => row.name)).size !== input.length)
|
|
279
|
+
throw new Error('Native graph pages require bounded unique identities');
|
|
280
|
+
const rows = input.map(entry => {
|
|
281
|
+
if (kind === 'weld') parseWorldSceneWeld(entry.row); else parse(LivingPageInputSchema, entry.row);
|
|
282
|
+
return entry;
|
|
283
|
+
});
|
|
284
|
+
const pack = (entries: typeof rows): unknown => {
|
|
285
|
+
const nodes: WorldSceneWeld['nodes'] = [], identities = new Map<string, number>();
|
|
286
|
+
const graph = (value: WorldSceneWeld) => ({ ...value, nodes: value.nodes.map(node => {
|
|
287
|
+
const key = JSON.stringify(node), previous = identities.get(key);
|
|
288
|
+
if (previous !== undefined) return previous;
|
|
289
|
+
const at = nodes.length; nodes.push(node); identities.set(key, at); return at;
|
|
290
|
+
}) });
|
|
291
|
+
const members = entries.map(({ row }) => 'graph' in row ? { ...row, graph: graph(row.graph) } : graph(row));
|
|
292
|
+
return { version: 1, kind, nodes, rows: members };
|
|
293
|
+
};
|
|
294
|
+
const files: NamedBlob[] = [], references = new Map<string, { file: string; member: number }>();
|
|
295
|
+
for (let at = 0, part = 0; at < rows.length; part++) {
|
|
296
|
+
let count = Math.min(16, rows.length - at), wire = pack(rows.slice(at, at + count));
|
|
297
|
+
while (count > 1 && !isJsonData(wire)) { count--; wire = pack(rows.slice(at, at + count)); }
|
|
298
|
+
parseWorldScenePage(wire);
|
|
299
|
+
const name: RegisteredScenePageJsonName = `world/scene-pages/${id}.${part}.json`;
|
|
300
|
+
files.push(nameBlob(name, 'json', new TextEncoder().encode(JSON.stringify(wire)), { jsonSchema: registeredJsonSchema(name) }));
|
|
301
|
+
for (let member = 0; member < count; member++) {
|
|
302
|
+
const entry = rows[at + member]; if (entry === undefined) throw new Error('Missing native graph page member');
|
|
303
|
+
references.set(entry.name, { file: name, member });
|
|
304
|
+
}
|
|
305
|
+
at += count;
|
|
306
|
+
}
|
|
307
|
+
return { files, references };
|
|
308
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as v from 'valibot';
|
|
2
|
+
import { isJsonData } from '@wildshard/format/json';
|
|
3
|
+
|
|
4
|
+
const id = v.pipe(v.string(), v.maxLength(128), v.regex(/^[a-z][a-z0-9.-]*$/u));
|
|
5
|
+
const reserved = new Set(['__proto__', 'prototype', 'constructor']);
|
|
6
|
+
const name = v.pipe(v.string(), v.minLength(1), v.maxLength(128), v.check((value) => value.trim() === value && Array.from(value).every((character) => {
|
|
7
|
+
const point = character.codePointAt(0) ?? 0;
|
|
8
|
+
return point >= 32 && point !== 127;
|
|
9
|
+
}) && !reserved.has(value), 'bounded literal glTF name'));
|
|
10
|
+
const glb = v.pipe(v.string(), v.maxLength(512), v.check((value) => value.endsWith('.glb') && value.split('/').every((part) => /^[A-Za-z0-9_-][A-Za-z0-9_. -]*$/u.test(part) && part.trim() === part && !part.endsWith('.')), 'project-relative GLB path without traversal, URL or backslash'));
|
|
11
|
+
const colliders = v.union([v.literal('mesh'), v.pipe(v.string(), v.maxLength(134), v.check((value) => value.startsWith('nodes:') && v.safeParse(name, value.slice(6)).success, 'nodes:<nonempty literal node-name prefix>'))]);
|
|
12
|
+
const interactive = v.strictObject({ node: name, id, colliderId: id });
|
|
13
|
+
|
|
14
|
+
function plainWorldData(input: unknown): boolean {
|
|
15
|
+
if (!isJsonData(input)) return false;
|
|
16
|
+
if (typeof input !== 'object' || input === null) return true;
|
|
17
|
+
// Record validators omit these keys; refuse them before parsing rather than losing an authored mapping.
|
|
18
|
+
for (const key of ['materials', 'objects']) {
|
|
19
|
+
const record: unknown = Reflect.get(input, key);
|
|
20
|
+
if (typeof record === 'object' && record !== null && Object.keys(record).some((entry) => reserved.has(entry))) return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Build-only authored geometry input in metres and glTF Y-up axes; it is never a compiled shardfile section. */
|
|
26
|
+
export const WorldSourceSchema: v.GenericSchema<BoundedWorldSourceInput, BoundedWorldSource> = v.pipe(v.unknown(), v.check(plainWorldData, 'world source is plain JSON with safe mapping keys'), v.strictObject({
|
|
27
|
+
glb,
|
|
28
|
+
materials: v.pipe(v.record(name, id), v.check((rows) => Object.keys(rows).length > 0 && Object.keys(rows).length <= 256, 'one to 256 explicit material mappings')),
|
|
29
|
+
colliders,
|
|
30
|
+
objects: v.optional(v.pipe(v.record(name, id), v.check((rows) => Object.keys(rows).length <= 1024, 'at most 1024 stable object names')), {}),
|
|
31
|
+
interactive: v.optional(v.pipe(v.array(interactive), v.maxLength(64)), []),
|
|
32
|
+
/** G532 (4): nodes under this name prefix collide, sample the edges and fill the far proxy, but the authored tiles never
|
|
33
|
+
* draw them: a baked-tiles row in the client plan draws them with their lightmaps */
|
|
34
|
+
undrawn: v.optional(name),
|
|
35
|
+
/** G608: nodes under this name prefix fill only the far proxy (a light's stand-in at a distance, as a hologram's):
|
|
36
|
+
* never a tile, a collider or an edge sample */
|
|
37
|
+
far: v.optional(name),
|
|
38
|
+
/** RM8.2: nodes under this name prefix draw only in the full-detail (L0) tiles: dense detail the coarse tiles leave to
|
|
39
|
+
* their own stand-ins; it collides as any static node does */
|
|
40
|
+
detail: v.optional(name),
|
|
41
|
+
/** RM8.2: nodes under this name prefix draw only in the coarse (L1) tiles, as they are (the detail's stand-ins):
|
|
42
|
+
* never an L0 tile, a collider, an edge sample or the far proxy */
|
|
43
|
+
coarse: v.optional(name),
|
|
44
|
+
/** NM0: replace uses only the declared far stand-ins. Without a mode, retain
|
|
45
|
+
* the normal proxy made from static, undrawn and far-only nodes. */
|
|
46
|
+
farMode: v.optional(v.literal('replace')),
|
|
47
|
+
/** NM5 (Night Market pilot): the world's own near view, baked from its coarse (L1) tiles over a flat floor, so a cell
|
|
48
|
+
* seen from the road draws its tiles in vertex colours instead of its far proxy (colour maps are not sampled: a
|
|
49
|
+
* textured surface carries its picture's colours in its vertex colours, which its own textured material ignores) */
|
|
50
|
+
near: v.optional(v.literal('coarse')),
|
|
51
|
+
}), v.check((source) => source.farMode !== 'replace' || source.far !== undefined, 'farMode replace needs a far prefix'), v.check((source) => {
|
|
52
|
+
const nodes = [...Object.keys(source.objects), ...source.interactive.map((row) => row.node)];
|
|
53
|
+
const ids = [...Object.values(source.objects), ...source.interactive.map((row) => row.id)];
|
|
54
|
+
return new Set(nodes).size === nodes.length && new Set(ids).size === ids.length && new Set(source.interactive.map((row) => row.colliderId)).size === source.interactive.length;
|
|
55
|
+
}, 'unique node names, stable object/panel IDs and interactive collider IDs'));
|
|
56
|
+
|
|
57
|
+
/** Normalized author-world declaration; objects and interactive default to empty collections. */
|
|
58
|
+
export type WorldSource = v.InferOutput<typeof WorldSourceSchema>;
|
|
59
|
+
|
|
60
|
+
/** Validate a build-only world declaration without opening files or executing getters or serializers. */
|
|
61
|
+
export function parseWorldSource(input: unknown): WorldSource { return v.parse(WorldSourceSchema, input); }
|
|
62
|
+
|
|
63
|
+
/** Complete admitted data, independent of validator implementation metadata. */
|
|
64
|
+
type BoundedWorldSourceInput = unknown;
|
|
65
|
+
interface BoundedWorldSourceFields {
|
|
66
|
+
glb: string;
|
|
67
|
+
materials: Record<string, string>;
|
|
68
|
+
colliders: string;
|
|
69
|
+
objects: Record<string, string>;
|
|
70
|
+
interactive: {
|
|
71
|
+
node: string;
|
|
72
|
+
id: string;
|
|
73
|
+
colliderId: string;
|
|
74
|
+
}[];
|
|
75
|
+
undrawn?: string | undefined;
|
|
76
|
+
far?: string | undefined;
|
|
77
|
+
detail?: string | undefined;
|
|
78
|
+
coarse?: string | undefined;
|
|
79
|
+
farMode?: "replace" | undefined;
|
|
80
|
+
near?: "coarse" | undefined;
|
|
81
|
+
}
|
|
82
|
+
type BoundedWorldSource = { [Key in keyof BoundedWorldSourceFields]: BoundedWorldSourceFields[Key] };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Template shard (`_template`)
|
|
2
|
+
|
|
3
|
+
Run `pnpm gen` in the repository before copying this folder to start a
|
|
4
|
+
shardfile project; see [SHARDS.md](../../../docs/SHARDS.md)
|
|
5
|
+
and [SHARDFILE.md](../../../docs/SHARDFILE.md). Install `@wildshard/sdk`, edit the
|
|
6
|
+
identity via the documented `shard.config.ts` entry (follow its import to
|
|
7
|
+
`generators/product.ts`), then run `wildshard build <folder>` and
|
|
8
|
+
`wildshard validate out/_template`. The prepared copy includes its immutable assets. Cheap CPU outputs are
|
|
9
|
+
regenerated from retained authoring sources through SHA256-pinned cache jobs;
|
|
10
|
+
curated skins remain author inputs. The map is generated from the declared terrain
|
|
11
|
+
and props by `generators/bake-map.mjs`, using the style in `data/map.json`.
|
|
12
|
+
|
|
13
|
+
`data/` declares terrain, props, exported creature skins, brains, encounters, items,
|
|
14
|
+
water, look, HUD, audio, ledger and interactions. `behaviour/` holds admitted numeric
|
|
15
|
+
AssemblyScript for the door and item hooks; `data/quests.json` declares the adventure. Stable
|
|
16
|
+
state-field IDs and item handles preserve the script ABI across declaration reorder.
|
|
17
|
+
`generators/` and `data/layout.json` are build-time source metadata, never client runtime. `generators/cell.ts` fills the
|
|
18
|
+
500 m cell (G220): a road from each entry socket to a square loop around the yard, a set piece just inside each entry
|
|
19
|
+
(north gate, south container yard, east signal mast, west covered drive), four hub corners outside the loop and lamp
|
|
20
|
+
posts, all dev-map boxes on ground the terrain levels to y = 0. `generators/districts.ts` (pass 2) fills the plane between
|
|
21
|
+
the roads: a hover test course, a block district, a ziggurat and an overpass in the corners, a scaffold yard, billboard
|
|
22
|
+
row, hangars and crate yard in the side strips, a second set piece at each entry, and four 40 m copy plots that a grid
|
|
23
|
+
copy fills with its own seeded landmarks (`src/client/game/grid/copyLayout.ts`).
|
|
24
|
+
|
|
25
|
+
The first-party manifest keeps the canonical `_template` slug, grey picker art and
|
|
26
|
+
`template-solo` save identity, and points at `/shardfiles/_template/shard.json`.
|
|
27
|
+
The existing Game admits the product before its normal world/kit/play stages, sharing
|
|
28
|
+
one player, physics world, fixed-step driver and HUD. There is no custom runtime chunk.
|
|
29
|
+
`shard.config.ts` includes build-time `data/card.json` metadata;
|
|
30
|
+
`generators/productOutput.ts` declares named blobs and platform sections. Budgets live in `data/` too. Root
|
|
31
|
+
`manifest.json` is a temporary discovery bridge only: P3 catalog activation
|
|
32
|
+
removes it, together with the generated discovery module. Runtime code never
|
|
33
|
+
imports `data/card.ts`. Keep bridge metadata synchronized until that switch.
|
|
34
|
+
|
|
35
|
+
The T2 reference in `behaviour/boss.as` binds the `combat/encounters` row
|
|
36
|
+
`template.boss` through the single `sim/scripts` row in `generators/productOutput.ts`.
|
|
37
|
+
`data/bossDecision.json` declares its capabilities, actor, move, strike, timers and
|
|
38
|
+
durable state. The SDK compiler generates the typed bindings; no handwritten
|
|
39
|
+
transport or runtime module is needed. It approaches, alternates timed strikes and moves,
|
|
40
|
+
accelerates at the second-phase threshold, wins on death and resets on stop.
|
|
41
|
+
The fixed-step engine owns the declared `actors/moves` and strike mechanics.
|
|
42
|
+
`generators/boss.ts` compiles one fixed Wasm page through the injected
|
|
43
|
+
SDK compiler and immutable step cache, without writing boss metadata into source; the scenario at
|
|
44
|
+
`test/scripts/_template-boss.test.ts` runs those built bytes through the real
|
|
45
|
+
DecisionHost, including a logical save restored into a fresh host. The
|
|
46
|
+
Template stays runtime-free. Event-only decisions run on the 60 Hz host's sixth
|
|
47
|
+
tick, at most 10 Hz; timers use simulation time. The scenario also checks that
|
|
48
|
+
every call respects that cadence, including calls after a save is restored.
|
|
49
|
+
The scenario does not compile AS or invent a second motion implementation.
|
|
50
|
+
From the repository root, run
|
|
51
|
+
`pnpm exec vitest run test/scripts/_template-boss.test.ts`; its setup prepares
|
|
52
|
+
only the Template product. For another shard, copy the scenario and replace
|
|
53
|
+
the product folder, script id, player fixture and expected commands with that
|
|
54
|
+
shard's declarations. `scenario()` reads the built `out/<folder>/` product;
|
|
55
|
+
it never imports authoring modules or recompiles the script inside the scenario.
|
|
56
|
+
|
|
57
|
+
A copied author project does not need a custom runtime. If one is necessary,
|
|
58
|
+
use `runtime/index.ts`, `runtime/sections.ts` for custom-section schemas and
|
|
59
|
+
`runtime/const.ts` for local constants; every runtime import stays inside that
|
|
60
|
+
folder or names a public platform module. Read content through the admitted
|
|
61
|
+
product. Build-time code never imports `runtime/`.
|
|
62
|
+
|
|
63
|
+
Four native proofs under `test/proof/_template/` cover boot, 10,000 fixed ticks,
|
|
64
|
+
checkpoint replay and ledger dedupe. Weapon input/replay and HUD regressions use the
|
|
65
|
+
declared item runtime. The installed-client proof covers real door/lantern input,
|
|
66
|
+
tile driving, cached/offline revisit and scoped unload.
|
|
67
|
+
|
|
68
|
+
The author entry is the executable `shard.config.ts` program. It calls the
|
|
69
|
+
terrain, props, raw behavior and boss producers in-process through `ctx.cached`,
|
|
70
|
+
retaining their original rows, bytes and page limits. Native fixtures call those
|
|
71
|
+
same source functions; browser boards read the built format-2 product.
|
|
72
|
+
|
|
73
|
+
The map paints the same L0 terrain and placed prop triangles into a cached RGBA
|
|
74
|
+
lattice. The SDK encodes the original lossless WebP directly into the charged
|
|
75
|
+
product, named `ui/map`. The root adapter supplies its current world-input hash,
|
|
76
|
+
covering generators, layout, SDK, format and the pinned dependency lock. There
|
|
77
|
+
are no Template catalogue jobs or generated metadata/assets written under source.
|
|
78
|
+
`data/map.json` keeps the same authored palette; map byte/pixel parity is tested.
|
package/src/shards/_template/assets/2bf489fdb15f1734ddb4c4f32d500ec6da85c765ec7a4eb28dc6781160e7ec8c
ADDED
|
Binary file
|
package/src/shards/_template/assets/97ec4d8f75f5fa6239ee919444d6dc19fd35896bb305930c1f050ac6e0e0e6a6
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"row":{"cost":{"decoded":69318,"draws":2,"gpu":30224,"triangles":100},"family":"toon","file":"2bf489fdb15f1734ddb4c4f32d500ec6da85c765ec7a4eb28dc6781160e7ec8c","id":"grey-blob","rig":{"clips":["idle","walk","attack","hit","die"],"joints":[["body","head"]],"skeleton":"template.greyBlob","sockets":["body","head"]}},"binding":{"loops":["idle","walk"],"material":{"envStrength":0.7,"family":"pbr","metalness":0,"occlusion":0,"roughness":0.85,"vertexColours":true},"poseLayers":{"idle":[{"id":"blob-pulse","period":1.5707963267948966,"phasePeriod":1,"phaseSteps":0,"times":[0,0.016534698176788386,0.03306939635357677,0.049604094530365156,0.06613879270715355,0.08267349088394192,0.09920818906073031,0.11574288723751869,0.1322775854143071,0.14881228359109547,0.16534698176788384,0.18188167994467222,0.19841637812146062,0.21495107629824903,0.23148577447503738,0.24802047265182575,0.2645551708286142,0.28108986900540256,0.29762456718219094,0.3141592653589793,0.3306939635357677,0.3472286617125561,0.36376335988934444,0.3802980580661328,0.39683275624292125,0.4133674544197096,0.42990215259649806,0.4464368507732864,0.46297154895007475,0.4795062471268632,0.4960409453036515,0.5125756434804399,0.5291103416572284,0.5456450398340167,0.5621797380108051,0.5787144361875934,0.5952491343643819,0.6117838325411703,0.6283185307179586,0.6448532288947469,0.6613879270715354,0.6779226252483237,0.6944573234251122,0.7109920216019006,0.7275267197786889,0.7440614179554773,0.7605961161322656,0.7771308143090542,0.7936655124858425,0.8102002106626308,0.8267349088394192,0.8432696070162076,0.8598043051929961,0.8763390033697844,0.8928737015465728,0.9094083997233612,0.9259430979001495,0.9424777960769378,0.9590124942537264,0.9755471924305147,0.992081890607303,1.0086165887840914,1.0251512869608799,1.0416859851376683,1.0582206833144567,1.074755381491245,1.0912900796680334,1.1078247778448218,1.1243594760216102,1.1408941741983987,1.1574288723751869,1.1739635705519753,1.1904982687287637,1.207032966905552,1.2235676650823406,1.2401023632591288,1.2566370614359172,1.2731717596127057,1.2897064577894939,1.3062411559662825,1.3227758541430708,1.3393105523198592,1.3558452504966474,1.372379948673436,1.3889146468502245,1.4054493450270127,1.4219840432038011,1.4385187413805893,1.4550534395573778,1.4715881377341664,1.4881228359109546,1.504657534087743,1.5211922322645313,1.5377269304413197,1.5542616286181083,1.5707963267948966],"tracks":[{"axis":"y","bone":"body","order":"XYZ","property":"scale","values":[0,0.0052872,0.0105514,0.0157694,0.0209184,0.025976,0.0309199,0.0357287,0.0403812,0.0448572,0.049137,0.053202,0.0570343,0.0606172,0.063935,0.0669733,0.0697187,0.0721593,0.0742843,0.0760845,0.077552,0.0786804,0.0794647,0.0799016,0.0799891,0.0797268,0.0791158,0.0781589,0.0768603,0.0752256,0.0732619,0.0709778,0.0683834,0.06549,0.0623102,0.0588579,0.0551483,0.0511975,0.0470228,0.0426425,0.0380758,0.0333425,0.0284635,0.02346,0.0183539,0.0131676,0.0079236,0.0026451,-0.0026451,-0.0079236,-0.0131676,-0.0183539,-0.02346,-0.0284635,-0.0333425,-0.0380758,-0.0426425,-0.0470228,-0.0511975,-0.0551483,-0.0588579,-0.0623102,-0.06549,-0.0683834,-0.0709778,-0.0732619,-0.0752256,-0.0768603,-0.0781589,-0.0791158,-0.0797268,-0.0799891,-0.0799016,-0.0794647,-0.0786804,-0.077552,-0.0760845,-0.0742843,-0.0721593,-0.0697187,-0.0669733,-0.063935,-0.0606172,-0.0570343,-0.053202,-0.049137,-0.0448572,-0.0403812,-0.0357287,-0.0309199,-0.025976,-0.0209184,-0.0157694,-0.0105514,-0.0052872,0]}]}],"walk":[{"id":"blob-pulse","period":1.5707963267948966,"phasePeriod":1,"phaseSteps":0,"times":[0,0.016534698176788386,0.03306939635357677,0.049604094530365156,0.06613879270715355,0.08267349088394192,0.09920818906073031,0.11574288723751869,0.1322775854143071,0.14881228359109547,0.16534698176788384,0.18188167994467222,0.19841637812146062,0.21495107629824903,0.23148577447503738,0.24802047265182575,0.2645551708286142,0.28108986900540256,0.29762456718219094,0.3141592653589793,0.3306939635357677,0.3472286617125561,0.36376335988934444,0.3802980580661328,0.39683275624292125,0.4133674544197096,0.42990215259649806,0.4464368507732864,0.46297154895007475,0.4795062471268632,0.4960409453036515,0.5125756434804399,0.5291103416572284,0.5456450398340167,0.5621797380108051,0.5787144361875934,0.5952491343643819,0.6117838325411703,0.6283185307179586,0.6448532288947469,0.6613879270715354,0.6779226252483237,0.6944573234251122,0.7109920216019006,0.7275267197786889,0.7440614179554773,0.7605961161322656,0.7771308143090542,0.7936655124858425,0.8102002106626308,0.8267349088394192,0.8432696070162076,0.8598043051929961,0.8763390033697844,0.8928737015465728,0.9094083997233612,0.9259430979001495,0.9424777960769378,0.9590124942537264,0.9755471924305147,0.992081890607303,1.0086165887840914,1.0251512869608799,1.0416859851376683,1.0582206833144567,1.074755381491245,1.0912900796680334,1.1078247778448218,1.1243594760216102,1.1408941741983987,1.1574288723751869,1.1739635705519753,1.1904982687287637,1.207032966905552,1.2235676650823406,1.2401023632591288,1.2566370614359172,1.2731717596127057,1.2897064577894939,1.3062411559662825,1.3227758541430708,1.3393105523198592,1.3558452504966474,1.372379948673436,1.3889146468502245,1.4054493450270127,1.4219840432038011,1.4385187413805893,1.4550534395573778,1.4715881377341664,1.4881228359109546,1.504657534087743,1.5211922322645313,1.5377269304413197,1.5542616286181083,1.5707963267948966],"tracks":[{"axis":"y","bone":"body","order":"XYZ","property":"scale","values":[0,0.0052872,0.0105514,0.0157694,0.0209184,0.025976,0.0309199,0.0357287,0.0403812,0.0448572,0.049137,0.053202,0.0570343,0.0606172,0.063935,0.0669733,0.0697187,0.0721593,0.0742843,0.0760845,0.077552,0.0786804,0.0794647,0.0799016,0.0799891,0.0797268,0.0791158,0.0781589,0.0768603,0.0752256,0.0732619,0.0709778,0.0683834,0.06549,0.0623102,0.0588579,0.0551483,0.0511975,0.0470228,0.0426425,0.0380758,0.0333425,0.0284635,0.02346,0.0183539,0.0131676,0.0079236,0.0026451,-0.0026451,-0.0079236,-0.0131676,-0.0183539,-0.02346,-0.0284635,-0.0333425,-0.0380758,-0.0426425,-0.0470228,-0.0511975,-0.0551483,-0.0588579,-0.0623102,-0.06549,-0.0683834,-0.0709778,-0.0732619,-0.0752256,-0.0768603,-0.0781589,-0.0791158,-0.0797268,-0.0799891,-0.0799016,-0.0794647,-0.0786804,-0.077552,-0.0760845,-0.0742843,-0.0721593,-0.0697187,-0.0669733,-0.063935,-0.0606172,-0.0570343,-0.053202,-0.049137,-0.0448572,-0.0403812,-0.0357287,-0.0309199,-0.025976,-0.0209184,-0.0157694,-0.0105514,-0.0052872,0]}]}]},"skin":"grey-blob"}}
|