@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,192 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
import { once } from 'node:events'
|
|
3
|
+
import { readFile } from 'node:fs/promises'
|
|
4
|
+
import path from 'node:path'
|
|
5
|
+
import { text as readAll } from 'node:stream/consumers'
|
|
6
|
+
|
|
7
|
+
import { object, optional, safeParse, string } from 'valibot'
|
|
8
|
+
|
|
9
|
+
import { readVersion } from '../version.ts'
|
|
10
|
+
|
|
11
|
+
// What every upload names (API-CLOUDFLARE AC16, J275 V1): the shard version
|
|
12
|
+
// and the commit of the shard project it was built from. `--version`
|
|
13
|
+
// defaults to the project's package.json version and `--commit` to its git
|
|
14
|
+
// HEAD, and a HEAD with uncommitted changes to tracked files is refused, as
|
|
15
|
+
// it does not describe the bytes. Untracked files (the packed tarball, build
|
|
16
|
+
// output) are not dirt, as in `git describe --dirty`. The checks match the
|
|
17
|
+
// API's, so a bad value fails here, before any bytes move.
|
|
18
|
+
//
|
|
19
|
+
// J306 (SHARD-AUTHORING UP3) adds the versions the shard was built with:
|
|
20
|
+
// sharddev's own, and engine's and shard-format's from the package.json
|
|
21
|
+
// each name resolves to from the shard project, the nearest
|
|
22
|
+
// node_modules/<name> at or above it. shard-format is
|
|
23
|
+
// `@wildshard/shard-format`, or the `@wildshard/format` alias until the J308
|
|
24
|
+
// pins land. A shard with neither installed falls back to the copy this
|
|
25
|
+
// sharddev carries, which is what its build ran with.
|
|
26
|
+
|
|
27
|
+
const VERSION = /^(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})\.(?:0|[1-9]\d{0,8})$/u
|
|
28
|
+
const COMMIT = /^[\da-f]{40}$/u
|
|
29
|
+
const PACKAGE_JSON = 'package.json'
|
|
30
|
+
const GIT_OK = 0
|
|
31
|
+
|
|
32
|
+
const PackageJsonSchema = object({ version: optional(string()) })
|
|
33
|
+
|
|
34
|
+
const ENGINE = ['@wildshard/engine']
|
|
35
|
+
const SHARD_FORMAT = ['@wildshard/shard-format', '@wildshard/format']
|
|
36
|
+
// This sharddev's own install: its node_modules resolve from here up.
|
|
37
|
+
const SHARDDEV_DIR = import.meta.dirname
|
|
38
|
+
|
|
39
|
+
interface ProvenanceRequest {
|
|
40
|
+
/** Where `wildshard upload` runs: inside the shard project. */
|
|
41
|
+
readonly cwd: string
|
|
42
|
+
/** `--version`, if passed. */
|
|
43
|
+
readonly version?: string | undefined
|
|
44
|
+
/** `--commit`, if passed. */
|
|
45
|
+
readonly commit?: string | undefined
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface Provenance {
|
|
49
|
+
readonly version: string
|
|
50
|
+
readonly commit: string
|
|
51
|
+
/** The sharddev that uploads (J306). */
|
|
52
|
+
readonly sharddev: string
|
|
53
|
+
/** The engine the shard resolves (J306). */
|
|
54
|
+
readonly engine: string
|
|
55
|
+
/** The shard-format the shard resolves (J306). */
|
|
56
|
+
readonly shardFormat: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function readIfThere(file: string): Promise<string | undefined> {
|
|
60
|
+
try {
|
|
61
|
+
return await readFile(file, 'utf8')
|
|
62
|
+
} catch (error: unknown) {
|
|
63
|
+
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
64
|
+
return undefined
|
|
65
|
+
}
|
|
66
|
+
throw error
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The nearest package.json at or above `dir`, and its text. */
|
|
71
|
+
async function nearestPackage(
|
|
72
|
+
dir: string,
|
|
73
|
+
): Promise<Readonly<{ file: string; text: string }> | undefined> {
|
|
74
|
+
const file = path.join(dir, PACKAGE_JSON)
|
|
75
|
+
const text = await readIfThere(file)
|
|
76
|
+
if (text !== undefined) {
|
|
77
|
+
return { file, text }
|
|
78
|
+
}
|
|
79
|
+
const parent = path.dirname(dir)
|
|
80
|
+
return parent === dir ? undefined : await nearestPackage(parent)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function projectVersion(cwd: string): Promise<string> {
|
|
84
|
+
const found = await nearestPackage(path.resolve(cwd))
|
|
85
|
+
if (found === undefined) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
`no ${PACKAGE_JSON} at or above ${cwd}; pass --version X.Y.Z`,
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
const parsed = safeParse(PackageJsonSchema, JSON.parse(found.text))
|
|
91
|
+
const version = parsed.success ? parsed.output.version : undefined
|
|
92
|
+
if (version === undefined) {
|
|
93
|
+
throw new Error(`no version in ${found.file}; pass --version X.Y.Z`)
|
|
94
|
+
}
|
|
95
|
+
return version
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function git(cwd: string, args: readonly string[]): Promise<string> {
|
|
99
|
+
const child = spawn('git', [...args], {
|
|
100
|
+
cwd,
|
|
101
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
102
|
+
})
|
|
103
|
+
const output = readAll(child.stdout)
|
|
104
|
+
try {
|
|
105
|
+
await once(child, 'close')
|
|
106
|
+
} catch {
|
|
107
|
+
// No git, or no such folder: the same advice.
|
|
108
|
+
}
|
|
109
|
+
if (child.exitCode !== GIT_OK) {
|
|
110
|
+
throw new Error(`${cwd} is not a git checkout; pass --commit <sha>`)
|
|
111
|
+
}
|
|
112
|
+
const out = await output
|
|
113
|
+
return out.trim()
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function headCommit(cwd: string): Promise<string> {
|
|
117
|
+
const head = await git(cwd, ['rev-parse', 'HEAD'])
|
|
118
|
+
const dirty = await git(cwd, [
|
|
119
|
+
'status',
|
|
120
|
+
'--porcelain',
|
|
121
|
+
'--untracked-files=no',
|
|
122
|
+
])
|
|
123
|
+
if (dirty !== '') {
|
|
124
|
+
throw new Error(
|
|
125
|
+
`the shard source has uncommitted changes (git status in ${cwd}); commit them, or pass --commit <sha> for bytes built elsewhere`,
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
return head
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The first of `names` installed at `dir` or above, and its version. */
|
|
132
|
+
async function installedAt(
|
|
133
|
+
dir: string,
|
|
134
|
+
names: readonly string[],
|
|
135
|
+
): Promise<Readonly<{ name: string; file: string; text: string }> | undefined> {
|
|
136
|
+
for (const name of names) {
|
|
137
|
+
const file = path.join(dir, 'node_modules', name, PACKAGE_JSON)
|
|
138
|
+
// oxlint-disable-next-line no-await-in-loop -- the first name found wins
|
|
139
|
+
const text = await readIfThere(file)
|
|
140
|
+
if (text !== undefined) {
|
|
141
|
+
return { name, file, text }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const parent = path.dirname(dir)
|
|
145
|
+
return parent === dir ? undefined : await installedAt(parent, names)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** The version of the first of `names` the shard, else sharddev, resolves. */
|
|
149
|
+
async function installedVersion(
|
|
150
|
+
cwd: string,
|
|
151
|
+
names: readonly string[],
|
|
152
|
+
): Promise<string> {
|
|
153
|
+
const found =
|
|
154
|
+
(await installedAt(path.resolve(cwd), names)) ??
|
|
155
|
+
(await installedAt(SHARDDEV_DIR, names))
|
|
156
|
+
if (found === undefined) {
|
|
157
|
+
throw new Error(
|
|
158
|
+
`${names.join(' or ')} is not installed at or above ${cwd}; run pnpm install in the shard repo`,
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
const parsed = safeParse(PackageJsonSchema, JSON.parse(found.text))
|
|
162
|
+
const version = parsed.success ? parsed.output.version : undefined
|
|
163
|
+
if (version === undefined || !VERSION.test(version)) {
|
|
164
|
+
throw new Error(
|
|
165
|
+
`${found.name} ${String(version)} (${found.file}) is not X.Y.Z`,
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
return version
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** The version and commit to send; throws what is missing or malformed. */
|
|
172
|
+
async function resolveProvenance(
|
|
173
|
+
request: ProvenanceRequest,
|
|
174
|
+
): Promise<Provenance> {
|
|
175
|
+
const version = request.version ?? (await projectVersion(request.cwd))
|
|
176
|
+
if (!VERSION.test(version)) {
|
|
177
|
+
throw new Error(`--version ${version} is not X.Y.Z`)
|
|
178
|
+
}
|
|
179
|
+
const commit = request.commit ?? (await headCommit(request.cwd))
|
|
180
|
+
if (!COMMIT.test(commit)) {
|
|
181
|
+
throw new Error(`--commit ${commit} is not a full 40-hex sha`)
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
version,
|
|
185
|
+
commit,
|
|
186
|
+
sharddev: await readVersion(),
|
|
187
|
+
engine: await installedVersion(request.cwd, ENGINE),
|
|
188
|
+
shardFormat: await installedVersion(request.cwd, SHARD_FORMAT),
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { type Provenance, type ProvenanceRequest, resolveProvenance }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createHash, createPrivateKey, sign } from 'node:crypto'
|
|
2
|
+
|
|
3
|
+
// The org creator key (J60, J69): Ed25519 over the raw 32 bytes of the
|
|
4
|
+
// tarball's SHA-256, never the compressed bytes. The private key is PKCS#8
|
|
5
|
+
// DER in base64, as `api-server keygen` prints it.
|
|
6
|
+
|
|
7
|
+
interface SignedShardfile {
|
|
8
|
+
/** Lowercase hex: the shardfile's identity. */
|
|
9
|
+
readonly hash: string
|
|
10
|
+
/** Base64: the `x-wildshard-signature` header. */
|
|
11
|
+
readonly signature: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function signTarball(
|
|
15
|
+
privateKey: string,
|
|
16
|
+
tarball: Readonly<Uint8Array>,
|
|
17
|
+
): SignedShardfile {
|
|
18
|
+
const key = createPrivateKey({
|
|
19
|
+
key: Buffer.from(privateKey, 'base64'),
|
|
20
|
+
format: 'der',
|
|
21
|
+
type: 'pkcs8',
|
|
22
|
+
})
|
|
23
|
+
const digest = createHash('sha256').update(tarball).digest()
|
|
24
|
+
return {
|
|
25
|
+
hash: digest.toString('hex'),
|
|
26
|
+
signature: sign(undefined, digest, key).toString('base64'),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { type SignedShardfile, signTarball }
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises'
|
|
2
|
+
|
|
3
|
+
import { DRAFT_SDK, draftMessage } from '../../sharddev/draft.ts'
|
|
4
|
+
import { assertAudio } from '../audio/audio.ts'
|
|
5
|
+
import {
|
|
6
|
+
commitUpload,
|
|
7
|
+
findCatalogued,
|
|
8
|
+
findStored,
|
|
9
|
+
putObject,
|
|
10
|
+
requestTicket,
|
|
11
|
+
} from './api.ts'
|
|
12
|
+
import { storedForm } from './compress.ts'
|
|
13
|
+
import { placementLines } from './placement.ts'
|
|
14
|
+
import { signTarball } from './signature.ts'
|
|
15
|
+
import { validateShardfile } from './validate.ts'
|
|
16
|
+
|
|
17
|
+
import type { ApiOptions, Channel } from './api.ts'
|
|
18
|
+
import type { StoredForm } from './compress.ts'
|
|
19
|
+
import type { Provenance } from './provenance.ts'
|
|
20
|
+
import type { SignedShardfile } from './signature.ts'
|
|
21
|
+
import type { CommitAnswer } from './wire.ts'
|
|
22
|
+
|
|
23
|
+
// `sharddev upload` (J60, J96): check the shardfile here, compress it here,
|
|
24
|
+
// sign the tarball, then ticket, PUT, commit. api-server only checks and
|
|
25
|
+
// stores what arrives. The commit carries the shard version and commit
|
|
26
|
+
// (API-CLOUDFLARE AC16, V1), and is sent for held bytes too, so the API
|
|
27
|
+
// answers which version holds them: a retry, or a 409 for another version.
|
|
28
|
+
// SHARD-AUTHORING UP3 adds the channel the upload is for (J301) and the
|
|
29
|
+
// versions it was built with (J306), and refuses a hero unchanged since the
|
|
30
|
+
// slug's newest catalogued version before any byte moves, as UP4's API will.
|
|
31
|
+
// An unprepared draft (sdk 0.2) refuses here too, before any request: the
|
|
32
|
+
// API answers it 422 at commit (J259), after the whole file was sent.
|
|
33
|
+
// SA32 sends `place: false` for `--no-place` and prints the API's grid
|
|
34
|
+
// answer and each moved channel's `/slug/<slug>` link (placement.ts).
|
|
35
|
+
|
|
36
|
+
const MS_PER_SECOND = 1000
|
|
37
|
+
const BYTES_PER_MB = 1_000_000
|
|
38
|
+
const PERCENT = 100
|
|
39
|
+
const ONE_DECIMAL = 1
|
|
40
|
+
const WHOLE = 1
|
|
41
|
+
|
|
42
|
+
interface UploadOptions extends ApiOptions, Provenance {
|
|
43
|
+
/** The shardfile tarball. */
|
|
44
|
+
readonly file: string
|
|
45
|
+
/** The channel the upload is for, by its wire name (J301). */
|
|
46
|
+
readonly channel: Channel
|
|
47
|
+
/** False for `--no-place` (SA32): the commit sends `place: false`. */
|
|
48
|
+
readonly place?: boolean
|
|
49
|
+
/** Base64 PKCS#8: WILDSHARD_CREATOR_PRIVATE_KEY. */
|
|
50
|
+
readonly privateKey: string
|
|
51
|
+
/** Brotli quality. */
|
|
52
|
+
readonly level: number
|
|
53
|
+
/** Receives one line per step. */
|
|
54
|
+
readonly report: (line: string) => void
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The upload that holds the bytes, as the API answered its commit. */
|
|
58
|
+
interface UploadOutcome {
|
|
59
|
+
/** The grid line and the links, printed after the commit line (SA32). */
|
|
60
|
+
readonly gridReport: readonly string[]
|
|
61
|
+
readonly hash: string
|
|
62
|
+
readonly shard: string
|
|
63
|
+
readonly revision: number
|
|
64
|
+
/** The bytes were stored already, so nothing new was recorded. */
|
|
65
|
+
readonly alreadyStored: boolean
|
|
66
|
+
/** The shard version the API holds these bytes as. */
|
|
67
|
+
readonly version: string
|
|
68
|
+
/** The API's format version. */
|
|
69
|
+
readonly formatVersion: string
|
|
70
|
+
/** The migrations the API ran. */
|
|
71
|
+
readonly migrations: readonly unknown[]
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
type Encoding = StoredForm['contentEncoding']
|
|
75
|
+
|
|
76
|
+
function mb(bytes: number): string {
|
|
77
|
+
return `${(bytes / BYTES_PER_MB).toFixed(ONE_DECIMAL)} MB`
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function secondsSince(start: number): string {
|
|
81
|
+
const elapsed = (performance.now() - start) / MS_PER_SECOND
|
|
82
|
+
return `${elapsed.toFixed(ONE_DECIMAL)} s`
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Listed bytes still ask for a ticket: the listing says they are held, and
|
|
87
|
+
* only the ticket says today's format takes them. A break refuses them here.
|
|
88
|
+
* True when they are held, so nothing needs compressing or sending.
|
|
89
|
+
*/
|
|
90
|
+
async function held(
|
|
91
|
+
options: UploadOptions,
|
|
92
|
+
signed: SignedShardfile,
|
|
93
|
+
tarballBytes: number,
|
|
94
|
+
): Promise<boolean> {
|
|
95
|
+
const listed = await findStored(options, signed.hash)
|
|
96
|
+
if (listed === undefined) {
|
|
97
|
+
return false
|
|
98
|
+
}
|
|
99
|
+
const ticket = await requestTicket(
|
|
100
|
+
options,
|
|
101
|
+
{ hash: signed.hash, storedBytes: tarballBytes },
|
|
102
|
+
signed.signature,
|
|
103
|
+
)
|
|
104
|
+
return ticket.stored
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
async function compressed(
|
|
108
|
+
options: UploadOptions,
|
|
109
|
+
tarball: Readonly<Uint8Array>,
|
|
110
|
+
): Promise<StoredForm> {
|
|
111
|
+
const start = performance.now()
|
|
112
|
+
const form = await storedForm(tarball, options.level)
|
|
113
|
+
const saved = PERCENT * (WHOLE - form.body.length / tarball.length)
|
|
114
|
+
options.report(
|
|
115
|
+
form.contentEncoding === undefined
|
|
116
|
+
? `sending the shard file uncompressed: Brotli would save under 1%`
|
|
117
|
+
: `brotli-${String(options.level)}: ${mb(tarball.length)} -> ${mb(form.body.length)}, ${saved.toFixed(ONE_DECIMAL)}% saved in ${secondsSince(start)}`,
|
|
118
|
+
)
|
|
119
|
+
return form
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Compress, ticket, and PUT unless the server has the bytes already. */
|
|
123
|
+
async function deliver(
|
|
124
|
+
options: UploadOptions,
|
|
125
|
+
tarball: Readonly<Uint8Array>,
|
|
126
|
+
signed: SignedShardfile,
|
|
127
|
+
): Promise<Encoding> {
|
|
128
|
+
const { body, contentEncoding } = await compressed(options, tarball)
|
|
129
|
+
const ticket = await requestTicket(
|
|
130
|
+
options,
|
|
131
|
+
{
|
|
132
|
+
hash: signed.hash,
|
|
133
|
+
storedBytes: body.length,
|
|
134
|
+
...(contentEncoding === undefined ? {} : { contentEncoding }),
|
|
135
|
+
},
|
|
136
|
+
signed.signature,
|
|
137
|
+
)
|
|
138
|
+
if (!ticket.stored) {
|
|
139
|
+
const start = performance.now()
|
|
140
|
+
await putObject(ticket, body)
|
|
141
|
+
options.report(`uploaded ${mb(body.length)} in ${secondsSince(start)}`)
|
|
142
|
+
}
|
|
143
|
+
return contentEncoding
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** UP2's echo of the channel and the versions: the fields the API sent. */
|
|
147
|
+
function echoOf(answer: CommitAnswer): string {
|
|
148
|
+
const { channel, sharddev, engine, shardFormat } = answer
|
|
149
|
+
const fields = { channel, sharddev, engine, shardFormat }
|
|
150
|
+
return Object.entries(fields)
|
|
151
|
+
.map(
|
|
152
|
+
([name, value]: readonly [string, string | null | undefined]): string =>
|
|
153
|
+
typeof value === 'string' ? `, ${name} ${value}` : '',
|
|
154
|
+
)
|
|
155
|
+
.join('')
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** The commit, always: the API names the version that holds the bytes (V1). */
|
|
159
|
+
async function commit(
|
|
160
|
+
options: UploadOptions,
|
|
161
|
+
signed: SignedShardfile,
|
|
162
|
+
contentEncoding: Encoding,
|
|
163
|
+
): Promise<UploadOutcome> {
|
|
164
|
+
const { channel, sharddev, engine, shardFormat } = options
|
|
165
|
+
const place = options.place !== false
|
|
166
|
+
const answer = await commitUpload(options, signed, {
|
|
167
|
+
place,
|
|
168
|
+
contentEncoding,
|
|
169
|
+
version: options.version,
|
|
170
|
+
commit: options.commit,
|
|
171
|
+
channel,
|
|
172
|
+
sharddev,
|
|
173
|
+
engine,
|
|
174
|
+
shardFormat,
|
|
175
|
+
})
|
|
176
|
+
const { hash, shard, revision, signedBy, created, staged, notified } = answer
|
|
177
|
+
const { version, formatVersion, migrations } = answer
|
|
178
|
+
options.report(
|
|
179
|
+
`signed by ${signedBy}, created: ${String(created)}, staged: ${String(staged)}, notified: ${String(notified)}`,
|
|
180
|
+
)
|
|
181
|
+
options.report(
|
|
182
|
+
`sent: channel ${channel}, sharddev ${sharddev}, engine ${engine}, shardFormat ${shardFormat}`,
|
|
183
|
+
)
|
|
184
|
+
options.report(
|
|
185
|
+
`api: version ${version}, formatVersion ${formatVersion}, migrations ${JSON.stringify(migrations)}${echoOf(answer)}`,
|
|
186
|
+
)
|
|
187
|
+
return {
|
|
188
|
+
gridReport: placementLines(answer, { channel, place }),
|
|
189
|
+
hash,
|
|
190
|
+
shard,
|
|
191
|
+
revision,
|
|
192
|
+
alreadyStored: !created,
|
|
193
|
+
version,
|
|
194
|
+
formatVersion,
|
|
195
|
+
migrations,
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** What the hero pre-check needs from the validated shardfile. */
|
|
200
|
+
interface Validated {
|
|
201
|
+
readonly slug: string
|
|
202
|
+
/** The hero digest, when the shard has a card. */
|
|
203
|
+
readonly hero: string | undefined
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Format's check, then the draft check (J198) and AU5's audio rules: a draft
|
|
208
|
+
* or a red refuses before any byte is sent.
|
|
209
|
+
*/
|
|
210
|
+
async function validated(
|
|
211
|
+
options: Readonly<UploadOptions>,
|
|
212
|
+
tarball: Readonly<Uint8Array>,
|
|
213
|
+
): Promise<Validated> {
|
|
214
|
+
const { slug, name, audio, heroHash, sdk } = await validateShardfile(tarball)
|
|
215
|
+
options.report(`valid: ${slug} (${name}), ${mb(tarball.length)}`)
|
|
216
|
+
if (sdk === DRAFT_SDK) {
|
|
217
|
+
throw new Error(draftMessage(slug))
|
|
218
|
+
}
|
|
219
|
+
await assertAudio(audio)
|
|
220
|
+
return { slug, hero: heroHash }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* UP3's hero pre-check (J306): a hero digest equal to the slug's newest
|
|
225
|
+
* catalogued one refuses here, before any byte moves. A first version, a
|
|
226
|
+
* catalogue with no digest (before UP4) and a retry of the catalogued
|
|
227
|
+
* version pass, as the API's own check does.
|
|
228
|
+
*/
|
|
229
|
+
async function checkHero(
|
|
230
|
+
options: UploadOptions,
|
|
231
|
+
shard: Validated,
|
|
232
|
+
): Promise<void> {
|
|
233
|
+
if (shard.hero === undefined) {
|
|
234
|
+
return
|
|
235
|
+
}
|
|
236
|
+
const newest = await findCatalogued(options, shard.slug)
|
|
237
|
+
if (newest?.heroHash === shard.hero && newest.version !== options.version) {
|
|
238
|
+
throw new Error(
|
|
239
|
+
`the hero is unchanged since ${[shard.slug, newest.version].filter(Boolean).join(' ')}: run wildshard hero, then build and upload again`,
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** The commit's line, then the grid line and the links (SA32). */
|
|
245
|
+
function reportCommitted(options: UploadOptions, outcome: UploadOutcome): void {
|
|
246
|
+
const verb = outcome.alreadyStored ? 'already stored' : 'committed'
|
|
247
|
+
options.report(
|
|
248
|
+
`${verb}: ${outcome.shard} ${outcome.version} catalogue number ${String(outcome.revision)} for ${options.channel} (${outcome.hash})`,
|
|
249
|
+
)
|
|
250
|
+
for (const line of outcome.gridReport) {
|
|
251
|
+
options.report(line)
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Check, compress, sign, upload and commit; the upload that holds the bytes. */
|
|
256
|
+
async function uploadShardfile(options: UploadOptions): Promise<UploadOutcome> {
|
|
257
|
+
const bytes = await readFile(options.file)
|
|
258
|
+
const tarball = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.length)
|
|
259
|
+
await checkHero(options, await validated(options, tarball))
|
|
260
|
+
const signed = signTarball(options.privateKey, tarball)
|
|
261
|
+
const encoding = (await held(options, signed, tarball.length))
|
|
262
|
+
? undefined
|
|
263
|
+
: await deliver(options, tarball, signed)
|
|
264
|
+
const outcome = await commit(options, signed, encoding)
|
|
265
|
+
reportCommitted(options, outcome)
|
|
266
|
+
return outcome
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export { type UploadOptions, type UploadOutcome, uploadShardfile }
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
|
|
3
|
+
import { installFormatHook } from '@wildshard/format/formatHook'
|
|
4
|
+
|
|
5
|
+
import { heroHashOf } from './hero.ts'
|
|
6
|
+
|
|
7
|
+
import type { HeroCard } from './hero.ts'
|
|
8
|
+
import type { AudioReport } from '@wildshard/format/audioRules'
|
|
9
|
+
import type { ProductFiles } from '@wildshard/format/productValidation'
|
|
10
|
+
|
|
11
|
+
// The same check api-server runs on commit, run first on the author's
|
|
12
|
+
// machine: a shardfile the server would refuse should not cost a Brotli
|
|
13
|
+
// pass and a 200 MB upload to find out.
|
|
14
|
+
|
|
15
|
+
/** What the upload reports about a valid shardfile. */
|
|
16
|
+
interface ValidShardfile {
|
|
17
|
+
readonly slug: string
|
|
18
|
+
readonly name: string
|
|
19
|
+
/** AUDIO AU5: the shard's own audio against format's rules, as of today. */
|
|
20
|
+
readonly audio: AudioReport
|
|
21
|
+
/** `presentation.card`'s three image blob hashes, when it has one (J306). */
|
|
22
|
+
readonly card: HeroCard | undefined
|
|
23
|
+
/** The hero digest api-server's UP4 takes (`hero.ts`); undefined with no card. */
|
|
24
|
+
readonly heroHash: string | undefined
|
|
25
|
+
/** `0.2`: a draft as `wildshard build` writes it; `0.3`: prepared (J198). */
|
|
26
|
+
readonly sdk: '0.2' | '0.3'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function sha256(bytes: Readonly<Uint8Array>): string {
|
|
30
|
+
return createHash('sha256').update(bytes).digest('hex')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The tarball's files as format's read-only view of a product folder. */
|
|
34
|
+
function productFiles(files: ReadonlyMap<string, Uint8Array>): ProductFiles {
|
|
35
|
+
return {
|
|
36
|
+
read: (path: string, maxBytes: number): Uint8Array => {
|
|
37
|
+
const bytes = files.get(path)
|
|
38
|
+
if (bytes === undefined) {
|
|
39
|
+
throw new Error(`no ${path} in the shard file`)
|
|
40
|
+
}
|
|
41
|
+
if (bytes.length > maxBytes) {
|
|
42
|
+
throw new Error(`${path} is larger than ${String(maxBytes)} bytes`)
|
|
43
|
+
}
|
|
44
|
+
return bytes
|
|
45
|
+
},
|
|
46
|
+
paths: (): Iterable<string> => files.keys(),
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The shard's identity; throws with format's reason when it is invalid. */
|
|
51
|
+
async function validateShardfile(
|
|
52
|
+
tarball: Readonly<Uint8Array>,
|
|
53
|
+
): Promise<ValidShardfile> {
|
|
54
|
+
installFormatHook()
|
|
55
|
+
const { prepareAssetDecoders } = await import('@wildshard/format/product')
|
|
56
|
+
const { validateShardfileProduct } =
|
|
57
|
+
await import('@wildshard/format/productValidation')
|
|
58
|
+
const { productAudioReport } = await import('@wildshard/format/productAudio')
|
|
59
|
+
const { readTar } = await import('@wildshard/format/tar')
|
|
60
|
+
await prepareAssetDecoders()
|
|
61
|
+
const product = productFiles(readTar(tarball))
|
|
62
|
+
const valid = validateShardfileProduct(product, { hash: sha256 })
|
|
63
|
+
const { identity, presentation } = valid.shard
|
|
64
|
+
return {
|
|
65
|
+
sdk: valid.index.sdk,
|
|
66
|
+
slug: identity.slug,
|
|
67
|
+
name: identity.name,
|
|
68
|
+
audio: productAudioReport(valid, new Date()),
|
|
69
|
+
card: presentation?.card,
|
|
70
|
+
heroHash: heroHashOf(valid.shard),
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { type ValidShardfile, validateShardfile }
|