@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,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* creatorUniverse — library index joins for the creator Universe surface
|
|
3
|
+
* (Phase 3 Slice 3).
|
|
4
|
+
*/
|
|
5
|
+
import {
|
|
6
|
+
buildUniverseIndex,
|
|
7
|
+
mergeGraphRelations,
|
|
8
|
+
videoDisplayName,
|
|
9
|
+
videoRelations,
|
|
10
|
+
UNASSIGNED_LANE_ID,
|
|
11
|
+
} from '../creatorUniverse';
|
|
12
|
+
import type { DocumentRecord, IngestionJob, VideoListingEntry } from '../api';
|
|
13
|
+
|
|
14
|
+
function job(overrides: Partial<IngestionJob>): IngestionJob {
|
|
15
|
+
return { jobId: 'j', videoId: 'v1', status: 'SUCCEEDED', ...overrides };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function listing(overrides: Partial<VideoListingEntry>): VideoListingEntry {
|
|
19
|
+
return {
|
|
20
|
+
videoId: 'v1',
|
|
21
|
+
filename: 'metropolis.mp4',
|
|
22
|
+
key: 'k',
|
|
23
|
+
size: 1,
|
|
24
|
+
lastModified: '2026-07-01T00:00:00Z',
|
|
25
|
+
...overrides,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function doc(overrides: Partial<DocumentRecord>): DocumentRecord {
|
|
30
|
+
return {
|
|
31
|
+
docId: 'd1',
|
|
32
|
+
status: 'parsed' as DocumentRecord['status'],
|
|
33
|
+
kind: 'script' as DocumentRecord['kind'],
|
|
34
|
+
title: 'Shooting script',
|
|
35
|
+
pageCount: 3,
|
|
36
|
+
suggestions: [],
|
|
37
|
+
...overrides,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
describe('videoDisplayName', () => {
|
|
42
|
+
it('prefers episodeTitle, then extension-stripped filename, then id', () => {
|
|
43
|
+
expect(videoDisplayName(job({ episodeTitle: 'The Heist' }), listing({}), 'v1')).toBe('The Heist');
|
|
44
|
+
expect(videoDisplayName(job({}), listing({ filename: 'metropolis.mp4' }), 'v1')).toBe('metropolis');
|
|
45
|
+
expect(videoDisplayName(undefined, undefined, 'v1')).toBe('v1');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('buildUniverseIndex', () => {
|
|
50
|
+
it('unions jobs and listings, links documents, groups lanes in canon order', () => {
|
|
51
|
+
const index = buildUniverseIndex(
|
|
52
|
+
[
|
|
53
|
+
job({ videoId: 'v1', seriesId: 's1', episodeNumber: 2, episodeTitle: 'Two' }),
|
|
54
|
+
job({ videoId: 'v2', seriesId: 's1', episodeNumber: 1, episodeTitle: 'One' }),
|
|
55
|
+
job({ videoId: 'v3' }), // no series, no listing
|
|
56
|
+
],
|
|
57
|
+
[listing({ videoId: 'v1' }), listing({ videoId: 'v4', filename: 'orphan.mov' })],
|
|
58
|
+
[doc({ videoId: 'v1' }), doc({ docId: 'd2', videoId: null, seriesId: 's1', title: 'Bible' })],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
expect(index.videos.map(v => v.videoId).sort()).toEqual(['v1', 'v2', 'v3', 'v4']);
|
|
62
|
+
expect(index.videos.find(v => v.videoId === 'v1')?.linkedDocIds).toEqual(['d1']);
|
|
63
|
+
expect(index.videos.find(v => v.videoId === 'v4')?.displayName).toBe('orphan');
|
|
64
|
+
|
|
65
|
+
const s1 = index.lanes.find(lane => lane.seriesId === 's1');
|
|
66
|
+
expect(s1?.videos.map(v => v.episodeNumber)).toEqual([1, 2]); // canon order
|
|
67
|
+
expect(index.lanes[index.lanes.length - 1].seriesId).toBe(UNASSIGNED_LANE_ID); // trails
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
describe('buildUniverseIndex — duplicate jobs', () => {
|
|
72
|
+
it('keeps the newest job per video regardless of scan order', () => {
|
|
73
|
+
const index = buildUniverseIndex(
|
|
74
|
+
[
|
|
75
|
+
job({ jobId: 'new', videoId: 'v1', status: 'SUCCEEDED', updatedAt: '2026-07-08T00:00:00Z' }),
|
|
76
|
+
job({ jobId: 'old', videoId: 'v1', status: 'FAILED', updatedAt: '2026-07-01T00:00:00Z' }),
|
|
77
|
+
],
|
|
78
|
+
[],
|
|
79
|
+
[],
|
|
80
|
+
);
|
|
81
|
+
expect(index.videos).toHaveLength(1);
|
|
82
|
+
expect(index.videos[0].status).toBe('SUCCEEDED');
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
describe('videoRelations', () => {
|
|
87
|
+
it('returns direct + series documents and canon-ordered siblings', () => {
|
|
88
|
+
const index = buildUniverseIndex(
|
|
89
|
+
[
|
|
90
|
+
job({ videoId: 'v1', seriesId: 's1', episodeNumber: 2 }),
|
|
91
|
+
job({ videoId: 'v2', seriesId: 's1', episodeNumber: 1 }),
|
|
92
|
+
job({ videoId: 'v9', seriesId: 's2', episodeNumber: 1 }),
|
|
93
|
+
],
|
|
94
|
+
[],
|
|
95
|
+
[doc({ videoId: 'v1' }), doc({ docId: 'd2', seriesId: 's1', title: 'Bible' }), doc({ docId: 'd3', videoId: 'v9' })],
|
|
96
|
+
);
|
|
97
|
+
const v1 = index.videos.find(v => v.videoId === 'v1')!;
|
|
98
|
+
const rel = videoRelations(v1, index);
|
|
99
|
+
expect(rel.documents.map(d => d.docId).sort()).toEqual(['d1', 'd2']);
|
|
100
|
+
expect(rel.seriesSiblings.map(s => s.videoId)).toEqual(['v2']);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('mergeGraphRelations (CUR.1b seam 6)', () => {
|
|
105
|
+
const dock = {
|
|
106
|
+
documents: [] as ReturnType<typeof buildUniverseIndex>['documents'],
|
|
107
|
+
seriesSiblings: [] as ReturnType<typeof buildUniverseIndex>['videos'],
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
it('folds the graph signal in additively', () => {
|
|
111
|
+
const merged = mergeGraphRelations(dock, {
|
|
112
|
+
traceId: 't',
|
|
113
|
+
videoId: 'v1',
|
|
114
|
+
shared: [
|
|
115
|
+
{
|
|
116
|
+
entityId: 'e1',
|
|
117
|
+
name: 'Elena Voss',
|
|
118
|
+
type: 'character',
|
|
119
|
+
hereMentions: 4,
|
|
120
|
+
elsewhere: [{ videoId: 'v2', mentionCount: 2 }],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
relationships: [{ subject: 'Elena Voss', label: 'ALLY_OF', object: 'Marcus' }],
|
|
124
|
+
});
|
|
125
|
+
expect(merged.sharedEntities).toHaveLength(1);
|
|
126
|
+
expect(merged.sharedEntities[0].elsewhere[0].videoId).toBe('v2');
|
|
127
|
+
expect(merged.relationships[0].label).toBe('ALLY_OF');
|
|
128
|
+
expect(merged.documents).toBe(dock.documents);
|
|
129
|
+
expect(merged.seriesSiblings).toBe(dock.seriesSiblings);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('degrades gracefully on a null response (endpoint 4xx / graph dark)', () => {
|
|
133
|
+
const merged = mergeGraphRelations(dock, null);
|
|
134
|
+
expect(merged.sharedEntities).toEqual([]);
|
|
135
|
+
expect(merged.relationships).toEqual([]);
|
|
136
|
+
expect(merged.documents).toBe(dock.documents);
|
|
137
|
+
});
|
|
138
|
+
});
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* §Q GROUND.52h — THE classification rule, swept over every outcome class a
|
|
3
|
+
* curation write can end in.
|
|
4
|
+
*
|
|
5
|
+
* The rule's whole job is to decide invalidation from the shape of a thrown
|
|
6
|
+
* value, so the honest test is exhaustive over shapes rather than illustrative.
|
|
7
|
+
* Each case names WHY it lands where it does; a status moved between buckets by
|
|
8
|
+
* accident fails here with the reason attached.
|
|
9
|
+
*
|
|
10
|
+
* RED-FIRST (measured): with `classifyWriteFailure` short-circuited to the
|
|
11
|
+
* pre-row behaviour — `return CURATION_WRITE_FAILURE.REFUSED` as its first
|
|
12
|
+
* statement, which is exactly what "a failure never invalidates" meant — **32
|
|
13
|
+
* of these 42 assertions fail**, including every AMBIGUOUS and every STALE
|
|
14
|
+
* case. Restored, all 42 pass.
|
|
15
|
+
*/
|
|
16
|
+
import {
|
|
17
|
+
CURATION_WRITE_FAILURE,
|
|
18
|
+
classifyWriteFailure,
|
|
19
|
+
shouldInvalidateAfterFailure,
|
|
20
|
+
} from '../curationWrite';
|
|
21
|
+
|
|
22
|
+
/** An error exactly as `requestJson` throws it: message plus `.status`. */
|
|
23
|
+
const httpError = (status: number): Error & { status: number } =>
|
|
24
|
+
Object.assign(new Error(`Request failed: ${status}`), { status });
|
|
25
|
+
|
|
26
|
+
const AMBIGUOUS = CURATION_WRITE_FAILURE.AMBIGUOUS;
|
|
27
|
+
const STALE = CURATION_WRITE_FAILURE.STALE;
|
|
28
|
+
const REFUSED = CURATION_WRITE_FAILURE.REFUSED;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The sweep. `why` is not decoration — it is the reason a reviewer can check
|
|
32
|
+
* the bucket against, and it prints on failure.
|
|
33
|
+
*/
|
|
34
|
+
const CASES: ReadonlyArray<{
|
|
35
|
+
name: string;
|
|
36
|
+
err: unknown;
|
|
37
|
+
kind: string;
|
|
38
|
+
why: string;
|
|
39
|
+
}> = [
|
|
40
|
+
// ---- AMBIGUOUS: no response at all ------------------------------------
|
|
41
|
+
{
|
|
42
|
+
name: 'a network error (TypeError from fetch)',
|
|
43
|
+
err: new TypeError('Failed to fetch'),
|
|
44
|
+
kind: AMBIGUOUS,
|
|
45
|
+
why: 'the request left the client; whether the handler ran is unknowable here',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'an abort',
|
|
49
|
+
err: Object.assign(new Error('The operation was aborted.'), { name: 'AbortError' }),
|
|
50
|
+
kind: AMBIGUOUS,
|
|
51
|
+
why: 'aborting the client read does not un-run a handler that already committed',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'a client-side timeout',
|
|
55
|
+
err: new Error('timeout of 30000ms exceeded'),
|
|
56
|
+
kind: AMBIGUOUS,
|
|
57
|
+
why: 'the deadline is ours; the server may still have applied the write',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'an unparseable body on a 2xx',
|
|
61
|
+
err: new SyntaxError('Unexpected token < in JSON at position 0'),
|
|
62
|
+
kind: AMBIGUOUS,
|
|
63
|
+
why: 'response.json() threw AFTER a 2xx — the write landed and only the answer was lost',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'a non-Error throw',
|
|
67
|
+
err: 'something went wrong',
|
|
68
|
+
kind: AMBIGUOUS,
|
|
69
|
+
why: 'no status to read, so "we cannot tell" is the classification',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'a null rejection',
|
|
73
|
+
err: null,
|
|
74
|
+
kind: AMBIGUOUS,
|
|
75
|
+
why: 'same as above — the absence of information is the ambiguous outcome',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'an error whose status is not a number',
|
|
79
|
+
err: Object.assign(new Error('weird'), { status: 'nope' }),
|
|
80
|
+
kind: AMBIGUOUS,
|
|
81
|
+
why: 'an unreadable status is no status; it must not be trusted into a bucket',
|
|
82
|
+
},
|
|
83
|
+
// ---- AMBIGUOUS: 5xx ----------------------------------------------------
|
|
84
|
+
{
|
|
85
|
+
name: 'a 500',
|
|
86
|
+
err: httpError(500),
|
|
87
|
+
kind: AMBIGUOUS,
|
|
88
|
+
why: 'the handler can commit and then fail on the way out',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'a 502',
|
|
92
|
+
err: httpError(502),
|
|
93
|
+
kind: AMBIGUOUS,
|
|
94
|
+
why: 'an intermediary that never saw the outcome either',
|
|
95
|
+
},
|
|
96
|
+
{ name: 'a 503', err: httpError(503), kind: AMBIGUOUS, why: 'same as 502' },
|
|
97
|
+
{
|
|
98
|
+
name: 'a 504',
|
|
99
|
+
err: httpError(504),
|
|
100
|
+
kind: AMBIGUOUS,
|
|
101
|
+
why: 'the gateway gave up waiting; the handler did not necessarily give up working',
|
|
102
|
+
},
|
|
103
|
+
// ---- STALE: a refusal that is itself news ------------------------------
|
|
104
|
+
{
|
|
105
|
+
name: 'a 404',
|
|
106
|
+
err: httpError(404),
|
|
107
|
+
kind: STALE,
|
|
108
|
+
why: 'the id we addressed is gone — re-keyed by a rename, absorbed by a merge',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'a 409',
|
|
112
|
+
err: httpError(409),
|
|
113
|
+
kind: STALE,
|
|
114
|
+
why: '"is already bound to cluster" — the server knows a state we do not',
|
|
115
|
+
},
|
|
116
|
+
{ name: 'a 410', err: httpError(410), kind: STALE, why: 'gone; our copy is provably stale' },
|
|
117
|
+
{
|
|
118
|
+
name: 'a 412',
|
|
119
|
+
err: httpError(412),
|
|
120
|
+
kind: STALE,
|
|
121
|
+
why: 'a precondition we believed holds no longer',
|
|
122
|
+
},
|
|
123
|
+
// ---- REFUSED: nothing committed and nothing learned --------------------
|
|
124
|
+
{
|
|
125
|
+
name: 'a 400',
|
|
126
|
+
err: httpError(400),
|
|
127
|
+
kind: REFUSED,
|
|
128
|
+
why: 'malformed request — a full graph re-read per typo is the cost this bucket avoids',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'a 401',
|
|
132
|
+
err: httpError(401),
|
|
133
|
+
kind: REFUSED,
|
|
134
|
+
why: 'unauthenticated; re-reading would fail the same way',
|
|
135
|
+
},
|
|
136
|
+
{ name: 'a 403', err: httpError(403), kind: REFUSED, why: 'forbidden; nothing changed' },
|
|
137
|
+
{
|
|
138
|
+
name: 'a 422',
|
|
139
|
+
err: httpError(422),
|
|
140
|
+
kind: REFUSED,
|
|
141
|
+
why: 'validation refused it before any write',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'a 429',
|
|
145
|
+
err: httpError(429),
|
|
146
|
+
kind: REFUSED,
|
|
147
|
+
why: 'rate limited — never executed, and re-reading spends the budget it just refused',
|
|
148
|
+
},
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
describe('classifyWriteFailure — the one rule, over every outcome class', () => {
|
|
152
|
+
it.each(CASES)('$name is $kind ($why)', ({ err, kind }) => {
|
|
153
|
+
expect(classifyWriteFailure(err)).toBe(kind);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it.each(CASES)('$name invalidates iff it is not a plain refusal', ({ err, kind }) => {
|
|
157
|
+
expect(shouldInvalidateAfterFailure(err)).toBe(kind !== REFUSED);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('covers every 4xx and 5xx status the routes can emit, with no unclassified gap', () => {
|
|
161
|
+
// A sweep rather than a spot check: an off-by-one in the bucket boundaries
|
|
162
|
+
// (`>= 500`, `>= 400`) would leave a status classified as AMBIGUOUS by the
|
|
163
|
+
// sub-400 fallthrough, which is the wrong reason for the right answer.
|
|
164
|
+
for (let status = 400; status < 600; status += 1) {
|
|
165
|
+
const kind = classifyWriteFailure(httpError(status));
|
|
166
|
+
if (status >= 500) expect(kind).toBe(AMBIGUOUS);
|
|
167
|
+
else if ([404, 409, 410, 412].includes(status)) expect(kind).toBe(STALE);
|
|
168
|
+
else expect(kind).toBe(REFUSED);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('a 2xx that still threw is AMBIGUOUS, not refused', () => {
|
|
173
|
+
// `requestJson` only attaches `.status` on a non-ok response, so a sub-400
|
|
174
|
+
// status on a thrown error means the failure happened AFTER a success.
|
|
175
|
+
expect(classifyWriteFailure(Object.assign(new Error('bad body'), { status: 200 }))).toBe(
|
|
176
|
+
AMBIGUOUS,
|
|
177
|
+
);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the generic decision-log surface on `ApiClient` (§Q W2.16b/W2.16e
|
|
3
|
+
* — reversibility contract RC-8): `getDecisions` (scope read + the additive
|
|
4
|
+
* `runId` run-log projection param) and `revertDecision`. Same
|
|
5
|
+
* global-fetch-mock pattern as `workflows.test.ts` — endpoints live on the
|
|
6
|
+
* tools/ingestion API (baseUrl), NOT the chat API.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { ApiClient, type ListDecisionsResponse, type RevertDecisionResponse } from '../api';
|
|
10
|
+
|
|
11
|
+
const TEST_BASE_URL = 'http://test.local';
|
|
12
|
+
const TEST_CHAT_BASE_URL = 'http://test.local/chat';
|
|
13
|
+
|
|
14
|
+
const makeClient = (sessionToken: string = 'test-token') =>
|
|
15
|
+
new ApiClient(TEST_BASE_URL, sessionToken, TEST_CHAT_BASE_URL);
|
|
16
|
+
|
|
17
|
+
const originalFetch = (globalThis as { fetch?: typeof fetch }).fetch;
|
|
18
|
+
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
if (originalFetch === undefined) {
|
|
21
|
+
delete (globalThis as { fetch?: typeof fetch }).fetch;
|
|
22
|
+
} else {
|
|
23
|
+
(globalThis as { fetch?: typeof fetch }).fetch = originalFetch;
|
|
24
|
+
}
|
|
25
|
+
jest.restoreAllMocks();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const mockFetchOnce = (body: unknown, init: { ok?: boolean; status?: number } = {}) => {
|
|
29
|
+
const fetchMock = jest.fn().mockResolvedValue({
|
|
30
|
+
ok: init.ok ?? true,
|
|
31
|
+
status: init.status ?? 200,
|
|
32
|
+
json: async () => body,
|
|
33
|
+
});
|
|
34
|
+
(globalThis as { fetch?: typeof fetch }).fetch = fetchMock as unknown as typeof fetch;
|
|
35
|
+
return fetchMock;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const listBody: ListDecisionsResponse = {
|
|
39
|
+
traceId: 'trace-1',
|
|
40
|
+
scopeType: 'PROJECT',
|
|
41
|
+
scopeId: 'proj-1',
|
|
42
|
+
decisions: [],
|
|
43
|
+
nextToken: null,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
describe('ApiClient.getDecisions', () => {
|
|
47
|
+
it('GETs the scope page on the tools base', async () => {
|
|
48
|
+
const fetchMock = mockFetchOnce(listBody);
|
|
49
|
+
const res = await makeClient().getDecisions('PROJECT', 'proj-1', { limit: 10 });
|
|
50
|
+
expect(res).toEqual(listBody);
|
|
51
|
+
const [url, init] = fetchMock.mock.calls[0];
|
|
52
|
+
expect(url).toBe(`${TEST_BASE_URL}/api/v1/decisions?scope=PROJECT%3Aproj-1&limit=10`);
|
|
53
|
+
expect((init as RequestInit).method ?? 'GET').toBe('GET');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('threads the additive runId run-log projection param (W2.16e)', async () => {
|
|
57
|
+
const fetchMock = mockFetchOnce(listBody);
|
|
58
|
+
await makeClient().getDecisions('PROJECT', 'proj-1', { limit: 25, runId: 'run-42' });
|
|
59
|
+
const [url] = fetchMock.mock.calls[0];
|
|
60
|
+
expect(url).toBe(
|
|
61
|
+
`${TEST_BASE_URL}/api/v1/decisions?scope=PROJECT%3Aproj-1&limit=25&runId=run-42`,
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('omits runId (wire shape unchanged) when the param is absent', async () => {
|
|
66
|
+
const fetchMock = mockFetchOnce(listBody);
|
|
67
|
+
await makeClient().getDecisions('PROJECT', 'proj-1');
|
|
68
|
+
const [url] = fetchMock.mock.calls[0];
|
|
69
|
+
expect(url).toBe(`${TEST_BASE_URL}/api/v1/decisions?scope=PROJECT%3Aproj-1`);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('ApiClient.revertDecision', () => {
|
|
74
|
+
it('POSTs the individual decision revert route', async () => {
|
|
75
|
+
const body: RevertDecisionResponse = {
|
|
76
|
+
traceId: 'trace-2',
|
|
77
|
+
scopeType: 'PROJECT',
|
|
78
|
+
scopeId: 'proj-1',
|
|
79
|
+
decisionId: 'dec-1',
|
|
80
|
+
compensatingDecisionId: 'dec-2',
|
|
81
|
+
};
|
|
82
|
+
const fetchMock = mockFetchOnce(body, { status: 202 });
|
|
83
|
+
const res = await makeClient().revertDecision('PROJECT', 'proj-1', 'dec-1');
|
|
84
|
+
expect(res).toEqual(body);
|
|
85
|
+
const [url, init] = fetchMock.mock.calls[0];
|
|
86
|
+
expect(url).toBe(`${TEST_BASE_URL}/api/v1/decisions/PROJECT/proj-1/dec-1/revert`);
|
|
87
|
+
expect((init as RequestInit).method).toBe('POST');
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LIGHT_TOKENS,
|
|
3
|
+
DARK_TOKENS,
|
|
4
|
+
cssVarName,
|
|
5
|
+
toCssVars,
|
|
6
|
+
type DesignTokenKey,
|
|
7
|
+
} from '../designTokens';
|
|
8
|
+
|
|
9
|
+
const KEYS: DesignTokenKey[] = [
|
|
10
|
+
'color-app-bg',
|
|
11
|
+
'color-surface',
|
|
12
|
+
'color-surface-muted',
|
|
13
|
+
'color-surface-elevated',
|
|
14
|
+
'color-border',
|
|
15
|
+
'color-border-strong',
|
|
16
|
+
'color-text-strong',
|
|
17
|
+
'color-text',
|
|
18
|
+
'color-text-muted',
|
|
19
|
+
'color-text-subtle',
|
|
20
|
+
'color-placeholder',
|
|
21
|
+
'color-accent',
|
|
22
|
+
'color-accent-strong',
|
|
23
|
+
'color-accent-soft',
|
|
24
|
+
'color-focus',
|
|
25
|
+
'color-success',
|
|
26
|
+
'color-success-soft',
|
|
27
|
+
'color-danger',
|
|
28
|
+
'color-danger-soft',
|
|
29
|
+
'color-warning',
|
|
30
|
+
'color-warning-soft',
|
|
31
|
+
'color-badge',
|
|
32
|
+
'gradient-cta',
|
|
33
|
+
'gradient-active',
|
|
34
|
+
'shadow-glass',
|
|
35
|
+
'glass-bg',
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
describe('designTokens — shared escape palette (#459)', () => {
|
|
39
|
+
it('both theme maps cover the complete key set', () => {
|
|
40
|
+
expect(Object.keys(LIGHT_TOKENS).sort()).toEqual([...KEYS].sort());
|
|
41
|
+
expect(Object.keys(DARK_TOKENS).sort()).toEqual([...KEYS].sort());
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('dark theme inherits cross-theme brand keys from light (no drift)', () => {
|
|
45
|
+
// The brand gradients + glass shadow are cross-theme: dark must NOT change
|
|
46
|
+
// them (it only overrides glass-bg + the semantic colors).
|
|
47
|
+
expect(DARK_TOKENS['gradient-cta']).toBe(LIGHT_TOKENS['gradient-cta']);
|
|
48
|
+
expect(DARK_TOKENS['gradient-active']).toBe(LIGHT_TOKENS['gradient-active']);
|
|
49
|
+
expect(DARK_TOKENS['shadow-glass']).toBe(LIGHT_TOKENS['shadow-glass']);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('dark theme actually re-values the surface/text/accent system', () => {
|
|
53
|
+
expect(DARK_TOKENS['color-surface']).not.toBe(LIGHT_TOKENS['color-surface']);
|
|
54
|
+
expect(DARK_TOKENS['color-text-strong']).not.toBe(LIGHT_TOKENS['color-text-strong']);
|
|
55
|
+
expect(DARK_TOKENS['color-accent']).not.toBe(LIGHT_TOKENS['color-accent']);
|
|
56
|
+
expect(DARK_TOKENS['glass-bg']).not.toBe(LIGHT_TOKENS['glass-bg']);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('cssVarName prefixes every key with --', () => {
|
|
60
|
+
expect(cssVarName('color-surface')).toBe('--color-surface');
|
|
61
|
+
expect(cssVarName('gradient-cta')).toBe('--gradient-cta');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('toCssVars projects a map to --var keys with identical values', () => {
|
|
65
|
+
const vars = toCssVars(LIGHT_TOKENS);
|
|
66
|
+
expect(vars['--color-surface']).toBe('#ffffff');
|
|
67
|
+
expect(vars['--color-accent']).toBe('#2563eb');
|
|
68
|
+
// Every key projects, none lost.
|
|
69
|
+
expect(Object.keys(vars)).toHaveLength(KEYS.length);
|
|
70
|
+
for (const k of KEYS) expect(vars[`--${k}`]).toBe(LIGHT_TOKENS[k]);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* §Q GROUND.148 — the read side of the per-LINE re-attribution door.
|
|
3
|
+
*
|
|
4
|
+
* The payloads here are the SHAPE `GET /graph/{videoId}` actually served for
|
|
5
|
+
* `e10-02-the-abyss-andres-aloi` on 2026-08-21 (84 DialogLine nodes, 23
|
|
6
|
+
* SPOKEN_BY edges, 6 Entity nodes of which 2 are characters and the rest are
|
|
7
|
+
* locations) — measured before this projection was written, because a panel
|
|
8
|
+
* built on a guessed payload is a panel that renders nothing live.
|
|
9
|
+
*/
|
|
10
|
+
import { dialogAttributionView, filterDialogAttributionRows } from '../dialogAttribution';
|
|
11
|
+
import { mayGroundCharacterByHand } from '../characterGrounding';
|
|
12
|
+
import type { CharacterGrounding } from '../characterGrounding';
|
|
13
|
+
import { parseTimestamp, formatTimestamp } from '../timeFormat';
|
|
14
|
+
import type { VideoGraphResponse } from '../api';
|
|
15
|
+
|
|
16
|
+
const entity = (id: string, name: string, type: string) => ({
|
|
17
|
+
id: `Entity:entityId:${id}`,
|
|
18
|
+
label: 'Entity',
|
|
19
|
+
properties: { entityId: id, name, type },
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const line = (id: string, text: string, t0: number, speaker: string) => ({
|
|
23
|
+
id: `DialogLine:dialogId:${id}`,
|
|
24
|
+
label: 'DialogLine',
|
|
25
|
+
properties: { dialogId: id, text, t0, t1: t0 + 1, speaker },
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const GRAPH = {
|
|
29
|
+
traceId: 't',
|
|
30
|
+
videoId: 'e10-02-the-abyss-andres-aloi',
|
|
31
|
+
nodes: [
|
|
32
|
+
entity('iris', 'Iris', 'character'),
|
|
33
|
+
entity('travis', 'Travis', 'character'),
|
|
34
|
+
entity('lake', 'lake', 'location'),
|
|
35
|
+
line('d2', 'Actually', 57.6, 'spk_0'),
|
|
36
|
+
line('d1', 'Reflections pull you out', 54.09, 'spk_0'),
|
|
37
|
+
line('d3', 'We are not sure', 59.02, 'spk_1'),
|
|
38
|
+
],
|
|
39
|
+
edges: [
|
|
40
|
+
{
|
|
41
|
+
id: 'e1',
|
|
42
|
+
source: 'DialogLine:dialogId:d1',
|
|
43
|
+
target: 'Entity:entityId:iris',
|
|
44
|
+
type: 'SPOKEN_BY',
|
|
45
|
+
properties: {},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
} as unknown as VideoGraphResponse;
|
|
49
|
+
|
|
50
|
+
describe('dialogAttributionView (§Q GROUND.148)', () => {
|
|
51
|
+
it('orders lines by start time, not by the order the graph returned them', () => {
|
|
52
|
+
expect(dialogAttributionView(GRAPH).rows.map((r) => r.dialogId)).toEqual([
|
|
53
|
+
'd1',
|
|
54
|
+
'd2',
|
|
55
|
+
'd3',
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('KNOWN-BAD SHAPE: an UNATTRIBUTED line is still offered — 61 of 84 on the measured video', () => {
|
|
60
|
+
// A panel that listed only lines carrying a SPOKEN_BY edge would hide the
|
|
61
|
+
// majority, and the unplaced ones are exactly what no other door can fix.
|
|
62
|
+
const rows = dialogAttributionView(GRAPH).rows;
|
|
63
|
+
expect(rows).toHaveLength(3);
|
|
64
|
+
expect(rows.filter((r) => r.speaker === null)).toHaveLength(2);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('resolves the speaker through the edge endpoint, which is the COMPOSITE node id', () => {
|
|
68
|
+
const [first] = dialogAttributionView(GRAPH).rows;
|
|
69
|
+
expect(first!.speaker).toEqual({ entityId: 'iris', name: 'Iris' });
|
|
70
|
+
// …and the entity id the door takes is the BARE pk, never the composite —
|
|
71
|
+
// #1816's P1 in the other direction.
|
|
72
|
+
expect(first!.speaker!.entityId).toBe('iris');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('carries the diarization label separately from the speaker, never as one', () => {
|
|
76
|
+
const rows = dialogAttributionView(GRAPH).rows;
|
|
77
|
+
expect(rows[1]!.speakerLabel).toBe('spk_0');
|
|
78
|
+
expect(rows[1]!.speaker).toBeNull();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('offers only CHARACTERS as attribution targets — a location is not a speaker', () => {
|
|
82
|
+
expect(dialogAttributionView(GRAPH).cast).toEqual([
|
|
83
|
+
{ entityId: 'iris', name: 'Iris' },
|
|
84
|
+
{ entityId: 'travis', name: 'Travis' },
|
|
85
|
+
]);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('returns empty views for a missing or empty graph rather than throwing', () => {
|
|
89
|
+
expect(dialogAttributionView(null)).toEqual({ rows: [], cast: [] });
|
|
90
|
+
expect(
|
|
91
|
+
dialogAttributionView({ nodes: [], edges: [] } as unknown as VideoGraphResponse),
|
|
92
|
+
).toEqual({ rows: [], cast: [] });
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe('filterDialogAttributionRows (§Q GROUND.148)', () => {
|
|
97
|
+
const rows = dialogAttributionView(GRAPH).rows;
|
|
98
|
+
|
|
99
|
+
it('finds a line by what was SAID — how a curator remembers the wrong one', () => {
|
|
100
|
+
expect(filterDialogAttributionRows(rows, 'reflections').map((r) => r.dialogId)).toEqual([
|
|
101
|
+
'd1',
|
|
102
|
+
]);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('matches the attributed name and the diarization label too', () => {
|
|
106
|
+
expect(filterDialogAttributionRows(rows, 'iris').map((r) => r.dialogId)).toEqual(['d1']);
|
|
107
|
+
expect(filterDialogAttributionRows(rows, 'spk_1').map((r) => r.dialogId)).toEqual(['d3']);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('an empty query keeps every row', () => {
|
|
111
|
+
expect(filterDialogAttributionRows(rows, ' ')).toHaveLength(rows.length);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('parseTimestamp (§Q GROUND.148 — the manual-grounding door takes an instant)', () => {
|
|
116
|
+
it('round-trips what the formatter emits', () => {
|
|
117
|
+
for (const seconds of [0, 32, 65, 3725]) {
|
|
118
|
+
expect(parseTimestamp(formatTimestamp(seconds))).toBe(seconds);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('reads a BARE number as seconds, and accepts a fraction', () => {
|
|
123
|
+
expect(parseTimestamp('90')).toBe(90);
|
|
124
|
+
expect(parseTimestamp('42.34')).toBeCloseTo(42.34, 5);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('refuses what is not an instant, rather than guessing one', () => {
|
|
128
|
+
// A guessed instant grounds a character on the wrong frame — a silent wrong
|
|
129
|
+
// answer where a refusal is cheap.
|
|
130
|
+
for (const bad of ['', ' ', 'soon', '1:75', '-5', '1:2:3:4', null, undefined]) {
|
|
131
|
+
expect(parseTimestamp(bad as string)).toBeNull();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
describe('mayGroundCharacterByHand (§Q GROUND.148(b))', () => {
|
|
137
|
+
const grounding = (over: Partial<CharacterGrounding>): CharacterGrounding => ({
|
|
138
|
+
entityId: 'e1',
|
|
139
|
+
level: 'absent',
|
|
140
|
+
assertedBy: 'model',
|
|
141
|
+
characterClass: null,
|
|
142
|
+
weakOverride: false,
|
|
143
|
+
appearanceDescription: null,
|
|
144
|
+
graded: true,
|
|
145
|
+
...over,
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('OFFERS it on a graded ABSENT row — §Q GROUND.71\'s whole population', () => {
|
|
149
|
+
expect(mayGroundCharacterByHand(grounding({ level: 'absent' }))).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('OFFERS it again on a row THIS DOOR grounded — the server accepts a second instant', () => {
|
|
153
|
+
// weak + human + non_facial is exactly what a manual grounding writes, and
|
|
154
|
+
// it leaves NO presence cluster, so the 409 arm does not apply. Hiding the
|
|
155
|
+
// door here would make the first instant a curator picked permanently
|
|
156
|
+
// uncorrectable (codex on #1998).
|
|
157
|
+
expect(
|
|
158
|
+
mayGroundCharacterByHand(
|
|
159
|
+
grounding({ level: 'weak', assertedBy: 'human', characterClass: 'non_facial' }),
|
|
160
|
+
),
|
|
161
|
+
).toBe(true);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('WITHHOLDS it from a machine binding — that implies the cluster the server refuses over', () => {
|
|
165
|
+
expect(mayGroundCharacterByHand(grounding({ level: 'weak', assertedBy: 'model' }))).toBe(
|
|
166
|
+
false,
|
|
167
|
+
);
|
|
168
|
+
expect(
|
|
169
|
+
mayGroundCharacterByHand(grounding({ level: 'verified', assertedBy: 'model' })),
|
|
170
|
+
).toBe(false);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it('WITHHOLDS it from a HUMAN-NAMED FACE — that character has a cluster', () => {
|
|
174
|
+
// The §13.6 naming door binds a real face cluster and also writes HUMAN
|
|
175
|
+
// provenance; the class is what tells the two human assertions apart.
|
|
176
|
+
expect(
|
|
177
|
+
mayGroundCharacterByHand(
|
|
178
|
+
grounding({ level: 'verified', assertedBy: 'human', characterClass: 'on_screen' }),
|
|
179
|
+
),
|
|
180
|
+
).toBe(false);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('WITHHOLDS it from an UNGRADED character — the write would 404', () => {
|
|
184
|
+
expect(mayGroundCharacterByHand(grounding({ graded: false }))).toBe(false);
|
|
185
|
+
expect(mayGroundCharacterByHand(null)).toBe(false);
|
|
186
|
+
});
|
|
187
|
+
});
|