@verticopolis/components 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ASSETS-LICENSE.md +49 -0
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/lib/audio/Audio.d.ts +110 -0
- package/lib/audio/Audio.js +199 -0
- package/lib/audio/Audio.js.map +1 -0
- package/lib/audio/ToneAudioEngine.d.ts +125 -0
- package/lib/audio/ToneAudioEngine.js +452 -0
- package/lib/audio/ToneAudioEngine.js.map +1 -0
- package/lib/audio/audioAssets.d.ts +25 -0
- package/lib/audio/audioAssets.js +28 -0
- package/lib/audio/audioAssets.js.map +1 -0
- package/lib/audio/awayWatch.d.ts +17 -0
- package/lib/audio/awayWatch.js +33 -0
- package/lib/audio/awayWatch.js.map +1 -0
- package/lib/audio/firstCueLatch.d.ts +18 -0
- package/lib/audio/firstCueLatch.js +34 -0
- package/lib/audio/firstCueLatch.js.map +1 -0
- package/lib/audio/lightEnvelope.d.ts +64 -0
- package/lib/audio/lightEnvelope.js +124 -0
- package/lib/audio/lightEnvelope.js.map +1 -0
- package/lib/audio/lightSynth.d.ts +125 -0
- package/lib/audio/lightSynth.js +203 -0
- package/lib/audio/lightSynth.js.map +1 -0
- package/lib/audio/toneContext.d.ts +30 -0
- package/lib/audio/toneContext.js +79 -0
- package/lib/audio/toneContext.js.map +1 -0
- package/lib/audio/toneCrowd.d.ts +62 -0
- package/lib/audio/toneCrowd.js +429 -0
- package/lib/audio/toneCrowd.js.map +1 -0
- package/lib/audio/toneCrowdData.d.ts +144 -0
- package/lib/audio/toneCrowdData.js +317 -0
- package/lib/audio/toneCrowdData.js.map +1 -0
- package/lib/audio/toneCrowdPrograms.d.ts +71 -0
- package/lib/audio/toneCrowdPrograms.js +273 -0
- package/lib/audio/toneCrowdPrograms.js.map +1 -0
- package/lib/audio/toneCrowdVoices.d.ts +49 -0
- package/lib/audio/toneCrowdVoices.js +212 -0
- package/lib/audio/toneCrowdVoices.js.map +1 -0
- package/lib/audio/toneMusicVoices.d.ts +11 -0
- package/lib/audio/toneMusicVoices.js +31 -0
- package/lib/audio/toneMusicVoices.js.map +1 -0
- package/lib/audio/tonePercussion.d.ts +45 -0
- package/lib/audio/tonePercussion.js +97 -0
- package/lib/audio/tonePercussion.js.map +1 -0
- package/lib/audio/toneRain.d.ts +23 -0
- package/lib/audio/toneRain.js +39 -0
- package/lib/audio/toneRain.js.map +1 -0
- package/lib/audio/toneRecordingMock.d.ts +89 -0
- package/lib/audio/toneRecordingMock.js +145 -0
- package/lib/audio/toneRecordingMock.js.map +1 -0
- package/lib/audio/toneRoomTone.d.ts +11 -0
- package/lib/audio/toneRoomTone.js +27 -0
- package/lib/audio/toneRoomTone.js.map +1 -0
- package/lib/audio/toneScenes.d.ts +57 -0
- package/lib/audio/toneScenes.js +208 -0
- package/lib/audio/toneScenes.js.map +1 -0
- package/lib/audio/toneTracks.d.ts +50 -0
- package/lib/audio/toneTracks.js +356 -0
- package/lib/audio/toneTracks.js.map +1 -0
- package/lib/audio/toneVoices.d.ts +57 -0
- package/lib/audio/toneVoices.js +208 -0
- package/lib/audio/toneVoices.js.map +1 -0
- package/lib/catalog/catalogTypes.d.ts +428 -0
- package/lib/catalog/catalogTypes.js +102 -0
- package/lib/catalog/catalogTypes.js.map +1 -0
- package/lib/catalog/skyBridgeTypes.d.ts +25 -0
- package/lib/catalog/skyBridgeTypes.js +7 -0
- package/lib/catalog/skyBridgeTypes.js.map +1 -0
- package/lib/catalog/starDutyTypes.d.ts +22 -0
- package/lib/catalog/starDutyTypes.js +7 -0
- package/lib/catalog/starDutyTypes.js.map +1 -0
- package/lib/catalog/towerCatalog.d.ts +32 -0
- package/lib/catalog/towerCatalog.js +44 -0
- package/lib/catalog/towerCatalog.js.map +1 -0
- package/lib/engineBinding/binding.d.ts +36 -0
- package/lib/engineBinding/binding.js +90 -0
- package/lib/engineBinding/binding.js.map +1 -0
- package/lib/engineBinding/catalog.d.ts +24 -0
- package/lib/engineBinding/catalog.js +267 -0
- package/lib/engineBinding/catalog.js.map +1 -0
- package/lib/engineBinding/engine.d.ts +866 -0
- package/lib/engineBinding/exportTiers.d.ts +289 -0
- package/lib/engineBinding/exportTiers.js +283 -0
- package/lib/engineBinding/exportTiers.js.map +1 -0
- package/lib/engineBinding/toolingMethods.d.ts +12 -0
- package/lib/engineBinding/toolingMethods.js +20 -0
- package/lib/engineBinding/toolingMethods.js.map +1 -0
- package/lib/events/gameplayCatalog.d.ts +57 -0
- package/lib/events/gameplayCatalog.js +214 -0
- package/lib/events/gameplayCatalog.js.map +1 -0
- package/lib/events/gameplayEventRules.d.ts +4 -0
- package/lib/events/gameplayEventRules.js +32 -0
- package/lib/events/gameplayEventRules.js.map +1 -0
- package/lib/events/gameplayEvents.d.ts +284 -0
- package/lib/presentation/clockText.d.ts +28 -0
- package/lib/presentation/clockText.js +38 -0
- package/lib/presentation/clockText.js.map +1 -0
- package/lib/presentation/facilityPresentation.d.ts +20 -0
- package/lib/presentation/facilityPresentation.js +164 -0
- package/lib/presentation/facilityPresentation.js.map +1 -0
- package/lib/presentation/statsCopy.d.ts +20 -0
- package/lib/presentation/statsCopy.js +37 -0
- package/lib/presentation/statsCopy.js.map +1 -0
- package/lib/presentation/traffic.d.ts +75 -0
- package/lib/presentation/traffic.js +79 -0
- package/lib/presentation/traffic.js.map +1 -0
- package/lib/presentation/viewKinds.d.ts +33 -0
- package/lib/presentation/viewKinds.js +88 -0
- package/lib/presentation/viewKinds.js.map +1 -0
- package/lib/presentation/viewWorld.d.ts +29 -0
- package/lib/presentation/viewWorld.js +31 -0
- package/lib/presentation/viewWorld.js.map +1 -0
- package/lib/render/atlas/archive.d.ts +78 -0
- package/lib/render/atlas/archive.js +427 -0
- package/lib/render/atlas/archive.js.map +1 -0
- package/lib/render/atlas/bake.d.ts +132 -0
- package/lib/render/atlas/bake.js +331 -0
- package/lib/render/atlas/bake.js.map +1 -0
- package/lib/render/atlas/bakeAdditions.d.ts +24 -0
- package/lib/render/atlas/bakeAdditions.js +46 -0
- package/lib/render/atlas/bakeAdditions.js.map +1 -0
- package/lib/render/atlas/browserEntry.d.ts +12 -0
- package/lib/render/atlas/browserEntry.js +222 -0
- package/lib/render/atlas/browserEntry.js.map +1 -0
- package/lib/render/atlas/catalog.d.ts +118 -0
- package/lib/render/atlas/catalog.js +253 -0
- package/lib/render/atlas/catalog.js.map +1 -0
- package/lib/render/atlas/catalogExtras.d.ts +45 -0
- package/lib/render/atlas/catalogExtras.js +217 -0
- package/lib/render/atlas/catalogExtras.js.map +1 -0
- package/lib/render/atlas/compose.d.ts +30 -0
- package/lib/render/atlas/compose.js +125 -0
- package/lib/render/atlas/compose.js.map +1 -0
- package/lib/render/atlas/cycles.d.ts +25 -0
- package/lib/render/atlas/cycles.js +41 -0
- package/lib/render/atlas/cycles.js.map +1 -0
- package/lib/render/atlas/lookup.d.ts +65 -0
- package/lib/render/atlas/lookup.js +83 -0
- package/lib/render/atlas/lookup.js.map +1 -0
- package/lib/render/atlas/pack.d.ts +23 -0
- package/lib/render/atlas/pack.js +50 -0
- package/lib/render/atlas/pack.js.map +1 -0
- package/lib/render/atlas/paint.d.ts +120 -0
- package/lib/render/atlas/paint.js +154 -0
- package/lib/render/atlas/paint.js.map +1 -0
- package/lib/render/atlas/pixels.d.ts +46 -0
- package/lib/render/atlas/pixels.js +158 -0
- package/lib/render/atlas/pixels.js.map +1 -0
- package/lib/render/atlas/png.d.ts +3 -0
- package/lib/render/atlas/png.js +102 -0
- package/lib/render/atlas/png.js.map +1 -0
- package/lib/render/atlas/raster.d.ts +34 -0
- package/lib/render/atlas/raster.js +114 -0
- package/lib/render/atlas/raster.js.map +1 -0
- package/lib/render/atlas/recyclingFill.d.ts +5 -0
- package/lib/render/atlas/recyclingFill.js +65 -0
- package/lib/render/atlas/recyclingFill.js.map +1 -0
- package/lib/render/atlas/samples.d.ts +24 -0
- package/lib/render/atlas/samples.js +75 -0
- package/lib/render/atlas/samples.js.map +1 -0
- package/lib/render/atlas/scenery.d.ts +230 -0
- package/lib/render/atlas/scenery.js +242 -0
- package/lib/render/atlas/scenery.js.map +1 -0
- package/lib/render/atlas/schema.d.ts +189 -0
- package/lib/render/atlas/schema.js +31 -0
- package/lib/render/atlas/schema.js.map +1 -0
- package/lib/render/atlas/shellMarks.d.ts +16 -0
- package/lib/render/atlas/shellMarks.js +72 -0
- package/lib/render/atlas/shellMarks.js.map +1 -0
- package/lib/render/atlas/store.d.ts +75 -0
- package/lib/render/atlas/store.js +127 -0
- package/lib/render/atlas/store.js.map +1 -0
- package/lib/render/atlas/verify.d.ts +43 -0
- package/lib/render/atlas/verify.js +87 -0
- package/lib/render/atlas/verify.js.map +1 -0
- package/lib/render/atlas/verifyExtras.d.ts +19 -0
- package/lib/render/atlas/verifyExtras.js +310 -0
- package/lib/render/atlas/verifyExtras.js.map +1 -0
- package/lib/render/cameraBounds.d.ts +71 -0
- package/lib/render/cameraBounds.js +107 -0
- package/lib/render/cameraBounds.js.map +1 -0
- package/lib/render/carIndicator.d.ts +41 -0
- package/lib/render/carIndicator.js +45 -0
- package/lib/render/carIndicator.js.map +1 -0
- package/lib/render/carMotion.d.ts +33 -0
- package/lib/render/carMotion.js +42 -0
- package/lib/render/carMotion.js.map +1 -0
- package/lib/render/catalogScale.d.ts +40 -0
- package/lib/render/catalogScale.js +33 -0
- package/lib/render/catalogScale.js.map +1 -0
- package/lib/render/climbPath.d.ts +59 -0
- package/lib/render/climbPath.js +115 -0
- package/lib/render/climbPath.js.map +1 -0
- package/lib/render/depthPlanes.d.ts +55 -0
- package/lib/render/depthPlanes.js +58 -0
- package/lib/render/depthPlanes.js.map +1 -0
- package/lib/render/excalibur/TowerEngine.d.ts +348 -0
- package/lib/render/excalibur/TowerEngine.js +415 -0
- package/lib/render/excalibur/TowerEngine.js.map +1 -0
- package/lib/render/excalibur/cabGraphics.d.ts +75 -0
- package/lib/render/excalibur/cabGraphics.js +108 -0
- package/lib/render/excalibur/cabGraphics.js.map +1 -0
- package/lib/render/excalibur/cabParts.d.ts +32 -0
- package/lib/render/excalibur/cabParts.js +79 -0
- package/lib/render/excalibur/cabParts.js.map +1 -0
- package/lib/render/excalibur/cabRiders.d.ts +72 -0
- package/lib/render/excalibur/cabRiders.js +176 -0
- package/lib/render/excalibur/cabRiders.js.map +1 -0
- package/lib/render/excalibur/crowdCull.d.ts +34 -0
- package/lib/render/excalibur/crowdCull.js +72 -0
- package/lib/render/excalibur/crowdCull.js.map +1 -0
- package/lib/render/excalibur/crowdFigure.d.ts +42 -0
- package/lib/render/excalibur/crowdFigure.js +99 -0
- package/lib/render/excalibur/crowdFigure.js.map +1 -0
- package/lib/render/excalibur/crowdLook.d.ts +137 -0
- package/lib/render/excalibur/crowdLook.js +186 -0
- package/lib/render/excalibur/crowdLook.js.map +1 -0
- package/lib/render/excalibur/frameHold.d.ts +23 -0
- package/lib/render/excalibur/frameHold.js +30 -0
- package/lib/render/excalibur/frameHold.js.map +1 -0
- package/lib/render/excalibur/guardPosition.d.ts +17 -0
- package/lib/render/excalibur/guardPosition.js +37 -0
- package/lib/render/excalibur/guardPosition.js.map +1 -0
- package/lib/render/excalibur/keyboardHost.d.ts +15 -0
- package/lib/render/excalibur/keyboardHost.js +22 -0
- package/lib/render/excalibur/keyboardHost.js.map +1 -0
- package/lib/render/excalibur/longPress.d.ts +16 -0
- package/lib/render/excalibur/longPress.js +71 -0
- package/lib/render/excalibur/longPress.js.map +1 -0
- package/lib/render/excalibur/peopleGfx.d.ts +16 -0
- package/lib/render/excalibur/peopleGfx.js +46 -0
- package/lib/render/excalibur/peopleGfx.js.map +1 -0
- package/lib/render/excalibur/peopleWindow.d.ts +35 -0
- package/lib/render/excalibur/peopleWindow.js +38 -0
- package/lib/render/excalibur/peopleWindow.js.map +1 -0
- package/lib/render/excalibur/personFocus.d.ts +36 -0
- package/lib/render/excalibur/personFocus.js +169 -0
- package/lib/render/excalibur/personFocus.js.map +1 -0
- package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
- package/lib/render/excalibur/pointerButtonGuard.js +86 -0
- package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
- package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
- package/lib/render/excalibur/pressLifecycle.js +66 -0
- package/lib/render/excalibur/pressLifecycle.js.map +1 -0
- package/lib/render/excalibur/rainShelter.d.ts +16 -0
- package/lib/render/excalibur/rainShelter.js +94 -0
- package/lib/render/excalibur/rainShelter.js.map +1 -0
- package/lib/render/excalibur/roomSignature.d.ts +30 -0
- package/lib/render/excalibur/roomSignature.js +49 -0
- package/lib/render/excalibur/roomSignature.js.map +1 -0
- package/lib/render/excalibur/sceneBake.d.ts +9 -0
- package/lib/render/excalibur/sceneBake.js +12 -0
- package/lib/render/excalibur/sceneBake.js.map +1 -0
- package/lib/render/excalibur/thiefSpan.d.ts +18 -0
- package/lib/render/excalibur/thiefSpan.js +51 -0
- package/lib/render/excalibur/thiefSpan.js.map +1 -0
- package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
- package/lib/render/excalibur/towerBridgeTiles.js +43 -0
- package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
- package/lib/render/excalibur/towerCrowd.d.ts +73 -0
- package/lib/render/excalibur/towerCrowd.js +464 -0
- package/lib/render/excalibur/towerCrowd.js.map +1 -0
- package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
- package/lib/render/excalibur/towerCrowdLayout.js +77 -0
- package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
- package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
- package/lib/render/excalibur/towerFireResponse.js +89 -0
- package/lib/render/excalibur/towerFireResponse.js.map +1 -0
- package/lib/render/excalibur/towerFrame.d.ts +8 -0
- package/lib/render/excalibur/towerFrame.js +57 -0
- package/lib/render/excalibur/towerFrame.js.map +1 -0
- package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
- package/lib/render/excalibur/towerGhostLabel.js +37 -0
- package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
- package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
- package/lib/render/excalibur/towerHallDoors.js +129 -0
- package/lib/render/excalibur/towerHallDoors.js.map +1 -0
- package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
- package/lib/render/excalibur/towerHaloRings.js +45 -0
- package/lib/render/excalibur/towerHaloRings.js.map +1 -0
- package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
- package/lib/render/excalibur/towerInputCamera.js +480 -0
- package/lib/render/excalibur/towerInputCamera.js.map +1 -0
- package/lib/render/excalibur/towerMetro.d.ts +31 -0
- package/lib/render/excalibur/towerMetro.js +115 -0
- package/lib/render/excalibur/towerMetro.js.map +1 -0
- package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
- package/lib/render/excalibur/towerNoiseReach.js +75 -0
- package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
- package/lib/render/excalibur/towerOverlay.d.ts +59 -0
- package/lib/render/excalibur/towerOverlay.js +453 -0
- package/lib/render/excalibur/towerOverlay.js.map +1 -0
- package/lib/render/excalibur/towerReconcile.d.ts +17 -0
- package/lib/render/excalibur/towerReconcile.js +404 -0
- package/lib/render/excalibur/towerReconcile.js.map +1 -0
- package/lib/render/excalibur/towerRegions.d.ts +61 -0
- package/lib/render/excalibur/towerRegions.js +193 -0
- package/lib/render/excalibur/towerRegions.js.map +1 -0
- package/lib/render/excalibur/towerScene.d.ts +66 -0
- package/lib/render/excalibur/towerScene.js +443 -0
- package/lib/render/excalibur/towerScene.js.map +1 -0
- package/lib/render/excalibur/towerScenery.d.ts +12 -0
- package/lib/render/excalibur/towerScenery.js +299 -0
- package/lib/render/excalibur/towerScenery.js.map +1 -0
- package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
- package/lib/render/excalibur/towerSceneryDraw.js +288 -0
- package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
- package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
- package/lib/render/excalibur/towerShaftNumbers.js +90 -0
- package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
- package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
- package/lib/render/excalibur/towerStructTiles.js +238 -0
- package/lib/render/excalibur/towerStructTiles.js.map +1 -0
- package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
- package/lib/render/excalibur/towerSyncSchedule.js +137 -0
- package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
- package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
- package/lib/render/excalibur/towerWalkerBuild.js +126 -0
- package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
- package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
- package/lib/render/excalibur/trafficSpotlight.js +64 -0
- package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
- package/lib/render/facadeGeometry.d.ts +50 -0
- package/lib/render/facadeGeometry.js +79 -0
- package/lib/render/facadeGeometry.js.map +1 -0
- package/lib/render/groundEntrances.d.ts +44 -0
- package/lib/render/groundEntrances.js +118 -0
- package/lib/render/groundEntrances.js.map +1 -0
- package/lib/render/lateNight.d.ts +14 -0
- package/lib/render/lateNight.js +18 -0
- package/lib/render/lateNight.js.map +1 -0
- package/lib/render/lobbyHalls.d.ts +44 -0
- package/lib/render/lobbyHalls.js +63 -0
- package/lib/render/lobbyHalls.js.map +1 -0
- package/lib/render/metroTrainSchedule.d.ts +20 -0
- package/lib/render/metroTrainSchedule.js +65 -0
- package/lib/render/metroTrainSchedule.js.map +1 -0
- package/lib/render/overviewMap/drawList.d.ts +67 -0
- package/lib/render/overviewMap/drawList.js +103 -0
- package/lib/render/overviewMap/drawList.js.map +1 -0
- package/lib/render/overviewMap/extent.d.ts +70 -0
- package/lib/render/overviewMap/extent.js +155 -0
- package/lib/render/overviewMap/extent.js.map +1 -0
- package/lib/render/overviewMap/floorSpans.d.ts +27 -0
- package/lib/render/overviewMap/floorSpans.js +32 -0
- package/lib/render/overviewMap/floorSpans.js.map +1 -0
- package/lib/render/overviewMap/gaps.d.ts +48 -0
- package/lib/render/overviewMap/gaps.js +148 -0
- package/lib/render/overviewMap/gaps.js.map +1 -0
- package/lib/render/overviewMap/geometry.d.ts +139 -0
- package/lib/render/overviewMap/geometry.js +245 -0
- package/lib/render/overviewMap/geometry.js.map +1 -0
- package/lib/render/overviewMap/heatView.d.ts +91 -0
- package/lib/render/overviewMap/heatView.js +143 -0
- package/lib/render/overviewMap/heatView.js.map +1 -0
- package/lib/render/overviewMap/hotelView.d.ts +82 -0
- package/lib/render/overviewMap/hotelView.js +136 -0
- package/lib/render/overviewMap/hotelView.js.map +1 -0
- package/lib/render/overviewMap/model.d.ts +97 -0
- package/lib/render/overviewMap/model.js +116 -0
- package/lib/render/overviewMap/model.js.map +1 -0
- package/lib/render/overviewMap/paint.d.ts +63 -0
- package/lib/render/overviewMap/paint.js +168 -0
- package/lib/render/overviewMap/paint.js.map +1 -0
- package/lib/render/overviewMap/style.d.ts +46 -0
- package/lib/render/overviewMap/style.js +117 -0
- package/lib/render/overviewMap/style.js.map +1 -0
- package/lib/render/overviewMap/tierView.d.ts +103 -0
- package/lib/render/overviewMap/tierView.js +209 -0
- package/lib/render/overviewMap/tierView.js.map +1 -0
- package/lib/render/overviewMap/viewMark.d.ts +69 -0
- package/lib/render/overviewMap/viewMark.js +103 -0
- package/lib/render/overviewMap/viewMark.js.map +1 -0
- package/lib/render/overviewMap/views.d.ts +24 -0
- package/lib/render/overviewMap/views.js +29 -0
- package/lib/render/overviewMap/views.js.map +1 -0
- package/lib/render/pinchTracker.d.ts +91 -0
- package/lib/render/pinchTracker.js +145 -0
- package/lib/render/pinchTracker.js.map +1 -0
- package/lib/render/pixelSprites/amusements.d.ts +32 -0
- package/lib/render/pixelSprites/amusements.js +243 -0
- package/lib/render/pixelSprites/amusements.js.map +1 -0
- package/lib/render/pixelSprites/artScale.d.ts +97 -0
- package/lib/render/pixelSprites/artScale.js +151 -0
- package/lib/render/pixelSprites/artScale.js.map +1 -0
- package/lib/render/pixelSprites/boutique.d.ts +30 -0
- package/lib/render/pixelSprites/boutique.js +244 -0
- package/lib/render/pixelSprites/boutique.js.map +1 -0
- package/lib/render/pixelSprites/clinic.d.ts +30 -0
- package/lib/render/pixelSprites/clinic.js +184 -0
- package/lib/render/pixelSprites/clinic.js.map +1 -0
- package/lib/render/pixelSprites/common.d.ts +185 -0
- package/lib/render/pixelSprites/common.js +449 -0
- package/lib/render/pixelSprites/common.js.map +1 -0
- package/lib/render/pixelSprites/daycare.d.ts +3 -0
- package/lib/render/pixelSprites/daycare.js +99 -0
- package/lib/render/pixelSprites/daycare.js.map +1 -0
- package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
- package/lib/render/pixelSprites/dollhouse.js +110 -0
- package/lib/render/pixelSprites/dollhouse.js.map +1 -0
- package/lib/render/pixelSprites/fitness.d.ts +30 -0
- package/lib/render/pixelSprites/fitness.js +176 -0
- package/lib/render/pixelSprites/fitness.js.map +1 -0
- package/lib/render/pixelSprites/food.d.ts +27 -0
- package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
- package/lib/render/pixelSprites/food.interiors.js +516 -0
- package/lib/render/pixelSprites/food.interiors.js.map +1 -0
- package/lib/render/pixelSprites/food.js +36 -0
- package/lib/render/pixelSprites/food.js.map +1 -0
- package/lib/render/pixelSprites/food.kit.d.ts +50 -0
- package/lib/render/pixelSprites/food.kit.js +140 -0
- package/lib/render/pixelSprites/food.kit.js.map +1 -0
- package/lib/render/pixelSprites/food.looks.d.ts +45 -0
- package/lib/render/pixelSprites/food.looks.js +56 -0
- package/lib/render/pixelSprites/food.looks.js.map +1 -0
- package/lib/render/pixelSprites/layers.d.ts +49 -0
- package/lib/render/pixelSprites/layers.js +61 -0
- package/lib/render/pixelSprites/layers.js.map +1 -0
- package/lib/render/pixelSprites/nightclub.d.ts +3 -0
- package/lib/render/pixelSprites/nightclub.js +108 -0
- package/lib/render/pixelSprites/nightclub.js.map +1 -0
- package/lib/render/pixelSprites/people.d.ts +168 -0
- package/lib/render/pixelSprites/people.js +431 -0
- package/lib/render/pixelSprites/people.js.map +1 -0
- package/lib/render/pixelSprites/residential.d.ts +5 -0
- package/lib/render/pixelSprites/residential.js +506 -0
- package/lib/render/pixelSprites/residential.js.map +1 -0
- package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
- package/lib/render/pixelSprites/residential.looks.js +43 -0
- package/lib/render/pixelSprites/residential.looks.js.map +1 -0
- package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
- package/lib/render/pixelSprites/residential.roaches.js +88 -0
- package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
- package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
- package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
- package/lib/render/pixelSprites/shop.d.ts +14 -0
- package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
- package/lib/render/pixelSprites/shop.interiors.js +382 -0
- package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
- package/lib/render/pixelSprites/shop.js +72 -0
- package/lib/render/pixelSprites/shop.js.map +1 -0
- package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
- package/lib/render/pixelSprites/shop.looks.js +24 -0
- package/lib/render/pixelSprites/shop.looks.js.map +1 -0
- package/lib/render/pixelSprites/skyBar.d.ts +11 -0
- package/lib/render/pixelSprites/skyBar.js +125 -0
- package/lib/render/pixelSprites/skyBar.js.map +1 -0
- package/lib/render/pixelSprites/spa.d.ts +3 -0
- package/lib/render/pixelSprites/spa.js +88 -0
- package/lib/render/pixelSprites/spa.js.map +1 -0
- package/lib/render/pixelSprites.d.ts +33 -0
- package/lib/render/pixelSprites.js +167 -0
- package/lib/render/pixelSprites.js.map +1 -0
- package/lib/render/regionGrid.d.ts +49 -0
- package/lib/render/regionGrid.js +82 -0
- package/lib/render/regionGrid.js.map +1 -0
- package/lib/render/regionPaint.d.ts +15 -0
- package/lib/render/regionPaint.js +33 -0
- package/lib/render/regionPaint.js.map +1 -0
- package/lib/render/renderSim.d.ts +104 -0
- package/lib/render/renderSim.js +2 -0
- package/lib/render/renderSim.js.map +1 -0
- package/lib/render/roomPortrait.d.ts +35 -0
- package/lib/render/roomPortrait.js +142 -0
- package/lib/render/roomPortrait.js.map +1 -0
- package/lib/render/roomShading.d.ts +29 -0
- package/lib/render/roomShading.js +43 -0
- package/lib/render/roomShading.js.map +1 -0
- package/lib/render/scale.d.ts +31 -0
- package/lib/render/scale.js +34 -0
- package/lib/render/scale.js.map +1 -0
- package/lib/render/sceneryLayout.d.ts +234 -0
- package/lib/render/sceneryLayout.js +199 -0
- package/lib/render/sceneryLayout.js.map +1 -0
- package/lib/render/sprites/common.d.ts +41 -0
- package/lib/render/sprites/common.js +46 -0
- package/lib/render/sprites/common.js.map +1 -0
- package/lib/render/sprites/escalator.d.ts +27 -0
- package/lib/render/sprites/escalator.js +156 -0
- package/lib/render/sprites/escalator.js.map +1 -0
- package/lib/render/sprites/events.d.ts +56 -0
- package/lib/render/sprites/events.js +280 -0
- package/lib/render/sprites/events.js.map +1 -0
- package/lib/render/sprites/facilities/garage.d.ts +23 -0
- package/lib/render/sprites/facilities/garage.js +230 -0
- package/lib/render/sprites/facilities/garage.js.map +1 -0
- package/lib/render/sprites/facilities/recycling.d.ts +3 -0
- package/lib/render/sprites/facilities/recycling.js +210 -0
- package/lib/render/sprites/facilities/recycling.js.map +1 -0
- package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
- package/lib/render/sprites/facilities/recyclingLook.js +52 -0
- package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
- package/lib/render/sprites/facilities/service.d.ts +14 -0
- package/lib/render/sprites/facilities/service.js +437 -0
- package/lib/render/sprites/facilities/service.js.map +1 -0
- package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
- package/lib/render/sprites/facilities/serviceKit.js +113 -0
- package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
- package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
- package/lib/render/sprites/facilities/vehicles.js +276 -0
- package/lib/render/sprites/facilities/vehicles.js.map +1 -0
- package/lib/render/sprites/facilities/venue.d.ts +28 -0
- package/lib/render/sprites/facilities/venue.js +211 -0
- package/lib/render/sprites/facilities/venue.js.map +1 -0
- package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
- package/lib/render/sprites/facilities/weddingHall.js +410 -0
- package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
- package/lib/render/sprites/facilities.d.ts +22 -0
- package/lib/render/sprites/facilities.js +24 -0
- package/lib/render/sprites/facilities.js.map +1 -0
- package/lib/render/sprites/helicopter.d.ts +11 -0
- package/lib/render/sprites/helicopter.js +60 -0
- package/lib/render/sprites/helicopter.js.map +1 -0
- package/lib/render/sprites/sky.d.ts +67 -0
- package/lib/render/sprites/sky.js +85 -0
- package/lib/render/sprites/sky.js.map +1 -0
- package/lib/render/sprites/spiralStair.d.ts +19 -0
- package/lib/render/sprites/spiralStair.js +111 -0
- package/lib/render/sprites/spiralStair.js.map +1 -0
- package/lib/render/sprites/structure/entrance.d.ts +35 -0
- package/lib/render/sprites/structure/entrance.js +347 -0
- package/lib/render/sprites/structure/entrance.js.map +1 -0
- package/lib/render/sprites/structure/lobby.d.ts +88 -0
- package/lib/render/sprites/structure/lobby.js +350 -0
- package/lib/render/sprites/structure/lobby.js.map +1 -0
- package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
- package/lib/render/sprites/structure/revolvingDoor.js +184 -0
- package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
- package/lib/render/sprites/structure/rooftop.d.ts +93 -0
- package/lib/render/sprites/structure/rooftop.js +302 -0
- package/lib/render/sprites/structure/rooftop.js.map +1 -0
- package/lib/render/sprites/structure/shell.d.ts +19 -0
- package/lib/render/sprites/structure/shell.js +142 -0
- package/lib/render/sprites/structure/shell.js.map +1 -0
- package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
- package/lib/render/sprites/structure/skyBridge.js +259 -0
- package/lib/render/sprites/structure/skyBridge.js.map +1 -0
- package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
- package/lib/render/sprites/structure/tallLobby.js +166 -0
- package/lib/render/sprites/structure/tallLobby.js.map +1 -0
- package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
- package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
- package/lib/render/sprites/structure.d.ts +15 -0
- package/lib/render/sprites/structure.js +16 -0
- package/lib/render/sprites/structure.js.map +1 -0
- package/lib/render/sprites/transport.d.ts +30 -0
- package/lib/render/sprites/transport.js +376 -0
- package/lib/render/sprites/transport.js.map +1 -0
- package/lib/render/sprites.d.ts +16 -0
- package/lib/render/sprites.js +108 -0
- package/lib/render/sprites.js.map +1 -0
- package/lib/render/venueFlights.d.ts +61 -0
- package/lib/render/venueFlights.js +50 -0
- package/lib/render/venueFlights.js.map +1 -0
- package/lib/shared/engineTypes.d.ts +256 -0
- package/lib/shared/engineTypes.js +8 -0
- package/lib/shared/engineTypes.js.map +1 -0
- package/lib/shared/floorRuns.d.ts +22 -0
- package/lib/shared/floorRuns.js +39 -0
- package/lib/shared/floorRuns.js.map +1 -0
- package/lib/shared/inputEvents.d.ts +18 -0
- package/lib/shared/inputEvents.js +23 -0
- package/lib/shared/inputEvents.js.map +1 -0
- package/lib/shared/serializedGame.d.ts +142 -0
- package/lib/shared/serializedGame.js +2 -0
- package/lib/shared/serializedGame.js.map +1 -0
- package/lib/shared/types.d.ts +298 -0
- package/lib/shared/types.js +47 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/shared/unitState.d.ts +36 -0
- package/lib/shared/unitState.js +42 -0
- package/lib/shared/unitState.js.map +1 -0
- package/lib/shared/vacateReasonText.d.ts +20 -0
- package/lib/shared/vacateReasonText.js +23 -0
- package/lib/shared/vacateReasonText.js.map +1 -0
- package/lib/shared/viewZoom.d.ts +14 -0
- package/lib/shared/viewZoom.js +17 -0
- package/lib/shared/viewZoom.js.map +1 -0
- package/lib/shared/wellFormed.d.ts +14 -0
- package/lib/shared/wellFormed.js +19 -0
- package/lib/shared/wellFormed.js.map +1 -0
- package/lib/simport/cards.d.ts +26 -0
- package/lib/simport/cards.js +138 -0
- package/lib/simport/cards.js.map +1 -0
- package/lib/simport/clockView.d.ts +24 -0
- package/lib/simport/clockView.js +43 -0
- package/lib/simport/clockView.js.map +1 -0
- package/lib/simport/commands.d.ts +215 -0
- package/lib/simport/commands.js +2 -0
- package/lib/simport/commands.js.map +1 -0
- package/lib/simport/emergencyReads.d.ts +19 -0
- package/lib/simport/emergencyReads.js +47 -0
- package/lib/simport/emergencyReads.js.map +1 -0
- package/lib/simport/enginePort.d.ts +433 -0
- package/lib/simport/enginePort.js +11 -0
- package/lib/simport/enginePort.js.map +1 -0
- package/lib/simport/fixtures/catalog.classic.json +2137 -0
- package/lib/simport/fixtures/catalog.modern.json +2515 -0
- package/lib/simport/fixtures/viewLayout.json +927 -0
- package/lib/simport/headerClock.d.ts +31 -0
- package/lib/simport/headerClock.js +29 -0
- package/lib/simport/headerClock.js.map +1 -0
- package/lib/simport/panels.d.ts +243 -0
- package/lib/simport/panels.js +2 -0
- package/lib/simport/panels.js.map +1 -0
- package/lib/simport/personCards.d.ts +63 -0
- package/lib/simport/personCards.js +55 -0
- package/lib/simport/personCards.js.map +1 -0
- package/lib/simport/portCodes.d.ts +41 -0
- package/lib/simport/portCodes.js +49 -0
- package/lib/simport/portCodes.js.map +1 -0
- package/lib/simport/portEvents.d.ts +39 -0
- package/lib/simport/portEvents.js +43 -0
- package/lib/simport/portEvents.js.map +1 -0
- package/lib/simport/portRenderSim.d.ts +70 -0
- package/lib/simport/portRenderSim.js +129 -0
- package/lib/simport/portRenderSim.js.map +1 -0
- package/lib/simport/queries.d.ts +64 -0
- package/lib/simport/queries.js +30 -0
- package/lib/simport/queries.js.map +1 -0
- package/lib/simport/recyclingPort.d.ts +13 -0
- package/lib/simport/recyclingPort.js +2 -0
- package/lib/simport/recyclingPort.js.map +1 -0
- package/lib/simport/request.d.ts +44 -0
- package/lib/simport/request.js +214 -0
- package/lib/simport/request.js.map +1 -0
- package/lib/simport/roomTiers.d.ts +102 -0
- package/lib/simport/roomTiers.js +122 -0
- package/lib/simport/roomTiers.js.map +1 -0
- package/lib/simport/scheduleSlots.d.ts +19 -0
- package/lib/simport/scheduleSlots.js +87 -0
- package/lib/simport/scheduleSlots.js.map +1 -0
- package/lib/simport/skyBridgePort.d.ts +20 -0
- package/lib/simport/skyBridgePort.js +2 -0
- package/lib/simport/skyBridgePort.js.map +1 -0
- package/lib/simport/skyBridgeView.d.ts +15 -0
- package/lib/simport/skyBridgeView.js +42 -0
- package/lib/simport/skyBridgeView.js.map +1 -0
- package/lib/simport/statsSheet.d.ts +15 -0
- package/lib/simport/statsSheet.js +101 -0
- package/lib/simport/statsSheet.js.map +1 -0
- package/lib/simport/tdtRecords.d.ts +9 -0
- package/lib/simport/tdtRecords.js +112 -0
- package/lib/simport/tdtRecords.js.map +1 -0
- package/lib/simport/tdtReportFacts.d.ts +110 -0
- package/lib/simport/tdtReportFacts.js +8 -0
- package/lib/simport/tdtReportFacts.js.map +1 -0
- package/lib/simport/trafficPort.d.ts +22 -0
- package/lib/simport/trafficPort.js +2 -0
- package/lib/simport/trafficPort.js.map +1 -0
- package/lib/simport/view.d.ts +275 -0
- package/lib/simport/view.js +2 -0
- package/lib/simport/view.js.map +1 -0
- package/lib/simport/viewReader.d.ts +89 -0
- package/lib/simport/viewReader.js +426 -0
- package/lib/simport/viewReader.js.map +1 -0
- package/lib/styles/game/appearance.css +108 -0
- package/lib/styles/game/base.css +68 -0
- package/lib/styles/game/components.css +69 -0
- package/lib/styles/game/desk-title.css +183 -0
- package/lib/styles/game/desk.css +487 -0
- package/lib/styles/game/dialogs.css +360 -0
- package/lib/styles/game/editor-sidebar.css +116 -0
- package/lib/styles/game/elevator-schedule.css +217 -0
- package/lib/styles/game/file-dialog.css +470 -0
- package/lib/styles/game/help.css +141 -0
- package/lib/styles/game/launch-fireworks.css +17 -0
- package/lib/styles/game/media-landscape.css +333 -0
- package/lib/styles/game/media-phone.css +303 -0
- package/lib/styles/game/media-tablet-touch.css +177 -0
- package/lib/styles/game/menubar.css +158 -0
- package/lib/styles/game/new-tower.css +219 -0
- package/lib/styles/game/onboarding.css +32 -0
- package/lib/styles/game/screen-saver.css +85 -0
- package/lib/styles/game/splash.css +413 -0
- package/lib/styles/game/stats-saves.css +106 -0
- package/lib/styles/game/tools-stage.css +340 -0
- package/lib/styles/game/topbar.css +191 -0
- package/lib/styles/menu-bar.css +108 -0
- package/lib/styles/not-found.css +335 -0
- package/lib/styles/overview-map-views.css +88 -0
- package/lib/styles/overview-map.css +195 -0
- package/lib/styles/retro-components.css +179 -0
- package/lib/styles/retro-page.css +254 -0
- package/lib/styles/retro-tokens.css +122 -0
- package/lib/styles/schemes/high-contrast.css +173 -0
- package/lib/styles/schemes/skyline.css +134 -0
- package/lib/styles.css +66 -0
- package/lib/ui/desk/deskGeometry.d.ts +59 -0
- package/lib/ui/desk/deskGeometry.js +106 -0
- package/lib/ui/desk/deskGeometry.js.map +1 -0
- package/lib/ui/desk/deskWindow.d.ts +90 -0
- package/lib/ui/desk/deskWindow.js +253 -0
- package/lib/ui/desk/deskWindow.js.map +1 -0
- package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
- package/lib/ui/desk/deskWindowMenu.js +143 -0
- package/lib/ui/desk/deskWindowMenu.js.map +1 -0
- package/lib/ui/escape.d.ts +1 -0
- package/lib/ui/escape.js +14 -0
- package/lib/ui/escape.js.map +1 -0
- package/lib/ui/format.d.ts +14 -0
- package/lib/ui/format.js +36 -0
- package/lib/ui/format.js.map +1 -0
- package/lib/ui/iconPaths.generated.d.ts +4 -0
- package/lib/ui/iconPaths.generated.js +68 -0
- package/lib/ui/iconPaths.generated.js.map +1 -0
- package/lib/ui/icons.d.ts +83 -0
- package/lib/ui/icons.js +156 -0
- package/lib/ui/icons.js.map +1 -0
- package/lib/ui/menuBar.d.ts +94 -0
- package/lib/ui/menuBar.js +361 -0
- package/lib/ui/menuBar.js.map +1 -0
- package/lib/ui/modalPrecedence.d.ts +108 -0
- package/lib/ui/modalPrecedence.js +165 -0
- package/lib/ui/modalPrecedence.js.map +1 -0
- package/lib/ui/movableWindow.d.ts +124 -0
- package/lib/ui/movableWindow.js +247 -0
- package/lib/ui/movableWindow.js.map +1 -0
- package/lib/ui/overviewMapInput.d.ts +109 -0
- package/lib/ui/overviewMapInput.js +135 -0
- package/lib/ui/overviewMapInput.js.map +1 -0
- package/lib/ui/uiModal.d.ts +38 -0
- package/lib/ui/uiModal.js +70 -0
- package/lib/ui/uiModal.js.map +1 -0
- package/lib/wasmhost/buildSection.d.ts +54 -0
- package/lib/wasmhost/buildSection.js +143 -0
- package/lib/wasmhost/buildSection.js.map +1 -0
- package/lib/wasmhost/catalogCheck.d.ts +11 -0
- package/lib/wasmhost/catalogCheck.js +43 -0
- package/lib/wasmhost/catalogCheck.js.map +1 -0
- package/lib/wasmhost/engineAssets.d.ts +57 -0
- package/lib/wasmhost/engineAssets.js +63 -0
- package/lib/wasmhost/engineAssets.js.map +1 -0
- package/lib/wasmhost/engineBoot.d.ts +165 -0
- package/lib/wasmhost/engineBoot.js +254 -0
- package/lib/wasmhost/engineBoot.js.map +1 -0
- package/lib/wasmhost/engineChoice.d.ts +6 -0
- package/lib/wasmhost/engineChoice.js +2 -0
- package/lib/wasmhost/engineChoice.js.map +1 -0
- package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
- package/lib/wasmhost/engineDiagnostics.js +189 -0
- package/lib/wasmhost/engineDiagnostics.js.map +1 -0
- package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
- package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
- package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
- package/lib/wasmhost/engineIdentity.d.ts +30 -0
- package/lib/wasmhost/engineIdentity.js +59 -0
- package/lib/wasmhost/engineIdentity.js.map +1 -0
- package/lib/wasmhost/engineLabel.d.ts +40 -0
- package/lib/wasmhost/engineLabel.js +50 -0
- package/lib/wasmhost/engineLabel.js.map +1 -0
- package/lib/wasmhost/engineLoad.d.ts +48 -0
- package/lib/wasmhost/engineLoad.js +53 -0
- package/lib/wasmhost/engineLoad.js.map +1 -0
- package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
- package/lib/wasmhost/enginePackageCheck.js +274 -0
- package/lib/wasmhost/enginePackageCheck.js.map +1 -0
- package/lib/wasmhost/enginePackageNames.d.ts +25 -0
- package/lib/wasmhost/enginePackageNames.js +28 -0
- package/lib/wasmhost/enginePackageNames.js.map +1 -0
- package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
- package/lib/wasmhost/enginePackageRecord.js +108 -0
- package/lib/wasmhost/enginePackageRecord.js.map +1 -0
- package/lib/wasmhost/engineRepair.d.ts +55 -0
- package/lib/wasmhost/engineRepair.js +183 -0
- package/lib/wasmhost/engineRepair.js.map +1 -0
- package/lib/wasmhost/frameView.d.ts +87 -0
- package/lib/wasmhost/frameView.js +133 -0
- package/lib/wasmhost/frameView.js.map +1 -0
- package/lib/wasmhost/hostFault.d.ts +40 -0
- package/lib/wasmhost/hostFault.js +94 -0
- package/lib/wasmhost/hostFault.js.map +1 -0
- package/lib/wasmhost/loadEngineModule.d.ts +79 -0
- package/lib/wasmhost/loadEngineModule.js +66 -0
- package/lib/wasmhost/loadEngineModule.js.map +1 -0
- package/lib/wasmhost/packageHash.d.ts +48 -0
- package/lib/wasmhost/packageHash.js +436 -0
- package/lib/wasmhost/packageHash.js.map +1 -0
- package/lib/wasmhost/rustEngine.d.ts +49 -0
- package/lib/wasmhost/rustEngine.js +63 -0
- package/lib/wasmhost/rustEngine.js.map +1 -0
- package/lib/wasmhost/slotPopulation.d.ts +19 -0
- package/lib/wasmhost/slotPopulation.js +69 -0
- package/lib/wasmhost/slotPopulation.js.map +1 -0
- package/lib/wasmhost/telemetry.d.ts +31 -0
- package/lib/wasmhost/telemetry.js +13 -0
- package/lib/wasmhost/telemetry.js.map +1 -0
- package/package.json +80 -4
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** What the record says about one served file. */
|
|
2
|
+
export interface EngineFileRecord {
|
|
3
|
+
sha256: string;
|
|
4
|
+
bytes: number;
|
|
5
|
+
}
|
|
6
|
+
/** The record's `files` block: exactly the glue and the binary. */
|
|
7
|
+
export type EngineFiles = Record<string, EngineFileRecord>;
|
|
8
|
+
/** The crate the package was built from, as its `Cargo.toml` names it. */
|
|
9
|
+
export interface EngineCrateRecord {
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
}
|
|
13
|
+
/** `engine/BUILD.json` at schema 2. */
|
|
14
|
+
export interface EnginePackageRecord {
|
|
15
|
+
schema: 2;
|
|
16
|
+
/** The hash of the Rust sources (src/wasmhost/packageHash.ts), unchanged. */
|
|
17
|
+
sources: string;
|
|
18
|
+
/**
|
|
19
|
+
* The crate's name and version (#963), so About can show them when the
|
|
20
|
+
* engine never loaded. Optional: a record cached before this field lacks
|
|
21
|
+
* it. It is not part of `package`, which covers the two files alone.
|
|
22
|
+
*/
|
|
23
|
+
crate?: EngineCrateRecord;
|
|
24
|
+
/** The hash of the canonical JSON of `files`: the id of these exact bytes. */
|
|
25
|
+
package: string;
|
|
26
|
+
files: EngineFiles;
|
|
27
|
+
}
|
|
28
|
+
/** What the shell is built to run: the record without the sources hash. */
|
|
29
|
+
export interface ExpectedEnginePackage {
|
|
30
|
+
package: string;
|
|
31
|
+
files: EngineFiles;
|
|
32
|
+
/** The crate this shell was built to run, a label for About and diagnostics (#963); the check never reads it. */
|
|
33
|
+
crate?: EngineCrateRecord;
|
|
34
|
+
/** The Workbox precache revision (the file's MD5 plus the rotation suffix) of each of the three
|
|
35
|
+
* engine files this build ships, by file name, so Repair can name the cache
|
|
36
|
+
* keys of the running build and no other (#985, design 5.4). Optional: a
|
|
37
|
+
* label for Repair; the package check never reads it. */
|
|
38
|
+
revisions?: Record<string, string>;
|
|
39
|
+
/** The hash of the Rust sources of the package this shell was built with
|
|
40
|
+
* (`BUILD.json`'s `sources`), for About to compare with the hash stamped in
|
|
41
|
+
* the binary (#963). A label: the package check never reads it. */
|
|
42
|
+
sources?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A SHA-256 as 64 lowercase hex digits. */
|
|
45
|
+
export declare const SHA256_HEX: RegExp;
|
|
46
|
+
/**
|
|
47
|
+
* The text whose SHA-256 is the package id. A newly built object in a fixed
|
|
48
|
+
* key order, no whitespace, so the same two files always give the same id
|
|
49
|
+
* whatever order or spacing a served record used.
|
|
50
|
+
*/
|
|
51
|
+
export declare function canonicalFilesJson(files: EngineFiles): string;
|
|
52
|
+
/** The first 12 hex digits of an id, as the failure screen and diagnostics show it. */
|
|
53
|
+
export declare function shortId(id: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* The record for a freshly built package. `sha256Hex` takes bytes or text, so
|
|
56
|
+
* the build uses Node's hash and a test can use a fake.
|
|
57
|
+
*/
|
|
58
|
+
export declare function engineBuildRecord(glue: Uint8Array, wasm: Uint8Array, sources: string, sha256Hex: (data: Uint8Array | string) => string, crate?: EngineCrateRecord): EnginePackageRecord;
|
|
59
|
+
/** The part of a record the shell compiles in. */
|
|
60
|
+
export declare function expectedOf(record: EnginePackageRecord): ExpectedEnginePackage;
|
|
61
|
+
/**
|
|
62
|
+
* Reads a record from JSON text, strictly: schema 2, a `package` of 64 hex
|
|
63
|
+
* digits, a `sources` string, and a `files` block naming exactly the glue and
|
|
64
|
+
* the binary with valid digests and byte counts. Unknown keys, at the top
|
|
65
|
+
* level or inside an entry, are ignored (a later field must not strand an
|
|
66
|
+
* older shell, and the package id covers only the digest and size of each
|
|
67
|
+
* file); an unknown file or a missing one is not. The optional `crate` is kept
|
|
68
|
+
* when it is two non-empty strings and reads as absent otherwise, since it
|
|
69
|
+
* labels the package and never gates the load. Returns why not on failure,
|
|
70
|
+
* never throws.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseEngineRecord(text: string): {
|
|
73
|
+
ok: true;
|
|
74
|
+
record: EnginePackageRecord;
|
|
75
|
+
} | {
|
|
76
|
+
ok: false;
|
|
77
|
+
why: string;
|
|
78
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ENGINE_WASM, ENGINE_GLUE } from './enginePackageNames.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The engine package's build record (`engine/BUILD.json`, schema 2) and the
|
|
5
|
+
* pure rules around it: how the file digests become one package id, and how a
|
|
6
|
+
* served record is read back (#985 criterion 5, design in
|
|
7
|
+
* _bmad-output/planning-artifacts/design/design-engine-package-set-consistency-2026-10-15.md).
|
|
8
|
+
*
|
|
9
|
+
* Nothing here hashes: the build passes a Node digest, the page passes
|
|
10
|
+
* `crypto.subtle`, so the rules are the same on both sides and a test can pin
|
|
11
|
+
* them. Keep this file ERASABLE (type-only TypeScript syntax; the rule is
|
|
12
|
+
* spelled out in scripts/screenshot-env.ts): scripts/wasm-build.ts imports it
|
|
13
|
+
* under plain `node`.
|
|
14
|
+
*/
|
|
15
|
+
/** A SHA-256 as 64 lowercase hex digits. */
|
|
16
|
+
const SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
17
|
+
/**
|
|
18
|
+
* The text whose SHA-256 is the package id. A newly built object in a fixed
|
|
19
|
+
* key order, no whitespace, so the same two files always give the same id
|
|
20
|
+
* whatever order or spacing a served record used.
|
|
21
|
+
*/
|
|
22
|
+
function canonicalFilesJson(files) {
|
|
23
|
+
const entry = (name) => ({ sha256: files[name].sha256, bytes: files[name].bytes });
|
|
24
|
+
return JSON.stringify({ [ENGINE_GLUE]: entry(ENGINE_GLUE), [ENGINE_WASM]: entry(ENGINE_WASM) });
|
|
25
|
+
}
|
|
26
|
+
/** The first 12 hex digits of an id, as the failure screen and diagnostics show it. */
|
|
27
|
+
function shortId(id) {
|
|
28
|
+
return id.slice(0, 12);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The record for a freshly built package. `sha256Hex` takes bytes or text, so
|
|
32
|
+
* the build uses Node's hash and a test can use a fake.
|
|
33
|
+
*/
|
|
34
|
+
function engineBuildRecord(glue, wasm, sources, sha256Hex, crate) {
|
|
35
|
+
const files = {
|
|
36
|
+
[ENGINE_GLUE]: { sha256: sha256Hex(glue), bytes: glue.length },
|
|
37
|
+
[ENGINE_WASM]: { sha256: sha256Hex(wasm), bytes: wasm.length },
|
|
38
|
+
};
|
|
39
|
+
return { schema: 2, sources, ...(crate ? { crate: { name: crate.name, version: crate.version } } : {}), package: sha256Hex(canonicalFilesJson(files)), files };
|
|
40
|
+
}
|
|
41
|
+
/** The part of a record the shell compiles in. */
|
|
42
|
+
function expectedOf(record) {
|
|
43
|
+
return {
|
|
44
|
+
package: record.package,
|
|
45
|
+
files: { [ENGINE_GLUE]: { ...record.files[ENGINE_GLUE] }, [ENGINE_WASM]: { ...record.files[ENGINE_WASM] } },
|
|
46
|
+
...(record.crate ? { crate: { ...record.crate } } : {}),
|
|
47
|
+
sources: record.sources,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** A crate entry is two non-empty strings; anything else reads as absent, since it is a label and never gates the load. */
|
|
51
|
+
function readCrate(v) {
|
|
52
|
+
if (typeof v !== "object" || v === null || Array.isArray(v))
|
|
53
|
+
return undefined;
|
|
54
|
+
const c = v;
|
|
55
|
+
return typeof c.name === "string" && c.name !== "" && typeof c.version === "string" && c.version !== "" ? { name: c.name, version: c.version } : undefined;
|
|
56
|
+
}
|
|
57
|
+
function isFileRecord(v) {
|
|
58
|
+
if (typeof v !== "object" || v === null || Array.isArray(v))
|
|
59
|
+
return false;
|
|
60
|
+
const r = v;
|
|
61
|
+
return typeof r.sha256 === "string" && SHA256_HEX.test(r.sha256) && typeof r.bytes === "number" && Number.isSafeInteger(r.bytes) && r.bytes >= 0;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reads a record from JSON text, strictly: schema 2, a `package` of 64 hex
|
|
65
|
+
* digits, a `sources` string, and a `files` block naming exactly the glue and
|
|
66
|
+
* the binary with valid digests and byte counts. Unknown keys, at the top
|
|
67
|
+
* level or inside an entry, are ignored (a later field must not strand an
|
|
68
|
+
* older shell, and the package id covers only the digest and size of each
|
|
69
|
+
* file); an unknown file or a missing one is not. The optional `crate` is kept
|
|
70
|
+
* when it is two non-empty strings and reads as absent otherwise, since it
|
|
71
|
+
* labels the package and never gates the load. Returns why not on failure,
|
|
72
|
+
* never throws.
|
|
73
|
+
*/
|
|
74
|
+
function parseEngineRecord(text) {
|
|
75
|
+
let v;
|
|
76
|
+
try {
|
|
77
|
+
v = JSON.parse(text);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return { ok: false, why: "not JSON" };
|
|
81
|
+
}
|
|
82
|
+
if (typeof v !== "object" || v === null || Array.isArray(v))
|
|
83
|
+
return { ok: false, why: "not an object" };
|
|
84
|
+
const r = v;
|
|
85
|
+
if (r.schema !== 2)
|
|
86
|
+
return { ok: false, why: "not schema 2" };
|
|
87
|
+
if (typeof r.sources !== "string")
|
|
88
|
+
return { ok: false, why: "no sources hash" };
|
|
89
|
+
if (typeof r.package !== "string" || !SHA256_HEX.test(r.package))
|
|
90
|
+
return { ok: false, why: "bad package id" };
|
|
91
|
+
const files = r.files;
|
|
92
|
+
if (typeof files !== "object" || files === null || Array.isArray(files))
|
|
93
|
+
return { ok: false, why: "no files block" };
|
|
94
|
+
const names = Object.keys(files);
|
|
95
|
+
if (names.length !== 2 || !names.includes(ENGINE_GLUE) || !names.includes(ENGINE_WASM))
|
|
96
|
+
return { ok: false, why: "files block does not name exactly the glue and the binary" };
|
|
97
|
+
for (const name of names) {
|
|
98
|
+
if (!isFileRecord(files[name]))
|
|
99
|
+
return { ok: false, why: `bad entry for ${name}` };
|
|
100
|
+
}
|
|
101
|
+
const f = files;
|
|
102
|
+
const entry = (name) => ({ sha256: f[name].sha256, bytes: f[name].bytes });
|
|
103
|
+
const crate = readCrate(r.crate);
|
|
104
|
+
return { ok: true, record: { schema: 2, sources: r.sources, ...(crate ? { crate } : {}), package: r.package, files: { [ENGINE_GLUE]: entry(ENGINE_GLUE), [ENGINE_WASM]: entry(ENGINE_WASM) } } };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { SHA256_HEX, canonicalFilesJson, engineBuildRecord, expectedOf, parseEngineRecord, shortId };
|
|
108
|
+
//# sourceMappingURL=enginePackageRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enginePackageRecord.js","sources":["../../src/wasmhost/enginePackageRecord.ts"],"sourcesContent":["/**\n * The engine package's build record (`engine/BUILD.json`, schema 2) and the\n * pure rules around it: how the file digests become one package id, and how a\n * served record is read back (#985 criterion 5, design in\n * _bmad-output/planning-artifacts/design/design-engine-package-set-consistency-2026-10-15.md).\n *\n * Nothing here hashes: the build passes a Node digest, the page passes\n * `crypto.subtle`, so the rules are the same on both sides and a test can pin\n * them. Keep this file ERASABLE (type-only TypeScript syntax; the rule is\n * spelled out in scripts/screenshot-env.ts): scripts/wasm-build.ts imports it\n * under plain `node`.\n */\nimport { ENGINE_GLUE, ENGINE_WASM } from \"./enginePackageNames.ts\";\n\n/** What the record says about one served file. */\nexport interface EngineFileRecord {\n sha256: string;\n bytes: number;\n}\n\n/** The record's `files` block: exactly the glue and the binary. */\nexport type EngineFiles = Record<string, EngineFileRecord>;\n\n/** The crate the package was built from, as its `Cargo.toml` names it. */\nexport interface EngineCrateRecord {\n name: string;\n version: string;\n}\n\n/** `engine/BUILD.json` at schema 2. */\nexport interface EnginePackageRecord {\n schema: 2;\n /** The hash of the Rust sources (src/wasmhost/packageHash.ts), unchanged. */\n sources: string;\n /**\n * The crate's name and version (#963), so About can show them when the\n * engine never loaded. Optional: a record cached before this field lacks\n * it. It is not part of `package`, which covers the two files alone.\n */\n crate?: EngineCrateRecord;\n /** The hash of the canonical JSON of `files`: the id of these exact bytes. */\n package: string;\n files: EngineFiles;\n}\n\n/** What the shell is built to run: the record without the sources hash. */\nexport interface ExpectedEnginePackage {\n package: string;\n files: EngineFiles;\n /** The crate this shell was built to run, a label for About and diagnostics (#963); the check never reads it. */\n crate?: EngineCrateRecord;\n /** The Workbox precache revision (the file's MD5 plus the rotation suffix) of each of the three\n * engine files this build ships, by file name, so Repair can name the cache\n * keys of the running build and no other (#985, design 5.4). Optional: a\n * label for Repair; the package check never reads it. */\n revisions?: Record<string, string>;\n /** The hash of the Rust sources of the package this shell was built with\n * (`BUILD.json`'s `sources`), for About to compare with the hash stamped in\n * the binary (#963). A label: the package check never reads it. */\n sources?: string;\n}\n\n/** A SHA-256 as 64 lowercase hex digits. */\nexport const SHA256_HEX = /^[0-9a-f]{64}$/;\n\n/**\n * The text whose SHA-256 is the package id. A newly built object in a fixed\n * key order, no whitespace, so the same two files always give the same id\n * whatever order or spacing a served record used.\n */\nexport function canonicalFilesJson(files: EngineFiles): string {\n const entry = (name: string) => ({ sha256: files[name].sha256, bytes: files[name].bytes });\n return JSON.stringify({ [ENGINE_GLUE]: entry(ENGINE_GLUE), [ENGINE_WASM]: entry(ENGINE_WASM) });\n}\n\n/** The first 12 hex digits of an id, as the failure screen and diagnostics show it. */\nexport function shortId(id: string): string {\n return id.slice(0, 12);\n}\n\n/**\n * The record for a freshly built package. `sha256Hex` takes bytes or text, so\n * the build uses Node's hash and a test can use a fake.\n */\nexport function engineBuildRecord(\n glue: Uint8Array,\n wasm: Uint8Array,\n sources: string,\n sha256Hex: (data: Uint8Array | string) => string,\n crate?: EngineCrateRecord,\n): EnginePackageRecord {\n const files: EngineFiles = {\n [ENGINE_GLUE]: { sha256: sha256Hex(glue), bytes: glue.length },\n [ENGINE_WASM]: { sha256: sha256Hex(wasm), bytes: wasm.length },\n };\n return { schema: 2, sources, ...(crate ? { crate: { name: crate.name, version: crate.version } } : {}), package: sha256Hex(canonicalFilesJson(files)), files };\n}\n\n/** The part of a record the shell compiles in. */\nexport function expectedOf(record: EnginePackageRecord): ExpectedEnginePackage {\n return {\n package: record.package,\n files: { [ENGINE_GLUE]: { ...record.files[ENGINE_GLUE] }, [ENGINE_WASM]: { ...record.files[ENGINE_WASM] } },\n ...(record.crate ? { crate: { ...record.crate } } : {}),\n sources: record.sources,\n };\n}\n\n/** A crate entry is two non-empty strings; anything else reads as absent, since it is a label and never gates the load. */\nfunction readCrate(v: unknown): EngineCrateRecord | undefined {\n if (typeof v !== \"object\" || v === null || Array.isArray(v)) return undefined;\n const c = v as { name?: unknown; version?: unknown };\n return typeof c.name === \"string\" && c.name !== \"\" && typeof c.version === \"string\" && c.version !== \"\" ? { name: c.name, version: c.version } : undefined;\n}\n\nfunction isFileRecord(v: unknown): v is EngineFileRecord {\n if (typeof v !== \"object\" || v === null || Array.isArray(v)) return false;\n const r = v as { sha256?: unknown; bytes?: unknown };\n return typeof r.sha256 === \"string\" && SHA256_HEX.test(r.sha256) && typeof r.bytes === \"number\" && Number.isSafeInteger(r.bytes) && r.bytes >= 0;\n}\n\n/**\n * Reads a record from JSON text, strictly: schema 2, a `package` of 64 hex\n * digits, a `sources` string, and a `files` block naming exactly the glue and\n * the binary with valid digests and byte counts. Unknown keys, at the top\n * level or inside an entry, are ignored (a later field must not strand an\n * older shell, and the package id covers only the digest and size of each\n * file); an unknown file or a missing one is not. The optional `crate` is kept\n * when it is two non-empty strings and reads as absent otherwise, since it\n * labels the package and never gates the load. Returns why not on failure,\n * never throws.\n */\nexport function parseEngineRecord(text: string): { ok: true; record: EnginePackageRecord } | { ok: false; why: string } {\n let v: unknown;\n try {\n v = JSON.parse(text);\n } catch {\n return { ok: false, why: \"not JSON\" };\n }\n if (typeof v !== \"object\" || v === null || Array.isArray(v)) return { ok: false, why: \"not an object\" };\n const r = v as Record<string, unknown>;\n if (r.schema !== 2) return { ok: false, why: \"not schema 2\" };\n if (typeof r.sources !== \"string\") return { ok: false, why: \"no sources hash\" };\n if (typeof r.package !== \"string\" || !SHA256_HEX.test(r.package)) return { ok: false, why: \"bad package id\" };\n const files = r.files;\n if (typeof files !== \"object\" || files === null || Array.isArray(files)) return { ok: false, why: \"no files block\" };\n const names = Object.keys(files);\n if (names.length !== 2 || !names.includes(ENGINE_GLUE) || !names.includes(ENGINE_WASM)) return { ok: false, why: \"files block does not name exactly the glue and the binary\" };\n for (const name of names) {\n if (!isFileRecord((files as Record<string, unknown>)[name])) return { ok: false, why: `bad entry for ${name}` };\n }\n const f = files as EngineFiles;\n const entry = (name: string): EngineFileRecord => ({ sha256: f[name].sha256, bytes: f[name].bytes });\n const crate = readCrate(r.crate);\n return { ok: true, record: { schema: 2, sources: r.sources, ...(crate ? { crate } : {}), package: r.package, files: { [ENGINE_GLUE]: entry(ENGINE_GLUE), [ENGINE_WASM]: entry(ENGINE_WASM) } } };\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;AAWG;AAmDH;AACO,MAAM,UAAU,GAAG;AAE1B;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,KAAkB,EAAA;AACnD,IAAA,MAAM,KAAK,GAAG,CAAC,IAAY,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1F,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;AACjG;AAEA;AACM,SAAU,OAAO,CAAC,EAAU,EAAA;IAChC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AACxB;AAEA;;;AAGG;AACG,SAAU,iBAAiB,CAC/B,IAAgB,EAChB,IAAgB,EAChB,OAAe,EACf,SAAgD,EAChD,KAAyB,EAAA;AAEzB,IAAA,MAAM,KAAK,GAAgB;AACzB,QAAA,CAAC,WAAW,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,CAA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AAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,KAAK,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE;AAClM;;"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type VerifyOptions } from "./enginePackageCheck";
|
|
2
|
+
import { type ExpectedEnginePackage } from "./enginePackageRecord";
|
|
3
|
+
import type { EngineBootFailure } from "./engineBoot";
|
|
4
|
+
export type RepairFailure =
|
|
5
|
+
/** No worker scope, no Cache Storage, or no revisions compiled into the shell. */
|
|
6
|
+
"unavailable"
|
|
7
|
+
/** A file did not arrive from the network (offline, an HTTP error, a redirect). */
|
|
8
|
+
| "fetch"
|
|
9
|
+
/** A file arrived but is not the one this shell was built for. */
|
|
10
|
+
| "mismatch"
|
|
11
|
+
/** The browser would not store the files. */
|
|
12
|
+
| "cache";
|
|
13
|
+
export type RepairResult = {
|
|
14
|
+
ok: true;
|
|
15
|
+
written: string[];
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
reason: RepairFailure;
|
|
19
|
+
file?: string;
|
|
20
|
+
};
|
|
21
|
+
export interface RepairOptions {
|
|
22
|
+
/** The package the shell was built with (default: the compiled-in one). */
|
|
23
|
+
expected?: ExpectedEnginePackage | null;
|
|
24
|
+
/** The folder URL the engine files are served from (default: beside the glue). */
|
|
25
|
+
engineBase?: string;
|
|
26
|
+
/** The controlling worker's scope; read from the registration when absent. */
|
|
27
|
+
scope?: string;
|
|
28
|
+
fetch?: (url: string, init: {
|
|
29
|
+
cache: "reload";
|
|
30
|
+
}) => Promise<Response>;
|
|
31
|
+
digest?: VerifyOptions["digest"];
|
|
32
|
+
caches?: Pick<CacheStorage, "open" | "has">;
|
|
33
|
+
/** Asked for one registration update after a repair. */
|
|
34
|
+
update?: () => Promise<unknown>;
|
|
35
|
+
}
|
|
36
|
+
/** Whether the stop screen offers Repair: a worker controls the page and the
|
|
37
|
+
* failure is files that did not match or did not arrive. Not for a timeout, an
|
|
38
|
+
* insecure connection or a package that cannot save towers, which a fresh copy
|
|
39
|
+
* of the files does not change. */
|
|
40
|
+
export declare function repairOffered(failure: EngineBootFailure, controlled: boolean): boolean;
|
|
41
|
+
/** The page's own check of whether a worker controls it. */
|
|
42
|
+
export declare function pageControlled(): boolean;
|
|
43
|
+
/** The cache key Workbox uses for a revisioned precache entry. */
|
|
44
|
+
export declare function precacheKey(url: string, revision: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Replace the running build's three engine cache entries with fresh, checked
|
|
47
|
+
* bytes. Never throws: every outcome is in the result. Does not reload or
|
|
48
|
+
* activate a worker.
|
|
49
|
+
*/
|
|
50
|
+
export declare function repairEnginePackage(opts?: RepairOptions): Promise<RepairResult>;
|
|
51
|
+
/** Ask the page's registration for one update check. */
|
|
52
|
+
export declare function updateRegistration(): Promise<void>;
|
|
53
|
+
/** What the stop screen says about a finished repair attempt. A failure always
|
|
54
|
+
* says nothing was changed, and Repair stays available for another try. */
|
|
55
|
+
export declare function repairMessage(result: RepairResult): string;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { ENGINE_GLUE, ENGINE_WASM, ENGINE_BUILD_RECORD, ENGINE_DIR } from './enginePackageNames.js';
|
|
2
|
+
import { isControlled, browserDigest } from './enginePackageCheck.js';
|
|
3
|
+
import { parseEngineRecord, canonicalFilesJson } from './enginePackageRecord.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Repair engine files (#985, design 5.4 "Corrupted-entry recovery"). A normal
|
|
7
|
+
* Reload does not fix a corrupted entry in Cache Storage: Workbox checks
|
|
8
|
+
* integrity on a network fetch and returns a cache hit as stored. Repair
|
|
9
|
+
* fetches the three engine files from the network (with a parameter the
|
|
10
|
+
* worker's precache route does not match, since a plain fetch of the engine
|
|
11
|
+
* URL would be answered from the damaged entry), checks them against the
|
|
12
|
+
* digests this shell was built with, and only then writes them over the cache
|
|
13
|
+
* keys of the running build: the three engine URLs of this deployment with the
|
|
14
|
+
* Workbox revision the shell was built for. It touches no other key, so a
|
|
15
|
+
* waiting worker's entries (other revisions), the shell and audio entries,
|
|
16
|
+
* IndexedDB, localStorage and saves are left alone, and it never deletes
|
|
17
|
+
* first. All three files are fetched and checked before any is written, so a
|
|
18
|
+
* failed fetch or digest leaves every old entry as it was. A write that fails
|
|
19
|
+
* partway (a full quota) can leave earlier ones replaced; each was checked.
|
|
20
|
+
*
|
|
21
|
+
* Permanent host infrastructure: the wasm-only build relies on it.
|
|
22
|
+
*/
|
|
23
|
+
/** Workbox names the precache `workbox-precache-v2-` plus the worker's scope. */
|
|
24
|
+
const PRECACHE_PREFIX = "workbox-precache-v2-";
|
|
25
|
+
/** The URL parameter Workbox adds to a revisioned entry's cache key. */
|
|
26
|
+
const REVISION_PARAM = "__WB_REVISION__";
|
|
27
|
+
/** A parameter the precache route does not ignore, so the controlling worker
|
|
28
|
+
* lets the request through to the network instead of answering from the bad
|
|
29
|
+
* entry. The static host ignores it. */
|
|
30
|
+
const NETWORK_PARAM = "vc-repair";
|
|
31
|
+
const FILES = [ENGINE_GLUE, ENGINE_WASM, ENGINE_BUILD_RECORD];
|
|
32
|
+
const hex = (bytes) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
33
|
+
/** Whether the stop screen offers Repair: a worker controls the page and the
|
|
34
|
+
* failure is files that did not match or did not arrive. Not for a timeout, an
|
|
35
|
+
* insecure connection or a package that cannot save towers, which a fresh copy
|
|
36
|
+
* of the files does not change. */
|
|
37
|
+
function repairOffered(failure, controlled) {
|
|
38
|
+
if (!controlled || failure.stage !== "load" || failure.cause !== undefined)
|
|
39
|
+
return false;
|
|
40
|
+
const pkg = failure.package;
|
|
41
|
+
// A build published without an engine package has nothing to repair from.
|
|
42
|
+
if (pkg && pkg.expectedPackage === null)
|
|
43
|
+
return false;
|
|
44
|
+
if (pkg)
|
|
45
|
+
return pkg.kind === "mismatch" || pkg.kind === "load-failed";
|
|
46
|
+
// No package detail: a glue and binary that fail to link are a mismatch.
|
|
47
|
+
// Any other untyped load failure (a compile error, an out-of-memory)
|
|
48
|
+
// happens with correct files, which a fresh copy does not change.
|
|
49
|
+
return failure.reason === "package-mismatch";
|
|
50
|
+
}
|
|
51
|
+
/** The page's own check of whether a worker controls it. */
|
|
52
|
+
function pageControlled() {
|
|
53
|
+
return typeof navigator !== "undefined" && isControlled(navigator);
|
|
54
|
+
}
|
|
55
|
+
/** The cache key Workbox uses for a revisioned precache entry. */
|
|
56
|
+
function precacheKey(url, revision) {
|
|
57
|
+
const key = new URL(url);
|
|
58
|
+
key.searchParams.set(REVISION_PARAM, revision);
|
|
59
|
+
return key.href;
|
|
60
|
+
}
|
|
61
|
+
async function currentScope() {
|
|
62
|
+
try {
|
|
63
|
+
return (await navigator.serviceWorker?.getRegistration())?.scope;
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Replace the running build's three engine cache entries with fresh, checked
|
|
71
|
+
* bytes. Never throws: every outcome is in the result. Does not reload or
|
|
72
|
+
* activate a worker.
|
|
73
|
+
*/
|
|
74
|
+
async function repairEnginePackage(opts = {}) {
|
|
75
|
+
const expected = opts.expected === undefined ? __ENGINE_PACKAGE__ : opts.expected;
|
|
76
|
+
const digest = "digest" in opts ? opts.digest : browserDigest();
|
|
77
|
+
const store = opts.caches ?? (typeof caches === "undefined" ? undefined : caches);
|
|
78
|
+
const scope = opts.scope ?? (await currentScope());
|
|
79
|
+
const engineBase = opts.engineBase ?? new URL(`${import.meta.env.BASE_URL}${ENGINE_DIR}`, globalThis.location?.href ?? "http://localhost/").href;
|
|
80
|
+
const revisions = expected?.revisions;
|
|
81
|
+
if (!expected || !revisions || !digest || !store || !scope || FILES.some((f) => !revisions[f]))
|
|
82
|
+
return { ok: false, reason: "unavailable" };
|
|
83
|
+
const cacheName = `${PRECACHE_PREFIX}${scope}`;
|
|
84
|
+
// Never create the precache: without the worker's own cache there is
|
|
85
|
+
// nothing for a repaired entry to replace.
|
|
86
|
+
if (!(await safely(() => store.has(cacheName))))
|
|
87
|
+
return { ok: false, reason: "unavailable" };
|
|
88
|
+
const doFetch = opts.fetch ?? ((url, init) => fetch(url, init));
|
|
89
|
+
// Fetch and check all three first; nothing is written until every file is right.
|
|
90
|
+
const fresh = [];
|
|
91
|
+
for (const name of FILES) {
|
|
92
|
+
const url = new URL(name, engineBase).href;
|
|
93
|
+
const networkUrl = new URL(url);
|
|
94
|
+
networkUrl.searchParams.set(NETWORK_PARAM, String(Date.now()));
|
|
95
|
+
let res;
|
|
96
|
+
let body;
|
|
97
|
+
try {
|
|
98
|
+
res = await doFetch(networkUrl.href, { cache: "reload" });
|
|
99
|
+
if (res.status !== 200 || res.redirected)
|
|
100
|
+
return { ok: false, reason: "fetch", file: name };
|
|
101
|
+
body = new Uint8Array(await res.arrayBuffer());
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return { ok: false, reason: "fetch", file: name };
|
|
105
|
+
}
|
|
106
|
+
if (!(await fits(name, body, expected, digest))) {
|
|
107
|
+
// The server may already serve a newer game than this shell: ask the
|
|
108
|
+
// worker to look for it, so the player is not left with only Reload.
|
|
109
|
+
await requestUpdate(opts);
|
|
110
|
+
return { ok: false, reason: "mismatch", file: name };
|
|
111
|
+
}
|
|
112
|
+
fresh.push({ name, key: precacheKey(url, revisions[name]), body, type: res.headers.get("content-type") ?? "" });
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
const cache = await store.open(cacheName);
|
|
116
|
+
for (const f of fresh)
|
|
117
|
+
await cache.put(f.key, new Response(f.body, { status: 200, headers: f.type ? { "content-type": f.type } : {} }));
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
return { ok: false, reason: "cache" };
|
|
121
|
+
}
|
|
122
|
+
await requestUpdate(opts);
|
|
123
|
+
return { ok: true, written: fresh.map((f) => f.name) };
|
|
124
|
+
}
|
|
125
|
+
/** One registration update check, so a newer deployment's worker can install.
|
|
126
|
+
* A failure here changes no outcome. */
|
|
127
|
+
async function requestUpdate(opts) {
|
|
128
|
+
try {
|
|
129
|
+
await opts.update?.();
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
/* the outcome stands */
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function safely(f) {
|
|
136
|
+
try {
|
|
137
|
+
return await f();
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/** Whether `body` is the file this shell was built for. */
|
|
144
|
+
async function fits(name, body, expected, digest) {
|
|
145
|
+
try {
|
|
146
|
+
if (name === ENGINE_BUILD_RECORD) {
|
|
147
|
+
const parsed = parseEngineRecord(new TextDecoder().decode(body));
|
|
148
|
+
if (!parsed.ok || parsed.record.package !== expected.package)
|
|
149
|
+
return false;
|
|
150
|
+
// The loader recomputes the id from the entries, so repair does too:
|
|
151
|
+
// a record with the right id and damaged entries would be refused again.
|
|
152
|
+
return hex(await digest(new TextEncoder().encode(canonicalFilesJson(parsed.record.files)))) === parsed.record.package;
|
|
153
|
+
}
|
|
154
|
+
const want = expected.files[name];
|
|
155
|
+
return !!want && body.length === want.bytes && hex(await digest(body)) === want.sha256;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** Ask the page's registration for one update check. */
|
|
162
|
+
async function updateRegistration() {
|
|
163
|
+
await (await navigator.serviceWorker?.getRegistration())?.update();
|
|
164
|
+
}
|
|
165
|
+
/** What the stop screen says about a finished repair attempt. A failure always
|
|
166
|
+
* says nothing was changed, and Repair stays available for another try. */
|
|
167
|
+
function repairMessage(result) {
|
|
168
|
+
if (result.ok)
|
|
169
|
+
return "Engine files repaired. Press Reload to try again.";
|
|
170
|
+
switch (result.reason) {
|
|
171
|
+
case "fetch":
|
|
172
|
+
return "Could not download the engine files. Nothing was changed. Check your connection and try again.";
|
|
173
|
+
case "mismatch":
|
|
174
|
+
return "The server sent engine files that do not match this version of the game. Nothing was changed. If the game was just updated, wait a moment and reload.";
|
|
175
|
+
case "cache":
|
|
176
|
+
return "This browser would not store all the engine files. Some may have been replaced. Try Repair again or Reload.";
|
|
177
|
+
default:
|
|
178
|
+
return "Repair is not available here. Nothing was changed.";
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { pageControlled, precacheKey, repairEnginePackage, repairMessage, repairOffered, updateRegistration };
|
|
183
|
+
//# sourceMappingURL=engineRepair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineRepair.js","sources":["../../src/wasmhost/engineRepair.ts"],"sourcesContent":["import { ENGINE_BUILD_RECORD, ENGINE_DIR, ENGINE_GLUE, ENGINE_WASM } from \"./enginePackageNames\";\nimport { browserDigest, isControlled, type VerifyOptions } from \"./enginePackageCheck\";\nimport { canonicalFilesJson, parseEngineRecord, type ExpectedEnginePackage } from \"./enginePackageRecord\";\nimport type { EngineBootFailure } from \"./engineBoot\";\n\n/**\n * Repair engine files (#985, design 5.4 \"Corrupted-entry recovery\"). A normal\n * Reload does not fix a corrupted entry in Cache Storage: Workbox checks\n * integrity on a network fetch and returns a cache hit as stored. Repair\n * fetches the three engine files from the network (with a parameter the\n * worker's precache route does not match, since a plain fetch of the engine\n * URL would be answered from the damaged entry), checks them against the\n * digests this shell was built with, and only then writes them over the cache\n * keys of the running build: the three engine URLs of this deployment with the\n * Workbox revision the shell was built for. It touches no other key, so a\n * waiting worker's entries (other revisions), the shell and audio entries,\n * IndexedDB, localStorage and saves are left alone, and it never deletes\n * first. All three files are fetched and checked before any is written, so a\n * failed fetch or digest leaves every old entry as it was. A write that fails\n * partway (a full quota) can leave earlier ones replaced; each was checked.\n *\n * Permanent host infrastructure: the wasm-only build relies on it.\n */\n\n/** Workbox names the precache `workbox-precache-v2-` plus the worker's scope. */\nconst PRECACHE_PREFIX = \"workbox-precache-v2-\";\n/** The URL parameter Workbox adds to a revisioned entry's cache key. */\nconst REVISION_PARAM = \"__WB_REVISION__\";\n/** A parameter the precache route does not ignore, so the controlling worker\n * lets the request through to the network instead of answering from the bad\n * entry. The static host ignores it. */\nconst NETWORK_PARAM = \"vc-repair\";\nconst FILES = [ENGINE_GLUE, ENGINE_WASM, ENGINE_BUILD_RECORD] as const;\n\nexport type RepairFailure =\n /** No worker scope, no Cache Storage, or no revisions compiled into the shell. */\n | \"unavailable\"\n /** A file did not arrive from the network (offline, an HTTP error, a redirect). */\n | \"fetch\"\n /** A file arrived but is not the one this shell was built for. */\n | \"mismatch\"\n /** The browser would not store the files. */\n | \"cache\";\n\nexport type RepairResult = { ok: true; written: string[] } | { ok: false; reason: RepairFailure; file?: string };\n\nexport interface RepairOptions {\n /** The package the shell was built with (default: the compiled-in one). */\n expected?: ExpectedEnginePackage | null;\n /** The folder URL the engine files are served from (default: beside the glue). */\n engineBase?: string;\n /** The controlling worker's scope; read from the registration when absent. */\n scope?: string;\n // Test seams; the browser supplies each by default.\n fetch?: (url: string, init: { cache: \"reload\" }) => Promise<Response>;\n digest?: VerifyOptions[\"digest\"];\n caches?: Pick<CacheStorage, \"open\" | \"has\">;\n /** Asked for one registration update after a repair. */\n update?: () => Promise<unknown>;\n}\n\nconst hex = (bytes: Uint8Array) => Array.from(bytes, (b) => b.toString(16).padStart(2, \"0\")).join(\"\");\n\n/** Whether the stop screen offers Repair: a worker controls the page and the\n * failure is files that did not match or did not arrive. Not for a timeout, an\n * insecure connection or a package that cannot save towers, which a fresh copy\n * of the files does not change. */\nexport function repairOffered(failure: EngineBootFailure, controlled: boolean): boolean {\n if (!controlled || failure.stage !== \"load\" || failure.cause !== undefined) return false;\n const pkg = failure.package;\n // A build published without an engine package has nothing to repair from.\n if (pkg && pkg.expectedPackage === null) return false;\n if (pkg) return pkg.kind === \"mismatch\" || pkg.kind === \"load-failed\";\n // No package detail: a glue and binary that fail to link are a mismatch.\n // Any other untyped load failure (a compile error, an out-of-memory)\n // happens with correct files, which a fresh copy does not change.\n return failure.reason === \"package-mismatch\";\n}\n\n/** The page's own check of whether a worker controls it. */\nexport function pageControlled(): boolean {\n return typeof navigator !== \"undefined\" && isControlled(navigator);\n}\n\n/** The cache key Workbox uses for a revisioned precache entry. */\nexport function precacheKey(url: string, revision: string): string {\n const key = new URL(url);\n key.searchParams.set(REVISION_PARAM, revision);\n return key.href;\n}\n\nasync function currentScope(): Promise<string | undefined> {\n try {\n return (await navigator.serviceWorker?.getRegistration())?.scope;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Replace the running build's three engine cache entries with fresh, checked\n * bytes. Never throws: every outcome is in the result. Does not reload or\n * activate a worker.\n */\nexport async function repairEnginePackage(opts: RepairOptions = {}): Promise<RepairResult> {\n const expected = opts.expected === undefined ? __ENGINE_PACKAGE__ : opts.expected;\n const digest = \"digest\" in opts ? opts.digest : browserDigest();\n const store = opts.caches ?? (typeof caches === \"undefined\" ? undefined : caches);\n const scope = opts.scope ?? (await currentScope());\n const engineBase = opts.engineBase ?? new URL(`${import.meta.env.BASE_URL}${ENGINE_DIR}`, globalThis.location?.href ?? \"http://localhost/\").href;\n const revisions = expected?.revisions;\n if (!expected || !revisions || !digest || !store || !scope || FILES.some((f) => !revisions[f])) return { ok: false, reason: \"unavailable\" };\n const cacheName = `${PRECACHE_PREFIX}${scope}`;\n // Never create the precache: without the worker's own cache there is\n // nothing for a repaired entry to replace.\n if (!(await safely(() => store.has(cacheName)))) return { ok: false, reason: \"unavailable\" };\n const doFetch = opts.fetch ?? ((url, init) => fetch(url, init));\n\n // Fetch and check all three first; nothing is written until every file is right.\n const fresh: Array<{ name: string; key: string; body: Uint8Array; type: string }> = [];\n for (const name of FILES) {\n const url = new URL(name, engineBase).href;\n const networkUrl = new URL(url);\n networkUrl.searchParams.set(NETWORK_PARAM, String(Date.now()));\n let res: Response;\n let body: Uint8Array;\n try {\n res = await doFetch(networkUrl.href, { cache: \"reload\" });\n if (res.status !== 200 || res.redirected) return { ok: false, reason: \"fetch\", file: name };\n body = new Uint8Array(await res.arrayBuffer());\n } catch {\n return { ok: false, reason: \"fetch\", file: name };\n }\n if (!(await fits(name, body, expected, digest))) {\n // The server may already serve a newer game than this shell: ask the\n // worker to look for it, so the player is not left with only Reload.\n await requestUpdate(opts);\n return { ok: false, reason: \"mismatch\", file: name };\n }\n fresh.push({ name, key: precacheKey(url, revisions[name]), body, type: res.headers.get(\"content-type\") ?? \"\" });\n }\n\n try {\n const cache = await store.open(cacheName);\n for (const f of fresh) await cache.put(f.key, new Response(f.body as BufferSource, { status: 200, headers: f.type ? { \"content-type\": f.type } : {} }));\n } catch {\n return { ok: false, reason: \"cache\" };\n }\n await requestUpdate(opts);\n return { ok: true, written: fresh.map((f) => f.name) };\n}\n\n/** One registration update check, so a newer deployment's worker can install.\n * A failure here changes no outcome. */\nasync function requestUpdate(opts: RepairOptions): Promise<void> {\n try {\n await opts.update?.();\n } catch {\n /* the outcome stands */\n }\n}\n\nasync function safely(f: () => Promise<boolean>): Promise<boolean> {\n try {\n return await f();\n } catch {\n return false;\n }\n}\n\n/** Whether `body` is the file this shell was built for. */\nasync function fits(name: string, body: Uint8Array, expected: ExpectedEnginePackage, digest: NonNullable<VerifyOptions[\"digest\"]>): Promise<boolean> {\n try {\n if (name === ENGINE_BUILD_RECORD) {\n const parsed = parseEngineRecord(new TextDecoder().decode(body));\n if (!parsed.ok || parsed.record.package !== expected.package) return false;\n // The loader recomputes the id from the entries, so repair does too:\n // a record with the right id and damaged entries would be refused again.\n return hex(await digest(new TextEncoder().encode(canonicalFilesJson(parsed.record.files)))) === parsed.record.package;\n }\n const want = expected.files[name];\n return !!want && body.length === want.bytes && hex(await digest(body)) === want.sha256;\n } catch {\n return false;\n }\n}\n\n/** Ask the page's registration for one update check. */\nexport async function updateRegistration(): Promise<void> {\n await (await navigator.serviceWorker?.getRegistration())?.update();\n}\n\n/** What the stop screen says about a finished repair attempt. A failure always\n * says nothing was changed, and Repair stays available for another try. */\nexport function repairMessage(result: RepairResult): string {\n if (result.ok) return \"Engine files repaired. Press Reload to try again.\";\n switch (result.reason) {\n case \"fetch\":\n return \"Could not download the engine files. Nothing was changed. Check your connection and try again.\";\n case \"mismatch\":\n return \"The server sent engine files that do not match this version of the game. Nothing was changed. If the game was just updated, wait a moment and reload.\";\n case \"cache\":\n return \"This browser would not store all the engine files. Some may have been replaced. Try Repair again or Reload.\";\n default:\n return \"Repair is not available here. Nothing was changed.\";\n }\n}\n"],"names":[],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;AAiBG;AAEH;AACA,MAAM,eAAe,GAAG,sBAAsB;AAC9C;AACA,MAAM,cAAc,GAAG,iBAAiB;AACxC;;AAEyC;AACzC,MAAM,aAAa,GAAG,WAAW;AACjC,MAAM,KAAK,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,mBAAmB,CAAU;AA6BtE,MAAM,GAAG,GAAG,CAAC,KAAiB,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AAErG;;;AAGoC;AAC9B,SAAU,aAAa,CAAC,OAA0B,EAAE,UAAmB,EAAA;AAC3E,IAAA,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;AAAE,QAAA,OAAO,KAAK;AACxF,IAAA,MAAM,GAAG,GAAG,OAAO,CAAC,OAA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CAAC;QACjC,OAAO,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,MAAM;IACxF;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;AAEA;AACO,eAAe,kBAAkB,GAAA;AACtC,IAAA,MAAM,CAAC,MAAM,SAAS,CAAC,aAAa,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE;AACpE;AAEA;AAC4E;AACtE,SAAU,aAAa,CAAC,MAAoB,EAAA;IAChD,IAAI,MAAM,CAAC,EAAE;AAAE,QAAA,OAAO,mDAAmD;AACzE,IAAA,QAAQ,MAAM,CAAC,MAAM;AACnB,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,gGAAgG;AACzG,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,uJAAuJ;AAChK,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,6GAA6G;AACtH,QAAA;AACE,YAAA,OAAO,oDAAoD;;AAEjE;;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Person, PersonState } from "../shared/engineTypes";
|
|
2
|
+
import type { Transport, Unit, UnitState, WeatherKind } from "../shared/types";
|
|
3
|
+
/**
|
|
4
|
+
* The engine's per-frame read model, decoded from the flat number array
|
|
5
|
+
* `Engine.frameView()` returns. The layout is fixed by `frame_view` in
|
|
6
|
+
* `engine-rs/src/frame.rs`; the header slots and the record widths here
|
|
7
|
+
* mirror it one for one.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FRAME_HEADER = 26;
|
|
10
|
+
export declare const PERSON_STATES: readonly PersonState[];
|
|
11
|
+
export declare const UNIT_STATES: readonly UnitState[];
|
|
12
|
+
export declare const WEATHERS: readonly WeatherKind[];
|
|
13
|
+
/** The header: the tower fields the engine sends every frame, named as the
|
|
14
|
+
* read model names them so a merge is a plain assignment, plus the tower
|
|
15
|
+
* revisions, the log cursor, and the record counts that follow. */
|
|
16
|
+
export interface FrameHeader {
|
|
17
|
+
money: number;
|
|
18
|
+
/** 1 to 5 stars, 6 for TOWER. */
|
|
19
|
+
star: number;
|
|
20
|
+
weather: WeatherKind;
|
|
21
|
+
santaFxSeq: number;
|
|
22
|
+
explosionFx: {
|
|
23
|
+
floor: number;
|
|
24
|
+
x: number;
|
|
25
|
+
seq: number;
|
|
26
|
+
};
|
|
27
|
+
thiefFx: {
|
|
28
|
+
caught: boolean;
|
|
29
|
+
floor: number;
|
|
30
|
+
seq: number;
|
|
31
|
+
};
|
|
32
|
+
treasureFx: {
|
|
33
|
+
floor: number;
|
|
34
|
+
x: number;
|
|
35
|
+
seq: number;
|
|
36
|
+
};
|
|
37
|
+
vipFxSeq: number;
|
|
38
|
+
onHourRuns: number;
|
|
39
|
+
logSeq: number;
|
|
40
|
+
revision: number;
|
|
41
|
+
mealOverlayRevision: number;
|
|
42
|
+
minutes: number;
|
|
43
|
+
counts: {
|
|
44
|
+
fires: number;
|
|
45
|
+
firesGutRooms: number;
|
|
46
|
+
bombs: number;
|
|
47
|
+
};
|
|
48
|
+
pending: boolean;
|
|
49
|
+
people: number;
|
|
50
|
+
units: number;
|
|
51
|
+
transports: number;
|
|
52
|
+
}
|
|
53
|
+
/** The fixed slots of a person record, before its route (`floors`, then
|
|
54
|
+
* `shafts`); mirrors `PERSON_FIXED` in `engine-rs/src/frame.rs`. */
|
|
55
|
+
export declare const PERSON_FIXED = 18;
|
|
56
|
+
/** The routines the engine tags a person with, by the code it sends (0 is
|
|
57
|
+
* none; the engine sends 255 for a routine it has no code for, which the
|
|
58
|
+
* decoder rejects with every other unknown code). */
|
|
59
|
+
export declare const ROUTINES: readonly NonNullable<Person["routine"]>[];
|
|
60
|
+
/** The per-frame slice of a {@link Person}: its position and state, and the
|
|
61
|
+
* routing the suites and the panels read (the origin and venue units, the
|
|
62
|
+
* meal intent, the routine tag, the return leg, the dwell timer, the route).
|
|
63
|
+
* `staff` is always present in a frame (the engine sends 0 or 1) where the
|
|
64
|
+
* instance keeps it optional; the optional unit ids and the timer are
|
|
65
|
+
* undefined when the engine sends -1, as on the instance. */
|
|
66
|
+
export type PersonRecord = Pick<Person, "id" | "seed" | "state" | "floor" | "x" | "fy" | "wait" | "originFloor" | "originUnitId" | "venueUnitId" | "mealVenueId" | "countedHotelGuest" | "routine" | "returning" | "dwellSecondsLeft" | "floors" | "shafts"> & {
|
|
67
|
+
staff: boolean;
|
|
68
|
+
};
|
|
69
|
+
/** The per-frame slice of a {@link Unit}: the counters the engine keeps for
|
|
70
|
+
* the unit's kind; an absent one reads undefined, as on the instance. */
|
|
71
|
+
export type UnitRecord = Pick<Unit, "id" | "state" | "occupants" | "customersIn" | "hotelCustomersIn" | "outForMeal">;
|
|
72
|
+
/** The per-frame slice of a {@link Transport}: the car positions, loads, and
|
|
73
|
+
* directions the renderer animates. */
|
|
74
|
+
export type TransportRecord = Pick<Transport, "id" | "cars" | "carPositions" | "carLoad" | "carDir">;
|
|
75
|
+
export interface FrameView {
|
|
76
|
+
header: FrameHeader;
|
|
77
|
+
people: PersonRecord[];
|
|
78
|
+
units: UnitRecord[];
|
|
79
|
+
transports: TransportRecord[];
|
|
80
|
+
}
|
|
81
|
+
export declare function enumAt<T>(table: readonly T[], code: number, what: string): T;
|
|
82
|
+
/** Decode the header alone. Throws when the array is shorter than the
|
|
83
|
+
* header, or a count or an enum code in it is bad. */
|
|
84
|
+
export declare function decodeHeader(v: ArrayLike<number>): FrameHeader;
|
|
85
|
+
/** Decode one frame view. Throws when the array is shorter than its
|
|
86
|
+
* header says, so a binding that changed its layout fails by name. */
|
|
87
|
+
export declare function decodeFrame(v: ArrayLike<number>): FrameView;
|