@escapeaihq/client-core 0.52.0 → 0.139.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 +10295 -2216
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4187 -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 +138 -0
- package/dist/domains/personas.d.ts.map +1 -0
- package/dist/domains/personas.js +322 -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 +395 -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 +58 -10
- package/dist/toolSchemas.d.ts.map +1 -1
- package/dist/toolSchemas.js +37 -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 +208 -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 +12687 -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 +440 -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 +1016 -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 +40 -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
package/src/questLog.ts
ADDED
|
@@ -0,0 +1,704 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QS.9 (quest-state design §6) — PURE derivations behind the play-lobby quest
|
|
3
|
+
* surface: the corner minimap/state widget + the fullscreen quest overlay
|
|
4
|
+
* (`QuestStateWidget` / `QuestOverlay`). No fetches, no React — everything
|
|
5
|
+
* here folds the client-core wire shapes (`QuestStateViewWire` /
|
|
6
|
+
* `MapViewWire` / `QuestHistoryEvent` + best-effort `QuestDefinition[]`)
|
|
7
|
+
* into render-ready models so the components stay thin and testable.
|
|
8
|
+
*
|
|
9
|
+
* Definitions are BEST-EFFORT: the session projection carries quest IDS +
|
|
10
|
+
* statuses only (names live on the graph's Quest nodes, read via the QS.8
|
|
11
|
+
* arc-scoped preview). With no definitions every label degrades to the raw
|
|
12
|
+
* quest id — never a crash (see `specs/debt/` QS.9 filing on a
|
|
13
|
+
* definitions-inclusive session read).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { BeatView } from './storyGraph';
|
|
17
|
+
import type {
|
|
18
|
+
CutsceneRegistryEntryWire,
|
|
19
|
+
Effect,
|
|
20
|
+
MapViewWire,
|
|
21
|
+
ObjectiveDefinition,
|
|
22
|
+
QuestDefinition,
|
|
23
|
+
QuestHistoryEvent,
|
|
24
|
+
SessionCutsceneState,
|
|
25
|
+
QuestStateViewWire,
|
|
26
|
+
QuestStatus,
|
|
27
|
+
} from './domains/quests';
|
|
28
|
+
import { beatTitle, indexBeatsById } from './beatTitles';
|
|
29
|
+
|
|
30
|
+
/** UI grouping of the six wire statuses (mockup vocabulary). */
|
|
31
|
+
export const QUEST_STATUS_LABEL: Readonly<Record<QuestStatus, string>> = {
|
|
32
|
+
LOCKED: 'INACTIVE',
|
|
33
|
+
OPEN: 'AVAILABLE',
|
|
34
|
+
ACTIVE: 'ACTIVE',
|
|
35
|
+
SUCCEEDED: 'COMPLETED',
|
|
36
|
+
FAILED: 'FAILED',
|
|
37
|
+
SKIPPED: 'SKIPPED',
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
/** Statuses that count as resolved for campaign progress. */
|
|
41
|
+
const TERMINAL: readonly QuestStatus[] = ['SUCCEEDED', 'FAILED', 'SKIPPED'];
|
|
42
|
+
|
|
43
|
+
/** One render-ready quest-log row (view ∪ definitions). */
|
|
44
|
+
export interface QuestLogEntry {
|
|
45
|
+
questId: string;
|
|
46
|
+
name: string;
|
|
47
|
+
description: string;
|
|
48
|
+
kind: string | null;
|
|
49
|
+
status: QuestStatus;
|
|
50
|
+
/** Objectives with per-objective status folded in (definition order). */
|
|
51
|
+
objectives: {
|
|
52
|
+
objectiveId: string;
|
|
53
|
+
title: string;
|
|
54
|
+
done: boolean;
|
|
55
|
+
failed: boolean;
|
|
56
|
+
optional: boolean;
|
|
57
|
+
}[];
|
|
58
|
+
/** Done/total counts across the entry's objectives. */
|
|
59
|
+
objectivesDone: number;
|
|
60
|
+
objectivesTotal: number;
|
|
61
|
+
/** Names of quests gating this one (empty when ungated/unknown). */
|
|
62
|
+
gatedByNames: string[];
|
|
63
|
+
/** §Q UX.10 — the story beat this quest was derived from
|
|
64
|
+
* (`QuestDefinition.sourceBeatId`), or null when the definition is absent
|
|
65
|
+
* or the quest is not beat-anchored. Drives the Beat grouping. */
|
|
66
|
+
beatId: string | null;
|
|
67
|
+
/** §Q UX.10 — the mockup's branch links: what this quest's `onSuccess` /
|
|
68
|
+
* `onFailure` effects DO, rendered on live cards and not just locked ones
|
|
69
|
+
* (`play-quest-menu.html:148-152`). Empty when the definition is absent or
|
|
70
|
+
* carries no effects. */
|
|
71
|
+
branches: { win: string[]; lose: string[] };
|
|
72
|
+
order: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* §Q UX.10 — one `onSuccess`/`onFailure` effect as a player-readable branch
|
|
77
|
+
* line (`play-quest-menu.html:148-152`: *"on success → unlocked …"*).
|
|
78
|
+
*
|
|
79
|
+
* Only effects whose consequence is legible to a PLAYER get a line. Bookkeeping
|
|
80
|
+
* effects (`emit_event`, `set_gamestate`) are deliberately dropped: surfacing a
|
|
81
|
+
* raw event type or state key as a promised outcome would put engine internals
|
|
82
|
+
* on a play surface and claim more than the player can act on.
|
|
83
|
+
*/
|
|
84
|
+
function branchLine(
|
|
85
|
+
effect: Effect,
|
|
86
|
+
nameOf: (questId: string) => string,
|
|
87
|
+
): string | null {
|
|
88
|
+
switch (effect.type) {
|
|
89
|
+
case 'open_quest':
|
|
90
|
+
return `“${nameOf(effect.questId)}” opens`;
|
|
91
|
+
case 'complete_beat':
|
|
92
|
+
return 'the story moves on';
|
|
93
|
+
case 'message_persona':
|
|
94
|
+
return 'a character speaks up';
|
|
95
|
+
case 'unlock_map_area':
|
|
96
|
+
return 'a new area unlocks';
|
|
97
|
+
case 'append_inventory':
|
|
98
|
+
return `you gain ${effect.item}`;
|
|
99
|
+
case 'emit_event':
|
|
100
|
+
case 'set_gamestate':
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function branchLines(
|
|
106
|
+
effects: readonly Effect[] | undefined,
|
|
107
|
+
nameOf: (questId: string) => string,
|
|
108
|
+
): string[] {
|
|
109
|
+
return (effects ?? [])
|
|
110
|
+
.map((e) => branchLine(e, nameOf))
|
|
111
|
+
.filter((line): line is string => line !== null);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function gateQuestIds(def: QuestDefinition | undefined): string[] {
|
|
115
|
+
const gate = def?.gatedBy;
|
|
116
|
+
if (!gate) return [];
|
|
117
|
+
if (gate.type === 'after_quest') return [gate.questId];
|
|
118
|
+
if (gate.type === 'all_of' || gate.type === 'any_of') {
|
|
119
|
+
return gate.gates.flatMap((clause) =>
|
|
120
|
+
clause.type === 'after_quest' ? [clause.questId] : [],
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Fold the projection + best-effort definitions into ordered quest-log rows.
|
|
128
|
+
* Rows exist for every quest in the VIEW (server-authoritative frontier);
|
|
129
|
+
* definition-only quests the fold has not surfaced yet are omitted.
|
|
130
|
+
*/
|
|
131
|
+
export function buildQuestLog(
|
|
132
|
+
view: QuestStateViewWire | null,
|
|
133
|
+
definitions: readonly QuestDefinition[] | null,
|
|
134
|
+
): QuestLogEntry[] {
|
|
135
|
+
if (!view) return [];
|
|
136
|
+
const defById = new Map((definitions ?? []).map((d) => [d.questId, d]));
|
|
137
|
+
const nameOf = (questId: string) => defById.get(questId)?.name || questId;
|
|
138
|
+
const entries: QuestLogEntry[] = Object.entries(view.quests).map(
|
|
139
|
+
([questId, progress]) => {
|
|
140
|
+
const def = defById.get(questId);
|
|
141
|
+
const objectiveStatuses = progress.objectives ?? {};
|
|
142
|
+
const fromDef = (def?.objectives ?? []).map((o) => ({
|
|
143
|
+
objectiveId: o.objectiveId,
|
|
144
|
+
title: o.title || o.objectiveId,
|
|
145
|
+
done: objectiveStatuses[o.objectiveId] === 'COMPLETED',
|
|
146
|
+
failed: objectiveStatuses[o.objectiveId] === 'FAILED',
|
|
147
|
+
optional: o.optional ?? false,
|
|
148
|
+
}));
|
|
149
|
+
// View-only objectives (no matching definition) still render by id.
|
|
150
|
+
const known = new Set(fromDef.map((o) => o.objectiveId));
|
|
151
|
+
const extras = Object.entries(objectiveStatuses)
|
|
152
|
+
.filter(([id]) => !known.has(id))
|
|
153
|
+
.map(([id, status]) => ({
|
|
154
|
+
objectiveId: id,
|
|
155
|
+
title: id,
|
|
156
|
+
done: status === 'COMPLETED',
|
|
157
|
+
failed: status === 'FAILED',
|
|
158
|
+
optional: false,
|
|
159
|
+
}));
|
|
160
|
+
const objectives = [...fromDef, ...extras];
|
|
161
|
+
return {
|
|
162
|
+
questId,
|
|
163
|
+
name: nameOf(questId),
|
|
164
|
+
description: def?.description ?? '',
|
|
165
|
+
kind: def?.kind ?? null,
|
|
166
|
+
status: progress.status,
|
|
167
|
+
objectives,
|
|
168
|
+
objectivesDone: objectives.filter((o) => o.done).length,
|
|
169
|
+
objectivesTotal: objectives.length,
|
|
170
|
+
gatedByNames: gateQuestIds(def).map(nameOf),
|
|
171
|
+
beatId: def?.sourceBeatId ?? null,
|
|
172
|
+
branches: {
|
|
173
|
+
win: branchLines(def?.onSuccess, nameOf),
|
|
174
|
+
lose: branchLines(def?.onFailure, nameOf),
|
|
175
|
+
},
|
|
176
|
+
order: def?.order ?? Number.MAX_SAFE_INTEGER,
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
);
|
|
180
|
+
return entries.sort(byOrderThenId((e) => e.questId));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** The ONE order-then-id comparator (quest log, cutscene chips, ◆ markers —
|
|
184
|
+
* claude[bot] DRY fold #1081). */
|
|
185
|
+
function byOrderThenId<T extends { order: number }>(
|
|
186
|
+
idOf: (x: T) => string,
|
|
187
|
+
): (a: T, b: T) => number {
|
|
188
|
+
return (a, b) => a.order - b.order || idOf(a).localeCompare(idOf(b));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const byCutsceneOrder = byOrderThenId<CutsceneChip>((c) => c.cutsceneId);
|
|
192
|
+
|
|
193
|
+
/** Campaign progress: resolved / total (+ % for the widget tick). */
|
|
194
|
+
export function questProgress(view: QuestStateViewWire | null): {
|
|
195
|
+
resolved: number;
|
|
196
|
+
total: number;
|
|
197
|
+
pct: number;
|
|
198
|
+
} {
|
|
199
|
+
return rollUp(Object.values(view?.quests ?? {}).map((q) => q.status));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** The widget's one-line active-quest summary (first ACTIVE entry). */
|
|
203
|
+
export function activeQuestLine(log: readonly QuestLogEntry[]): string | null {
|
|
204
|
+
const active = log.find((e) => e.status === 'ACTIVE');
|
|
205
|
+
if (!active) return null;
|
|
206
|
+
return active.objectivesTotal > 0
|
|
207
|
+
? `${active.name} · ${active.objectivesDone}/${active.objectivesTotal}`
|
|
208
|
+
: active.name;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// ─── §Q UX.10 — Beat grouping + the who-updated-what trail ──────────────────
|
|
212
|
+
|
|
213
|
+
/** One beat group in the quest log (`play-quest-menu.html:207-241`). */
|
|
214
|
+
export interface QuestBeatGroup {
|
|
215
|
+
/** `null` = the catch-all group for quests with no `sourceBeatId`. */
|
|
216
|
+
beatId: string | null;
|
|
217
|
+
/** Beat label from the story graph; the raw id only when the graph has no
|
|
218
|
+
* such beat; a fixed label for the ungrouped bucket. */
|
|
219
|
+
title: string;
|
|
220
|
+
entries: QuestLogEntry[];
|
|
221
|
+
/** Group roll-up, same shape as {@link questProgress}. */
|
|
222
|
+
resolved: number;
|
|
223
|
+
total: number;
|
|
224
|
+
pct: number;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** The ONE resolved/total/pct roll-up (campaign, beat group). */
|
|
228
|
+
function rollUp(statuses: readonly QuestStatus[]): {
|
|
229
|
+
resolved: number;
|
|
230
|
+
total: number;
|
|
231
|
+
pct: number;
|
|
232
|
+
} {
|
|
233
|
+
const total = statuses.length;
|
|
234
|
+
const resolved = statuses.filter((s) => TERMINAL.includes(s)).length;
|
|
235
|
+
return { resolved, total, pct: total ? Math.round((resolved / total) * 100) : 0 };
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Label for the bucket holding quests that carry no `sourceBeatId`. */
|
|
239
|
+
export const UNGROUPED_BEAT_TITLE = 'Not tied to a beat';
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Group the quest log by the story BEAT each quest was derived from, in the
|
|
243
|
+
* graph's story order, with a per-group progress roll-up.
|
|
244
|
+
*
|
|
245
|
+
* **Beat, not Act.** The ratified mockup groups Act → Beat, but the wire
|
|
246
|
+
* carries no act: `QuestDefinition` has `sourceBeatId` and nothing above it,
|
|
247
|
+
* and the `after_act` gate class is dead (`specs/debt/20260712-after-act-quest-
|
|
248
|
+
* gates-are-dead-*`). Rendering an Act tier would mean inventing a container
|
|
249
|
+
* the projection cannot prove — the same mistake §Q DM.4's copy was corrected
|
|
250
|
+
* for. The Act tier lands when acts exist on the wire (§Q UX.12).
|
|
251
|
+
*
|
|
252
|
+
* Beats sort by their story-graph `order`; a quest anchored to a beat the graph
|
|
253
|
+
* does not contain keeps its group (labelled by raw id) after the known ones,
|
|
254
|
+
* and the ungrouped bucket is always last.
|
|
255
|
+
*/
|
|
256
|
+
export function groupQuestLogByBeat(
|
|
257
|
+
entries: readonly QuestLogEntry[],
|
|
258
|
+
beats: readonly BeatView[],
|
|
259
|
+
): QuestBeatGroup[] {
|
|
260
|
+
// §Q UX.11 — the id→label resolution moved to `beatTitles` so the DM lobby's
|
|
261
|
+
// session rows resolve beats the SAME way these group headers do.
|
|
262
|
+
const beatById = indexBeatsById(beats);
|
|
263
|
+
const byBeat = new Map<string | null, QuestLogEntry[]>();
|
|
264
|
+
for (const entry of entries) {
|
|
265
|
+
const key = entry.beatId ?? null;
|
|
266
|
+
const bucket = byBeat.get(key);
|
|
267
|
+
if (bucket) bucket.push(entry);
|
|
268
|
+
else byBeat.set(key, [entry]);
|
|
269
|
+
}
|
|
270
|
+
const groups: QuestBeatGroup[] = [...byBeat.entries()].map(
|
|
271
|
+
([beatId, groupEntries]) => ({
|
|
272
|
+
beatId,
|
|
273
|
+
title:
|
|
274
|
+
beatId === null ? UNGROUPED_BEAT_TITLE : beatTitle(beatId, beatById),
|
|
275
|
+
entries: groupEntries,
|
|
276
|
+
...rollUp(groupEntries.map((e) => e.status)),
|
|
277
|
+
}),
|
|
278
|
+
);
|
|
279
|
+
// Known beats in story order, then unknown-beat groups, then the ungrouped
|
|
280
|
+
// bucket. `Number.MAX_SAFE_INTEGER - 1` keeps unknown beats ahead of it.
|
|
281
|
+
const rank = (g: QuestBeatGroup) =>
|
|
282
|
+
g.beatId === null
|
|
283
|
+
? Number.MAX_SAFE_INTEGER
|
|
284
|
+
: (beatById.get(g.beatId)?.order ?? Number.MAX_SAFE_INTEGER - 1);
|
|
285
|
+
return groups.sort(
|
|
286
|
+
(a, b) => rank(a) - rank(b) || a.title.localeCompare(b.title),
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** One "who updated what" line on a quest card (mockup `.trail`). */
|
|
291
|
+
export interface QuestTrailEntry {
|
|
292
|
+
seq: number;
|
|
293
|
+
/** Resolved actor label — a persona's friendly name when the event names one,
|
|
294
|
+
* else the raw `actorKind` humanised. Never a bare UUID. */
|
|
295
|
+
actor: string;
|
|
296
|
+
/** True when the DM appended the atom (the mockup tints those lines). */
|
|
297
|
+
byDm: boolean;
|
|
298
|
+
/** What happened, from the event type. */
|
|
299
|
+
what: string;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** `QuestEventType` → the trail's past-tense phrasing. Unlisted types fall
|
|
303
|
+
* back to the humanised event type, so a new backend event still renders. */
|
|
304
|
+
const TRAIL_PHRASE: Readonly<Record<string, string>> = {
|
|
305
|
+
QUEST_OPENED: 'offered this quest',
|
|
306
|
+
QUEST_STARTED: 'started this quest',
|
|
307
|
+
QUEST_SUCCEEDED: 'completed this quest',
|
|
308
|
+
QUEST_FAILED: 'marked this quest failed',
|
|
309
|
+
QUEST_SKIPPED: 'skipped this quest',
|
|
310
|
+
OBJECTIVE_COMPLETED: 'completed an objective',
|
|
311
|
+
OBJECTIVE_FAILED: 'failed an objective',
|
|
312
|
+
SPOKE_WITH: 'spoke with a character',
|
|
313
|
+
FOUND_OBJECT: 'found an object',
|
|
314
|
+
REACHED_SCENE: 'reached a scene',
|
|
315
|
+
BEAT_ADVANCED: 'moved the story on',
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
function humanise(token: string): string {
|
|
319
|
+
const lower = token.toLowerCase().replace(/_/g, ' ');
|
|
320
|
+
return lower.charAt(0).toUpperCase() + lower.slice(1);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Resolve the quest a history event updated (codex P2, round 2).
|
|
325
|
+
*
|
|
326
|
+
* MOST ledger events do NOT carry a `questId`, so keying the trail off
|
|
327
|
+
* `event.questId` alone would have shown only direct quest-status commands and
|
|
328
|
+
* dropped the objective progress the trail exists to show:
|
|
329
|
+
*
|
|
330
|
+
* - `QUEST_*` events carry `questId` directly (`shared/quest_models.py`).
|
|
331
|
+
* - `OBJECTIVE_COMPLETED` / `OBJECTIVE_FAILED` carry only `objectiveId`
|
|
332
|
+
* (`ObjectiveStatusEvent`) — resolved here through the definitions, which
|
|
333
|
+
* already carry `ObjectiveDefinition.questId`.
|
|
334
|
+
* - The auto-atoms `SPOKE_WITH` / `FOUND_OBJECT` (`entityId`) and
|
|
335
|
+
* `REACHED_SCENE` (`sceneId`) name a TARGET, not a quest — matched against
|
|
336
|
+
* `targetEntityId` / `targetSceneId`, and ONLY when exactly one objective
|
|
337
|
+
* targets it. An ambiguous atom is dropped rather than attributed to a
|
|
338
|
+
* guess: this file never re-derives what the server's fold decided.
|
|
339
|
+
*/
|
|
340
|
+
function trailQuestId(
|
|
341
|
+
e: QuestHistoryEvent,
|
|
342
|
+
questIdByObjective: ReadonlyMap<string, string>,
|
|
343
|
+
questIdByEntity: ReadonlyMap<string, string>,
|
|
344
|
+
questIdByScene: ReadonlyMap<string, string>,
|
|
345
|
+
): string | null {
|
|
346
|
+
if (typeof e.event.questId === 'string') return e.event.questId;
|
|
347
|
+
if (typeof e.event.objectiveId === 'string') {
|
|
348
|
+
return questIdByObjective.get(e.event.objectiveId) ?? null;
|
|
349
|
+
}
|
|
350
|
+
if (typeof e.event.entityId === 'string') {
|
|
351
|
+
return questIdByEntity.get(e.event.entityId) ?? null;
|
|
352
|
+
}
|
|
353
|
+
if (typeof e.event.sceneId === 'string') {
|
|
354
|
+
return questIdByScene.get(e.event.sceneId) ?? null;
|
|
355
|
+
}
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/** Build a target→questId index, dropping any target claimed by more than one
|
|
360
|
+
* quest (ambiguous ⇒ no attribution). */
|
|
361
|
+
function uniqueTargetIndex(
|
|
362
|
+
definitions: readonly QuestDefinition[] | null,
|
|
363
|
+
targetOf: (o: ObjectiveDefinition) => string | null | undefined,
|
|
364
|
+
): Map<string, string> {
|
|
365
|
+
const seen = new Map<string, string | null>();
|
|
366
|
+
for (const def of definitions ?? []) {
|
|
367
|
+
for (const o of def.objectives ?? []) {
|
|
368
|
+
const target = targetOf(o);
|
|
369
|
+
if (!target) continue;
|
|
370
|
+
// null marks "claimed by two different quests" — ambiguous.
|
|
371
|
+
seen.set(target, seen.has(target) && seen.get(target) !== def.questId
|
|
372
|
+
? null
|
|
373
|
+
: def.questId);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const out = new Map<string, string>();
|
|
377
|
+
for (const [target, questId] of seen) if (questId) out.set(target, questId);
|
|
378
|
+
return out;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* §Q UX.10 — the "who updated what" trails, folded from the SAME history slice
|
|
383
|
+
* the save-point timeline already fetches. `QuestHistoryEvent.actorKind` /
|
|
384
|
+
* `personaId` have been on the wire since QS.7
|
|
385
|
+
* (`packages/client-core/src/domains/quests.ts`) and were read only for
|
|
386
|
+
* save-point sequence numbers.
|
|
387
|
+
*
|
|
388
|
+
* Returns `questId → trail`, oldest first, capped at `limit` per quest (the
|
|
389
|
+
* most RECENT ones — a long session must not turn a card into a log dump).
|
|
390
|
+
* An event that cannot be resolved to exactly one quest (see
|
|
391
|
+
* {@link trailQuestId}) belongs to no card and is skipped.
|
|
392
|
+
*/
|
|
393
|
+
export function buildQuestTrails(
|
|
394
|
+
events: readonly QuestHistoryEvent[],
|
|
395
|
+
personaNames: ReadonlyMap<string, string>,
|
|
396
|
+
definitions: readonly QuestDefinition[] | null = null,
|
|
397
|
+
limit = 4,
|
|
398
|
+
): Map<string, QuestTrailEntry[]> {
|
|
399
|
+
const questIdByObjective = new Map<string, string>();
|
|
400
|
+
for (const def of definitions ?? []) {
|
|
401
|
+
for (const o of def.objectives ?? []) {
|
|
402
|
+
questIdByObjective.set(o.objectiveId, def.questId);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
const questIdByEntity = uniqueTargetIndex(definitions, (o) => o.targetEntityId);
|
|
406
|
+
const questIdByScene = uniqueTargetIndex(definitions, (o) => o.targetSceneId);
|
|
407
|
+
|
|
408
|
+
const byQuest = new Map<string, QuestTrailEntry[]>();
|
|
409
|
+
for (const e of events) {
|
|
410
|
+
const questId = trailQuestId(
|
|
411
|
+
e,
|
|
412
|
+
questIdByObjective,
|
|
413
|
+
questIdByEntity,
|
|
414
|
+
questIdByScene,
|
|
415
|
+
);
|
|
416
|
+
if (!questId) continue;
|
|
417
|
+
const byDm = e.actorKind.toLowerCase() === 'dm';
|
|
418
|
+
const actor = e.personaId
|
|
419
|
+
? (personaNames.get(e.personaId) ?? (byDm ? 'The DM' : 'A character'))
|
|
420
|
+
: byDm
|
|
421
|
+
? 'The DM'
|
|
422
|
+
: humanise(e.actorKind);
|
|
423
|
+
const entry: QuestTrailEntry = {
|
|
424
|
+
seq: e.seq,
|
|
425
|
+
actor,
|
|
426
|
+
byDm,
|
|
427
|
+
what: TRAIL_PHRASE[e.eventType] ?? humanise(e.eventType),
|
|
428
|
+
};
|
|
429
|
+
const bucket = byQuest.get(questId);
|
|
430
|
+
if (bucket) bucket.push(entry);
|
|
431
|
+
else byQuest.set(questId, [entry]);
|
|
432
|
+
}
|
|
433
|
+
for (const [questId, trail] of byQuest) {
|
|
434
|
+
trail.sort((a, b) => a.seq - b.seq);
|
|
435
|
+
if (trail.length > limit) byQuest.set(questId, trail.slice(-limit));
|
|
436
|
+
}
|
|
437
|
+
return byQuest;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** History event types that qualify as save points (design §6). */
|
|
441
|
+
const SAVE_POINT_EVENTS = new Set(['QUEST_SUCCEEDED', 'BEAT_ADVANCED']);
|
|
442
|
+
|
|
443
|
+
/** One relive-able save point on the timeline. */
|
|
444
|
+
export interface SavePoint {
|
|
445
|
+
seq: number;
|
|
446
|
+
ts: string;
|
|
447
|
+
label: string;
|
|
448
|
+
eventType: string;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Milestone save points from the history slice: every `QUEST_SUCCEEDED` /
|
|
453
|
+
* `BEAT_ADVANCED` event, labeled via the definitions when available.
|
|
454
|
+
*/
|
|
455
|
+
export function deriveSavePoints(
|
|
456
|
+
events: readonly QuestHistoryEvent[],
|
|
457
|
+
definitions: readonly QuestDefinition[] | null,
|
|
458
|
+
): SavePoint[] {
|
|
459
|
+
const defById = new Map((definitions ?? []).map((d) => [d.questId, d]));
|
|
460
|
+
return events
|
|
461
|
+
.filter((e) => SAVE_POINT_EVENTS.has(e.eventType))
|
|
462
|
+
.map((e) => {
|
|
463
|
+
const questId =
|
|
464
|
+
typeof e.event.questId === 'string' ? e.event.questId : null;
|
|
465
|
+
const beatId = beatAdvancedTargetBeatId(e);
|
|
466
|
+
const label =
|
|
467
|
+
e.eventType === 'QUEST_SUCCEEDED'
|
|
468
|
+
? `Quest completed — ${questId ? (defById.get(questId)?.name ?? questId) : 'quest'}`
|
|
469
|
+
: `Reached beat ${beatId ?? ''}`.trim();
|
|
470
|
+
return { seq: e.seq, ts: e.ts, label, eventType: e.eventType };
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The beat a `BEAT_ADVANCED` event landed on. The wire payload is the
|
|
476
|
+
* camelCase `BeatAdvancedEvent` (`shared/quest_models.py`): `toBeatId` is the
|
|
477
|
+
* reached beat (`fromBeatId` the one left) — ONE reader for both the
|
|
478
|
+
* save-point labels and the chapter-rail relive map.
|
|
479
|
+
*/
|
|
480
|
+
function beatAdvancedTargetBeatId(e: QuestHistoryEvent): string | null {
|
|
481
|
+
return typeof e.event.toBeatId === 'string' ? e.event.toBeatId : null;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Beat id → the beat's save-point seq (W2.13 chapter-rail relive): the
|
|
486
|
+
* EARLIEST `BEAT_ADVANCED` ledger event per beat — reliving from a beat means
|
|
487
|
+
* reseeding at the moment the party first reached it. Events missing a string
|
|
488
|
+
* `toBeatId` payload are skipped (no invented save points).
|
|
489
|
+
*/
|
|
490
|
+
export function reliveSeqByBeat(
|
|
491
|
+
events: readonly QuestHistoryEvent[],
|
|
492
|
+
): Map<string, number> {
|
|
493
|
+
const seqByBeat = new Map<string, number>();
|
|
494
|
+
for (const e of events) {
|
|
495
|
+
if (e.eventType !== 'BEAT_ADVANCED') continue;
|
|
496
|
+
const beatId = beatAdvancedTargetBeatId(e);
|
|
497
|
+
if (beatId && !seqByBeat.has(beatId)) seqByBeat.set(beatId, e.seq);
|
|
498
|
+
}
|
|
499
|
+
return seqByBeat;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// ─── QC.7 (OQ-8) cutscene consumption — pure derivations ────────────────────
|
|
503
|
+
|
|
504
|
+
/** One render-ready cutscene chip (quest overlay) / marker (chapter rail).
|
|
505
|
+
* Booleans are SERVER-evaluated (`SessionCutsceneState` from the projection
|
|
506
|
+
* read) — this file never evaluates gate expressions (design §OQ-8). */
|
|
507
|
+
export interface CutsceneChip {
|
|
508
|
+
cutsceneId: string;
|
|
509
|
+
name: string;
|
|
510
|
+
/** Gate satisfied by this session's quest state (server-evaluated). */
|
|
511
|
+
available: boolean;
|
|
512
|
+
/** Anchored node carries a generated T6.2 clip stamp (server-resolved). */
|
|
513
|
+
clipReady: boolean;
|
|
514
|
+
/** Arrived on a live `newlyAvailable.cutscenes` frame this page-load —
|
|
515
|
+
* drives the stage trigger's NEW pulse (mockup state 2). */
|
|
516
|
+
isNew: boolean;
|
|
517
|
+
order: number;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Fold the projection's server-evaluated cutscene states with the live
|
|
522
|
+
* accumulated `newlyAvailable.cutscenes` ids into ordered, render-ready
|
|
523
|
+
* chips. Only AVAILABLE entries surface (server-authoritative fog — a gated
|
|
524
|
+
* cutscene the party hasn't earned never leaks its name). A frame id the
|
|
525
|
+
* projection hasn't caught up to yet still renders (name degrades to the id,
|
|
526
|
+
* `clipReady` false until the refetch lands — honest, never invented).
|
|
527
|
+
*/
|
|
528
|
+
export function buildCutsceneChips(
|
|
529
|
+
states: readonly SessionCutsceneState[] | null,
|
|
530
|
+
newIds: readonly string[],
|
|
531
|
+
): CutsceneChip[] {
|
|
532
|
+
const newSet = new Set(newIds);
|
|
533
|
+
const chips: CutsceneChip[] = (states ?? [])
|
|
534
|
+
.filter((s) => s.available)
|
|
535
|
+
.map((s) => ({
|
|
536
|
+
cutsceneId: s.cutsceneId,
|
|
537
|
+
name: s.name,
|
|
538
|
+
available: true,
|
|
539
|
+
clipReady: s.clipReady,
|
|
540
|
+
isNew: newSet.has(s.cutsceneId),
|
|
541
|
+
order: s.order,
|
|
542
|
+
}));
|
|
543
|
+
const known = new Set(chips.map((c) => c.cutsceneId));
|
|
544
|
+
for (const id of newIds) {
|
|
545
|
+
if (known.has(id)) continue;
|
|
546
|
+
known.add(id);
|
|
547
|
+
chips.push({
|
|
548
|
+
cutsceneId: id,
|
|
549
|
+
name: id,
|
|
550
|
+
available: true,
|
|
551
|
+
clipReady: false,
|
|
552
|
+
isNew: true,
|
|
553
|
+
order: Number.MAX_SAFE_INTEGER,
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
return chips.sort(byCutsceneOrder);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Beat id → the beat's ◆ cutscene markers (chapter rail, mockup play-lobby):
|
|
561
|
+
* the story registry supplies the beat ANCHORS (`beatId`), the session
|
|
562
|
+
* projection the server-evaluated `available`/`clipReady` booleans. Entries
|
|
563
|
+
* without a beat anchor (scene-anchored) don't sit on the rail; entries the
|
|
564
|
+
* session projection doesn't carry (e.g. no quest surface) render as
|
|
565
|
+
* not-yet-available markers — visible fog, never playable.
|
|
566
|
+
*/
|
|
567
|
+
export function cutsceneMarkersByBeat(
|
|
568
|
+
registry: readonly CutsceneRegistryEntryWire[] | null,
|
|
569
|
+
states: readonly SessionCutsceneState[] | null,
|
|
570
|
+
): Map<string, CutsceneChip[]> {
|
|
571
|
+
const byBeat = new Map<string, CutsceneChip[]>();
|
|
572
|
+
if (!registry || registry.length === 0) return byBeat;
|
|
573
|
+
const stateById = new Map((states ?? []).map((s) => [s.cutsceneId, s]));
|
|
574
|
+
for (const entry of registry) {
|
|
575
|
+
if (!entry.beatId) continue;
|
|
576
|
+
const state = stateById.get(entry.cutsceneId);
|
|
577
|
+
const marker: CutsceneChip = {
|
|
578
|
+
cutsceneId: entry.cutsceneId,
|
|
579
|
+
name: entry.name,
|
|
580
|
+
available: state?.available ?? false,
|
|
581
|
+
clipReady: state?.clipReady ?? entry.clipReady,
|
|
582
|
+
isNew: false,
|
|
583
|
+
order: entry.order,
|
|
584
|
+
};
|
|
585
|
+
const list = byBeat.get(entry.beatId);
|
|
586
|
+
if (list) list.push(marker);
|
|
587
|
+
else byBeat.set(entry.beatId, [marker]);
|
|
588
|
+
}
|
|
589
|
+
for (const list of byBeat.values()) {
|
|
590
|
+
list.sort(byCutsceneOrder);
|
|
591
|
+
}
|
|
592
|
+
return byBeat;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* §Q `DM.54` — the cutscene that covers a world build at `beatId`, or `null`.
|
|
597
|
+
*
|
|
598
|
+
* NOT the same question the rail asks, and the difference is deliberate.
|
|
599
|
+
* {@link cutsceneMarkersByBeat} renders FOG: an entry the session projection
|
|
600
|
+
* does not carry shows as not-yet-available, because the rail is a map of what
|
|
601
|
+
* the party might still earn. This is a LOADING SCREEN for a world the DM has
|
|
602
|
+
* already decided to open at this beat — so it is the creator's curation that
|
|
603
|
+
* authorises it, and the projection only gets to VETO.
|
|
604
|
+
*
|
|
605
|
+
* The cases, in order of authority:
|
|
606
|
+
* - the projection says `available: false` ⇒ NOTHING. A gated cutscene the
|
|
607
|
+
* party has not earned never leaks, not even as a loading screen.
|
|
608
|
+
* - the projection says `available: true` ⇒ play it (the demo path).
|
|
609
|
+
* - the projection carries NO state for this id AND THE ENTRY IS UNGATED
|
|
610
|
+
* (`gate === null`) ⇒ fall back to the registry's own `clipReady`.
|
|
611
|
+
* Measured on staging 2026-08-01: a session spawned without a questline has
|
|
612
|
+
* no quest projection AT ALL, so every entry read `available: false` and
|
|
613
|
+
* the cover could never fire on the very sessions that need it most. "The
|
|
614
|
+
* server has no opinion" is not "the server said no" — and
|
|
615
|
+
* `cutsceneMarkersByBeat` already degrades `clipReady` to the registry in
|
|
616
|
+
* exactly this case.
|
|
617
|
+
* - the projection carries no state and the entry IS gated ⇒ NOTHING. **The
|
|
618
|
+
* projection is the only thing that evaluates a gate**, so an unevaluated
|
|
619
|
+
* gate is an unanswered question. (`GET .../cutscenes/{id}/clip` used to
|
|
620
|
+
* check story-read + clip-readiness only and presign a clip the party had
|
|
621
|
+
* not earned — codex round 2, PR #1644; since §Q SEC.34 it refuses a gated
|
|
622
|
+
* clip unless the named `sessionId`'s projection unlocked it, so this
|
|
623
|
+
* fallback would now 403 rather than leak.) An open-by-default fallback
|
|
624
|
+
* over a gated entry is an authorization leak, not a degrade.
|
|
625
|
+
* - the projection carries no state and the entry's stored gate DID NOT
|
|
626
|
+
* PARSE (`gateUnparseable`) ⇒ NOTHING (§Q QST.9). Its `gate` is null on
|
|
627
|
+
* the wire, so without the flag this reads as ungated and auto-plays —
|
|
628
|
+
* the same fail-open the server-side projection now refuses, arriving by
|
|
629
|
+
* the one route that skips the projection entirely.
|
|
630
|
+
*
|
|
631
|
+
* A clip is required in every case: an entry with no generated clip 404s on the
|
|
632
|
+
* playback fetch, which is `DM.51`'s visibly-broken-chip failure.
|
|
633
|
+
*/
|
|
634
|
+
export function buildWindowCutsceneForBeat(
|
|
635
|
+
registry: readonly CutsceneRegistryEntryWire[] | null,
|
|
636
|
+
states: readonly SessionCutsceneState[] | null,
|
|
637
|
+
beatId: string | null | undefined,
|
|
638
|
+
): CutsceneChip | null {
|
|
639
|
+
if (!registry || !beatId) return null;
|
|
640
|
+
const stateById = new Map((states ?? []).map((s) => [s.cutsceneId, s]));
|
|
641
|
+
const candidates = registry
|
|
642
|
+
.filter((entry) => entry.beatId === beatId)
|
|
643
|
+
.map((entry) => {
|
|
644
|
+
const state = stateById.get(entry.cutsceneId);
|
|
645
|
+
return {
|
|
646
|
+
cutsceneId: entry.cutsceneId,
|
|
647
|
+
name: state?.name ?? entry.name,
|
|
648
|
+
// The fallback is ONLY for an ungated entry — see the docblock. `gate`
|
|
649
|
+
// is OPTIONAL on the wire, so absent and explicit-null both mean
|
|
650
|
+
// ungated; anything else is a gate nobody has evaluated.
|
|
651
|
+
//
|
|
652
|
+
// §Q QST.9: a null `gate` is NOT proof of an ungated entry. When the
|
|
653
|
+
// stored expression failed to parse the server sends `gate: null` with
|
|
654
|
+
// `gateUnparseable: true` — a gate that exists and nobody could
|
|
655
|
+
// evaluate, which is precisely the "unanswered question" the docblock
|
|
656
|
+
// says must play NOTHING. Without this clause the fail-open the
|
|
657
|
+
// projection now refuses simply reappears on the no-projection
|
|
658
|
+
// fallback, the exact path a questline-less session takes.
|
|
659
|
+
available:
|
|
660
|
+
state?.available ??
|
|
661
|
+
(!entry.gateUnparseable && (entry.gate ?? null) === null),
|
|
662
|
+
clipReady: state?.clipReady ?? entry.clipReady,
|
|
663
|
+
isNew: false,
|
|
664
|
+
order: entry.order,
|
|
665
|
+
} satisfies CutsceneChip;
|
|
666
|
+
})
|
|
667
|
+
.filter((c) => c.available && c.clipReady)
|
|
668
|
+
.sort(byCutsceneOrder);
|
|
669
|
+
return candidates[0] ?? null;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/** One minimap/map cell (widget thumbnail + overlay map share this). */
|
|
673
|
+
export interface MapCell {
|
|
674
|
+
locationId: string;
|
|
675
|
+
name: string;
|
|
676
|
+
state: 'visited' | 'unlocked' | 'unvisited';
|
|
677
|
+
/** Pin glyphs on this area (📍 active objective; the widget ignores them). */
|
|
678
|
+
pins: { questId: string; objectiveId: string; title: string }[];
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Fold the §5 map projection into render cells; pins attach to their area by
|
|
683
|
+
* `locationId` (scene-targeted pins without a location are dropped — honest:
|
|
684
|
+
* no geometry exists to place them; see the §5 backend-gap manifest).
|
|
685
|
+
*/
|
|
686
|
+
export function buildMapCells(
|
|
687
|
+
map: MapViewWire | null,
|
|
688
|
+
definitions: readonly QuestDefinition[] | null,
|
|
689
|
+
): MapCell[] {
|
|
690
|
+
if (!map) return [];
|
|
691
|
+
const defById = new Map((definitions ?? []).map((d) => [d.questId, d]));
|
|
692
|
+
return map.areas.map((area) => ({
|
|
693
|
+
locationId: area.locationId,
|
|
694
|
+
name: area.name,
|
|
695
|
+
state: area.state,
|
|
696
|
+
pins: map.pins
|
|
697
|
+
.filter((p) => p.locationId === area.locationId)
|
|
698
|
+
.map((p) => ({
|
|
699
|
+
questId: p.questId,
|
|
700
|
+
objectiveId: p.objectiveId,
|
|
701
|
+
title: defById.get(p.questId)?.name ?? p.questId,
|
|
702
|
+
})),
|
|
703
|
+
}));
|
|
704
|
+
}
|