@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
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storyboard region-edit core — brush → mask PNG + camera annotation.
|
|
3
|
+
*
|
|
4
|
+
* §Q SB-U.2 / storyboard spec slice S2
|
|
5
|
+
* (`specs/2026-07-24-storyboard-generator.md` §11). The framework-agnostic
|
|
6
|
+
* half of the mask editor: everything here is pure TypeScript over plain
|
|
7
|
+
* data, so the React canvas surface (SB-U.7, react-konva via
|
|
8
|
+
* `next/dynamic ssr:false`) and any future Vue host share one implementation
|
|
9
|
+
* of what a stroke means, what the mask bytes look like, and how a camera
|
|
10
|
+
* gesture becomes the frame's dual camera encoding.
|
|
11
|
+
*
|
|
12
|
+
* **ZERO new client-core dependencies** — a hard constraint of the row, not
|
|
13
|
+
* a preference. react-konva belongs to `web/` and arrives in SB-U.7. The
|
|
14
|
+
* only browser API touched is the 2D canvas, and only in the two explicit
|
|
15
|
+
* raster helpers at the bottom; the geometry, the render plan, and the whole
|
|
16
|
+
* camera core run in plain jsdom/node.
|
|
17
|
+
*
|
|
18
|
+
* ## Coordinate system
|
|
19
|
+
*
|
|
20
|
+
* Strokes are stored in NORMALIZED image coordinates — `x`/`y` in `[0, 1]`
|
|
21
|
+
* relative to the frame's own box. That is what makes a mask survive the
|
|
22
|
+
* gap between the editor canvas (whatever CSS size the panel inspector got)
|
|
23
|
+
* and the master render (1664×960 per spec §4.1): the same stroke list
|
|
24
|
+
* rasterizes correctly at any target size. Brush `radius` is normalized
|
|
25
|
+
* against the LONGER edge, so a brush stays round in pixel space on a
|
|
26
|
+
* non-square frame.
|
|
27
|
+
*
|
|
28
|
+
* ## Mask semantics
|
|
29
|
+
*
|
|
30
|
+
* The PNG is a binary grayscale mask: **white = the region to edit, black =
|
|
31
|
+
* keep**, matching the Bedrock Stability `stable-image-inpaint` mask
|
|
32
|
+
* convention the default region-edit adapter uses (spec §4.4) and the
|
|
33
|
+
* `gpt-image-2` identity arm. An `erase` stroke paints `MASK_KEEP_COLOR`
|
|
34
|
+
* back over the paint strokes rather than compositing, so the plan stays a
|
|
35
|
+
* flat, order-dependent op list with no canvas blend modes to reproduce.
|
|
36
|
+
*
|
|
37
|
+
* The bytes ride to `POST …/frames/{frameId}/region-edit` as the
|
|
38
|
+
* `maskImageBase64` field (spec §4.5). No mask ⇒ the backend takes the
|
|
39
|
+
* `semantic_edit` path instead, which is why {@link strokesAreEmpty} is the
|
|
40
|
+
* caller's "should I send a mask at all" check.
|
|
41
|
+
*/
|
|
42
|
+
import { fileToBase64 } from './reactor/seedImageOrchestrator.js';
|
|
43
|
+
/** Fill for the region the model should regenerate. */
|
|
44
|
+
export const MASK_PAINT_COLOR = '#ffffff';
|
|
45
|
+
/** Fill for the region the model must leave alone (and the plan's base fill). */
|
|
46
|
+
export const MASK_KEEP_COLOR = '#000000';
|
|
47
|
+
/** Mask MIME type. PNG is lossless — a JPEG mask would smear the edges. */
|
|
48
|
+
export const MASK_IMAGE_MIME = 'image/png';
|
|
49
|
+
/** Default brush radius (normalized), ~4% of the longer edge. */
|
|
50
|
+
export const DEFAULT_MASK_BRUSH_RADIUS = 0.04;
|
|
51
|
+
/**
|
|
52
|
+
* Points closer together than this (normalized distance) are dropped while
|
|
53
|
+
* extending a stroke. Pointer-move events fire far denser than the mask
|
|
54
|
+
* needs, and every kept point is a `lineTo` in the render plan.
|
|
55
|
+
*/
|
|
56
|
+
export const MASK_MIN_POINT_DISTANCE = 0.002;
|
|
57
|
+
function clamp(value, min, max) {
|
|
58
|
+
if (!Number.isFinite(value))
|
|
59
|
+
return min;
|
|
60
|
+
return Math.min(max, Math.max(min, value));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Clamp a signed normalized deflection into `[-1, 1]`. A non-finite input
|
|
64
|
+
* means "no movement" (0) rather than {@link clamp}'s low bound — a stray
|
|
65
|
+
* `NaN` from a zero-sized box must not read as a hard-left pan.
|
|
66
|
+
*/
|
|
67
|
+
function normalizedDeflection(value) {
|
|
68
|
+
if (!Number.isFinite(value))
|
|
69
|
+
return 0;
|
|
70
|
+
return Math.min(1, Math.max(-1, value));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Per-axis scale from normalized space into "long-edge space" — the frame
|
|
74
|
+
* measured in units of its own longer edge, where one unit on x is the same
|
|
75
|
+
* number of PIXELS as one unit on y. Brush radius is already in those units
|
|
76
|
+
* (see the file header), so every radius-vs-distance comparison must happen
|
|
77
|
+
* here; comparing a radius against a raw normalized delta silently
|
|
78
|
+
* under-measures the short axis of a 16:9 frame.
|
|
79
|
+
*/
|
|
80
|
+
function longEdgeScale(geometry) {
|
|
81
|
+
const width = Math.max(1, geometry.width);
|
|
82
|
+
const height = Math.max(1, geometry.height);
|
|
83
|
+
const longEdge = Math.max(width, height);
|
|
84
|
+
return { x: width / longEdge, y: height / longEdge };
|
|
85
|
+
}
|
|
86
|
+
/** Clamp a point into the `[0, 1]` box. Off-canvas drags stay on the mask edge. */
|
|
87
|
+
export function clampMaskPoint(point) {
|
|
88
|
+
return { x: clamp(point.x, 0, 1), y: clamp(point.y, 0, 1) };
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Convert a pointer position in element-pixel space to normalized image
|
|
92
|
+
* space. The host passes the element's own box; nothing here knows about
|
|
93
|
+
* DOM events, so React and Vue hosts feed it the same numbers.
|
|
94
|
+
*/
|
|
95
|
+
export function toMaskPoint(position, box) {
|
|
96
|
+
const width = box.width > 0 ? box.width : 1;
|
|
97
|
+
const height = box.height > 0 ? box.height : 1;
|
|
98
|
+
return clampMaskPoint({ x: position.x / width, y: position.y / height });
|
|
99
|
+
}
|
|
100
|
+
/** Start a stroke at `origin`. A stroke with a single point renders as a dot. */
|
|
101
|
+
export function createMaskStroke(mode, origin, radius = DEFAULT_MASK_BRUSH_RADIUS) {
|
|
102
|
+
return {
|
|
103
|
+
mode,
|
|
104
|
+
radius: clamp(radius, 0.001, 1),
|
|
105
|
+
points: [clampMaskPoint(origin)],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Append a point to a stroke, dropping it when it is within
|
|
110
|
+
* {@link MASK_MIN_POINT_DISTANCE} of the previous one. Returns the SAME
|
|
111
|
+
* stroke object when the point is dropped, so a host can use referential
|
|
112
|
+
* equality to skip a re-render.
|
|
113
|
+
*/
|
|
114
|
+
export function extendMaskStroke(stroke, point) {
|
|
115
|
+
const next = clampMaskPoint(point);
|
|
116
|
+
const last = stroke.points[stroke.points.length - 1];
|
|
117
|
+
if (last) {
|
|
118
|
+
const dx = next.x - last.x;
|
|
119
|
+
const dy = next.y - last.y;
|
|
120
|
+
if (Math.hypot(dx, dy) < MASK_MIN_POINT_DISTANCE)
|
|
121
|
+
return stroke;
|
|
122
|
+
}
|
|
123
|
+
return { ...stroke, points: [...stroke.points, next] };
|
|
124
|
+
}
|
|
125
|
+
/** Squared distance from `p` to the segment `a…b`, all in long-edge space. */
|
|
126
|
+
function squaredDistanceToSegment(p, a, b) {
|
|
127
|
+
const abx = b.x - a.x;
|
|
128
|
+
const aby = b.y - a.y;
|
|
129
|
+
const lengthSquared = abx * abx + aby * aby;
|
|
130
|
+
let t = 0;
|
|
131
|
+
if (lengthSquared > 0) {
|
|
132
|
+
t = ((p.x - a.x) * abx + (p.y - a.y) * aby) / lengthSquared;
|
|
133
|
+
t = Math.min(1, Math.max(0, t));
|
|
134
|
+
}
|
|
135
|
+
const dx = p.x - (a.x + t * abx);
|
|
136
|
+
const dy = p.y - (a.y + t * aby);
|
|
137
|
+
return dx * dx + dy * dy;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* True when `point` (carrying `paintRadius`) lies wholly inside the swept
|
|
141
|
+
* region of `eraser`. Conservative on purpose — the whole brush disc must be
|
|
142
|
+
* covered, not just its centre.
|
|
143
|
+
*/
|
|
144
|
+
function discIsErased(point, paintRadius, eraser, scale) {
|
|
145
|
+
const margin = eraser.radius - paintRadius;
|
|
146
|
+
if (margin < 0)
|
|
147
|
+
return false;
|
|
148
|
+
const marginSquared = margin * margin;
|
|
149
|
+
const scaled = (q) => ({
|
|
150
|
+
x: q.x * scale.x,
|
|
151
|
+
y: q.y * scale.y,
|
|
152
|
+
});
|
|
153
|
+
const p = scaled(point);
|
|
154
|
+
const first = eraser.points[0];
|
|
155
|
+
if (!first)
|
|
156
|
+
return false;
|
|
157
|
+
if (eraser.points.length === 1) {
|
|
158
|
+
return squaredDistanceToSegment(p, scaled(first), scaled(first)) <= marginSquared;
|
|
159
|
+
}
|
|
160
|
+
for (let i = 1; i < eraser.points.length; i++) {
|
|
161
|
+
const a = scaled(eraser.points[i - 1]);
|
|
162
|
+
const b = scaled(eraser.points[i]);
|
|
163
|
+
if (squaredDistanceToSegment(p, a, b) <= marginSquared)
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* True when the stroke list would produce an all-black mask. Callers use this
|
|
170
|
+
* to choose between the masked `mask_inpaint` path and the mask-free
|
|
171
|
+
* `semantic_edit` path (spec §4.5), because an all-black mask means "edit
|
|
172
|
+
* nothing" and would waste a call.
|
|
173
|
+
*
|
|
174
|
+
* Covers BOTH ways a mask ends up blank: no paint strokes at all, and paint
|
|
175
|
+
* that a LATER erase stroke wiped out. The erase test is deliberately
|
|
176
|
+
* conservative — a painted sample counts as gone only when its whole brush
|
|
177
|
+
* disc sits inside one later erase stroke's swept region — so this can answer
|
|
178
|
+
* "not empty" for a mask the rasterizer happens to render black, but it never
|
|
179
|
+
* calls a mask with surviving paint empty. Erring that way costs one wasted
|
|
180
|
+
* inpaint call; erring the other way would silently drop the creator's edit.
|
|
181
|
+
*/
|
|
182
|
+
export function strokesAreEmpty(strokes, geometry) {
|
|
183
|
+
const scale = longEdgeScale(geometry);
|
|
184
|
+
for (let i = 0; i < strokes.length; i++) {
|
|
185
|
+
const stroke = strokes[i];
|
|
186
|
+
if (stroke.mode !== 'paint' || stroke.points.length === 0)
|
|
187
|
+
continue;
|
|
188
|
+
const erasers = strokes
|
|
189
|
+
.slice(i + 1)
|
|
190
|
+
.filter(later => later.mode === 'erase' && later.points.length > 0);
|
|
191
|
+
for (const point of stroke.points) {
|
|
192
|
+
const erased = erasers.some(eraser => discIsErased(point, stroke.radius, eraser, scale));
|
|
193
|
+
if (!erased)
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Bounding box of the PAINT strokes in normalized space, clamped to the
|
|
201
|
+
* frame. `null` when nothing is painted. Erase strokes are ignored — they
|
|
202
|
+
* can only shrink coverage, and computing the true post-erase extent would
|
|
203
|
+
* mean rasterizing. Callers use this for "zoom to edit" affordances and for
|
|
204
|
+
* the too-small-to-inpaint warning, both of which want a conservative
|
|
205
|
+
* (over-)estimate.
|
|
206
|
+
*
|
|
207
|
+
* `geometry` is REQUIRED because the radius is normalized against the longer
|
|
208
|
+
* edge: on a 16:9 frame the same brush spans a larger fraction of the short
|
|
209
|
+
* axis, so the two axes get different normalized extents.
|
|
210
|
+
*/
|
|
211
|
+
export function maskCoverageBounds(strokes, geometry) {
|
|
212
|
+
const scale = longEdgeScale(geometry);
|
|
213
|
+
let minX = Infinity;
|
|
214
|
+
let minY = Infinity;
|
|
215
|
+
let maxX = -Infinity;
|
|
216
|
+
let maxY = -Infinity;
|
|
217
|
+
for (const stroke of strokes) {
|
|
218
|
+
if (stroke.mode !== 'paint')
|
|
219
|
+
continue;
|
|
220
|
+
const radiusX = stroke.radius / scale.x;
|
|
221
|
+
const radiusY = stroke.radius / scale.y;
|
|
222
|
+
for (const point of stroke.points) {
|
|
223
|
+
minX = Math.min(minX, point.x - radiusX);
|
|
224
|
+
minY = Math.min(minY, point.y - radiusY);
|
|
225
|
+
maxX = Math.max(maxX, point.x + radiusX);
|
|
226
|
+
maxY = Math.max(maxY, point.y + radiusY);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (minX === Infinity)
|
|
230
|
+
return null;
|
|
231
|
+
return {
|
|
232
|
+
minX: clamp(minX, 0, 1),
|
|
233
|
+
minY: clamp(minY, 0, 1),
|
|
234
|
+
maxX: clamp(maxX, 0, 1),
|
|
235
|
+
maxY: clamp(maxY, 0, 1),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Turn strokes into a flat op list at `geometry`'s pixel size. Pure — this
|
|
240
|
+
* is the testable heart of the brush→mask path.
|
|
241
|
+
*
|
|
242
|
+
* A single-point (tap) stroke becomes a `dot` op — a filled circle — NOT a
|
|
243
|
+
* degenerate path. `moveTo(p); lineTo(p); stroke()` renders a zero-length
|
|
244
|
+
* subpath whose treatment is engine-dependent even with a round line cap, and
|
|
245
|
+
* a tap that silently produced no mask pixels would send an all-black mask
|
|
246
|
+
* down the inpaint path.
|
|
247
|
+
*/
|
|
248
|
+
export function planMaskRender(strokes, geometry) {
|
|
249
|
+
const width = Math.max(1, Math.round(geometry.width));
|
|
250
|
+
const height = Math.max(1, Math.round(geometry.height));
|
|
251
|
+
const longEdge = Math.max(width, height);
|
|
252
|
+
const ops = [{ kind: 'fill', color: MASK_KEEP_COLOR }];
|
|
253
|
+
for (const stroke of strokes) {
|
|
254
|
+
if (stroke.points.length === 0)
|
|
255
|
+
continue;
|
|
256
|
+
const color = stroke.mode === 'paint' ? MASK_PAINT_COLOR : MASK_KEEP_COLOR;
|
|
257
|
+
// Radius is normalized against the longer edge (see the file header),
|
|
258
|
+
// so the stroke's pixel diameter is radius * 2 * longEdge.
|
|
259
|
+
const lineWidth = Math.max(1, stroke.radius * 2 * longEdge);
|
|
260
|
+
const points = stroke.points.map(p => ({
|
|
261
|
+
x: p.x * width,
|
|
262
|
+
y: p.y * height,
|
|
263
|
+
}));
|
|
264
|
+
if (points.length === 1) {
|
|
265
|
+
ops.push({
|
|
266
|
+
kind: 'dot',
|
|
267
|
+
mode: stroke.mode,
|
|
268
|
+
color,
|
|
269
|
+
center: points[0],
|
|
270
|
+
radius: lineWidth / 2,
|
|
271
|
+
});
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
ops.push({ kind: 'path', mode: stroke.mode, color, lineWidth, points });
|
|
275
|
+
}
|
|
276
|
+
return { width, height, ops };
|
|
277
|
+
}
|
|
278
|
+
/** Apply a plan to any 2D-context-shaped target. */
|
|
279
|
+
export function rasterizeMaskPlan(plan, target) {
|
|
280
|
+
target.lineCap = 'round';
|
|
281
|
+
target.lineJoin = 'round';
|
|
282
|
+
for (const op of plan.ops) {
|
|
283
|
+
if (op.kind === 'fill') {
|
|
284
|
+
target.fillStyle = op.color;
|
|
285
|
+
target.fillRect(0, 0, plan.width, plan.height);
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (op.kind === 'dot') {
|
|
289
|
+
target.fillStyle = op.color;
|
|
290
|
+
target.beginPath();
|
|
291
|
+
target.arc(op.center.x, op.center.y, op.radius, 0, Math.PI * 2);
|
|
292
|
+
target.fill();
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
const [first, ...rest] = op.points;
|
|
296
|
+
if (!first)
|
|
297
|
+
continue;
|
|
298
|
+
target.strokeStyle = op.color;
|
|
299
|
+
target.lineWidth = op.lineWidth;
|
|
300
|
+
target.beginPath();
|
|
301
|
+
target.moveTo(first.x, first.y);
|
|
302
|
+
for (const point of rest)
|
|
303
|
+
target.lineTo(point.x, point.y);
|
|
304
|
+
target.stroke();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Draw the mask into a caller-owned canvas, sized to the plan. Use this when
|
|
309
|
+
* the host already has a canvas (the SB-U.7 editor previews the mask live);
|
|
310
|
+
* {@link strokesToMaskPngBlob} is the one-shot export path.
|
|
311
|
+
*/
|
|
312
|
+
export function renderMaskToCanvas(strokes, geometry, canvas) {
|
|
313
|
+
const plan = planMaskRender(strokes, geometry);
|
|
314
|
+
canvas.width = plan.width;
|
|
315
|
+
canvas.height = plan.height;
|
|
316
|
+
const ctx = canvas.getContext('2d');
|
|
317
|
+
if (!ctx)
|
|
318
|
+
throw new Error('storyboardMask: 2D canvas context unavailable');
|
|
319
|
+
rasterizeMaskPlan(plan, ctx);
|
|
320
|
+
return plan;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Encode the strokes as a mask PNG.
|
|
324
|
+
*
|
|
325
|
+
* Requires a DOM with a working 2D canvas backend — i.e. a real browser.
|
|
326
|
+
* It THROWS rather than falling back in a canvas-less environment (jsdom,
|
|
327
|
+
* SSR): a silent fallback here would ship a mask that edits the wrong
|
|
328
|
+
* pixels, which is worse than a loud failure the caller can surface.
|
|
329
|
+
* Everything above this line is testable without a canvas, which is why the
|
|
330
|
+
* plan/raster split exists.
|
|
331
|
+
*/
|
|
332
|
+
export async function strokesToMaskPngBlob(strokes, geometry) {
|
|
333
|
+
if (typeof document === 'undefined') {
|
|
334
|
+
throw new Error('storyboardMask: no document — mask export needs a browser');
|
|
335
|
+
}
|
|
336
|
+
const canvas = document.createElement('canvas');
|
|
337
|
+
renderMaskToCanvas(strokes, geometry, canvas);
|
|
338
|
+
const blob = await new Promise(resolve => {
|
|
339
|
+
canvas.toBlob(b => resolve(b), MASK_IMAGE_MIME);
|
|
340
|
+
});
|
|
341
|
+
if (!blob)
|
|
342
|
+
throw new Error('storyboardMask: canvas.toBlob yielded no mask');
|
|
343
|
+
return blob;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Mask PNG as the bare base64 payload for the `maskImageBase64` field of
|
|
347
|
+
* `POST …/frames/{frameId}/region-edit` (spec §4.5). Reuses the existing
|
|
348
|
+
* `fileToBase64` helper rather than adding a second data-URL stripper.
|
|
349
|
+
*/
|
|
350
|
+
export async function strokesToMaskBase64(strokes, geometry) {
|
|
351
|
+
return await fileToBase64(await strokesToMaskPngBlob(strokes, geometry));
|
|
352
|
+
}
|
|
353
|
+
/** A camera that does not move. Prose leg: {@link CAMERA_PROSE_STATIC}. */
|
|
354
|
+
export const CAMERA_POSE_IDENTITY = {
|
|
355
|
+
rx: 0,
|
|
356
|
+
ry: 0,
|
|
357
|
+
rz: 0,
|
|
358
|
+
tx: 0,
|
|
359
|
+
ty: 0,
|
|
360
|
+
tz: 0,
|
|
361
|
+
};
|
|
362
|
+
/** Full-deflection limits an annotation gesture can reach. */
|
|
363
|
+
export const CAMERA_MAX_YAW_DEG = 45;
|
|
364
|
+
export const CAMERA_MAX_PITCH_DEG = 30;
|
|
365
|
+
export const CAMERA_MAX_ROLL_DEG = 20;
|
|
366
|
+
/** Full-deflection translation, in normalized frame units. */
|
|
367
|
+
export const CAMERA_MAX_TRANSLATION = 1;
|
|
368
|
+
/** Below this, a component reads as noise and contributes no prose clause. */
|
|
369
|
+
export const CAMERA_DEADZONE = 1e-3;
|
|
370
|
+
/** Prose for a pose within the deadzone on every axis. */
|
|
371
|
+
export const CAMERA_PROSE_STATIC = 'static camera';
|
|
372
|
+
/**
|
|
373
|
+
* Convert a pixel drag over the frame into a pan/tilt annotation. Dragging
|
|
374
|
+
* RIGHT pans right and dragging UP tilts up, so the handle follows the
|
|
375
|
+
* pointer; screen `dy` grows downward, hence the negation. A full-width drag
|
|
376
|
+
* is full deflection.
|
|
377
|
+
*/
|
|
378
|
+
export function dragToCameraAnnotation(drag, box) {
|
|
379
|
+
const width = box.width > 0 ? box.width : 1;
|
|
380
|
+
const height = box.height > 0 ? box.height : 1;
|
|
381
|
+
return {
|
|
382
|
+
pan: normalizedDeflection(drag.dx / width),
|
|
383
|
+
tilt: normalizedDeflection(-drag.dy / height),
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Scale an annotation into a {@link CameraPose}, optionally composed onto an
|
|
388
|
+
* existing pose (so successive gestures accumulate). The result is clamped
|
|
389
|
+
* to the per-axis limits.
|
|
390
|
+
*/
|
|
391
|
+
export function annotationToCameraPose(annotation, base = CAMERA_POSE_IDENTITY) {
|
|
392
|
+
const T = CAMERA_MAX_TRANSLATION;
|
|
393
|
+
const axis = (value, origin, limit) => clamp(origin + normalizedDeflection(value ?? 0) * limit, -limit, limit);
|
|
394
|
+
return {
|
|
395
|
+
rx: axis(annotation.tilt, base.rx, CAMERA_MAX_PITCH_DEG),
|
|
396
|
+
ry: axis(annotation.pan, base.ry, CAMERA_MAX_YAW_DEG),
|
|
397
|
+
rz: axis(annotation.roll, base.rz, CAMERA_MAX_ROLL_DEG),
|
|
398
|
+
tx: axis(annotation.truck, base.tx, T),
|
|
399
|
+
ty: axis(annotation.pedestal, base.ty, T),
|
|
400
|
+
tz: axis(annotation.dolly, base.tz, T),
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Inverse of {@link annotationToCameraPose} against the identity pose —
|
|
405
|
+
* restores the editor's annotation handles from a frame's saved pose.
|
|
406
|
+
*/
|
|
407
|
+
export function cameraPoseToAnnotation(pose) {
|
|
408
|
+
const T = CAMERA_MAX_TRANSLATION;
|
|
409
|
+
return {
|
|
410
|
+
pan: pose.ry / CAMERA_MAX_YAW_DEG,
|
|
411
|
+
tilt: pose.rx / CAMERA_MAX_PITCH_DEG,
|
|
412
|
+
roll: pose.rz / CAMERA_MAX_ROLL_DEG,
|
|
413
|
+
dolly: pose.tz / T,
|
|
414
|
+
truck: pose.tx / T,
|
|
415
|
+
pedestal: pose.ty / T,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
/** Serialize a pose to its `[rx, ry, rz, tx, ty, tz]` tuple form. */
|
|
419
|
+
export function cameraPoseToTuple(pose) {
|
|
420
|
+
return [pose.rx, pose.ry, pose.rz, pose.tx, pose.ty, pose.tz];
|
|
421
|
+
}
|
|
422
|
+
/** Parse a `[rx, ry, rz, tx, ty, tz]` tuple back into a pose. */
|
|
423
|
+
export function cameraPoseFromTuple(tuple) {
|
|
424
|
+
const [rx, ry, rz, tx, ty, tz] = tuple;
|
|
425
|
+
return { rx, ry, rz, tx, ty, tz };
|
|
426
|
+
}
|
|
427
|
+
/** True when every axis is inside {@link CAMERA_DEADZONE}. */
|
|
428
|
+
export function isStaticCameraPose(pose) {
|
|
429
|
+
return cameraPoseToTuple(pose).every(v => Math.abs(v) < CAMERA_DEADZONE);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Clause vocabulary for {@link cameraPoseToProse}, in the FIXED order the
|
|
433
|
+
* prose reads. Module-level so the same pose always yields the same string
|
|
434
|
+
* regardless of the order a gesture touched the axes.
|
|
435
|
+
*/
|
|
436
|
+
const CAMERA_PROSE_AXES = [
|
|
437
|
+
{
|
|
438
|
+
key: 'ry',
|
|
439
|
+
limit: CAMERA_MAX_YAW_DEG,
|
|
440
|
+
positive: 'pans right',
|
|
441
|
+
negative: 'pans left',
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
key: 'rx',
|
|
445
|
+
limit: CAMERA_MAX_PITCH_DEG,
|
|
446
|
+
positive: 'tilts up',
|
|
447
|
+
negative: 'tilts down',
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
key: 'tz',
|
|
451
|
+
limit: CAMERA_MAX_TRANSLATION,
|
|
452
|
+
positive: 'pushes in',
|
|
453
|
+
negative: 'pulls back',
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
key: 'tx',
|
|
457
|
+
limit: CAMERA_MAX_TRANSLATION,
|
|
458
|
+
positive: 'trucks right',
|
|
459
|
+
negative: 'trucks left',
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
key: 'ty',
|
|
463
|
+
limit: CAMERA_MAX_TRANSLATION,
|
|
464
|
+
positive: 'pedestals up',
|
|
465
|
+
negative: 'pedestals down',
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
key: 'rz',
|
|
469
|
+
limit: CAMERA_MAX_ROLL_DEG,
|
|
470
|
+
positive: 'rolls clockwise',
|
|
471
|
+
negative: 'rolls counter-clockwise',
|
|
472
|
+
},
|
|
473
|
+
];
|
|
474
|
+
function magnitudeWord(ratio) {
|
|
475
|
+
if (ratio < 1 / 3)
|
|
476
|
+
return 'slightly ';
|
|
477
|
+
if (ratio > 2 / 3)
|
|
478
|
+
return 'sharply ';
|
|
479
|
+
return '';
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* The PROSE leg of the dual camera encoding, and today the only leg any live
|
|
483
|
+
* target consumes (spec §5.4: Seedance / Veo / Runway / LongLive / HappyOyster
|
|
484
|
+
* REGISTER all take camera language — see {@link CameraPose} for why the
|
|
485
|
+
* parametric leg has no wire consumer yet). Deterministic and axis-ordered so
|
|
486
|
+
* the same pose always compiles to the same string, which is what lets
|
|
487
|
+
* `FramePrompt.compiled_text()` stay reproducible.
|
|
488
|
+
*/
|
|
489
|
+
export function cameraPoseToProse(pose) {
|
|
490
|
+
const clauses = [];
|
|
491
|
+
for (const axis of CAMERA_PROSE_AXES) {
|
|
492
|
+
const value = pose[axis.key];
|
|
493
|
+
if (Math.abs(value) < CAMERA_DEADZONE)
|
|
494
|
+
continue;
|
|
495
|
+
const ratio = Math.min(1, Math.abs(value) / axis.limit);
|
|
496
|
+
clauses.push(`${magnitudeWord(ratio)}${value > 0 ? axis.positive : axis.negative}`);
|
|
497
|
+
}
|
|
498
|
+
if (clauses.length === 0)
|
|
499
|
+
return CAMERA_PROSE_STATIC;
|
|
500
|
+
if (clauses.length === 1)
|
|
501
|
+
return `camera ${clauses[0]}`;
|
|
502
|
+
const last = clauses[clauses.length - 1];
|
|
503
|
+
return `camera ${clauses.slice(0, -1).join(', ')} and ${last}`;
|
|
504
|
+
}
|
|
505
|
+
//# sourceMappingURL=storyboardMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyboardMask.js","sourceRoot":"","sources":["../src/storyboardMask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAuC/D,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAC1C,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AACzC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE7C,S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E,OAAO,UAAU,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,OAAO,UAAU,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type StoryboardFrame, type StoryboardFrameStatus } from './domains/storyboards';
|
|
2
|
+
/** One frame laid on the ruler. */
|
|
3
|
+
export interface StoryboardTimelineClip {
|
|
4
|
+
frame: StoryboardFrame;
|
|
5
|
+
frameId: string;
|
|
6
|
+
/** 0-based position in resolved `frameIds` order. */
|
|
7
|
+
index: number;
|
|
8
|
+
/** Screen-time offset of the clip's left edge, in seconds. */
|
|
9
|
+
startSeconds: number;
|
|
10
|
+
/** `startSeconds + durationSeconds`. */
|
|
11
|
+
endSeconds: number;
|
|
12
|
+
durationSeconds: number;
|
|
13
|
+
/** Derived from the frame's variants — never read from a stored field. */
|
|
14
|
+
status: StoryboardFrameStatus;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A run of CONSECUTIVE clips sharing one `sequenceId` — the mockup's sequence
|
|
18
|
+
* band above the ruler.
|
|
19
|
+
*
|
|
20
|
+
* Consecutive, not grouped-by-id: a band is a stretch of screen time, so two
|
|
21
|
+
* separated runs of the same `sequenceId` are two bands. Collapsing them into
|
|
22
|
+
* one would draw a band over frames that are not in it. Frames with no
|
|
23
|
+
* `sequenceId` produce no band (nothing is invented for them).
|
|
24
|
+
*/
|
|
25
|
+
export interface StoryboardTimelineSequence {
|
|
26
|
+
sequenceId: string;
|
|
27
|
+
startSeconds: number;
|
|
28
|
+
endSeconds: number;
|
|
29
|
+
/** Index of the first clip in the run — the band's identity for keying. */
|
|
30
|
+
firstIndex: number;
|
|
31
|
+
}
|
|
32
|
+
export interface StoryboardTimeline {
|
|
33
|
+
clips: StoryboardTimelineClip[];
|
|
34
|
+
sequences: StoryboardTimelineSequence[];
|
|
35
|
+
/** Total screen time of the resolved clips, in seconds. */
|
|
36
|
+
totalSeconds: number;
|
|
37
|
+
/**
|
|
38
|
+
* Ids present in `frameIds` with no frame in the payload. Normal while a
|
|
39
|
+
* board generates (SB.4 writes the ordering to META before the frames
|
|
40
|
+
* exist), so the board reports them rather than pretending the board is
|
|
41
|
+
* shorter than it is.
|
|
42
|
+
*/
|
|
43
|
+
missingFrameIds: string[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Project an ordered board onto the ruler.
|
|
47
|
+
*
|
|
48
|
+
* @param frameIds The board's `frameIds` — the ONLY source of order.
|
|
49
|
+
* @param frames The detail read's frames, in any order.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildStoryboardTimeline(frameIds: readonly string[], frames: readonly StoryboardFrame[]): StoryboardTimeline;
|
|
52
|
+
/**
|
|
53
|
+
* The clip the playhead sits over: the LAST clip whose start is at or before
|
|
54
|
+
* `seconds`. Times past the end resolve to the final clip (the playhead can
|
|
55
|
+
* rest on the board's last frame), and an empty board resolves to `undefined`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function clipAtTime(timeline: StoryboardTimeline, seconds: number): StoryboardTimelineClip | undefined;
|
|
58
|
+
/** Render progress across a board's frames — the 202-poll progress readout. */
|
|
59
|
+
export interface StoryboardFrameProgress {
|
|
60
|
+
/**
|
|
61
|
+
* Every frame the board WILL have — resolved clips plus the ids in
|
|
62
|
+
* `frameIds` that have no frame written yet.
|
|
63
|
+
*
|
|
64
|
+
* Counting only resolved clips is the bug this field exists to prevent: SB.4
|
|
65
|
+
* writes the whole ordering to META before the first frame, so a board one
|
|
66
|
+
* frame into a ten-frame run would otherwise report "1/1 frames rendered"
|
|
67
|
+
* with a full bar.
|
|
68
|
+
*/
|
|
69
|
+
total: number;
|
|
70
|
+
/** Not started — includes the ids with no frame written yet. */
|
|
71
|
+
pending: number;
|
|
72
|
+
running: number;
|
|
73
|
+
succeeded: number;
|
|
74
|
+
failed: number;
|
|
75
|
+
/** `succeeded + failed` — frames that will not change again. */
|
|
76
|
+
settled: number;
|
|
77
|
+
/**
|
|
78
|
+
* `settled / total`, clamped to `[0, 1]`; `0` for an empty board.
|
|
79
|
+
*
|
|
80
|
+
* SETTLED, not succeeded, drives the bar on purpose: a board whose last
|
|
81
|
+
* frame failed is finished, and a bar keyed on successes alone would sit at
|
|
82
|
+
* 90 % forever while the run is over. The failure is reported by `failed`.
|
|
83
|
+
*/
|
|
84
|
+
fraction: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Count a board's frames by derived status. Takes the whole timeline — not
|
|
88
|
+
* just its clips — so the denominator includes the not-yet-written ids, and so
|
|
89
|
+
* the counter and the ruler can never disagree (both read one
|
|
90
|
+
* `deriveFrameStatus` result per frame).
|
|
91
|
+
*/
|
|
92
|
+
export declare function storyboardFrameProgress(timeline: StoryboardTimeline): StoryboardFrameProgress;
|
|
93
|
+
//# sourceMappingURL=storyboardTimeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyboardTimeline.d.ts","sourceRoot":"","sources":["../src/storyboardTimeline.ts"],"names":[],"mappings":"AA0BA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC3B,MAAM,uBAAuB,CAAC;AAE/B,mCAAmC;AACnC,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH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