@wildshard/sdk 0.0.1 → 0.2.4
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 +895 -0
- package/README.md +13 -5
- 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 +365 -3
- 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 +47 -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 +39 -0
- package/src/cli/bin.mjs +8 -0
- package/src/cli/delete/delete.ts +258 -0
- package/src/cli/help.ts +204 -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 +291 -0
- package/src/cli/report.ts +20 -0
- package/src/cli/shardfile/command.ts +49 -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/agentFiles.ts +127 -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 +118 -0
- package/src/sharddev/checkProject.ts +127 -0
- package/src/sharddev/cli.ts +200 -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 +226 -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 +29 -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 +304 -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,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// C0 (J137): record which public files each product owns, so a shardfile stands alone. A product's list goes to
|
|
3
|
+
// src/shards/<folder>/mounts.json; `writeOutputProduct` copies those files into the product under mounts/, and `cook` then
|
|
4
|
+
// needs nothing from the tree. Run it over a finished build, after a change to what a shard reads:
|
|
5
|
+
// node scripts/record-shard-mounts.mjs [--root=<tree>] [--dist=dist] [--check]
|
|
6
|
+
// A product reads a public file when its spawn manifests list it (the default and packs books, both tiers), its sections
|
|
7
|
+
// name it (or a folder holding it, or its tier variant), its boot inventory lists it, its legacy boot pack holds it, or it
|
|
8
|
+
// sits in an audio folder named for the shard, or its texture table (discovery `native.ktx2`) names it as a stand-in. A file more than one shard folder reads belongs to the engine (the shared
|
|
9
|
+
// sfx, the piano stings): it stays out of every list, and a product of the same folder may share one.
|
|
10
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
12
|
+
import { shardProducts } from '@wildshard/engine/scripts/shard-outputs.mjs';
|
|
13
|
+
|
|
14
|
+
const argument = (name) => process.argv.find(row => row.startsWith(`--${name}=`))?.slice(name.length + 3);
|
|
15
|
+
// --root: the tree whose src/shards, public and out are recorded (a shard repo; this repo by default).
|
|
16
|
+
const root = resolve(argument('root') ?? resolve(import.meta.dirname, '..'));
|
|
17
|
+
const dist = resolve(root, argument('dist') ?? 'dist'), check = process.argv.includes('--check');
|
|
18
|
+
const publicRoot = resolve(root, 'public'), out = resolve(root, 'out');
|
|
19
|
+
|
|
20
|
+
const bare = (url) => url.split('?')[0] ?? url;
|
|
21
|
+
const onDisk = (url) => { const file = join(publicRoot, url.slice(1)); return existsSync(file) && statSync(file).isFile(); };
|
|
22
|
+
const isFolder = (url) => { const file = join(publicRoot, url.slice(1)); return existsSync(file) && statSync(file).isDirectory(); };
|
|
23
|
+
const filesUnder = (url) => readdirSync(join(publicRoot, url.slice(1)), { recursive: true, withFileTypes: true })
|
|
24
|
+
.filter(row => row.isFile()).map(row => `/${relative(publicRoot, join(row.parentPath, row.name)).split(sep).join('/')}`);
|
|
25
|
+
/** The tier and encoding variants the boot's `tierUrl` and stand-in table can read for a section's URL. */
|
|
26
|
+
function variants(url) {
|
|
27
|
+
const dot = url.lastIndexOf('.'), stem = url.slice(0, dot), extension = url.slice(dot);
|
|
28
|
+
const rows = [url, `${stem}.phone${extension}`, `${stem}.ktx2`, `${stem}.phone.ktx2`];
|
|
29
|
+
return [...rows, ...rows.map(row => row.replace(/^\/assets\//u, '/assets/gpu/'))];
|
|
30
|
+
}
|
|
31
|
+
/** A .gltf's external buffers and images, which load beside it. */
|
|
32
|
+
function gltfParts(url) {
|
|
33
|
+
const body = JSON.parse(readFileSync(join(publicRoot, url.slice(1)), 'utf8')), folder = dirname(url);
|
|
34
|
+
return [...body.buffers ?? [], ...body.images ?? []].flatMap(row => typeof row.uri === 'string' && !row.uri.startsWith('data:') ? [`${folder}/${row.uri}`] : []);
|
|
35
|
+
}
|
|
36
|
+
function sectionUrls(slug) {
|
|
37
|
+
const found = new Set(), folder = join(out, slug, 'sections');
|
|
38
|
+
if (!existsSync(folder)) return found;
|
|
39
|
+
for (const row of readdirSync(folder, { recursive: true, withFileTypes: true })) {
|
|
40
|
+
if (!row.isFile()) continue;
|
|
41
|
+
for (const match of readFileSync(join(row.parentPath, row.name), 'utf8').matchAll(/"(\/assets\/[^"]+)"/gu)) found.add(match[1].replace(/\/$/u, ''));
|
|
42
|
+
}
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
/** A source file with a cooked stand-in on both tiers, and those stand-ins: no device reads the source, so a shardfile carries
|
|
46
|
+
* what the device does. */
|
|
47
|
+
function rawForms(folder) {
|
|
48
|
+
const file = resolve(root, 'src/shards', folder, 'ktx2.generated.ts');
|
|
49
|
+
if (!existsSync(file)) return new Map();
|
|
50
|
+
const [, phone = '', desktop = ''] = /"phone": \{([\s\S]*?)\n {2}\},\n {2}"desktop": \{([\s\S]*?)\n {2}\}/u.exec(readFileSync(file, 'utf8')) ?? [];
|
|
51
|
+
const rows = (text) => new Map([...text.matchAll(/"(\/assets\/[^"]+)": "(\/assets\/[^"]+)"/gu)].map(match => [match[1], match[2]]));
|
|
52
|
+
const onPhone = rows(phone);
|
|
53
|
+
return new Map([...rows(desktop)].flatMap(([url, cooked]) => onPhone.has(url) ? [[url, [onPhone.get(url), cooked]]] : []));
|
|
54
|
+
}
|
|
55
|
+
/** Every stand-in a product's texture table names, every group (shard, grid) and tier: the page reads the hashed target in
|
|
56
|
+
* place of the source URL, and no tier variant spells it (S12, GAME-89: Pine's `*.phone.rigged-<hash>.glb` rigs and birds). */
|
|
57
|
+
function tableTargets(slug) {
|
|
58
|
+
const file = join(out, slug, 'mounts/shardfiles', slug, 'discovery.json');
|
|
59
|
+
if (!existsSync(file)) return [];
|
|
60
|
+
const table = JSON.parse(readFileSync(file, 'utf8')).native?.ktx2;
|
|
61
|
+
if (table?.$call !== 'pageModeKtx2') return [];
|
|
62
|
+
return Object.values(table.args?.[0] ?? {}).flatMap(tiers => Object.values(tiers ?? {}).flatMap(rows => Object.values(rows ?? {})))
|
|
63
|
+
.filter(url => typeof url === 'string');
|
|
64
|
+
}
|
|
65
|
+
const SHELL = [/^\/assets\/(?:(?:spawn|packs|physics|fonts)\/|boot-)/u, /\.(?:js|mjs|css)$/u];
|
|
66
|
+
const shellOwned = (url) => SHELL.some(rule => rule.test(url));
|
|
67
|
+
function legacyMembers(slug) {
|
|
68
|
+
const file = resolve(root, 'src/client/game/boot/packs.generated.ts');
|
|
69
|
+
if (!existsSync(file)) return []; // a tree after the engine lift has no legacy boot packs
|
|
70
|
+
const source = readFileSync(file, 'utf8');
|
|
71
|
+
return source.split(/^ {2}"/mu).filter(block => [`${slug}"`, `${slug}-`].some(start => block.startsWith(start)))
|
|
72
|
+
.flatMap(block => [...block.matchAll(/"(\/assets\/[^"]+)"/gu)].map(match => match[1]));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const html = readFileSync(join(dist, 'index.html'), 'utf8');
|
|
76
|
+
const bank = JSON.parse(/id="boot-module-files">([^<]+)</u.exec(html)?.[1] ?? 'null');
|
|
77
|
+
const book = JSON.parse(readFileSync(join(dist, readdirSync(join(dist, 'assets/spawn')).filter(name => name.startsWith('packs-')).map(name => `assets/spawn/${name}`)[0] ?? ''), 'utf8'));
|
|
78
|
+
const folders = readdirSync(resolve(root, 'src/shards'), { withFileTypes: true }).filter(row => row.isDirectory()).map(row => row.name);
|
|
79
|
+
const products = shardProducts(root, folders).filter(row => existsSync(join(out, row.slug, 'shard.json')));
|
|
80
|
+
|
|
81
|
+
const reads = new Map(), folderOf = new Map(products.map(row => [row.slug, row.folder]));
|
|
82
|
+
for (const { slug } of products) {
|
|
83
|
+
const pending = new Set();
|
|
84
|
+
for (const shelf of [bank.spawnManifests.client[slug], book.client[slug]]) for (const address of Object.values(shelf ?? {})) {
|
|
85
|
+
for (const row of JSON.parse(readFileSync(join(dist, address.url.slice(1)), 'utf8')).files) pending.add(bare(row.url));
|
|
86
|
+
}
|
|
87
|
+
const extra = bank.extras[`/shardfiles/${slug}/`];
|
|
88
|
+
if (extra !== undefined) for (const [url] of JSON.parse(readFileSync(join(dist, extra[0].slice(1)), 'utf8'))) pending.add(bare(url));
|
|
89
|
+
for (const url of sectionUrls(slug)) {
|
|
90
|
+
if (isFolder(url)) for (const file of filesUnder(url)) pending.add(file);
|
|
91
|
+
else for (const variant of variants(url)) pending.add(variant);
|
|
92
|
+
}
|
|
93
|
+
for (const url of legacyMembers(slug)) pending.add(bare(url));
|
|
94
|
+
const named = tableTargets(slug);
|
|
95
|
+
for (const url of named) pending.add(bare(url));
|
|
96
|
+
// The boot tables name audio by slot, and a slot can load long after control: a folder named for the shard is its own.
|
|
97
|
+
const names = new Set([slug, slug.replace(/^open-plot-/u, ''), slug.split('-')[0]]);
|
|
98
|
+
// A bake names its blobs inside its own files, so the folder is the unit (Nalati's held bow reads one that way).
|
|
99
|
+
for (const name of names) if (isFolder(`/assets/${name}/baked`)) for (const file of filesUnder(`/assets/${name}/baked`)) pending.add(file);
|
|
100
|
+
for (const kind of ['sfx', 'music']) for (const name of isFolder(`/assets/${kind}`) ? readdirSync(join(publicRoot, 'assets', kind)) : []) {
|
|
101
|
+
if ((names.has(name) || name.startsWith(`${slug}-`)) && isFolder(`/assets/${kind}/${name}`)) for (const file of filesUnder(`/assets/${kind}/${name}`)) pending.add(file);
|
|
102
|
+
}
|
|
103
|
+
const seen = new Set(), raws = rawForms(folderOf.get(slug));
|
|
104
|
+
for (const [url, cooked] of raws) if (pending.has(url)) for (const row of cooked) pending.add(row);
|
|
105
|
+
for (const url of pending) {
|
|
106
|
+
if (!url.startsWith('/assets/') || shellOwned(url) || !onDisk(url) || seen.has(url) || raws.has(url)) continue;
|
|
107
|
+
seen.add(url);
|
|
108
|
+
if (url.endsWith('.gltf')) for (const part of gltfParts(url)) if (onDisk(part)) seen.add(part);
|
|
109
|
+
}
|
|
110
|
+
// A target not in public/ cannot be mounted: name it, so the gap shows here and not as a 404 on play.
|
|
111
|
+
for (const url of named) if (url.startsWith('/assets/') && !shellOwned(url) && !onDisk(url)) console.warn(`${slug}: texture table names ${url}, not in public/`);
|
|
112
|
+
reads.set(slug, seen);
|
|
113
|
+
}
|
|
114
|
+
const users = new Map();
|
|
115
|
+
for (const [slug, urls] of reads) for (const url of urls) (users.get(url) ?? users.set(url, new Set()).get(url)).add(folderOf.get(slug));
|
|
116
|
+
|
|
117
|
+
let stale = 0;
|
|
118
|
+
for (const folder of folders) {
|
|
119
|
+
const outputs = {};
|
|
120
|
+
for (const { slug } of products.filter(row => row.folder === folder)) {
|
|
121
|
+
const owned = [...reads.get(slug)].filter(url => users.get(url).size === 1).sort((left, right) => left.localeCompare(right));
|
|
122
|
+
// A shard's recorded programs: its page reads them by name, so the tarball carries them (D5).
|
|
123
|
+
if (existsSync(join(publicRoot, 'programs', `${slug}.json`))) owned.push(`/programs/${slug}.json`);
|
|
124
|
+
if (owned.length > 0) outputs[slug] = owned;
|
|
125
|
+
const bytes = owned.reduce((sum, url) => sum + statSync(join(publicRoot, url.slice(1))).size, 0);
|
|
126
|
+
console.log(`${slug}: ${owned.length} mounts, ${(bytes / 1e6).toFixed(1)} MB`);
|
|
127
|
+
}
|
|
128
|
+
const file = resolve(root, 'src/shards', folder, 'mounts.json'), text = `${JSON.stringify({ version: 1, outputs }, null, 1)}\n`;
|
|
129
|
+
if (Object.keys(outputs).length === 0) continue;
|
|
130
|
+
if (check) { if (!existsSync(file) || readFileSync(file, 'utf8') !== text) { console.error(`stale: ${file}`); stale++; } }
|
|
131
|
+
else writeFileSync(file, text);
|
|
132
|
+
}
|
|
133
|
+
if (stale > 0) process.exit(1);
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// CS1: plain, hash-bound section facts. No progress, credit or host score.
|
|
2
|
+
import '@wildshard/engine/scripts/format-hook.mjs';
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
|
+
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs';
|
|
6
|
+
import { dirname, relative, resolve } from 'node:path';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import ts from '@typescript/typescript6';
|
|
9
|
+
import { outputFormat } from '@wildshard/engine/scripts/shard-platform-format.mjs';
|
|
10
|
+
import { shardProducts } from '@wildshard/engine/scripts/shard-outputs.mjs';
|
|
11
|
+
import type { SectionMapping } from '@wildshard/format/outputFields';
|
|
12
|
+
import { formatSource } from '@wildshard/engine/scripts/format-package.mjs';
|
|
13
|
+
|
|
14
|
+
const { validatePlatformFile, platformFileFamily } = await import('@wildshard/format/platformFileFamilies');
|
|
15
|
+
|
|
16
|
+
interface Reader {path:string;line:number;selector:string|null;name:string|null;schema:string|null;groups:string[];access:string}
|
|
17
|
+
interface Entry {product:string;shard:string;name:string;kind:'platform'|'named-json'|'platform-file';path:string;bytes:number;hash:string;schema:string|null;document:unknown;routes:string[]}
|
|
18
|
+
interface Product {product:string;shard:string;indexHash:string;sourceHash:string;entries:Entry[]}
|
|
19
|
+
interface InventoryRow extends Omit<Entry,'document'> {schemaIdentity:string;schemaBindings:string[];schemaCandidates:string[];provenance:string;readers:Reader[];schemaUsers:string[];registeredReader:string|null}
|
|
20
|
+
interface Inventory {version:number;basis:string;products:Omit<Product,'entries'>[];rows:InventoryRow[];unresolvedReaders:Reader[]}
|
|
21
|
+
|
|
22
|
+
const ROOT=resolve(import.meta.dirname,'..'),HOST_PIN='419cf542cd';
|
|
23
|
+
const digest=(value:string|Uint8Array):string=>createHash('sha256').update(value).digest('hex');
|
|
24
|
+
const sorted=(values:Iterable<string>):string[]=>[...new Set(values)].sort((a,b)=>a.localeCompare(b));
|
|
25
|
+
const canonical=(value:unknown):string=>{
|
|
26
|
+
const text=JSON.stringify(value,(_key:string,item:unknown):unknown=>item!==null&&typeof item==='object'&&!Array.isArray(item)
|
|
27
|
+
?Object.fromEntries(Object.entries(item).sort(([a],[b])=>a.localeCompare(b))):item);
|
|
28
|
+
if(text===undefined)throw new Error('Missing schema document');return text;
|
|
29
|
+
};
|
|
30
|
+
const tree=(root:string):string[]=>readdirSync(root,{withFileTypes:true}).flatMap(entry=>entry.isSymbolicLink()?[]:entry.isDirectory()?tree(resolve(root,entry.name)):[resolve(root,entry.name)]);
|
|
31
|
+
const sourceFile=(path:string,source:string):ts.SourceFile=>ts.createSourceFile(path,source,ts.ScriptTarget.Latest,true);
|
|
32
|
+
const textName=(node:ts.Node|undefined):string|null=>node!==undefined&&(ts.isIdentifier(node)||ts.isStringLiteral(node)||ts.isNoSubstitutionTemplateLiteral(node))?node.text:null;
|
|
33
|
+
const unwrap=(node:ts.Expression):ts.Expression=>ts.isAsExpression(node)||ts.isSatisfiesExpression(node)||ts.isParenthesizedExpression(node)?unwrap(node.expression):node;
|
|
34
|
+
|
|
35
|
+
/** Follow emitted section routes through named documents, including shared
|
|
36
|
+
* descendants and cycles. No source-name search is mistaken for a live route. */
|
|
37
|
+
export function namedJsonRoutes(roots:ReadonlyMap<string,unknown>,documents:ReadonlyMap<string,unknown>):Record<string,string[]>{
|
|
38
|
+
const result:Record<string,string[]>={};
|
|
39
|
+
const names=(value:unknown):string[]=>typeof value==='string'?(documents.has(value)?[value]:[]):Array.isArray(value)?value.flatMap(names)
|
|
40
|
+
:value!==null&&typeof value==='object'?Object.values(value).flatMap(names):[];
|
|
41
|
+
for(const [root,value]of roots){
|
|
42
|
+
const visited=new Set<string>(),pending=names(value);
|
|
43
|
+
while(pending.length>0){
|
|
44
|
+
const name=pending.pop();if(name===undefined||visited.has(name))continue;visited.add(name);
|
|
45
|
+
result[name]=sorted([...(result[name]??[]),root]);pending.push(...names(documents.get(name)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
function imports(file:ts.SourceFile):Map<string,string>{
|
|
51
|
+
const result=new Map<string,string>();
|
|
52
|
+
for(const statement of file.statements)if(ts.isImportDeclaration(statement)&&ts.isStringLiteral(statement.moduleSpecifier)){
|
|
53
|
+
const bindings=statement.importClause?.namedBindings;
|
|
54
|
+
if(bindings!==undefined&&ts.isNamedImports(bindings))for(const item of bindings.elements){
|
|
55
|
+
let module=statement.moduleSpecifier.text;
|
|
56
|
+
if(module.startsWith('.'))module=relative('src',resolve(dirname(file.fileName),module)).replaceAll('\\','/').replace(/\.ts$/u,'');
|
|
57
|
+
if(module.startsWith('format/'))module=`@wildshard/${module}`;
|
|
58
|
+
result.set(item.name.text,`${module}#${item.propertyName?.text??item.name.text}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
/** Static defining bindings, not a second schema registry. */
|
|
64
|
+
export function platformSchemaBindings(source:string):Record<string,string>{
|
|
65
|
+
const file=sourceFile('src/format/platformDataSections.ts',source),bindings=imports(file),result:Record<string,string>={};
|
|
66
|
+
const visit=(node:ts.Node):void=>{
|
|
67
|
+
if(ts.isVariableDeclaration(node)&&textName(node.name)==='PLATFORM_DATA_SECTIONS'&&node.initializer!==undefined){
|
|
68
|
+
const object=unwrap(node.initializer);
|
|
69
|
+
if(!ts.isObjectLiteralExpression(object))throw new Error('Platform schema registry is not an object');
|
|
70
|
+
for(const property of object.properties){
|
|
71
|
+
if(!ts.isPropertyAssignment(property))throw new Error('Unresolved platform schema name');
|
|
72
|
+
const name=textName(property.name);
|
|
73
|
+
if(name===null)throw new Error('Unresolved platform schema name');
|
|
74
|
+
const value=unwrap(property.initializer);
|
|
75
|
+
if(!ts.isObjectLiteralExpression(value))throw new Error('Unresolved platform schema binding');
|
|
76
|
+
const schema=value.properties.find(row=>ts.isPropertyAssignment(row)&&textName(row.name)==='schema');
|
|
77
|
+
const binding=schema!==undefined&&ts.isPropertyAssignment(schema)?textName(unwrap(schema.initializer)):null;
|
|
78
|
+
const identity=binding===null?undefined:bindings.get(binding);
|
|
79
|
+
if(identity===undefined)throw new Error(`Missing defining platform schema: ${textName(property.name)}`);
|
|
80
|
+
result[name]=identity;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
ts.forEachChild(node,visit);
|
|
84
|
+
};
|
|
85
|
+
visit(file);if(Object.keys(result).length===0)throw new Error('Missing platform schema registry');return result;
|
|
86
|
+
}
|
|
87
|
+
/** H-group labels come from the accepted historical table and its exact cited text. */
|
|
88
|
+
export function hostGroupBindings(table:string,hostBar:string):Record<string,string[]>{
|
|
89
|
+
const lines=hostBar.split('\n'),result:Record<string,string[]>={};
|
|
90
|
+
for(const match of table.matchAll(/^\| (H\d{3}) [^|]*\| L(\d+) /gmu)){
|
|
91
|
+
const line=lines[Number(match[2])-1];if(line===undefined)throw new Error(`Missing accepted host line: ${match[1]}`);
|
|
92
|
+
for(const module of line.matchAll(/`((?:engine|game|sdk|sharddev|format)\/[\w./-]+)(?:#[\w$]+)?`/gu)){
|
|
93
|
+
const group=match[1];if(group===undefined)throw new Error('Missing accepted host group');
|
|
94
|
+
const path=`src/${module[1]}.ts`;result[path]=sorted([...(result[path]??[]),group]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return result;
|
|
98
|
+
}
|
|
99
|
+
/** Literal reads and adjacent defining parsers are source evidence, not proof of live adoption. */
|
|
100
|
+
export function sectionReaders(files:readonly {path:string;source:string}[],groups:Readonly<Record<string,string[]>>={}):Reader[]{
|
|
101
|
+
const rows:Reader[]=[];
|
|
102
|
+
for(const {path,source}of files){
|
|
103
|
+
const file=sourceFile(path,source),bindings=imports(file);
|
|
104
|
+
const visit=(node:ts.Node):void=>{
|
|
105
|
+
if(ts.isCallExpression(node)&&ts.isPropertyAccessExpression(node.expression)&&['json','section'].includes(node.expression.name.text)&&node.arguments.length===1){
|
|
106
|
+
const argument=node.arguments[0],name=argument!==undefined&&(ts.isStringLiteral(argument)||ts.isNoSubstitutionTemplateLiteral(argument))?argument.text:null;let parent=node.parent;
|
|
107
|
+
while(parent!==undefined&&(ts.isAwaitExpression(parent)||ts.isAsExpression(parent)||ts.isParenthesizedExpression(parent)))parent=parent.parent;
|
|
108
|
+
const schemaName=parent!==undefined&&ts.isCallExpression(parent)&&ts.isPropertyAccessExpression(parent.expression)&&parent.expression.name.text==='parse'?textName(parent.arguments[0]):null;
|
|
109
|
+
const schema=schemaName===null?undefined:bindings.get(schemaName);
|
|
110
|
+
let owner:ts.Node|undefined=node.parent,selector:string|null=null;
|
|
111
|
+
while(owner!==undefined){
|
|
112
|
+
if((ts.isFunctionDeclaration(owner)||ts.isMethodDeclaration(owner)||ts.isVariableDeclaration(owner))&&textName(owner.name)!==null){selector=textName(owner.name);break;}
|
|
113
|
+
owner=owner.parent;
|
|
114
|
+
}
|
|
115
|
+
rows.push({path,line:file.getLineAndCharacterOfPosition(node.getStart()).line+1,
|
|
116
|
+
selector,name,schema:schema??null,groups:groups[path]??[],access:node.expression.name.text});
|
|
117
|
+
}
|
|
118
|
+
ts.forEachChild(node,visit);
|
|
119
|
+
};
|
|
120
|
+
visit(file);
|
|
121
|
+
}
|
|
122
|
+
return rows.sort((a,b)=>a.path.localeCompare(b.path)||a.line-b.line);
|
|
123
|
+
}
|
|
124
|
+
/** Every JSON member is checked against its actual declared hash and size. */
|
|
125
|
+
export function productSectionEntries(folder:string,product:string,shard:string):Product{
|
|
126
|
+
const indexBytes=readFileSync(resolve(folder,'shard.json')),index=outputFormat.parseOutputIndex(JSON.parse(indexBytes.toString('utf8')));
|
|
127
|
+
if(index.identity.slug!==(product==='_template'?'template':product))throw new Error(`Foreign product identity: ${product}`);
|
|
128
|
+
const read=(entry:{path:string;hash:string;bytes?:number;compressed?:number}):unknown=>{
|
|
129
|
+
const path=resolve(folder,entry.path);
|
|
130
|
+
for(let at=path;at!==resolve(folder);at=dirname(at))if(lstatSync(at).isSymbolicLink())throw new Error(`Symbolic inventory member: ${entry.path}`);
|
|
131
|
+
const bytes=readFileSync(path),expected=entry.bytes??entry.compressed;
|
|
132
|
+
if(bytes.byteLength!==expected||digest(bytes)!==entry.hash)throw new Error(`Inventory member hash/size differs: ${product}/${entry.path}`);
|
|
133
|
+
return JSON.parse(bytes.toString('utf8'));
|
|
134
|
+
};
|
|
135
|
+
const roots=new Map<string,unknown>(),documents=new Map<string,unknown>();
|
|
136
|
+
const entries:Entry[]=index.sections.map(section=>{
|
|
137
|
+
roots.set(section.name,read(section));
|
|
138
|
+
return {product,shard,name:section.name,kind:'platform',path:section.path,
|
|
139
|
+
bytes:section.bytes,hash:section.hash,schema:section.schema,document:null,routes:[]};
|
|
140
|
+
});
|
|
141
|
+
for(const file of index.files)if(file.kind==='json'&&file.name!==undefined){
|
|
142
|
+
const value=read(file),source=file.jsonSchema?.['$comment'];documents.set(file.name,value);
|
|
143
|
+
const family=validatePlatformFile(file.name,typeof source==='string'?source:undefined,value);
|
|
144
|
+
entries.push({product,shard,name:file.name,kind:family===undefined?'named-json':'platform-file',path:file.path,bytes:file.compressed,hash:file.hash,schema:null,document:file.jsonSchema??null,routes:[]});
|
|
145
|
+
}
|
|
146
|
+
const routes=namedJsonRoutes(roots,documents);
|
|
147
|
+
for(const entry of entries)entry.routes=routes[entry.name]??[];
|
|
148
|
+
return {product,shard,indexHash:digest(indexBytes),sourceHash:index.build.sourceHash,entries};
|
|
149
|
+
}
|
|
150
|
+
/** Emitters are deduplicated by source project, never counted as live host users. */
|
|
151
|
+
export function sectionInventory(products:readonly Product[],catalogue:Readonly<Record<string,unknown>>,platformBindings:Readonly<Record<string,string>>,rootSections:readonly SectionMapping[],readers:readonly Reader[]):Inventory{
|
|
152
|
+
if(new Set(products.map(product=>product.product)).size!==products.length)throw new Error('Duplicate inventory product');
|
|
153
|
+
const documents=new Map(Object.entries(catalogue).map(([name,document])=>[name,canonical(document)]));
|
|
154
|
+
const shape=(document:unknown):string=>canonical(document!==null&&typeof document==='object'&&!Array.isArray(document)
|
|
155
|
+
?Object.fromEntries(Object.entries(document).filter(([key])=>key!=='$comment')):document);
|
|
156
|
+
const shapes=Object.entries(catalogue).map(([name,document])=>({name,shape:shape(document)}));
|
|
157
|
+
const rows:InventoryRow[]=products.flatMap(product=>product.entries).map(entry=>{
|
|
158
|
+
let schemaBindings:string[]=[],schemaIdentity:string,provenance:string;
|
|
159
|
+
if(entry.kind==='platform'){
|
|
160
|
+
const binding=platformBindings[entry.name],mapping=rootSections.find(row=>row.name===entry.name);
|
|
161
|
+
if(binding!==undefined)schemaBindings=[binding];
|
|
162
|
+
else if(mapping!==undefined)schemaBindings=[`@wildshard/format/${mapping.row===undefined?'shardSchema#ShardfileFieldSchemas':'rows#RowsSchema'}`];
|
|
163
|
+
else throw new Error(`Missing platform schema source: ${entry.name}`);
|
|
164
|
+
if(entry.schema===null)throw new Error(`Missing platform schema identity: ${entry.name}`);
|
|
165
|
+
schemaIdentity=entry.schema;provenance='platform-registry';
|
|
166
|
+
}else{
|
|
167
|
+
const claimed=entry.document!==null&&typeof entry.document==='object'?Reflect.get(entry.document,'$comment'):undefined;
|
|
168
|
+
if(typeof claimed==='string'&&documents.get(claimed)===canonical(entry.document))schemaBindings=[claimed];
|
|
169
|
+
schemaIdentity=entry.document===null?`unattributed:${entry.shard}/${entry.name}`:`json:${digest(canonical(entry.document))}`;
|
|
170
|
+
provenance=schemaBindings.length===0?'unattributed':'verified-format';
|
|
171
|
+
}
|
|
172
|
+
const matches=readers.filter(reader=>reader.access===(entry.kind==='named-json'||entry.kind==='platform-file'?'json':'section')
|
|
173
|
+
&&(reader.name===entry.name||reader.schema!==null&&schemaBindings.includes(reader.schema)));
|
|
174
|
+
const {document:_document,...metadata}=entry;
|
|
175
|
+
const schemaCandidates=entry.document===null?[]:shapes.filter(candidate=>candidate.shape===shape(entry.document)).map(candidate=>candidate.name);
|
|
176
|
+
const family=entry.kind==='platform-file'?platformFileFamily(entry.name,schemaBindings[0]):undefined;
|
|
177
|
+
if(entry.kind==='platform-file'&&family===undefined)throw new Error(`Platform family requires verified defining schema: ${entry.name}`);
|
|
178
|
+
return Object.assign(metadata,{schemaIdentity,schemaBindings,schemaCandidates,provenance,readers:matches,schemaUsers:[],registeredReader:family?.reader??null});
|
|
179
|
+
});
|
|
180
|
+
for(const row of rows)row.schemaUsers=sorted(rows.filter(candidate=>candidate.schemaIdentity===row.schemaIdentity).map(candidate=>candidate.shard));
|
|
181
|
+
return {version:1,basis:'Hash-verified emitted JSON; source readers are static evidence, not host scores or live adoption.',
|
|
182
|
+
products:products.map(({entries:_entries,...product})=>product),rows:rows.sort((a,b)=>a.product.localeCompare(b.product)||a.name.localeCompare(b.name)),
|
|
183
|
+
unresolvedReaders:readers.filter(reader=>!rows.some(row=>row.readers.includes(reader)))};
|
|
184
|
+
}
|
|
185
|
+
/** Read existing products only; missing declared outputs refuse rather than become empty rows. */
|
|
186
|
+
export async function readSectionInventory(root:string=ROOT,productsRoot:string=resolve(root,'out')):Promise<Inventory>{
|
|
187
|
+
const {namedFormatJsonSchemas}=await import('@wildshard/sdk/formatJsonSchema');
|
|
188
|
+
const {OUTPUT_SECTIONS}=await import('@wildshard/format/outputFields');
|
|
189
|
+
const folders=readdirSync(resolve(root,'src/shards'),{withFileTypes:true})
|
|
190
|
+
.filter(entry=>entry.isDirectory()&&!entry.name.endsWith('-legacy')&&existsSync(resolve(root,'src/shards',entry.name,'shard.config.ts'))).map(entry=>entry.name);
|
|
191
|
+
const products=shardProducts(root,folders).map(({slug,folder})=>productSectionEntries(resolve(productsRoot,slug),slug,folder));
|
|
192
|
+
const table=readFileSync(resolve(root,'project/archive/reviews/2026-10-24-host-audit-inventory.md'),'utf8');
|
|
193
|
+
const historic=execFileSync('git',['show',`${HOST_PIN}:docs/HOST-BAR.md`],{cwd:root,encoding:'utf8'});
|
|
194
|
+
const groups=hostGroupBindings(table,historic),files=['src/engine','src/game'].flatMap(folder=>tree(resolve(root,folder)))
|
|
195
|
+
.filter(path=>path.endsWith('.ts')&&!path.endsWith('.d.ts')&&!path.endsWith('.test.ts')).map(path=>({path:relative(root,path).replaceAll('\\','/'),source:readFileSync(path,'utf8')}));
|
|
196
|
+
return sectionInventory(products,namedFormatJsonSchemas(),platformSchemaBindings(readFileSync(formatSource(root,'platformDataSections.ts'),'utf8')),OUTPUT_SECTIONS,sectionReaders(files,groups));
|
|
197
|
+
}
|
|
198
|
+
export function renderSectionInventory(report:Inventory):string{
|
|
199
|
+
const cell=(value:unknown):string=>String(value).replaceAll('|',String.raw`\|`).replaceAll('\n',' ');
|
|
200
|
+
return ['# Emitted section inventory','',report.basis,'',
|
|
201
|
+
'| Product | Custom | Registered streamed files |','|---|---:|---:|',
|
|
202
|
+
...report.products.map(product=>{const rows=report.rows.filter(row=>row.product===product.product);return `| ${cell(product.product)} | ${rows.filter(row=>row.kind==='named-json').length} | ${rows.filter(row=>row.kind==='platform-file').length} |`;}),'',
|
|
203
|
+
'| Product | Source project | Name | Kind | Bytes | Defining schema | Schema emitters | Reading hosts (H-group) | Emitted routes |',
|
|
204
|
+
'|---|---|---|---|---:|---|---|---|---|',...report.rows.map(row=>`| ${cell(row.product)} | ${cell(row.shard)} | ${cell(row.name)} | ${row.kind} | ${row.bytes} | ${cell(row.schemaBindings.join(', ')||'unattributed')} | ${cell(row.schemaUsers.join(', '))} | ${cell(row.readers.length===0?(row.registeredReader??'unresolved'):row.readers.map(reader=>`${reader.path}:${reader.line}${reader.groups.length===0?' (unmapped)':` (${reader.groups.join(', ')})`}`).join('; '))} | ${cell(row.routes.join(', ')||'direct reader')} |`),''].join('\n');
|
|
205
|
+
}
|
|
206
|
+
if(process.argv[1]!==undefined&&import.meta.url===pathToFileURL(resolve(process.argv[1])).href){
|
|
207
|
+
const args=process.argv.slice(2);if(args.some(arg=>arg!=='--json'))throw new Error('Usage: node scripts/section-inventory.ts [--json]');
|
|
208
|
+
const report=await readSectionInventory();console.info(args.includes('--json')?JSON.stringify(report,null,2):renderSectionInventory(report));
|
|
209
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Ring 3 overrides the entire dependency graph, not only the direct edge.
|
|
2
|
+
// An empty input keeps the checked-in frozen install. Candidates are exact
|
|
3
|
+
// commit hashes, never executable shell fragments or moving branches.
|
|
4
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
5
|
+
const choices = [['engine', process.env.CANDIDATE_ENGINE]];
|
|
6
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
|
|
7
|
+
for (const [name, sha] of choices) {
|
|
8
|
+
if (!sha) continue;
|
|
9
|
+
if (!/^[a-f0-9]{40}$/u.test(sha)) throw new Error(`${name}: candidate must be a full commit hash`);
|
|
10
|
+
const spec = `github:project-wildshard/${name}#${sha}`;
|
|
11
|
+
pkg.dependencies[`@wildshard/${name}`] = spec;
|
|
12
|
+
pkg.pnpm ??= {}; pkg.pnpm.overrides ??= {};
|
|
13
|
+
pkg.pnpm.overrides[`@wildshard/${name}`] = spec;
|
|
14
|
+
}
|
|
15
|
+
if (choices.some(([, value]) => value)) writeFileSync('package.json', `${JSON.stringify(pkg, null, 2)}\n`);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Six processes at most; a hard failure aborts owned children and drains active tasks. */
|
|
2
|
+
export function runShardBuildPool<T>(items: readonly T[], work: (item: T, signal: AbortSignal) => Promise<void>, prepare?: () => Promise<unknown>): Promise<void>;
|
|
3
|
+
/** Run one CLI product build with the parent's environment and lease. */
|
|
4
|
+
export function runShardBuild(args: string[], signal: AbortSignal, cacheReport?: (report: unknown) => void): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Bound CPU-heavy author builds by process; the parent owns cache publication and catalogue admission.
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { buildCacheReportReader } from '@wildshard/engine/scripts/build-cache-report.mjs';
|
|
5
|
+
import { resolve as resolvePath } from 'node:path';
|
|
6
|
+
import {shardfileCacheRoot} from '@wildshard/engine/scripts/shardfile-cache.mjs';
|
|
7
|
+
|
|
8
|
+
/** @template T @param {readonly T[]} items @param {(item:T,signal:AbortSignal)=>Promise<void>} work
|
|
9
|
+
* @param {()=>Promise<unknown>} [prepare] */
|
|
10
|
+
export async function runShardBuildPool(items, work, prepare) {
|
|
11
|
+
if (prepare !== undefined) await prepare();
|
|
12
|
+
const controller = new AbortController();
|
|
13
|
+
let next = 0;
|
|
14
|
+
/** @type {{failed:boolean,failure:unknown}} */
|
|
15
|
+
const state = { failed: false, failure: undefined };
|
|
16
|
+
await Promise.all(Array.from({ length: Math.min(6, items.length) }, async () => {
|
|
17
|
+
while (!controller.signal.aborted && next < items.length) {
|
|
18
|
+
const item = items[next++];
|
|
19
|
+
try { await work(item, controller.signal); }
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (!state.failed) { state.failed = true; state.failure = error; controller.abort(); }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
if (state.failed) throw state.failure;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** One product per child. Keep the build lease, cache and input-recorder environment.
|
|
29
|
+
* @param {string[]} args @param {AbortSignal} signal @param {(report:unknown)=>void} [cacheReport] @returns {Promise<void>} */
|
|
30
|
+
export function runShardBuild(args, signal, cacheReport) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const child = spawn(process.execPath, ['--import', fileURLToPath(import.meta.resolve('@wildshard/engine/scripts/shardfile-inputs.mjs')), resolvePath(import.meta.dirname, 'wildshard.mjs'), ...args], {
|
|
33
|
+
cwd: process.cwd(), env: {...process.env,WILDSHARD_WORLD_TEXTURE_CACHE:process.env.WILDSHARD_WORLD_TEXTURE_CACHE??resolvePath(shardfileCacheRoot(),'.world-textures-v1')}, signal, stdio: ['ignore', 'inherit', 'pipe'],
|
|
34
|
+
});
|
|
35
|
+
// Forward all diagnostics, retaining only a bounded tail for the pool's error.
|
|
36
|
+
let stderrTail = '';
|
|
37
|
+
const reports=cacheReport===undefined?undefined:buildCacheReportReader(cacheReport,text=>{process.stderr.write(text);},true);
|
|
38
|
+
child.stderr.setEncoding('utf8');
|
|
39
|
+
child.stderr.on('data', (/** @type {string} */ chunk) => {
|
|
40
|
+
if(reports===undefined)process.stderr.write(chunk);else reports.write(chunk);
|
|
41
|
+
stderrTail = (stderrTail + chunk).slice(-8192);
|
|
42
|
+
});
|
|
43
|
+
/** @type {Error|undefined} */
|
|
44
|
+
let failure;
|
|
45
|
+
child.on('error', error => { failure = error; });
|
|
46
|
+
child.on('close', (code, killed) => {
|
|
47
|
+
reports?.end();
|
|
48
|
+
if(failure!==undefined)reject(failure);
|
|
49
|
+
else if(code===0)resolve();
|
|
50
|
+
else reject(new Error(`Shard build exited ${String(code ?? killed)} (${args[1] ?? 'unknown product'})\n${stderrTail.trim() || 'Child stderr was empty'}`));
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"since": "2026-10-16T12:00:00Z",
|
|
3
|
+
"revision": "319dbea5bb996e5e0bbe15257532b405b5988385",
|
|
4
|
+
"basis": "source",
|
|
5
|
+
"customLines": {
|
|
6
|
+
"_template": 725,
|
|
7
|
+
"blender-template": 123,
|
|
8
|
+
"driftwood-isle": 13201,
|
|
9
|
+
"far-reach": 6075,
|
|
10
|
+
"ink-cel-valley": 1917,
|
|
11
|
+
"nalati-grasslands": 30045,
|
|
12
|
+
"nine-dragon-stack": 16258,
|
|
13
|
+
"pastel-plain": 736,
|
|
14
|
+
"pine-hollow": 18174,
|
|
15
|
+
"sunscar-dunes": 1794
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type {OutputReader} from '@wildshard/engine/scripts/shard-platform-output.mjs';
|
|
2
|
+
|
|
3
|
+
export type Verdict='pass'|'fail'|'unknown';
|
|
4
|
+
export interface Criterion {verdict:Verdict;evidence:string}
|
|
5
|
+
export interface GridReady {verdict:Verdict;criteria:Record<string,Criterion>;frameFloor?:Criterion;binding?:{indexHash:string;validationHash:string;sourceHash:string;validator:string;revision:string|null}}
|
|
6
|
+
export interface M3Progress {basis:'source'|'output';customLines:number;legacyLines:number;target:number;mustGo:number;cut:number;fraction:number}
|
|
7
|
+
export const MILESTONE_SHARDS:string[];
|
|
8
|
+
export const M2_GRID_SHARDS:string[];
|
|
9
|
+
export const M2_GRID_PLOTS:number;
|
|
10
|
+
export const M2_GRID_PLOT_CELLS:{instance:string;slug:string}[];
|
|
11
|
+
export function readinessVerdict(criteria:Record<string,Criterion>):Verdict;
|
|
12
|
+
export function unknownGridReady(evidence?:string):GridReady;
|
|
13
|
+
export function gridReady(root:string,slug:string,products:string,options?:{revision?:string|null;receipts?:readonly string[];reader?:OutputReader}):GridReady;
|
|
14
|
+
export function m3Progress(slug:string,input:{basis:'source'|'output';customLines:number;legacyLines:number|null}):M3Progress|null;
|
|
15
|
+
export function planProgress(rows:Record<string,{m3:M3Progress|null;gridReady:GridReady}|undefined>,plots?:Record<string,GridReady>):{m3:{fraction:number|null;cut:number;mustGo:number;shards:number};m2:{lower:number;upper:number;ready:number;unknown:number;total:number;shards:string[];plots:number;plotReadiness:{ready:number;fail:number;unknown:number;total:number};readiness:Record<string,GridReady>};frameFloor:{ready:number;fail:number;unknown:number;total:number};plan:{lower:number;upper:number}|null};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// G458: outcome progress and evidence-bound grid readiness, never task counts.
|
|
2
|
+
import { representativeProduct } from '@wildshard/engine/scripts/shard-outputs.mjs';
|
|
3
|
+
import {existsSync,readFileSync} from 'node:fs';
|
|
4
|
+
import {resolve} from 'node:path';
|
|
5
|
+
import {createHash} from 'node:crypto';
|
|
6
|
+
import {outputFormat,gridReadinessFormat} from '@wildshard/engine/scripts/shard-platform-format.mjs';
|
|
7
|
+
import {runtimeGridEvidence} from '@wildshard/engine/scripts/grid-runtime-evidence.mjs';
|
|
8
|
+
import catalogue from '@wildshard/engine/game/grid/singleplayer.json' with {type:'json'};
|
|
9
|
+
import plotOutputs from '../src/shards/open-plots/outputs.json' with {type:'json'};
|
|
10
|
+
import {formatSource} from '@wildshard/engine/scripts/format-package.mjs';
|
|
11
|
+
|
|
12
|
+
export const MILESTONE_SHARDS=['far-reach','sunscar-dunes','pine-hollow','driftwood-isle','nalati-grasslands','nine-dragon-stack'];
|
|
13
|
+
// M2 covers the complete authored grid, shared by public and Developer. M3
|
|
14
|
+
// retains its six frozen denominators. Plot products occupy cells separately.
|
|
15
|
+
/** @type {Map<string,{slug:string,instance:string}>} */
|
|
16
|
+
const gridCells=new Map();
|
|
17
|
+
for(const cell of catalogue.grid.cells)gridCells.set(cell.cell.join(','),cell);
|
|
18
|
+
const plotSlugs=new Set(plotOutputs.outputs.map(row=>row.slug));
|
|
19
|
+
export const M2_GRID_SHARDS=[...new Set([...gridCells.values()].filter(cell=>!plotSlugs.has(cell.slug)).map(cell=>cell.slug))].sort();
|
|
20
|
+
export const M2_GRID_PLOT_CELLS=[...gridCells.values()].filter(cell=>plotSlugs.has(cell.slug));
|
|
21
|
+
export const M2_GRID_PLOTS=M2_GRID_PLOT_CELLS.length;
|
|
22
|
+
const hash=bytes=>createHash('sha256').update(bytes).digest('hex');
|
|
23
|
+
/** @param {Record<string,{verdict:'pass'|'fail'|'unknown',evidence:string}>} criteria */
|
|
24
|
+
export function readinessVerdict(criteria) {
|
|
25
|
+
const values=Object.values(criteria);
|
|
26
|
+
return values.some(row=>row.verdict==='fail')?'fail':values.length>0&&values.every(row=>row.verdict==='pass')?'pass':'unknown';
|
|
27
|
+
}
|
|
28
|
+
export function unknownGridReady(evidence='No bound output validation evidence') {
|
|
29
|
+
/** @type {Record<string,import('./shard-milestones.mjs').Criterion>} */
|
|
30
|
+
const criteria=Object.fromEntries(['bakedTiles','edgeProfile','fourEntryways','memory','hudAccent','oneFrameLooks'].map(name=>[name,{verdict:'unknown',evidence}]));
|
|
31
|
+
return {verdict:readinessVerdict(criteria),criteria,frameFloor:{verdict:'unknown',evidence:'No qualified exact-SHA frame-floor receipt'}};
|
|
32
|
+
}
|
|
33
|
+
/** Only byte-bound emitted metadata and the writer's matching receipt supply
|
|
34
|
+
* evidence. Missing or stale artifacts stay unknown; source declarations and
|
|
35
|
+
* a successful standalone boot never stand in for grid readiness.
|
|
36
|
+
* @param {string} root @param {string} slug @param {string} products
|
|
37
|
+
* @param {{revision?:string|null,receipts?:readonly string[],reader?:import('@wildshard/engine/scripts/shard-platform-output.mjs').OutputReader}} options */
|
|
38
|
+
export function gridReady(root,slug,products,{revision=null,receipts=[],reader}={}) {
|
|
39
|
+
const {criteria,frameFloor:unmeasuredFloor}=unknownGridReady();
|
|
40
|
+
let frameFloor=unmeasuredFloor;
|
|
41
|
+
/** @type {import('./shard-milestones.mjs').GridReady['binding']} */
|
|
42
|
+
let binding;
|
|
43
|
+
const result=()=>({verdict:readinessVerdict(criteria),criteria,frameFloor,...(binding===undefined?{}:{binding})});
|
|
44
|
+
const directory=resolve(products,representativeProduct(root,slug)),indexPath=resolve(directory,'shard.json'),receiptPath=resolve(directory,'validation.json');
|
|
45
|
+
if(!existsSync(indexPath)||!existsSync(receiptPath))return result();
|
|
46
|
+
try {
|
|
47
|
+
const bytes=readFileSync(indexPath),index=outputFormat.parseOutputIndex(JSON.parse(bytes.toString('utf8'))),receipt=JSON.parse(readFileSync(receiptPath,'utf8'));
|
|
48
|
+
if(receipt.indexHash!==hash(bytes)||receipt.revision!==index.build.validator||receipt.sourceHash!==index.build.sourceHash)return result();
|
|
49
|
+
binding={indexHash:hash(bytes),validationHash:hash(readFileSync(receiptPath)),sourceHash:index.build.sourceHash,validator:index.build.validator,revision};
|
|
50
|
+
const sections=new Map();
|
|
51
|
+
for(const row of index.sections) {
|
|
52
|
+
const payload=readFileSync(resolve(directory,row.path));
|
|
53
|
+
if(payload.length!==row.bytes||hash(payload)!==row.hash)return result();
|
|
54
|
+
sections.set(row.name,JSON.parse(payload.toString('utf8')));
|
|
55
|
+
}
|
|
56
|
+
if(receipt.gridReady===undefined)return result();
|
|
57
|
+
// The writer emits this only after actual asset admission, including the full
|
|
58
|
+
// 8x15m terrain/mesh/prop/collider/water checks, not just the metadata schema.
|
|
59
|
+
const source=reader===undefined?outputFormat.assembleOutputShardfile(index,sections):reader.source(slug);
|
|
60
|
+
const structural=gridReadinessFormat.parseGridStructuralEvidence(receipt.gridReady);
|
|
61
|
+
if(JSON.stringify(structural)!==JSON.stringify(gridReadinessFormat.structuralGridEvidence(source)))throw new Error('Grid evidence differs from emitted sections');
|
|
62
|
+
for(const [name,criterion] of Object.entries(structural.criteria))criteria[name]={...criterion,
|
|
63
|
+
evidence:`index sha256:${hash(bytes)}, validation sha256:${hash(readFileSync(receiptPath))}: ${criterion.evidence}`};
|
|
64
|
+
const caps=JSON.parse(readFileSync(formatSource(root,'memoryGates.json'),'utf8'));
|
|
65
|
+
criteria.memory={verdict:'unknown',evidence:'No latched memory pass or qualified current-source reading; declared costs alone are not readings'};
|
|
66
|
+
criteria.oneFrameLooks={verdict:'unknown',evidence:'No latched look/travel pass or qualified current-source phone grid witness'};
|
|
67
|
+
if([caps.explorerMB,caps.loadingMB].every(value=>typeof value==='number'&&Number.isFinite(value)&&value>0)) {
|
|
68
|
+
const {frameFloor:measuredFloor,...readiness}=runtimeGridEvidence(root,slug,revision,receipts,caps);
|
|
69
|
+
frameFloor=measuredFloor??unmeasuredFloor;Object.assign(criteria,readiness);
|
|
70
|
+
}
|
|
71
|
+
} catch(error) {
|
|
72
|
+
criteria.validation={verdict:'fail',evidence:`Output validation refused: ${error instanceof Error?error.message:String(error)}`};
|
|
73
|
+
}
|
|
74
|
+
return result();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @param {string} _slug @param {{basis:'source'|'output',customLines:number,legacyLines:number|null}} input */
|
|
78
|
+
export function m3Progress(_slug,input) {
|
|
79
|
+
if(input.legacyLines===null)return null;
|
|
80
|
+
const target=0;
|
|
81
|
+
const mustGo=input.legacyLines,cut=Math.max(0,input.legacyLines-input.customLines);
|
|
82
|
+
return {...input,target,mustGo,cut,fraction:cut/mustGo};
|
|
83
|
+
}
|
|
84
|
+
/** @param {Record<string,{m3:ReturnType<typeof m3Progress>,gridReady:import('./shard-milestones.mjs').GridReady}|undefined>} rows
|
|
85
|
+
* @param {Record<string,import('./shard-milestones.mjs').GridReady>} [plots] */
|
|
86
|
+
export function planProgress(rows,plots={}) {
|
|
87
|
+
const ports=MILESTONE_SHARDS.map(slug=>rows[slug]),measured=ports.flatMap(row=>row?.m3??[]);
|
|
88
|
+
const mustGo=measured.reduce((sum,row)=>sum+row.mustGo,0),cut=measured.reduce((sum,row)=>sum+row.cut,0);
|
|
89
|
+
const m3=measured.length===6&&mustGo>0?cut/mustGo:null;
|
|
90
|
+
const grid=M2_GRID_SHARDS.map(slug=>rows[slug]),total=grid.length;
|
|
91
|
+
const ready=grid.filter(row=>row?.gridReady.verdict==='pass').length;
|
|
92
|
+
const unknown=grid.filter(row=>row===undefined||row.gridReady.verdict==='unknown').length;
|
|
93
|
+
const plotReady=M2_GRID_PLOT_CELLS.filter(cell=>plots[cell.slug]?.verdict==='pass').length;
|
|
94
|
+
const plotFail=M2_GRID_PLOT_CELLS.filter(cell=>plots[cell.slug]?.verdict==='fail').length;
|
|
95
|
+
const readiness=Object.fromEntries([...M2_GRID_SHARDS.flatMap(slug=>rows[slug]===undefined?[]:[[slug,rows[slug].gridReady]]),...Object.entries(plots)]);
|
|
96
|
+
const m2={lower:ready/total,upper:(ready+unknown)/total,ready,unknown,total,shards:[...M2_GRID_SHARDS],plots:M2_GRID_PLOTS,
|
|
97
|
+
plotReadiness:{ready:plotReady,fail:plotFail,unknown:M2_GRID_PLOTS-plotReady-plotFail,total:M2_GRID_PLOTS},readiness};
|
|
98
|
+
const floorReady=grid.filter(row=>row?.gridReady.frameFloor?.verdict==='pass').length;
|
|
99
|
+
const floorFail=grid.filter(row=>row?.gridReady.frameFloor?.verdict==='fail').length;
|
|
100
|
+
const frameFloor={ready:floorReady,fail:floorFail,unknown:total-floorReady-floorFail,total};
|
|
101
|
+
// G567: original custom lines are the denominator; report uncapped progress.
|
|
102
|
+
const m3Share=m3;
|
|
103
|
+
return {m3:{fraction:m3,cut,mustGo,shards:measured.length},m2,frameFloor,
|
|
104
|
+
plan:m3Share===null?null:{lower:.6*m3Share+.4*m2.lower,upper:.6*m3Share+.4*m2.upper}};
|
|
105
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type {RuntimeClosure} from '@wildshard/engine/scripts/shard-runtime-closure.mjs';
|
|
2
|
+
import type {ShardLines,PortHeadline} from '@wildshard/engine/scripts/shard-platform.mjs';
|
|
3
|
+
import type {OutputContent} from '@wildshard/engine/scripts/shard-output-content.mjs';
|
|
4
|
+
import type {M3Progress,GridReady,planProgress} from './shard-milestones.mjs';
|
|
5
|
+
import type {productScriptMetrics} from '@wildshard/engine/scripts/script-scenario-metrics.mjs';
|
|
6
|
+
import type {netLineReport,sourceLineDelta} from '@wildshard/engine/scripts/shard-net-lines.mjs';
|
|
7
|
+
|
|
8
|
+
export type OutputReportRow=RuntimeClosure&{customPercent:number|null;port:PortHeadline|null;content?:OutputContent;m3:M3Progress|null;gridReady:GridReady;scriptMetrics:ReturnType<typeof productScriptMetrics>;linesRemovedSince12Z:ReturnType<typeof sourceLineDelta>['shards'][string]|null;legacyLines?:number|null;measurementError?:string;productFailure?:string}&Partial<ShardLines>;
|
|
9
|
+
export function outputReport(root:string,options?:{build?:boolean;sourceProgress?:boolean;products?:string;revision?:string|null;receipts?:readonly string[];scriptReceipts?:readonly string[];reportOnly?:boolean;buildProduct?:(args:string[])=>Promise<void>}):Promise<{rows:Record<string,OutputReportRow>;measures:Record<string,ShardLines>;inventory:Record<string,ShardLines>;netLines:ReturnType<typeof netLineReport>;dailyLines:ReturnType<typeof sourceLineDelta>;progress:ReturnType<typeof planProgress>;sectionFailures:string[];productFailures:Record<string,string>;measurementError:string|null}>;
|