@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,544 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-prompt compaction — §Q `DM.18`: fit a frame's SERVER-COMPILED
|
|
3
|
+
* `promptText` inside a live target's prompt cap WITHOUT amputating the beat.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this exists
|
|
6
|
+
*
|
|
7
|
+
* `FramePrompt.compiled_text()` (`shared/storyboard_models.py`) is budgeted
|
|
8
|
+
* against `PROMPT_TEXT_MAX_LEN * 4` — the ceiling for the string the storyboard
|
|
9
|
+
* worker PERSISTS. HappyOyster's `createWorld` caps its prompt at
|
|
10
|
+
* {@link HAPPY_OYSTER_PROMPT_MAX_CHARS} (2000), a quarter of that. The two
|
|
11
|
+
* budgets were never reconciled, so the first genuine board frame compiled to
|
|
12
|
+
* 2363 characters and `planDmWorldEntry` returned `prompt_invalid` — the
|
|
13
|
+
* production world launch could not fire at all.
|
|
14
|
+
*
|
|
15
|
+
* ## Why NOT truncation
|
|
16
|
+
*
|
|
17
|
+
* A head-truncation of that real frame to 2000 dropped exactly the outdoor half
|
|
18
|
+
* of the beat (*"They pick their way through the burning Battlefield, dodging
|
|
19
|
+
* collapsing archways and stray Soldiers…"*) and produced an interior-only
|
|
20
|
+
* world that looked plausible and was wrong. §Q `DM.19` then established that
|
|
21
|
+
* the world tracks the storyboard's PROSE, not its picture — every checkable
|
|
22
|
+
* thing in the on-beat world was a literal noun-phrase from the `Action` line.
|
|
23
|
+
* So the prompt is the whole lever, and a cut that lands on a byte offset
|
|
24
|
+
* silently deletes story.
|
|
25
|
+
*
|
|
26
|
+
* ## The rule: shed whole semantic UNITS, ceremony first, in a fixed order
|
|
27
|
+
*
|
|
28
|
+
* `compiled_text` is deterministic and LABELLED (fixed section order, fixed
|
|
29
|
+
* separators, `Label: value` per line), and `services/storyboard/brief.py`
|
|
30
|
+
* composes `Scene` from labelled clauses joined by `" — "`. That structure is
|
|
31
|
+
* what makes a principled shed possible: {@link FRAME_PROMPT_SHED_LADDER}
|
|
32
|
+
* removes complete units — a whole section, a whole conflict, a whole cast
|
|
33
|
+
* descriptor — in a fixed priority order, stopping the moment the text fits.
|
|
34
|
+
* Nothing is ever cut mid-clause and nothing is cut because of where a byte
|
|
35
|
+
* count landed.
|
|
36
|
+
*
|
|
37
|
+
* The order shed-first to shed-last, and the reason each rung outranks the next:
|
|
38
|
+
*
|
|
39
|
+
* 1. `References` — `@ImageN` slot addressing for MULTI-reference adapters
|
|
40
|
+
* (Seedance/Gemini). `createWorld` takes ONE first-frame image and has no
|
|
41
|
+
* slots, so the line addresses nothing on this target.
|
|
42
|
+
* 2. `Negative` — a negative-prompt channel `createWorld` does not have. Read
|
|
43
|
+
* as positive prose it is worse than absent.
|
|
44
|
+
* 3. `Dialogue` — a world model builds a PLACE; the spoken lines are the DM's
|
|
45
|
+
* job at runtime, not the world's.
|
|
46
|
+
* 4. `Camera` — the player drives the camera in an interactive world.
|
|
47
|
+
* 5. `Scene` → `Themes:` — abstract nouns, board-wide, not depictable.
|
|
48
|
+
* 6. `Scene` → `At stake:` conflicts, TAIL FIRST — arc-level stakes repeated
|
|
49
|
+
* identically on every frame of the board, describing agents and places
|
|
50
|
+
* that are NOT in this frame. Shed one whole conflict at a time so the
|
|
51
|
+
* primary one survives longest.
|
|
52
|
+
* 7. `Style` — art direction; goes only after every non-depictable clause has.
|
|
53
|
+
* 8. `Scene` → `Art direction:` — the creator's typed direction outlives the
|
|
54
|
+
* tags (`brief.py` budgets it first for the same reason).
|
|
55
|
+
* 9. `Characters` descriptors — the cast survives as NAMES; the biography
|
|
56
|
+
* prose is backstory, not this frame. All of them go together: a
|
|
57
|
+
* descriptor contains commas, so there is no unambiguous per-entry cut.
|
|
58
|
+
* Pass {@link FramePromptCompactionOptions.castInWords} and the names come
|
|
59
|
+
* from the frame's STRUCTURE rather than from the flattened line.
|
|
60
|
+
* 10. `Scene` → the headline, keeping the leading setting clause — the setting
|
|
61
|
+
* survives as its place name.
|
|
62
|
+
* 11. `Characters` entirely — the cast is still named inside `Action`.
|
|
63
|
+
* 12. `Scene` entirely — the last thing standing before the beat itself.
|
|
64
|
+
*
|
|
65
|
+
* **`Action` is never shed.** It is the beat: cast, action and implicit setting
|
|
66
|
+
* in one clause. If `Action` alone exceeds the cap the compaction REFUSES to
|
|
67
|
+
* make it fit — {@link compactFramePromptText} returns the fully-shed text, the
|
|
68
|
+
* caller's existing cap check reports it, and the launch is blocked loudly
|
|
69
|
+
* rather than launching a world built from half a beat. That is the whole
|
|
70
|
+
* lesson of `DM.18`.
|
|
71
|
+
*
|
|
72
|
+
* A prompt already inside the cap is returned BYTE-IDENTICAL: the frame's
|
|
73
|
+
* compiled prompt is the authority and this module never editorialises one that
|
|
74
|
+
* fits.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The section labels `FramePrompt.compiled_text` emits, in its emission order.
|
|
79
|
+
*
|
|
80
|
+
* MIRRORED from `shared/storyboard_models.py` (`FramePrompt.compiled_text`) —
|
|
81
|
+
* the flattener is server-side by design and this is the only place the client
|
|
82
|
+
* restates its vocabulary. A label added there and not here is not a silent
|
|
83
|
+
* corruption: an unrecognised line is carried through untouched (see
|
|
84
|
+
* {@link parseCompiledFramePrompt}), so the worst case is that the new section
|
|
85
|
+
* cannot be shed.
|
|
86
|
+
*/
|
|
87
|
+
export const FRAME_PROMPT_SECTION_LABELS = [
|
|
88
|
+
'Scene',
|
|
89
|
+
'Characters',
|
|
90
|
+
'Action',
|
|
91
|
+
'Camera',
|
|
92
|
+
'Style',
|
|
93
|
+
'Dialogue',
|
|
94
|
+
'References',
|
|
95
|
+
'Negative',
|
|
96
|
+
] as const;
|
|
97
|
+
|
|
98
|
+
export type FramePromptSectionLabel =
|
|
99
|
+
(typeof FRAME_PROMPT_SECTION_LABELS)[number];
|
|
100
|
+
|
|
101
|
+
/** The clause separator `brief.py` joins `Scene`'s parts with. */
|
|
102
|
+
const SCENE_CLAUSE_SEPARATOR = ' — ';
|
|
103
|
+
|
|
104
|
+
/** The separator `brief.py` joins the individual conflicts with. */
|
|
105
|
+
const SCENE_STAKES_SEPARATOR = ' | ';
|
|
106
|
+
|
|
107
|
+
/** The separator `compiled_text` joins cast entries with. */
|
|
108
|
+
const CAST_SEPARATOR = ', ';
|
|
109
|
+
|
|
110
|
+
/** The separator `brief.py`'s `_describe` puts between a cast name and its
|
|
111
|
+
* descriptor. */
|
|
112
|
+
const CAST_DESCRIPTOR_SEPARATOR = ' — ';
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The labelled clauses inside `Scene`, in `brief.py`'s composition order. The
|
|
116
|
+
* unlabelled remainder that precedes them all is the SETTING (location +
|
|
117
|
+
* headline) and has no marker of its own.
|
|
118
|
+
*/
|
|
119
|
+
const SCENE_CLAUSE_LABELS = {
|
|
120
|
+
stakes: 'At stake: ',
|
|
121
|
+
themes: 'Themes: ',
|
|
122
|
+
artDirection: 'Art direction: ',
|
|
123
|
+
} as const;
|
|
124
|
+
|
|
125
|
+
/** `Scene`, taken apart along the clause boundaries `brief.py` writes. */
|
|
126
|
+
export interface ParsedSceneDescription {
|
|
127
|
+
/** Location + headline — everything before the first labelled clause. */
|
|
128
|
+
setting: string;
|
|
129
|
+
/** The `At stake:` conflicts, split on their own separator. */
|
|
130
|
+
stakes: string[];
|
|
131
|
+
/** The `Themes:` value, or `''`. */
|
|
132
|
+
themes: string;
|
|
133
|
+
/** The `Art direction:` value, or `''`. */
|
|
134
|
+
artDirection: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** One line of the compiled prompt. `label` is `null` for a line this module
|
|
138
|
+
* does not recognise, which is then carried through and never shed. */
|
|
139
|
+
export interface ParsedPromptSection {
|
|
140
|
+
label: FramePromptSectionLabel | null;
|
|
141
|
+
/** The verbatim line, used to re-emit an unrecognised section untouched. */
|
|
142
|
+
raw: string;
|
|
143
|
+
value: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The compiled prompt taken apart into the units the ladder sheds. */
|
|
147
|
+
export interface ParsedFramePrompt {
|
|
148
|
+
sections: ParsedPromptSection[];
|
|
149
|
+
scene: ParsedSceneDescription | null;
|
|
150
|
+
/** The STRUCTURED cast, when the caller supplied it — see
|
|
151
|
+
* {@link FramePromptCompactionOptions.castInWords}. */
|
|
152
|
+
castInWords: readonly string[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Optional structure the caller already holds, so the ladder does not have to
|
|
156
|
+
* re-derive it from the flattened text. */
|
|
157
|
+
export interface FramePromptCompactionOptions {
|
|
158
|
+
/**
|
|
159
|
+
* The frame's structured cast — `FramePrompt.charactersInWords`, each entry
|
|
160
|
+
* exactly as `brief.py`'s `_describe` wrote it (`name — descriptor`, or a
|
|
161
|
+
* BARE NAME when the graph had no descriptor).
|
|
162
|
+
*
|
|
163
|
+
* Supplied, the `cast-descriptors` rung reads the names from here instead of
|
|
164
|
+
* re-deriving them from the `Characters:` line — which cannot always be done
|
|
165
|
+
* unambiguously, because a descriptor may contain the `", "` that also
|
|
166
|
+
* separates entries, so a descriptorless entry sitting between two described
|
|
167
|
+
* ones is indistinguishable from descriptor prose. The hint is IGNORED unless
|
|
168
|
+
* every name in it appears in the compiled line, so a `prompt` that has
|
|
169
|
+
* drifted from the variant's compiled snapshot can never inject a roster the
|
|
170
|
+
* frame did not actually ship with.
|
|
171
|
+
*/
|
|
172
|
+
castInWords?: readonly string[];
|
|
173
|
+
/**
|
|
174
|
+
* Which tiers of the ladder may fire. Omitted, every rung may — the cap is
|
|
175
|
+
* absolute and the frame yields to it.
|
|
176
|
+
*
|
|
177
|
+
* Pass `['ceremony']` to compact against a target that is SMALLER than the
|
|
178
|
+
* vendor cap because the caller is reserving room for something else (§Q
|
|
179
|
+
* `DM.21` — the DM tag's atmosphere). That reservation is allowed to cost
|
|
180
|
+
* ceremony and must never cost the cast or the setting, so a ceremony-only
|
|
181
|
+
* compaction that cannot reach the target comes back OVER it and the caller
|
|
182
|
+
* falls back to compacting against the full cap.
|
|
183
|
+
*/
|
|
184
|
+
shedTiers?: readonly FramePromptShedTier[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** What a compaction did. Returned even when the result still exceeds the cap —
|
|
188
|
+
* the caller owns the cap check, so it can report the real overflow. */
|
|
189
|
+
export interface FramePromptCompaction {
|
|
190
|
+
/** The compacted prompt. Byte-identical to the input when it already fit. */
|
|
191
|
+
text: string;
|
|
192
|
+
/** Length of the prompt as compiled, before any shedding. */
|
|
193
|
+
originalLength: number;
|
|
194
|
+
/**
|
|
195
|
+
* The {@link FRAME_PROMPT_SHED_LADDER} rung ids that were applied, in order.
|
|
196
|
+
* Empty when nothing was shed. A surface can render this to show an operator
|
|
197
|
+
* exactly what the world prompt lost.
|
|
198
|
+
*/
|
|
199
|
+
shed: string[];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function parseSceneDescription(value: string): ParsedSceneDescription {
|
|
203
|
+
const markers = (
|
|
204
|
+
Object.entries(SCENE_CLAUSE_LABELS) as [
|
|
205
|
+
keyof typeof SCENE_CLAUSE_LABELS,
|
|
206
|
+
string,
|
|
207
|
+
][]
|
|
208
|
+
)
|
|
209
|
+
.map(([key, marker]) => {
|
|
210
|
+
if (value.startsWith(marker)) return { key, at: 0, marker };
|
|
211
|
+
const at = value.indexOf(`${SCENE_CLAUSE_SEPARATOR}${marker}`);
|
|
212
|
+
return at === -1
|
|
213
|
+
? null
|
|
214
|
+
: { key, at: at + SCENE_CLAUSE_SEPARATOR.length, marker };
|
|
215
|
+
})
|
|
216
|
+
.filter((m): m is { key: keyof typeof SCENE_CLAUSE_LABELS; at: number; marker: string } => m !== null)
|
|
217
|
+
.sort((a, b) => a.at - b.at);
|
|
218
|
+
|
|
219
|
+
const parsed: ParsedSceneDescription = {
|
|
220
|
+
setting:
|
|
221
|
+
markers.length === 0
|
|
222
|
+
? value
|
|
223
|
+
: value
|
|
224
|
+
.slice(0, Math.max(0, markers[0].at - SCENE_CLAUSE_SEPARATOR.length))
|
|
225
|
+
.trim(),
|
|
226
|
+
stakes: [],
|
|
227
|
+
themes: '',
|
|
228
|
+
artDirection: '',
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
markers.forEach((marker, index) => {
|
|
232
|
+
const end = index + 1 < markers.length
|
|
233
|
+
? Math.max(0, markers[index + 1].at - SCENE_CLAUSE_SEPARATOR.length)
|
|
234
|
+
: value.length;
|
|
235
|
+
const body = value.slice(marker.at + marker.marker.length, end).trim();
|
|
236
|
+
if (marker.key === 'stakes') {
|
|
237
|
+
parsed.stakes = body
|
|
238
|
+
.split(SCENE_STAKES_SEPARATOR)
|
|
239
|
+
.map(entry => entry.trim())
|
|
240
|
+
.filter(entry => entry !== '');
|
|
241
|
+
} else if (marker.key === 'themes') {
|
|
242
|
+
parsed.themes = body;
|
|
243
|
+
} else {
|
|
244
|
+
parsed.artDirection = body;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
return parsed;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function renderSceneDescription(scene: ParsedSceneDescription): string {
|
|
252
|
+
const stakes =
|
|
253
|
+
scene.stakes.length === 0
|
|
254
|
+
? ''
|
|
255
|
+
: `${SCENE_CLAUSE_LABELS.stakes}${scene.stakes.join(SCENE_STAKES_SEPARATOR)}`;
|
|
256
|
+
const themes =
|
|
257
|
+
scene.themes === '' ? '' : `${SCENE_CLAUSE_LABELS.themes}${scene.themes}`;
|
|
258
|
+
const artDirection =
|
|
259
|
+
scene.artDirection === ''
|
|
260
|
+
? ''
|
|
261
|
+
: `${SCENE_CLAUSE_LABELS.artDirection}${scene.artDirection}`;
|
|
262
|
+
return [scene.setting, stakes, themes, artDirection]
|
|
263
|
+
.filter(clause => clause !== '')
|
|
264
|
+
.join(SCENE_CLAUSE_SEPARATOR);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Take a compiled prompt apart along `compiled_text`'s own boundaries.
|
|
269
|
+
*
|
|
270
|
+
* Exported for the ladder's tests and for a surface that wants to show the
|
|
271
|
+
* sections; it is a pure parse with no policy in it.
|
|
272
|
+
*/
|
|
273
|
+
export function parseCompiledFramePrompt(
|
|
274
|
+
text: string,
|
|
275
|
+
options: FramePromptCompactionOptions = {},
|
|
276
|
+
): ParsedFramePrompt {
|
|
277
|
+
const sections: ParsedPromptSection[] = text.split('\n').map(raw => {
|
|
278
|
+
const label = FRAME_PROMPT_SECTION_LABELS.find(candidate =>
|
|
279
|
+
raw.startsWith(`${candidate}: `),
|
|
280
|
+
);
|
|
281
|
+
return label === undefined
|
|
282
|
+
? { label: null, raw, value: raw }
|
|
283
|
+
: { label, raw, value: raw.slice(label.length + 2) };
|
|
284
|
+
});
|
|
285
|
+
const sceneSection = sections.find(section => section.label === 'Scene');
|
|
286
|
+
return {
|
|
287
|
+
sections,
|
|
288
|
+
scene:
|
|
289
|
+
sceneSection === undefined
|
|
290
|
+
? null
|
|
291
|
+
: parseSceneDescription(sceneSection.value),
|
|
292
|
+
castInWords: options.castInWords ?? [],
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function renderFramePrompt(parsed: ParsedFramePrompt): string {
|
|
297
|
+
return parsed.sections
|
|
298
|
+
.map(section => {
|
|
299
|
+
if (section.label === null) return section.raw;
|
|
300
|
+
const value =
|
|
301
|
+
section.label === 'Scene' && parsed.scene !== null
|
|
302
|
+
? renderSceneDescription(parsed.scene)
|
|
303
|
+
: section.value;
|
|
304
|
+
return value.trim() === '' ? '' : `${section.label}: ${value}`;
|
|
305
|
+
})
|
|
306
|
+
.filter(line => line !== '')
|
|
307
|
+
.join('\n');
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The cast NAMES for the `cast-descriptors` rung, or `[]` when they cannot be
|
|
312
|
+
* established.
|
|
313
|
+
*
|
|
314
|
+
* **The structured cast wins whenever the caller has it.** Each
|
|
315
|
+
* `charactersInWords` entry is `name — descriptor` (or a bare name), so the
|
|
316
|
+
* names come out EXACTLY. The hint is only trusted when every name it yields is
|
|
317
|
+
* present in the compiled line — otherwise `frame.prompt` has drifted from the
|
|
318
|
+
* variant's compiled snapshot and the flattened text stays the authority.
|
|
319
|
+
*
|
|
320
|
+
* Falling back to the flattened line, the split is on the DESCRIPTOR separator,
|
|
321
|
+
* never the entry separator: a descriptor contains commas ("…discovers a Holy
|
|
322
|
+
* Blade in a cave, becomes bound to it, and is hunted…"), so splitting on `", "`
|
|
323
|
+
* shreds the roster into fragments. The text after the LAST `", "` of each span
|
|
324
|
+
* is the next entry's name.
|
|
325
|
+
*
|
|
326
|
+
* That fallback has ONE thing it cannot see, and it is why the hint exists: a
|
|
327
|
+
* DESCRIPTORLESS entry that follows a described one (`Yang — a stoic swordsman,
|
|
328
|
+
* The Colonel`) is indistinguishable from that descriptor's own prose, so it is
|
|
329
|
+
* dropped with the descriptor. Leading descriptorless entries are safe — nothing
|
|
330
|
+
* before the first `" — "` can be a descriptor.
|
|
331
|
+
*
|
|
332
|
+
* Returns `[]` — "refuse, do not guess" — when a descriptor itself contains a
|
|
333
|
+
* `" — "`, because the next name can no longer be located at all. The caller
|
|
334
|
+
* then skips the rung rather than emit a mangled cast.
|
|
335
|
+
*/
|
|
336
|
+
function castNames(value: string, castInWords: readonly string[]): string[] {
|
|
337
|
+
const hinted = castInWords
|
|
338
|
+
.map(entry => entry.split(CAST_DESCRIPTOR_SEPARATOR)[0].trim())
|
|
339
|
+
.filter(name => name !== '');
|
|
340
|
+
if (hinted.length > 0 && hinted.every(name => value.includes(name))) {
|
|
341
|
+
return hinted;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const spans = value.split(CAST_DESCRIPTOR_SEPARATOR);
|
|
345
|
+
if (spans.length < 2) return [];
|
|
346
|
+
const names = [spans[0].trim()];
|
|
347
|
+
for (const span of spans.slice(1, -1)) {
|
|
348
|
+
const at = span.lastIndexOf(CAST_SEPARATOR);
|
|
349
|
+
if (at === -1) return [];
|
|
350
|
+
names.push(span.slice(at + CAST_SEPARATOR.length).trim());
|
|
351
|
+
}
|
|
352
|
+
return names.every(name => name !== '') ? names : [];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function dropSection(
|
|
356
|
+
parsed: ParsedFramePrompt,
|
|
357
|
+
label: FramePromptSectionLabel,
|
|
358
|
+
): void {
|
|
359
|
+
parsed.sections = parsed.sections.filter(section => section.label !== label);
|
|
360
|
+
if (label === 'Scene') parsed.scene = null;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* What a rung takes.
|
|
365
|
+
*
|
|
366
|
+
* `'ceremony'` — framing the live target cannot use or that repeats board-wide
|
|
367
|
+
* context: reference-slot addressing, a negative channel that does not exist,
|
|
368
|
+
* the script, the shot, the themes, the arc stakes, the style/art direction.
|
|
369
|
+
* Removing it costs the world nothing it was going to render.
|
|
370
|
+
*
|
|
371
|
+
* `'substance'` — the frame's own content: the cast, the setting. Only the cap
|
|
372
|
+
* itself may force these, never a caller wanting room for something else.
|
|
373
|
+
* (`Action` has no rung at all — it is never shed.)
|
|
374
|
+
*/
|
|
375
|
+
export type FramePromptShedTier = 'ceremony' | 'substance';
|
|
376
|
+
|
|
377
|
+
/** How an untiered {@link FramePromptShedStep} is classified. `'substance'` —
|
|
378
|
+
* an unclassified rung is never spent for a caller's reservation. */
|
|
379
|
+
export const FRAME_PROMPT_DEFAULT_SHED_TIER: FramePromptShedTier = 'substance';
|
|
380
|
+
|
|
381
|
+
/** One rung of the shed ladder: a complete semantic unit and why it goes. */
|
|
382
|
+
export interface FramePromptShedStep {
|
|
383
|
+
/** Stable id reported in {@link FramePromptCompaction.shed}. */
|
|
384
|
+
id: string;
|
|
385
|
+
/**
|
|
386
|
+
* Whether this rung takes ceremony or the frame's own substance.
|
|
387
|
+
*
|
|
388
|
+
* OPTIONAL so that adding it stayed source-compatible for anyone already
|
|
389
|
+
* constructing a step against the published surface (client-core is an
|
|
390
|
+
* additive-only contract). Every built-in rung sets it explicitly; an omitted
|
|
391
|
+
* tier is read as {@link FRAME_PROMPT_DEFAULT_SHED_TIER} — `'substance'`,
|
|
392
|
+
* the conservative direction, so an unclassified rung is never spent to free
|
|
393
|
+
* room a caller reserved rather than to satisfy the cap itself.
|
|
394
|
+
*/
|
|
395
|
+
tier?: FramePromptShedTier;
|
|
396
|
+
/** Remove the unit. Returns `false` when there was nothing there to remove,
|
|
397
|
+
* so the ladder moves straight on without recording a no-op. */
|
|
398
|
+
apply: (parsed: ParsedFramePrompt) => boolean;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function dropSectionStep(
|
|
402
|
+
id: string,
|
|
403
|
+
label: FramePromptSectionLabel,
|
|
404
|
+
tier: FramePromptShedTier,
|
|
405
|
+
): FramePromptShedStep {
|
|
406
|
+
return {
|
|
407
|
+
id,
|
|
408
|
+
tier,
|
|
409
|
+
apply: parsed => {
|
|
410
|
+
if (!parsed.sections.some(section => section.label === label)) {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
dropSection(parsed, label);
|
|
414
|
+
return true;
|
|
415
|
+
},
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The shed order, ceremony first, `Action` never. Declared as data so the
|
|
421
|
+
* policy is readable end to end and a rung cannot be reordered by accident;
|
|
422
|
+
* the module docblock carries the reason for each one.
|
|
423
|
+
*
|
|
424
|
+
* Rung 6 is UNBOUNDED in the number of units it can remove, so it is applied one
|
|
425
|
+
* conflict at a time (tail first) by {@link compactFramePromptText} rather than
|
|
426
|
+
* expanded here.
|
|
427
|
+
*/
|
|
428
|
+
export const FRAME_PROMPT_SHED_LADDER: readonly FramePromptShedStep[] = [
|
|
429
|
+
dropSectionStep('references', 'References', 'ceremony'),
|
|
430
|
+
dropSectionStep('negative', 'Negative', 'ceremony'),
|
|
431
|
+
dropSectionStep('dialogue', 'Dialogue', 'ceremony'),
|
|
432
|
+
dropSectionStep('camera', 'Camera', 'ceremony'),
|
|
433
|
+
{
|
|
434
|
+
id: 'scene-themes',
|
|
435
|
+
tier: 'ceremony',
|
|
436
|
+
apply: parsed => {
|
|
437
|
+
if (parsed.scene === null || parsed.scene.themes === '') return false;
|
|
438
|
+
parsed.scene.themes = '';
|
|
439
|
+
return true;
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
// Tail first — the primary conflict is the one worth keeping longest.
|
|
444
|
+
id: 'scene-stake',
|
|
445
|
+
tier: 'ceremony',
|
|
446
|
+
apply: parsed => {
|
|
447
|
+
if (parsed.scene === null || parsed.scene.stakes.length === 0) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
parsed.scene.stakes.pop();
|
|
451
|
+
return true;
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
dropSectionStep('style', 'Style', 'ceremony'),
|
|
455
|
+
{
|
|
456
|
+
id: 'scene-art-direction',
|
|
457
|
+
tier: 'ceremony',
|
|
458
|
+
apply: parsed => {
|
|
459
|
+
if (parsed.scene === null || parsed.scene.artDirection === '') {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
parsed.scene.artDirection = '';
|
|
463
|
+
return true;
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
// Every cast NAME survives this rung; the biographies go together.
|
|
468
|
+
id: 'cast-descriptors',
|
|
469
|
+
tier: 'substance',
|
|
470
|
+
apply: parsed => {
|
|
471
|
+
const cast = parsed.sections.find(
|
|
472
|
+
section => section.label === 'Characters',
|
|
473
|
+
);
|
|
474
|
+
if (cast === undefined) return false;
|
|
475
|
+
const names = castNames(cast.value, parsed.castInWords);
|
|
476
|
+
if (names.length === 0) return false;
|
|
477
|
+
const roster = names.join(CAST_SEPARATOR);
|
|
478
|
+
if (roster === cast.value) return false;
|
|
479
|
+
cast.value = roster;
|
|
480
|
+
return true;
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: 'scene-headline',
|
|
485
|
+
tier: 'substance',
|
|
486
|
+
apply: parsed => {
|
|
487
|
+
if (parsed.scene === null) return false;
|
|
488
|
+
const clauses = parsed.scene.setting.split(SCENE_CLAUSE_SEPARATOR);
|
|
489
|
+
if (clauses.length < 2) return false;
|
|
490
|
+
parsed.scene.setting = clauses[0].trim();
|
|
491
|
+
return true;
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
dropSectionStep('characters', 'Characters', 'substance'),
|
|
495
|
+
dropSectionStep('scene', 'Scene', 'substance'),
|
|
496
|
+
];
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* The rungs that may fire more than once, each removing one further unit.
|
|
500
|
+
* Everything else is idempotent by construction.
|
|
501
|
+
*/
|
|
502
|
+
const REPEATABLE_SHED_IDS: ReadonlySet<string> = new Set(['scene-stake']);
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Compact a frame's compiled `promptText` to fit `maxChars`, shedding whole
|
|
506
|
+
* semantic units in {@link FRAME_PROMPT_SHED_LADDER} order and stopping the
|
|
507
|
+
* moment it fits.
|
|
508
|
+
*
|
|
509
|
+
* Returns the input BYTE-IDENTICAL when it already fits. Returns the
|
|
510
|
+
* fully-shed text — which may STILL exceed `maxChars` when `Action` alone does
|
|
511
|
+
* — rather than cutting into the beat; the caller's cap check owns that case
|
|
512
|
+
* and must report it instead of launching.
|
|
513
|
+
*/
|
|
514
|
+
export function compactFramePromptText(
|
|
515
|
+
text: string,
|
|
516
|
+
maxChars: number,
|
|
517
|
+
options: FramePromptCompactionOptions = {},
|
|
518
|
+
): FramePromptCompaction {
|
|
519
|
+
const originalLength = text.length;
|
|
520
|
+
if (originalLength <= maxChars) {
|
|
521
|
+
return { text, originalLength, shed: [] };
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const parsed = parseCompiledFramePrompt(text, options);
|
|
525
|
+
const shed: string[] = [];
|
|
526
|
+
let current = text;
|
|
527
|
+
|
|
528
|
+
const tiers = options.shedTiers;
|
|
529
|
+
for (const step of FRAME_PROMPT_SHED_LADDER) {
|
|
530
|
+
const tier = step.tier ?? FRAME_PROMPT_DEFAULT_SHED_TIER;
|
|
531
|
+
if (tiers !== undefined && !tiers.includes(tier)) continue;
|
|
532
|
+
const repeatable = REPEATABLE_SHED_IDS.has(step.id);
|
|
533
|
+
do {
|
|
534
|
+
if (!step.apply(parsed)) break;
|
|
535
|
+
shed.push(step.id);
|
|
536
|
+
current = renderFramePrompt(parsed);
|
|
537
|
+
if (current.length <= maxChars) {
|
|
538
|
+
return { text: current, originalLength, shed };
|
|
539
|
+
}
|
|
540
|
+
} while (repeatable);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
return { text: current, originalLength, shed };
|
|
544
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE FRAME-WORLD CLAIM, client side — one implementation, two callers.
|
|
3
|
+
*
|
|
4
|
+
* `PUT …/storyboards/{id}/frames/{frameId}/world` (§Q `SB.20`) is the CAS that
|
|
5
|
+
* owns one permanent world per frame: re-sending the same id succeeds, a
|
|
6
|
+
* DIFFERENT id answers **409 carrying the id the frame already owns**, and that
|
|
7
|
+
* 409 is a real answer rather than a failure — a billed, unlistable asset is
|
|
8
|
+
* never silently re-pointed.
|
|
9
|
+
*
|
|
10
|
+
* Reading that answer used to live inside the DM host's `bindWorldToFrame`
|
|
11
|
+
* (`web/app/watch/[videoId]/useDmWorldEntry.ts`). §Q `MOMENT.15` added a SECOND
|
|
12
|
+
* caller — the studio's browser mint loop, which binds every world it mints —
|
|
13
|
+
* and a second copy of "is this a conflict, and which id is in it" is exactly
|
|
14
|
+
* the drift that ends with one surface treating a 409 as an outage and minting
|
|
15
|
+
* again. So the reading lives here and both hosts call it.
|
|
16
|
+
*
|
|
17
|
+
* Structural, not `ApiClient`-typed, for the usual client-core reason: this
|
|
18
|
+
* module must not drag the transport layer into `reactor/`, and a host that
|
|
19
|
+
* wraps its client (the DM host folds the post-write frame back into its board)
|
|
20
|
+
* can still satisfy it.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import type {
|
|
24
|
+
SetFrameWorldRequest,
|
|
25
|
+
StoryboardFrameResponse,
|
|
26
|
+
} from '../domains/storyboards';
|
|
27
|
+
import type { HappyOysterMode } from './happyOysterWorld';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* How a claim settled.
|
|
31
|
+
*
|
|
32
|
+
* `unavailable` is deliberately NOT an error the caller throws on: the world is
|
|
33
|
+
* already minted and billed by the time this runs, so the caller's job is to
|
|
34
|
+
* keep the handle visible, not to unwind.
|
|
35
|
+
*/
|
|
36
|
+
export type FrameWorldBindResult =
|
|
37
|
+
/** The frame owns this world now. */
|
|
38
|
+
| { status: 'bound'; worldId: string }
|
|
39
|
+
/** The documented 409: the frame already owns a DIFFERENT world, and that
|
|
40
|
+
* world's id is the answer. */
|
|
41
|
+
| { status: 'conflict'; existingWorldId: string | null }
|
|
42
|
+
/** The write did not land (network, auth, 5xx). The world still exists. */
|
|
43
|
+
| { status: 'unavailable' };
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Pull the already-bound world id out of a 409. `undefined` means "not a
|
|
47
|
+
* conflict at all", which is how a caller tells a CAS answer from an outage —
|
|
48
|
+
* conflating them is what makes a client re-mint a world the frame refused.
|
|
49
|
+
*/
|
|
50
|
+
export function readFrameWorldConflictId(err: unknown): string | null | undefined {
|
|
51
|
+
if (typeof err !== 'object' || err === null) return undefined;
|
|
52
|
+
const candidate = err as { status?: unknown; detail?: unknown };
|
|
53
|
+
if (candidate.status !== 409) return undefined;
|
|
54
|
+
// `http.ts` carries the route's structured `detail` onto the thrown error;
|
|
55
|
+
// the frame-world CAS puts the already-bound id there.
|
|
56
|
+
const detail = candidate.detail;
|
|
57
|
+
if (typeof detail === 'object' && detail !== null) {
|
|
58
|
+
const worldId = (detail as { worldId?: unknown }).worldId;
|
|
59
|
+
if (typeof worldId === 'string' && worldId.length > 0) return worldId;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The one API call this module needs, structurally. */
|
|
65
|
+
export interface FrameWorldBindClient {
|
|
66
|
+
setStoryboardFrameWorld: (
|
|
67
|
+
storyId: string,
|
|
68
|
+
storyboardId: string,
|
|
69
|
+
frameId: string,
|
|
70
|
+
body: SetFrameWorldRequest,
|
|
71
|
+
options?: { supersede?: boolean },
|
|
72
|
+
) => Promise<StoryboardFrameResponse>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Claim a permanent world onto its frame and CLASSIFY the answer.
|
|
77
|
+
*
|
|
78
|
+
* §Q `DM.30` — the MODE rides with the id. A bare handle looks bound and can be
|
|
79
|
+
* permanently unusable: worlds live on the mode-fixed model that created them,
|
|
80
|
+
* and `attachWorld` rejects the other mode's with `MODE_MISMATCH`.
|
|
81
|
+
*
|
|
82
|
+
* `onFrame` receives the server's CONSISTENT post-write frame, which is how a
|
|
83
|
+
* caller learns what it just wrote without a second read (§Q `DM.75`).
|
|
84
|
+
*/
|
|
85
|
+
export async function bindFrameWorld(
|
|
86
|
+
client: FrameWorldBindClient,
|
|
87
|
+
input: {
|
|
88
|
+
storyId: string;
|
|
89
|
+
storyboardId: string;
|
|
90
|
+
frameId: string;
|
|
91
|
+
worldId: string;
|
|
92
|
+
worldMode: HappyOysterMode;
|
|
93
|
+
/**
|
|
94
|
+
* §Q `WORLD.11` — the authorisation this mint was covered by, when there was
|
|
95
|
+
* one. Threading it is what makes the server's consume EXACT: without it the
|
|
96
|
+
* bind consumed whichever lease sat on the frame, so a mint against a lapsed
|
|
97
|
+
* authorisation could take a newer caller's. The DM's own entry has no
|
|
98
|
+
* prepared authorisation and correctly omits it.
|
|
99
|
+
*/
|
|
100
|
+
leaseToken?: string;
|
|
101
|
+
},
|
|
102
|
+
options: {
|
|
103
|
+
onFrame?: (frame: StoryboardFrameResponse['frame']) => void;
|
|
104
|
+
} = {},
|
|
105
|
+
): Promise<FrameWorldBindResult> {
|
|
106
|
+
try {
|
|
107
|
+
const response = await client.setStoryboardFrameWorld(
|
|
108
|
+
input.storyId,
|
|
109
|
+
input.storyboardId,
|
|
110
|
+
input.frameId,
|
|
111
|
+
{
|
|
112
|
+
worldId: input.worldId,
|
|
113
|
+
worldMode: input.worldMode,
|
|
114
|
+
...(input.leaseToken === undefined ? {} : { leaseToken: input.leaseToken }),
|
|
115
|
+
},
|
|
116
|
+
);
|
|
117
|
+
options.onFrame?.(response.frame);
|
|
118
|
+
// ⛔ A 2xx IS NOT A BINDING (codex #6 on §Q MOMENT.15). The route answers
|
|
119
|
+
// with a CONSISTENT post-write read, so the frame it returns is the fact —
|
|
120
|
+
// and `?? input.worldId` would mask a frame that came back owning a
|
|
121
|
+
// DIFFERENT world, reporting a paid handle as recorded when it is not. A
|
|
122
|
+
// disagreeing id is read as what it is: this frame owns something else.
|
|
123
|
+
const persisted = (response.frame.worldId ?? '').trim();
|
|
124
|
+
if (persisted !== '' && persisted !== input.worldId) {
|
|
125
|
+
return { status: 'conflict', existingWorldId: persisted };
|
|
126
|
+
}
|
|
127
|
+
return { status: 'bound', worldId: input.worldId };
|
|
128
|
+
} catch (err) {
|
|
129
|
+
const existing = readFrameWorldConflictId(err);
|
|
130
|
+
if (existing !== undefined) return { status: 'conflict', existingWorldId: existing };
|
|
131
|
+
return { status: 'unavailable' };
|
|
132
|
+
}
|
|
133
|
+
}
|