@escapeaihq/client-core 0.49.1 → 0.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +445 -153
- package/dist/adapters/capabilities.d.ts +20 -3
- package/dist/adapters/capabilities.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.d.ts +5 -4
- package/dist/adapters/directorAdapter.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.js +5 -4
- package/dist/adapters/directorAdapter.js.map +1 -1
- package/dist/adapters/experienceModelCatalog.d.ts +382 -0
- package/dist/adapters/experienceModelCatalog.d.ts.map +1 -0
- package/dist/adapters/experienceModelCatalog.js +401 -0
- package/dist/adapters/experienceModelCatalog.js.map +1 -0
- package/dist/adapters/extractionAdapter.d.ts +81 -0
- package/dist/adapters/extractionAdapter.d.ts.map +1 -0
- package/dist/adapters/extractionAdapter.js +98 -0
- package/dist/adapters/extractionAdapter.js.map +1 -0
- package/dist/adapters/imageAdapter.d.ts +5 -1
- package/dist/adapters/imageAdapter.d.ts.map +1 -1
- package/dist/adapters/imageAdapter.js +5 -1
- package/dist/adapters/imageAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +54 -16
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +62 -11
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/momentDirective.d.ts +66 -0
- package/dist/adapters/momentDirective.d.ts.map +1 -0
- package/dist/adapters/momentDirective.js +78 -0
- package/dist/adapters/momentDirective.js.map +1 -0
- package/dist/adapters/momentPolicy.d.ts +132 -0
- package/dist/adapters/momentPolicy.d.ts.map +1 -0
- package/dist/adapters/momentPolicy.js +165 -0
- package/dist/adapters/momentPolicy.js.map +1 -0
- package/dist/adapters/registry.d.ts +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/videoGenAdapter.d.ts +55 -0
- package/dist/adapters/videoGenAdapter.d.ts.map +1 -0
- package/dist/adapters/videoGenAdapter.js +78 -0
- package/dist/adapters/videoGenAdapter.js.map +1 -0
- package/dist/adapters/worldAdapter.d.ts +132 -11
- package/dist/adapters/worldAdapter.d.ts.map +1 -1
- package/dist/adapters/worldAdapter.js +127 -11
- package/dist/adapters/worldAdapter.js.map +1 -1
- package/dist/adapters/worldModelPreference.d.ts +173 -0
- package/dist/adapters/worldModelPreference.d.ts.map +1 -0
- package/dist/adapters/worldModelPreference.js +209 -0
- package/dist/adapters/worldModelPreference.js.map +1 -0
- package/dist/adapters/worldModelTradeoffs.d.ts +120 -0
- package/dist/adapters/worldModelTradeoffs.d.ts.map +1 -0
- package/dist/adapters/worldModelTradeoffs.js +154 -0
- package/dist/adapters/worldModelTradeoffs.js.map +1 -0
- package/dist/admin.d.ts +545 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +230 -16
- package/dist/admin.js.map +1 -1
- package/dist/api.d.ts +10281 -2216
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4174 -1240
- package/dist/api.js.map +1 -1
- package/dist/arcBoardJoin.d.ts +38 -0
- package/dist/arcBoardJoin.d.ts.map +1 -0
- package/dist/arcBoardJoin.js +37 -0
- package/dist/arcBoardJoin.js.map +1 -0
- package/dist/arcPreview.d.ts +49 -0
- package/dist/arcPreview.d.ts.map +1 -0
- package/dist/arcPreview.js +65 -0
- package/dist/arcPreview.js.map +1 -0
- package/dist/audio.d.ts +259 -16
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +605 -114
- package/dist/audio.js.map +1 -1
- package/dist/audioDsp.d.ts +45 -0
- package/dist/audioDsp.d.ts.map +1 -0
- package/dist/audioDsp.js +108 -0
- package/dist/audioDsp.js.map +1 -0
- package/dist/audioProtocol.d.ts +160 -0
- package/dist/audioProtocol.d.ts.map +1 -1
- package/dist/audioProtocol.js +99 -0
- package/dist/audioProtocol.js.map +1 -1
- package/dist/beatTitles.d.ts +33 -0
- package/dist/beatTitles.d.ts.map +1 -0
- package/dist/beatTitles.js +39 -0
- package/dist/beatTitles.js.map +1 -0
- package/dist/castProjection.d.ts +204 -1
- package/dist/castProjection.d.ts.map +1 -1
- package/dist/castProjection.js +202 -0
- package/dist/castProjection.js.map +1 -1
- package/dist/characterGrounding.d.ts +369 -0
- package/dist/characterGrounding.d.ts.map +1 -0
- package/dist/characterGrounding.js +408 -0
- package/dist/characterGrounding.js.map +1 -0
- package/dist/conversation/binding.d.ts +41 -1
- package/dist/conversation/binding.d.ts.map +1 -1
- package/dist/conversation/binding.js +12 -0
- 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 +60 -0
- package/dist/conversation/controller.d.ts.map +1 -1
- package/dist/conversation/controller.js +104 -3
- package/dist/conversation/controller.js.map +1 -1
- package/dist/conversation/index.d.ts +2 -0
- package/dist/conversation/index.d.ts.map +1 -1
- package/dist/conversation/index.js +2 -0
- package/dist/conversation/index.js.map +1 -1
- package/dist/conversation/participant.d.ts +16 -0
- package/dist/conversation/participant.d.ts.map +1 -1
- package/dist/conversation/readSequencer.d.ts +38 -0
- package/dist/conversation/readSequencer.d.ts.map +1 -0
- package/dist/conversation/readSequencer.js +42 -0
- package/dist/conversation/readSequencer.js.map +1 -0
- package/dist/conversation/roster.d.ts +5 -1
- package/dist/conversation/roster.d.ts.map +1 -1
- package/dist/conversation/roster.js.map +1 -1
- package/dist/conversation/rosterProjection.d.ts +74 -1
- package/dist/conversation/rosterProjection.d.ts.map +1 -1
- package/dist/conversation/rosterProjection.js +135 -1
- package/dist/conversation/rosterProjection.js.map +1 -1
- package/dist/conversation/runtime.d.ts +20 -3
- package/dist/conversation/runtime.d.ts.map +1 -1
- package/dist/conversation/runtime.js +66 -7
- package/dist/conversation/runtime.js.map +1 -1
- package/dist/conversation/types.d.ts +43 -4
- package/dist/conversation/types.d.ts.map +1 -1
- package/dist/conversation/voice.d.ts +290 -13
- package/dist/conversation/voice.d.ts.map +1 -1
- package/dist/conversation/voice.js +565 -42
- package/dist/conversation/voice.js.map +1 -1
- package/dist/creatorCuration.d.ts +134 -0
- package/dist/creatorCuration.d.ts.map +1 -0
- package/dist/creatorCuration.js +228 -0
- package/dist/creatorCuration.js.map +1 -0
- package/dist/creatorDashboard.d.ts +155 -0
- package/dist/creatorDashboard.d.ts.map +1 -0
- package/dist/creatorDashboard.js +237 -0
- package/dist/creatorDashboard.js.map +1 -0
- package/dist/creatorUniverse.d.ts +95 -0
- package/dist/creatorUniverse.d.ts.map +1 -0
- package/dist/creatorUniverse.js +136 -0
- package/dist/creatorUniverse.js.map +1 -0
- package/dist/curationWrite.d.ts +76 -0
- package/dist/curationWrite.d.ts.map +1 -0
- package/dist/curationWrite.js +106 -0
- package/dist/curationWrite.js.map +1 -0
- package/dist/designTokens.d.ts +64 -0
- package/dist/designTokens.d.ts.map +1 -0
- package/dist/designTokens.js +117 -0
- package/dist/designTokens.js.map +1 -0
- package/dist/dialogAttribution.d.ts +79 -0
- package/dist/dialogAttribution.d.ts.map +1 -0
- package/dist/dialogAttribution.js +144 -0
- package/dist/dialogAttribution.js.map +1 -0
- package/dist/dmRunWorldReadiness.d.ts +605 -0
- package/dist/dmRunWorldReadiness.d.ts.map +1 -0
- package/dist/dmRunWorldReadiness.js +775 -0
- package/dist/dmRunWorldReadiness.js.map +1 -0
- package/dist/domains/access.d.ts +32 -0
- package/dist/domains/access.d.ts.map +1 -0
- package/dist/domains/access.js +43 -0
- package/dist/domains/access.js.map +1 -0
- package/dist/domains/adventureDefinitions.d.ts +159 -0
- package/dist/domains/adventureDefinitions.d.ts.map +1 -0
- package/dist/domains/adventureDefinitions.js +168 -0
- package/dist/domains/adventureDefinitions.js.map +1 -0
- package/dist/domains/adventures.d.ts +329 -0
- package/dist/domains/adventures.d.ts.map +1 -0
- package/dist/domains/adventures.js +359 -0
- package/dist/domains/adventures.js.map +1 -0
- package/dist/domains/arcs.d.ts +146 -0
- package/dist/domains/arcs.d.ts.map +1 -0
- package/dist/domains/arcs.js +202 -0
- package/dist/domains/arcs.js.map +1 -0
- package/dist/domains/artifacts.d.ts +259 -0
- package/dist/domains/artifacts.d.ts.map +1 -0
- package/dist/domains/artifacts.js +125 -0
- package/dist/domains/artifacts.js.map +1 -0
- package/dist/domains/chat.d.ts +158 -0
- package/dist/domains/chat.d.ts.map +1 -0
- package/dist/domains/chat.js +224 -0
- package/dist/domains/chat.js.map +1 -0
- package/dist/domains/decisions.d.ts +31 -0
- package/dist/domains/decisions.d.ts.map +1 -0
- package/dist/domains/decisions.js +42 -0
- package/dist/domains/decisions.js.map +1 -0
- package/dist/domains/documents.d.ts +218 -0
- package/dist/domains/documents.d.ts.map +1 -0
- package/dist/domains/documents.js +252 -0
- package/dist/domains/documents.js.map +1 -0
- package/dist/domains/enhancements.d.ts +106 -0
- package/dist/domains/enhancements.d.ts.map +1 -0
- package/dist/domains/enhancements.js +160 -0
- package/dist/domains/enhancements.js.map +1 -0
- package/dist/domains/graph.d.ts +454 -0
- package/dist/domains/graph.d.ts.map +1 -0
- package/dist/domains/graph.js +648 -0
- package/dist/domains/graph.js.map +1 -0
- package/dist/domains/images.d.ts +220 -0
- package/dist/domains/images.d.ts.map +1 -0
- package/dist/domains/images.js +307 -0
- package/dist/domains/images.js.map +1 -0
- package/dist/domains/ingestion.d.ts +312 -0
- package/dist/domains/ingestion.d.ts.map +1 -0
- package/dist/domains/ingestion.js +495 -0
- package/dist/domains/ingestion.js.map +1 -0
- package/dist/domains/me.d.ts +21 -0
- package/dist/domains/me.d.ts.map +1 -0
- package/dist/domains/me.js +23 -0
- package/dist/domains/me.js.map +1 -0
- package/dist/domains/orgs.d.ts +47 -0
- package/dist/domains/orgs.d.ts.map +1 -0
- package/dist/domains/orgs.js +75 -0
- package/dist/domains/orgs.js.map +1 -0
- package/dist/domains/personas.d.ts +135 -0
- package/dist/domains/personas.d.ts.map +1 -0
- package/dist/domains/personas.js +316 -0
- package/dist/domains/personas.js.map +1 -0
- package/dist/domains/projects.d.ts +53 -0
- package/dist/domains/projects.d.ts.map +1 -0
- package/dist/domains/projects.js +94 -0
- package/dist/domains/projects.js.map +1 -0
- package/dist/domains/quests.d.ts +431 -0
- package/dist/domains/quests.d.ts.map +1 -0
- package/dist/domains/quests.js +61 -0
- package/dist/domains/quests.js.map +1 -0
- package/dist/domains/reactor.d.ts +98 -0
- package/dist/domains/reactor.d.ts.map +1 -0
- package/dist/domains/reactor.js +131 -0
- package/dist/domains/reactor.js.map +1 -0
- package/dist/domains/showcase.d.ts +28 -0
- package/dist/domains/showcase.d.ts.map +1 -0
- package/dist/domains/showcase.js +28 -0
- package/dist/domains/showcase.js.map +1 -0
- package/dist/domains/storyboards.d.ts +1253 -0
- package/dist/domains/storyboards.d.ts.map +1 -0
- package/dist/domains/storyboards.js +781 -0
- package/dist/domains/storyboards.js.map +1 -0
- package/dist/domains/studioSettings.d.ts +39 -0
- package/dist/domains/studioSettings.d.ts.map +1 -0
- package/dist/domains/studioSettings.js +80 -0
- package/dist/domains/studioSettings.js.map +1 -0
- package/dist/domains/universes.d.ts +191 -0
- package/dist/domains/universes.d.ts.map +1 -0
- package/dist/domains/universes.js +276 -0
- package/dist/domains/universes.js.map +1 -0
- package/dist/domains/userDefaults.d.ts +18 -0
- package/dist/domains/userDefaults.d.ts.map +1 -0
- package/dist/domains/userDefaults.js +27 -0
- package/dist/domains/userDefaults.js.map +1 -0
- package/dist/domains/visemeBundles.d.ts +262 -0
- package/dist/domains/visemeBundles.d.ts.map +1 -0
- package/dist/domains/visemeBundles.js +373 -0
- package/dist/domains/visemeBundles.js.map +1 -0
- package/dist/domains/workflows.d.ts +142 -0
- package/dist/domains/workflows.d.ts.map +1 -0
- package/dist/domains/workflows.js +245 -0
- package/dist/domains/workflows.js.map +1 -0
- package/dist/enhancementDiff.d.ts +56 -0
- package/dist/enhancementDiff.d.ts.map +1 -0
- package/dist/enhancementDiff.js +110 -0
- package/dist/enhancementDiff.js.map +1 -0
- package/dist/generated/contract.d.ts +372 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +390 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/graphSchema.d.ts +36 -5
- package/dist/graphSchema.d.ts.map +1 -1
- package/dist/graphSchema.js +88 -2
- package/dist/graphSchema.js.map +1 -1
- package/dist/http.d.ts +70 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +263 -11
- package/dist/http.js.map +1 -1
- package/dist/identity.d.ts +81 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +65 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -1
- package/dist/messageContent.d.ts +174 -0
- package/dist/messageContent.d.ts.map +1 -0
- package/dist/messageContent.js +405 -0
- package/dist/messageContent.js.map +1 -0
- package/dist/mutationEpoch.d.ts +83 -0
- package/dist/mutationEpoch.d.ts.map +1 -0
- package/dist/mutationEpoch.js +109 -0
- package/dist/mutationEpoch.js.map +1 -0
- package/dist/obo.d.ts +144 -0
- package/dist/obo.d.ts.map +1 -0
- package/dist/obo.js +135 -0
- package/dist/obo.js.map +1 -0
- package/dist/opusTransport.d.ts +113 -0
- package/dist/opusTransport.d.ts.map +1 -0
- package/dist/opusTransport.js +170 -0
- package/dist/opusTransport.js.map +1 -0
- package/dist/pagination.d.ts +18 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +26 -0
- package/dist/pagination.js.map +1 -0
- package/dist/platformAssistant.d.ts +55 -1
- package/dist/platformAssistant.d.ts.map +1 -1
- package/dist/platformAssistant.js +39 -1
- package/dist/platformAssistant.js.map +1 -1
- package/dist/pollUtils.d.ts +19 -0
- package/dist/pollUtils.d.ts.map +1 -0
- package/dist/pollUtils.js +35 -0
- package/dist/pollUtils.js.map +1 -0
- package/dist/questLog.d.ts +232 -0
- package/dist/questLog.d.ts.map +1 -0
- package/dist/questLog.js +522 -0
- package/dist/questLog.js.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts +300 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.js +401 -0
- package/dist/reactor/dmDirectiveToExperience.js.map +1 -0
- package/dist/reactor/dmSceneControlPrompt.d.ts +40 -0
- package/dist/reactor/dmSceneControlPrompt.d.ts.map +1 -0
- package/dist/reactor/dmSceneControlPrompt.js +145 -0
- package/dist/reactor/dmSceneControlPrompt.js.map +1 -0
- 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 +20 -0
- package/dist/reactor/index.d.ts.map +1 -1
- package/dist/reactor/index.js +81 -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 +44 -5
- 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 +37 -28
- package/dist/reactor/toolPromptAddon.d.ts.map +1 -1
- package/dist/reactor/toolPromptAddon.js +63 -101
- package/dist/reactor/toolPromptAddon.js.map +1 -1
- package/dist/reactor/worldMintLoop.d.ts +286 -0
- package/dist/reactor/worldMintLoop.d.ts.map +1 -0
- package/dist/reactor/worldMintLoop.js +381 -0
- package/dist/reactor/worldMintLoop.js.map +1 -0
- package/dist/reactor/worldSteerOutcome.d.ts +98 -0
- package/dist/reactor/worldSteerOutcome.d.ts.map +1 -0
- package/dist/reactor/worldSteerOutcome.js +81 -0
- package/dist/reactor/worldSteerOutcome.js.map +1 -0
- package/dist/retryAfter.d.ts +15 -0
- package/dist/retryAfter.d.ts.map +1 -0
- package/dist/retryAfter.js +75 -0
- package/dist/retryAfter.js.map +1 -0
- package/dist/seriesKey.d.ts +31 -0
- package/dist/seriesKey.d.ts.map +1 -0
- package/dist/seriesKey.js +33 -0
- package/dist/seriesKey.js.map +1 -0
- package/dist/sessionRefresh.d.ts +135 -0
- package/dist/sessionRefresh.d.ts.map +1 -0
- package/dist/sessionRefresh.js +215 -0
- package/dist/sessionRefresh.js.map +1 -0
- package/dist/sharedAudioContext.d.ts +39 -0
- package/dist/sharedAudioContext.d.ts.map +1 -0
- package/dist/sharedAudioContext.js +63 -0
- package/dist/sharedAudioContext.js.map +1 -0
- package/dist/singleFlight.d.ts +51 -0
- package/dist/singleFlight.d.ts.map +1 -0
- package/dist/singleFlight.js +87 -0
- package/dist/singleFlight.js.map +1 -0
- package/dist/storyGraph.d.ts +83 -0
- package/dist/storyGraph.d.ts.map +1 -1
- package/dist/storyGraph.js +169 -4
- package/dist/storyGraph.js.map +1 -1
- package/dist/storyboardMask.d.ts +343 -0
- package/dist/storyboardMask.d.ts.map +1 -0
- package/dist/storyboardMask.js +505 -0
- package/dist/storyboardMask.js.map +1 -0
- package/dist/storyboardTimeline.d.ts +93 -0
- package/dist/storyboardTimeline.d.ts.map +1 -0
- package/dist/storyboardTimeline.js +131 -0
- package/dist/storyboardTimeline.js.map +1 -0
- package/dist/studioAutomation.d.ts +104 -0
- package/dist/studioAutomation.d.ts.map +1 -0
- package/dist/studioAutomation.js +178 -0
- package/dist/studioAutomation.js.map +1 -0
- package/dist/tenantClaim.d.ts +86 -0
- package/dist/tenantClaim.d.ts.map +1 -0
- package/dist/tenantClaim.js +164 -0
- package/dist/tenantClaim.js.map +1 -0
- package/dist/timeFormat.d.ts +25 -0
- package/dist/timeFormat.d.ts.map +1 -1
- package/dist/timeFormat.js +56 -0
- package/dist/timeFormat.js.map +1 -1
- package/dist/toolSchemas.d.ts +53 -10
- package/dist/toolSchemas.d.ts.map +1 -1
- package/dist/toolSchemas.js +36 -9
- package/dist/toolSchemas.js.map +1 -1
- package/dist/transport.d.ts +120 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +282 -0
- package/dist/transport.js.map +1 -0
- package/dist/videoGenFacade.d.ts +63 -0
- package/dist/videoGenFacade.d.ts.map +1 -0
- package/dist/videoGenFacade.js +49 -0
- package/dist/videoGenFacade.js.map +1 -0
- package/dist/visemeScheduler.d.ts +24 -2
- package/dist/visemeScheduler.d.ts.map +1 -1
- package/dist/visemeScheduler.js +31 -2
- package/dist/visemeScheduler.js.map +1 -1
- package/dist/vision/VisionPublisher.d.ts +88 -0
- package/dist/vision/VisionPublisher.d.ts.map +1 -1
- package/dist/vision/VisionPublisher.js +196 -13
- package/dist/vision/VisionPublisher.js.map +1 -1
- package/dist/vision/VisionSourceController.d.ts +67 -1
- package/dist/vision/VisionSourceController.d.ts.map +1 -1
- package/dist/vision/VisionSourceController.js +147 -5
- package/dist/vision/VisionSourceController.js.map +1 -1
- package/dist/vision/index.d.ts +2 -1
- package/dist/vision/index.d.ts.map +1 -1
- package/dist/vision/index.js +2 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/sourceKinds.d.ts +18 -5
- package/dist/vision/sourceKinds.d.ts.map +1 -1
- package/dist/vision/sourceKinds.js +15 -2
- package/dist/vision/sourceKinds.js.map +1 -1
- package/dist/vision/types.d.ts +7 -4
- package/dist/vision/types.d.ts.map +1 -1
- package/dist/vision/visionErrors.d.ts +45 -0
- package/dist/vision/visionErrors.d.ts.map +1 -0
- package/dist/vision/visionErrors.js +66 -0
- package/dist/vision/visionErrors.js.map +1 -0
- package/dist/voiceCloneCaption.d.ts +33 -0
- package/dist/voiceCloneCaption.d.ts.map +1 -0
- package/dist/voiceCloneCaption.js +69 -0
- package/dist/voiceCloneCaption.js.map +1 -0
- package/dist/websocket.d.ts +390 -10
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +152 -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/binding.test.ts +53 -0
- package/src/__tests__/conversation/chatSessionStore.test.ts +243 -0
- package/src/__tests__/conversation/controller.test.ts +328 -0
- package/src/__tests__/conversation/readSequencer.test.ts +52 -0
- package/src/__tests__/conversation/rosterProjection.test.ts +204 -3
- package/src/__tests__/conversation/runtime.test.ts +118 -1
- package/src/__tests__/conversation/voice.test.ts +741 -7
- package/src/__tests__/creatorCuration.test.ts +256 -0
- package/src/__tests__/creatorDashboard.test.ts +444 -0
- package/src/__tests__/creatorUniverse.test.ts +138 -0
- package/src/__tests__/curationWrite.test.ts +179 -0
- package/src/__tests__/decisions.test.ts +89 -0
- package/src/__tests__/designTokens.test.ts +72 -0
- package/src/__tests__/dialogAttribution.test.ts +187 -0
- package/src/__tests__/dmDirectiveToExperience.test.ts +198 -0
- package/src/__tests__/dmWorldEntry.test.ts +2102 -0
- package/src/__tests__/enhancementDiff.test.ts +132 -0
- package/src/__tests__/experienceModelCatalog.test.ts +292 -0
- package/src/__tests__/extractionStageState.test.ts +67 -0
- package/src/__tests__/getVideo.test.ts +95 -0
- package/src/__tests__/graphReadAfterWrite.test.ts +211 -0
- package/src/__tests__/graphSchema.test.ts +55 -4
- package/src/__tests__/happyOysterSeed.test.ts +208 -0
- package/src/__tests__/happyOysterWorld.test.ts +1241 -0
- package/src/__tests__/happyOysterWorldRefusal.test.ts +224 -0
- package/src/__tests__/hiddenWorldLifecycle.test.ts +203 -0
- package/src/__tests__/http.session-refresh.test.ts +424 -0
- package/src/__tests__/http.test.ts +316 -0
- package/src/__tests__/identity.test.ts +132 -0
- package/src/__tests__/loadBundleManifest.test.ts +192 -22
- package/src/__tests__/longLiveSceneEntry.test.ts +371 -0
- package/src/__tests__/me.test.ts +74 -0
- package/src/__tests__/messageContent.test.ts +395 -0
- package/src/__tests__/momentCut.test.ts +229 -0
- package/src/__tests__/mutationEpoch.test.ts +218 -0
- package/src/__tests__/obo.test.ts +159 -0
- package/src/__tests__/opusTransport.test.ts +182 -0
- package/src/__tests__/opusTransportLibopus.test.ts +125 -0
- package/src/__tests__/orgs.test.ts +229 -0
- package/src/__tests__/persona-generation.test.ts +187 -1
- package/src/__tests__/platformAssistant.test.ts +140 -0
- package/src/__tests__/projects.test.ts +338 -0
- package/src/__tests__/promptTemplatePreview.test.ts +160 -0
- package/src/__tests__/reactor/__fixtures__/realFramePromptText.ts +23 -0
- package/src/__tests__/reactor/api-reactor.test.ts +60 -21
- package/src/__tests__/reactor/framePromptCompaction.test.ts +300 -0
- package/src/__tests__/reactor/promptAddonRegistry.test.ts +82 -1
- 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/toolPromptAddon.test.ts +34 -42
- 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-session-attach.test.ts +288 -0
- package/src/__tests__/websocket-vision.test.ts +141 -0
- package/src/__tests__/websocket.test.ts +75 -1
- package/src/__tests__/workflowAuthoring.test.ts +187 -0
- package/src/__tests__/workflows.test.ts +640 -0
- package/src/__tests__/worldMintLoop.test.ts +448 -0
- package/src/__tests__/worldModelPreference.test.ts +302 -0
- package/src/__tests__/worldModelTradeoffs.test.ts +89 -0
- package/src/__tests__/worldSteerOutcome.test.ts +62 -0
- package/src/adapters/capabilities.ts +39 -3
- package/src/adapters/directorAdapter.ts +5 -4
- package/src/adapters/experienceModelCatalog.ts +538 -0
- package/src/adapters/extractionAdapter.ts +150 -0
- package/src/adapters/imageAdapter.ts +5 -1
- package/src/adapters/index.ts +104 -17
- package/src/adapters/momentDirective.ts +109 -0
- package/src/adapters/momentPolicy.ts +209 -0
- package/src/adapters/registry.ts +1 -1
- package/src/adapters/videoGenAdapter.ts +124 -0
- package/src/adapters/worldAdapter.ts +221 -16
- package/src/adapters/worldModelPreference.ts +247 -0
- package/src/adapters/worldModelTradeoffs.ts +247 -0
- package/src/admin.ts +842 -16
- package/src/api.ts +12670 -3446
- package/src/arcBoardJoin.ts +46 -0
- package/src/arcPreview.ts +103 -0
- package/src/audio.ts +691 -130
- package/src/audioDsp.ts +132 -0
- package/src/audioProtocol.ts +235 -0
- package/src/beatTitles.ts +51 -0
- package/src/castProjection.ts +311 -0
- package/src/characterGrounding.ts +491 -0
- package/src/conversation/binding.ts +53 -1
- package/src/conversation/chatSessionStore.ts +281 -0
- package/src/conversation/controller.ts +135 -3
- package/src/conversation/index.ts +2 -0
- package/src/conversation/participant.ts +16 -0
- package/src/conversation/readSequencer.ts +55 -0
- package/src/conversation/roster.ts +5 -1
- package/src/conversation/rosterProjection.ts +166 -2
- package/src/conversation/runtime.ts +66 -7
- package/src/conversation/types.ts +43 -4
- package/src/conversation/voice.ts +655 -51
- package/src/creatorCuration.ts +316 -0
- package/src/creatorDashboard.ts +344 -0
- package/src/creatorUniverse.ts +222 -0
- package/src/curationWrite.ts +108 -0
- package/src/designTokens.ts +157 -0
- package/src/dialogAttribution.ts +182 -0
- package/src/dmRunWorldReadiness.ts +1168 -0
- package/src/domains/access.ts +92 -0
- package/src/domains/adventureDefinitions.ts +313 -0
- package/src/domains/adventures.ts +557 -0
- package/src/domains/arcs.ts +350 -0
- package/src/domains/artifacts.ts +349 -0
- package/src/domains/chat.ts +338 -0
- package/src/domains/decisions.ts +62 -0
- package/src/domains/documents.ts +389 -0
- package/src/domains/enhancements.ts +259 -0
- package/src/domains/graph.ts +959 -0
- package/src/domains/images.ts +451 -0
- package/src/domains/ingestion.ts +695 -0
- package/src/domains/me.ts +27 -0
- package/src/domains/orgs.ts +168 -0
- package/src/domains/personas.ts +433 -0
- package/src/domains/projects.ts +177 -0
- package/src/domains/quests.ts +587 -0
- package/src/domains/reactor.ts +163 -0
- package/src/domains/showcase.ts +35 -0
- package/src/domains/storyboards.ts +1698 -0
- package/src/domains/studioSettings.ts +149 -0
- package/src/domains/universes.ts +433 -0
- package/src/domains/userDefaults.ts +37 -0
- package/src/domains/visemeBundles.ts +541 -0
- package/src/domains/workflows.ts +376 -0
- package/src/enhancementDiff.ts +171 -0
- package/src/generated/contract.ts +1011 -0
- package/src/graphSchema.ts +154 -6
- package/src/http.ts +295 -11
- package/src/identity.ts +123 -0
- package/src/index.ts +131 -0
- package/src/messageContent.ts +500 -0
- package/src/mutationEpoch.ts +107 -0
- package/src/obo.ts +201 -0
- package/src/opusTransport.ts +268 -0
- package/src/pagination.ts +29 -0
- package/src/platformAssistant.ts +97 -1
- package/src/pollUtils.ts +35 -0
- package/src/questLog.ts +704 -0
- package/src/reactor/dmDirectiveToExperience.ts +636 -0
- package/src/reactor/dmSceneControlPrompt.ts +152 -0
- 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 +81 -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 +83 -5
- 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 +66 -102
- package/src/reactor/worldMintLoop.ts +545 -0
- package/src/reactor/worldSteerOutcome.ts +132 -0
- package/src/retryAfter.ts +71 -0
- package/src/seriesKey.ts +42 -0
- package/src/sessionRefresh.ts +237 -0
- package/src/sharedAudioContext.ts +67 -0
- package/src/singleFlight.ts +91 -0
- package/src/storyGraph.ts +247 -4
- package/src/storyboardMask.ts +756 -0
- package/src/storyboardTimeline.ts +220 -0
- package/src/studioAutomation.ts +208 -0
- package/src/tenantClaim.ts +170 -0
- package/src/timeFormat.ts +51 -0
- package/src/toolSchemas.ts +39 -10
- package/src/transport.ts +327 -0
- package/src/videoGenFacade.ts +90 -0
- package/src/visemeScheduler.ts +36 -3
- package/src/vision/VisionPublisher.ts +204 -14
- package/src/vision/VisionSourceController.ts +187 -6
- package/src/vision/__tests__/VisionPublisher.kvs.test.ts +50 -0
- package/src/vision/__tests__/VisionPublisher.test.ts +291 -0
- package/src/vision/__tests__/VisionSourceController.test.ts +376 -6
- package/src/vision/index.ts +5 -1
- package/src/vision/sourceKinds.ts +19 -5
- package/src/vision/types.ts +7 -4
- package/src/vision/visionErrors.ts +70 -0
- package/src/voiceCloneCaption.ts +77 -0
- package/src/websocket.ts +542 -9
- package/src/workflowAuthoring.ts +664 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Studio-settings domain module (SET.9, settings ledger groups g-automation +
|
|
3
|
+
* g-features): the tenant automation toggles + the org-scoped feature
|
|
4
|
+
* entitlement restrictions, served by `api/studio_settings/app.py` (SET.4 +
|
|
5
|
+
* SET.7 backend). Mounted on the Chat API, so every method routes through
|
|
6
|
+
* `transport.requestJson(transport.chatBaseUrl, ...)` (same base as
|
|
7
|
+
* `./personas.ts`). SET.8 added the same router's other half: the
|
|
8
|
+
* studio-defined prompt add-ons CRUD (settings spec §3, ledger group
|
|
9
|
+
* g-addons). SET.14c adds the per-CODE-defined-add-on `enabled_by_default`
|
|
10
|
+
* FLAG seam (settings spec §3 residual) — flag-only, never content; the
|
|
11
|
+
* new backend flag-row shape the g-prompts group's UI half needed.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { Transport } from '../transport';
|
|
15
|
+
import type {
|
|
16
|
+
AutomationSettings,
|
|
17
|
+
AutomationSettingsUpdateRequest,
|
|
18
|
+
CodeAddonFlagsResponse,
|
|
19
|
+
CodeAddonFlagsUpdateRequest,
|
|
20
|
+
FeatureSettingsResponse,
|
|
21
|
+
FeatureSettingsUpdateRequest,
|
|
22
|
+
StudioAddonCreateRequest,
|
|
23
|
+
StudioAddonDetailResponse,
|
|
24
|
+
StudioAddonListResponse,
|
|
25
|
+
StudioAddonUpdateRequest,
|
|
26
|
+
} from '../api';
|
|
27
|
+
|
|
28
|
+
const STUDIO_SETTINGS_BASE = '/api/v1/studio/settings';
|
|
29
|
+
|
|
30
|
+
export class StudioSettingsApi {
|
|
31
|
+
constructor(private readonly transport: Transport) {}
|
|
32
|
+
|
|
33
|
+
/** See {@link ApiClient.getAutomationSettings}. */
|
|
34
|
+
async getAutomationSettings(): Promise<AutomationSettings> {
|
|
35
|
+
return this.transport.requestJson<AutomationSettings>(
|
|
36
|
+
this.transport.chatBaseUrl,
|
|
37
|
+
`${STUDIO_SETTINGS_BASE}/automation`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** See {@link ApiClient.updateAutomationSettings}. */
|
|
42
|
+
async updateAutomationSettings(
|
|
43
|
+
body: AutomationSettingsUpdateRequest,
|
|
44
|
+
): Promise<AutomationSettings> {
|
|
45
|
+
return this.transport.requestJson<AutomationSettings>(
|
|
46
|
+
this.transport.chatBaseUrl,
|
|
47
|
+
`${STUDIO_SETTINGS_BASE}/automation`,
|
|
48
|
+
{
|
|
49
|
+
method: 'PUT',
|
|
50
|
+
headers: { 'Content-Type': 'application/json' },
|
|
51
|
+
body: JSON.stringify(body),
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** See {@link ApiClient.listPromptAddons}. */
|
|
57
|
+
async listPromptAddons(): Promise<StudioAddonListResponse> {
|
|
58
|
+
return this.transport.requestJson<StudioAddonListResponse>(
|
|
59
|
+
this.transport.chatBaseUrl,
|
|
60
|
+
`${STUDIO_SETTINGS_BASE}/addons`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** See {@link ApiClient.createPromptAddon}. */
|
|
65
|
+
async createPromptAddon(
|
|
66
|
+
body: StudioAddonCreateRequest,
|
|
67
|
+
): Promise<StudioAddonDetailResponse> {
|
|
68
|
+
return this.transport.requestJson<StudioAddonDetailResponse>(
|
|
69
|
+
this.transport.chatBaseUrl,
|
|
70
|
+
`${STUDIO_SETTINGS_BASE}/addons`,
|
|
71
|
+
{
|
|
72
|
+
method: 'POST',
|
|
73
|
+
headers: { 'Content-Type': 'application/json' },
|
|
74
|
+
body: JSON.stringify(body),
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** See {@link ApiClient.updatePromptAddon}. */
|
|
80
|
+
async updatePromptAddon(
|
|
81
|
+
addonId: string,
|
|
82
|
+
body: StudioAddonUpdateRequest,
|
|
83
|
+
): Promise<StudioAddonDetailResponse> {
|
|
84
|
+
return this.transport.requestJson<StudioAddonDetailResponse>(
|
|
85
|
+
this.transport.chatBaseUrl,
|
|
86
|
+
`${STUDIO_SETTINGS_BASE}/addons/${encodeURIComponent(addonId)}`,
|
|
87
|
+
{
|
|
88
|
+
method: 'PATCH',
|
|
89
|
+
headers: { 'Content-Type': 'application/json' },
|
|
90
|
+
body: JSON.stringify(body),
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** See {@link ApiClient.deletePromptAddon}. */
|
|
96
|
+
async deletePromptAddon(addonId: string): Promise<void> {
|
|
97
|
+
await this.transport.requestJson<void>(
|
|
98
|
+
this.transport.chatBaseUrl,
|
|
99
|
+
`${STUDIO_SETTINGS_BASE}/addons/${encodeURIComponent(addonId)}`,
|
|
100
|
+
{ method: 'DELETE' },
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** See {@link ApiClient.getCodeAddonFlags}. */
|
|
105
|
+
async getCodeAddonFlags(): Promise<CodeAddonFlagsResponse> {
|
|
106
|
+
return this.transport.requestJson<CodeAddonFlagsResponse>(
|
|
107
|
+
this.transport.chatBaseUrl,
|
|
108
|
+
`${STUDIO_SETTINGS_BASE}/code-addons`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** See {@link ApiClient.updateCodeAddonFlags}. */
|
|
113
|
+
async updateCodeAddonFlags(
|
|
114
|
+
body: CodeAddonFlagsUpdateRequest,
|
|
115
|
+
): Promise<CodeAddonFlagsResponse> {
|
|
116
|
+
return this.transport.requestJson<CodeAddonFlagsResponse>(
|
|
117
|
+
this.transport.chatBaseUrl,
|
|
118
|
+
`${STUDIO_SETTINGS_BASE}/code-addons`,
|
|
119
|
+
{
|
|
120
|
+
method: 'PUT',
|
|
121
|
+
headers: { 'Content-Type': 'application/json' },
|
|
122
|
+
body: JSON.stringify(body),
|
|
123
|
+
},
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** See {@link ApiClient.getFeatureSettings}. */
|
|
128
|
+
async getFeatureSettings(): Promise<FeatureSettingsResponse> {
|
|
129
|
+
return this.transport.requestJson<FeatureSettingsResponse>(
|
|
130
|
+
this.transport.chatBaseUrl,
|
|
131
|
+
`${STUDIO_SETTINGS_BASE}/features`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** See {@link ApiClient.updateFeatureSettings}. */
|
|
136
|
+
async updateFeatureSettings(
|
|
137
|
+
body: FeatureSettingsUpdateRequest,
|
|
138
|
+
): Promise<FeatureSettingsResponse> {
|
|
139
|
+
return this.transport.requestJson<FeatureSettingsResponse>(
|
|
140
|
+
this.transport.chatBaseUrl,
|
|
141
|
+
`${STUDIO_SETTINGS_BASE}/features`,
|
|
142
|
+
{
|
|
143
|
+
method: 'PUT',
|
|
144
|
+
headers: { 'Content-Type': 'application/json' },
|
|
145
|
+
body: JSON.stringify(body),
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universes domain module (§Q UV.1/UV.4/UV.3/UV.7b/UV.7c/UV.9/UV.8a/UV.8b):
|
|
3
|
+
* the first-class Universe record list, the single-call arc index that kills
|
|
4
|
+
* the #811 per-video client fan-out, and the UV.10 History UI reads/writes —
|
|
5
|
+
* commit history, two-column diff, per-commit revert dispatch, the
|
|
6
|
+
* point-in-time restore-plan projection, and restore EXECUTION (the async
|
|
7
|
+
* saga UV.7c dispatches + its status poll). Branch/fork (UV.9), export
|
|
8
|
+
* (UV.8a), and import-as-new (UV.8b) landed on the backend under §Q UV.11's
|
|
9
|
+
* client-core plumbing slice — types + methods below; the History UI
|
|
10
|
+
* progress panels that consume them are a `/drive-seer-ui` follow-up.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { Transport } from '../transport';
|
|
14
|
+
import type {
|
|
15
|
+
CreateUniverseBranchRequest,
|
|
16
|
+
CreateUniverseBranchResponse,
|
|
17
|
+
CreateUniverseExportResponse,
|
|
18
|
+
CreateUniverseImportRequest,
|
|
19
|
+
CreateUniverseImportResponse,
|
|
20
|
+
CreateUniverseRequest,
|
|
21
|
+
CreateUniverseResponse,
|
|
22
|
+
GetUniverseBranchResponse,
|
|
23
|
+
GetUniverseExportResponse,
|
|
24
|
+
GetUniverseImportResponse,
|
|
25
|
+
ListEntityArcsResponse,
|
|
26
|
+
ListUniverseArcsResponse,
|
|
27
|
+
ListUniverseBranchesResponse,
|
|
28
|
+
ListUniverseExportsResponse,
|
|
29
|
+
ListUniverseImportsResponse,
|
|
30
|
+
ListUniversesResponse,
|
|
31
|
+
RestoreJobStatus,
|
|
32
|
+
RestoreUniverseRequest,
|
|
33
|
+
RestoreUniverseResponse,
|
|
34
|
+
RevertUniverseCommitResponse,
|
|
35
|
+
RunCommitResponse,
|
|
36
|
+
UniverseBranchStatus,
|
|
37
|
+
UniverseDiffResponse,
|
|
38
|
+
UniverseHistoryResponse,
|
|
39
|
+
UniverseRestoreJobResponse,
|
|
40
|
+
UniverseRestorePlanResponse,
|
|
41
|
+
} from '../api';
|
|
42
|
+
|
|
43
|
+
/** Why {@link UniversesApi.executeRestore} refused with `409 Conflict` — the
|
|
44
|
+
* backend has two distinct causes behind the same status code (§Q UV.7c) and
|
|
45
|
+
* the UI must not conflate them: a stale plan needs a plan re-fetch, an
|
|
46
|
+
* already-active restore needs the user to wait. The backend returns a plain
|
|
47
|
+
* `detail` string (no structured error code, unlike `RecloneConflictError`'s
|
|
48
|
+
* `{error, attempts}` body) — classified here by matching the ONE
|
|
49
|
+
* distinguishing substring each of `_RESTORE_STALE_PLAN`/
|
|
50
|
+
* `_RESTORE_ALREADY_ACTIVE` (`api/universes/app.py`) is built from. */
|
|
51
|
+
export type RestoreConflictCode = 'stale_plan' | 'already_active';
|
|
52
|
+
|
|
53
|
+
/** Thrown by {@link UniversesApi.executeRestore} on a `409` so the History UI
|
|
54
|
+
* can branch: `stale_plan` → re-fetch the restore plan before retrying;
|
|
55
|
+
* `already_active` → tell the user a restore is already running. */
|
|
56
|
+
export class RestoreConflictError extends Error {
|
|
57
|
+
readonly code: RestoreConflictCode;
|
|
58
|
+
constructor(code: RestoreConflictCode, detail: string) {
|
|
59
|
+
super(detail);
|
|
60
|
+
this.name = 'RestoreConflictError';
|
|
61
|
+
this.code = code;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Thrown by {@link UniversesApi.executeRestore} on a `400` — the requested
|
|
66
|
+
* `toVersion` is above the universe's current head version. */
|
|
67
|
+
export class RestoreInvalidTargetError extends Error {
|
|
68
|
+
constructor(detail: string) {
|
|
69
|
+
super(detail);
|
|
70
|
+
this.name = 'RestoreInvalidTargetError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Substring unique to the backend's "already in progress" 409 detail
|
|
75
|
+
* (`_RESTORE_ALREADY_ACTIVE`); anything else on a 409 is the stale-plan case
|
|
76
|
+
* (`_RESTORE_STALE_PLAN`) — the only two 409 causes this endpoint has. */
|
|
77
|
+
const ALREADY_ACTIVE_DETAIL_MARKER = 'already in progress';
|
|
78
|
+
|
|
79
|
+
/** Terminal `RestoreJobStatus` values (mirrors the backend
|
|
80
|
+
* `TERMINAL_RESTORE_STATUSES` in `shared/universe_restore_models.py`) — a
|
|
81
|
+
* runtime const (not a type), consumed directly by `web/`
|
|
82
|
+
* (`useRestoreExecution.ts`) to stop polling. Re-exported from `api.ts`
|
|
83
|
+
* unchanged, mirroring `WORKFLOW_TERMINAL_RUN_STATUSES`
|
|
84
|
+
* (`./workflows.ts`)/`REGENERATION_TERMINAL_STATUSES` (`./ingestion.ts`).
|
|
85
|
+
* `PARTIAL` is a legitimate terminal SUCCESS-with-skips outcome — it belongs
|
|
86
|
+
* in the terminal set, never treated as a failure by callers. */
|
|
87
|
+
export const RESTORE_TERMINAL_STATUSES: ReadonlySet<RestoreJobStatus> = new Set([
|
|
88
|
+
'COMPLETED',
|
|
89
|
+
'PARTIAL',
|
|
90
|
+
'FAILED',
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
export function isTerminalRestoreStatus(status: RestoreJobStatus): boolean {
|
|
94
|
+
return RESTORE_TERMINAL_STATUSES.has(status);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Terminal `UniverseBranchStatus` values (mirrors the backend
|
|
98
|
+
* `UniverseBranchStatus` enum — fork jobs and import-as-new jobs share it) —
|
|
99
|
+
* the `isTerminalRestoreStatus` precedent above, applied to branch/import job
|
|
100
|
+
* polling (§Q UV.11 UI slice, `web/lib/useUniverseBranchExecution.ts`).
|
|
101
|
+
* `PARTIAL` is a legitimate terminal outcome (some steps skipped, e.g. a lost
|
|
102
|
+
* provenance commit), never a failure. */
|
|
103
|
+
export const BRANCH_TERMINAL_STATUSES: ReadonlySet<UniverseBranchStatus> = new Set([
|
|
104
|
+
'COMPLETED',
|
|
105
|
+
'PARTIAL',
|
|
106
|
+
'FAILED',
|
|
107
|
+
]);
|
|
108
|
+
|
|
109
|
+
export function isTerminalBranchStatus(status: UniverseBranchStatus): boolean {
|
|
110
|
+
return BRANCH_TERMINAL_STATUSES.has(status);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export class UniversesApi {
|
|
114
|
+
constructor(private readonly transport: Transport) {}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* List the caller's universes (lazy-mints one per distinct `seriesId` on
|
|
118
|
+
* first read). GET `/api/v1/universes`.
|
|
119
|
+
*/
|
|
120
|
+
async listUniverses(): Promise<ListUniversesResponse> {
|
|
121
|
+
return this.transport.requestJson<ListUniversesResponse>(
|
|
122
|
+
this.transport.baseUrl,
|
|
123
|
+
'/api/v1/universes',
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Create a named, video-less universe (§Q UT.4a — the durable half of the
|
|
129
|
+
* "New universe" UX). POST `/api/v1/universes` → 201 with the minted
|
|
130
|
+
* record; 409 when a universe already exists for the (derived or explicit)
|
|
131
|
+
* series slug; 422 on an invalid slug.
|
|
132
|
+
*/
|
|
133
|
+
async createUniverse(body: CreateUniverseRequest): Promise<CreateUniverseResponse> {
|
|
134
|
+
return this.transport.requestJson<CreateUniverseResponse>(
|
|
135
|
+
this.transport.baseUrl,
|
|
136
|
+
'/api/v1/universes',
|
|
137
|
+
{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) },
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* List a universe's arc proposals in one call, newest-first (UV.4). GET
|
|
143
|
+
* `/api/v1/universes/{universeId}/arcs?cursor&status&limit`. 404 when arc
|
|
144
|
+
* generation is not enabled on this environment (land-dark parity with the
|
|
145
|
+
* per-story arc surfaces).
|
|
146
|
+
*/
|
|
147
|
+
async listUniverseArcs(
|
|
148
|
+
universeId: string,
|
|
149
|
+
options: { cursor?: string; status?: string; limit?: number } = {},
|
|
150
|
+
): Promise<ListUniverseArcsResponse> {
|
|
151
|
+
const params = new URLSearchParams();
|
|
152
|
+
if (options.cursor) params.set('cursor', options.cursor);
|
|
153
|
+
if (options.status) params.set('status', options.status);
|
|
154
|
+
if (options.limit != null) params.set('limit', String(options.limit));
|
|
155
|
+
const qs = params.toString();
|
|
156
|
+
return this.transport.requestJson<ListUniverseArcsResponse>(
|
|
157
|
+
this.transport.baseUrl,
|
|
158
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/arcs${qs ? `?${qs}` : ''}`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* List the arcs that cast a given graph entity (§Q W2.24r) — the REVERSE
|
|
164
|
+
* of {@link listUniverseArcs}'s `castBindings` forward trail (#1157): the
|
|
165
|
+
* cast inspector's "used in these arcs" list. GET
|
|
166
|
+
* `/api/v1/universes/{universeId}/entities/{entityId}/arcs`. 404 when arc
|
|
167
|
+
* generation is not enabled on this environment (same land-dark parity as
|
|
168
|
+
* {@link listUniverseArcs}).
|
|
169
|
+
*/
|
|
170
|
+
async listEntityArcs(universeId: string, entityId: string): Promise<ListEntityArcsResponse> {
|
|
171
|
+
return this.transport.requestJson<ListEntityArcsResponse>(
|
|
172
|
+
this.transport.baseUrl,
|
|
173
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/entities/${encodeURIComponent(entityId)}/arcs`,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Newest-first commit-spine page (UV.3). GET
|
|
179
|
+
* `/api/v1/universes/{universeId}/history?cursor&limit`.
|
|
180
|
+
*/
|
|
181
|
+
async getUniverseHistory(
|
|
182
|
+
universeId: string,
|
|
183
|
+
options: { cursor?: string; limit?: number } = {},
|
|
184
|
+
): Promise<UniverseHistoryResponse> {
|
|
185
|
+
const params = new URLSearchParams();
|
|
186
|
+
if (options.cursor) params.set('cursor', options.cursor);
|
|
187
|
+
if (options.limit != null) params.set('limit', String(options.limit));
|
|
188
|
+
const qs = params.toString();
|
|
189
|
+
return this.transport.requestJson<UniverseHistoryResponse>(
|
|
190
|
+
this.transport.baseUrl,
|
|
191
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/history${qs ? `?${qs}` : ''}`,
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Two-column commit diff between two versions (UV.3), computed on read. GET
|
|
197
|
+
* `/api/v1/universes/{universeId}/diff?from&to`.
|
|
198
|
+
*/
|
|
199
|
+
async getUniverseDiff(
|
|
200
|
+
universeId: string,
|
|
201
|
+
from: number,
|
|
202
|
+
to: number,
|
|
203
|
+
): Promise<UniverseDiffResponse> {
|
|
204
|
+
const params = new URLSearchParams({ from: String(from), to: String(to) });
|
|
205
|
+
return this.transport.requestJson<UniverseDiffResponse>(
|
|
206
|
+
this.transport.baseUrl,
|
|
207
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/diff?${params.toString()}`,
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Dispatch a per-commit revert to existing machinery (UV.3/UV.7a). POST
|
|
213
|
+
* `/api/v1/universes/{universeId}/commits/{commitId}/revert` — 202 on a
|
|
214
|
+
* wired handle, 422 when the commit has no mechanical revert path.
|
|
215
|
+
*/
|
|
216
|
+
async revertUniverseCommit(
|
|
217
|
+
universeId: string,
|
|
218
|
+
commitId: string,
|
|
219
|
+
): Promise<RevertUniverseCommitResponse> {
|
|
220
|
+
return this.transport.requestJson<RevertUniverseCommitResponse>(
|
|
221
|
+
this.transport.baseUrl,
|
|
222
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/commits/${encodeURIComponent(commitId)}/revert`,
|
|
223
|
+
{ method: 'POST' },
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Resolve the commit a generation/regeneration run PRODUCED (§Q LIB.5) —
|
|
229
|
+
* the History feed's revert/keep-discard wiring join: given a
|
|
230
|
+
* `GenerationRunCard.runId` + its `universeId`, resolve `commit.commitId`
|
|
231
|
+
* here, then dispatch {@link revertUniverseCommit}. GET
|
|
232
|
+
* `/api/v1/universes/{universeId}/commits/by-run/{runId}` — 404 when no
|
|
233
|
+
* commit in this universe carries the run id.
|
|
234
|
+
*/
|
|
235
|
+
async getRunCommit(universeId: string, runId: string): Promise<RunCommitResponse> {
|
|
236
|
+
return this.transport.requestJson<RunCommitResponse>(
|
|
237
|
+
this.transport.baseUrl,
|
|
238
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/commits/by-run/${encodeURIComponent(runId)}`,
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Point-in-time restore-plan projection (UV.7b) — pure read, no side
|
|
244
|
+
* effects. GET `/api/v1/universes/{universeId}/restore-plan?to=vN`. The
|
|
245
|
+
* History UI renders this as the restore-confirm dialog.
|
|
246
|
+
*/
|
|
247
|
+
async getUniverseRestorePlan(
|
|
248
|
+
universeId: string,
|
|
249
|
+
to: number,
|
|
250
|
+
): Promise<UniverseRestorePlanResponse> {
|
|
251
|
+
return this.transport.requestJson<UniverseRestorePlanResponse>(
|
|
252
|
+
this.transport.baseUrl,
|
|
253
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/restore-plan?to=${encodeURIComponent(String(to))}`,
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Execute a point-in-time restore (UV.7c) — dispatches the async saga. POST
|
|
259
|
+
* `/api/v1/universes/{universeId}/restore`, 202 + `restoreId`. Uses
|
|
260
|
+
* `transport.fetch` directly (not `requestJson`) because the two 409 causes
|
|
261
|
+
* need full response-body inspection to disambiguate — mirrors
|
|
262
|
+
* {@link PersonasApi.reclonePersona}'s typed-conflict-error precedent.
|
|
263
|
+
*
|
|
264
|
+
* @throws {RestoreConflictError} on 409 — stale `planEtag` or a restore
|
|
265
|
+
* already running for this universe (check `.code`).
|
|
266
|
+
* @throws {RestoreInvalidTargetError} on 400 — `toVersion` above head.
|
|
267
|
+
*/
|
|
268
|
+
async executeRestore(
|
|
269
|
+
universeId: string,
|
|
270
|
+
body: RestoreUniverseRequest,
|
|
271
|
+
): Promise<RestoreUniverseResponse> {
|
|
272
|
+
const url = `${this.transport.baseUrl}/api/v1/universes/${encodeURIComponent(universeId)}/restore`;
|
|
273
|
+
const response = await this.transport.fetch(url, {
|
|
274
|
+
method: 'POST',
|
|
275
|
+
headers: { 'Content-Type': 'application/json' },
|
|
276
|
+
body: JSON.stringify(body),
|
|
277
|
+
});
|
|
278
|
+
if (response.ok) {
|
|
279
|
+
return (await response.json()) as RestoreUniverseResponse;
|
|
280
|
+
}
|
|
281
|
+
const detail = await response
|
|
282
|
+
.json()
|
|
283
|
+
.then((b: { detail?: string }) => b.detail)
|
|
284
|
+
.catch(() => undefined);
|
|
285
|
+
const message = detail || `Restore failed: HTTP ${response.status}`;
|
|
286
|
+
if (response.status === 409) {
|
|
287
|
+
const code: RestoreConflictCode = message.includes(ALREADY_ACTIVE_DETAIL_MARKER)
|
|
288
|
+
? 'already_active'
|
|
289
|
+
: 'stale_plan';
|
|
290
|
+
throw new RestoreConflictError(code, message);
|
|
291
|
+
}
|
|
292
|
+
if (response.status === 400) {
|
|
293
|
+
throw new RestoreInvalidTargetError(message);
|
|
294
|
+
}
|
|
295
|
+
throw new Error(message);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Read a restore job's status + per-step outcomes (UV.7c) — poll this
|
|
300
|
+
* until `status` is terminal. GET
|
|
301
|
+
* `/api/v1/universes/{universeId}/restores/{restoreId}`.
|
|
302
|
+
*/
|
|
303
|
+
async getUniverseRestore(
|
|
304
|
+
universeId: string,
|
|
305
|
+
restoreId: string,
|
|
306
|
+
): Promise<UniverseRestoreJobResponse> {
|
|
307
|
+
return this.transport.requestJson<UniverseRestoreJobResponse>(
|
|
308
|
+
this.transport.baseUrl,
|
|
309
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/restores/${encodeURIComponent(restoreId)}`,
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Deep-fork a universe under a new series id (§Q UV.9) — 202 Accepted, the
|
|
315
|
+
* fork materializes async via the graph FIFO queue. POST
|
|
316
|
+
* `/api/v1/universes/{universeId}/branches`. Poll {@link getUniverseBranch}
|
|
317
|
+
* with the returned job's `branchId`.
|
|
318
|
+
*/
|
|
319
|
+
async createUniverseBranch(
|
|
320
|
+
universeId: string,
|
|
321
|
+
body: CreateUniverseBranchRequest = {},
|
|
322
|
+
): Promise<CreateUniverseBranchResponse> {
|
|
323
|
+
return this.transport.requestJson<CreateUniverseBranchResponse>(
|
|
324
|
+
this.transport.baseUrl,
|
|
325
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/branches`,
|
|
326
|
+
{ method: 'POST', body: JSON.stringify(body) },
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* List a universe's fork jobs, newest-first (§Q UV.9). GET
|
|
332
|
+
* `/api/v1/universes/{universeId}/branches`.
|
|
333
|
+
*/
|
|
334
|
+
async listUniverseBranches(universeId: string): Promise<ListUniverseBranchesResponse> {
|
|
335
|
+
return this.transport.requestJson<ListUniverseBranchesResponse>(
|
|
336
|
+
this.transport.baseUrl,
|
|
337
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/branches`,
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Read one fork job's status/steps (§Q UV.9; the progress-panel read). GET
|
|
343
|
+
* `/api/v1/universes/{universeId}/branches/{branchId}`.
|
|
344
|
+
*/
|
|
345
|
+
async getUniverseBranch(
|
|
346
|
+
universeId: string,
|
|
347
|
+
branchId: string,
|
|
348
|
+
): Promise<GetUniverseBranchResponse> {
|
|
349
|
+
return this.transport.requestJson<GetUniverseBranchResponse>(
|
|
350
|
+
this.transport.baseUrl,
|
|
351
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/branches/${encodeURIComponent(branchId)}`,
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Export a universe to a portable bundle (§Q UV.8a) — 201 Created with a
|
|
357
|
+
* short-lived presigned `downloadUrl`. POST
|
|
358
|
+
* `/api/v1/universes/{universeId}/exports`.
|
|
359
|
+
*/
|
|
360
|
+
async createUniverseExport(universeId: string): Promise<CreateUniverseExportResponse> {
|
|
361
|
+
return this.transport.requestJson<CreateUniverseExportResponse>(
|
|
362
|
+
this.transport.baseUrl,
|
|
363
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/exports`,
|
|
364
|
+
{ method: 'POST' },
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* List a universe's export bundles, newest-first (§Q UV.8a; retention-
|
|
370
|
+
* capped). GET `/api/v1/universes/{universeId}/exports`.
|
|
371
|
+
*/
|
|
372
|
+
async listUniverseExports(universeId: string): Promise<ListUniverseExportsResponse> {
|
|
373
|
+
return this.transport.requestJson<ListUniverseExportsResponse>(
|
|
374
|
+
this.transport.baseUrl,
|
|
375
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/exports`,
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Read one export bundle record + a fresh presigned download URL (§Q
|
|
381
|
+
* UV.8a). GET `/api/v1/universes/{universeId}/exports/{exportId}`.
|
|
382
|
+
*/
|
|
383
|
+
async getUniverseExport(
|
|
384
|
+
universeId: string,
|
|
385
|
+
exportId: string,
|
|
386
|
+
): Promise<GetUniverseExportResponse> {
|
|
387
|
+
return this.transport.requestJson<GetUniverseExportResponse>(
|
|
388
|
+
this.transport.baseUrl,
|
|
389
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/exports/${encodeURIComponent(exportId)}`,
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Import an export bundle as a NEW universe (§Q UV.8b) — 202 Accepted;
|
|
395
|
+
* always creates a new universe, never merges into an existing one (OQ-B6).
|
|
396
|
+
* POST `/api/v1/universes/imports`. Poll {@link getUniverseImport} with the
|
|
397
|
+
* returned job's `branchId` (imports ride the UV.9 branch-job keyspace).
|
|
398
|
+
*/
|
|
399
|
+
async createUniverseImport(
|
|
400
|
+
body: CreateUniverseImportRequest,
|
|
401
|
+
): Promise<CreateUniverseImportResponse> {
|
|
402
|
+
return this.transport.requestJson<CreateUniverseImportResponse>(
|
|
403
|
+
this.transport.baseUrl,
|
|
404
|
+
`/api/v1/universes/imports`,
|
|
405
|
+
{ method: 'POST', body: JSON.stringify(body) },
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Read one import job's status/steps (§Q UV.8b; the progress-panel read).
|
|
411
|
+
* GET `/api/v1/universes/imports/{sourceUniverseId}/{importId}`.
|
|
412
|
+
*/
|
|
413
|
+
async getUniverseImport(
|
|
414
|
+
sourceUniverseId: string,
|
|
415
|
+
importId: string,
|
|
416
|
+
): Promise<GetUniverseImportResponse> {
|
|
417
|
+
return this.transport.requestJson<GetUniverseImportResponse>(
|
|
418
|
+
this.transport.baseUrl,
|
|
419
|
+
`/api/v1/universes/imports/${encodeURIComponent(sourceUniverseId)}/${encodeURIComponent(importId)}`,
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* List import jobs sourced from this universe's exports, newest-first (§Q
|
|
425
|
+
* UV.11). GET `/api/v1/universes/{universeId}/imports`.
|
|
426
|
+
*/
|
|
427
|
+
async listUniverseImports(universeId: string): Promise<ListUniverseImportsResponse> {
|
|
428
|
+
return this.transport.requestJson<ListUniverseImportsResponse>(
|
|
429
|
+
this.transport.baseUrl,
|
|
430
|
+
`/api/v1/universes/${encodeURIComponent(universeId)}/imports`,
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-user defaults domain module (SET.9/SET.10, settings ledger group
|
|
3
|
+
* g-me): the caller's personal, tenant-INDEPENDENT preferences, served by
|
|
4
|
+
* `api/defaults/app.py` (SET.10 backend). Mounted on the Chat API, so every
|
|
5
|
+
* method routes through `transport.requestJson(transport.chatBaseUrl, ...)`
|
|
6
|
+
* (same base as `./personas.ts`).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Transport } from '../transport';
|
|
10
|
+
import type { UserDefaults, UserDefaultsUpdateRequest } from '../api';
|
|
11
|
+
|
|
12
|
+
const DEFAULTS_ENDPOINT = '/api/v1/defaults';
|
|
13
|
+
|
|
14
|
+
export class UserDefaultsApi {
|
|
15
|
+
constructor(private readonly transport: Transport) {}
|
|
16
|
+
|
|
17
|
+
/** See {@link ApiClient.getUserDefaults}. */
|
|
18
|
+
async getUserDefaults(): Promise<UserDefaults> {
|
|
19
|
+
return this.transport.requestJson<UserDefaults>(
|
|
20
|
+
this.transport.chatBaseUrl,
|
|
21
|
+
DEFAULTS_ENDPOINT,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** See {@link ApiClient.updateUserDefaults}. */
|
|
26
|
+
async updateUserDefaults(body: UserDefaultsUpdateRequest): Promise<UserDefaults> {
|
|
27
|
+
return this.transport.requestJson<UserDefaults>(
|
|
28
|
+
this.transport.chatBaseUrl,
|
|
29
|
+
DEFAULTS_ENDPOINT,
|
|
30
|
+
{
|
|
31
|
+
method: 'PUT',
|
|
32
|
+
headers: { 'Content-Type': 'application/json' },
|
|
33
|
+
body: JSON.stringify(body),
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|