@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,695 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ingestion domain module (§A9, row A9.2): video upload/listing, ingestion
|
|
3
|
+
* jobs, Pegasus enrichment, the VLM extraction-catalogue admin/user surface,
|
|
4
|
+
* video deletion, and the M7 Phase 6 async narrative-regeneration runner —
|
|
5
|
+
* moved off the `ApiClient` god class into a facade delegation per the
|
|
6
|
+
* client-core domain split.
|
|
7
|
+
*
|
|
8
|
+
* `ApiClient` keeps the public method names/signatures/JSDoc UNCHANGED (the
|
|
9
|
+
* published surface `../Web-App` is pinned to) — every `ApiClient` method
|
|
10
|
+
* below is now a one-line delegation to an `IngestionApi` instance held on
|
|
11
|
+
* `this.ingestion`. Request/response TYPES stay declared in `api.ts` (still
|
|
12
|
+
* exported from `index.ts` exactly as before); this module only imports them
|
|
13
|
+
* `import type` so there is no runtime circularity with `api.ts`.
|
|
14
|
+
*
|
|
15
|
+
* `REGENERATION_STATUS` / `REGENERATION_TERMINAL_STATUSES` (runtime consts,
|
|
16
|
+
* not types) move here — their owning domain (used by
|
|
17
|
+
* {@link IngestionApi.pollRegenerationUntilDone}) — and are re-exported from
|
|
18
|
+
* `api.ts` unchanged, mirroring the `PARTY_ACTION` relocation in
|
|
19
|
+
* `./adventures`.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { Transport } from '../transport';
|
|
23
|
+
import { abortableSleep } from '../pollUtils';
|
|
24
|
+
import type {
|
|
25
|
+
CastWithPersonaResponse,
|
|
26
|
+
CharacterListResponse,
|
|
27
|
+
EnrichVideoResponse,
|
|
28
|
+
EnrichmentModelsResponse,
|
|
29
|
+
EnrichmentRecord,
|
|
30
|
+
ExtractionModelsResponse,
|
|
31
|
+
ExtractionRouterState,
|
|
32
|
+
ExtractionSampleRequest,
|
|
33
|
+
ExtractionSampleResponse,
|
|
34
|
+
ExtractionTemplatesResponse,
|
|
35
|
+
IngestionJob,
|
|
36
|
+
ListEnrichmentsResponse,
|
|
37
|
+
GetVideoResponse,
|
|
38
|
+
ListJobsResponse,
|
|
39
|
+
ListVideosResponse,
|
|
40
|
+
PegasusConfig,
|
|
41
|
+
RegenerateRequest,
|
|
42
|
+
RegenerationListResponse,
|
|
43
|
+
RegenerationRunResponse,
|
|
44
|
+
RegenerationRunStatus,
|
|
45
|
+
ReprocessVideoResponse,
|
|
46
|
+
GetSeriesTransferResponse,
|
|
47
|
+
SeriesTransferAcceptedResponse,
|
|
48
|
+
SeriesTransferRequest,
|
|
49
|
+
SeriesTransferStatus,
|
|
50
|
+
UploadProgressCallback,
|
|
51
|
+
UploadResponse,
|
|
52
|
+
VideoDeletionResponse,
|
|
53
|
+
VideoSeriesAssignmentRequest,
|
|
54
|
+
VideoSeriesAssignmentResponse,
|
|
55
|
+
} from '../api';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Lifecycle status of a regeneration run. Mirrors
|
|
59
|
+
* `shared/models.py::RegenerationRunStatus` (a Python StrEnum) — the worker
|
|
60
|
+
* walks QUEUED → RUNNING → MERGING → COMPLETE, or terminates in FAILED /
|
|
61
|
+
* CANCELLED. Exposed as a const map (not bare literals) so call sites compare
|
|
62
|
+
* against `REGENERATION_STATUS.COMPLETE` rather than `'complete'`.
|
|
63
|
+
*/
|
|
64
|
+
export const REGENERATION_STATUS = {
|
|
65
|
+
QUEUED: 'queued',
|
|
66
|
+
RUNNING: 'running',
|
|
67
|
+
MERGING: 'merging',
|
|
68
|
+
COMPLETE: 'complete',
|
|
69
|
+
FAILED: 'failed',
|
|
70
|
+
CANCELLED: 'cancelled',
|
|
71
|
+
} as const satisfies Record<string, RegenerationRunStatus>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Terminal statuses: a run in one of these will never transition again.
|
|
75
|
+
* Mirrors `shared/models.py::REGENERATION_TERMINAL_STATUSES`. The poller
|
|
76
|
+
* resolves on COMPLETE / CANCELLED and throws on FAILED — but a consumer
|
|
77
|
+
* rendering history can use this set to gate "in-flight" affordances.
|
|
78
|
+
*/
|
|
79
|
+
export const REGENERATION_TERMINAL_STATUSES: readonly RegenerationRunStatus[] = [
|
|
80
|
+
REGENERATION_STATUS.COMPLETE,
|
|
81
|
+
REGENERATION_STATUS.FAILED,
|
|
82
|
+
REGENERATION_STATUS.CANCELLED,
|
|
83
|
+
] as const;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* §Q MT.15c X3 — terminal `SeriesTransferStatus` values (mirrors
|
|
87
|
+
* `TERMINAL_TRANSFER_STATUSES` in `shared/series_transfer_store.py`). A
|
|
88
|
+
* redelivered saga message acks without touching a job already in one of
|
|
89
|
+
* these; a status-poller can use this set to stop polling.
|
|
90
|
+
*/
|
|
91
|
+
export const SERIES_TRANSFER_TERMINAL_STATUSES: readonly SeriesTransferStatus[] = [
|
|
92
|
+
'COMPLETED',
|
|
93
|
+
'FAILED',
|
|
94
|
+
] as const;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* §Q W2.11 failed-ingest recovery — the stable machine-keyable 409 reason
|
|
98
|
+
* tokens of `POST /api/v1/ingestion/videos/{videoId}/reprocess`
|
|
99
|
+
* ({@link IngestionApi.reprocessVideo}). The backend contract is
|
|
100
|
+
* `"{token}: human message"` (`api/ingestion/app.py::reprocess_video` — "the
|
|
101
|
+
* UI keys off the token before ':'"); mirrors `services/ingestion/reprocess.py`
|
|
102
|
+
* `BLOCKED_*` plus the handler-raised execution-time tokens. Const map (not
|
|
103
|
+
* bare literals) per the {@link REGENERATION_STATUS} convention.
|
|
104
|
+
*/
|
|
105
|
+
export const REPROCESS_BLOCKED_REASON = {
|
|
106
|
+
/** D.1 terminal-curation policy — a curated graph is never re-ingested. */
|
|
107
|
+
CURATED_TERMINAL: 'curated-terminal',
|
|
108
|
+
/** The ingestion job is still PENDING/RUNNING. */
|
|
109
|
+
IN_FLIGHT: 'in-flight',
|
|
110
|
+
/** SUCCEEDED job with no failed (re-runnable) stage. */
|
|
111
|
+
NO_REPROCESSABLE_STAGE: 'no-reprocessable-stage',
|
|
112
|
+
/** The job record carries no S3 source location. */
|
|
113
|
+
SOURCE_LOCATION_UNKNOWN: 'source-location-unknown',
|
|
114
|
+
/** The source video object was deleted from storage. */
|
|
115
|
+
SOURCE_OBJECT_MISSING: 'source-object-missing',
|
|
116
|
+
/** SME extraction transport not configured (enrichment re-run). */
|
|
117
|
+
SME_TRANSPORT_UNAVAILABLE: 'sme-transport-unavailable',
|
|
118
|
+
/** No canonical shots available for the enrichment re-run. */
|
|
119
|
+
SHOTS_UNAVAILABLE: 'shots-unavailable',
|
|
120
|
+
/** Transcription transport not configured (transcript re-run). */
|
|
121
|
+
TRANSCRIPTION_NOT_CONFIGURED: 'transcription-not-configured',
|
|
122
|
+
} as const;
|
|
123
|
+
|
|
124
|
+
/** One machine-keyable reprocess 409 reason token. */
|
|
125
|
+
export type ReprocessBlockedReason =
|
|
126
|
+
(typeof REPROCESS_BLOCKED_REASON)[keyof typeof REPROCESS_BLOCKED_REASON];
|
|
127
|
+
|
|
128
|
+
const REPROCESS_BLOCKED_REASON_SET: ReadonlySet<string> = new Set(
|
|
129
|
+
Object.values(REPROCESS_BLOCKED_REASON),
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Parse a {@link IngestionApi.reprocessVideo} failure into its 409 reason
|
|
134
|
+
* token, or `null` for any other error (transport faults, 5xx, non-conflict
|
|
135
|
+
* shapes). Accepts the thrown value directly — the transport surfaces the
|
|
136
|
+
* backend `detail` string as `Error.message`, so this keys off the text
|
|
137
|
+
* before the first `':'` per the endpoint's stated contract.
|
|
138
|
+
*/
|
|
139
|
+
export function parseReprocessBlockedReason(error: unknown): ReprocessBlockedReason | null {
|
|
140
|
+
const message =
|
|
141
|
+
error instanceof Error ? error.message : typeof error === 'string' ? error : '';
|
|
142
|
+
const separator = message.indexOf(':');
|
|
143
|
+
if (separator === -1) return null;
|
|
144
|
+
const token = message.slice(0, separator).trim();
|
|
145
|
+
return REPROCESS_BLOCKED_REASON_SET.has(token) ? (token as ReprocessBlockedReason) : null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Video ingestion + enrichment + extraction catalogue + narrative
|
|
150
|
+
* regeneration (main tools API base, except the 4 admin extraction-catalogue
|
|
151
|
+
* methods which are CHAT-base — see the per-method note).
|
|
152
|
+
*/
|
|
153
|
+
export class IngestionApi {
|
|
154
|
+
constructor(private readonly transport: Transport) {}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* List all ingestion jobs with optional filtering
|
|
158
|
+
*/
|
|
159
|
+
async listJobs(params?: {
|
|
160
|
+
status?: string;
|
|
161
|
+
limit?: number;
|
|
162
|
+
nextToken?: string;
|
|
163
|
+
}): Promise<ListJobsResponse> {
|
|
164
|
+
const searchParams = new URLSearchParams();
|
|
165
|
+
if (params?.status) searchParams.append('status', params.status);
|
|
166
|
+
if (params?.limit) searchParams.append('limit', params.limit.toString());
|
|
167
|
+
if (params?.nextToken) searchParams.append('nextToken', params.nextToken);
|
|
168
|
+
|
|
169
|
+
const query = searchParams.toString();
|
|
170
|
+
const endpoint = `/api/v1/ingestion/jobs${query ? `?${query}` : ''}`;
|
|
171
|
+
|
|
172
|
+
return this.transport.requestJson<ListJobsResponse>(this.transport.baseUrl, endpoint);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Get a specific ingestion job by video ID
|
|
177
|
+
*/
|
|
178
|
+
async getJob(videoId: string): Promise<{ traceId: string; job: IngestionJob }> {
|
|
179
|
+
return this.transport.requestJson(this.transport.baseUrl, `/api/v1/ingestion/jobs/${videoId}`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* List succeeded videos (for chat selector)
|
|
184
|
+
*/
|
|
185
|
+
async listSucceededVideos(params?: {
|
|
186
|
+
limit?: number;
|
|
187
|
+
nextToken?: string;
|
|
188
|
+
}): Promise<ListJobsResponse> {
|
|
189
|
+
const searchParams = new URLSearchParams();
|
|
190
|
+
if (params?.limit) searchParams.append('limit', params.limit.toString());
|
|
191
|
+
if (params?.nextToken) searchParams.append('nextToken', params.nextToken);
|
|
192
|
+
|
|
193
|
+
const query = searchParams.toString();
|
|
194
|
+
const endpoint = `/api/v1/tools/videos${query ? `?${query}` : ''}`;
|
|
195
|
+
|
|
196
|
+
return this.transport.requestJson<ListJobsResponse>(this.transport.baseUrl, endpoint);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Story Engine Phase 5 — list character entities for a video. Backs the
|
|
201
|
+
* persona↔character binding selector. Returns only ``Entity`` nodes with
|
|
202
|
+
* ``type === 'character'`` for the given video. Auth + video ownership are
|
|
203
|
+
* enforced server-side (caller must own the video). Uses the main API base
|
|
204
|
+
* (the tools routes use ``request``, not ``chatRequest``).
|
|
205
|
+
*/
|
|
206
|
+
async listVideoCharacters(videoId: string): Promise<CharacterListResponse> {
|
|
207
|
+
return this.transport.requestJson<CharacterListResponse>(
|
|
208
|
+
this.transport.baseUrl,
|
|
209
|
+
`/api/v1/tools/videos/${encodeURIComponent(videoId)}/characters`,
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Platform Restructure R5a — fetch a video's character cast pre-joined to
|
|
215
|
+
* each character's bound persona in ONE round-trip (the server resolves the
|
|
216
|
+
* PORTRAYS binding + hydrates persona display fields). The one-call
|
|
217
|
+
* replacement for the CastGrid's `getVideoGraph` + `listPersonas` client-side
|
|
218
|
+
* `entity_id` join (the R5c rewire consumes this). Auth + video ownership are
|
|
219
|
+
* enforced server-side. Tools API base (`request`, not `chatRequest`).
|
|
220
|
+
*/
|
|
221
|
+
async getCast(videoId: string): Promise<CastWithPersonaResponse> {
|
|
222
|
+
return this.transport.requestJson<CastWithPersonaResponse>(
|
|
223
|
+
this.transport.baseUrl,
|
|
224
|
+
`/api/v1/tools/videos/${encodeURIComponent(videoId)}/cast`,
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* List staged videos in the ingestion bucket.
|
|
230
|
+
*
|
|
231
|
+
* §Q API.3 — this is THE canonical video list: `GET /api/v1/ingestion/videos`,
|
|
232
|
+
* answering `{ results, nextToken }` (`ListVideosResponse`). There is no list
|
|
233
|
+
* handler on `GET /api/v1/videos` (that prefix carries per-video and
|
|
234
|
+
* generation routes only, so a bare GET 404s), and no response carries a
|
|
235
|
+
* `videos` array — a probe that read `.videos` reported a populated library as
|
|
236
|
+
* empty. Entries enumerate raw S3 objects, so one `videoId` can appear more
|
|
237
|
+
* than once; deduplicate by `videoId` before presenting a choice.
|
|
238
|
+
*/
|
|
239
|
+
async listVideos(params?: {
|
|
240
|
+
prefix?: string;
|
|
241
|
+
pageSize?: number;
|
|
242
|
+
continuationToken?: string;
|
|
243
|
+
}): Promise<ListVideosResponse> {
|
|
244
|
+
const searchParams = new URLSearchParams();
|
|
245
|
+
if (params?.prefix) searchParams.append('prefix', params.prefix);
|
|
246
|
+
if (params?.pageSize) searchParams.append('pageSize', params.pageSize.toString());
|
|
247
|
+
if (params?.continuationToken) searchParams.append('continuationToken', params.continuationToken);
|
|
248
|
+
|
|
249
|
+
const query = searchParams.toString();
|
|
250
|
+
const endpoint = `/api/v1/ingestion/videos${query ? `?${query}` : ''}`;
|
|
251
|
+
|
|
252
|
+
return this.transport.requestJson<ListVideosResponse>(this.transport.baseUrl, endpoint);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Resolve ONE video's presigned listing entry (§Q SHOW.5).
|
|
257
|
+
*
|
|
258
|
+
* `GET /api/v1/ingestion/videos/{videoId}`. Two reasons to use this instead
|
|
259
|
+
* of hunting a `videoId` through {@link listVideos}: it is a single call
|
|
260
|
+
* rather than a paged bucket walk, and — the reason it exists — it applies
|
|
261
|
+
* the WIDER server-side read scope (owner, BLESSED, named delegation,
|
|
262
|
+
* superuser, same-tenant member). `listVideos` is OWNER-filtered by design
|
|
263
|
+
* and stays that way, so a blessed video another creator owns is listable on
|
|
264
|
+
* the showcase/stories/projects surfaces but resolvable ONLY here.
|
|
265
|
+
*
|
|
266
|
+
* Throws on 403 (not readable), 404 (no such object) and 503 (existence
|
|
267
|
+
* could not be determined — retryable, distinct from 404 on purpose).
|
|
268
|
+
*/
|
|
269
|
+
async getVideo(videoId: string): Promise<GetVideoResponse> {
|
|
270
|
+
return this.transport.requestJson<GetVideoResponse>(
|
|
271
|
+
this.transport.baseUrl,
|
|
272
|
+
`/api/v1/ingestion/videos/${encodeURIComponent(videoId)}`,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Upload a video file with progress tracking
|
|
278
|
+
*/
|
|
279
|
+
async uploadVideo(
|
|
280
|
+
file: File,
|
|
281
|
+
onProgress?: UploadProgressCallback,
|
|
282
|
+
options?: {
|
|
283
|
+
minSegmentDuration?: number;
|
|
284
|
+
maxSegmentDuration?: number;
|
|
285
|
+
seriesId?: string;
|
|
286
|
+
episodeNumber?: number;
|
|
287
|
+
episodeTitle?: string;
|
|
288
|
+
},
|
|
289
|
+
): Promise<UploadResponse> {
|
|
290
|
+
const url = `${this.transport.baseUrl}/api/v1/ingestion/uploads`;
|
|
291
|
+
|
|
292
|
+
// Prepare form data
|
|
293
|
+
const formData = new FormData();
|
|
294
|
+
formData.append('upload', file);
|
|
295
|
+
|
|
296
|
+
const payload: {
|
|
297
|
+
subdirectory: string;
|
|
298
|
+
source: { type: string; filename: string; contentType: string };
|
|
299
|
+
minSegmentDuration?: number;
|
|
300
|
+
maxSegmentDuration?: number;
|
|
301
|
+
seriesId?: string;
|
|
302
|
+
episodeNumber?: number;
|
|
303
|
+
episodeTitle?: string;
|
|
304
|
+
} = {
|
|
305
|
+
subdirectory: 'web-uploads',
|
|
306
|
+
source: {
|
|
307
|
+
type: 'direct',
|
|
308
|
+
filename: file.name,
|
|
309
|
+
contentType: file.type,
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
// T2.6 — merge the optional per-job segment-duration knobs ONLY when set, so
|
|
314
|
+
// an omitting caller keeps a BYTE-IDENTICAL payload (transport admin default).
|
|
315
|
+
if (options?.minSegmentDuration !== undefined) {
|
|
316
|
+
payload.minSegmentDuration = options.minSegmentDuration;
|
|
317
|
+
}
|
|
318
|
+
if (options?.maxSegmentDuration !== undefined) {
|
|
319
|
+
payload.maxSegmentDuration = options.maxSegmentDuration;
|
|
320
|
+
}
|
|
321
|
+
// W2.4 — series membership at upload time (upload-into-universe). Same
|
|
322
|
+
// omit-when-unset discipline: an omitting caller stays BYTE-IDENTICAL.
|
|
323
|
+
if (options?.seriesId !== undefined) {
|
|
324
|
+
payload.seriesId = options.seriesId;
|
|
325
|
+
}
|
|
326
|
+
if (options?.episodeNumber !== undefined) {
|
|
327
|
+
payload.episodeNumber = options.episodeNumber;
|
|
328
|
+
}
|
|
329
|
+
if (options?.episodeTitle !== undefined) {
|
|
330
|
+
payload.episodeTitle = options.episodeTitle;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
formData.append('payload', JSON.stringify(payload));
|
|
334
|
+
|
|
335
|
+
// XHR upload with progress via the shared Transport (single
|
|
336
|
+
// header-composition point — Authorization + OBO ride the upload too).
|
|
337
|
+
return this.transport.uploadFormData<UploadResponse>(url, formData, onProgress);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* W2.4 "Assign to universe" — re-stamp an EXISTING video's series membership.
|
|
342
|
+
* `PATCH /api/v1/ingestion/videos/{videoId}/series` (owner-guarded: 401/403
|
|
343
|
+
* before body validation; 404 when no ingestion job exists). The episode
|
|
344
|
+
* fields REPLACE stored values wholesale — omitted ⇒ cleared server-side.
|
|
345
|
+
*/
|
|
346
|
+
async assignVideoSeries(
|
|
347
|
+
videoId: string,
|
|
348
|
+
request: VideoSeriesAssignmentRequest,
|
|
349
|
+
): Promise<VideoSeriesAssignmentResponse> {
|
|
350
|
+
return this.transport.requestJson<VideoSeriesAssignmentResponse>(
|
|
351
|
+
this.transport.baseUrl,
|
|
352
|
+
`/api/v1/ingestion/videos/${encodeURIComponent(videoId)}/series`,
|
|
353
|
+
{
|
|
354
|
+
method: 'PATCH',
|
|
355
|
+
body: JSON.stringify(request),
|
|
356
|
+
},
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* §Q MT.15c X3 — transfer a WHOLE series (and its universe) across tenants.
|
|
362
|
+
* `POST /api/v1/ingestion/series/{seriesId}/transfer` → 202 (async saga;
|
|
363
|
+
* `Location` header points at the status poll — use
|
|
364
|
+
* {@link getSeriesTransfer} with the returned `transfer.transferId`).
|
|
365
|
+
* `seriesId` is the namespaced `{tenantId}::{slug}` key, so it is
|
|
366
|
+
* `encodeURIComponent`-escaped like every other series-keyed path segment.
|
|
367
|
+
* Errors: 403 (dark/release/receive authz), 404 (series not found), 409
|
|
368
|
+
* (legacy un-namespaced key / no-op transfer / slug taken / an active
|
|
369
|
+
* transfer already running), 422 (bad slug), 502/503 (store/queue failure).
|
|
370
|
+
*/
|
|
371
|
+
async transferSeries(
|
|
372
|
+
seriesId: string,
|
|
373
|
+
request: SeriesTransferRequest,
|
|
374
|
+
): Promise<SeriesTransferAcceptedResponse> {
|
|
375
|
+
return this.transport.requestJson<SeriesTransferAcceptedResponse>(
|
|
376
|
+
this.transport.baseUrl,
|
|
377
|
+
`/api/v1/ingestion/series/${encodeURIComponent(seriesId)}/transfer`,
|
|
378
|
+
{
|
|
379
|
+
method: 'POST',
|
|
380
|
+
body: JSON.stringify(request),
|
|
381
|
+
},
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* §Q MT.15c X3 — poll one series-transfer job's status/steps.
|
|
387
|
+
* `GET /api/v1/ingestion/series/{seriesId}/transfers/{transferId}` (404 if
|
|
388
|
+
* absent). Pair with {@link transferSeries}.
|
|
389
|
+
*/
|
|
390
|
+
async getSeriesTransfer(
|
|
391
|
+
seriesId: string,
|
|
392
|
+
transferId: string,
|
|
393
|
+
): Promise<GetSeriesTransferResponse> {
|
|
394
|
+
return this.transport.requestJson<GetSeriesTransferResponse>(
|
|
395
|
+
this.transport.baseUrl,
|
|
396
|
+
`/api/v1/ingestion/series/${encodeURIComponent(seriesId)}/transfers/${encodeURIComponent(
|
|
397
|
+
transferId,
|
|
398
|
+
)}`,
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* §Q W2.22/W2.23 failed-ingest recovery — re-run a FAILED ingest (full
|
|
404
|
+
* pipeline via the real S3 entry; a fresh job id is minted asynchronously)
|
|
405
|
+
* or ONE failed stage of a SUCCEEDED ingest: enrichment (tracked
|
|
406
|
+
* `enrichmentId`), transcript, or video-embedding (W2.23; precedence
|
|
407
|
+
* enrichment > transcript > video-embedding — re-call after each stage
|
|
408
|
+
* completes when several failed).
|
|
409
|
+
* `POST /api/v1/ingestion/videos/{videoId}/reprocess` (owner/EDIT-grant
|
|
410
|
+
* guarded; 409 for curated-terminal / in-flight / no-reprocessable-stage /
|
|
411
|
+
* source-object-missing / transcription-not-configured).
|
|
412
|
+
*/
|
|
413
|
+
async reprocessVideo(videoId: string): Promise<ReprocessVideoResponse> {
|
|
414
|
+
return this.transport.requestJson<ReprocessVideoResponse>(
|
|
415
|
+
this.transport.baseUrl,
|
|
416
|
+
`/api/v1/ingestion/videos/${encodeURIComponent(videoId)}/reprocess`,
|
|
417
|
+
{
|
|
418
|
+
method: 'POST',
|
|
419
|
+
},
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// ==================== Enrichment API Methods ====================
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Trigger Pegasus enrichment analysis on an ingested video
|
|
427
|
+
*/
|
|
428
|
+
async enrichVideo(videoId: string, config?: PegasusConfig): Promise<EnrichVideoResponse> {
|
|
429
|
+
return this.transport.requestJson<EnrichVideoResponse>(
|
|
430
|
+
this.transport.baseUrl,
|
|
431
|
+
`/api/v1/ingestion/videos/${videoId}/enrichments`,
|
|
432
|
+
{
|
|
433
|
+
method: 'POST',
|
|
434
|
+
// F5 additive override fields (`vlmModel` / `templateId`) ride the SAME
|
|
435
|
+
// optional-omit discipline as the pegasus* fields: `JSON.stringify` drops
|
|
436
|
+
// any key whose value is `undefined`, so when a caller passes neither the
|
|
437
|
+
// serialized body is BYTE-IDENTICAL to pre-F2 (locked by the
|
|
438
|
+
// enrichVideo-serialization test). The backend 422-rejects an unreachable
|
|
439
|
+
// value (§2f); an omitted value leaves today's byte-identical path.
|
|
440
|
+
body: JSON.stringify({
|
|
441
|
+
pegasusPrompt: config?.pegasusPrompt,
|
|
442
|
+
pegasusTemperature: config?.pegasusTemperature,
|
|
443
|
+
pegasusMaxTokens: config?.pegasusMaxTokens,
|
|
444
|
+
vlmModel: config?.vlmModel,
|
|
445
|
+
templateId: config?.templateId,
|
|
446
|
+
// T2.6 — same omit-when-undefined discipline (byte-identical dark).
|
|
447
|
+
minSegmentDuration: config?.minSegmentDuration,
|
|
448
|
+
maxSegmentDuration: config?.maxSegmentDuration,
|
|
449
|
+
}),
|
|
450
|
+
},
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* List all enrichment runs for a video
|
|
456
|
+
*/
|
|
457
|
+
async getEnrichments(videoId: string): Promise<ListEnrichmentsResponse> {
|
|
458
|
+
return this.transport.requestJson<ListEnrichmentsResponse>(
|
|
459
|
+
this.transport.baseUrl,
|
|
460
|
+
`/api/v1/ingestion/videos/${videoId}/enrichments`,
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Get a specific enrichment result
|
|
466
|
+
*/
|
|
467
|
+
async getEnrichment(enrichmentId: string): Promise<EnrichmentRecord> {
|
|
468
|
+
return this.transport.requestJson<EnrichmentRecord>(
|
|
469
|
+
this.transport.baseUrl,
|
|
470
|
+
`/api/v1/ingestion/enrichments/${enrichmentId}`,
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// ==================== Extraction catalogue API Methods ====================
|
|
475
|
+
// VLM frontend-surfacing F2 (§3b). TWO bases — verified against the F1 mount
|
|
476
|
+
// topology, NOT the spec's (wrong) §3b assumption:
|
|
477
|
+
// • ADMIN `/api/v1/admin/extraction/*` is mounted ONLY on the CHAT app
|
|
478
|
+
// (`api/chat/app.py` mounts `admin_extraction_router`; `api/tools/app.py`
|
|
479
|
+
// does NOT) — so the four admin methods use `chatRequest()`, mirroring the
|
|
480
|
+
// existing `AdminClient` ("admin endpoints live on the CHAT API base",
|
|
481
|
+
// `admin.ts`) and `listImageModels` (images are also chat-base). Using
|
|
482
|
+
// `request()` (main base) would 404 in a split chat/tools deployment.
|
|
483
|
+
// • USER `/api/v1/enrichment/models` IS on the MAIN/tools app
|
|
484
|
+
// (`api/tools/app.py` mounts `enrichment_models_router`) — so it uses
|
|
485
|
+
// `request()`, mirroring `enrichVideo` / `getEnrichments` (the `/jobs`
|
|
486
|
+
// page is a main-base user surface).
|
|
487
|
+
// The three GETs carry no `traceId` (static-ish catalogues); the sample-fire
|
|
488
|
+
// POST returns one (resource).
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Admin observability — every `EXTRACTION_MODELS` entry (incl. nova-pro /
|
|
492
|
+
* `dormant_route`) + `embeddingModels`, each with the server-computed
|
|
493
|
+
* `reachable` gate + 5-value `darkStatus` badge, plus the response-level
|
|
494
|
+
* `activeModelId` (the default the adapter seeds `ROUTE_DEFAULT` from — the
|
|
495
|
+
* backend does NOT emit per-model `isDefault`/`isFallback`). `require_admin`
|
|
496
|
+
* (403 for a non-admin; the `createPlatformRegistries` guard degrades that to
|
|
497
|
+
* an empty registry). CHAT API base (`chatRequest`, like `AdminClient`).
|
|
498
|
+
*/
|
|
499
|
+
async listExtractionModels(): Promise<ExtractionModelsResponse> {
|
|
500
|
+
return this.transport.requestJson<ExtractionModelsResponse>(
|
|
501
|
+
this.transport.chatBaseUrl,
|
|
502
|
+
'/api/v1/admin/extraction/models',
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Admin observability — the live "what would run right now" route + override /
|
|
508
|
+
* transport-configured / `docAcceptAutoRegen` booleans (set/unset only, never
|
|
509
|
+
* key values). `require_admin`. CHAT API base.
|
|
510
|
+
*/
|
|
511
|
+
async getExtractionRouterState(): Promise<ExtractionRouterState> {
|
|
512
|
+
return this.transport.requestJson<ExtractionRouterState>(
|
|
513
|
+
this.transport.chatBaseUrl,
|
|
514
|
+
'/api/v1/admin/extraction/router',
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Admin observability — all 7 `_REGISTRY` templates incl. the two
|
|
520
|
+
* model-agnostic ones (`fused-narrative` / `character-narrative`) that the
|
|
521
|
+
* models endpoint cannot reach. `require_admin`. CHAT API base.
|
|
522
|
+
*/
|
|
523
|
+
async listExtractionTemplates(): Promise<ExtractionTemplatesResponse> {
|
|
524
|
+
return this.transport.requestJson<ExtractionTemplatesResponse>(
|
|
525
|
+
this.transport.chatBaseUrl,
|
|
526
|
+
'/api/v1/admin/extraction/templates',
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* USER-scoped extraction catalogue for the `/jobs/[videoId]` Run-Analysis
|
|
532
|
+
* selector — server PRE-FILTERED to `reachable` models + templates only (dark
|
|
533
|
+
* ones omitted) + the active defaults. Only the normal `get_user_id` floor
|
|
534
|
+
* (NOT `require_admin`), so a non-admin reads it without 403ing into an empty
|
|
535
|
+
* catalogue. With all flags unset → Pegasus 1.2 + the default template. MAIN
|
|
536
|
+
* API base (`request`, like `enrichVideo` — the `/jobs` user surface).
|
|
537
|
+
*/
|
|
538
|
+
async listEnrichmentModels(): Promise<EnrichmentModelsResponse> {
|
|
539
|
+
return this.transport.requestJson<EnrichmentModelsResponse>(
|
|
540
|
+
this.transport.baseUrl,
|
|
541
|
+
'/api/v1/enrichment/models',
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Gated operator sample-fire (§2g) — fire a one-off sample extraction with a
|
|
547
|
+
* chosen `modelId` + `templateId` through the EXISTING `ExtractionProvider`
|
|
548
|
+
* invoke seam. `require_admin`; the backend 422-rejects a dark/unreachable
|
|
549
|
+
* target before any invoke, so with all transports dark today every fire
|
|
550
|
+
* against a gated model 422s (dormant by construction). CHAT API base.
|
|
551
|
+
*/
|
|
552
|
+
async sampleExtraction(
|
|
553
|
+
request: ExtractionSampleRequest,
|
|
554
|
+
): Promise<ExtractionSampleResponse> {
|
|
555
|
+
return this.transport.requestJson<ExtractionSampleResponse>(
|
|
556
|
+
this.transport.chatBaseUrl,
|
|
557
|
+
'/api/v1/admin/extraction/sample',
|
|
558
|
+
{
|
|
559
|
+
method: 'POST',
|
|
560
|
+
body: JSON.stringify(request),
|
|
561
|
+
},
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Delete a video and all associated data across all systems
|
|
567
|
+
*/
|
|
568
|
+
async deleteVideo(videoId: string, s3Key?: string): Promise<VideoDeletionResponse> {
|
|
569
|
+
const searchParams = new URLSearchParams();
|
|
570
|
+
if (s3Key) searchParams.append('s3Key', s3Key);
|
|
571
|
+
|
|
572
|
+
const query = searchParams.toString();
|
|
573
|
+
const endpoint = `/api/v1/ingestion/videos/${videoId}${query ? `?${query}` : ''}`;
|
|
574
|
+
|
|
575
|
+
return this.transport.requestJson<VideoDeletionResponse>(this.transport.baseUrl, endpoint, {
|
|
576
|
+
method: 'DELETE',
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// ============= Narrative Regeneration API (M7 Phase 6 / Story Engine) =============
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Start an async narrative regeneration run for a video scope.
|
|
584
|
+
* `POST /api/v1/tools/graph/{videoId}/regenerate` → 202 with the QUEUED run
|
|
585
|
+
* (and a `Location` header to the run's poll URL, exposed as `statusUrl`).
|
|
586
|
+
*
|
|
587
|
+
* Auth + ownership are enforced server-side. A malformed `scope` is a 422,
|
|
588
|
+
* an in-flight run is a 409, over-cap is a 429 — all surface as a thrown
|
|
589
|
+
* `Error` carrying the FastAPI detail. Build `request.scope` with
|
|
590
|
+
* {@link buildRegenerationScope}. Pair with {@link pollRegenerationUntilDone}.
|
|
591
|
+
*/
|
|
592
|
+
async startRegeneration(
|
|
593
|
+
videoId: string,
|
|
594
|
+
request: RegenerateRequest,
|
|
595
|
+
): Promise<RegenerationRunResponse> {
|
|
596
|
+
return this.transport.requestJson<RegenerationRunResponse>(
|
|
597
|
+
this.transport.baseUrl,
|
|
598
|
+
`/api/v1/tools/graph/${encodeURIComponent(videoId)}/regenerate`,
|
|
599
|
+
{
|
|
600
|
+
method: 'POST',
|
|
601
|
+
body: JSON.stringify(request),
|
|
602
|
+
},
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* List a video's regeneration runs, newest-first.
|
|
608
|
+
* `GET /api/v1/tools/graph/{videoId}/regenerations`. `limit` (1–100) and
|
|
609
|
+
* `cursor` (opaque pagination token from a prior `nextCursor`) are optional.
|
|
610
|
+
*/
|
|
611
|
+
async listRegenerations(
|
|
612
|
+
videoId: string,
|
|
613
|
+
params?: { limit?: number; cursor?: string },
|
|
614
|
+
): Promise<RegenerationListResponse> {
|
|
615
|
+
const searchParams = new URLSearchParams();
|
|
616
|
+
if (params?.limit != null) searchParams.append('limit', params.limit.toString());
|
|
617
|
+
if (params?.cursor) searchParams.append('cursor', params.cursor);
|
|
618
|
+
|
|
619
|
+
const query = searchParams.toString();
|
|
620
|
+
const endpoint = `/api/v1/tools/graph/${encodeURIComponent(videoId)}/regenerations${
|
|
621
|
+
query ? `?${query}` : ''
|
|
622
|
+
}`;
|
|
623
|
+
return this.transport.requestJson<RegenerationListResponse>(this.transport.baseUrl, endpoint);
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Fetch a single regeneration run by id.
|
|
628
|
+
* `GET /api/v1/tools/graph/{videoId}/regenerations/{runId}` (404 if absent).
|
|
629
|
+
* `signal` aborts the in-flight fetch — {@link pollRegenerationUntilDone}
|
|
630
|
+
* threads its poll signal through so a page unmount cancels cleanly.
|
|
631
|
+
*/
|
|
632
|
+
async getRegeneration(
|
|
633
|
+
videoId: string,
|
|
634
|
+
runId: string,
|
|
635
|
+
options: { signal?: AbortSignal } = {},
|
|
636
|
+
): Promise<RegenerationRunResponse> {
|
|
637
|
+
return this.transport.requestJson<RegenerationRunResponse>(
|
|
638
|
+
this.transport.baseUrl,
|
|
639
|
+
`/api/v1/tools/graph/${encodeURIComponent(videoId)}/regenerations/${encodeURIComponent(
|
|
640
|
+
runId,
|
|
641
|
+
)}`,
|
|
642
|
+
{ signal: options.signal },
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Poll {@link getRegeneration} until the run reaches a terminal status.
|
|
648
|
+
* COMPLETE / CANCELLED resolve with the final run; FAILED throws
|
|
649
|
+
* (`record.error` ?? a generic message). Mirrors
|
|
650
|
+
* {@link pollVisemeBundleUntilDone}: 5s cadence, abortable via `signal`,
|
|
651
|
+
* and a wall-clock timeout (regeneration re-invokes Pegasus, so the default
|
|
652
|
+
* matches bundle assembly — generous but bounded).
|
|
653
|
+
*/
|
|
654
|
+
async pollRegenerationUntilDone(
|
|
655
|
+
videoId: string,
|
|
656
|
+
runId: string,
|
|
657
|
+
options: {
|
|
658
|
+
intervalMs?: number;
|
|
659
|
+
timeoutMs?: number;
|
|
660
|
+
signal?: AbortSignal;
|
|
661
|
+
} = {},
|
|
662
|
+
): Promise<RegenerationRunResponse> {
|
|
663
|
+
const intervalMs = options.intervalMs ?? 5000;
|
|
664
|
+
// The regenerator Lambda can run up to its 15-min cap (an `acts` scope re-runs
|
|
665
|
+
// Pegasus over the whole film), so the default poll deadline must exceed that or
|
|
666
|
+
// the client gives up while the run is still completing. 16 min covers a normal
|
|
667
|
+
// single run; if the poll still times out (e.g. an SQS redelivery), the run row
|
|
668
|
+
// is durable — a refresh / re-fetch surfaces the terminal state.
|
|
669
|
+
const timeoutMs = options.timeoutMs ?? 960_000;
|
|
670
|
+
const deadline = Date.now() + timeoutMs;
|
|
671
|
+
while (true) {
|
|
672
|
+
if (options.signal?.aborted) {
|
|
673
|
+
throw new DOMException('Polling aborted', 'AbortError');
|
|
674
|
+
}
|
|
675
|
+
const record = await this.getRegeneration(videoId, runId, {
|
|
676
|
+
signal: options.signal,
|
|
677
|
+
});
|
|
678
|
+
if (
|
|
679
|
+
record.status === REGENERATION_STATUS.COMPLETE ||
|
|
680
|
+
record.status === REGENERATION_STATUS.CANCELLED
|
|
681
|
+
) {
|
|
682
|
+
return record;
|
|
683
|
+
}
|
|
684
|
+
if (record.status === REGENERATION_STATUS.FAILED) {
|
|
685
|
+
throw new Error(record.error ?? 'Regeneration failed');
|
|
686
|
+
}
|
|
687
|
+
if (Date.now() >= deadline) {
|
|
688
|
+
throw new Error(
|
|
689
|
+
`Regeneration timed out after ${Math.round(timeoutMs / 1000)}s`,
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
await abortableSleep(intervalMs, options.signal);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|