@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 @@
|
|
|
1
|
+
{"version":3,"file":"engineBoot.js","sources":["../../src/wasmhost/engineBoot.ts"],"sourcesContent":["import type { WasmModule } from \"../engineBinding/binding\";\nimport { EnginePackageError, type PackageFailureDetail, type PackageFailureKind } from \"./enginePackageCheck\";\nimport { readEngineIdentity } from \"./engineIdentity\";\nimport type { BuildMetadataResult } from \"./buildSection\";\n\n/**\n * How boot gets its engine. Boot always loads the WASM package, and a package\n * that fails to load or lacks a part the game needs is a failure that stops\n * boot: there is no other engine to fall back to.\n *\n * The result is published on `window.__vcEngineBoot` so a tester, the e2e\n * suites and a support session can read which build this is, which engine it\n * runs and why it stopped, without a console handle into the sim.\n */\nexport type BootEngine = \"wasm\" | \"ts\" | \"none\";\nexport type BootStage = \"load\" | \"start\" | \"host\";\n\n/**\n * Why the engine fell back (or, in a wasm-only build, stopped), as a code from\n * a closed list. The code is what analytics and the host status report\n * (`engine_status`, `docs/analytics-data-map.md`); the message beside it stays\n * on the console and the boot state and is never put in that event, since an\n * engine message can quote a tower name or a path.\n *\n * Boot sends the first six, plus `other` for a boot step outside the engine\n * that failed after the host took the tower (the host is let go). The\n * runtime fallback (#874) sends the trap codes for a running engine's fault\n * in a command (the undo capture's save just before an edit included), a\n * tick, a frame sync or the event drain, or an undo or redo, and `other` for\n * a save or the reads when a tower is let go. A trap in the engine's save\n * writer (#1205) is `trap-save`, and one in the slot census that loads a save\n * into a short-lived engine (#1612) is `trap-census`.\n */\nexport const FALLBACK_REASONS = [\"none\", \"boot-timeout\", \"boot-error\", \"package-mismatch\", \"unverifiable\", \"attach-refused\", \"trap-command\", \"trap-tick\", \"trap-undo\", \"trap-save\", \"trap-census\", \"other\"] as const;\nexport type FallbackReason = (typeof FALLBACK_REASONS)[number];\n\n/** Where a fallback happened: loading the package, starting the host on the\n * first tower, or a later tower the host was handed (a load or a new game,\n * or an undo restore). Closed like {@link FALLBACK_REASONS}. A running\n * engine's fault (#874) takes the stage of how its tower was hosted, so the\n * trap code says which path failed and the stage on which kind of tower. */\nexport const FALLBACK_STAGES = [\"none\", \"load\", \"start\", \"adopt\", \"undo\"] as const;\nexport type FallbackStage = (typeof FALLBACK_STAGES)[number];\n\n/** Why the byte check refused the engine package, as plain data (so a worker\n * can send it): the kind, the file, both package ids and whether a service\n * worker controlled the page (#985). Hex ids and codes only; the boot state\n * carries it for tooling and support, and analytics never does. */\nexport type PackageFailure = PackageFailureDetail & { kind: PackageFailureKind };\n\nexport interface EngineBootFailure {\n stage: BootStage;\n /** The code analytics reports; never derived from `message`. */\n reason: FallbackReason;\n message: string;\n /** Set when the byte check refused the package. */\n package?: PackageFailure;\n /** Set for a cause with no code of its own in the closed list, so the\n * screen can word it without reading `message`. */\n cause?: \"no-save-writer\";\n}\n\n/** A boot failure that already knows its code: the load's time limit, a\n * package that does not match this shell. Anything else on the way to a\n * running engine is `boot-error` (see {@link bootFailureReason}). */\nexport class EngineBootError extends Error {\n readonly reason: FallbackReason;\n readonly package?: PackageFailure;\n constructor(reason: FallbackReason, message: string, pkg?: PackageFailure) {\n super(message);\n this.name = \"EngineBootError\";\n this.reason = reason;\n if (pkg) this.package = pkg;\n }\n}\n\n/** The message a wasm-only build logs and records when the package has no\n * save writer. It reads as a developer note, so the screen words the cause\n * from the failure's `cause` instead. */\nconst NO_SAVE_WRITER_MESSAGE = \"the engine package has no save writer (encodeVctower); rebuild it\";\n\n/** The codes a failed load can carry: the rest of the closed list is for a\n * fault in a running engine or for no fault at all. */\nexport const LOAD_FAILURE_REASONS: readonly FallbackReason[] = [\"boot-error\", \"package-mismatch\", \"unverifiable\", \"boot-timeout\"];\n\nconst PACKAGE_KINDS: readonly string[] = [\"mismatch\", \"load-failed\", \"unverifiable\"];\nconst PACKAGE_FILES: readonly string[] = [\"glue\", \"wasm\", \"build-record\"];\nconst hexId = (v: unknown): string | null => (typeof v === \"string\" && /^[0-9a-f]{12}$/.test(v) ? v : null);\n\n/** A package detail that came across a worker message, rebuilt from known\n * values only: the kind and file from their lists, the ids as 12 hex digits.\n * Anything else is dropped, so the boot state never carries free text from a\n * message. Undefined when there is no usable kind. */\nexport function cleanPackageFailure(raw: unknown): PackageFailure | undefined {\n if (typeof raw !== \"object\" || raw === null) return undefined;\n const p = raw as Record<string, unknown>;\n if (typeof p.kind !== \"string\" || !PACKAGE_KINDS.includes(p.kind)) return undefined;\n return {\n kind: p.kind as PackageFailureKind,\n file: typeof p.file === \"string\" && PACKAGE_FILES.includes(p.file) ? (p.file as PackageFailure[\"file\"]) : null,\n expected: hexId(p.expected),\n found: hexId(p.found),\n expectedPackage: hexId(p.expectedPackage),\n servedPackage: hexId(p.servedPackage),\n controlled: p.controlled === true,\n };\n}\n\n/** A worker's account of the binary's build section, rebuilt from known\n * values (a state from the list, a 64-digit hash, a short reason), so the\n * boot state never carries free text from a message. Undefined for anything\n * else. */\nexport function cleanBuildMetadata(raw: unknown): BuildMetadataResult | undefined {\n if (typeof raw !== \"object\" || raw === null) return undefined;\n const b = raw as Record<string, unknown>;\n if (b.state === \"missing\") return { state: \"missing\" };\n if (b.state === \"ok\") return typeof b.sourceHash === \"string\" && /^[0-9a-f]{64}$/.test(b.sourceHash) ? { state: \"ok\", sourceHash: b.sourceHash } : undefined;\n if (b.state === \"malformed\") return { state: \"malformed\", why: typeof b.why === \"string\" ? b.why.slice(0, 120) : \"\" };\n return undefined;\n}\n\n/** The code for a refused package. A set that disagrees with the shell is a\n * mismatch, a browser that cannot hash the files is `unverifiable` (the files\n * may be fine; neither sits in the fault rate), and files that did not arrive\n * are a `boot-error`. */\nexport function packageFailureReason(kind: PackageFailureKind): FallbackReason {\n if (kind === \"mismatch\") return \"package-mismatch\";\n return kind === \"unverifiable\" ? \"unverifiable\" : \"boot-error\";\n}\n\n/** The code for a failure on the way to a running engine. A glue and binary\n * from different builds fail to link: that is a package mismatch, and the\n * engine itself may be sound. Every other untyped failure is `boot-error`. */\nexport function bootFailureReason(e: unknown): FallbackReason {\n if (e instanceof EngineBootError) return e.reason;\n if (e instanceof EnginePackageError) return packageFailureReason(e.kind);\n if (typeof WebAssembly !== \"undefined\" && e instanceof WebAssembly.LinkError) return \"package-mismatch\";\n return \"boot-error\";\n}\n\n/** The package detail of a failure, when the byte check refused the package. */\nexport function packageFailureOf(e: unknown): PackageFailure | undefined {\n if (e instanceof EnginePackageError) return { kind: e.kind, ...e.detail };\n if (e instanceof EngineBootError) return e.package;\n return undefined;\n}\n\nconst messageOf = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n\n/** A boot failure built from what was thrown. */\nexport function bootFailure(stage: BootStage, e: unknown): EngineBootFailure {\n const pkg = packageFailureOf(e);\n return { stage, reason: bootFailureReason(e), message: messageOf(e), ...(pkg ? { package: pkg } : {}) };\n}\n\nexport interface EngineBootState {\n build: \"wasm-only\" | \"switchable\";\n /** The engine boot settled on: \"none\" once a wasm-only build has failed. */\n engine: BootEngine;\n failure: EngineBootFailure | null;\n /** Set once the engine save writer has turned itself off this page life\n * (`vctowerWriter.ts`); absent until then. */\n writerLatched?: true;\n /** The engine's identity record as the loaded package reports it\n * (`engineIdentity()`, #963), for About and Copy Diagnostics. Absent when\n * no engine loaded or the package has no such call, and until the record\n * is read after boot (`settleEngineIdentity`, #1254). */\n identity?: string;\n /** What the engine binary's `verticopolis.build` section said (#963): the\n * hash of the Rust sources it was built from, `missing` or `malformed`.\n * Absent when the binary was never read (a TypeScript boot, or a load that\n * failed before the binary compiled). Read even when the engine then\n * failed to link, so About can say which build the failed binary was. */\n binary?: BuildMetadataResult;\n}\n\nexport interface EngineBootOptions {\n /** Loads the engine. The signal fires at the time limit; the loader checks\n * it after each step and drops a result that arrives later. `onBuild` gets\n * the binary's build metadata as soon as it is read, so a failure later in\n * the load still reports it. */\n load: (signal: AbortSignal, onBuild: (build: BuildMetadataResult) => void) => Promise<WasmModule>;\n log?: Pick<Console, \"error\">;\n /** How long the load may take before boot gives up on it (ms). */\n timeoutMs?: number;\n}\n\n/** The load's limit when the caller sets none. Generous: a first visit on a\n * slow connection downloads the whole engine; an installed game reads it\n * from the precache in milliseconds. Without a limit, a stalled fetch would\n * leave a wasm-only boot on a blank page with no message. */\nexport const ENGINE_LOAD_TIMEOUT_MS = 90_000;\n\nfunction withTimeout<T>(work: Promise<T>, ms: number, expire: () => void): Promise<T> {\n return new Promise<T>((done, fail) => {\n const seconds = Math.round(ms / 1000);\n const timer = setTimeout(() => {\n // The attempt is terminal before the timeout is published.\n expire();\n fail(new EngineBootError(\"boot-timeout\", `the engine package did not load within ${seconds} ${seconds === 1 ? \"second\" : \"seconds\"}`));\n }, ms);\n work.then(\n (v) => {\n clearTimeout(timer);\n done(v);\n },\n (e: unknown) => {\n clearTimeout(timer);\n fail(e);\n },\n );\n });\n}\n\nexport interface EngineBootResult {\n module: WasmModule | null;\n state: EngineBootState;\n}\n\n/** Load the WASM engine for boot. Never throws: a failure is in the state. */\nexport async function loadBootEngine(opts: EngineBootOptions): Promise<EngineBootResult> {\n const log = opts.log ?? console;\n const build = \"wasm-only\";\n let mod: WasmModule;\n let binary: BuildMetadataResult | undefined;\n const binaryField = () => (binary === undefined ? {} : { binary });\n try {\n const attempt = new AbortController();\n mod = await withTimeout(opts.load(attempt.signal, (b) => (binary = b)), opts.timeoutMs ?? ENGINE_LOAD_TIMEOUT_MS, () => attempt.abort());\n } catch (e) {\n log.error(\"[wasm] the engine package did not load, and this build has no other engine:\", e);\n return { module: null, state: { build, engine: \"none\", failure: bootFailure(\"load\", e), ...binaryField() } };\n }\n // Saves go through the engine's own writer (#935), so a package without one\n // cannot run the game.\n if (!mod.encodeVctower) {\n const message = NO_SAVE_WRITER_MESSAGE;\n log.error(`[wasm] ${message}`);\n return { module: null, state: { build, engine: \"none\", failure: { stage: \"load\", reason: \"package-mismatch\", message, cause: \"no-save-writer\" }, ...binaryField() } };\n }\n return { module: mod, state: { build, engine: \"wasm\", failure: null, ...binaryField() } };\n}\n\n/** The loaded engine's identity read, until it runs (`deferEngineIdentity`). */\nlet pendingIdentity: (() => string | undefined) | null = null;\n/** The identity record once read; publishBootState carries it from then on. */\nlet settledIdentity: string | undefined;\n\n/** Leave the engine's identity record (#963) for later (#1254). Reading it\n * hashes both catalogs inside the engine, a cost the boot used to pay before\n * the title screen. Boot hands the loaded module over here instead, and the\n * record is read once: when About, Settings or Copy Diagnostics first asks\n * for it (`settleEngineIdentity`), or after the first frame. */\nexport function deferEngineIdentity(mod: Pick<WasmModule, \"engineIdentity\">): void {\n pendingIdentity = () => readEngineIdentity(mod);\n settledIdentity = undefined;\n}\n\n/** Read the deferred identity record if it has not been read, and publish it\n * on the boot state. Does nothing once read, or when no engine loaded. */\nexport function settleEngineIdentity(g: { __vcEngineBoot?: EngineBootState } = globalThis as { __vcEngineBoot?: EngineBootState }): void {\n const read = pendingIdentity;\n if (!read) return;\n pendingIdentity = null;\n settledIdentity = read();\n if (g.__vcEngineBoot) publishBootState(g.__vcEngineBoot, g);\n}\n\n/** Mark a boot that loaded its engine but could not start or keep it. */\nexport function failBoot(state: EngineBootState, stage: BootStage, reason: FallbackReason, message: string): EngineBootState {\n return { ...state, engine: \"none\", failure: { stage, reason, message } };\n}\n\n/** Publish the boot state for tooling, tests and support, with the engine's\n * identity record once it has been read (`settleEngineIdentity`). */\nexport function publishBootState(state: EngineBootState, g: { __vcEngineBoot?: EngineBootState } = globalThis as { __vcEngineBoot?: EngineBootState }): void {\n g.__vcEngineBoot = settledIdentity === undefined || state.identity !== undefined ? state : { ...state, identity: settledIdentity };\n}\n\n/** What the player is told when a wasm-only build cannot run its engine: what\n * happened, the reason, and what to try, in order. Plain data, so the boot\n * overlay renders it and the tests read it. */\nexport interface EngineFailureCopy {\n headline: string;\n reason: string;\n steps: string[];\n}\n\nconst FILE_LABEL: Record<string, string> = { glue: \"the engine glue file\", wasm: \"the engine binary\", \"build-record\": \"the build record\" };\n\n/** The sentence the player reads for a refused or failed engine load (#985),\n * one per cause, from the failure's code, cause and package detail. Every\n * failure at the load stage has one; a start or host failure has none and\n * its message stands. */\nfunction loadFailureSentence(failure: EngineBootFailure, online: boolean, secure: boolean): string | null {\n if (failure.stage !== \"load\") return null;\n const pkg = failure.package;\n if (failure.cause === \"no-save-writer\") return \"The engine cannot save towers. Reload after the game is updated.\";\n if (failure.reason === \"boot-timeout\") return \"The engine took too long to load. Try Reload when your connection is ready.\";\n if (failure.reason === \"unverifiable\" || pkg?.kind === \"unverifiable\") {\n return secure ? \"This browser could not check the engine files. Try Reload, or try another browser.\" : \"This browser connection cannot verify the engine files. Open the game using HTTPS.\";\n }\n if (failure.reason === \"package-mismatch\" && pkg?.kind !== \"load-failed\") {\n const id = (v: string | null | undefined) => v ?? \"unavailable\";\n // The same package id on both sides means one file differs from the record.\n const detail =\n pkg?.expectedPackage && pkg.expectedPackage === pkg.servedPackage\n ? `${FILE_LABEL[pkg.file ?? \"\"] ?? \"an engine file\"} differs from the record`\n : `expected ${id(pkg?.expectedPackage)}, found ${id(pkg?.servedPackage)}`;\n return `The engine files do not match this version of the game. The engine was not started. (${detail})`;\n }\n if (pkg?.kind === \"load-failed\" && pkg.expectedPackage === null) {\n return \"The engine files could not be loaded. This version of the game was published without them, so a corrected deployment is needed.\";\n }\n return online ? \"The engine files could not be loaded. Try Reload.\" : \"The engine files could not be loaded. Connect to the internet and try Reload.\";\n}\n\n/** What the stop screen knows beyond the failure: whether the page is on a\n * secure connection, and whether it offers Repair engine files. */\nexport interface EngineFailureContext {\n secure?: boolean;\n repair?: boolean;\n}\n\nexport function engineFailureCopy(failure: EngineBootFailure, online: boolean, context: EngineFailureContext = {}): EngineFailureCopy {\n const { secure = true, repair = false } = context;\n const host = failure.stage === \"host\";\n const headline = host ? \"The game engine stopped running this tower, so the game has stopped.\" : \"The game engine could not start, so the game cannot run.\";\n const sentence = loadFailureSentence(failure, online, secure);\n // Over an insecure connection a reload cannot help; the first step is HTTPS.\n const insecure = failure.stage === \"load\" && !secure && (failure.reason === \"unverifiable\" || failure.package?.kind === \"unverifiable\");\n let first = \"Reload the page to try again. Your saved towers stay in this browser.\";\n if (host) first = \"Reload the page to continue from your last save. Changes since that save may be lost.\";\n else if (insecure) first = \"Open the game using HTTPS, then reload. Your saved towers stay in this browser.\";\n const steps = [first];\n if (repair) {\n steps.push(\n online\n ? \"If Reload does not help, press Repair engine files to download a fresh copy, then reload.\"\n : \"Connect to the internet before repairing engine files. Then press Repair engine files and reload.\",\n );\n }\n if (!online && !insecure) {\n steps.push(\"You appear to be offline. If the game was updated since this device last opened it, connect to the internet and reload once so the new engine can download.\");\n }\n steps.push(\"If it keeps happening, update your browser or try another one.\");\n return { headline, reason: sentence ?? failure.message, steps };\n}\n"],"names":[],"mappings":";;;AAiBA;;;;;;;;;;;;;;;AAeG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO;AAG1M;;;;AAI6E;AACtE,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;AAqBxE;;AAEsE;AAChE,MAAO,eAAgB,SAAQ,KAAK,CAAA;AAGxC,IAAA,WAAA,CAAY,MAAsB,EAAE,OAAe,EAAE,GAAoB,EAAA;QACvE,KAAK,CAAC,OAAO,CAAC;AACd,QAAA,IAAI,CAAC,IAAI,GAAG,iBAAiB;AAC7B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AACpB,QAAA,IAAI,GAAG;AAAE,YAAA,IAAI,CAAC,OAAO,GAAG,GAAG;IAC7B;AACD;AAED;;AAE0C;AAC1C,MAAM,sBAAsB,GAAG,mEAAmE;AAElG;AACwD;AACjD,MAAM,oBAAoB,GAA8B,CAAC,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,cAAc;AAEhI,MAAM,aAAa,GAAsB,CA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
* rows. The game always runs the Rust engine now; the other names stay in the
|
|
4
|
+
* type so rows from older builds keep their meaning.
|
|
5
|
+
*/
|
|
6
|
+
export type EngineChoice = "ts" | "wasm" | "wasm-frame" | "wasm-worker";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineChoice.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { EngineBootState } from "./engineBoot";
|
|
2
|
+
import { type EngineIdentity } from "./engineIdentity";
|
|
3
|
+
import { type ExpectedEnginePackage } from "./enginePackageRecord";
|
|
4
|
+
import type { BuildMetadataResult } from "./buildSection";
|
|
5
|
+
/**
|
|
6
|
+
* The engine diagnostics report (#963): one plain-data answer to "which build
|
|
7
|
+
* and which engine was that?" for About and its Copy Diagnostics button. It
|
|
8
|
+
* joins the app version, the engine boot settled on, the host's status, what
|
|
9
|
+
* the shell was built to run (`__ENGINE_PACKAGE__`) and the record the engine
|
|
10
|
+
* itself reports. Every input is optional, so the report builds, and copies,
|
|
11
|
+
* when the engine never loaded.
|
|
12
|
+
*
|
|
13
|
+
* Two hashes appear and are different facts. The package id is a SHA-256 over
|
|
14
|
+
* the digests of the served glue and compiled binary (it says which files
|
|
15
|
+
* these are). The source hash is the hash of the Rust sources the binary was
|
|
16
|
+
* built from, stamped into the binary's `verticopolis.build` section by the
|
|
17
|
+
* build (it says which engine code those files came from). The core engine
|
|
18
|
+
* does not carry it, so a missing or malformed section leaves the engine
|
|
19
|
+
* running and the source hash unavailable.
|
|
20
|
+
*
|
|
21
|
+
* The text carries versions, codes, digests, the browser and the engine's own
|
|
22
|
+
* error text. It holds no save and no player data, but an engine error message
|
|
23
|
+
* can quote a tower name (a hand-edited save controls it), so it is something
|
|
24
|
+
* the player sends on purpose, never something the page sends by itself.
|
|
25
|
+
* About's Report a problem puts it in the GitHub link it opens on the player's
|
|
26
|
+
* click (src/ui/bugReport.ts), where the player reviews it before submitting.
|
|
27
|
+
*/
|
|
28
|
+
export type DiagnosticsState = "ok" | "not-running" | "not-loaded" | "mismatch" | "unavailable";
|
|
29
|
+
export interface DiagnosticsRow {
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
}
|
|
33
|
+
export interface DiagnosticsReport {
|
|
34
|
+
state: DiagnosticsState;
|
|
35
|
+
/** One sentence for the top of the block. */
|
|
36
|
+
summary: string;
|
|
37
|
+
rows: DiagnosticsRow[];
|
|
38
|
+
/** The rows as `Label: value` lines under a heading, for the clipboard. */
|
|
39
|
+
text: string;
|
|
40
|
+
}
|
|
41
|
+
export interface DiagnosticsHost {
|
|
42
|
+
hosted?: boolean;
|
|
43
|
+
lastError?: string | null;
|
|
44
|
+
droppedErrors?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface DiagnosticsInput {
|
|
47
|
+
appVersion: string;
|
|
48
|
+
appSha?: string;
|
|
49
|
+
/** `window.__vcEngineBoot`. */
|
|
50
|
+
boot?: EngineBootState;
|
|
51
|
+
/** `window.__vcEngine.status`. */
|
|
52
|
+
host?: DiagnosticsHost;
|
|
53
|
+
/** `__ENGINE_PACKAGE__`: what this shell was built to run. */
|
|
54
|
+
expected?: ExpectedEnginePackage | null;
|
|
55
|
+
/** `navigator.userAgent` and the time of the report, for a support ticket. */
|
|
56
|
+
userAgent?: string;
|
|
57
|
+
date?: string;
|
|
58
|
+
}
|
|
59
|
+
/** The source hash the binary was stamped with against the one this page was
|
|
60
|
+
* built for, or null when they agree or either is unknown. It needs only the
|
|
61
|
+
* binary and the page's record, so a package that fails to link, or reports no
|
|
62
|
+
* identity, still gets it. */
|
|
63
|
+
export declare function sourceMismatch(expected: ExpectedEnginePackage | null | undefined, build: BuildMetadataResult | undefined): string | null;
|
|
64
|
+
/** The fields the engine's record and the shell's build record disagree on. */
|
|
65
|
+
export declare function identityMismatches(identity: EngineIdentity, expected: ExpectedEnginePackage | null | undefined, build?: BuildMetadataResult): string[];
|
|
66
|
+
export declare function buildDiagnostics(input: DiagnosticsInput): DiagnosticsReport;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { parseEngineIdentity } from './engineIdentity.js';
|
|
2
|
+
import { shortId } from './enginePackageRecord.js';
|
|
3
|
+
|
|
4
|
+
/** An engine message can be long; the clipboard text keeps the start. */
|
|
5
|
+
const MESSAGE_CAP = 300;
|
|
6
|
+
const cap = (s) => s.length > MESSAGE_CAP ? `${s.slice(0, MESSAGE_CAP)}...` : s;
|
|
7
|
+
/** One row is one line of the clipboard text, so a message that spans lines
|
|
8
|
+
* (a stack, a multi-line engine error) is folded onto one. */
|
|
9
|
+
const oneLine = (s) => s.replace(/\s*[\r\n]+\s*/g, " ");
|
|
10
|
+
/** The source hash the binary was stamped with against the one this page was
|
|
11
|
+
* built for, or null when they agree or either is unknown. It needs only the
|
|
12
|
+
* binary and the page's record, so a package that fails to link, or reports no
|
|
13
|
+
* identity, still gets it. */
|
|
14
|
+
function sourceMismatch(expected, build) {
|
|
15
|
+
if (build?.state !== "ok" || !expected?.sources)
|
|
16
|
+
return null;
|
|
17
|
+
if (build.sourceHash === expected.sources)
|
|
18
|
+
return null;
|
|
19
|
+
return `source hash (engine binary ${shortId(build.sourceHash)}, this page was built for ${shortId(expected.sources)})`;
|
|
20
|
+
}
|
|
21
|
+
/** The fields the engine's record and the shell's build record disagree on. */
|
|
22
|
+
function identityMismatches(identity, expected, build) {
|
|
23
|
+
const out = [];
|
|
24
|
+
const crate = expected?.crate;
|
|
25
|
+
if (crate && crate.name !== identity.crate.name)
|
|
26
|
+
out.push(`crate name (engine ${identity.crate.name}, this page was built for ${crate.name})`);
|
|
27
|
+
if (crate && crate.version !== identity.crate.version)
|
|
28
|
+
out.push(`crate version (engine ${identity.crate.version}, this page was built for ${crate.version})`);
|
|
29
|
+
const source = sourceMismatch(expected, build);
|
|
30
|
+
if (source)
|
|
31
|
+
out.push(source);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
/** Why the source hash cannot be shown, or null when it can (or was not read). */
|
|
35
|
+
function buildUnavailable(build) {
|
|
36
|
+
if (build?.state === "missing")
|
|
37
|
+
return "its binary carries no build metadata section";
|
|
38
|
+
if (build?.state === "malformed")
|
|
39
|
+
return `its build metadata section is malformed (${build.why})`;
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
function buildValue(build) {
|
|
43
|
+
if (build.state === "ok")
|
|
44
|
+
return shortId(build.sourceHash);
|
|
45
|
+
if (build.state === "missing")
|
|
46
|
+
return "unavailable (no build metadata section)";
|
|
47
|
+
return `unavailable (malformed: ${build.why})`;
|
|
48
|
+
}
|
|
49
|
+
/** Whether the current tower runs on the Rust engine. The host's status is the
|
|
50
|
+
* authority when there is one: a later tower can be hosted after the first
|
|
51
|
+
* was refused, and a tower can stop with no boot failure recorded. The boot
|
|
52
|
+
* state decides only when no host handle exists. */
|
|
53
|
+
function wasmRunning(input) {
|
|
54
|
+
if (input.host)
|
|
55
|
+
return !!input.host.hosted;
|
|
56
|
+
return input.boot?.engine === "wasm" && !input.boot.failure;
|
|
57
|
+
}
|
|
58
|
+
/** The Rust engine is the only engine (#1875), so a tower it does not run has
|
|
59
|
+
* no engine running at all. */
|
|
60
|
+
function engineName(input) {
|
|
61
|
+
return wasmRunning(input) ? "Rust engine" : "not running";
|
|
62
|
+
}
|
|
63
|
+
/** The sentence for an engine that is not running, by where it stopped. */
|
|
64
|
+
function failureSummary(stage) {
|
|
65
|
+
const WHAT = {
|
|
66
|
+
host: "The Rust engine stopped after a fault",
|
|
67
|
+
start: "The Rust engine did not take the first tower",
|
|
68
|
+
};
|
|
69
|
+
const what = WHAT[stage] ?? "The Rust engine did not load";
|
|
70
|
+
return `${what}, and this build has no other engine.`;
|
|
71
|
+
}
|
|
72
|
+
function buildDiagnostics(input) {
|
|
73
|
+
const { boot, host, expected } = input;
|
|
74
|
+
const failure = boot?.failure ?? null;
|
|
75
|
+
const identity = parseEngineIdentity(boot?.identity);
|
|
76
|
+
const running = wasmRunning(input);
|
|
77
|
+
const mismatches = identity
|
|
78
|
+
? identityMismatches(identity, expected, boot?.binary)
|
|
79
|
+
: [sourceMismatch(expected, boot?.binary)].filter((m) => m !== null);
|
|
80
|
+
const noBuild = buildUnavailable(boot?.binary);
|
|
81
|
+
// "Matches" is claimed only when a comparison ran.
|
|
82
|
+
const compared = (!!identity && !!expected?.crate) ||
|
|
83
|
+
(boot?.binary?.state === "ok" && !!expected?.sources);
|
|
84
|
+
let state;
|
|
85
|
+
let summary;
|
|
86
|
+
if (!running && failure) {
|
|
87
|
+
state = "not-loaded";
|
|
88
|
+
summary = failureSummary(failure.stage);
|
|
89
|
+
}
|
|
90
|
+
else if (!running) {
|
|
91
|
+
state = "not-running";
|
|
92
|
+
summary = "The Rust engine is not running this tower.";
|
|
93
|
+
}
|
|
94
|
+
else if (mismatches.length > 0) {
|
|
95
|
+
state = "mismatch";
|
|
96
|
+
summary = "The Rust engine does not match the build this page expected.";
|
|
97
|
+
}
|
|
98
|
+
else if (!identity) {
|
|
99
|
+
state = "unavailable";
|
|
100
|
+
summary =
|
|
101
|
+
"The Rust engine is running, but this package does not report its identity.";
|
|
102
|
+
}
|
|
103
|
+
else if (noBuild) {
|
|
104
|
+
state = "unavailable";
|
|
105
|
+
summary = `The Rust engine is running, but ${noBuild}, so its source hash is unavailable.`;
|
|
106
|
+
}
|
|
107
|
+
else if (compared) {
|
|
108
|
+
state = "ok";
|
|
109
|
+
summary = "The Rust engine is running and matches this build.";
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
state = "ok";
|
|
113
|
+
summary =
|
|
114
|
+
"The Rust engine is running. This page has no build record to compare it with.";
|
|
115
|
+
}
|
|
116
|
+
const rows = [
|
|
117
|
+
{
|
|
118
|
+
label: "App",
|
|
119
|
+
value: `v${input.appVersion}${input.appSha ? ` (${input.appSha})` : ""}`,
|
|
120
|
+
},
|
|
121
|
+
];
|
|
122
|
+
if (input.date)
|
|
123
|
+
rows.push({ label: "Date", value: input.date });
|
|
124
|
+
if (input.userAgent)
|
|
125
|
+
rows.push({ label: "Browser", value: cap(input.userAgent) });
|
|
126
|
+
// No "Build" row: every build runs the Rust engine alone (#1875), so the
|
|
127
|
+
// boot state's bundle kind always read "wasm-only" and told a player nothing.
|
|
128
|
+
rows.push({ label: "Engine in use", value: engineName(input) });
|
|
129
|
+
if (failure) {
|
|
130
|
+
rows.push({ label: "Failed at", value: failure.stage });
|
|
131
|
+
rows.push({ label: "Reason", value: failure.reason });
|
|
132
|
+
rows.push({ label: "Detail", value: cap(failure.message) });
|
|
133
|
+
}
|
|
134
|
+
if (host?.lastError)
|
|
135
|
+
rows.push({ label: "Last engine error", value: cap(host.lastError) });
|
|
136
|
+
if (host?.droppedErrors)
|
|
137
|
+
rows.push({ label: "Errors not kept", value: String(host.droppedErrors) });
|
|
138
|
+
if (expected) {
|
|
139
|
+
rows.push({
|
|
140
|
+
label: "Package id this page expects",
|
|
141
|
+
value: shortId(expected.package),
|
|
142
|
+
});
|
|
143
|
+
if (expected.sources)
|
|
144
|
+
rows.push({
|
|
145
|
+
label: "Source hash this page expects",
|
|
146
|
+
value: shortId(expected.sources),
|
|
147
|
+
});
|
|
148
|
+
if (expected.crate)
|
|
149
|
+
rows.push({
|
|
150
|
+
label: "Crate this page expects",
|
|
151
|
+
value: `${expected.crate.name} ${expected.crate.version}`,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (boot?.binary)
|
|
155
|
+
rows.push({
|
|
156
|
+
label: "Source hash in the engine binary",
|
|
157
|
+
value: buildValue(boot.binary),
|
|
158
|
+
});
|
|
159
|
+
if (identity) {
|
|
160
|
+
rows.push({
|
|
161
|
+
label: "Engine crate",
|
|
162
|
+
value: `${identity.crate.name} ${identity.crate.version}`,
|
|
163
|
+
});
|
|
164
|
+
rows.push({
|
|
165
|
+
label: "Save version",
|
|
166
|
+
value: `${identity.saveVersion} (loads back to ${identity.oldestSaveVersion})`,
|
|
167
|
+
});
|
|
168
|
+
rows.push({
|
|
169
|
+
label: "Frame layout",
|
|
170
|
+
value: String(identity.frameLayoutVersion),
|
|
171
|
+
});
|
|
172
|
+
rows.push({
|
|
173
|
+
label: "Catalog",
|
|
174
|
+
value: `${identity.catalogVersion} (classic ${identity.catalogDigests.classic}, modern ${identity.catalogDigests.modern})`,
|
|
175
|
+
});
|
|
176
|
+
rows.push({ label: "Conformance lock", value: identity.lockDigest });
|
|
177
|
+
}
|
|
178
|
+
for (const m of mismatches)
|
|
179
|
+
rows.push({ label: "Mismatch", value: m });
|
|
180
|
+
const text = [
|
|
181
|
+
"Verticopolis diagnostics",
|
|
182
|
+
oneLine(summary),
|
|
183
|
+
...rows.map((r) => `${r.label}: ${oneLine(r.value)}`),
|
|
184
|
+
].join("\n");
|
|
185
|
+
return { state, summary, rows, text };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { buildDiagnostics, identityMismatches, sourceMismatch };
|
|
189
|
+
//# sourceMappingURL=engineDiagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineDiagnostics.js","sources":["../../src/wasmhost/engineDiagnostics.ts"],"sourcesContent":["import type { EngineBootState } from \"./engineBoot\";\nimport { parseEngineIdentity, type EngineIdentity } from \"./engineIdentity\";\nimport { shortId, type ExpectedEnginePackage } from \"./enginePackageRecord\";\nimport type { BuildMetadataResult } from \"./buildSection\";\n\n/**\n * The engine diagnostics report (#963): one plain-data answer to \"which build\n * and which engine was that?\" for About and its Copy Diagnostics button. It\n * joins the app version, the engine boot settled on, the host's status, what\n * the shell was built to run (`__ENGINE_PACKAGE__`) and the record the engine\n * itself reports. Every input is optional, so the report builds, and copies,\n * when the engine never loaded.\n *\n * Two hashes appear and are different facts. The package id is a SHA-256 over\n * the digests of the served glue and compiled binary (it says which files\n * these are). The source hash is the hash of the Rust sources the binary was\n * built from, stamped into the binary's `verticopolis.build` section by the\n * build (it says which engine code those files came from). The core engine\n * does not carry it, so a missing or malformed section leaves the engine\n * running and the source hash unavailable.\n *\n * The text carries versions, codes, digests, the browser and the engine's own\n * error text. It holds no save and no player data, but an engine error message\n * can quote a tower name (a hand-edited save controls it), so it is something\n * the player sends on purpose, never something the page sends by itself.\n * About's Report a problem puts it in the GitHub link it opens on the player's\n * click (src/ui/bugReport.ts), where the player reviews it before submitting.\n */\nexport type DiagnosticsState =\n | \"ok\"\n | \"not-running\"\n | \"not-loaded\"\n | \"mismatch\"\n | \"unavailable\";\n\nexport interface DiagnosticsRow {\n label: string;\n value: string;\n}\n\nexport interface DiagnosticsReport {\n state: DiagnosticsState;\n /** One sentence for the top of the block. */\n summary: string;\n rows: DiagnosticsRow[];\n /** The rows as `Label: value` lines under a heading, for the clipboard. */\n text: string;\n}\n\nexport interface DiagnosticsHost {\n hosted?: boolean;\n lastError?: string | null;\n droppedErrors?: number;\n}\n\nexport interface DiagnosticsInput {\n appVersion: string;\n appSha?: string;\n /** `window.__vcEngineBoot`. */\n boot?: EngineBootState;\n /** `window.__vcEngine.status`. */\n host?: DiagnosticsHost;\n /** `__ENGINE_PACKAGE__`: what this shell was built to run. */\n expected?: ExpectedEnginePackage | null;\n /** `navigator.userAgent` and the time of the report, for a support ticket. */\n userAgent?: string;\n date?: string;\n}\n\n/** An engine message can be long; the clipboard text keeps the start. */\nconst MESSAGE_CAP = 300;\n\nconst cap = (s: string): string =>\n s.length > MESSAGE_CAP ? `${s.slice(0, MESSAGE_CAP)}...` : s;\n\n/** One row is one line of the clipboard text, so a message that spans lines\n * (a stack, a multi-line engine error) is folded onto one. */\nconst oneLine = (s: string): string => s.replace(/\\s*[\\r\\n]+\\s*/g, \" \");\n\n/** The source hash the binary was stamped with against the one this page was\n * built for, or null when they agree or either is unknown. It needs only the\n * binary and the page's record, so a package that fails to link, or reports no\n * identity, still gets it. */\nexport function sourceMismatch(\n expected: ExpectedEnginePackage | null | undefined,\n build: BuildMetadataResult | undefined,\n): string | null {\n if (build?.state !== \"ok\" || !expected?.sources) return null;\n if (build.sourceHash === expected.sources) return null;\n return `source hash (engine binary ${shortId(build.sourceHash)}, this page was built for ${shortId(expected.sources)})`;\n}\n\n/** The fields the engine's record and the shell's build record disagree on. */\nexport function identityMismatches(\n identity: EngineIdentity,\n expected: ExpectedEnginePackage | null | undefined,\n build?: BuildMetadataResult,\n): string[] {\n const out: string[] = [];\n const crate = expected?.crate;\n if (crate && crate.name !== identity.crate.name)\n out.push(\n `crate name (engine ${identity.crate.name}, this page was built for ${crate.name})`,\n );\n if (crate && crate.version !== identity.crate.version)\n out.push(\n `crate version (engine ${identity.crate.version}, this page was built for ${crate.version})`,\n );\n const source = sourceMismatch(expected, build);\n if (source) out.push(source);\n return out;\n}\n\n/** Why the source hash cannot be shown, or null when it can (or was not read). */\nfunction buildUnavailable(build: BuildMetadataResult | undefined): string | null {\n if (build?.state === \"missing\")\n return \"its binary carries no build metadata section\";\n if (build?.state === \"malformed\")\n return `its build metadata section is malformed (${build.why})`;\n return null;\n}\n\nfunction buildValue(build: BuildMetadataResult): string {\n if (build.state === \"ok\") return shortId(build.sourceHash);\n if (build.state === \"missing\") return \"unavailable (no build metadata section)\";\n return `unavailable (malformed: ${build.why})`;\n}\n\n/** Whether the current tower runs on the Rust engine. The host's status is the\n * authority when there is one: a later tower can be hosted after the first\n * was refused, and a tower can stop with no boot failure recorded. The boot\n * state decides only when no host handle exists. */\nfunction wasmRunning(input: DiagnosticsInput): boolean {\n if (input.host) return !!input.host.hosted;\n return input.boot?.engine === \"wasm\" && !input.boot.failure;\n}\n\n/** The Rust engine is the only engine (#1875), so a tower it does not run has\n * no engine running at all. */\nfunction engineName(input: DiagnosticsInput): string {\n return wasmRunning(input) ? \"Rust engine\" : \"not running\";\n}\n\n/** The sentence for an engine that is not running, by where it stopped. */\nfunction failureSummary(stage: string): string {\n const WHAT: Record<string, string> = {\n host: \"The Rust engine stopped after a fault\",\n start: \"The Rust engine did not take the first tower\",\n };\n const what = WHAT[stage] ?? \"The Rust engine did not load\";\n return `${what}, and this build has no other engine.`;\n}\n\nexport function buildDiagnostics(input: DiagnosticsInput): DiagnosticsReport {\n const { boot, host, expected } = input;\n const failure = boot?.failure ?? null;\n const identity = parseEngineIdentity(boot?.identity);\n const running = wasmRunning(input);\n const mismatches = identity\n ? identityMismatches(identity, expected, boot?.binary)\n : [sourceMismatch(expected, boot?.binary)].filter(\n (m): m is string => m !== null,\n );\n const noBuild = buildUnavailable(boot?.binary);\n // \"Matches\" is claimed only when a comparison ran.\n const compared =\n (!!identity && !!expected?.crate) ||\n (boot?.binary?.state === \"ok\" && !!expected?.sources);\n\n let state: DiagnosticsState;\n let summary: string;\n if (!running && failure) {\n state = \"not-loaded\";\n summary = failureSummary(failure.stage);\n } else if (!running) {\n state = \"not-running\";\n summary = \"The Rust engine is not running this tower.\";\n } else if (mismatches.length > 0) {\n state = \"mismatch\";\n summary = \"The Rust engine does not match the build this page expected.\";\n } else if (!identity) {\n state = \"unavailable\";\n summary =\n \"The Rust engine is running, but this package does not report its identity.\";\n } else if (noBuild) {\n state = \"unavailable\";\n summary = `The Rust engine is running, but ${noBuild}, so its source hash is unavailable.`;\n } else if (compared) {\n state = \"ok\";\n summary = \"The Rust engine is running and matches this build.\";\n } else {\n state = \"ok\";\n summary =\n \"The Rust engine is running. This page has no build record to compare it with.\";\n }\n\n const rows: DiagnosticsRow[] = [\n {\n label: \"App\",\n value: `v${input.appVersion}${input.appSha ? ` (${input.appSha})` : \"\"}`,\n },\n ];\n if (input.date) rows.push({ label: \"Date\", value: input.date });\n if (input.userAgent)\n rows.push({ label: \"Browser\", value: cap(input.userAgent) });\n // No \"Build\" row: every build runs the Rust engine alone (#1875), so the\n // boot state's bundle kind always read \"wasm-only\" and told a player nothing.\n rows.push({ label: \"Engine in use\", value: engineName(input) });\n if (failure) {\n rows.push({ label: \"Failed at\", value: failure.stage });\n rows.push({ label: \"Reason\", value: failure.reason });\n rows.push({ label: \"Detail\", value: cap(failure.message) });\n }\n if (host?.lastError)\n rows.push({ label: \"Last engine error\", value: cap(host.lastError) });\n if (host?.droppedErrors)\n rows.push({ label: \"Errors not kept\", value: String(host.droppedErrors) });\n if (expected) {\n rows.push({\n label: \"Package id this page expects\",\n value: shortId(expected.package),\n });\n if (expected.sources)\n rows.push({\n label: \"Source hash this page expects\",\n value: shortId(expected.sources),\n });\n if (expected.crate)\n rows.push({\n label: \"Crate this page expects\",\n value: `${expected.crate.name} ${expected.crate.version}`,\n });\n }\n if (boot?.binary)\n rows.push({\n label: \"Source hash in the engine binary\",\n value: buildValue(boot.binary),\n });\n if (identity) {\n rows.push({\n label: \"Engine crate\",\n value: `${identity.crate.name} ${identity.crate.version}`,\n });\n rows.push({\n label: \"Save version\",\n value: `${identity.saveVersion} (loads back to ${identity.oldestSaveVersion})`,\n });\n rows.push({\n label: \"Frame layout\",\n value: String(identity.frameLayoutVersion),\n });\n rows.push({\n label: \"Catalog\",\n value: `${identity.catalogVersion} (classic ${identity.catalogDigests.classic}, modern ${identity.catalogDigests.modern})`,\n });\n rows.push({ label: \"Conformance lock\", value: identity.lockDigest });\n }\n for (const m of mismatches) rows.push({ label: \"Mismatch\", value: m });\n\n const text = [\n \"Verticopolis diagnostics\",\n oneLine(summary),\n ...rows.map((r) => `${r.label}: ${oneLine(r.value)}`),\n ].join(\"\\n\");\n return { state, summary, rows, text };\n}\n"],"names":[],"mappings":";;;AAqEA;AACA,MAAM,WAAW,GAAG,GAAG;AAEvB,MAAM,GAAG,GAAG,CAAC,CAAS,KACpB,CAAC,CAAC,MAAM,GAAG,WAAW,GAAG,CAAA,EAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAA,GAAA,CAAK,GAAG,CAAC;AAE9D;AAC+D;AAC/D,MAAM,OAAO,GAAG,CAAC,CAAS,KAAa,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;AAEvE;;;AAG+B;AACzB,SAAU,cAAc,CAC5B,QAAkD,EAClD,KAAsC,EAAA;IAEtC,IAAI,KAAK,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,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AA,EAAmB,QAAQ,CAAC,iBAAiB,CAAA,CAAA,CAAG;AAC/E,SAAA,CAAC;QACF,IAAI,CAAC,IAAI,CAAC;AACR,YAAA,KAAK,EAAE,cAAc;AACrB,YAAA,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;AAC3C,SAAA,CAAC;QACF,IAAI,CAAC,IAAI,CAAC;AACR,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,KAAK,EAAE,CAAA,EAAG,QAAQ,CAAC,cAAc,aAAa,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAA,SAAA,EAAY,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAA,CAAA,CAAG;AAC3H,SAAA,CAAC;AACF,QAAA,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC;IACtE;IACA,KAAK,MAAM,CAAC,IAAI,UAAU;AAAE,QAAA,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAEtE,IAAA,MAAM,IAAI,GAAG;QACX,0BAA0B;QAC1B,OAAO,CAAC,OAAO,CAAC;QAChB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAA,EAAG,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA,CAAE,CAAC;AACtD,KAAA,CAAC,IAAI,CAAC,IAAI,CAAC;IACZ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;AACvC;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type EngineBootState } from "./engineBoot";
|
|
2
|
+
import { type DiagnosticsHost, type DiagnosticsReport } from "./engineDiagnostics";
|
|
3
|
+
/** The page globals the report reads: what boot published and the host's handle. */
|
|
4
|
+
export interface DiagnosticsGlobals {
|
|
5
|
+
__vcEngineBoot?: EngineBootState;
|
|
6
|
+
__vcEngine?: {
|
|
7
|
+
status?: DiagnosticsHost;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** The report for the running page. Every source can be missing (a boot that
|
|
11
|
+
* never published, a build with no engine package), and a report that cannot
|
|
12
|
+
* be built at all comes back as an unavailable one with the reason, so this
|
|
13
|
+
* never throws: Copy diagnostics has to work when the engine is the thing
|
|
14
|
+
* that failed. */
|
|
15
|
+
export declare function liveDiagnostics(g?: DiagnosticsGlobals): DiagnosticsReport;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { settleEngineIdentity } from './engineBoot.js';
|
|
2
|
+
import { buildDiagnostics } from './engineDiagnostics.js';
|
|
3
|
+
|
|
4
|
+
/** The report for the running page. Every source can be missing (a boot that
|
|
5
|
+
* never published, a build with no engine package), and a report that cannot
|
|
6
|
+
* be built at all comes back as an unavailable one with the reason, so this
|
|
7
|
+
* never throws: Copy diagnostics has to work when the engine is the thing
|
|
8
|
+
* that failed. */
|
|
9
|
+
function liveDiagnostics(g = globalThis) {
|
|
10
|
+
try {
|
|
11
|
+
// Boot reads the engine's identity record after the first frame (#1254);
|
|
12
|
+
// a report asked for sooner reads it now.
|
|
13
|
+
settleEngineIdentity(g);
|
|
14
|
+
return buildDiagnostics({
|
|
15
|
+
appVersion: typeof __APP_VERSION__ !== "undefined" ? __APP_VERSION__ : "dev",
|
|
16
|
+
appSha: typeof __APP_SHA__ !== "undefined" ? __APP_SHA__ : undefined,
|
|
17
|
+
boot: g.__vcEngineBoot,
|
|
18
|
+
host: g.__vcEngine?.status,
|
|
19
|
+
expected: typeof __ENGINE_PACKAGE__ !== "undefined" ? __ENGINE_PACKAGE__ : null,
|
|
20
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : undefined,
|
|
21
|
+
date: new Date().toISOString(),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
const summary = `The report could not be built: ${e instanceof Error ? e.message : String(e)}`;
|
|
26
|
+
return { state: "unavailable", summary, rows: [], text: `Verticopolis diagnostics\n${summary}` };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { liveDiagnostics };
|
|
31
|
+
//# sourceMappingURL=engineDiagnosticsLive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineDiagnosticsLive.js","sources":["../../src/wasmhost/engineDiagnosticsLive.ts"],"sourcesContent":["import { settleEngineIdentity, type EngineBootState } from \"./engineBoot\";\nimport {\n buildDiagnostics,\n type DiagnosticsHost,\n type DiagnosticsReport,\n} from \"./engineDiagnostics\";\n\n/** The page globals the report reads: what boot published and the host's handle. */\nexport interface DiagnosticsGlobals {\n __vcEngineBoot?: EngineBootState;\n __vcEngine?: { status?: DiagnosticsHost };\n}\n\n/** The report for the running page. Every source can be missing (a boot that\n * never published, a build with no engine package), and a report that cannot\n * be built at all comes back as an unavailable one with the reason, so this\n * never throws: Copy diagnostics has to work when the engine is the thing\n * that failed. */\nexport function liveDiagnostics(\n g: DiagnosticsGlobals = globalThis as DiagnosticsGlobals,\n): DiagnosticsReport {\n try {\n // Boot reads the engine's identity record after the first frame (#1254);\n // a report asked for sooner reads it now.\n settleEngineIdentity(g);\n return buildDiagnostics({\n appVersion:\n typeof __APP_VERSION__ !== \"undefined\" ? __APP_VERSION__ : \"dev\",\n appSha: typeof __APP_SHA__ !== \"undefined\" ? __APP_SHA__ : undefined,\n boot: g.__vcEngineBoot,\n host: g.__vcEngine?.status,\n expected:\n typeof __ENGINE_PACKAGE__ !== \"undefined\" ? __ENGINE_PACKAGE__ : null,\n userAgent: typeof navigator !== \"undefined\" ? navigator.userAgent : undefined,\n date: new Date().toISOString(),\n });\n } catch (e) {\n const summary = `The report could not be built: ${e instanceof Error ? e.message : String(e)}`;\n return { state: \"unavailable\", summary, rows: [], text: `Verticopolis diagnostics\\n${summary}` };\n }\n}\n"],"names":[],"mappings":";;;AAaA;;;;AAImB;AACb,SAAU,eAAe,CAC7B,CAAA,GAAwB,UAAgC,EAAA;AAExD,IAAA,IAAI;;;QAGF,oBAAoB,CAAC,CAAC,CAAC;AACvB,QAAA,OAAO,gBAAgB,CAAC;AACtB,YAAA,UAAU,EACR,OAAO,eAAe,KAAK,WAAW,GAAG,eAAe,GAAG,KAAK;AAClE,YAAA,MAAM,EAAE,OAAO,WAAW,KAAK,WAAW,GAAG,WAAW,GAAG,SAAS;YACpE,IAAI,EAAE,CAAC,CAAC,cAAc;AACtB,YAAA,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM;AAC1B,YAAA,QAAQ,EACN,OAAO,kBAAkB,KAAK,WAAW,GAAG,kBAAkB,GAAG,IAAI;AACvE,YAAA,SAAS,EAAE,OAAO,SAAS,KAAK,WAAW,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS;AAC7E,YAAA,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC/B,SAAA,CAAC;IACJ;IAAE,OAAO,CAAC,EAAE;QACV,MAAM,OAAO,GAAG,CAAA,+BAAA,EAAkC,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE;AAC9F,QAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,6BAA6B,OAAO,CAAA,CAAE,EAAE;IAClG;AACF;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WasmModule } from "../engineBinding/binding";
|
|
2
|
+
/**
|
|
3
|
+
* The engine's own identity record (#963): which crate, which save, frame
|
|
4
|
+
* layout and catalog contracts, and the conformance lock the engine was built
|
|
5
|
+
* against. The Rust engine writes it (`engine-rs/src/identity.rs`); this file
|
|
6
|
+
* only reads it back, so no identity value is spelled in the frontend.
|
|
7
|
+
*/
|
|
8
|
+
export interface EngineIdentity {
|
|
9
|
+
schema: number;
|
|
10
|
+
crate: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
14
|
+
saveVersion: number;
|
|
15
|
+
oldestSaveVersion: number;
|
|
16
|
+
frameLayoutVersion: number;
|
|
17
|
+
catalogVersion: number;
|
|
18
|
+
catalogDigests: {
|
|
19
|
+
classic: string;
|
|
20
|
+
modern: string;
|
|
21
|
+
};
|
|
22
|
+
lockDigest: string;
|
|
23
|
+
}
|
|
24
|
+
/** The engine's record text, or undefined when the package has no such call
|
|
25
|
+
* or it throws. About reports the gap, so a missing identity never stops a
|
|
26
|
+
* boot. */
|
|
27
|
+
export declare function readEngineIdentity(mod: Pick<WasmModule, "engineIdentity">): string | undefined;
|
|
28
|
+
/** The record from its text, or null when the text is missing, is not JSON or
|
|
29
|
+
* lacks a field. A record from a newer schema with extra fields still reads. */
|
|
30
|
+
export declare function parseEngineIdentity(text: string | undefined): EngineIdentity | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** The engine's record text, or undefined when the package has no such call
|
|
2
|
+
* or it throws. About reports the gap, so a missing identity never stops a
|
|
3
|
+
* boot. */
|
|
4
|
+
function readEngineIdentity(mod) {
|
|
5
|
+
try {
|
|
6
|
+
return typeof mod.engineIdentity === "function"
|
|
7
|
+
? mod.engineIdentity()
|
|
8
|
+
: undefined;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const isString = (v) => typeof v === "string" && v.length > 0;
|
|
15
|
+
const isCount = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
16
|
+
const isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
17
|
+
/** The record from its text, or null when the text is missing, is not JSON or
|
|
18
|
+
* lacks a field. A record from a newer schema with extra fields still reads. */
|
|
19
|
+
function parseEngineIdentity(text) {
|
|
20
|
+
if (!text)
|
|
21
|
+
return null;
|
|
22
|
+
let raw;
|
|
23
|
+
try {
|
|
24
|
+
raw = JSON.parse(text);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (!isObject(raw) || !isObject(raw.crate) || !isObject(raw.catalogDigests))
|
|
30
|
+
return null;
|
|
31
|
+
const { schema, saveVersion, oldestSaveVersion, frameLayoutVersion, catalogVersion, lockDigest, } = raw;
|
|
32
|
+
const { name, version } = raw.crate;
|
|
33
|
+
const { classic, modern } = raw.catalogDigests;
|
|
34
|
+
if (!isCount(schema) ||
|
|
35
|
+
!isCount(saveVersion) ||
|
|
36
|
+
!isCount(oldestSaveVersion) ||
|
|
37
|
+
!isCount(frameLayoutVersion) ||
|
|
38
|
+
!isCount(catalogVersion))
|
|
39
|
+
return null;
|
|
40
|
+
if (!isString(lockDigest) ||
|
|
41
|
+
!isString(name) ||
|
|
42
|
+
!isString(version) ||
|
|
43
|
+
!isString(classic) ||
|
|
44
|
+
!isString(modern))
|
|
45
|
+
return null;
|
|
46
|
+
return {
|
|
47
|
+
schema,
|
|
48
|
+
crate: { name, version },
|
|
49
|
+
saveVersion,
|
|
50
|
+
oldestSaveVersion,
|
|
51
|
+
frameLayoutVersion,
|
|
52
|
+
catalogVersion,
|
|
53
|
+
catalogDigests: { classic, modern },
|
|
54
|
+
lockDigest,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { parseEngineIdentity, readEngineIdentity };
|
|
59
|
+
//# sourceMappingURL=engineIdentity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineIdentity.js","sources":["../../src/wasmhost/engineIdentity.ts"],"sourcesContent":["import type { WasmModule } from \"../engineBinding/binding\";\n\n/**\n * The engine's own identity record (#963): which crate, which save, frame\n * layout and catalog contracts, and the conformance lock the engine was built\n * against. The Rust engine writes it (`engine-rs/src/identity.rs`); this file\n * only reads it back, so no identity value is spelled in the frontend.\n */\nexport interface EngineIdentity {\n schema: number;\n crate: { name: string; version: string };\n saveVersion: number;\n oldestSaveVersion: number;\n frameLayoutVersion: number;\n catalogVersion: number;\n catalogDigests: { classic: string; modern: string };\n lockDigest: string;\n}\n\n/** The engine's record text, or undefined when the package has no such call\n * or it throws. About reports the gap, so a missing identity never stops a\n * boot. */\nexport function readEngineIdentity(\n mod: Pick<WasmModule, \"engineIdentity\">,\n): string | undefined {\n try {\n return typeof mod.engineIdentity === \"function\"\n ? mod.engineIdentity()\n : undefined;\n } catch {\n return undefined;\n }\n}\n\nconst isString = (v: unknown): v is string =>\n typeof v === \"string\" && v.length > 0;\nconst isCount = (v: unknown): v is number =>\n typeof v === \"number\" && Number.isInteger(v) && v >= 0;\nconst isObject = (v: unknown): v is Record<string, unknown> =>\n typeof v === \"object\" && v !== null && !Array.isArray(v);\n\n/** The record from its text, or null when the text is missing, is not JSON or\n * lacks a field. A record from a newer schema with extra fields still reads. */\nexport function parseEngineIdentity(\n text: string | undefined,\n): EngineIdentity | null {\n if (!text) return null;\n let raw: unknown;\n try {\n raw = JSON.parse(text);\n } catch {\n return null;\n }\n if (!isObject(raw) || !isObject(raw.crate) || !isObject(raw.catalogDigests))\n return null;\n const {\n schema,\n saveVersion,\n oldestSaveVersion,\n frameLayoutVersion,\n catalogVersion,\n lockDigest,\n } = raw;\n const { name, version } = raw.crate;\n const { classic, modern } = raw.catalogDigests;\n if (\n !isCount(schema) ||\n !isCount(saveVersion) ||\n !isCount(oldestSaveVersion) ||\n !isCount(frameLayoutVersion) ||\n !isCount(catalogVersion)\n )\n return null;\n if (\n !isString(lockDigest) ||\n !isString(name) ||\n !isString(version) ||\n !isString(classic) ||\n !isString(modern)\n )\n return null;\n return {\n schema,\n crate: { name, version },\n saveVersion,\n oldestSaveVersion,\n frameLayoutVersion,\n catalogVersion,\n catalogDigests: { classic, modern },\n lockDigest,\n };\n}\n"],"names":[],"mappings":"AAmBA;;AAEY;AACN,SAAU,kBAAkB,CAChC,GAAuC,EAAA;AAEvC,IAAA,IAA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AM,CAAC;QAChB,CAAC,OAAO,CAAC,WAAW,CAAC;QACrB,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAC3B,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAC5B,CAAC,OAAO,CAAC,cAAc,CAAC;AAExB,QAAA,OAAO,IAAI;AACb,IAAA,IACE,CAAC,QAAQ,CAAC,UAAU,CAAC;QACrB,CAAC,QAAQ,CAAC,IAAI,CAAC;QACf,CAAC,QAAQ,CAAC,OAAO,CAAC;QAClB,CAAC,QAAQ,CAAC,OAAO,CAAC;QAClB,CAAC,QAAQ,CAAC,MAAM,CAAC;AAEjB,QAAA,OAAO,IAAI;IACb,OAAO;QACL,MAAM;AACN,QAAA,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACxB,WAAW;QACX,iBAAiB;QACjB,kBAAkB;QAClB,cAAc;AACd,QAAA,cAAc,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACnC,UAAU;KACX;AACH;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type EngineBootState } from "./engineBoot";
|
|
2
|
+
/**
|
|
3
|
+
* The player-visible name of the engine running the simulation, for the
|
|
4
|
+
* version lines on the splash, Settings, and About this game, with the engine's
|
|
5
|
+
* own version and a short source hash (#1422): "v2.51.0 · Rust engine 0.20.0
|
|
6
|
+
* (1a2b3c4d5e6f)", so a player or tester can tell from the title screen which
|
|
7
|
+
* build of the engine they are on without opening the console. The Rust engine's version is the
|
|
8
|
+
* crate version its package reports and the hash is its binary's; either is
|
|
9
|
+
* left out when the package did not report it.
|
|
10
|
+
*/
|
|
11
|
+
interface EngineHandle {
|
|
12
|
+
status: {
|
|
13
|
+
hosted: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
interface LabelSource {
|
|
17
|
+
__vcEngine?: EngineHandle;
|
|
18
|
+
/** `window.__vcEngineBoot`: the identity and binary the Rust package reported. */
|
|
19
|
+
__vcEngineBoot?: Partial<Pick<EngineBootState, "identity" | "binary" | "build" | "engine">>;
|
|
20
|
+
}
|
|
21
|
+
/** The engine the current tower runs on: "wasm" while the WASM host has a
|
|
22
|
+
* tower attached, "ts" otherwise (including a WASM package that failed to
|
|
23
|
+
* load, which leaves the game on the TypeScript engine). */
|
|
24
|
+
export declare function activeEngine(g?: LabelSource): "ts" | "wasm";
|
|
25
|
+
/** The engine's name, version and short hash, as the version lines append it.
|
|
26
|
+
* The page's own suffix reads the engine's identity record first if boot left
|
|
27
|
+
* it for later (#1254), so Settings and About name the version. */
|
|
28
|
+
export declare function engineSuffix(g?: LabelSource): string;
|
|
29
|
+
/** The full version line: the app's `version` (the host passes its own,
|
|
30
|
+
* `APP_VERSION`), then the engine (`engineSuffix`). The title screen draws it while the game starts, so it does not read a
|
|
31
|
+
* deferred identity record: boot rewrites it once the record is read
|
|
32
|
+
* (`refreshSplashVersion`). */
|
|
33
|
+
export declare function versionLine(version: string, g?: LabelSource): string;
|
|
34
|
+
/** Rewrite an already-rendered splash version line once the engine's identity
|
|
35
|
+
* record is read after the first frame (#1254): the title screen mounts
|
|
36
|
+
* inside `create()`, before the record is read, so its template cannot name
|
|
37
|
+
* the engine's version at render time. Dialogs render later and read the
|
|
38
|
+
* suffix themselves. `version` is the app's, as `versionLine` takes it. */
|
|
39
|
+
export declare function refreshSplashVersion(version: string, doc?: Pick<Document, "querySelector">): void;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { settleEngineIdentity } from './engineBoot.js';
|
|
2
|
+
import { parseEngineIdentity } from './engineIdentity.js';
|
|
3
|
+
import { shortId } from './enginePackageRecord.js';
|
|
4
|
+
|
|
5
|
+
const pageSource = () => globalThis;
|
|
6
|
+
/** The engine the current tower runs on: "wasm" while the WASM host has a
|
|
7
|
+
* tower attached, "ts" otherwise (including a WASM package that failed to
|
|
8
|
+
* load, which leaves the game on the TypeScript engine). */
|
|
9
|
+
function activeEngine(g = pageSource()) {
|
|
10
|
+
return g.__vcEngine?.status.hosted ? "wasm" : "ts";
|
|
11
|
+
}
|
|
12
|
+
/** The engine's name, version and short hash, as the version lines append it.
|
|
13
|
+
* The page's own suffix reads the engine's identity record first if boot left
|
|
14
|
+
* it for later (#1254), so Settings and About name the version. */
|
|
15
|
+
function engineSuffix(g = pageSource()) {
|
|
16
|
+
if (g === pageSource())
|
|
17
|
+
settleEngineIdentity();
|
|
18
|
+
return suffixOf(g);
|
|
19
|
+
}
|
|
20
|
+
/** The suffix from what `g` holds now, without reading a deferred identity. */
|
|
21
|
+
function suffixOf(g) {
|
|
22
|
+
// The Rust engine is the only engine (#1875). A Rust engine that stopped
|
|
23
|
+
// after a trap reads `engine: "none"` until the reload, and says so.
|
|
24
|
+
const stopped = activeEngine(g) !== "wasm" && g.__vcEngineBoot?.engine === "none";
|
|
25
|
+
const version = parseEngineIdentity(g.__vcEngineBoot?.identity)?.crate.version;
|
|
26
|
+
const binary = g.__vcEngineBoot?.binary;
|
|
27
|
+
const hash = binary?.state === "ok" ? shortId(binary.sourceHash) : null;
|
|
28
|
+
const extras = [hash, stopped ? "stopped" : null].filter((x) => x !== null);
|
|
29
|
+
return ` · Rust engine${version ? ` ${version}` : ""}${extras.length > 0 ? ` (${extras.join(", ")})` : ""}`;
|
|
30
|
+
}
|
|
31
|
+
/** The full version line: the app's `version` (the host passes its own,
|
|
32
|
+
* `APP_VERSION`), then the engine (`engineSuffix`). The title screen draws it while the game starts, so it does not read a
|
|
33
|
+
* deferred identity record: boot rewrites it once the record is read
|
|
34
|
+
* (`refreshSplashVersion`). */
|
|
35
|
+
function versionLine(version, g = pageSource()) {
|
|
36
|
+
return `v${version}${suffixOf(g)}`;
|
|
37
|
+
}
|
|
38
|
+
/** Rewrite an already-rendered splash version line once the engine's identity
|
|
39
|
+
* record is read after the first frame (#1254): the title screen mounts
|
|
40
|
+
* inside `create()`, before the record is read, so its template cannot name
|
|
41
|
+
* the engine's version at render time. Dialogs render later and read the
|
|
42
|
+
* suffix themselves. `version` is the app's, as `versionLine` takes it. */
|
|
43
|
+
function refreshSplashVersion(version, doc = document) {
|
|
44
|
+
const el = doc.querySelector(".splash-version");
|
|
45
|
+
if (el)
|
|
46
|
+
el.textContent = versionLine(version);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { activeEngine, engineSuffix, refreshSplashVersion, versionLine };
|
|
50
|
+
//# sourceMappingURL=engineLabel.js.map
|