@escapeaihq/client-core 0.52.0 → 0.138.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/README.md +445 -153
- package/dist/adapters/capabilities.d.ts +20 -3
- package/dist/adapters/capabilities.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.d.ts +5 -4
- package/dist/adapters/directorAdapter.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.js +5 -4
- package/dist/adapters/directorAdapter.js.map +1 -1
- package/dist/adapters/experienceModelCatalog.d.ts +382 -0
- package/dist/adapters/experienceModelCatalog.d.ts.map +1 -0
- package/dist/adapters/experienceModelCatalog.js +401 -0
- package/dist/adapters/experienceModelCatalog.js.map +1 -0
- package/dist/adapters/extractionAdapter.d.ts +81 -0
- package/dist/adapters/extractionAdapter.d.ts.map +1 -0
- package/dist/adapters/extractionAdapter.js +98 -0
- package/dist/adapters/extractionAdapter.js.map +1 -0
- package/dist/adapters/imageAdapter.d.ts +5 -1
- package/dist/adapters/imageAdapter.d.ts.map +1 -1
- package/dist/adapters/imageAdapter.js +5 -1
- package/dist/adapters/imageAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +54 -16
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +62 -11
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/momentDirective.d.ts +66 -0
- package/dist/adapters/momentDirective.d.ts.map +1 -0
- package/dist/adapters/momentDirective.js +78 -0
- package/dist/adapters/momentDirective.js.map +1 -0
- package/dist/adapters/momentPolicy.d.ts +132 -0
- package/dist/adapters/momentPolicy.d.ts.map +1 -0
- package/dist/adapters/momentPolicy.js +165 -0
- package/dist/adapters/momentPolicy.js.map +1 -0
- package/dist/adapters/registry.d.ts +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/videoGenAdapter.d.ts +55 -0
- package/dist/adapters/videoGenAdapter.d.ts.map +1 -0
- package/dist/adapters/videoGenAdapter.js +78 -0
- package/dist/adapters/videoGenAdapter.js.map +1 -0
- package/dist/adapters/worldAdapter.d.ts +132 -11
- package/dist/adapters/worldAdapter.d.ts.map +1 -1
- package/dist/adapters/worldAdapter.js +127 -11
- package/dist/adapters/worldAdapter.js.map +1 -1
- package/dist/adapters/worldModelPreference.d.ts +173 -0
- package/dist/adapters/worldModelPreference.d.ts.map +1 -0
- package/dist/adapters/worldModelPreference.js +209 -0
- package/dist/adapters/worldModelPreference.js.map +1 -0
- package/dist/adapters/worldModelTradeoffs.d.ts +120 -0
- package/dist/adapters/worldModelTradeoffs.d.ts.map +1 -0
- package/dist/adapters/worldModelTradeoffs.js +154 -0
- package/dist/adapters/worldModelTradeoffs.js.map +1 -0
- package/dist/admin.d.ts +545 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +230 -16
- package/dist/admin.js.map +1 -1
- package/dist/api.d.ts +10281 -2216
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4174 -1240
- package/dist/api.js.map +1 -1
- package/dist/arcBoardJoin.d.ts +38 -0
- package/dist/arcBoardJoin.d.ts.map +1 -0
- package/dist/arcBoardJoin.js +37 -0
- package/dist/arcBoardJoin.js.map +1 -0
- package/dist/arcPreview.d.ts +49 -0
- package/dist/arcPreview.d.ts.map +1 -0
- package/dist/arcPreview.js +65 -0
- package/dist/arcPreview.js.map +1 -0
- package/dist/audio.d.ts +259 -16
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +605 -114
- package/dist/audio.js.map +1 -1
- package/dist/audioDsp.d.ts +45 -0
- package/dist/audioDsp.d.ts.map +1 -0
- package/dist/audioDsp.js +108 -0
- package/dist/audioDsp.js.map +1 -0
- package/dist/audioProtocol.d.ts +160 -0
- package/dist/audioProtocol.d.ts.map +1 -1
- package/dist/audioProtocol.js +99 -0
- package/dist/audioProtocol.js.map +1 -1
- package/dist/beatTitles.d.ts +33 -0
- package/dist/beatTitles.d.ts.map +1 -0
- package/dist/beatTitles.js +39 -0
- package/dist/beatTitles.js.map +1 -0
- package/dist/castProjection.d.ts +204 -1
- package/dist/castProjection.d.ts.map +1 -1
- package/dist/castProjection.js +202 -0
- package/dist/castProjection.js.map +1 -1
- package/dist/characterGrounding.d.ts +369 -0
- package/dist/characterGrounding.d.ts.map +1 -0
- package/dist/characterGrounding.js +408 -0
- package/dist/characterGrounding.js.map +1 -0
- package/dist/conversation/binding.d.ts +13 -0
- package/dist/conversation/binding.d.ts.map +1 -1
- package/dist/conversation/binding.js.map +1 -1
- package/dist/conversation/chatSessionStore.d.ts +178 -0
- package/dist/conversation/chatSessionStore.d.ts.map +1 -0
- package/dist/conversation/chatSessionStore.js +196 -0
- package/dist/conversation/chatSessionStore.js.map +1 -0
- package/dist/conversation/controller.d.ts +44 -0
- package/dist/conversation/controller.d.ts.map +1 -1
- package/dist/conversation/controller.js +82 -3
- package/dist/conversation/controller.js.map +1 -1
- package/dist/conversation/index.d.ts +2 -0
- package/dist/conversation/index.d.ts.map +1 -1
- package/dist/conversation/index.js +2 -0
- package/dist/conversation/index.js.map +1 -1
- package/dist/conversation/participant.d.ts +16 -0
- package/dist/conversation/participant.d.ts.map +1 -1
- package/dist/conversation/readSequencer.d.ts +38 -0
- package/dist/conversation/readSequencer.d.ts.map +1 -0
- package/dist/conversation/readSequencer.js +42 -0
- package/dist/conversation/readSequencer.js.map +1 -0
- package/dist/conversation/roster.d.ts +5 -1
- package/dist/conversation/roster.d.ts.map +1 -1
- package/dist/conversation/roster.js.map +1 -1
- package/dist/conversation/rosterProjection.d.ts +74 -1
- package/dist/conversation/rosterProjection.d.ts.map +1 -1
- package/dist/conversation/rosterProjection.js +135 -1
- package/dist/conversation/rosterProjection.js.map +1 -1
- package/dist/conversation/runtime.d.ts +20 -3
- package/dist/conversation/runtime.d.ts.map +1 -1
- package/dist/conversation/runtime.js +66 -7
- package/dist/conversation/runtime.js.map +1 -1
- package/dist/conversation/types.d.ts +43 -4
- package/dist/conversation/types.d.ts.map +1 -1
- package/dist/conversation/voice.d.ts +290 -13
- package/dist/conversation/voice.d.ts.map +1 -1
- package/dist/conversation/voice.js +565 -42
- package/dist/conversation/voice.js.map +1 -1
- package/dist/creatorCuration.d.ts +134 -0
- package/dist/creatorCuration.d.ts.map +1 -0
- package/dist/creatorCuration.js +228 -0
- package/dist/creatorCuration.js.map +1 -0
- package/dist/creatorDashboard.d.ts +155 -0
- package/dist/creatorDashboard.d.ts.map +1 -0
- package/dist/creatorDashboard.js +237 -0
- package/dist/creatorDashboard.js.map +1 -0
- package/dist/creatorUniverse.d.ts +95 -0
- package/dist/creatorUniverse.d.ts.map +1 -0
- package/dist/creatorUniverse.js +136 -0
- package/dist/creatorUniverse.js.map +1 -0
- package/dist/curationWrite.d.ts +76 -0
- package/dist/curationWrite.d.ts.map +1 -0
- package/dist/curationWrite.js +106 -0
- package/dist/curationWrite.js.map +1 -0
- package/dist/designTokens.d.ts +64 -0
- package/dist/designTokens.d.ts.map +1 -0
- package/dist/designTokens.js +117 -0
- package/dist/designTokens.js.map +1 -0
- package/dist/dialogAttribution.d.ts +79 -0
- package/dist/dialogAttribution.d.ts.map +1 -0
- package/dist/dialogAttribution.js +144 -0
- package/dist/dialogAttribution.js.map +1 -0
- package/dist/dmRunWorldReadiness.d.ts +605 -0
- package/dist/dmRunWorldReadiness.d.ts.map +1 -0
- package/dist/dmRunWorldReadiness.js +775 -0
- package/dist/dmRunWorldReadiness.js.map +1 -0
- package/dist/domains/access.d.ts +32 -0
- package/dist/domains/access.d.ts.map +1 -0
- package/dist/domains/access.js +43 -0
- package/dist/domains/access.js.map +1 -0
- package/dist/domains/adventureDefinitions.d.ts +159 -0
- package/dist/domains/adventureDefinitions.d.ts.map +1 -0
- package/dist/domains/adventureDefinitions.js +168 -0
- package/dist/domains/adventureDefinitions.js.map +1 -0
- package/dist/domains/adventures.d.ts +329 -0
- package/dist/domains/adventures.d.ts.map +1 -0
- package/dist/domains/adventures.js +359 -0
- package/dist/domains/adventures.js.map +1 -0
- package/dist/domains/arcs.d.ts +146 -0
- package/dist/domains/arcs.d.ts.map +1 -0
- package/dist/domains/arcs.js +202 -0
- package/dist/domains/arcs.js.map +1 -0
- package/dist/domains/artifacts.d.ts +259 -0
- package/dist/domains/artifacts.d.ts.map +1 -0
- package/dist/domains/artifacts.js +125 -0
- package/dist/domains/artifacts.js.map +1 -0
- package/dist/domains/chat.d.ts +158 -0
- package/dist/domains/chat.d.ts.map +1 -0
- package/dist/domains/chat.js +224 -0
- package/dist/domains/chat.js.map +1 -0
- package/dist/domains/decisions.d.ts +31 -0
- package/dist/domains/decisions.d.ts.map +1 -0
- package/dist/domains/decisions.js +42 -0
- package/dist/domains/decisions.js.map +1 -0
- package/dist/domains/documents.d.ts +218 -0
- package/dist/domains/documents.d.ts.map +1 -0
- package/dist/domains/documents.js +252 -0
- package/dist/domains/documents.js.map +1 -0
- package/dist/domains/enhancements.d.ts +106 -0
- package/dist/domains/enhancements.d.ts.map +1 -0
- package/dist/domains/enhancements.js +160 -0
- package/dist/domains/enhancements.js.map +1 -0
- package/dist/domains/graph.d.ts +454 -0
- package/dist/domains/graph.d.ts.map +1 -0
- package/dist/domains/graph.js +648 -0
- package/dist/domains/graph.js.map +1 -0
- package/dist/domains/images.d.ts +220 -0
- package/dist/domains/images.d.ts.map +1 -0
- package/dist/domains/images.js +307 -0
- package/dist/domains/images.js.map +1 -0
- package/dist/domains/ingestion.d.ts +312 -0
- package/dist/domains/ingestion.d.ts.map +1 -0
- package/dist/domains/ingestion.js +495 -0
- package/dist/domains/ingestion.js.map +1 -0
- package/dist/domains/me.d.ts +21 -0
- package/dist/domains/me.d.ts.map +1 -0
- package/dist/domains/me.js +23 -0
- package/dist/domains/me.js.map +1 -0
- package/dist/domains/orgs.d.ts +47 -0
- package/dist/domains/orgs.d.ts.map +1 -0
- package/dist/domains/orgs.js +75 -0
- package/dist/domains/orgs.js.map +1 -0
- package/dist/domains/personas.d.ts +135 -0
- package/dist/domains/personas.d.ts.map +1 -0
- package/dist/domains/personas.js +316 -0
- package/dist/domains/personas.js.map +1 -0
- package/dist/domains/projects.d.ts +53 -0
- package/dist/domains/projects.d.ts.map +1 -0
- package/dist/domains/projects.js +94 -0
- package/dist/domains/projects.js.map +1 -0
- package/dist/domains/quests.d.ts +431 -0
- package/dist/domains/quests.d.ts.map +1 -0
- package/dist/domains/quests.js +61 -0
- package/dist/domains/quests.js.map +1 -0
- package/dist/domains/reactor.d.ts +98 -0
- package/dist/domains/reactor.d.ts.map +1 -0
- package/dist/domains/reactor.js +131 -0
- package/dist/domains/reactor.js.map +1 -0
- package/dist/domains/showcase.d.ts +28 -0
- package/dist/domains/showcase.d.ts.map +1 -0
- package/dist/domains/showcase.js +28 -0
- package/dist/domains/showcase.js.map +1 -0
- package/dist/domains/storyboards.d.ts +1253 -0
- package/dist/domains/storyboards.d.ts.map +1 -0
- package/dist/domains/storyboards.js +781 -0
- package/dist/domains/storyboards.js.map +1 -0
- package/dist/domains/studioSettings.d.ts +39 -0
- package/dist/domains/studioSettings.d.ts.map +1 -0
- package/dist/domains/studioSettings.js +80 -0
- package/dist/domains/studioSettings.js.map +1 -0
- package/dist/domains/universes.d.ts +191 -0
- package/dist/domains/universes.d.ts.map +1 -0
- package/dist/domains/universes.js +276 -0
- package/dist/domains/universes.js.map +1 -0
- package/dist/domains/userDefaults.d.ts +18 -0
- package/dist/domains/userDefaults.d.ts.map +1 -0
- package/dist/domains/userDefaults.js +27 -0
- package/dist/domains/userDefaults.js.map +1 -0
- package/dist/domains/visemeBundles.d.ts +262 -0
- package/dist/domains/visemeBundles.d.ts.map +1 -0
- package/dist/domains/visemeBundles.js +373 -0
- package/dist/domains/visemeBundles.js.map +1 -0
- package/dist/domains/workflows.d.ts +142 -0
- package/dist/domains/workflows.d.ts.map +1 -0
- package/dist/domains/workflows.js +245 -0
- package/dist/domains/workflows.js.map +1 -0
- package/dist/enhancementDiff.d.ts +56 -0
- package/dist/enhancementDiff.d.ts.map +1 -0
- package/dist/enhancementDiff.js +110 -0
- package/dist/enhancementDiff.js.map +1 -0
- package/dist/generated/contract.d.ts +372 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +390 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/graphSchema.d.ts +36 -5
- package/dist/graphSchema.d.ts.map +1 -1
- package/dist/graphSchema.js +88 -2
- package/dist/graphSchema.js.map +1 -1
- package/dist/http.d.ts +70 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +263 -11
- package/dist/http.js.map +1 -1
- package/dist/identity.d.ts +81 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +65 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -1
- package/dist/messageContent.d.ts +174 -0
- package/dist/messageContent.d.ts.map +1 -0
- package/dist/messageContent.js +405 -0
- package/dist/messageContent.js.map +1 -0
- package/dist/mutationEpoch.d.ts +83 -0
- package/dist/mutationEpoch.d.ts.map +1 -0
- package/dist/mutationEpoch.js +109 -0
- package/dist/mutationEpoch.js.map +1 -0
- package/dist/obo.d.ts +144 -0
- package/dist/obo.d.ts.map +1 -0
- package/dist/obo.js +135 -0
- package/dist/obo.js.map +1 -0
- package/dist/opusTransport.d.ts +113 -0
- package/dist/opusTransport.d.ts.map +1 -0
- package/dist/opusTransport.js +170 -0
- package/dist/opusTransport.js.map +1 -0
- package/dist/pagination.d.ts +18 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +26 -0
- package/dist/pagination.js.map +1 -0
- package/dist/platformAssistant.d.ts +55 -1
- package/dist/platformAssistant.d.ts.map +1 -1
- package/dist/platformAssistant.js +39 -1
- package/dist/platformAssistant.js.map +1 -1
- package/dist/pollUtils.d.ts +19 -0
- package/dist/pollUtils.d.ts.map +1 -0
- package/dist/pollUtils.js +35 -0
- package/dist/pollUtils.js.map +1 -0
- package/dist/questLog.d.ts +232 -0
- package/dist/questLog.d.ts.map +1 -0
- package/dist/questLog.js +522 -0
- package/dist/questLog.js.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts +300 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.js +401 -0
- package/dist/reactor/dmDirectiveToExperience.js.map +1 -0
- package/dist/reactor/dmSceneControlPrompt.d.ts.map +1 -1
- package/dist/reactor/dmSceneControlPrompt.js +64 -2
- package/dist/reactor/dmSceneControlPrompt.js.map +1 -1
- package/dist/reactor/dmWorldEntry.d.ts +1278 -0
- package/dist/reactor/dmWorldEntry.d.ts.map +1 -0
- package/dist/reactor/dmWorldEntry.js +1396 -0
- package/dist/reactor/dmWorldEntry.js.map +1 -0
- package/dist/reactor/framePromptCompaction.d.ts +223 -0
- package/dist/reactor/framePromptCompaction.d.ts.map +1 -0
- package/dist/reactor/framePromptCompaction.js +393 -0
- package/dist/reactor/framePromptCompaction.js.map +1 -0
- package/dist/reactor/frameWorldBind.d.ts +86 -0
- package/dist/reactor/frameWorldBind.d.ts.map +1 -0
- package/dist/reactor/frameWorldBind.js +79 -0
- package/dist/reactor/frameWorldBind.js.map +1 -0
- package/dist/reactor/happyOysterSeed.d.ts +166 -0
- package/dist/reactor/happyOysterSeed.d.ts.map +1 -0
- package/dist/reactor/happyOysterSeed.js +233 -0
- package/dist/reactor/happyOysterSeed.js.map +1 -0
- package/dist/reactor/happyOysterWalk.d.ts +274 -0
- package/dist/reactor/happyOysterWalk.d.ts.map +1 -0
- package/dist/reactor/happyOysterWalk.js +407 -0
- package/dist/reactor/happyOysterWalk.js.map +1 -0
- package/dist/reactor/happyOysterWorld.d.ts +718 -0
- package/dist/reactor/happyOysterWorld.d.ts.map +1 -0
- package/dist/reactor/happyOysterWorld.js +826 -0
- package/dist/reactor/happyOysterWorld.js.map +1 -0
- package/dist/reactor/heliosCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/heliosCommandDispatcher.js +5 -2
- package/dist/reactor/heliosCommandDispatcher.js.map +1 -1
- package/dist/reactor/hiddenWorldLifecycle.d.ts +101 -0
- package/dist/reactor/hiddenWorldLifecycle.d.ts.map +1 -0
- package/dist/reactor/hiddenWorldLifecycle.js +119 -0
- package/dist/reactor/hiddenWorldLifecycle.js.map +1 -0
- package/dist/reactor/imageCanvas.d.ts +15 -0
- package/dist/reactor/imageCanvas.d.ts.map +1 -0
- package/dist/reactor/imageCanvas.js +33 -0
- package/dist/reactor/imageCanvas.js.map +1 -0
- package/dist/reactor/index.d.ts +19 -0
- package/dist/reactor/index.d.ts.map +1 -1
- package/dist/reactor/index.js +78 -0
- package/dist/reactor/index.js.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.d.ts +23 -8
- package/dist/reactor/longLiveCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.js +16 -4
- package/dist/reactor/longLiveCommandDispatcher.js.map +1 -1
- package/dist/reactor/longLiveSceneEntry.d.ts +203 -0
- package/dist/reactor/longLiveSceneEntry.d.ts.map +1 -0
- package/dist/reactor/longLiveSceneEntry.js +280 -0
- package/dist/reactor/longLiveSceneEntry.js.map +1 -0
- package/dist/reactor/momentCut.d.ts +153 -0
- package/dist/reactor/momentCut.d.ts.map +1 -0
- package/dist/reactor/momentCut.js +142 -0
- package/dist/reactor/momentCut.js.map +1 -0
- package/dist/reactor/promptAddonRegistry.d.ts +39 -3
- package/dist/reactor/promptAddonRegistry.d.ts.map +1 -1
- package/dist/reactor/promptAddonRegistry.js +42 -3
- package/dist/reactor/promptAddonRegistry.js.map +1 -1
- package/dist/reactor/promptTemplatePreview.d.ts +97 -0
- package/dist/reactor/promptTemplatePreview.d.ts.map +1 -0
- package/dist/reactor/promptTemplatePreview.js +185 -0
- package/dist/reactor/promptTemplatePreview.js.map +1 -0
- package/dist/reactor/reactorAvailability.d.ts +80 -0
- package/dist/reactor/reactorAvailability.d.ts.map +1 -0
- package/dist/reactor/reactorAvailability.js +121 -0
- package/dist/reactor/reactorAvailability.js.map +1 -0
- package/dist/reactor/reactorSessionRefusal.d.ts +125 -0
- package/dist/reactor/reactorSessionRefusal.d.ts.map +1 -0
- package/dist/reactor/reactorSessionRefusal.js +197 -0
- package/dist/reactor/reactorSessionRefusal.js.map +1 -0
- package/dist/reactor/reactorTokenScope.d.ts +47 -0
- package/dist/reactor/reactorTokenScope.d.ts.map +1 -0
- package/dist/reactor/reactorTokenScope.js +64 -0
- package/dist/reactor/reactorTokenScope.js.map +1 -0
- package/dist/reactor/resolveDirectorBeats.d.ts +65 -0
- package/dist/reactor/resolveDirectorBeats.d.ts.map +1 -0
- package/dist/reactor/resolveDirectorBeats.js +86 -0
- package/dist/reactor/resolveDirectorBeats.js.map +1 -0
- package/dist/reactor/sanaLiveEdit.d.ts +117 -0
- package/dist/reactor/sanaLiveEdit.d.ts.map +1 -0
- package/dist/reactor/sanaLiveEdit.js +105 -0
- package/dist/reactor/sanaLiveEdit.js.map +1 -0
- package/dist/reactor/sceneEntry.d.ts +66 -9
- package/dist/reactor/sceneEntry.d.ts.map +1 -1
- package/dist/reactor/sceneEntry.js +59 -66
- package/dist/reactor/sceneEntry.js.map +1 -1
- package/dist/reactor/sceneSeedImage.d.ts +199 -0
- package/dist/reactor/sceneSeedImage.d.ts.map +1 -0
- package/dist/reactor/sceneSeedImage.js +239 -0
- package/dist/reactor/sceneSeedImage.js.map +1 -0
- package/dist/reactor/seedImageOrchestrator.d.ts +70 -3
- package/dist/reactor/seedImageOrchestrator.d.ts.map +1 -1
- package/dist/reactor/seedImageOrchestrator.js +92 -28
- package/dist/reactor/seedImageOrchestrator.js.map +1 -1
- package/dist/reactor/toolPromptAddon.d.ts.map +1 -1
- package/dist/reactor/toolPromptAddon.js +16 -2
- package/dist/reactor/toolPromptAddon.js.map +1 -1
- package/dist/reactor/worldMintLoop.d.ts +286 -0
- package/dist/reactor/worldMintLoop.d.ts.map +1 -0
- package/dist/reactor/worldMintLoop.js +381 -0
- package/dist/reactor/worldMintLoop.js.map +1 -0
- package/dist/reactor/worldSteerOutcome.d.ts +98 -0
- package/dist/reactor/worldSteerOutcome.d.ts.map +1 -0
- package/dist/reactor/worldSteerOutcome.js +81 -0
- package/dist/reactor/worldSteerOutcome.js.map +1 -0
- package/dist/retryAfter.d.ts +15 -0
- package/dist/retryAfter.d.ts.map +1 -0
- package/dist/retryAfter.js +75 -0
- package/dist/retryAfter.js.map +1 -0
- package/dist/seriesKey.d.ts +31 -0
- package/dist/seriesKey.d.ts.map +1 -0
- package/dist/seriesKey.js +33 -0
- package/dist/seriesKey.js.map +1 -0
- package/dist/sessionRefresh.d.ts +135 -0
- package/dist/sessionRefresh.d.ts.map +1 -0
- package/dist/sessionRefresh.js +215 -0
- package/dist/sessionRefresh.js.map +1 -0
- package/dist/sharedAudioContext.d.ts +39 -0
- package/dist/sharedAudioContext.d.ts.map +1 -0
- package/dist/sharedAudioContext.js +63 -0
- package/dist/sharedAudioContext.js.map +1 -0
- package/dist/singleFlight.d.ts +51 -0
- package/dist/singleFlight.d.ts.map +1 -0
- package/dist/singleFlight.js +87 -0
- package/dist/singleFlight.js.map +1 -0
- package/dist/storyGraph.d.ts +83 -0
- package/dist/storyGraph.d.ts.map +1 -1
- package/dist/storyGraph.js +169 -4
- package/dist/storyGraph.js.map +1 -1
- package/dist/storyboardMask.d.ts +343 -0
- package/dist/storyboardMask.d.ts.map +1 -0
- package/dist/storyboardMask.js +505 -0
- package/dist/storyboardMask.js.map +1 -0
- package/dist/storyboardTimeline.d.ts +93 -0
- package/dist/storyboardTimeline.d.ts.map +1 -0
- package/dist/storyboardTimeline.js +131 -0
- package/dist/storyboardTimeline.js.map +1 -0
- package/dist/studioAutomation.d.ts +104 -0
- package/dist/studioAutomation.d.ts.map +1 -0
- package/dist/studioAutomation.js +178 -0
- package/dist/studioAutomation.js.map +1 -0
- package/dist/tenantClaim.d.ts +86 -0
- package/dist/tenantClaim.d.ts.map +1 -0
- package/dist/tenantClaim.js +164 -0
- package/dist/tenantClaim.js.map +1 -0
- package/dist/timeFormat.d.ts +25 -0
- package/dist/timeFormat.d.ts.map +1 -1
- package/dist/timeFormat.js +56 -0
- package/dist/timeFormat.js.map +1 -1
- package/dist/toolSchemas.d.ts +53 -10
- package/dist/toolSchemas.d.ts.map +1 -1
- package/dist/toolSchemas.js +36 -9
- package/dist/toolSchemas.js.map +1 -1
- package/dist/transport.d.ts +120 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +282 -0
- package/dist/transport.js.map +1 -0
- package/dist/videoGenFacade.d.ts +63 -0
- package/dist/videoGenFacade.d.ts.map +1 -0
- package/dist/videoGenFacade.js +49 -0
- package/dist/videoGenFacade.js.map +1 -0
- package/dist/visemeScheduler.d.ts +24 -2
- package/dist/visemeScheduler.d.ts.map +1 -1
- package/dist/visemeScheduler.js +31 -2
- package/dist/visemeScheduler.js.map +1 -1
- package/dist/vision/VisionPublisher.d.ts +88 -0
- package/dist/vision/VisionPublisher.d.ts.map +1 -1
- package/dist/vision/VisionPublisher.js +196 -13
- package/dist/vision/VisionPublisher.js.map +1 -1
- package/dist/vision/VisionSourceController.d.ts +67 -1
- package/dist/vision/VisionSourceController.d.ts.map +1 -1
- package/dist/vision/VisionSourceController.js +147 -5
- package/dist/vision/VisionSourceController.js.map +1 -1
- package/dist/vision/index.d.ts +2 -1
- package/dist/vision/index.d.ts.map +1 -1
- package/dist/vision/index.js +2 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/sourceKinds.d.ts +18 -5
- package/dist/vision/sourceKinds.d.ts.map +1 -1
- package/dist/vision/sourceKinds.js +15 -2
- package/dist/vision/sourceKinds.js.map +1 -1
- package/dist/vision/types.d.ts +7 -4
- package/dist/vision/types.d.ts.map +1 -1
- package/dist/vision/visionErrors.d.ts +45 -0
- package/dist/vision/visionErrors.d.ts.map +1 -0
- package/dist/vision/visionErrors.js +66 -0
- package/dist/vision/visionErrors.js.map +1 -0
- package/dist/voiceCloneCaption.d.ts +33 -0
- package/dist/voiceCloneCaption.d.ts.map +1 -0
- package/dist/voiceCloneCaption.js +69 -0
- package/dist/voiceCloneCaption.js.map +1 -0
- package/dist/websocket.d.ts +273 -10
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +79 -0
- package/dist/websocket.js.map +1 -1
- package/dist/workflowAuthoring.d.ts +139 -0
- package/dist/workflowAuthoring.d.ts.map +1 -0
- package/dist/workflowAuthoring.js +557 -0
- package/dist/workflowAuthoring.js.map +1 -0
- package/package.json +15 -5
- package/src/__tests__/adapters-director.test.ts +9 -6
- package/src/__tests__/adapters-extraction.test.ts +175 -0
- package/src/__tests__/adapters-image.test.ts +66 -0
- package/src/__tests__/adapters-momentPolicy.test.ts +218 -0
- package/src/__tests__/adapters-platform.test.ts +110 -4
- package/src/__tests__/adapters-videogen.test.ts +53 -0
- package/src/__tests__/adapters-world.test.ts +117 -7
- package/src/__tests__/admin.enhancement-defaults.test.ts +115 -0
- package/src/__tests__/admin.test.ts +282 -0
- package/src/__tests__/adventures-world-state.test.ts +156 -0
- package/src/__tests__/adventures.test.ts +111 -1
- package/src/__tests__/api-pollers.test.ts +113 -23
- package/src/__tests__/api.adventure-definitions.test.ts +312 -0
- package/src/__tests__/api.anchor-beat.test.ts +75 -0
- package/src/__tests__/api.arc-approval.test.ts +171 -0
- package/src/__tests__/api.arc-beats-floor.test.ts +56 -0
- package/src/__tests__/api.arc-generation.test.ts +168 -0
- package/src/__tests__/api.arc-templates.test.ts +78 -0
- package/src/__tests__/api.assignVideoSeries.test.ts +81 -0
- package/src/__tests__/api.cast-frame-choices.test.ts +141 -0
- package/src/__tests__/api.cutscene-registry.test.ts +148 -0
- package/src/__tests__/api.enhancement-addition-actions.test.ts +137 -0
- package/src/__tests__/api.enrichVideo-serialization.test.ts +116 -0
- package/src/__tests__/api.extraction-base.test.ts +87 -0
- package/src/__tests__/api.generateVideo-cutscene.test.ts +148 -0
- package/src/__tests__/api.job-pipeline-stages.test.ts +128 -0
- package/src/__tests__/api.list-images-filters.test.ts +6 -3
- package/src/__tests__/api.quest-curation.test.ts +169 -0
- package/src/__tests__/api.reprocessVideo.test.ts +71 -0
- package/src/__tests__/api.scene-split-merge.test.ts +129 -0
- package/src/__tests__/api.session-quests.test.ts +184 -0
- package/src/__tests__/api.test.ts +122 -0
- package/src/__tests__/api.transferSeries.test.ts +114 -0
- package/src/__tests__/api.unknown-clusters.test.ts +225 -0
- package/src/__tests__/api.uploadVideo-options.test.ts +156 -0
- package/src/__tests__/arcPreview.test.ts +71 -0
- package/src/__tests__/arcStyleProfile.test.ts +204 -0
- package/src/__tests__/artifacts-delete.test.ts +109 -0
- package/src/__tests__/audio.test.ts +864 -5
- package/src/__tests__/audioDsp.test.ts +196 -0
- package/src/__tests__/audioUnavailable.test.ts +43 -0
- package/src/__tests__/cast.test.ts +10 -1
- package/src/__tests__/castCurationProjection.test.ts +84 -0
- package/src/__tests__/castFramePipelinePending.test.ts +171 -0
- package/src/__tests__/castProjection.test.ts +497 -5
- package/src/__tests__/characterGrounding.test.ts +357 -0
- package/src/__tests__/contract.test.ts +97 -0
- package/src/__tests__/conversation/chatSessionStore.test.ts +243 -0
- package/src/__tests__/conversation/controller.test.ts +211 -0
- package/src/__tests__/conversation/readSequencer.test.ts +52 -0
- package/src/__tests__/conversation/rosterProjection.test.ts +204 -3
- package/src/__tests__/conversation/runtime.test.ts +118 -1
- package/src/__tests__/conversation/voice.test.ts +741 -7
- package/src/__tests__/creatorCuration.test.ts +256 -0
- package/src/__tests__/creatorDashboard.test.ts +444 -0
- package/src/__tests__/creatorUniverse.test.ts +138 -0
- package/src/__tests__/curationWrite.test.ts +179 -0
- package/src/__tests__/decisions.test.ts +89 -0
- package/src/__tests__/designTokens.test.ts +72 -0
- package/src/__tests__/dialogAttribution.test.ts +187 -0
- package/src/__tests__/dmDirectiveToExperience.test.ts +198 -0
- package/src/__tests__/dmWorldEntry.test.ts +2102 -0
- package/src/__tests__/enhancementDiff.test.ts +132 -0
- package/src/__tests__/experienceModelCatalog.test.ts +292 -0
- package/src/__tests__/extractionStageState.test.ts +67 -0
- package/src/__tests__/getVideo.test.ts +95 -0
- package/src/__tests__/graphReadAfterWrite.test.ts +211 -0
- package/src/__tests__/graphSchema.test.ts +55 -4
- package/src/__tests__/happyOysterSeed.test.ts +208 -0
- package/src/__tests__/happyOysterWorld.test.ts +1241 -0
- package/src/__tests__/happyOysterWorldRefusal.test.ts +224 -0
- package/src/__tests__/hiddenWorldLifecycle.test.ts +203 -0
- package/src/__tests__/http.session-refresh.test.ts +424 -0
- package/src/__tests__/http.test.ts +316 -0
- package/src/__tests__/identity.test.ts +132 -0
- package/src/__tests__/loadBundleManifest.test.ts +192 -22
- package/src/__tests__/longLiveSceneEntry.test.ts +371 -0
- package/src/__tests__/me.test.ts +74 -0
- package/src/__tests__/messageContent.test.ts +395 -0
- package/src/__tests__/momentCut.test.ts +229 -0
- package/src/__tests__/mutationEpoch.test.ts +218 -0
- package/src/__tests__/obo.test.ts +159 -0
- package/src/__tests__/opusTransport.test.ts +182 -0
- package/src/__tests__/opusTransportLibopus.test.ts +125 -0
- package/src/__tests__/orgs.test.ts +229 -0
- package/src/__tests__/persona-generation.test.ts +187 -1
- package/src/__tests__/platformAssistant.test.ts +140 -0
- package/src/__tests__/projects.test.ts +338 -0
- package/src/__tests__/promptTemplatePreview.test.ts +160 -0
- package/src/__tests__/reactor/__fixtures__/realFramePromptText.ts +23 -0
- package/src/__tests__/reactor/api-reactor.test.ts +60 -21
- package/src/__tests__/reactor/framePromptCompaction.test.ts +300 -0
- package/src/__tests__/reactor/promptAddonRegistry.test.ts +79 -0
- package/src/__tests__/reactor/reactorTokenScope.test.ts +50 -0
- package/src/__tests__/reactor/resolveDirectorBeats.test.ts +156 -0
- package/src/__tests__/reactor/sceneEntry.test.ts +3 -0
- package/src/__tests__/reactor/sceneSeedImage.test.ts +361 -0
- package/src/__tests__/reactor/seedImageOrchestrator.test.ts +43 -5
- package/src/__tests__/reactor-happyOysterWalk.test.ts +294 -0
- package/src/__tests__/reactorAvailability.test.ts +217 -0
- package/src/__tests__/reactorSessionRefusal.test.ts +189 -0
- package/src/__tests__/regeneration.test.ts +9 -9
- package/src/__tests__/reprocessBlockedReason.test.ts +30 -0
- package/src/__tests__/retryAfter.test.ts +65 -0
- package/src/__tests__/roleClaim.test.ts +102 -0
- package/src/__tests__/sanaLiveEdit.test.ts +84 -0
- package/src/__tests__/seriesKey.test.ts +24 -0
- package/src/__tests__/settings-set9.test.ts +238 -0
- package/src/__tests__/singleFlight.test.ts +348 -0
- package/src/__tests__/storyGraph.test.ts +111 -1
- package/src/__tests__/storyboardFrameCutscene.test.ts +115 -0
- package/src/__tests__/storyboardMask.test.ts +527 -0
- package/src/__tests__/storyboardTimeline.test.ts +228 -0
- package/src/__tests__/storyboards.test.ts +639 -0
- package/src/__tests__/studioAutomation.test.ts +325 -0
- package/src/__tests__/toolSchemas.test.ts +11 -18
- package/src/__tests__/transport.test.ts +312 -0
- package/src/__tests__/videoGenFacade.test.ts +141 -0
- package/src/__tests__/videoGraph.test.ts +43 -1
- package/src/__tests__/visemeScheduler.test.ts +55 -1
- package/src/__tests__/visibility.test.ts +143 -0
- package/src/__tests__/voiceCloneCaption.test.ts +80 -0
- package/src/__tests__/voiceFallback.test.ts +55 -0
- package/src/__tests__/websocket-error-turn-ended.test.ts +49 -0
- package/src/__tests__/websocket-vision.test.ts +141 -0
- package/src/__tests__/websocket.test.ts +75 -1
- package/src/__tests__/workflowAuthoring.test.ts +187 -0
- package/src/__tests__/workflows.test.ts +640 -0
- package/src/__tests__/worldMintLoop.test.ts +448 -0
- package/src/__tests__/worldModelPreference.test.ts +302 -0
- package/src/__tests__/worldModelTradeoffs.test.ts +89 -0
- package/src/__tests__/worldSteerOutcome.test.ts +62 -0
- package/src/adapters/capabilities.ts +39 -3
- package/src/adapters/directorAdapter.ts +5 -4
- package/src/adapters/experienceModelCatalog.ts +538 -0
- package/src/adapters/extractionAdapter.ts +150 -0
- package/src/adapters/imageAdapter.ts +5 -1
- package/src/adapters/index.ts +104 -17
- package/src/adapters/momentDirective.ts +109 -0
- package/src/adapters/momentPolicy.ts +209 -0
- package/src/adapters/registry.ts +1 -1
- package/src/adapters/videoGenAdapter.ts +124 -0
- package/src/adapters/worldAdapter.ts +221 -16
- package/src/adapters/worldModelPreference.ts +247 -0
- package/src/adapters/worldModelTradeoffs.ts +247 -0
- package/src/admin.ts +842 -16
- package/src/api.ts +12670 -3446
- package/src/arcBoardJoin.ts +46 -0
- package/src/arcPreview.ts +103 -0
- package/src/audio.ts +691 -130
- package/src/audioDsp.ts +132 -0
- package/src/audioProtocol.ts +235 -0
- package/src/beatTitles.ts +51 -0
- package/src/castProjection.ts +311 -0
- package/src/characterGrounding.ts +491 -0
- package/src/conversation/binding.ts +13 -0
- package/src/conversation/chatSessionStore.ts +281 -0
- package/src/conversation/controller.ts +96 -3
- package/src/conversation/index.ts +2 -0
- package/src/conversation/participant.ts +16 -0
- package/src/conversation/readSequencer.ts +55 -0
- package/src/conversation/roster.ts +5 -1
- package/src/conversation/rosterProjection.ts +166 -2
- package/src/conversation/runtime.ts +66 -7
- package/src/conversation/types.ts +43 -4
- package/src/conversation/voice.ts +655 -51
- package/src/creatorCuration.ts +316 -0
- package/src/creatorDashboard.ts +344 -0
- package/src/creatorUniverse.ts +222 -0
- package/src/curationWrite.ts +108 -0
- package/src/designTokens.ts +157 -0
- package/src/dialogAttribution.ts +182 -0
- package/src/dmRunWorldReadiness.ts +1168 -0
- package/src/domains/access.ts +92 -0
- package/src/domains/adventureDefinitions.ts +313 -0
- package/src/domains/adventures.ts +557 -0
- package/src/domains/arcs.ts +350 -0
- package/src/domains/artifacts.ts +349 -0
- package/src/domains/chat.ts +338 -0
- package/src/domains/decisions.ts +62 -0
- package/src/domains/documents.ts +389 -0
- package/src/domains/enhancements.ts +259 -0
- package/src/domains/graph.ts +959 -0
- package/src/domains/images.ts +451 -0
- package/src/domains/ingestion.ts +695 -0
- package/src/domains/me.ts +27 -0
- package/src/domains/orgs.ts +168 -0
- package/src/domains/personas.ts +433 -0
- package/src/domains/projects.ts +177 -0
- package/src/domains/quests.ts +587 -0
- package/src/domains/reactor.ts +163 -0
- package/src/domains/showcase.ts +35 -0
- package/src/domains/storyboards.ts +1698 -0
- package/src/domains/studioSettings.ts +149 -0
- package/src/domains/universes.ts +433 -0
- package/src/domains/userDefaults.ts +37 -0
- package/src/domains/visemeBundles.ts +541 -0
- package/src/domains/workflows.ts +376 -0
- package/src/enhancementDiff.ts +171 -0
- package/src/generated/contract.ts +1011 -0
- package/src/graphSchema.ts +154 -6
- package/src/http.ts +295 -11
- package/src/identity.ts +123 -0
- package/src/index.ts +131 -0
- package/src/messageContent.ts +500 -0
- package/src/mutationEpoch.ts +107 -0
- package/src/obo.ts +201 -0
- package/src/opusTransport.ts +268 -0
- package/src/pagination.ts +29 -0
- package/src/platformAssistant.ts +97 -1
- package/src/pollUtils.ts +35 -0
- package/src/questLog.ts +704 -0
- package/src/reactor/dmDirectiveToExperience.ts +636 -0
- package/src/reactor/dmSceneControlPrompt.ts +69 -2
- package/src/reactor/dmWorldEntry.ts +2226 -0
- package/src/reactor/framePromptCompaction.ts +544 -0
- package/src/reactor/frameWorldBind.ts +133 -0
- package/src/reactor/happyOysterSeed.ts +329 -0
- package/src/reactor/happyOysterWalk.ts +541 -0
- package/src/reactor/happyOysterWorld.ts +1270 -0
- package/src/reactor/heliosCommandDispatcher.ts +5 -1
- package/src/reactor/hiddenWorldLifecycle.ts +182 -0
- package/src/reactor/imageCanvas.ts +38 -0
- package/src/reactor/index.ts +78 -0
- package/src/reactor/longLiveCommandDispatcher.ts +23 -8
- package/src/reactor/longLiveSceneEntry.ts +409 -0
- package/src/reactor/momentCut.ts +219 -0
- package/src/reactor/promptAddonRegistry.ts +81 -3
- package/src/reactor/promptTemplatePreview.ts +240 -0
- package/src/reactor/reactorAvailability.ts +155 -0
- package/src/reactor/reactorSessionRefusal.ts +260 -0
- package/src/reactor/reactorTokenScope.ts +69 -0
- package/src/reactor/resolveDirectorBeats.ts +140 -0
- package/src/reactor/sanaLiveEdit.ts +158 -0
- package/src/reactor/sceneEntry.ts +106 -88
- package/src/reactor/sceneSeedImage.ts +338 -0
- package/src/reactor/seedImageOrchestrator.ts +116 -34
- package/src/reactor/toolPromptAddon.ts +16 -2
- package/src/reactor/worldMintLoop.ts +545 -0
- package/src/reactor/worldSteerOutcome.ts +132 -0
- package/src/retryAfter.ts +71 -0
- package/src/seriesKey.ts +42 -0
- package/src/sessionRefresh.ts +237 -0
- package/src/sharedAudioContext.ts +67 -0
- package/src/singleFlight.ts +91 -0
- package/src/storyGraph.ts +247 -4
- package/src/storyboardMask.ts +756 -0
- package/src/storyboardTimeline.ts +220 -0
- package/src/studioAutomation.ts +208 -0
- package/src/tenantClaim.ts +170 -0
- package/src/timeFormat.ts +51 -0
- package/src/toolSchemas.ts +39 -10
- package/src/transport.ts +327 -0
- package/src/videoGenFacade.ts +90 -0
- package/src/visemeScheduler.ts +36 -3
- package/src/vision/VisionPublisher.ts +204 -14
- package/src/vision/VisionSourceController.ts +187 -6
- package/src/vision/__tests__/VisionPublisher.kvs.test.ts +50 -0
- package/src/vision/__tests__/VisionPublisher.test.ts +291 -0
- package/src/vision/__tests__/VisionSourceController.test.ts +376 -6
- package/src/vision/index.ts +5 -1
- package/src/vision/sourceKinds.ts +19 -5
- package/src/vision/types.ts +7 -4
- package/src/vision/visionErrors.ts +70 -0
- package/src/voiceCloneCaption.ts +77 -0
- package/src/websocket.ts +361 -12
- package/src/workflowAuthoring.ts +664 -0
|
@@ -0,0 +1,1278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DM world entry — the client half of §Q `DM.1`: a DM `[SCENE:enter_world]`
|
|
3
|
+
* directive opens a HappyOyster world SEEDED FROM THE RATIFIED STORYBOARD
|
|
4
|
+
* FRAME for the beat the party is standing on.
|
|
5
|
+
*
|
|
6
|
+
* Nothing here is a new mechanism. `happyOysterWorld.ts` already owns the
|
|
7
|
+
* lifecycle, the permanent `{encryptedWorldId, mode}` handle and the error
|
|
8
|
+
* taxonomy; `happyOysterSeed.ts` already owns crop-then-encode; the directive
|
|
9
|
+
* pipeline already parses the tag. This module owns only the decisions that
|
|
10
|
+
* stand between an LLM-emitted tag and a PERMANENT, BILLED, UNLISTABLE asset,
|
|
11
|
+
* and it owns them in ONE place so no surface can re-derive them differently.
|
|
12
|
+
*
|
|
13
|
+
* ## The owner's ruling: OPT-IN AUTO-FIRE WITH RAILS, not a blanket gate
|
|
14
|
+
*
|
|
15
|
+
* (Owner, 2026-07-28: *"user should be able to allow dm to auto-fire (as long
|
|
16
|
+
* as there aren't any hidden sessions or lost sessions and they can easily be
|
|
17
|
+
* stopped. And they timeout after an interval … default to 30 seconds)"*.) The
|
|
18
|
+
* four rails, and where each one lives:
|
|
19
|
+
*
|
|
20
|
+
* 1. **Opt-in.** {@link DmWorldEntryPlanInput.autoFireEnabled} defaults to
|
|
21
|
+
* `false` ({@link DM_WORLD_AUTO_FIRE_DEFAULT}). With it off, every create
|
|
22
|
+
* is `confirm_required` and {@link launchDmWorldEntry} REFUSES to run one
|
|
23
|
+
* without an explicit operator confirmation.
|
|
24
|
+
* 2. **No hidden or lost sessions.** Every handle a launch produces goes to
|
|
25
|
+
* `onWorldHandle`, at THREE points (§Q `DM.43`): at MINT time, the instant
|
|
26
|
+
* the vendor returns a world id and BEFORE `startTravel`; on success; and
|
|
27
|
+
* from `HappyOysterLaunchError.handle`, i.e. including a world that was
|
|
28
|
+
* created and billed but whose `startTravel` failed. The mint-time offer
|
|
29
|
+
* is the load-bearing one — `startTravel` can occupy minutes, and the two
|
|
30
|
+
* settle-time offers only fire once it is over.
|
|
31
|
+
* {@link rememberDmWorldEntry} keeps the session's
|
|
32
|
+
* list so a surface can show what it opened and reattach to it, and
|
|
33
|
+
* {@link collectDmWorldRecords} (§Q `DM.24`) is the DURABLE-FIRST read of
|
|
34
|
+
* it: the board's `StoryboardFrame.worldId` bindings, which survive a
|
|
35
|
+
* reload, plus whatever the session knows that the board does not yet.
|
|
36
|
+
* 3. **Easily stopped.** Auto-fired plans carry
|
|
37
|
+
* {@link DmWorldEntryPlan.autoStopAfterMs}; the pane arms that deadline and
|
|
38
|
+
* the existing "Back to the party" exit is the manual stop.
|
|
39
|
+
* 4. **Timeout, default 30 s** — {@link DM_WORLD_AUTO_STOP_MS_DEFAULT},
|
|
40
|
+
* overridable per call by the studio setting once that store exists.
|
|
41
|
+
*
|
|
42
|
+
* **What actually bounds vendor cost is CREATION FREQUENCY, not run time.** A
|
|
43
|
+
* timeout stops a world streaming; it cannot un-bill a world already created.
|
|
44
|
+
* So auto-fire rides the owner's `DM.12` ruling — *"regenerate the world at
|
|
45
|
+
* scene changes, have the DM issue instruct commands based on the storyboard
|
|
46
|
+
* and user choices otherwise"*: a live world whose scene has not changed is
|
|
47
|
+
* STEERED (`'steer'` ⇒ `instruct`, free), a frame that already owns a world is
|
|
48
|
+
* REOPENED (`'reopen'` ⇒ `attachWorld`, free), and `createWorld` fires only on
|
|
49
|
+
* a genuine scene change. That caps creation at one per scene rather than one
|
|
50
|
+
* per LLM emission, which was the real hazard.
|
|
51
|
+
*
|
|
52
|
+
* ## Two things that are NOT relaxed by any of the above
|
|
53
|
+
*
|
|
54
|
+
* - **The seed is BYTES, never a URL.** `createWorld({firstFrameImageUrl})` is
|
|
55
|
+
* forwarded verbatim with no client guard, frames are stored PNG with no
|
|
56
|
+
* byte guarantee, and the presigned frame URL expires — each of those fails
|
|
57
|
+
* AFTER the world is billed. `prepareHappyOysterSeedFromUrl` converts all
|
|
58
|
+
* three into PRE-billing throws for the cost of one client-side fetch, and
|
|
59
|
+
* the launcher refuses to create without prepared bytes in hand.
|
|
60
|
+
* - **The frame is resolved DETERMINISTICALLY, never from the tag.**
|
|
61
|
+
* {@link resolveDmWorldEntryFrame} joins the ACTIVE BEAT to a board frame
|
|
62
|
+
* through `StoryboardFrame.beatId` (the documented join to quests'
|
|
63
|
+
* `sourceBeatId`). The tag's free text is ATMOSPHERE ONLY, appended to the
|
|
64
|
+
* frame's server-compiled prompt. A hallucinated id can never select,
|
|
65
|
+
* replace or mis-address the seed — a risk that goes UP, not down, with
|
|
66
|
+
* auto-fire on.
|
|
67
|
+
*
|
|
68
|
+
* Framework- and SDK-agnostic, like the rest of `reactor/`: pure data plus the
|
|
69
|
+
* structural {@link HappyOysterBridge}.
|
|
70
|
+
*
|
|
71
|
+
* PARKED, deliberately not decided here: §Q `DM.1` Q3 (are DM worlds always
|
|
72
|
+
* `adventure`?) stays open on `SB-W.4`, so `mode` is a REQUIRED input the host
|
|
73
|
+
* supplies rather than a default this module picks.
|
|
74
|
+
*/
|
|
75
|
+
import { type StoryboardFrame } from '../domains/storyboards';
|
|
76
|
+
import type { BeatView } from '../storyGraph';
|
|
77
|
+
import type { PreparedHappyOysterSeed } from './happyOysterSeed';
|
|
78
|
+
import { type HappyOysterBridge, type HappyOysterFailureReason, type HappyOysterLaunchResult, type HappyOysterMode, type HappyOysterWorldHandle } from './happyOysterWorld';
|
|
79
|
+
import { type ReactorSessionRefusal } from './reactorSessionRefusal';
|
|
80
|
+
/**
|
|
81
|
+
* Whether the DM may open a world WITHOUT asking, when the host supplies no
|
|
82
|
+
* setting. `false` — the rail is opt-IN (owner 2026-07-28), so an unconfigured
|
|
83
|
+
* host never lets an LLM-emitted tag mint a permanent, billed asset on its own.
|
|
84
|
+
*/
|
|
85
|
+
export declare const DM_WORLD_AUTO_FIRE_DEFAULT = false;
|
|
86
|
+
/**
|
|
87
|
+
* §Q `WORLD.1-A` — THE MODE EVERY PLAYER SURFACE OPENS A WORLD ON.
|
|
88
|
+
*
|
|
89
|
+
* `DM.23` decided this for the DM play episode and held the constant in that
|
|
90
|
+
* file: **on a player surface a world is always `adventure`** — the party steps
|
|
91
|
+
* into it while the DM narrates, and `directing` is the authoring experience
|
|
92
|
+
* (the World Explorer demo and, later, `SB-W.4`'s storyboard director keep
|
|
93
|
+
* their own picker). `DM.1` Q3 stays PARKED at the client-core level: this is a
|
|
94
|
+
* shared HOST default, not a decision `planDmWorldEntry` makes — `mode` is
|
|
95
|
+
* still a REQUIRED input there.
|
|
96
|
+
*
|
|
97
|
+
* It moved here the moment a SECOND player surface needed it. The viewer
|
|
98
|
+
* (`WatchShell`) reopens the very worlds the episode created, and the vendor
|
|
99
|
+
* fails a cross-mode reattach with `MODE_MISMATCH` — so two surfaces holding
|
|
100
|
+
* their own literal is a world that is permanently unreachable from one of
|
|
101
|
+
* them, and `planDmWorldEntry`'s `world_mode_mismatch` refusal would be the
|
|
102
|
+
* only warning.
|
|
103
|
+
*/
|
|
104
|
+
export declare const DM_WORLD_MODE: HappyOysterMode;
|
|
105
|
+
/**
|
|
106
|
+
* How long an AUTO-FIRED world runs before the surface stops it, in ms. Owner
|
|
107
|
+
* default: 30 s. Studio-configurable once that setting store exists — the value
|
|
108
|
+
* rides {@link DmWorldEntryPlanInput.autoStopAfterMs} so the host passes the
|
|
109
|
+
* configured number and nothing here needs to change.
|
|
110
|
+
*
|
|
111
|
+
* This bounds RUN TIME, not spend: the world is already billed by the time it
|
|
112
|
+
* streams. The spend rail is the scene-change condition on `'create'`.
|
|
113
|
+
*/
|
|
114
|
+
export declare const DM_WORLD_AUTO_STOP_MS_DEFAULT = 30000;
|
|
115
|
+
/**
|
|
116
|
+
* Separator between the frame's server-compiled prompt and the DM tag's
|
|
117
|
+
* atmosphere text. The label is part of the contract: it keeps the atmosphere
|
|
118
|
+
* legible as a modifier of the frame rather than as a second scene description.
|
|
119
|
+
*/
|
|
120
|
+
export declare const DM_WORLD_ATMOSPHERE_PREFIX = "\n\nAtmosphere: ";
|
|
121
|
+
/**
|
|
122
|
+
* Shortest atmosphere worth appending. If the frame's own prompt leaves less
|
|
123
|
+
* room than this under {@link HAPPY_OYSTER_PROMPT_MAX_CHARS}, the atmosphere is
|
|
124
|
+
* dropped entirely rather than shipped as a truncated fragment — the frame is
|
|
125
|
+
* the authority, so it is never the thing that gets cut.
|
|
126
|
+
*/
|
|
127
|
+
export declare const DM_WORLD_ATMOSPHERE_MIN_CHARS = 24;
|
|
128
|
+
/**
|
|
129
|
+
* §Q `DM.17` — WHAT A REOPEN ACTUALLY RETURNS, in the one place every surface
|
|
130
|
+
* reads it from.
|
|
131
|
+
*
|
|
132
|
+
* Measured live 2026-07-28 on world `dHpmaEU0…EihKgVEbA1ghvbKh20QDdU4`: after an
|
|
133
|
+
* `instruct` visibly moved the world, TWO separate reattaches minutes apart both
|
|
134
|
+
* came back to the world as CREATED. `attachWorld` restores the seeded scene;
|
|
135
|
+
* the vendor persists no steered state and exposes no checkpoint API.
|
|
136
|
+
*
|
|
137
|
+
* The `DM.17` ruling is to SAY SO, not to replay. Replay cannot serve the
|
|
138
|
+
* affordance this notice guards —
|
|
139
|
+
* `↻ relive` mints a NEW session (`reliveFromSavePoint`), so a client-held steer
|
|
140
|
+
* log dies with the session it was kept in, and the quest ledger has no steer
|
|
141
|
+
* event to rebuild one from (`QUEST_EVENT_TYPES` carries none). Replaying only
|
|
142
|
+
* where a log happens to survive would make continuity INTERMITTENT, which is a
|
|
143
|
+
* worse lie than a uniform, stated limit. Durable replay is a backend row.
|
|
144
|
+
*/
|
|
145
|
+
export declare const DM_WORLD_REOPEN_NOTICE = "Reopening returns this world to the scene it was created from. Steering issued while it ran is not carried over \u2014 the vendor stores no steered state.";
|
|
146
|
+
/**
|
|
147
|
+
* The continuity notice a surface must show for `action`, or `null` when the
|
|
148
|
+
* action carries no continuity claim to correct.
|
|
149
|
+
*
|
|
150
|
+
* Only `'reopen'` re-enters an existing world, so only `'reopen'` can silently
|
|
151
|
+
* imply a continuity that does not exist. `'create'`/`'confirm_required'` mint
|
|
152
|
+
* the scene they show, and `'steer'` re-aims the world that is already running —
|
|
153
|
+
* neither loses anything. Derived here so no surface re-decides it.
|
|
154
|
+
*/
|
|
155
|
+
export declare function dmWorldReopenNotice(action: DmWorldEntryAction): string | null;
|
|
156
|
+
/**
|
|
157
|
+
* §Q `DM.42` — WHICH OF THE TWO LONG WAITS A LAUNCH IS IN.
|
|
158
|
+
*
|
|
159
|
+
* They look identical from the outside and mean opposite things:
|
|
160
|
+
*
|
|
161
|
+
* - `'building'` — `createWorld`/`attachWorld` has not returned. Measured at
|
|
162
|
+
* 105–240 s and entirely normal; the answer is to wait.
|
|
163
|
+
* - `'entering'` — the world is BUILT and `startTravel` is waiting for the
|
|
164
|
+
* live stream, which the vendor bounds at
|
|
165
|
+
* {@link HAPPY_OYSTER_STREAM_START_TIMEOUT_MS}. Waiting past that does not
|
|
166
|
+
* help: the SDK ends the travel itself.
|
|
167
|
+
*
|
|
168
|
+
* Collapsing them is what made a dead travel read as a slow build. Measured
|
|
169
|
+
* 2026-08-01 on staging: the pane held *"Reopening this world…"* for the full
|
|
170
|
+
* 60 s while the world's own phase was already `traveling`, then the travel
|
|
171
|
+
* was torn down.
|
|
172
|
+
*/
|
|
173
|
+
export type DmWorldLaunchStage =
|
|
174
|
+
/** Fetching + cropping the seed bytes. Nothing is billed yet. */
|
|
175
|
+
'preparing' | 'building' | 'entering';
|
|
176
|
+
/**
|
|
177
|
+
* The SDK client phase that means "the world is done; we are opening the
|
|
178
|
+
* stream". `HappyOysterModel.doStartTravel` sets it on the line immediately
|
|
179
|
+
* before `startTravel`, so it is the exact boundary — not an inference from
|
|
180
|
+
* elapsed time, which is what a host would otherwise have to guess with.
|
|
181
|
+
*/
|
|
182
|
+
export declare const HAPPY_OYSTER_PHASE_STARTING_STREAM = "starting_stream";
|
|
183
|
+
/** Resolve the stage from the SDK's own phase. `preparingSeed` wins because it
|
|
184
|
+
* runs before any session state exists to read. */
|
|
185
|
+
export declare function dmWorldLaunchStage(input: {
|
|
186
|
+
preparingSeed: boolean;
|
|
187
|
+
/** `HappyOysterModel.phase`. */
|
|
188
|
+
clientPhase: string | null | undefined;
|
|
189
|
+
}): DmWorldLaunchStage;
|
|
190
|
+
/** What a surface renders while a launch is in flight. */
|
|
191
|
+
export interface DmWorldLaunchProgress {
|
|
192
|
+
title: string;
|
|
193
|
+
/** The honest expectation for THIS stage, or `null` when there is none worth
|
|
194
|
+
* stating (a reopen's attach is fast and unbounded by anything useful). */
|
|
195
|
+
detail: string | null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The progress copy for a stage — the ONLY place a surface gets it, so the
|
|
199
|
+
* build's 105–240 s expectation can never be shown over the stream-start wait
|
|
200
|
+
* again.
|
|
201
|
+
*/
|
|
202
|
+
export declare function dmWorldLaunchProgress(stage: DmWorldLaunchStage, action: DmWorldEntryAction): DmWorldLaunchProgress;
|
|
203
|
+
/**
|
|
204
|
+
* §Q `DM.42` — what to SAY when a launch dies after the world was already
|
|
205
|
+
* built and the stream never came.
|
|
206
|
+
*
|
|
207
|
+
* Measured on staging 2026-08-01, on the free reopen path and independently in
|
|
208
|
+
* the World Explorer host, which shares no episode code: the vendor's
|
|
209
|
+
* `travels/status` reports `rtcStatus: STREAMING`, the AliRTC peer reaches ICE
|
|
210
|
+
* `connected` with both transceivers delivered — and `getStats()` records ZERO
|
|
211
|
+
* `inbound-rtp` for the whole window, so the world publisher never sends a
|
|
212
|
+
* packet. The client then hits the vendor's stream-start bound and the SDK ends
|
|
213
|
+
* the travel.
|
|
214
|
+
*
|
|
215
|
+
* Why this text exists rather than the vendor's own error: the SDK retries a
|
|
216
|
+
* stream-start timeout (its transient-error regex matches the word "timeout"),
|
|
217
|
+
* so the error that finally surfaces is the RETRY's — on a reopen that is
|
|
218
|
+
* `[TRAVELING] a travel is live`, which describes the wreckage of the first
|
|
219
|
+
* attempt and not the failure. Reporting it verbatim sends the reader after
|
|
220
|
+
* the wrong cause.
|
|
221
|
+
*/
|
|
222
|
+
export declare const DM_WORLD_STREAM_STALL_TITLE = "The world never started streaming";
|
|
223
|
+
export declare const DM_WORLD_STREAM_STALL_MESSAGE: string;
|
|
224
|
+
/** Everything a surface renders for a failed launch. */
|
|
225
|
+
export interface DmWorldLaunchFailure {
|
|
226
|
+
title: string;
|
|
227
|
+
detail: string;
|
|
228
|
+
/**
|
|
229
|
+
* The permanent world this launch already paid for, when one exists. Shown
|
|
230
|
+
* because a billed world that reaches a dead end WITHOUT its id on screen is
|
|
231
|
+
* exactly the loss `DM.43` is about — worlds cannot be listed.
|
|
232
|
+
*/
|
|
233
|
+
worldId: string | null;
|
|
234
|
+
/**
|
|
235
|
+
* Whether this is the stream-start stall rather than an ordinary failure.
|
|
236
|
+
* Carried on the result so a surface can address the state (a test id, a
|
|
237
|
+
* probe) without re-deriving it by comparing the rendered title to a
|
|
238
|
+
* constant — the copy is allowed to change; the classification is not.
|
|
239
|
+
*/
|
|
240
|
+
streamStalled: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* §Q `WORLD.17` — the vendor's refusal of the session, when that is what
|
|
243
|
+
* failed. Carried so a surface can publish it (a test id, a probe) without
|
|
244
|
+
* re-parsing the rendered copy.
|
|
245
|
+
*/
|
|
246
|
+
vendorRefusal?: ReactorSessionRefusal | null;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Build a {@link DmWorldLaunchFailure}. `streamStalled` takes precedence over
|
|
250
|
+
* the vendor's reason for the reason in {@link DM_WORLD_STREAM_STALL_MESSAGE};
|
|
251
|
+
* the vendor's own text is kept as the detail's tail so nothing is hidden.
|
|
252
|
+
*/
|
|
253
|
+
export declare function dmWorldLaunchFailure(input: {
|
|
254
|
+
reason: HappyOysterFailureReason | string;
|
|
255
|
+
message: string;
|
|
256
|
+
worldId?: string | null;
|
|
257
|
+
streamStalled?: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* §Q `WORLD.17` — set when the vendor refused the SESSION. Takes precedence
|
|
260
|
+
* over everything else: the reason a refused session carries is `unknown`,
|
|
261
|
+
* and rendering that word as the headline is what left the 2026-10-09 402
|
|
262
|
+
* nameless.
|
|
263
|
+
*/
|
|
264
|
+
vendorRefusal?: ReactorSessionRefusal | null;
|
|
265
|
+
}): DmWorldLaunchFailure;
|
|
266
|
+
/** Why a world entry cannot proceed, AS DECIDED BY THE PLANNER — i.e. the board
|
|
267
|
+
* was in hand, {@link planDmWorldEntry} ran, and it refused. Every one of these
|
|
268
|
+
* is decided BEFORE any session is opened, i.e. before anything can be billed.
|
|
269
|
+
*
|
|
270
|
+
* ⛔ DO NOT WIDEN THIS ALIAS. It is published, and a consumer's exhaustive
|
|
271
|
+
* `switch` or `Record<DmWorldEntryBlockReason, …>` breaks the moment a member
|
|
272
|
+
* is added (codex on #1681). New RENDERABLE reasons go on
|
|
273
|
+
* {@link DmWorldEntryHostBlockReason} and reach the copy tables through
|
|
274
|
+
* {@link DmWorldEntryRenderBlockReason}. */
|
|
275
|
+
export type DmWorldEntryBlockReason =
|
|
276
|
+
/** The session reports no active beat, so there is nothing to join on. */
|
|
277
|
+
'no_active_beat'
|
|
278
|
+
/** No board frame carries that beat id. */
|
|
279
|
+
| 'no_frame_for_beat'
|
|
280
|
+
/** The frame exists and is still generating — there is no seed YET. */
|
|
281
|
+
| 'frame_not_rendered'
|
|
282
|
+
/**
|
|
283
|
+
* §Q `SB.34` — the frame exists, is fully described, and its render FAILED.
|
|
284
|
+
* Split out of `frame_not_rendered` because the two need opposite responses:
|
|
285
|
+
* one resolves by waiting, the other never does.
|
|
286
|
+
*/
|
|
287
|
+
| 'frame_render_failed'
|
|
288
|
+
/** The frame carries no server-compiled prompt text on any variant. */
|
|
289
|
+
| 'prompt_unavailable'
|
|
290
|
+
/** The composed prompt is unusable (empty / over the vendor cap). */
|
|
291
|
+
| 'prompt_invalid'
|
|
292
|
+
/**
|
|
293
|
+
* §Q `DM.30` — the frame IS bound to a world, but to the OTHER mode's model.
|
|
294
|
+
* HappyOyster worlds are mode-fixed, so this can never resolve by retrying
|
|
295
|
+
* here; the world has to be opened from the surface that minted it. Decided
|
|
296
|
+
* from the frame's STORED `worldMode`, which is why DM.30 had to persist it:
|
|
297
|
+
* a bare id looks bound and fails at `attachWorld` with `[MODE_MISMATCH]`.
|
|
298
|
+
*/
|
|
299
|
+
| 'world_mode_mismatch';
|
|
300
|
+
/**
|
|
301
|
+
* §Q `DM.73` — why a HOST cannot even reach the planner.
|
|
302
|
+
*
|
|
303
|
+
* The planner is pure and needs the board in hand, so a host that has not got
|
|
304
|
+
* one has no `DmWorldEntryBlockReason` to report. It used to report NOTHING
|
|
305
|
+
* — `reason: null`, which {@link dmWorldEntryBlockTitle} renders as
|
|
306
|
+
* {@link DM_WORLD_ENTRY_NO_BOARD_TITLE} — and that collapsed three different
|
|
307
|
+
* situations into the single claim *"this story has no ratified storyboard"*:
|
|
308
|
+
* the read had not landed yet, the read FAILED, and the story genuinely has no
|
|
309
|
+
* board. Only the third is what the copy says. See the DM.73 section at the
|
|
310
|
+
* bottom of this module for the measurement.
|
|
311
|
+
*/
|
|
312
|
+
export type DmWorldEntryHostBlockReason =
|
|
313
|
+
/** The board read has not settled yet (first attempt or a scheduled retry). */
|
|
314
|
+
'board_read_pending'
|
|
315
|
+
/** Every attempt at the board read failed. The story's board state is
|
|
316
|
+
* UNKNOWN — emphatically not known to be absent. */
|
|
317
|
+
| 'board_read_failed'
|
|
318
|
+
/**
|
|
319
|
+
* §Q `WORLD.1-A` — the surface has a board and NO beat, so the player has to
|
|
320
|
+
* name which world to open and has not yet.
|
|
321
|
+
*
|
|
322
|
+
* The DM episode can never reach it: a session always stands on a beat (or
|
|
323
|
+
* reports `no_active_beat`, which is a different claim — the story has not
|
|
324
|
+
* started). The VIEWER has no session at all, so its entry is a pick from the
|
|
325
|
+
* story's frame-bound worlds, and stepping into the world source before
|
|
326
|
+
* picking one is a real, reachable state that would otherwise render as a
|
|
327
|
+
* black pane.
|
|
328
|
+
*/
|
|
329
|
+
| 'world_not_chosen';
|
|
330
|
+
/**
|
|
331
|
+
* Every reason a surface can render a block for: the planner's refusals plus
|
|
332
|
+
* the host's own pre-planner states.
|
|
333
|
+
*
|
|
334
|
+
* A NEW name rather than a widening of {@link DmWorldEntryBlockReason}, so the
|
|
335
|
+
* published planner alias keeps exactly the members it shipped with and only
|
|
336
|
+
* the copy tables and {@link DmWorldEntryBlock} see the wider set.
|
|
337
|
+
* {@link DmWorldEntryPlanResult} keeps the PLANNER half, so no planner branch
|
|
338
|
+
* can ever return a host reason, while the Records below cover the whole union —
|
|
339
|
+
* a new member of either half fails to compile until it has a headline.
|
|
340
|
+
*/
|
|
341
|
+
export type DmWorldEntryRenderBlockReason = DmWorldEntryBlockReason | DmWorldEntryHostBlockReason;
|
|
342
|
+
/**
|
|
343
|
+
* §Q `SB.34` — the HEADLINE a surface shows for each block reason.
|
|
344
|
+
*
|
|
345
|
+
* The messages below already differed per reason; the headline did not, so
|
|
346
|
+
* every block read as the same dead end — *"No world for this beat"* on a beat
|
|
347
|
+
* whose frame merely failed looks exactly like a beat nobody storyboarded, and
|
|
348
|
+
* the owner's `star-wars` board (1 rendered frame, 5 refused) presented as
|
|
349
|
+
* having no board at all. The headline is the line that gets read first, so it
|
|
350
|
+
* is the line that has to carry the difference.
|
|
351
|
+
*
|
|
352
|
+
* A `Record` rather than a `switch` so a new {@link DmWorldEntryBlockReason}
|
|
353
|
+
* member fails to compile here instead of silently falling back to generic copy.
|
|
354
|
+
* It lives beside the reasons — the messages already do — so no surface invents
|
|
355
|
+
* its own vocabulary for a state the planner owns.
|
|
356
|
+
*/
|
|
357
|
+
export declare const DM_WORLD_ENTRY_BLOCK_TITLES: Record<DmWorldEntryRenderBlockReason, string>;
|
|
358
|
+
/**
|
|
359
|
+
* The headline for a block, or the generic one when the planner was never
|
|
360
|
+
* reached at all (no board on the story, so there is no reason object).
|
|
361
|
+
*/
|
|
362
|
+
export declare const DM_WORLD_ENTRY_NO_BOARD_TITLE = "No world for this beat";
|
|
363
|
+
/**
|
|
364
|
+
* §Q `DM.61(a)` — THE ONE MOVE THAT LEAVES THE BLOCK, when one exists.
|
|
365
|
+
*
|
|
366
|
+
* A refusal that states only what is missing is a dead end even when the way
|
|
367
|
+
* out is one click away. `no_active_beat` is the case that made this worth a
|
|
368
|
+
* field: it is reachable on the HAPPY path (a definition spawn starts with no
|
|
369
|
+
* beat until the DM's first `advance_story`), it resolves ENTIRELY by playing
|
|
370
|
+
* the first turn, and nothing on the block said so.
|
|
371
|
+
*
|
|
372
|
+
* The value is the action LABEL a surface puts on the way back, so the copy
|
|
373
|
+
* lives beside the reason it belongs to rather than in whichever pane renders
|
|
374
|
+
* it. `null` means there is genuinely nothing the player can do from here — do
|
|
375
|
+
* NOT invent one to fill the field:
|
|
376
|
+
*
|
|
377
|
+
* · `no_frame_for_beat` / `frame_not_rendered` / `frame_render_failed` /
|
|
378
|
+
* `prompt_unavailable` / `prompt_invalid` resolve on the STORYBOARD, which
|
|
379
|
+
* is a different surface and a different person's job.
|
|
380
|
+
* · `world_mode_mismatch` has no client recourse at all. The frame holds ONE
|
|
381
|
+
* world slot and the bound world lives on the other mode-fixed model, so
|
|
382
|
+
* nothing the player clicks here can rebind it — per-mode slots (or an
|
|
383
|
+
* unbind) is a server change. Faking a button would be worse than the
|
|
384
|
+
* honest dead end.
|
|
385
|
+
*/
|
|
386
|
+
export declare const DM_WORLD_ENTRY_BLOCK_RECOURSE: Record<DmWorldEntryRenderBlockReason, string | null>;
|
|
387
|
+
/**
|
|
388
|
+
* §Q `DM.73` — whether this block's recourse is a RETRY of the thing that
|
|
389
|
+
* failed, rather than a way out of the surface.
|
|
390
|
+
*
|
|
391
|
+
* `HappyOysterWorldPane` renders `DmWorldEntryBlock.recourse` as the label of
|
|
392
|
+
* its EXIT control, which is right for `no_active_beat` ("Back to chat to take
|
|
393
|
+
* your first turn" genuinely leaves the pane) and would be a lie for
|
|
394
|
+
* `board_read_failed` — a button reading *"Try loading the storyboard again"*
|
|
395
|
+
* that instead closes the world pane. Derived here so no surface re-decides
|
|
396
|
+
* which recourses are exits and which are actions.
|
|
397
|
+
*/
|
|
398
|
+
export declare function dmWorldEntryBlockIsRetryable(reason: DmWorldEntryRenderBlockReason | null): boolean;
|
|
399
|
+
/** {@link DM_WORLD_ENTRY_BLOCK_RECOURSE} with the no-reason case folded in. */
|
|
400
|
+
export declare function dmWorldEntryBlockRecourse(reason: DmWorldEntryRenderBlockReason | null): string | null;
|
|
401
|
+
/** {@link DM_WORLD_ENTRY_BLOCK_TITLES} with the no-reason case folded in, so a
|
|
402
|
+
* surface never repeats the `?? generic` tail. */
|
|
403
|
+
export declare function dmWorldEntryBlockTitle(reason: DmWorldEntryRenderBlockReason | null): string;
|
|
404
|
+
/**
|
|
405
|
+
* Everything a surface renders for a block, in ONE object: the reason (for
|
|
406
|
+
* test/telemetry addressing), the headline, and the planner's own message.
|
|
407
|
+
*
|
|
408
|
+
* Carried as a pair rather than two loose props because they must always agree —
|
|
409
|
+
* a headline paired with a message from a different reason is the exact class of
|
|
410
|
+
* drift that let a failed frame read as a missing one.
|
|
411
|
+
*/
|
|
412
|
+
export interface DmWorldEntryBlock {
|
|
413
|
+
/** `null` when the planner was never reached AND the host has nothing of its
|
|
414
|
+
* own to say — i.e. the story genuinely has no board (§Q `DM.73`). */
|
|
415
|
+
reason: DmWorldEntryRenderBlockReason | null;
|
|
416
|
+
title: string;
|
|
417
|
+
message: string;
|
|
418
|
+
/**
|
|
419
|
+
* §Q `DM.61(a)` — the label for the one move that resolves this block, or
|
|
420
|
+
* `null` when nothing the player does here can. See
|
|
421
|
+
* {@link DM_WORLD_ENTRY_BLOCK_RECOURSE}.
|
|
422
|
+
*/
|
|
423
|
+
recourse: string | null;
|
|
424
|
+
}
|
|
425
|
+
/** Build a {@link DmWorldEntryBlock}; the ONLY way a surface should mint one. */
|
|
426
|
+
export declare function dmWorldEntryBlock(reason: DmWorldEntryRenderBlockReason | null, message: string): DmWorldEntryBlock;
|
|
427
|
+
/** What the plan authorises. Only `'create'` costs anything. */
|
|
428
|
+
export type DmWorldEntryAction =
|
|
429
|
+
/** A world is live and the scene has not changed — `instruct` it (DM.12). */
|
|
430
|
+
'steer'
|
|
431
|
+
/** The frame already owns a permanent world — reopen it. Free and instant. */
|
|
432
|
+
| 'reopen'
|
|
433
|
+
/** Auto-fire is on and this is a scene change: create without asking. */
|
|
434
|
+
| 'create'
|
|
435
|
+
/** Create ONLY after an explicit operator confirmation. */
|
|
436
|
+
| 'confirm_required';
|
|
437
|
+
/** What is streaming right now, so the planner can prefer steering/reuse over a
|
|
438
|
+
* new billed world (owner `DM.12`). */
|
|
439
|
+
export interface DmLiveWorld {
|
|
440
|
+
handle: HappyOysterWorldHandle;
|
|
441
|
+
/** The `sequenceId` of the frame the live world was seeded from. A change is
|
|
442
|
+
* a CUT — that, and only that, is what justifies a new world. */
|
|
443
|
+
sequenceId?: string | null;
|
|
444
|
+
/**
|
|
445
|
+
* §Q `DM.62` — the FRAME the live world was seeded from. Optional and
|
|
446
|
+
* additive (client-core is published and `../Web-App` is pinned), but it is
|
|
447
|
+
* what makes scene identity decidable when the sequence anchor is null: 8 of
|
|
448
|
+
* 21 live frames carry no `sequenceId` and the ENDINGS are among them, so
|
|
449
|
+
* `sequenceId`-only identity collapsed every unanchored beat into one scene.
|
|
450
|
+
*/
|
|
451
|
+
frameId?: string | null;
|
|
452
|
+
/** The beat that frame was resolved from — the fallback identity for a host
|
|
453
|
+
* that knows the beat but not the frame id. */
|
|
454
|
+
beatId?: string | null;
|
|
455
|
+
}
|
|
456
|
+
/** One world this session opened — rail 2's "nothing hidden, nothing lost". */
|
|
457
|
+
export interface DmWorldSessionEntry {
|
|
458
|
+
handle: HappyOysterWorldHandle;
|
|
459
|
+
/** The frame it was seeded from, so a surface can show WHICH moment it is. */
|
|
460
|
+
frameId: string;
|
|
461
|
+
beatId: string | null;
|
|
462
|
+
/** How it came to exist — an auto-fired world is the one a player did not
|
|
463
|
+
* ask for by hand, so a surface can label it as such. */
|
|
464
|
+
trigger: 'auto' | 'confirmed' | 'reopen';
|
|
465
|
+
/** `Date.now()` at the launch attempt. */
|
|
466
|
+
openedAt: number;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Add a world to the session's list, de-duplicated by `encryptedWorldId`.
|
|
470
|
+
*
|
|
471
|
+
* Pure and returning a new array so a host can hold it in ordinary state. It is
|
|
472
|
+
* NOT the world-explorer demo's `worldHandleStore.saveStoredWorld` — that one
|
|
473
|
+
* PERSISTS a capped, newest-first list to `localStorage` for a dev host; this is
|
|
474
|
+
* the DM session's in-order record of what THIS session opened, and the durable
|
|
475
|
+
* home for a DM world is `StoryboardFrame.world_id`. Only the
|
|
476
|
+
* dedupe-on-encrypted-id rule is shared, and it is three lines.
|
|
477
|
+
*
|
|
478
|
+
* This is rail 2's data half: a world that is billed and permanent must be VISIBLE
|
|
479
|
+
* (the list is what a surface renders) and REACHABLE afterwards (the handle
|
|
480
|
+
* reopens it via `attachWorld`), including one whose `startTravel` failed.
|
|
481
|
+
*
|
|
482
|
+
* §Q `DM.24` — this list ALONE is not that rail: it is React state, so it is
|
|
483
|
+
* gone on reload while the worlds stay billed. A surface renders
|
|
484
|
+
* {@link collectDmWorldRecords}, which reads the durable frame bindings first
|
|
485
|
+
* and folds this list in; an entry that appears ONLY here is flagged with
|
|
486
|
+
* {@link DM_WORLD_UNRECORDED_NOTICE}.
|
|
487
|
+
*/
|
|
488
|
+
export declare function rememberDmWorldEntry(entries: readonly DmWorldSessionEntry[], entry: DmWorldSessionEntry): DmWorldSessionEntry[];
|
|
489
|
+
/**
|
|
490
|
+
* §Q `DM.24` — WHERE THE KNOWLEDGE OF A WORLD ACTUALLY LIVES.
|
|
491
|
+
*
|
|
492
|
+
* `'frame'` — read back off `StoryboardFrame.worldId`. DURABLE: it survives a
|
|
493
|
+
* reload, a different browser and a different operator, because the board is
|
|
494
|
+
* server state.
|
|
495
|
+
*
|
|
496
|
+
* `'session'` — present only in {@link rememberDmWorldEntry}'s in-memory list.
|
|
497
|
+
* The world EXISTS and IS BILLED, but no frame records it, so the id dies with
|
|
498
|
+
* the tab. This is the state {@link DM_WORLD_UNRECORDED_NOTICE} warns about and
|
|
499
|
+
* the reason this projection exists at all.
|
|
500
|
+
*/
|
|
501
|
+
export type DmWorldRecordSource = 'frame' | 'session'
|
|
502
|
+
/**
|
|
503
|
+
* §Q `MOMENT.8` — read back off `StoryboardFrame.supersededWorldIds`. The
|
|
504
|
+
* frame USED to open into it and a sibling replaced it. Just as DURABLE and
|
|
505
|
+
* just as BILLED as `'frame'`: HappyOyster exposes no delete, so a superseded
|
|
506
|
+
* world is permanent, and the id in the ledger is the only thing that can
|
|
507
|
+
* still reach it. It is listed for exactly that reason — the alternative,
|
|
508
|
+
* dropping it on replacement, is the orphaned-paid-world failure the
|
|
509
|
+
* supersede design exists to prevent.
|
|
510
|
+
*/
|
|
511
|
+
| 'superseded';
|
|
512
|
+
/**
|
|
513
|
+
* One world this story is known to own, from the DURABLE board first and the
|
|
514
|
+
* session's memory second.
|
|
515
|
+
*
|
|
516
|
+
* A projection, never storage: `collectDmWorldRecords` rebuilds it from the two
|
|
517
|
+
* inputs on every read, so no surface can hold a stale copy of which worlds
|
|
518
|
+
* exist.
|
|
519
|
+
*/
|
|
520
|
+
export interface DmWorldRecord {
|
|
521
|
+
/** The permanent HappyOyster `encryptedWorldId`. */
|
|
522
|
+
worldId: string;
|
|
523
|
+
/**
|
|
524
|
+
* The mode-fixed model that owns it, or `null` when NOTHING recorded it — a
|
|
525
|
+
* pre-`DM.30` binding, or a session entry (whose handle mode is what the
|
|
526
|
+
* session launched with, which is a fact, so it is carried).
|
|
527
|
+
*
|
|
528
|
+
* `null` is UNKNOWN, never a default. A reader that substitutes its own mode
|
|
529
|
+
* here re-creates the `[MODE_MISMATCH]` bug DM.30 fixed.
|
|
530
|
+
*/
|
|
531
|
+
mode: HappyOysterMode | null;
|
|
532
|
+
/** The frame that owns it. Always set — every record is anchored to a frame,
|
|
533
|
+
* including a session-only one (the launch resolved one to seed from). */
|
|
534
|
+
frameId: string;
|
|
535
|
+
beatId: string | null;
|
|
536
|
+
source: DmWorldRecordSource;
|
|
537
|
+
/** How it came to exist, when THIS session opened it; `null` for a world read
|
|
538
|
+
* back off the board that this session did not open. */
|
|
539
|
+
trigger: DmWorldSessionEntry['trigger'] | null;
|
|
540
|
+
/** `Date.now()` at this session's launch, or `null` as above. */
|
|
541
|
+
openedAt: number | null;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* What a surface must say about a `'session'`-source record.
|
|
545
|
+
*
|
|
546
|
+
* HappyOyster worlds are permanent, billed and UNLISTABLE — there is no
|
|
547
|
+
* vendor-side list to recover an id from. So a world whose frame binding never
|
|
548
|
+
* landed is reachable ONLY through the string on screen, and only until the page
|
|
549
|
+
* reloads. That is not a warning about a future risk; it is the current state.
|
|
550
|
+
*/
|
|
551
|
+
export declare const DM_WORLD_UNRECORDED_NOTICE = "This world exists and is billed, but no storyboard frame records it \u2014 copy the id now. HappyOyster worlds cannot be listed, so once this page reloads nothing can reach it again.";
|
|
552
|
+
/**
|
|
553
|
+
* Every world this story owns, DURABLE-FIRST — the data half of §Q `DM.24`.
|
|
554
|
+
*
|
|
555
|
+
* The problem it solves: `DmWorldSessionEntry[]` lives in React state, so a
|
|
556
|
+
* surface built on it alone shows nothing after a reload while the worlds it
|
|
557
|
+
* listed are still permanent and still billed. `StoryboardFrame.worldId` is the
|
|
558
|
+
* durable home (written by `DM.27`, mode-stamped by `DM.30`), so the board — not
|
|
559
|
+
* the session — is the primary source here and the session list only ADDS what
|
|
560
|
+
* the board does not yet know.
|
|
561
|
+
*
|
|
562
|
+
* Order: board order (`orderStoryboardFrames`) for durable records, then
|
|
563
|
+
* session-only records in the order they were opened. Durable first because
|
|
564
|
+
* that is the list that is still true tomorrow.
|
|
565
|
+
*
|
|
566
|
+
* A session entry whose world IS on the board enriches that durable record with
|
|
567
|
+
* `trigger`/`openedAt` rather than appearing twice — one world, one row, and the
|
|
568
|
+
* row still says it is safely recorded.
|
|
569
|
+
*/
|
|
570
|
+
export declare function collectDmWorldRecords(input: {
|
|
571
|
+
/** The board's ordering source of truth (`Storyboard.frameIds`). */
|
|
572
|
+
frameIds: readonly string[];
|
|
573
|
+
/** The detail read's frames, in any order. */
|
|
574
|
+
frames: readonly StoryboardFrame[];
|
|
575
|
+
/** This session's in-memory list (`rememberDmWorldEntry`). */
|
|
576
|
+
entries?: readonly DmWorldSessionEntry[];
|
|
577
|
+
}): DmWorldRecord[];
|
|
578
|
+
/**
|
|
579
|
+
* §Q `MOMENT.6b` — "N of M prepared", from the board alone.
|
|
580
|
+
*
|
|
581
|
+
* `preparedBeats` counts BEATS whose deterministic anchor frame already owns a
|
|
582
|
+
* permanent world, so play-time entry resolves to `'reopen'` (`attachWorld`,
|
|
583
|
+
* instant) instead of a 105-240 s cold build. `totalBeats` is every beat the
|
|
584
|
+
* board covers.
|
|
585
|
+
*
|
|
586
|
+
* Counted per BEAT and not per FRAME because that is the grain the world is
|
|
587
|
+
* minted at (design R3) and the grain play-time entry joins on: a board with 12
|
|
588
|
+
* frames over 6 beats and 6 worlds is FULLY prepared, and a frame-grain count
|
|
589
|
+
* would report it half done.
|
|
590
|
+
*/
|
|
591
|
+
export interface DmWorldPreparationSummary {
|
|
592
|
+
preparedBeats: number;
|
|
593
|
+
totalBeats: number;
|
|
594
|
+
/** `'4 of 6 prepared'` — one wording, so two surfaces cannot drift. */
|
|
595
|
+
label: string;
|
|
596
|
+
}
|
|
597
|
+
export declare function summarizeDmWorldPreparation(input: {
|
|
598
|
+
/** The board's ordering source of truth (`Storyboard.frameIds`). */
|
|
599
|
+
frameIds: readonly string[];
|
|
600
|
+
/** The detail read's frames, in any order. */
|
|
601
|
+
frames: readonly StoryboardFrame[];
|
|
602
|
+
}): DmWorldPreparationSummary;
|
|
603
|
+
/**
|
|
604
|
+
* §Q `DM.24` — the reopen affordance's own refusal.
|
|
605
|
+
*
|
|
606
|
+
* The row's reopen button plans through {@link planDmWorldEntry} rather than
|
|
607
|
+
* building a handle by hand, so the plan is checked to be a `'reopen'` OF THE
|
|
608
|
+
* CLICKED WORLD before it runs. It can legitimately not be: several frames may
|
|
609
|
+
* carry the same `beatId` and {@link resolveDmWorldEntryFrame} prefers a
|
|
610
|
+
* RENDERED one, so the beat can resolve to a frame that owns a DIFFERENT world
|
|
611
|
+
* (or none). Opening the resolver's choice anyway would mean opening the wrong
|
|
612
|
+
* PAID asset, so this says so instead.
|
|
613
|
+
*/
|
|
614
|
+
export declare const DM_WORLD_REOPEN_UNRESOLVED_MESSAGE = "This world's beat now resolves to a different storyboard frame, so reopening from here could open the wrong world. Open it from that frame on the board instead.";
|
|
615
|
+
/**
|
|
616
|
+
* §Q `WORLD.1-A` — what a surface tells a player who reached the world pane
|
|
617
|
+
* without naming a world. Paired with the `world_not_chosen` block reason.
|
|
618
|
+
*/
|
|
619
|
+
export declare const DM_WORLD_NOT_CHOSEN_MESSAGE = "HappyOyster worlds belong to a storyboard frame, so this surface opens one you pick rather than guessing. Choose a world from the list beside the video.";
|
|
620
|
+
/**
|
|
621
|
+
* §Q `WORLD.1-A` — THE ONE DECISION BEHIND A "REOPEN THIS WORLD" CLICK.
|
|
622
|
+
*
|
|
623
|
+
* Pure, and shared by every surface that lists {@link collectDmWorldRecords}:
|
|
624
|
+
* the DM play episode and the viewer both offer the same button and both must
|
|
625
|
+
* refuse the same way. It was written once in `DmExperienceLayout` and copied
|
|
626
|
+
* nowhere — this exists so it stays that way now the viewer has the affordance
|
|
627
|
+
* too.
|
|
628
|
+
*
|
|
629
|
+
* The guard is two conditions, and dropping either one turns a free reattach
|
|
630
|
+
* into a paid mistake: the plan must be a `'reopen'` (a `'create'` would mint a
|
|
631
|
+
* SECOND permanent world for a button labelled "reopen"), and its handle must be
|
|
632
|
+
* THE CLICKED WORLD (the beat can resolve to a frame owning a different one).
|
|
633
|
+
*
|
|
634
|
+
* `planned === null` means the host could not reach the planner at all — no
|
|
635
|
+
* board in hand — which is a refusal like any other here, not a licence to open.
|
|
636
|
+
*/
|
|
637
|
+
export declare function dmWorldReopenDecision(record: DmWorldRecord, planned: DmWorldEntryPlanResult | null): {
|
|
638
|
+
plan: DmWorldEntryPlan;
|
|
639
|
+
blocked: null;
|
|
640
|
+
} | {
|
|
641
|
+
plan: null;
|
|
642
|
+
blocked: DmWorldEntryBlock;
|
|
643
|
+
};
|
|
644
|
+
/**
|
|
645
|
+
* Whether a failed launch was the vendor's CONTENT refusal of this beat's scene
|
|
646
|
+
* (403004 moderation / 403005 copyright — `classifyHappyOysterError` collapses
|
|
647
|
+
* both). That refusal is about the seed and prompt, so a different beat's world
|
|
648
|
+
* can still open, which is what makes {@link dmWorldContentRefusalRoutes} the
|
|
649
|
+
* recourse. No other launch failure gets those routes: a transport fault or a
|
|
650
|
+
* credits refusal fails the next beat exactly the same way.
|
|
651
|
+
*/
|
|
652
|
+
export declare function dmWorldLaunchIsContentRefusal(reason: HappyOysterFailureReason | string | null | undefined): boolean;
|
|
653
|
+
/** One beat a content-refused entry can go to instead. */
|
|
654
|
+
export interface DmWorldRefusalRoute {
|
|
655
|
+
/** The board-space beat id — what `planDmWorldEntry` joins on. */
|
|
656
|
+
beatId: string;
|
|
657
|
+
/** The frame the planner resolved for it. */
|
|
658
|
+
frameId: string;
|
|
659
|
+
/**
|
|
660
|
+
* What the planner authorised: `'reopen'` (the frame already owns a world —
|
|
661
|
+
* free, and nothing new is submitted to moderation) or `'confirm_required'`
|
|
662
|
+
* (a NEW, billed world, which still asks before anything is spent).
|
|
663
|
+
*/
|
|
664
|
+
action: DmWorldEntryAction;
|
|
665
|
+
/** `Beat 3 — the vault`, or `Beat <raw id>` when the graph lacks the beat. */
|
|
666
|
+
label: string;
|
|
667
|
+
/** What choosing it does, in one clause. */
|
|
668
|
+
hint: string;
|
|
669
|
+
}
|
|
670
|
+
export declare const DM_WORLD_REFUSAL_ROUTE_REOPEN_HINT = "reopens the world this beat already owns";
|
|
671
|
+
export declare const DM_WORLD_REFUSAL_ROUTE_BUILD_HINT = "builds this beat\u2019s world \u2014 asks you first";
|
|
672
|
+
/** The sentence above the routes. */
|
|
673
|
+
export declare const DM_WORLD_CONTENT_REFUSAL_ROUTES_LEAD = "The world model refused this beat\u2019s scene on content grounds. That refusal is about this beat only \u2014 another beat\u2019s world can still open:";
|
|
674
|
+
/**
|
|
675
|
+
* What the card says when no other beat can be entered. Said in words, because
|
|
676
|
+
* an empty list under a refusal is the same dead end this row removes.
|
|
677
|
+
*/
|
|
678
|
+
export declare const DM_WORLD_CONTENT_REFUSAL_NO_ROUTE = "The world model refused this beat\u2019s scene on content grounds, and no other beat on this story\u2019s board has a world or a drawn frame to open one from yet. Carry on in the chat \u2014 the refusal is about this beat, not the story.";
|
|
679
|
+
/**
|
|
680
|
+
* The control under {@link DM_WORLD_CONTENT_REFUSAL_NO_ROUTE}. The routes are
|
|
681
|
+
* planned from the board the episode read when it opened, and a session board
|
|
682
|
+
* is still drawing frames for minutes after launch — so "nothing else can open
|
|
683
|
+
* yet" from that read is exactly when re-reading the board is the way out.
|
|
684
|
+
*/
|
|
685
|
+
export declare const DM_WORLD_CONTENT_REFUSAL_RECHECK_LABEL = "Check the board again";
|
|
686
|
+
/**
|
|
687
|
+
* §Q `DM.67` — the beats a content-refused entry can go to instead.
|
|
688
|
+
*
|
|
689
|
+
* Every beat on the board other than the refused ones, in board order, kept
|
|
690
|
+
* only when {@link planDmWorldEntry} authorises an entry for it. Reopens come
|
|
691
|
+
* first: they are free, and attaching an existing world submits nothing new to
|
|
692
|
+
* the moderation that just refused. Planned WITHOUT auto-fire, so a route that
|
|
693
|
+
* would mint a world arrives as `'confirm_required'` and the pane still parks
|
|
694
|
+
* it on the consent card.
|
|
695
|
+
*/
|
|
696
|
+
export declare function dmWorldContentRefusalRoutes(input: {
|
|
697
|
+
/** The board's ordering source of truth (`Storyboard.frameIds`). */
|
|
698
|
+
frameIds: readonly string[];
|
|
699
|
+
/** The detail read's frames, in any order. */
|
|
700
|
+
frames: readonly StoryboardFrame[];
|
|
701
|
+
/** The mode-fixed model this session runs on. */
|
|
702
|
+
mode: HappyOysterMode;
|
|
703
|
+
/** Every beat the vendor refused on content grounds in this pane so far. */
|
|
704
|
+
refusedBeatIds: readonly string[];
|
|
705
|
+
/** The story-graph beats, for the label. Absent ⇒ `Beat <raw id>`. */
|
|
706
|
+
beatById?: ReadonlyMap<string, BeatView>;
|
|
707
|
+
}): DmWorldRefusalRoute[];
|
|
708
|
+
/** A resolved, authorised world entry. Produced ONLY by
|
|
709
|
+
* {@link planDmWorldEntry}; {@link launchDmWorldEntry} takes nothing else. */
|
|
710
|
+
export interface DmWorldEntryPlan {
|
|
711
|
+
action: DmWorldEntryAction;
|
|
712
|
+
/** The deterministically resolved seed frame. */
|
|
713
|
+
frame: StoryboardFrame;
|
|
714
|
+
/** The mode-fixed model this entry runs on (host-supplied — see the module
|
|
715
|
+
* docblock's PARKED note). */
|
|
716
|
+
mode: HappyOysterMode;
|
|
717
|
+
/** The permanent world to reopen/steer — non-null on `'reopen'`/`'steer'`. */
|
|
718
|
+
handle: HappyOysterWorldHandle | null;
|
|
719
|
+
/**
|
|
720
|
+
* The composed prompt (frame prompt + atmosphere), inside the vendor cap. The
|
|
721
|
+
* create prompt on `'create'`/`'confirm_required'`; the `instruct` text on
|
|
722
|
+
* `'steer'`. Empty on `'reopen'`, which sends no prompt.
|
|
723
|
+
*/
|
|
724
|
+
prompt: string;
|
|
725
|
+
/** The frame image to fetch BYTES from — never handed to the vendor as a
|
|
726
|
+
* URL. Null on `'reopen'`/`'steer'`, which create nothing. */
|
|
727
|
+
seedImageUrl: string | null;
|
|
728
|
+
/**
|
|
729
|
+
* Rail 3/4 — how long the surface should let an AUTO-FIRED world run before
|
|
730
|
+
* stopping it, in ms. Null when the entry was not auto-fired: a player who
|
|
731
|
+
* asked for the world by hand is not yanked out of it on a timer.
|
|
732
|
+
*/
|
|
733
|
+
autoStopAfterMs: number | null;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Whether an action would MINT a new permanent, billed world (`'create'` now,
|
|
737
|
+
* `'confirm_required'` once an operator confirms). Derived from the action
|
|
738
|
+
* rather than stored on the plan, so no plan can carry a stale flag.
|
|
739
|
+
*/
|
|
740
|
+
export declare function dmWorldEntryWouldCreateWorld(action: DmWorldEntryAction): boolean;
|
|
741
|
+
/** A plan, or the reason there is none. */
|
|
742
|
+
export type DmWorldEntryPlanResult = {
|
|
743
|
+
ok: true;
|
|
744
|
+
plan: DmWorldEntryPlan;
|
|
745
|
+
} | {
|
|
746
|
+
ok: false;
|
|
747
|
+
reason: DmWorldEntryBlockReason;
|
|
748
|
+
message: string;
|
|
749
|
+
};
|
|
750
|
+
export interface DmWorldEntryPlanInput {
|
|
751
|
+
/** The board's ordering source of truth (`Storyboard.frameIds`). */
|
|
752
|
+
frameIds: readonly string[];
|
|
753
|
+
/** The detail read's frames, in any order. */
|
|
754
|
+
frames: readonly StoryboardFrame[];
|
|
755
|
+
/** The beat the party is standing on — the deterministic join key. */
|
|
756
|
+
activeBeatId: string | null | undefined;
|
|
757
|
+
/**
|
|
758
|
+
* The DM tag's free-text `prompt`. **Atmosphere only**: it is appended to the
|
|
759
|
+
* frame's compiled prompt and can never select or replace the seed.
|
|
760
|
+
*/
|
|
761
|
+
atmosphere?: string | null;
|
|
762
|
+
/** The mode-fixed HappyOyster model the host will connect to. */
|
|
763
|
+
mode: HappyOysterMode;
|
|
764
|
+
/** Rail 1 — the player's "let the DM open worlds on its own" setting.
|
|
765
|
+
* Defaults to {@link DM_WORLD_AUTO_FIRE_DEFAULT} (`false`). */
|
|
766
|
+
autoFireEnabled?: boolean;
|
|
767
|
+
/** The world currently streaming, if any (owner `DM.12` — steer it instead of
|
|
768
|
+
* minting a new one unless the scene changed). */
|
|
769
|
+
liveWorld?: DmLiveWorld | null;
|
|
770
|
+
/** Rail 4 — the studio-configured auto-stop interval. Defaults to
|
|
771
|
+
* {@link DM_WORLD_AUTO_STOP_MS_DEFAULT} (30 s). */
|
|
772
|
+
autoStopAfterMs?: number;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Resolve the ACTIVE BEAT to its board frame, deterministically.
|
|
776
|
+
*
|
|
777
|
+
* Board order (`frameIds`) is the tie-break, so the same beat always resolves
|
|
778
|
+
* to the same frame for every player of the story. A beat with several frames
|
|
779
|
+
* prefers the first that has actually RENDERED — an unrendered frame has no
|
|
780
|
+
* seed, and silently seeding from a later beat would be worse than reporting
|
|
781
|
+
* nothing.
|
|
782
|
+
*
|
|
783
|
+
* Returns `null` when the beat is absent or no frame carries it.
|
|
784
|
+
*/
|
|
785
|
+
export declare function resolveDmWorldEntryFrame(input: {
|
|
786
|
+
frameIds: readonly string[];
|
|
787
|
+
frames: readonly StoryboardFrame[];
|
|
788
|
+
activeBeatId: string | null | undefined;
|
|
789
|
+
}): StoryboardFrame | null;
|
|
790
|
+
/**
|
|
791
|
+
* How many characters {@link composeDmWorldPrompt} holds back from the frame's
|
|
792
|
+
* compacted prompt so the DM tag's atmosphere survives (§Q `DM.21`).
|
|
793
|
+
*
|
|
794
|
+
* The prefix plus enough of the atmosphere to be worth appending —
|
|
795
|
+
* {@link DM_WORLD_ATMOSPHERE_MIN_CHARS}, the floor the module already used to
|
|
796
|
+
* decide a stub was not worth shipping — or the WHOLE atmosphere when it is
|
|
797
|
+
* shorter than that floor, because reserving more ceremony than the text needs
|
|
798
|
+
* would shed board context for nothing.
|
|
799
|
+
*
|
|
800
|
+
* `0` for an empty atmosphere: nothing to seat, so the frame gets the full cap.
|
|
801
|
+
*/
|
|
802
|
+
export declare function dmWorldAtmosphereReservation(atmosphere: string): number;
|
|
803
|
+
/**
|
|
804
|
+
* Compose the prompt: the frame's SERVER-COMPILED prompt text, COMPACTED to
|
|
805
|
+
* the vendor cap, plus the DM tag's atmosphere.
|
|
806
|
+
*
|
|
807
|
+
* The base is `FrameVariant.promptText` — the exact string the storyboard
|
|
808
|
+
* worker sent for this frame — deliberately NOT a client-side re-flattening of
|
|
809
|
+
* `FramePrompt`. `compiled_text()` is server-side by design (`FramePrompt`'s
|
|
810
|
+
* docblock) and a second flattener here would be a second source of truth for
|
|
811
|
+
* what a frame looks like.
|
|
812
|
+
*
|
|
813
|
+
* §Q `SB.34` — read through `promptFrameVariant`, NOT `displayFrameVariant`.
|
|
814
|
+
* The latter is succeeded-only (correctly, for images), which meant a frame
|
|
815
|
+
* whose render was refused reported no prompt at all and blocked the beat as if
|
|
816
|
+
* it had never been storyboarded. The prompt is composed BEFORE the image call
|
|
817
|
+
* and is not what failed, so a failed variant's text is a real answer here even
|
|
818
|
+
* though its (absent) image is not. This is the accessor split the row calls
|
|
819
|
+
* for: image display keeps the succeeded-only rule untouched.
|
|
820
|
+
*
|
|
821
|
+
* §Q `DM.18` — `compiled_text` is budgeted against `PROMPT_TEXT_MAX_LEN * 4`
|
|
822
|
+
* and a real frame compiles past {@link HAPPY_OYSTER_PROMPT_MAX_CHARS}, so the
|
|
823
|
+
* base runs through {@link compactFramePromptText} first. That sheds whole
|
|
824
|
+
* semantic units (reference addressing, arc stakes, themes) in a fixed
|
|
825
|
+
* ceremony-first order and NEVER touches the `Action` line — see that module
|
|
826
|
+
* for why truncation is not an option here. A base already inside the cap comes
|
|
827
|
+
* back byte-identical.
|
|
828
|
+
*
|
|
829
|
+
* A frame whose `Action` alone exceeds the cap stays over it: this returns the
|
|
830
|
+
* fully-shed text and `planDmWorldEntry`'s `happyOysterPromptIssue` check
|
|
831
|
+
* reports `prompt_invalid` with the real overflow, rather than launching a
|
|
832
|
+
* world built from half a beat.
|
|
833
|
+
*
|
|
834
|
+
* §Q `DM.21` — DM.18 left the real frame at 1999 of 2000, so the DM tag's own
|
|
835
|
+
* text no longer fit and was dropped. `DM.19` established that the world tracks
|
|
836
|
+
* the storyboard's PROSE, which makes that drop the loss of the INTERACTIVE
|
|
837
|
+
* half of the entry: the world gets built from the board alone and the DM's
|
|
838
|
+
* live scene intent is silently discarded. So the atmosphere's room is now
|
|
839
|
+
* RESERVED before compaction — and taken from CEREMONY only
|
|
840
|
+
* (`shedTiers: ['ceremony']`), never from the cast, the setting or the action.
|
|
841
|
+
* That honours the ratified "the frame is never the thing that gets cut"
|
|
842
|
+
* precedence rather than inverting it: ceremony is not the frame's substance.
|
|
843
|
+
* When ceremony alone cannot free the reservation, the reservation is abandoned
|
|
844
|
+
* and the full-cap compaction stands — the frame still wins.
|
|
845
|
+
*
|
|
846
|
+
* Returns `null` when the frame carries no compiled prompt.
|
|
847
|
+
*/
|
|
848
|
+
export declare function composeDmWorldPrompt(frame: StoryboardFrame, atmosphere?: string | null): string | null;
|
|
849
|
+
/**
|
|
850
|
+
* §Q `DM.62` — is the live world's scene the SAME scene as this frame's?
|
|
851
|
+
*
|
|
852
|
+
* The steer-vs-create decision hangs on this one predicate, and it used to be
|
|
853
|
+
* `(liveWorld.sequenceId ?? null) === (frame.sequenceId ?? null)`. A null
|
|
854
|
+
* sequence anchor is not an identity: it means "this frame is not anchored to a
|
|
855
|
+
* sequence", and TWO of those compared EQUAL. Measured 2026-08-02: 8 of 21 live
|
|
856
|
+
* frames have a null `sequenceId` and every ENDING is one of them, so a world
|
|
857
|
+
* opened on any unanchored beat was re-aimed at the ending's prompt instead of
|
|
858
|
+
* the ending getting its own world — permanently, for the rest of the session.
|
|
859
|
+
*
|
|
860
|
+
* The rule, in order, so DM.12's spend rail survives intact:
|
|
861
|
+
*
|
|
862
|
+
* 1. **Same frame ⇒ `'same'`.** An exact identity, and the case that must
|
|
863
|
+
* never mint a second world for one frame.
|
|
864
|
+
* 2. **Both anchored ⇒ compare the anchors.** This is DM.12 unchanged: two
|
|
865
|
+
* different frames of the same sequence are one scene and get a steer.
|
|
866
|
+
* 3. **Unanchored and the frame ids differ ⇒ `'changed'`.** This is the row.
|
|
867
|
+
* 4. **Neither anchored, no frame id ⇒ compare the beat**, when the host
|
|
868
|
+
* recorded one.
|
|
869
|
+
* 5. **Otherwise `'unknown'`** — NOT `'changed'`. The third value is the
|
|
870
|
+
* point (codex P1 on #1663): a host that records no identity at all
|
|
871
|
+
* cannot be said to have changed scene either, and collapsing that into
|
|
872
|
+
* "changed" would let an explicit `autoFireEnabled: true` MINT A BILLED
|
|
873
|
+
* WORLD for a scene that may already be streaming. `planDmWorldEntry`
|
|
874
|
+
* routes `'unknown'` to `confirm_required` — a question, never a bill.
|
|
875
|
+
*/
|
|
876
|
+
export type DmWorldSceneRelation = 'same' | 'changed' | 'unknown';
|
|
877
|
+
export declare function dmWorldEntrySceneRelation(liveWorld: DmLiveWorld, frame: StoryboardFrame): DmWorldSceneRelation;
|
|
878
|
+
/**
|
|
879
|
+
* Decide what a DM world entry may do, from deterministic state only.
|
|
880
|
+
*
|
|
881
|
+
* Every failure path lands here — BEFORE `connect`, before `createWorld`, so
|
|
882
|
+
* before anything is billed. Exactly one branch mints a billed world
|
|
883
|
+
* (`'create'`), and it requires BOTH the player's auto-fire setting AND a
|
|
884
|
+
* genuine scene change; everything else steers, reopens, or asks.
|
|
885
|
+
*/
|
|
886
|
+
export declare function planDmWorldEntry(input: DmWorldEntryPlanInput): DmWorldEntryPlanResult;
|
|
887
|
+
export interface DmWorldEntryLaunchOptions {
|
|
888
|
+
/**
|
|
889
|
+
* The prepared seed BYTES. REQUIRED for any create — the launcher never falls
|
|
890
|
+
* back to `firstFrameImageUrl` (see the module docblock).
|
|
891
|
+
*/
|
|
892
|
+
seed?: PreparedHappyOysterSeed;
|
|
893
|
+
/**
|
|
894
|
+
* Explicit operator confirmation. The ONLY thing that unlocks a
|
|
895
|
+
* `confirm_required` plan, i.e. the only way a world is created while the
|
|
896
|
+
* player's auto-fire setting is off. A directive can never set this.
|
|
897
|
+
*/
|
|
898
|
+
operatorConfirmed?: boolean;
|
|
899
|
+
/**
|
|
900
|
+
* Rail 2 — persist/record the permanent handle.
|
|
901
|
+
*
|
|
902
|
+
* Called at THREE points (§Q `DM.43`), de-duplicated so ONE world is written
|
|
903
|
+
* once: at MINT time (the instant `createWorld` yields an id, before
|
|
904
|
+
* `startTravel`), on success, and on a failure that nevertheless created a
|
|
905
|
+
* world (`HappyOysterLaunchError.handle`). Worlds are permanent with no
|
|
906
|
+
* listing API, and `startTravel` can occupy minutes, so waiting for either
|
|
907
|
+
* settle-time offer leaves a long window in which a reload orphans a billed
|
|
908
|
+
* asset.
|
|
909
|
+
*
|
|
910
|
+
* Return `false` ({@link DmWorldHandleRecorded}) when the write did NOT land,
|
|
911
|
+
* so a later offer retries it; returning nothing means recorded. A throw is
|
|
912
|
+
* treated the same as `false`, and is additionally swallowed on the failure
|
|
913
|
+
* path so the ORIGINAL launch error still reaches the caller.
|
|
914
|
+
*/
|
|
915
|
+
onWorldHandle?: (handle: HappyOysterWorldHandle, entry: DmWorldSessionEntry) => DmWorldHandleRecorded | void | Promise<DmWorldHandleRecorded | void>;
|
|
916
|
+
jwt?: string;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* §Q `DM.43` — whether a handle offer actually LANDED somewhere durable.
|
|
920
|
+
*
|
|
921
|
+
* `false` means the write failed and the world is still unrecorded, so the
|
|
922
|
+
* launcher must offer the handle again at its next opportunity. Returning
|
|
923
|
+
* nothing means "recorded", which keeps every pre-existing caller behaving
|
|
924
|
+
* exactly as before.
|
|
925
|
+
*
|
|
926
|
+
* This exists because the DM host's `bindWorldToFrame` reports a failed write
|
|
927
|
+
* by RESOLVING with `{status: 'unavailable'}` rather than throwing — so a
|
|
928
|
+
* launcher that treated "did not throw" as "recorded" would mark the world done
|
|
929
|
+
* on a transient API outage and never retry it. A 409 conflict is NOT such a
|
|
930
|
+
* case: it is a durable answer (the frame already owns another world) that
|
|
931
|
+
* retrying cannot improve.
|
|
932
|
+
*/
|
|
933
|
+
export type DmWorldHandleRecorded = boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Execute a {@link planDmWorldEntry} plan. This is the ONLY place a DM world
|
|
936
|
+
* entry reaches `createWorld`, and it refuses three things outright:
|
|
937
|
+
*
|
|
938
|
+
* - a `confirm_required` plan without `operatorConfirmed: true` (i.e. auto-fire
|
|
939
|
+
* off and nobody confirmed);
|
|
940
|
+
* - a create with no prepared seed bytes;
|
|
941
|
+
* - anything the underlying launcher already refuses (prompt cap, mode
|
|
942
|
+
* mismatch, …).
|
|
943
|
+
*
|
|
944
|
+
* All three throw a {@link HappyOysterLaunchError} before a session is opened.
|
|
945
|
+
* A `'steer'` plan is NOT launched here, and no second executor is owed: the
|
|
946
|
+
* adapter-agnostic steer path already shipped as §Q DM.14 — the pane registers
|
|
947
|
+
* a steer closure (`useExperienceSource.registerWorldSteer`) and client-core's
|
|
948
|
+
* `resolveWorldSteerCommand(adapterId)` maps it to the live model's verb
|
|
949
|
+
* (HappyOyster → `instruct`). A steer plan feeds that, not this launcher.
|
|
950
|
+
*/
|
|
951
|
+
export declare function launchDmWorldEntry(plan: DmWorldEntryPlan, bridge: HappyOysterBridge, options?: DmWorldEntryLaunchOptions): Promise<HappyOysterLaunchResult>;
|
|
952
|
+
/**
|
|
953
|
+
* WHAT WAS MEASURED. CHECKPOINT-2 (2026-08-02,
|
|
954
|
+
* `~/.seer-e2e/checkpoint2-0802-verdicts.md` §B5) sampled the SAME world
|
|
955
|
+
* `<video>` every 10 s with no user action in between:
|
|
956
|
+
*
|
|
957
|
+
* ```
|
|
958
|
+
* s8 {readyState: 4, 864x480, currentTime: 55.893, paused: false}
|
|
959
|
+
* s9 {readyState: 0, 0x0, currentTime: 0, paused: true }
|
|
960
|
+
* ```
|
|
961
|
+
*
|
|
962
|
+
* and `checkpoint2-0802-worldplay-final-1440.png`, taken after that drop, still
|
|
963
|
+
* shows the `● You're in the world` badge, *"The DM is narrating"*, and the
|
|
964
|
+
* transport bar over a black pane. No error, no ended state, no way back in.
|
|
965
|
+
*
|
|
966
|
+
* WHY THE VENDOR'S OWN EVENT IS NOT ENOUGH. The SDK receives the RTC
|
|
967
|
+
* `streamStop` and DELIBERATELY DISCARDS IT — its bundle logs *"Travel RTC
|
|
968
|
+
* event: streamStop ignored, rely on status heartbeat"* — and its runtime
|
|
969
|
+
* monitor answers a dead `<video>` by asking the backend for a status, which
|
|
970
|
+
* reaches the client as `statusChanged('completed')` only if that request
|
|
971
|
+
* agrees. In the measured failure the badge was still live and the transport
|
|
972
|
+
* button still enabled, i.e. the client phase never left `streaming`. **So the
|
|
973
|
+
* render element is the signal that is always present**, and the two facade
|
|
974
|
+
* signals corroborate rather than lead.
|
|
975
|
+
*
|
|
976
|
+
* WHAT THIS SECTION DECIDES, and what it deliberately does not. It decides
|
|
977
|
+
* whether the stream a surface is CLAIMING is still there, and what to say when
|
|
978
|
+
* it is not. It decides NOTHING about *why* the vendor stops at ~t+68 s —
|
|
979
|
+
* whether that is the travel's natural end or a duration limit is `DM.57`'s
|
|
980
|
+
* open measurement and belongs to the vendor thread.
|
|
981
|
+
*/
|
|
982
|
+
export type DmWorldStreamEndReason =
|
|
983
|
+
/** The SDK reported the travel `completed` — authoritative, vendor-side. */
|
|
984
|
+
'travel_completed'
|
|
985
|
+
/** The client left the `streaming` phase without a completed travel: the
|
|
986
|
+
* session dropped, or the SDK tore the travel down itself. */
|
|
987
|
+
| 'session_ended'
|
|
988
|
+
/** The render element is at `HAVE_NOTHING` while a live world is claimed. A
|
|
989
|
+
* rebuffering stream sits at 2/3 and fires `waiting`/`stalled`; it does not
|
|
990
|
+
* drop to 0. This is the reading CHECKPOINT-2 captured. */
|
|
991
|
+
| 'video_gone'
|
|
992
|
+
/** The element still holds media but no new frame has arrived for
|
|
993
|
+
* {@link DM_WORLD_STREAM_SILENCE_MS}. */
|
|
994
|
+
| 'video_silent';
|
|
995
|
+
/** Every reason, for runtime validation by a probe or a coherence check. */
|
|
996
|
+
export declare const DM_WORLD_STREAM_END_REASONS: readonly DmWorldStreamEndReason[];
|
|
997
|
+
/**
|
|
998
|
+
* `HTMLMediaElement.HAVE_NOTHING`. Named because the whole `video_gone` verdict
|
|
999
|
+
* turns on it and a bare `0` at a comparison site reads as a placeholder.
|
|
1000
|
+
*/
|
|
1001
|
+
export declare const HTML_MEDIA_HAVE_NOTHING = 0;
|
|
1002
|
+
/**
|
|
1003
|
+
* How long the render may go without a new frame before the stream is called
|
|
1004
|
+
* dead, in ms.
|
|
1005
|
+
*
|
|
1006
|
+
* DELIBERATELY LONGER THAN THE SDK'S OWN CONFIRM DELAY. The SDK's runtime
|
|
1007
|
+
* monitor debounces a `waiting`/`stalled`/`suspend` by
|
|
1008
|
+
* `DEFAULT_VIDEO_ISSUE_CONFIRM_DELAY_MS = 3000` and then re-checks whether the
|
|
1009
|
+
* element became playable again — i.e. the vendor treats sub-3 s silence as
|
|
1010
|
+
* ordinary rebuffering. A host bound at or below that would paint "the stream
|
|
1011
|
+
* ended" over a stream the SDK is about to recover, which is the same
|
|
1012
|
+
* dishonest surface this row exists to remove, pointing the other way. 15 s is
|
|
1013
|
+
* five times the vendor's own tolerance and still well inside the 10 s
|
|
1014
|
+
* sampling interval that caught the real failure.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare const DM_WORLD_STREAM_SILENCE_MS = 15000;
|
|
1017
|
+
/**
|
|
1018
|
+
* What a host reads off the world render element.
|
|
1019
|
+
*
|
|
1020
|
+
* Deliberately NOT the element's own `paused`: it is `true` under the player's
|
|
1021
|
+
* own Pause, under an autoplay refusal and under a dead stream alike, so it
|
|
1022
|
+
* decides nothing this reducer does not already decide better. A paused
|
|
1023
|
+
* element that is not the player's doing stops `currentTime`, which the silence
|
|
1024
|
+
* bound catches.
|
|
1025
|
+
*/
|
|
1026
|
+
export interface DmWorldStreamSample {
|
|
1027
|
+
/** `HTMLMediaElement.readyState`. */
|
|
1028
|
+
readyState: number;
|
|
1029
|
+
currentTime: number;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* How long an INFERRED end must persist before a surface may state it, in ms.
|
|
1033
|
+
*
|
|
1034
|
+
* Longer than the SDK's own `DEFAULT_VIDEO_ISSUE_CONFIRM_DELAY_MS = 3000`
|
|
1035
|
+
* rebuffer-confirm delay, for the same reason the silence bound is: a single
|
|
1036
|
+
* sample at `HAVE_NOTHING` — a source swap, a reload, a brief rebuffer — is not
|
|
1037
|
+
* yet a dead stream, and painting the ended notice on it is the mirror of the
|
|
1038
|
+
* defect this row removes.
|
|
1039
|
+
*/
|
|
1040
|
+
export declare const DM_WORLD_STREAM_DEAD_CONFIRM_MS = 4000;
|
|
1041
|
+
/**
|
|
1042
|
+
* Whether a reason may be stated the moment it is first seen.
|
|
1043
|
+
*
|
|
1044
|
+
* Only the vendor-reported end is authoritative enough: `travel_completed` is
|
|
1045
|
+
* the SDK folding a server-side status into its own facade, so there is nothing
|
|
1046
|
+
* to confirm and nothing to recover from. Everything else is INFERRED from the
|
|
1047
|
+
* client's own view and must persist for {@link DM_WORLD_STREAM_DEAD_CONFIRM_MS}
|
|
1048
|
+
* before a surface says it out loud.
|
|
1049
|
+
*/
|
|
1050
|
+
export declare function dmWorldStreamEndIsImmediate(reason: DmWorldStreamEndReason): boolean;
|
|
1051
|
+
/** The SDK client phase that means the live stream is up. */
|
|
1052
|
+
export declare const HAPPY_OYSTER_PHASE_STREAMING = "streaming";
|
|
1053
|
+
/**
|
|
1054
|
+
* The `onTravelStatusChanged` value the SDK folds into its own facade state —
|
|
1055
|
+
* it is the one status on which `HappyOysterModel.handleTravelCompleted` runs.
|
|
1056
|
+
* Named here so a host compares against vendor vocabulary in one place instead
|
|
1057
|
+
* of spelling the literal at each call site.
|
|
1058
|
+
*/
|
|
1059
|
+
export declare const HAPPY_OYSTER_TRAVEL_STATUS_COMPLETED = "completed";
|
|
1060
|
+
export interface DmWorldStreamHealthInput {
|
|
1061
|
+
/** The SDK's `onTravelStatusChanged` reached `completed`. */
|
|
1062
|
+
travelCompleted: boolean;
|
|
1063
|
+
/** `HappyOysterModel.phase`. {@link HAPPY_OYSTER_PHASE_STREAMING} is the only
|
|
1064
|
+
* healthy value while a live world is claimed; `null`/`undefined` means the
|
|
1065
|
+
* host could not read one and the phase decides nothing. */
|
|
1066
|
+
clientPhase: string | null | undefined;
|
|
1067
|
+
/** The player pressed Pause. A paused world is HELD, not dead, so no
|
|
1068
|
+
* element-derived reason may fire while this is true. */
|
|
1069
|
+
userPaused: boolean;
|
|
1070
|
+
/** The render element's reading, or `null` when it could not be read. */
|
|
1071
|
+
sample: DmWorldStreamSample | null;
|
|
1072
|
+
/** Milliseconds since `currentTime` last advanced, or `null` when there is no
|
|
1073
|
+
* baseline yet (the first sample of a launch). */
|
|
1074
|
+
msSinceAdvance: number | null;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* Why the claimed-live world is not streaming, or `null` while it is fine.
|
|
1078
|
+
*
|
|
1079
|
+
* Pure, so a host can call it on a timer and a check can call it on a fixture.
|
|
1080
|
+
* Order is authority: a vendor-reported end outranks the client phase, which
|
|
1081
|
+
* outranks anything inferred from the element. Reversible BY CONSTRUCTION —
|
|
1082
|
+
* it reads only the current observation, so an element that starts advancing
|
|
1083
|
+
* again returns `null` and the surface goes back to claiming the world.
|
|
1084
|
+
*/
|
|
1085
|
+
export declare function dmWorldStreamEndReason(input: DmWorldStreamHealthInput): DmWorldStreamEndReason | null;
|
|
1086
|
+
/** What a surface renders when the stream is gone. */
|
|
1087
|
+
export interface DmWorldStreamEndedNotice {
|
|
1088
|
+
title: string;
|
|
1089
|
+
detail: string;
|
|
1090
|
+
/** The label for the re-entry affordance, or `null` when there is no recorded
|
|
1091
|
+
* world to go back to and the only honest offer is to leave. */
|
|
1092
|
+
action: string | null;
|
|
1093
|
+
}
|
|
1094
|
+
export declare const DM_WORLD_STREAM_ENDED_TITLE = "The world stopped streaming";
|
|
1095
|
+
export declare const DM_WORLD_REENTER_ACTION = "Re-enter the world";
|
|
1096
|
+
/**
|
|
1097
|
+
* The copy for a dead stream — one place, so no surface can keep claiming a
|
|
1098
|
+
* live world.
|
|
1099
|
+
*
|
|
1100
|
+
* The re-entry half is NOT decoration: a stream that stopped with no way back
|
|
1101
|
+
* leaves a black pane, which is the state this row was filed against. When a
|
|
1102
|
+
* handle exists the detail carries {@link DM_WORLD_REOPEN_NOTICE} verbatim,
|
|
1103
|
+
* because re-entering IS a reopen and `DM.17` already measured what a reopen
|
|
1104
|
+
* does — it returns to the opening scene. Restating that in different words
|
|
1105
|
+
* here would be a second source of truth for it.
|
|
1106
|
+
*/
|
|
1107
|
+
export declare function dmWorldStreamEndedNotice(reason: DmWorldStreamEndReason, options: {
|
|
1108
|
+
canReenter: boolean;
|
|
1109
|
+
}): DmWorldStreamEndedNotice;
|
|
1110
|
+
/**
|
|
1111
|
+
* The plan a re-entry runs — ALWAYS a `'reopen'`, never a mint.
|
|
1112
|
+
*
|
|
1113
|
+
* ⛔ THE SPEND RAIL LIVES HERE, NOT IN THE SURFACE. The obvious re-entry is
|
|
1114
|
+
* "run the plan again", and on a `'create'` / `'confirm_required'` plan that
|
|
1115
|
+
* CREATES A SECOND PERMANENT BILLED WORLD every time the vendor stops the
|
|
1116
|
+
* stream — a charge for a fault the player did not cause. This builder is
|
|
1117
|
+
* structurally incapable of returning a minting action:
|
|
1118
|
+
* {@link dmWorldEntryWouldCreateWorld} is `false` for every plan it can return,
|
|
1119
|
+
* and it returns `null` (⇒ the surface offers only the exit) when no permanent
|
|
1120
|
+
* handle exists to reopen.
|
|
1121
|
+
*
|
|
1122
|
+
* `prompt` and `seedImageUrl` are cleared because a reopen sends neither, and
|
|
1123
|
+
* `autoStopAfterMs` is cleared because a re-entry is an explicit player action
|
|
1124
|
+
* — the auto-stop rail exists for worlds the player did not ask for.
|
|
1125
|
+
*/
|
|
1126
|
+
export declare function dmWorldReentryPlan(plan: DmWorldEntryPlan | null, handle: HappyOysterWorldHandle | null): DmWorldEntryPlan | null;
|
|
1127
|
+
/**
|
|
1128
|
+
* WHAT WAS MEASURED. On the 2026-08-03 GP.21 walk
|
|
1129
|
+
* (`~/.seer-e2e/gp21-0803-walk.log`), `GET /stories/{id}/storyboards` returned
|
|
1130
|
+
* **429** inside the episode's opening request burst. The host's board effect
|
|
1131
|
+
* caught it, set only its settled flag, and left `board` null — on an effect
|
|
1132
|
+
* keyed `[apiClient, storyId, enabled]`, so nothing ever read again for the
|
|
1133
|
+
* lifetime of the mount. `planEntry` then returned null on every one of three
|
|
1134
|
+
* world-entry attempts and the pane rendered *"This story has no ratified
|
|
1135
|
+
* storyboard yet"* over storyboard `1f18e56a3f784a46a840e8d883e1b2b3`, which
|
|
1136
|
+
* was `succeeded` with 14/14 frames and returned 200 on a re-read minutes later.
|
|
1137
|
+
*
|
|
1138
|
+
* THE DEFECT IS THE CLAIM, NOT THE 429. One transient rate-limit told the player
|
|
1139
|
+
* a FALSE FACT, permanently, with no way to correct it short of a reload — and
|
|
1140
|
+
* the same false fact reached the harness, which reported it as GP.20 substrate
|
|
1141
|
+
* absence. (The burst itself is §Q `DM.74` and is not fixed here.)
|
|
1142
|
+
*
|
|
1143
|
+
* WHAT THIS SECTION OWNS: the vocabulary and the policy, pure and testable —
|
|
1144
|
+
* which read failures are worth retrying, how long to wait between attempts, and
|
|
1145
|
+
* what a surface says for each unsettled state. The timer and the effect stay in
|
|
1146
|
+
* the host, because they are React.
|
|
1147
|
+
*/
|
|
1148
|
+
/**
|
|
1149
|
+
* Where the host's board read has got to.
|
|
1150
|
+
*
|
|
1151
|
+
* `'absent'` and `'failed'` are the two that must never be collapsed: the first
|
|
1152
|
+
* is a read that SUCCEEDED and found no board, the second is a read that did not
|
|
1153
|
+
* succeed at all, so the story's board state is unknown.
|
|
1154
|
+
*/
|
|
1155
|
+
export type DmWorldBoardReadStatus =
|
|
1156
|
+
/** The first attempt is in flight. */
|
|
1157
|
+
'loading'
|
|
1158
|
+
/** An attempt failed retryably and another is scheduled or in flight. */
|
|
1159
|
+
| 'retrying'
|
|
1160
|
+
/** A board is in hand. */
|
|
1161
|
+
| 'loaded'
|
|
1162
|
+
/** The read SUCCEEDED and the story has no storyboard. */
|
|
1163
|
+
| 'absent'
|
|
1164
|
+
/** Every permitted attempt failed. The board state is UNKNOWN. */
|
|
1165
|
+
| 'failed';
|
|
1166
|
+
/** Every status, for runtime validation by a probe or a coherence check. */
|
|
1167
|
+
export declare const DM_WORLD_BOARD_READ_STATUSES: readonly DmWorldBoardReadStatus[];
|
|
1168
|
+
/** `429 Too Many Requests` — the status this row was filed against. Named
|
|
1169
|
+
* because a bare `429` at a comparison site reads as a placeholder. */
|
|
1170
|
+
export declare const HTTP_STATUS_TOO_MANY_REQUESTS = 429;
|
|
1171
|
+
/** The floor of the 5xx range: everything at or above it is a server-side
|
|
1172
|
+
* fault, i.e. not something this client asked for wrongly. */
|
|
1173
|
+
export declare const HTTP_STATUS_SERVER_ERROR_FLOOR = 500;
|
|
1174
|
+
/**
|
|
1175
|
+
* How many times the board read may be attempted in total, including the first.
|
|
1176
|
+
*
|
|
1177
|
+
* Three, not more: the read sits on the episode's own mount, so every extra
|
|
1178
|
+
* attempt is latency a player waits through before the DM can ground anything —
|
|
1179
|
+
* and the burst that produced the 429 is itself the thing more attempts would
|
|
1180
|
+
* feed. Exhausting these leaves a RETRYABLE block, so the ceiling costs the
|
|
1181
|
+
* player a click rather than the answer.
|
|
1182
|
+
*/
|
|
1183
|
+
export declare const DM_WORLD_BOARD_READ_MAX_ATTEMPTS = 3;
|
|
1184
|
+
/**
|
|
1185
|
+
* The wait before attempt N+1, in ms — one entry per retry, so its length is
|
|
1186
|
+
* {@link DM_WORLD_BOARD_READ_MAX_ATTEMPTS} minus the first attempt.
|
|
1187
|
+
*
|
|
1188
|
+
* Backed off rather than flat because the failure mode being retried is a rate
|
|
1189
|
+
* limit produced by a burst this read is part of; retrying immediately re-enters
|
|
1190
|
+
* the burst. Short in absolute terms because the whole schedule runs BEFORE the
|
|
1191
|
+
* player can be told anything true about the board.
|
|
1192
|
+
*/
|
|
1193
|
+
export declare const DM_WORLD_BOARD_READ_RETRY_DELAYS_MS: readonly number[];
|
|
1194
|
+
/**
|
|
1195
|
+
* Whether an HTTP status is worth another attempt.
|
|
1196
|
+
*
|
|
1197
|
+
* `null`/`undefined` — a transport failure with no response at all — IS
|
|
1198
|
+
* retryable: that is the offline blip and the aborted connection, neither of
|
|
1199
|
+
* which says anything about the board.
|
|
1200
|
+
*
|
|
1201
|
+
* A `404`/`403` is deliberately NOT retryable. Those are answers: retrying them
|
|
1202
|
+
* would spin a story that legitimately has no board (or that this viewer may not
|
|
1203
|
+
* read) through the full schedule before settling, which is latency bought for
|
|
1204
|
+
* nothing.
|
|
1205
|
+
*/
|
|
1206
|
+
export declare function isRetryableBoardReadStatus(status: number | null | undefined): boolean;
|
|
1207
|
+
/**
|
|
1208
|
+
* {@link isRetryableBoardReadStatus} against a thrown error.
|
|
1209
|
+
*
|
|
1210
|
+
* `http.ts` enriches every thrown request error with `.status` (§Q `AA.5c`), so
|
|
1211
|
+
* this branches on the status rather than pattern-matching a message — an error
|
|
1212
|
+
* carrying no status at all is a transport failure and retryable.
|
|
1213
|
+
*/
|
|
1214
|
+
export declare function dmWorldBoardReadIsRetryable(err: unknown): boolean;
|
|
1215
|
+
/**
|
|
1216
|
+
* How long to wait before the attempt that follows `attemptsMade`, or `null`
|
|
1217
|
+
* when no attempt is left.
|
|
1218
|
+
*
|
|
1219
|
+
* Takes the number of attempts ALREADY made, so a caller counting from 1 asks
|
|
1220
|
+
* the same question the schedule answers and there is no off-by-one to get
|
|
1221
|
+
* wrong at the call site.
|
|
1222
|
+
*/
|
|
1223
|
+
export declare function dmWorldBoardReadRetryDelayMs(attemptsMade: number): number | null;
|
|
1224
|
+
/** The message for a board read that has not settled yet. It states the state
|
|
1225
|
+
* and claims nothing about whether a board exists. */
|
|
1226
|
+
export declare const DM_WORLD_BOARD_READ_PENDING_MESSAGE = "The storyboard this world would be seeded from is still loading. Whether this story has a ratified board is not known yet \u2014 nothing has been decided against it.";
|
|
1227
|
+
/**
|
|
1228
|
+
* The message for a board read this session has stopped attempting — the
|
|
1229
|
+
* schedule was exhausted, or the failure was one retrying cannot resolve.
|
|
1230
|
+
*
|
|
1231
|
+
* It must say UNKNOWN, not absent: the whole row exists because a 429 was
|
|
1232
|
+
* rendered as *"this story has no ratified storyboard yet"* over a board that
|
|
1233
|
+
* was succeeded and 14/14. Deliberately claims no ATTEMPT COUNT — a
|
|
1234
|
+
* non-retryable failure settles here on the first one, and a message asserting
|
|
1235
|
+
* three would be its own small lie.
|
|
1236
|
+
*/
|
|
1237
|
+
export declare const DM_WORLD_BOARD_READ_FAILED_MESSAGE = "The storyboard could not be read, so it is unknown whether this story has one. This is a failed read, not a missing board \u2014 the story may well have a ratified storyboard that this session could not fetch.";
|
|
1238
|
+
/**
|
|
1239
|
+
* The host block for a board-read status, or `null` when the status carries no
|
|
1240
|
+
* block at all.
|
|
1241
|
+
*
|
|
1242
|
+
* `'loaded'` has a board, so the PLANNER decides and this must not speak over
|
|
1243
|
+
* it. `'absent'` is the one status that genuinely means no board — it keeps the
|
|
1244
|
+
* `reason: null` / {@link DM_WORLD_ENTRY_NO_BOARD_TITLE} rendering, which is now
|
|
1245
|
+
* true wherever it appears, because the two states that used to borrow it have
|
|
1246
|
+
* their own.
|
|
1247
|
+
*/
|
|
1248
|
+
/**
|
|
1249
|
+
* Whether a block came from the BOARD READ rather than from the planner.
|
|
1250
|
+
*
|
|
1251
|
+
* A host holds a block in state, so a block minted while the read was in flight
|
|
1252
|
+
* outlives the read unless something re-decides it. This is the predicate that
|
|
1253
|
+
* says which blocks are worth re-deciding when the read's status moves: a
|
|
1254
|
+
* planner refusal is a decision about the beat and does not become stale when a
|
|
1255
|
+
* board arrives, but a board-read block is nothing BUT a statement about the
|
|
1256
|
+
* read.
|
|
1257
|
+
*/
|
|
1258
|
+
export declare function dmWorldEntryBlockIsBoardRead(reason: DmWorldEntryRenderBlockReason | null): boolean;
|
|
1259
|
+
/**
|
|
1260
|
+
* §Q `DM.76` — whether this block is still IN FLIGHT rather than settled.
|
|
1261
|
+
*
|
|
1262
|
+
* Every other block reason is an ANSWER: the planner refused, the read failed,
|
|
1263
|
+
* the story has no board. `board_read_pending` is the one that says only *"ask
|
|
1264
|
+
* again in a moment"* — the read has not decided anything yet and the surface is
|
|
1265
|
+
* already doing the one thing that resolves it.
|
|
1266
|
+
*
|
|
1267
|
+
* That difference has to be readable by a surface, because a surface that
|
|
1268
|
+
* renders pending under the same handle as the settled blocks teaches every
|
|
1269
|
+
* reader — human and probe — that the entry is over. `golden-path.mjs` races
|
|
1270
|
+
* three TERMINAL selectors after a world directive, `dm-world-blocked` among
|
|
1271
|
+
* them, so a directive landing mid-read resolved that race on a state that was
|
|
1272
|
+
* about to become a live world and recorded the attempt as blocked. The
|
|
1273
|
+
* predicate lives here, beside the reasons, so no surface re-derives "is this
|
|
1274
|
+
* one still in flight" from a string literal of its own.
|
|
1275
|
+
*/
|
|
1276
|
+
export declare function dmWorldEntryBlockIsPending(reason: DmWorldEntryRenderBlockReason | null): boolean;
|
|
1277
|
+
export declare function dmWorldBoardBlock(status: DmWorldBoardReadStatus): DmWorldEntryBlock | null;
|
|
1278
|
+
//# sourceMappingURL=dmWorldEntry.d.ts.map
|