@escapeaihq/client-core 0.52.0 → 0.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +445 -153
- package/dist/adapters/capabilities.d.ts +20 -3
- package/dist/adapters/capabilities.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.d.ts +5 -4
- package/dist/adapters/directorAdapter.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.js +5 -4
- package/dist/adapters/directorAdapter.js.map +1 -1
- package/dist/adapters/experienceModelCatalog.d.ts +382 -0
- package/dist/adapters/experienceModelCatalog.d.ts.map +1 -0
- package/dist/adapters/experienceModelCatalog.js +401 -0
- package/dist/adapters/experienceModelCatalog.js.map +1 -0
- package/dist/adapters/extractionAdapter.d.ts +81 -0
- package/dist/adapters/extractionAdapter.d.ts.map +1 -0
- package/dist/adapters/extractionAdapter.js +98 -0
- package/dist/adapters/extractionAdapter.js.map +1 -0
- package/dist/adapters/imageAdapter.d.ts +5 -1
- package/dist/adapters/imageAdapter.d.ts.map +1 -1
- package/dist/adapters/imageAdapter.js +5 -1
- package/dist/adapters/imageAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +54 -16
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +62 -11
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/momentDirective.d.ts +66 -0
- package/dist/adapters/momentDirective.d.ts.map +1 -0
- package/dist/adapters/momentDirective.js +78 -0
- package/dist/adapters/momentDirective.js.map +1 -0
- package/dist/adapters/momentPolicy.d.ts +132 -0
- package/dist/adapters/momentPolicy.d.ts.map +1 -0
- package/dist/adapters/momentPolicy.js +165 -0
- package/dist/adapters/momentPolicy.js.map +1 -0
- package/dist/adapters/registry.d.ts +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/videoGenAdapter.d.ts +55 -0
- package/dist/adapters/videoGenAdapter.d.ts.map +1 -0
- package/dist/adapters/videoGenAdapter.js +78 -0
- package/dist/adapters/videoGenAdapter.js.map +1 -0
- package/dist/adapters/worldAdapter.d.ts +132 -11
- package/dist/adapters/worldAdapter.d.ts.map +1 -1
- package/dist/adapters/worldAdapter.js +127 -11
- package/dist/adapters/worldAdapter.js.map +1 -1
- package/dist/adapters/worldModelPreference.d.ts +173 -0
- package/dist/adapters/worldModelPreference.d.ts.map +1 -0
- package/dist/adapters/worldModelPreference.js +209 -0
- package/dist/adapters/worldModelPreference.js.map +1 -0
- package/dist/adapters/worldModelTradeoffs.d.ts +120 -0
- package/dist/adapters/worldModelTradeoffs.d.ts.map +1 -0
- package/dist/adapters/worldModelTradeoffs.js +154 -0
- package/dist/adapters/worldModelTradeoffs.js.map +1 -0
- package/dist/admin.d.ts +545 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +230 -16
- package/dist/admin.js.map +1 -1
- package/dist/api.d.ts +10281 -2216
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4174 -1240
- package/dist/api.js.map +1 -1
- package/dist/arcBoardJoin.d.ts +38 -0
- package/dist/arcBoardJoin.d.ts.map +1 -0
- package/dist/arcBoardJoin.js +37 -0
- package/dist/arcBoardJoin.js.map +1 -0
- package/dist/arcPreview.d.ts +49 -0
- package/dist/arcPreview.d.ts.map +1 -0
- package/dist/arcPreview.js +65 -0
- package/dist/arcPreview.js.map +1 -0
- package/dist/audio.d.ts +259 -16
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +605 -114
- package/dist/audio.js.map +1 -1
- package/dist/audioDsp.d.ts +45 -0
- package/dist/audioDsp.d.ts.map +1 -0
- package/dist/audioDsp.js +108 -0
- package/dist/audioDsp.js.map +1 -0
- package/dist/audioProtocol.d.ts +160 -0
- package/dist/audioProtocol.d.ts.map +1 -1
- package/dist/audioProtocol.js +99 -0
- package/dist/audioProtocol.js.map +1 -1
- package/dist/beatTitles.d.ts +33 -0
- package/dist/beatTitles.d.ts.map +1 -0
- package/dist/beatTitles.js +39 -0
- package/dist/beatTitles.js.map +1 -0
- package/dist/castProjection.d.ts +204 -1
- package/dist/castProjection.d.ts.map +1 -1
- package/dist/castProjection.js +202 -0
- package/dist/castProjection.js.map +1 -1
- package/dist/characterGrounding.d.ts +369 -0
- package/dist/characterGrounding.d.ts.map +1 -0
- package/dist/characterGrounding.js +408 -0
- package/dist/characterGrounding.js.map +1 -0
- package/dist/conversation/binding.d.ts +13 -0
- package/dist/conversation/binding.d.ts.map +1 -1
- package/dist/conversation/binding.js.map +1 -1
- package/dist/conversation/chatSessionStore.d.ts +178 -0
- package/dist/conversation/chatSessionStore.d.ts.map +1 -0
- package/dist/conversation/chatSessionStore.js +196 -0
- package/dist/conversation/chatSessionStore.js.map +1 -0
- package/dist/conversation/controller.d.ts +44 -0
- package/dist/conversation/controller.d.ts.map +1 -1
- package/dist/conversation/controller.js +82 -3
- package/dist/conversation/controller.js.map +1 -1
- package/dist/conversation/index.d.ts +2 -0
- package/dist/conversation/index.d.ts.map +1 -1
- package/dist/conversation/index.js +2 -0
- package/dist/conversation/index.js.map +1 -1
- package/dist/conversation/participant.d.ts +16 -0
- package/dist/conversation/participant.d.ts.map +1 -1
- package/dist/conversation/readSequencer.d.ts +38 -0
- package/dist/conversation/readSequencer.d.ts.map +1 -0
- package/dist/conversation/readSequencer.js +42 -0
- package/dist/conversation/readSequencer.js.map +1 -0
- package/dist/conversation/roster.d.ts +5 -1
- package/dist/conversation/roster.d.ts.map +1 -1
- package/dist/conversation/roster.js.map +1 -1
- package/dist/conversation/rosterProjection.d.ts +74 -1
- package/dist/conversation/rosterProjection.d.ts.map +1 -1
- package/dist/conversation/rosterProjection.js +135 -1
- package/dist/conversation/rosterProjection.js.map +1 -1
- package/dist/conversation/runtime.d.ts +20 -3
- package/dist/conversation/runtime.d.ts.map +1 -1
- package/dist/conversation/runtime.js +66 -7
- package/dist/conversation/runtime.js.map +1 -1
- package/dist/conversation/types.d.ts +43 -4
- package/dist/conversation/types.d.ts.map +1 -1
- package/dist/conversation/voice.d.ts +290 -13
- package/dist/conversation/voice.d.ts.map +1 -1
- package/dist/conversation/voice.js +565 -42
- package/dist/conversation/voice.js.map +1 -1
- package/dist/creatorCuration.d.ts +134 -0
- package/dist/creatorCuration.d.ts.map +1 -0
- package/dist/creatorCuration.js +228 -0
- package/dist/creatorCuration.js.map +1 -0
- package/dist/creatorDashboard.d.ts +155 -0
- package/dist/creatorDashboard.d.ts.map +1 -0
- package/dist/creatorDashboard.js +237 -0
- package/dist/creatorDashboard.js.map +1 -0
- package/dist/creatorUniverse.d.ts +95 -0
- package/dist/creatorUniverse.d.ts.map +1 -0
- package/dist/creatorUniverse.js +136 -0
- package/dist/creatorUniverse.js.map +1 -0
- package/dist/curationWrite.d.ts +76 -0
- package/dist/curationWrite.d.ts.map +1 -0
- package/dist/curationWrite.js +106 -0
- package/dist/curationWrite.js.map +1 -0
- package/dist/designTokens.d.ts +64 -0
- package/dist/designTokens.d.ts.map +1 -0
- package/dist/designTokens.js +117 -0
- package/dist/designTokens.js.map +1 -0
- package/dist/dialogAttribution.d.ts +79 -0
- package/dist/dialogAttribution.d.ts.map +1 -0
- package/dist/dialogAttribution.js +144 -0
- package/dist/dialogAttribution.js.map +1 -0
- package/dist/dmRunWorldReadiness.d.ts +605 -0
- package/dist/dmRunWorldReadiness.d.ts.map +1 -0
- package/dist/dmRunWorldReadiness.js +775 -0
- package/dist/dmRunWorldReadiness.js.map +1 -0
- package/dist/domains/access.d.ts +32 -0
- package/dist/domains/access.d.ts.map +1 -0
- package/dist/domains/access.js +43 -0
- package/dist/domains/access.js.map +1 -0
- package/dist/domains/adventureDefinitions.d.ts +159 -0
- package/dist/domains/adventureDefinitions.d.ts.map +1 -0
- package/dist/domains/adventureDefinitions.js +168 -0
- package/dist/domains/adventureDefinitions.js.map +1 -0
- package/dist/domains/adventures.d.ts +329 -0
- package/dist/domains/adventures.d.ts.map +1 -0
- package/dist/domains/adventures.js +359 -0
- package/dist/domains/adventures.js.map +1 -0
- package/dist/domains/arcs.d.ts +146 -0
- package/dist/domains/arcs.d.ts.map +1 -0
- package/dist/domains/arcs.js +202 -0
- package/dist/domains/arcs.js.map +1 -0
- package/dist/domains/artifacts.d.ts +259 -0
- package/dist/domains/artifacts.d.ts.map +1 -0
- package/dist/domains/artifacts.js +125 -0
- package/dist/domains/artifacts.js.map +1 -0
- package/dist/domains/chat.d.ts +158 -0
- package/dist/domains/chat.d.ts.map +1 -0
- package/dist/domains/chat.js +224 -0
- package/dist/domains/chat.js.map +1 -0
- package/dist/domains/decisions.d.ts +31 -0
- package/dist/domains/decisions.d.ts.map +1 -0
- package/dist/domains/decisions.js +42 -0
- package/dist/domains/decisions.js.map +1 -0
- package/dist/domains/documents.d.ts +218 -0
- package/dist/domains/documents.d.ts.map +1 -0
- package/dist/domains/documents.js +252 -0
- package/dist/domains/documents.js.map +1 -0
- package/dist/domains/enhancements.d.ts +106 -0
- package/dist/domains/enhancements.d.ts.map +1 -0
- package/dist/domains/enhancements.js +160 -0
- package/dist/domains/enhancements.js.map +1 -0
- package/dist/domains/graph.d.ts +454 -0
- package/dist/domains/graph.d.ts.map +1 -0
- package/dist/domains/graph.js +648 -0
- package/dist/domains/graph.js.map +1 -0
- package/dist/domains/images.d.ts +220 -0
- package/dist/domains/images.d.ts.map +1 -0
- package/dist/domains/images.js +307 -0
- package/dist/domains/images.js.map +1 -0
- package/dist/domains/ingestion.d.ts +312 -0
- package/dist/domains/ingestion.d.ts.map +1 -0
- package/dist/domains/ingestion.js +495 -0
- package/dist/domains/ingestion.js.map +1 -0
- package/dist/domains/me.d.ts +21 -0
- package/dist/domains/me.d.ts.map +1 -0
- package/dist/domains/me.js +23 -0
- package/dist/domains/me.js.map +1 -0
- package/dist/domains/orgs.d.ts +47 -0
- package/dist/domains/orgs.d.ts.map +1 -0
- package/dist/domains/orgs.js +75 -0
- package/dist/domains/orgs.js.map +1 -0
- package/dist/domains/personas.d.ts +135 -0
- package/dist/domains/personas.d.ts.map +1 -0
- package/dist/domains/personas.js +316 -0
- package/dist/domains/personas.js.map +1 -0
- package/dist/domains/projects.d.ts +53 -0
- package/dist/domains/projects.d.ts.map +1 -0
- package/dist/domains/projects.js +94 -0
- package/dist/domains/projects.js.map +1 -0
- package/dist/domains/quests.d.ts +431 -0
- package/dist/domains/quests.d.ts.map +1 -0
- package/dist/domains/quests.js +61 -0
- package/dist/domains/quests.js.map +1 -0
- package/dist/domains/reactor.d.ts +98 -0
- package/dist/domains/reactor.d.ts.map +1 -0
- package/dist/domains/reactor.js +131 -0
- package/dist/domains/reactor.js.map +1 -0
- package/dist/domains/showcase.d.ts +28 -0
- package/dist/domains/showcase.d.ts.map +1 -0
- package/dist/domains/showcase.js +28 -0
- package/dist/domains/showcase.js.map +1 -0
- package/dist/domains/storyboards.d.ts +1253 -0
- package/dist/domains/storyboards.d.ts.map +1 -0
- package/dist/domains/storyboards.js +781 -0
- package/dist/domains/storyboards.js.map +1 -0
- package/dist/domains/studioSettings.d.ts +39 -0
- package/dist/domains/studioSettings.d.ts.map +1 -0
- package/dist/domains/studioSettings.js +80 -0
- package/dist/domains/studioSettings.js.map +1 -0
- package/dist/domains/universes.d.ts +191 -0
- package/dist/domains/universes.d.ts.map +1 -0
- package/dist/domains/universes.js +276 -0
- package/dist/domains/universes.js.map +1 -0
- package/dist/domains/userDefaults.d.ts +18 -0
- package/dist/domains/userDefaults.d.ts.map +1 -0
- package/dist/domains/userDefaults.js +27 -0
- package/dist/domains/userDefaults.js.map +1 -0
- package/dist/domains/visemeBundles.d.ts +262 -0
- package/dist/domains/visemeBundles.d.ts.map +1 -0
- package/dist/domains/visemeBundles.js +373 -0
- package/dist/domains/visemeBundles.js.map +1 -0
- package/dist/domains/workflows.d.ts +142 -0
- package/dist/domains/workflows.d.ts.map +1 -0
- package/dist/domains/workflows.js +245 -0
- package/dist/domains/workflows.js.map +1 -0
- package/dist/enhancementDiff.d.ts +56 -0
- package/dist/enhancementDiff.d.ts.map +1 -0
- package/dist/enhancementDiff.js +110 -0
- package/dist/enhancementDiff.js.map +1 -0
- package/dist/generated/contract.d.ts +372 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +390 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/graphSchema.d.ts +36 -5
- package/dist/graphSchema.d.ts.map +1 -1
- package/dist/graphSchema.js +88 -2
- package/dist/graphSchema.js.map +1 -1
- package/dist/http.d.ts +70 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +263 -11
- package/dist/http.js.map +1 -1
- package/dist/identity.d.ts +81 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +65 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -1
- package/dist/messageContent.d.ts +174 -0
- package/dist/messageContent.d.ts.map +1 -0
- package/dist/messageContent.js +405 -0
- package/dist/messageContent.js.map +1 -0
- package/dist/mutationEpoch.d.ts +83 -0
- package/dist/mutationEpoch.d.ts.map +1 -0
- package/dist/mutationEpoch.js +109 -0
- package/dist/mutationEpoch.js.map +1 -0
- package/dist/obo.d.ts +144 -0
- package/dist/obo.d.ts.map +1 -0
- package/dist/obo.js +135 -0
- package/dist/obo.js.map +1 -0
- package/dist/opusTransport.d.ts +113 -0
- package/dist/opusTransport.d.ts.map +1 -0
- package/dist/opusTransport.js +170 -0
- package/dist/opusTransport.js.map +1 -0
- package/dist/pagination.d.ts +18 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +26 -0
- package/dist/pagination.js.map +1 -0
- package/dist/platformAssistant.d.ts +55 -1
- package/dist/platformAssistant.d.ts.map +1 -1
- package/dist/platformAssistant.js +39 -1
- package/dist/platformAssistant.js.map +1 -1
- package/dist/pollUtils.d.ts +19 -0
- package/dist/pollUtils.d.ts.map +1 -0
- package/dist/pollUtils.js +35 -0
- package/dist/pollUtils.js.map +1 -0
- package/dist/questLog.d.ts +232 -0
- package/dist/questLog.d.ts.map +1 -0
- package/dist/questLog.js +522 -0
- package/dist/questLog.js.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts +300 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.js +401 -0
- package/dist/reactor/dmDirectiveToExperience.js.map +1 -0
- package/dist/reactor/dmSceneControlPrompt.d.ts.map +1 -1
- package/dist/reactor/dmSceneControlPrompt.js +64 -2
- package/dist/reactor/dmSceneControlPrompt.js.map +1 -1
- package/dist/reactor/dmWorldEntry.d.ts +1278 -0
- package/dist/reactor/dmWorldEntry.d.ts.map +1 -0
- package/dist/reactor/dmWorldEntry.js +1396 -0
- package/dist/reactor/dmWorldEntry.js.map +1 -0
- package/dist/reactor/framePromptCompaction.d.ts +223 -0
- package/dist/reactor/framePromptCompaction.d.ts.map +1 -0
- package/dist/reactor/framePromptCompaction.js +393 -0
- package/dist/reactor/framePromptCompaction.js.map +1 -0
- package/dist/reactor/frameWorldBind.d.ts +86 -0
- package/dist/reactor/frameWorldBind.d.ts.map +1 -0
- package/dist/reactor/frameWorldBind.js +79 -0
- package/dist/reactor/frameWorldBind.js.map +1 -0
- package/dist/reactor/happyOysterSeed.d.ts +166 -0
- package/dist/reactor/happyOysterSeed.d.ts.map +1 -0
- package/dist/reactor/happyOysterSeed.js +233 -0
- package/dist/reactor/happyOysterSeed.js.map +1 -0
- package/dist/reactor/happyOysterWalk.d.ts +274 -0
- package/dist/reactor/happyOysterWalk.d.ts.map +1 -0
- package/dist/reactor/happyOysterWalk.js +407 -0
- package/dist/reactor/happyOysterWalk.js.map +1 -0
- package/dist/reactor/happyOysterWorld.d.ts +718 -0
- package/dist/reactor/happyOysterWorld.d.ts.map +1 -0
- package/dist/reactor/happyOysterWorld.js +826 -0
- package/dist/reactor/happyOysterWorld.js.map +1 -0
- package/dist/reactor/heliosCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/heliosCommandDispatcher.js +5 -2
- package/dist/reactor/heliosCommandDispatcher.js.map +1 -1
- package/dist/reactor/hiddenWorldLifecycle.d.ts +101 -0
- package/dist/reactor/hiddenWorldLifecycle.d.ts.map +1 -0
- package/dist/reactor/hiddenWorldLifecycle.js +119 -0
- package/dist/reactor/hiddenWorldLifecycle.js.map +1 -0
- package/dist/reactor/imageCanvas.d.ts +15 -0
- package/dist/reactor/imageCanvas.d.ts.map +1 -0
- package/dist/reactor/imageCanvas.js +33 -0
- package/dist/reactor/imageCanvas.js.map +1 -0
- package/dist/reactor/index.d.ts +19 -0
- package/dist/reactor/index.d.ts.map +1 -1
- package/dist/reactor/index.js +78 -0
- package/dist/reactor/index.js.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.d.ts +23 -8
- package/dist/reactor/longLiveCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.js +16 -4
- package/dist/reactor/longLiveCommandDispatcher.js.map +1 -1
- package/dist/reactor/longLiveSceneEntry.d.ts +203 -0
- package/dist/reactor/longLiveSceneEntry.d.ts.map +1 -0
- package/dist/reactor/longLiveSceneEntry.js +280 -0
- package/dist/reactor/longLiveSceneEntry.js.map +1 -0
- package/dist/reactor/momentCut.d.ts +153 -0
- package/dist/reactor/momentCut.d.ts.map +1 -0
- package/dist/reactor/momentCut.js +142 -0
- package/dist/reactor/momentCut.js.map +1 -0
- package/dist/reactor/promptAddonRegistry.d.ts +39 -3
- package/dist/reactor/promptAddonRegistry.d.ts.map +1 -1
- package/dist/reactor/promptAddonRegistry.js +42 -3
- package/dist/reactor/promptAddonRegistry.js.map +1 -1
- package/dist/reactor/promptTemplatePreview.d.ts +97 -0
- package/dist/reactor/promptTemplatePreview.d.ts.map +1 -0
- package/dist/reactor/promptTemplatePreview.js +185 -0
- package/dist/reactor/promptTemplatePreview.js.map +1 -0
- package/dist/reactor/reactorAvailability.d.ts +80 -0
- package/dist/reactor/reactorAvailability.d.ts.map +1 -0
- package/dist/reactor/reactorAvailability.js +121 -0
- package/dist/reactor/reactorAvailability.js.map +1 -0
- package/dist/reactor/reactorSessionRefusal.d.ts +125 -0
- package/dist/reactor/reactorSessionRefusal.d.ts.map +1 -0
- package/dist/reactor/reactorSessionRefusal.js +197 -0
- package/dist/reactor/reactorSessionRefusal.js.map +1 -0
- package/dist/reactor/reactorTokenScope.d.ts +47 -0
- package/dist/reactor/reactorTokenScope.d.ts.map +1 -0
- package/dist/reactor/reactorTokenScope.js +64 -0
- package/dist/reactor/reactorTokenScope.js.map +1 -0
- package/dist/reactor/resolveDirectorBeats.d.ts +65 -0
- package/dist/reactor/resolveDirectorBeats.d.ts.map +1 -0
- package/dist/reactor/resolveDirectorBeats.js +86 -0
- package/dist/reactor/resolveDirectorBeats.js.map +1 -0
- package/dist/reactor/sanaLiveEdit.d.ts +117 -0
- package/dist/reactor/sanaLiveEdit.d.ts.map +1 -0
- package/dist/reactor/sanaLiveEdit.js +105 -0
- package/dist/reactor/sanaLiveEdit.js.map +1 -0
- package/dist/reactor/sceneEntry.d.ts +66 -9
- package/dist/reactor/sceneEntry.d.ts.map +1 -1
- package/dist/reactor/sceneEntry.js +59 -66
- package/dist/reactor/sceneEntry.js.map +1 -1
- package/dist/reactor/sceneSeedImage.d.ts +199 -0
- package/dist/reactor/sceneSeedImage.d.ts.map +1 -0
- package/dist/reactor/sceneSeedImage.js +239 -0
- package/dist/reactor/sceneSeedImage.js.map +1 -0
- package/dist/reactor/seedImageOrchestrator.d.ts +70 -3
- package/dist/reactor/seedImageOrchestrator.d.ts.map +1 -1
- package/dist/reactor/seedImageOrchestrator.js +92 -28
- package/dist/reactor/seedImageOrchestrator.js.map +1 -1
- package/dist/reactor/toolPromptAddon.d.ts.map +1 -1
- package/dist/reactor/toolPromptAddon.js +16 -2
- package/dist/reactor/toolPromptAddon.js.map +1 -1
- package/dist/reactor/worldMintLoop.d.ts +286 -0
- package/dist/reactor/worldMintLoop.d.ts.map +1 -0
- package/dist/reactor/worldMintLoop.js +381 -0
- package/dist/reactor/worldMintLoop.js.map +1 -0
- package/dist/reactor/worldSteerOutcome.d.ts +98 -0
- package/dist/reactor/worldSteerOutcome.d.ts.map +1 -0
- package/dist/reactor/worldSteerOutcome.js +81 -0
- package/dist/reactor/worldSteerOutcome.js.map +1 -0
- package/dist/retryAfter.d.ts +15 -0
- package/dist/retryAfter.d.ts.map +1 -0
- package/dist/retryAfter.js +75 -0
- package/dist/retryAfter.js.map +1 -0
- package/dist/seriesKey.d.ts +31 -0
- package/dist/seriesKey.d.ts.map +1 -0
- package/dist/seriesKey.js +33 -0
- package/dist/seriesKey.js.map +1 -0
- package/dist/sessionRefresh.d.ts +135 -0
- package/dist/sessionRefresh.d.ts.map +1 -0
- package/dist/sessionRefresh.js +215 -0
- package/dist/sessionRefresh.js.map +1 -0
- package/dist/sharedAudioContext.d.ts +39 -0
- package/dist/sharedAudioContext.d.ts.map +1 -0
- package/dist/sharedAudioContext.js +63 -0
- package/dist/sharedAudioContext.js.map +1 -0
- package/dist/singleFlight.d.ts +51 -0
- package/dist/singleFlight.d.ts.map +1 -0
- package/dist/singleFlight.js +87 -0
- package/dist/singleFlight.js.map +1 -0
- package/dist/storyGraph.d.ts +83 -0
- package/dist/storyGraph.d.ts.map +1 -1
- package/dist/storyGraph.js +169 -4
- package/dist/storyGraph.js.map +1 -1
- package/dist/storyboardMask.d.ts +343 -0
- package/dist/storyboardMask.d.ts.map +1 -0
- package/dist/storyboardMask.js +505 -0
- package/dist/storyboardMask.js.map +1 -0
- package/dist/storyboardTimeline.d.ts +93 -0
- package/dist/storyboardTimeline.d.ts.map +1 -0
- package/dist/storyboardTimeline.js +131 -0
- package/dist/storyboardTimeline.js.map +1 -0
- package/dist/studioAutomation.d.ts +104 -0
- package/dist/studioAutomation.d.ts.map +1 -0
- package/dist/studioAutomation.js +178 -0
- package/dist/studioAutomation.js.map +1 -0
- package/dist/tenantClaim.d.ts +86 -0
- package/dist/tenantClaim.d.ts.map +1 -0
- package/dist/tenantClaim.js +164 -0
- package/dist/tenantClaim.js.map +1 -0
- package/dist/timeFormat.d.ts +25 -0
- package/dist/timeFormat.d.ts.map +1 -1
- package/dist/timeFormat.js +56 -0
- package/dist/timeFormat.js.map +1 -1
- package/dist/toolSchemas.d.ts +53 -10
- package/dist/toolSchemas.d.ts.map +1 -1
- package/dist/toolSchemas.js +36 -9
- package/dist/toolSchemas.js.map +1 -1
- package/dist/transport.d.ts +120 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +282 -0
- package/dist/transport.js.map +1 -0
- package/dist/videoGenFacade.d.ts +63 -0
- package/dist/videoGenFacade.d.ts.map +1 -0
- package/dist/videoGenFacade.js +49 -0
- package/dist/videoGenFacade.js.map +1 -0
- package/dist/visemeScheduler.d.ts +24 -2
- package/dist/visemeScheduler.d.ts.map +1 -1
- package/dist/visemeScheduler.js +31 -2
- package/dist/visemeScheduler.js.map +1 -1
- package/dist/vision/VisionPublisher.d.ts +88 -0
- package/dist/vision/VisionPublisher.d.ts.map +1 -1
- package/dist/vision/VisionPublisher.js +196 -13
- package/dist/vision/VisionPublisher.js.map +1 -1
- package/dist/vision/VisionSourceController.d.ts +67 -1
- package/dist/vision/VisionSourceController.d.ts.map +1 -1
- package/dist/vision/VisionSourceController.js +147 -5
- package/dist/vision/VisionSourceController.js.map +1 -1
- package/dist/vision/index.d.ts +2 -1
- package/dist/vision/index.d.ts.map +1 -1
- package/dist/vision/index.js +2 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/sourceKinds.d.ts +18 -5
- package/dist/vision/sourceKinds.d.ts.map +1 -1
- package/dist/vision/sourceKinds.js +15 -2
- package/dist/vision/sourceKinds.js.map +1 -1
- package/dist/vision/types.d.ts +7 -4
- package/dist/vision/types.d.ts.map +1 -1
- package/dist/vision/visionErrors.d.ts +45 -0
- package/dist/vision/visionErrors.d.ts.map +1 -0
- package/dist/vision/visionErrors.js +66 -0
- package/dist/vision/visionErrors.js.map +1 -0
- package/dist/voiceCloneCaption.d.ts +33 -0
- package/dist/voiceCloneCaption.d.ts.map +1 -0
- package/dist/voiceCloneCaption.js +69 -0
- package/dist/voiceCloneCaption.js.map +1 -0
- package/dist/websocket.d.ts +273 -10
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +79 -0
- package/dist/websocket.js.map +1 -1
- package/dist/workflowAuthoring.d.ts +139 -0
- package/dist/workflowAuthoring.d.ts.map +1 -0
- package/dist/workflowAuthoring.js +557 -0
- package/dist/workflowAuthoring.js.map +1 -0
- package/package.json +15 -5
- package/src/__tests__/adapters-director.test.ts +9 -6
- package/src/__tests__/adapters-extraction.test.ts +175 -0
- package/src/__tests__/adapters-image.test.ts +66 -0
- package/src/__tests__/adapters-momentPolicy.test.ts +218 -0
- package/src/__tests__/adapters-platform.test.ts +110 -4
- package/src/__tests__/adapters-videogen.test.ts +53 -0
- package/src/__tests__/adapters-world.test.ts +117 -7
- package/src/__tests__/admin.enhancement-defaults.test.ts +115 -0
- package/src/__tests__/admin.test.ts +282 -0
- package/src/__tests__/adventures-world-state.test.ts +156 -0
- package/src/__tests__/adventures.test.ts +111 -1
- package/src/__tests__/api-pollers.test.ts +113 -23
- package/src/__tests__/api.adventure-definitions.test.ts +312 -0
- package/src/__tests__/api.anchor-beat.test.ts +75 -0
- package/src/__tests__/api.arc-approval.test.ts +171 -0
- package/src/__tests__/api.arc-beats-floor.test.ts +56 -0
- package/src/__tests__/api.arc-generation.test.ts +168 -0
- package/src/__tests__/api.arc-templates.test.ts +78 -0
- package/src/__tests__/api.assignVideoSeries.test.ts +81 -0
- package/src/__tests__/api.cast-frame-choices.test.ts +141 -0
- package/src/__tests__/api.cutscene-registry.test.ts +148 -0
- package/src/__tests__/api.enhancement-addition-actions.test.ts +137 -0
- package/src/__tests__/api.enrichVideo-serialization.test.ts +116 -0
- package/src/__tests__/api.extraction-base.test.ts +87 -0
- package/src/__tests__/api.generateVideo-cutscene.test.ts +148 -0
- package/src/__tests__/api.job-pipeline-stages.test.ts +128 -0
- package/src/__tests__/api.list-images-filters.test.ts +6 -3
- package/src/__tests__/api.quest-curation.test.ts +169 -0
- package/src/__tests__/api.reprocessVideo.test.ts +71 -0
- package/src/__tests__/api.scene-split-merge.test.ts +129 -0
- package/src/__tests__/api.session-quests.test.ts +184 -0
- package/src/__tests__/api.test.ts +122 -0
- package/src/__tests__/api.transferSeries.test.ts +114 -0
- package/src/__tests__/api.unknown-clusters.test.ts +225 -0
- package/src/__tests__/api.uploadVideo-options.test.ts +156 -0
- package/src/__tests__/arcPreview.test.ts +71 -0
- package/src/__tests__/arcStyleProfile.test.ts +204 -0
- package/src/__tests__/artifacts-delete.test.ts +109 -0
- package/src/__tests__/audio.test.ts +864 -5
- package/src/__tests__/audioDsp.test.ts +196 -0
- package/src/__tests__/audioUnavailable.test.ts +43 -0
- package/src/__tests__/cast.test.ts +10 -1
- package/src/__tests__/castCurationProjection.test.ts +84 -0
- package/src/__tests__/castFramePipelinePending.test.ts +171 -0
- package/src/__tests__/castProjection.test.ts +497 -5
- package/src/__tests__/characterGrounding.test.ts +357 -0
- package/src/__tests__/contract.test.ts +97 -0
- package/src/__tests__/conversation/chatSessionStore.test.ts +243 -0
- package/src/__tests__/conversation/controller.test.ts +211 -0
- package/src/__tests__/conversation/readSequencer.test.ts +52 -0
- package/src/__tests__/conversation/rosterProjection.test.ts +204 -3
- package/src/__tests__/conversation/runtime.test.ts +118 -1
- package/src/__tests__/conversation/voice.test.ts +741 -7
- package/src/__tests__/creatorCuration.test.ts +256 -0
- package/src/__tests__/creatorDashboard.test.ts +444 -0
- package/src/__tests__/creatorUniverse.test.ts +138 -0
- package/src/__tests__/curationWrite.test.ts +179 -0
- package/src/__tests__/decisions.test.ts +89 -0
- package/src/__tests__/designTokens.test.ts +72 -0
- package/src/__tests__/dialogAttribution.test.ts +187 -0
- package/src/__tests__/dmDirectiveToExperience.test.ts +198 -0
- package/src/__tests__/dmWorldEntry.test.ts +2102 -0
- package/src/__tests__/enhancementDiff.test.ts +132 -0
- package/src/__tests__/experienceModelCatalog.test.ts +292 -0
- package/src/__tests__/extractionStageState.test.ts +67 -0
- package/src/__tests__/getVideo.test.ts +95 -0
- package/src/__tests__/graphReadAfterWrite.test.ts +211 -0
- package/src/__tests__/graphSchema.test.ts +55 -4
- package/src/__tests__/happyOysterSeed.test.ts +208 -0
- package/src/__tests__/happyOysterWorld.test.ts +1241 -0
- package/src/__tests__/happyOysterWorldRefusal.test.ts +224 -0
- package/src/__tests__/hiddenWorldLifecycle.test.ts +203 -0
- package/src/__tests__/http.session-refresh.test.ts +424 -0
- package/src/__tests__/http.test.ts +316 -0
- package/src/__tests__/identity.test.ts +132 -0
- package/src/__tests__/loadBundleManifest.test.ts +192 -22
- package/src/__tests__/longLiveSceneEntry.test.ts +371 -0
- package/src/__tests__/me.test.ts +74 -0
- package/src/__tests__/messageContent.test.ts +395 -0
- package/src/__tests__/momentCut.test.ts +229 -0
- package/src/__tests__/mutationEpoch.test.ts +218 -0
- package/src/__tests__/obo.test.ts +159 -0
- package/src/__tests__/opusTransport.test.ts +182 -0
- package/src/__tests__/opusTransportLibopus.test.ts +125 -0
- package/src/__tests__/orgs.test.ts +229 -0
- package/src/__tests__/persona-generation.test.ts +187 -1
- package/src/__tests__/platformAssistant.test.ts +140 -0
- package/src/__tests__/projects.test.ts +338 -0
- package/src/__tests__/promptTemplatePreview.test.ts +160 -0
- package/src/__tests__/reactor/__fixtures__/realFramePromptText.ts +23 -0
- package/src/__tests__/reactor/api-reactor.test.ts +60 -21
- package/src/__tests__/reactor/framePromptCompaction.test.ts +300 -0
- package/src/__tests__/reactor/promptAddonRegistry.test.ts +79 -0
- package/src/__tests__/reactor/reactorTokenScope.test.ts +50 -0
- package/src/__tests__/reactor/resolveDirectorBeats.test.ts +156 -0
- package/src/__tests__/reactor/sceneEntry.test.ts +3 -0
- package/src/__tests__/reactor/sceneSeedImage.test.ts +361 -0
- package/src/__tests__/reactor/seedImageOrchestrator.test.ts +43 -5
- package/src/__tests__/reactor-happyOysterWalk.test.ts +294 -0
- package/src/__tests__/reactorAvailability.test.ts +217 -0
- package/src/__tests__/reactorSessionRefusal.test.ts +189 -0
- package/src/__tests__/regeneration.test.ts +9 -9
- package/src/__tests__/reprocessBlockedReason.test.ts +30 -0
- package/src/__tests__/retryAfter.test.ts +65 -0
- package/src/__tests__/roleClaim.test.ts +102 -0
- package/src/__tests__/sanaLiveEdit.test.ts +84 -0
- package/src/__tests__/seriesKey.test.ts +24 -0
- package/src/__tests__/settings-set9.test.ts +238 -0
- package/src/__tests__/singleFlight.test.ts +348 -0
- package/src/__tests__/storyGraph.test.ts +111 -1
- package/src/__tests__/storyboardFrameCutscene.test.ts +115 -0
- package/src/__tests__/storyboardMask.test.ts +527 -0
- package/src/__tests__/storyboardTimeline.test.ts +228 -0
- package/src/__tests__/storyboards.test.ts +639 -0
- package/src/__tests__/studioAutomation.test.ts +325 -0
- package/src/__tests__/toolSchemas.test.ts +11 -18
- package/src/__tests__/transport.test.ts +312 -0
- package/src/__tests__/videoGenFacade.test.ts +141 -0
- package/src/__tests__/videoGraph.test.ts +43 -1
- package/src/__tests__/visemeScheduler.test.ts +55 -1
- package/src/__tests__/visibility.test.ts +143 -0
- package/src/__tests__/voiceCloneCaption.test.ts +80 -0
- package/src/__tests__/voiceFallback.test.ts +55 -0
- package/src/__tests__/websocket-error-turn-ended.test.ts +49 -0
- package/src/__tests__/websocket-vision.test.ts +141 -0
- package/src/__tests__/websocket.test.ts +75 -1
- package/src/__tests__/workflowAuthoring.test.ts +187 -0
- package/src/__tests__/workflows.test.ts +640 -0
- package/src/__tests__/worldMintLoop.test.ts +448 -0
- package/src/__tests__/worldModelPreference.test.ts +302 -0
- package/src/__tests__/worldModelTradeoffs.test.ts +89 -0
- package/src/__tests__/worldSteerOutcome.test.ts +62 -0
- package/src/adapters/capabilities.ts +39 -3
- package/src/adapters/directorAdapter.ts +5 -4
- package/src/adapters/experienceModelCatalog.ts +538 -0
- package/src/adapters/extractionAdapter.ts +150 -0
- package/src/adapters/imageAdapter.ts +5 -1
- package/src/adapters/index.ts +104 -17
- package/src/adapters/momentDirective.ts +109 -0
- package/src/adapters/momentPolicy.ts +209 -0
- package/src/adapters/registry.ts +1 -1
- package/src/adapters/videoGenAdapter.ts +124 -0
- package/src/adapters/worldAdapter.ts +221 -16
- package/src/adapters/worldModelPreference.ts +247 -0
- package/src/adapters/worldModelTradeoffs.ts +247 -0
- package/src/admin.ts +842 -16
- package/src/api.ts +12670 -3446
- package/src/arcBoardJoin.ts +46 -0
- package/src/arcPreview.ts +103 -0
- package/src/audio.ts +691 -130
- package/src/audioDsp.ts +132 -0
- package/src/audioProtocol.ts +235 -0
- package/src/beatTitles.ts +51 -0
- package/src/castProjection.ts +311 -0
- package/src/characterGrounding.ts +491 -0
- package/src/conversation/binding.ts +13 -0
- package/src/conversation/chatSessionStore.ts +281 -0
- package/src/conversation/controller.ts +96 -3
- package/src/conversation/index.ts +2 -0
- package/src/conversation/participant.ts +16 -0
- package/src/conversation/readSequencer.ts +55 -0
- package/src/conversation/roster.ts +5 -1
- package/src/conversation/rosterProjection.ts +166 -2
- package/src/conversation/runtime.ts +66 -7
- package/src/conversation/types.ts +43 -4
- package/src/conversation/voice.ts +655 -51
- package/src/creatorCuration.ts +316 -0
- package/src/creatorDashboard.ts +344 -0
- package/src/creatorUniverse.ts +222 -0
- package/src/curationWrite.ts +108 -0
- package/src/designTokens.ts +157 -0
- package/src/dialogAttribution.ts +182 -0
- package/src/dmRunWorldReadiness.ts +1168 -0
- package/src/domains/access.ts +92 -0
- package/src/domains/adventureDefinitions.ts +313 -0
- package/src/domains/adventures.ts +557 -0
- package/src/domains/arcs.ts +350 -0
- package/src/domains/artifacts.ts +349 -0
- package/src/domains/chat.ts +338 -0
- package/src/domains/decisions.ts +62 -0
- package/src/domains/documents.ts +389 -0
- package/src/domains/enhancements.ts +259 -0
- package/src/domains/graph.ts +959 -0
- package/src/domains/images.ts +451 -0
- package/src/domains/ingestion.ts +695 -0
- package/src/domains/me.ts +27 -0
- package/src/domains/orgs.ts +168 -0
- package/src/domains/personas.ts +433 -0
- package/src/domains/projects.ts +177 -0
- package/src/domains/quests.ts +587 -0
- package/src/domains/reactor.ts +163 -0
- package/src/domains/showcase.ts +35 -0
- package/src/domains/storyboards.ts +1698 -0
- package/src/domains/studioSettings.ts +149 -0
- package/src/domains/universes.ts +433 -0
- package/src/domains/userDefaults.ts +37 -0
- package/src/domains/visemeBundles.ts +541 -0
- package/src/domains/workflows.ts +376 -0
- package/src/enhancementDiff.ts +171 -0
- package/src/generated/contract.ts +1011 -0
- package/src/graphSchema.ts +154 -6
- package/src/http.ts +295 -11
- package/src/identity.ts +123 -0
- package/src/index.ts +131 -0
- package/src/messageContent.ts +500 -0
- package/src/mutationEpoch.ts +107 -0
- package/src/obo.ts +201 -0
- package/src/opusTransport.ts +268 -0
- package/src/pagination.ts +29 -0
- package/src/platformAssistant.ts +97 -1
- package/src/pollUtils.ts +35 -0
- package/src/questLog.ts +704 -0
- package/src/reactor/dmDirectiveToExperience.ts +636 -0
- package/src/reactor/dmSceneControlPrompt.ts +69 -2
- package/src/reactor/dmWorldEntry.ts +2226 -0
- package/src/reactor/framePromptCompaction.ts +544 -0
- package/src/reactor/frameWorldBind.ts +133 -0
- package/src/reactor/happyOysterSeed.ts +329 -0
- package/src/reactor/happyOysterWalk.ts +541 -0
- package/src/reactor/happyOysterWorld.ts +1270 -0
- package/src/reactor/heliosCommandDispatcher.ts +5 -1
- package/src/reactor/hiddenWorldLifecycle.ts +182 -0
- package/src/reactor/imageCanvas.ts +38 -0
- package/src/reactor/index.ts +78 -0
- package/src/reactor/longLiveCommandDispatcher.ts +23 -8
- package/src/reactor/longLiveSceneEntry.ts +409 -0
- package/src/reactor/momentCut.ts +219 -0
- package/src/reactor/promptAddonRegistry.ts +81 -3
- package/src/reactor/promptTemplatePreview.ts +240 -0
- package/src/reactor/reactorAvailability.ts +155 -0
- package/src/reactor/reactorSessionRefusal.ts +260 -0
- package/src/reactor/reactorTokenScope.ts +69 -0
- package/src/reactor/resolveDirectorBeats.ts +140 -0
- package/src/reactor/sanaLiveEdit.ts +158 -0
- package/src/reactor/sceneEntry.ts +106 -88
- package/src/reactor/sceneSeedImage.ts +338 -0
- package/src/reactor/seedImageOrchestrator.ts +116 -34
- package/src/reactor/toolPromptAddon.ts +16 -2
- package/src/reactor/worldMintLoop.ts +545 -0
- package/src/reactor/worldSteerOutcome.ts +132 -0
- package/src/retryAfter.ts +71 -0
- package/src/seriesKey.ts +42 -0
- package/src/sessionRefresh.ts +237 -0
- package/src/sharedAudioContext.ts +67 -0
- package/src/singleFlight.ts +91 -0
- package/src/storyGraph.ts +247 -4
- package/src/storyboardMask.ts +756 -0
- package/src/storyboardTimeline.ts +220 -0
- package/src/studioAutomation.ts +208 -0
- package/src/tenantClaim.ts +170 -0
- package/src/timeFormat.ts +51 -0
- package/src/toolSchemas.ts +39 -10
- package/src/transport.ts +327 -0
- package/src/videoGenFacade.ts +90 -0
- package/src/visemeScheduler.ts +36 -3
- package/src/vision/VisionPublisher.ts +204 -14
- package/src/vision/VisionSourceController.ts +187 -6
- package/src/vision/__tests__/VisionPublisher.kvs.test.ts +50 -0
- package/src/vision/__tests__/VisionPublisher.test.ts +291 -0
- package/src/vision/__tests__/VisionSourceController.test.ts +376 -6
- package/src/vision/index.ts +5 -1
- package/src/vision/sourceKinds.ts +19 -5
- package/src/vision/types.ts +7 -4
- package/src/vision/visionErrors.ts +70 -0
- package/src/voiceCloneCaption.ts +77 -0
- package/src/websocket.ts +361 -12
- package/src/workflowAuthoring.ts +664 -0
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Character grounding — the READ side of the grounded-verification layer,
|
|
3
|
+
* projected out of the raw video graph for cast-curation surfaces (§Q GROUND.12,
|
|
4
|
+
* spec `2026-08-04-grounded-verification-design.md` R11 + §6 mechanism 2).
|
|
5
|
+
*
|
|
6
|
+
* ## Why this lives in client-core rather than `web/`
|
|
7
|
+
*
|
|
8
|
+
* It is LOGIC, not presentation: reading the level off a node, deciding whether
|
|
9
|
+
* an override affordance may be offered at all, and deciding what an honest
|
|
10
|
+
* empty state is. The Vue `../Web-App` curates the same cast against the same
|
|
11
|
+
* graph, and two implementations of "may this character be generated anyway"
|
|
12
|
+
* is two answers waiting to disagree about money. Presentation — badge markup,
|
|
13
|
+
* colour, copy placement — stays in each app.
|
|
14
|
+
*
|
|
15
|
+
* ## Where the values come from
|
|
16
|
+
*
|
|
17
|
+
* The CII writes four properties onto the character's `Entity` node
|
|
18
|
+
* (`shared/neo4j_queries.py:CII_SET_ENTITY_GROUNDING`) plus ratified ruling 4's
|
|
19
|
+
* override boolean (`SET_ENTITY_GROUNDING_OVERRIDE`):
|
|
20
|
+
*
|
|
21
|
+
* | property | source enum |
|
|
22
|
+
* |---|---|
|
|
23
|
+
* | `groundingStatus` | `shared/grounding.py:GroundingLevel` (VISUAL dimension) |
|
|
24
|
+
* | `groundingAssertedBy` | `shared/character_identity.py:BindingProvenance` |
|
|
25
|
+
* | `class` | `shared/character_identity.py:CharacterClass` |
|
|
26
|
+
* | `appearanceDescription` | written from VERIFIED crops only |
|
|
27
|
+
* | `exemplarImageKeys` | S3 keys — NOT presigned, see the warning below |
|
|
28
|
+
* | `groundingWeakOverride` | `shared/neo4j_queries.py:PROPERTY_GROUNDING_WEAK_OVERRIDE` |
|
|
29
|
+
*
|
|
30
|
+
* They arrive as opaque `GraphNode.properties` on `GET /api/v1/tools/graph/{videoId}`
|
|
31
|
+
* (raw detail), which returns whole nodes.
|
|
32
|
+
*
|
|
33
|
+
* ⛔ **`exemplarImageKeys` ARE NOT RENDERABLE URLS.** They are raw S3 object
|
|
34
|
+
* keys, and the `shared/image_render` exposure contract keeps object paths off
|
|
35
|
+
* the wire as authoring-secret class. The crop a curation surface shows is the
|
|
36
|
+
* cast projection's `CastFrame.url` (presigned, per-response). This module
|
|
37
|
+
* deliberately does not carry the keys: exposing them would invite a call site
|
|
38
|
+
* to build an `<img src>` that can only 403.
|
|
39
|
+
*
|
|
40
|
+
* ⛔ **`UNKNOWN_PERSON` IDENTITIES ARE NOT REACHABLE FROM HERE, AND THAT IS NOT
|
|
41
|
+
* AN OVERSIGHT IN THIS FILE.** `services/grounding/cii.py` mints them with
|
|
42
|
+
* `entity_id=""` — deliberately, because the CII "must NEVER mint a character
|
|
43
|
+
* out of a face" — so they exist only in the S3 CII artifact and as
|
|
44
|
+
* `PresenceCluster` nodes. `PresenceCluster` is not in
|
|
45
|
+
* `shared/graph_schema.PRIMARY_KEY` and no query in
|
|
46
|
+
* `shared/graph/video_graph.py:get_video_graph` fetches it, so no read door
|
|
47
|
+
* serves them to a browser today. {@link isUnknownPerson} exists so that the
|
|
48
|
+
* day a door does, the vocabulary is already single-sourced here — it is not a
|
|
49
|
+
* claim that the rows can be rendered now.
|
|
50
|
+
*/
|
|
51
|
+
import { GRAPH_ENTITY_LABEL } from './graphSchema.js';
|
|
52
|
+
/**
|
|
53
|
+
* `shared/grounding.py:GroundingLevel`, mirrored in the producer's own
|
|
54
|
+
* spelling (lowercase — the Python side is a `StrEnum` and writes `.value`).
|
|
55
|
+
*/
|
|
56
|
+
export const GROUNDING_LEVEL = {
|
|
57
|
+
VERIFIED: 'verified',
|
|
58
|
+
WEAK: 'weak',
|
|
59
|
+
ABSENT: 'absent',
|
|
60
|
+
};
|
|
61
|
+
/** The three-value vocabulary, in the producer's declaration order. */
|
|
62
|
+
export const GROUNDING_LEVEL_VALUES = Object.freeze([
|
|
63
|
+
GROUNDING_LEVEL.VERIFIED,
|
|
64
|
+
GROUNDING_LEVEL.WEAK,
|
|
65
|
+
GROUNDING_LEVEL.ABSENT,
|
|
66
|
+
]);
|
|
67
|
+
/**
|
|
68
|
+
* `shared/character_identity.py:BindingProvenance` — WHO asserted this
|
|
69
|
+
* character's visual identity (§Q GROUND.75, review #1848 §7).
|
|
70
|
+
*
|
|
71
|
+
* ⛔ **A SEPARATE AXIS FROM {@link GROUNDING_LEVEL}, WHICH STAYS AT THREE
|
|
72
|
+
* MEMBERS.** The level bounds how strongly the evidence supports the claim;
|
|
73
|
+
* this records who made it. A fourth level would have to answer whether a
|
|
74
|
+
* human's word ranks above or below machine `verified`, and there is no correct
|
|
75
|
+
* answer because they are not one ladder — so the owner's third state is
|
|
76
|
+
* carried here, as provenance, and rendered as its own badge.
|
|
77
|
+
*
|
|
78
|
+
* `model` is the fail-closed default: a node that says nothing about provenance
|
|
79
|
+
* grants no human authority, so the worst case is a curator asked to confirm
|
|
80
|
+
* again rather than a model's guess spending money as though a person approved.
|
|
81
|
+
*/
|
|
82
|
+
export const BINDING_PROVENANCE = {
|
|
83
|
+
/** The CII pass asserted it. */
|
|
84
|
+
MODEL: 'model',
|
|
85
|
+
/** A person asserted it through a curation door. */
|
|
86
|
+
HUMAN: 'human',
|
|
87
|
+
};
|
|
88
|
+
const BINDING_PROVENANCE_VALUES = Object.freeze(Object.values(BINDING_PROVENANCE));
|
|
89
|
+
/**
|
|
90
|
+
* `shared/character_identity.py:CharacterClass`.
|
|
91
|
+
*
|
|
92
|
+
* `MENTIONED_ONLY` and `UNKNOWN_PERSON` are CORRECT TERMINAL STATES, not
|
|
93
|
+
* failures — that is the honesty key the whole layer turns on, and a surface
|
|
94
|
+
* that renders them as errors has misread the design.
|
|
95
|
+
*
|
|
96
|
+
* ⛔ **THE CLASS NAMES A MECHANISM, NOT A STRENGTH (§Q GROUND.77).** How well
|
|
97
|
+
* the claim is supported is {@link GROUNDING_LEVEL}, carried on the same node
|
|
98
|
+
* and rendered by its own pill; the class says HOW the identity was arrived at.
|
|
99
|
+
* Do not order these values, and do not present `ON_SCREEN_UNMATCHED` as a rung
|
|
100
|
+
* below `ON_SCREEN` — the level beside it already says what it says.
|
|
101
|
+
*/
|
|
102
|
+
export const CHARACTER_CLASS = {
|
|
103
|
+
ON_SCREEN: 'on_screen',
|
|
104
|
+
NARRATOR: 'narrator',
|
|
105
|
+
/**
|
|
106
|
+
* No face cluster ever formed — the VLM presence arm saw this character and
|
|
107
|
+
* the face detector did not cluster them (§13.2: the Shadow Giant, masks,
|
|
108
|
+
* backs of heads).
|
|
109
|
+
*
|
|
110
|
+
* ⛔ **A CLAIM ABOUT THE DETECTOR, NOT ABOUT THE PERSON.** It does NOT mean
|
|
111
|
+
* this character never shows a face, and a surface that says so is asserting
|
|
112
|
+
* something the pipeline never measured — including over a crop a curator
|
|
113
|
+
* just looked at and named through the §13.6 door.
|
|
114
|
+
*/
|
|
115
|
+
NON_FACIAL: 'non_facial',
|
|
116
|
+
MENTIONED_ONLY: 'mentioned_only',
|
|
117
|
+
UNKNOWN_PERSON: 'unknown_person',
|
|
118
|
+
/**
|
|
119
|
+
* §Q GROUND.77 — a face cluster formed and carries this character's name, but
|
|
120
|
+
* no mechanism ever compared the figure to the name: the mention-span
|
|
121
|
+
* correlation arm bound it on narration timing while the crop arm abstained.
|
|
122
|
+
* On screen, identity unmatched.
|
|
123
|
+
*/
|
|
124
|
+
ON_SCREEN_UNMATCHED: 'on_screen_unmatched',
|
|
125
|
+
};
|
|
126
|
+
const CHARACTER_CLASS_VALUES = Object.freeze(Object.values(CHARACTER_CLASS));
|
|
127
|
+
/**
|
|
128
|
+
* `Entity.entityId` — the BARE primary key, and the only id a cast row can be
|
|
129
|
+
* joined on. Mirrors `shared/graph_schema.PRIMARY_KEY[LABEL_ENTITY]`.
|
|
130
|
+
*/
|
|
131
|
+
export const ENTITY_ID_PROPERTY = 'entityId';
|
|
132
|
+
/** `Entity.groundingStatus` — the VISUAL grounding level. */
|
|
133
|
+
export const GROUNDING_STATUS_PROPERTY = 'groundingStatus';
|
|
134
|
+
/** `Entity.groundingAssertedBy` — the VISUAL identity's `BindingProvenance`. */
|
|
135
|
+
export const GROUNDING_ASSERTED_BY_PROPERTY = 'groundingAssertedBy';
|
|
136
|
+
/** `Entity.class` — the `CharacterClass` the CII assigned. */
|
|
137
|
+
export const CHARACTER_CLASS_PROPERTY = 'class';
|
|
138
|
+
/** `Entity.groundingWeakOverride` — ratified ruling 4's per-character permission. */
|
|
139
|
+
export const GROUNDING_WEAK_OVERRIDE_PROPERTY = 'groundingWeakOverride';
|
|
140
|
+
/** `Entity.appearanceDescription` — written from VERIFIED crops only. */
|
|
141
|
+
export const APPEARANCE_DESCRIPTION_PROPERTY = 'appearanceDescription';
|
|
142
|
+
/**
|
|
143
|
+
* §Q GROUND.52 — HOW WELL THE GROUNDING INDEX ITSELF IS KNOWN, as a third value
|
|
144
|
+
* rather than a boolean.
|
|
145
|
+
*
|
|
146
|
+
* GROUND.26 made the index decide whether a stored cast frame may be SHOWN, and
|
|
147
|
+
* the read that produces it had only two outcomes: settled or not. A read that
|
|
148
|
+
* FAILED landed in the same empty index an ungraded video produces, so a
|
|
149
|
+
* transient graph fault was indistinguishable from "nobody looked" — and the
|
|
150
|
+
* suppression, which keys on {@link CharacterGrounding.graded}, quietly stopped
|
|
151
|
+
* firing. The stale pre-CII picture was then served as if the index had cleared
|
|
152
|
+
* it. That is the exact wrong-face outcome GROUND.26 exists to stop, reached
|
|
153
|
+
* through the error path instead of the happy one.
|
|
154
|
+
*
|
|
155
|
+
* The three values are the three different things a surface may know:
|
|
156
|
+
*
|
|
157
|
+
* - `loading` — nothing is established yet. Paint no claim at all
|
|
158
|
+
* (`CAST_FRAME_STATE.CHECKING`).
|
|
159
|
+
* - `ready` — the index was READ. An entity missing from it is genuinely
|
|
160
|
+
* ungraded ("nobody looked"), which is the dark posture and suppresses
|
|
161
|
+
* nothing.
|
|
162
|
+
* - `unreadable` — the read could not be completed. Nothing is known about ANY
|
|
163
|
+
* entity, so no frame can be certified and every one of them is withheld
|
|
164
|
+
* ({@link CAST_FRAME_SUPPRESSION_REASON.GROUNDING_UNREADABLE}).
|
|
165
|
+
*
|
|
166
|
+
* ⛔ **`unreadable` IS NOT "ONE REQUEST FAILED".** The reader is expected to
|
|
167
|
+
* exhaust a bounded retry first and stay `loading` in between — otherwise a
|
|
168
|
+
* single blip withholds every frame on the surface and recovers a moment later,
|
|
169
|
+
* which is a flicker the creator reads as data loss. The retry lives in the
|
|
170
|
+
* reader (`web/lib/useCharacterGrounding.ts`); this vocabulary only names the
|
|
171
|
+
* settled outcomes.
|
|
172
|
+
*/
|
|
173
|
+
export const GROUNDING_INDEX_STATUS = {
|
|
174
|
+
/** The read is in flight (including between bounded retries). */
|
|
175
|
+
LOADING: 'loading',
|
|
176
|
+
/** The read completed — what the index does not carry is genuinely ungraded. */
|
|
177
|
+
READY: 'ready',
|
|
178
|
+
/** The read could not be completed; nothing about any character is known. */
|
|
179
|
+
UNREADABLE: 'unreadable',
|
|
180
|
+
};
|
|
181
|
+
function readString(properties, key) {
|
|
182
|
+
const raw = properties[key];
|
|
183
|
+
return typeof raw === 'string' ? raw.trim() : '';
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Project one graph node into its grounding facts.
|
|
187
|
+
*
|
|
188
|
+
* Returns `null` for any node that is not an `Entity` — callers pass whole
|
|
189
|
+
* `VideoGraphResponse.nodes` arrays and the filter belongs here, once — and for
|
|
190
|
+
* an `Entity` carrying no `entityId` property, which cannot be joined to a cast
|
|
191
|
+
* row at all.
|
|
192
|
+
*
|
|
193
|
+
* ⛔ **THE ID COMES FROM `properties.entityId`, NEVER FROM `node.id`.**
|
|
194
|
+
* `shared/graph/video_graph.py:_GraphAccumulator.node_key` builds `node.id` as
|
|
195
|
+
* a COMPOSITE `"<label>:<pkName>:<pkValue>"` — an Entity arrives as
|
|
196
|
+
* `"Entity:entityId:abc"`, not `"abc"`. The cast projection joins on the BARE
|
|
197
|
+
* id, so indexing on `node.id` produces a map whose keys can never match a
|
|
198
|
+
* lookup: every badge, every empty state and every override button silently
|
|
199
|
+
* fails to render, on every video, forever. That was the first implementation
|
|
200
|
+
* of this function (codex, PR #1816), and the unit fixtures hid it by using a
|
|
201
|
+
* bare `id` the endpoint never emits.
|
|
202
|
+
*/
|
|
203
|
+
export function readCharacterGrounding(node) {
|
|
204
|
+
if (!node || node.label !== GRAPH_ENTITY_LABEL)
|
|
205
|
+
return null;
|
|
206
|
+
const properties = node.properties ?? {};
|
|
207
|
+
const entityId = readString(properties, ENTITY_ID_PROPERTY);
|
|
208
|
+
if (!entityId)
|
|
209
|
+
return null;
|
|
210
|
+
const rawLevel = readString(properties, GROUNDING_STATUS_PROPERTY).toLowerCase();
|
|
211
|
+
const rawClass = readString(properties, CHARACTER_CLASS_PROPERTY).toLowerCase();
|
|
212
|
+
const rawAssertedBy = readString(properties, GROUNDING_ASSERTED_BY_PROPERTY).toLowerCase();
|
|
213
|
+
const rawAppearance = readString(properties, APPEARANCE_DESCRIPTION_PROPERTY);
|
|
214
|
+
const overrideValue = properties[GROUNDING_WEAK_OVERRIDE_PROPERTY];
|
|
215
|
+
// "Graded" is keyed on the two properties the CII writes TOGETHER
|
|
216
|
+
// (CII_SET_ENTITY_GROUNDING sets both in one statement). The override
|
|
217
|
+
// boolean deliberately does NOT count: it is written by a separate door and
|
|
218
|
+
// its presence says a human clicked, not that the pipeline ever ran.
|
|
219
|
+
const graded = rawLevel !== '' || rawClass !== '';
|
|
220
|
+
return {
|
|
221
|
+
entityId,
|
|
222
|
+
level: GROUNDING_LEVEL_VALUES.includes(rawLevel)
|
|
223
|
+
? rawLevel
|
|
224
|
+
: GROUNDING_LEVEL.ABSENT,
|
|
225
|
+
assertedBy: BINDING_PROVENANCE_VALUES.includes(rawAssertedBy)
|
|
226
|
+
? rawAssertedBy
|
|
227
|
+
: BINDING_PROVENANCE.MODEL,
|
|
228
|
+
characterClass: CHARACTER_CLASS_VALUES.includes(rawClass)
|
|
229
|
+
? rawClass
|
|
230
|
+
: null,
|
|
231
|
+
weakOverride: overrideValue === true,
|
|
232
|
+
appearanceDescription: rawAppearance === '' ? null : rawAppearance,
|
|
233
|
+
graded,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Index a video graph's `Entity` nodes by id, so a cast row can look its own
|
|
238
|
+
* grounding up in O(1) instead of scanning the node list per row.
|
|
239
|
+
*/
|
|
240
|
+
export function indexCharacterGrounding(nodes) {
|
|
241
|
+
const index = new Map();
|
|
242
|
+
for (const node of nodes ?? []) {
|
|
243
|
+
const grounding = readCharacterGrounding(node);
|
|
244
|
+
if (grounding && grounding.entityId)
|
|
245
|
+
index.set(grounding.entityId, grounding);
|
|
246
|
+
}
|
|
247
|
+
return index;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* §Q GROUND.75 — whether a PERSON confirmed this character's identity through a
|
|
251
|
+
* curation door, and the badge should say so ("confirmed by you").
|
|
252
|
+
*
|
|
253
|
+
* The owner's third state, as PROVENANCE rather than as a fourth strength
|
|
254
|
+
* level: naming a stranger, creating a character from a face, or picking the
|
|
255
|
+
* frame are all a human answering the very question the verifier asks, about a
|
|
256
|
+
* crop the read door served them.
|
|
257
|
+
*
|
|
258
|
+
* ⛔ **NON-ABSENT IS PART OF THE PREDICATE, NOT A DETAIL.** A rejection voids
|
|
259
|
+
* the judged crop's verdict and the character demotes to `absent`, while a
|
|
260
|
+
* hand-edited or half-repaired record can strand the provenance value on a node
|
|
261
|
+
* with no usable observation. "Confirmed by you" over a character the layer can
|
|
262
|
+
* see nothing for would be the badge lying in the one direction that costs
|
|
263
|
+
* money — so it takes BOTH, mirroring the server, where an ABSENT block is
|
|
264
|
+
* never lifted by anything.
|
|
265
|
+
*/
|
|
266
|
+
export function isHumanConfirmed(grounding) {
|
|
267
|
+
if (!grounding || !grounding.graded)
|
|
268
|
+
return false;
|
|
269
|
+
if (grounding.level === GROUNDING_LEVEL.ABSENT)
|
|
270
|
+
return false;
|
|
271
|
+
return grounding.assertedBy === BINDING_PROVENANCE.HUMAN;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Whether the "generate anyway" override may be OFFERED for this character.
|
|
275
|
+
*
|
|
276
|
+
* ⛔ **`WEAK` ONLY. `ABSENT` IS NEVER OVERRIDABLE** — spec §7 and the server
|
|
277
|
+
* guard in `shared/grounding.py` both refuse it regardless of what is recorded,
|
|
278
|
+
* because at ABSENT there is no crop for the human to have looked at. Rendering
|
|
279
|
+
* a button there would offer the creator a control that cannot work, which is
|
|
280
|
+
* worse than offering nothing.
|
|
281
|
+
*
|
|
282
|
+
* Also false for an UNGRADED character: with the grounding layer dark nothing
|
|
283
|
+
* is gated at all, so there is no block for an override to lift.
|
|
284
|
+
*
|
|
285
|
+
* ⛔ **AND FALSE FOR A HUMAN-CONFIRMED CHARACTER (§Q GROUND.75)** — for the
|
|
286
|
+
* SAME reason, one step further along: the server admits that write with no
|
|
287
|
+
* click, so there is no block left for this button to lift and pressing it
|
|
288
|
+
* would change nothing. This is the friction the owner rejected — *a curator
|
|
289
|
+
* who just used their eyes must not be told "unverified — needs your eyes"* —
|
|
290
|
+
* and it is removed HERE, in the single decision both apps read, so the Vue app
|
|
291
|
+
* cannot keep asking.
|
|
292
|
+
*/
|
|
293
|
+
export function mayOverrideWeakGrounding(grounding) {
|
|
294
|
+
if (!grounding || !grounding.graded)
|
|
295
|
+
return false;
|
|
296
|
+
if (isHumanConfirmed(grounding))
|
|
297
|
+
return false;
|
|
298
|
+
return grounding.level === GROUNDING_LEVEL.WEAK;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* §Q GROUND.148 — whether the MANUAL-GROUNDING door (§Q GROUND.71) may be
|
|
302
|
+
* offered for this character.
|
|
303
|
+
*
|
|
304
|
+
* The server's real condition is `CharacterIdentity.presence_cluster_id`: it
|
|
305
|
+
* refuses with 409 a character it can already see, because letting the door
|
|
306
|
+
* through would discard a real detection and replace it with a strictly weaker
|
|
307
|
+
* manual assertion. **No read serves that field**, so this is the closest sound
|
|
308
|
+
* approximation of it, and the two cases it admits are the two the server
|
|
309
|
+
* accepts:
|
|
310
|
+
*
|
|
311
|
+
* 1. **Graded `ABSENT`** — "we looked and saw nothing", §Q GROUND.71's whole
|
|
312
|
+
* population (a mask, a creature, an animated figure).
|
|
313
|
+
* 2. **A character THIS DOOR already grounded** — `WEAK`, asserted by a
|
|
314
|
+
* HUMAN, classed `NON_FACIAL`. A manual grounding writes exactly that
|
|
315
|
+
* triple and leaves no presence cluster behind, so the server still
|
|
316
|
+
* accepts another one; hiding the door there would make the FIRST instant
|
|
317
|
+
* a curator picked permanently uncorrectable (codex on #1998).
|
|
318
|
+
*
|
|
319
|
+
* ⛔ FALSE for an UNGRADED character: with the layer dark there is no identity
|
|
320
|
+
* index to write into and the door 404s — "nobody looked" is not "nothing was
|
|
321
|
+
* seen". FALSE for any MACHINE-asserted binding, which implies the cluster the
|
|
322
|
+
* server refuses over.
|
|
323
|
+
*
|
|
324
|
+
* ⚠ It remains an APPROXIMATION in one direction, deliberately: a character
|
|
325
|
+
* whose cluster produced no passing crop grades `ABSENT` and still 409s. The
|
|
326
|
+
* door renders that refusal verbatim rather than pretending it cannot happen.
|
|
327
|
+
*/
|
|
328
|
+
export function mayGroundCharacterByHand(grounding) {
|
|
329
|
+
if (!grounding || !grounding.graded)
|
|
330
|
+
return false;
|
|
331
|
+
if (grounding.level === GROUNDING_LEVEL.ABSENT)
|
|
332
|
+
return true;
|
|
333
|
+
return (grounding.level === GROUNDING_LEVEL.WEAK
|
|
334
|
+
&& grounding.assertedBy === BINDING_PROVENANCE.HUMAN
|
|
335
|
+
&& grounding.characterClass === CHARACTER_CLASS.NON_FACIAL);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Whether the portrait family is currently BLOCKED for this character —
|
|
339
|
+
* i.e. §7 would refuse a paid render right now.
|
|
340
|
+
*
|
|
341
|
+
* Mirrors the server gate: ABSENT always blocks; WEAK blocks unless the
|
|
342
|
+
* per-character override is recorded OR a human asserted the identity
|
|
343
|
+
* themselves (§Q GROUND.75); VERIFIED runs. An ungraded character is not
|
|
344
|
+
* blocked (the layer is dark; every call site is on its pre-GROUND.10 path).
|
|
345
|
+
*
|
|
346
|
+
* The two WEAK-lifting inputs are the same one cell in `GATE_TABLE`, which is
|
|
347
|
+
* why they are one clause here: `evaluate_grounded_write` lifts the block on
|
|
348
|
+
* `weak_override or human_asserted`, and a mirror that disagreed would show a
|
|
349
|
+
* blocked state for a render the server performs.
|
|
350
|
+
*/
|
|
351
|
+
export function portraitBlockedByGrounding(grounding) {
|
|
352
|
+
if (!grounding || !grounding.graded)
|
|
353
|
+
return false;
|
|
354
|
+
if (grounding.level === GROUNDING_LEVEL.VERIFIED)
|
|
355
|
+
return false;
|
|
356
|
+
if (grounding.level === GROUNDING_LEVEL.WEAK) {
|
|
357
|
+
return !grounding.weakOverride && !isHumanConfirmed(grounding);
|
|
358
|
+
}
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* §Q GROUND.26 — whether a stored cast frame must be WITHHELD from the
|
|
363
|
+
* projection for this character.
|
|
364
|
+
*
|
|
365
|
+
* True for exactly one state: the CII **graded** this character and put its
|
|
366
|
+
* visual grounding at ABSENT. A frame can still exist for such a character —
|
|
367
|
+
* the pre-CII candidate walk picked one before the index existed, and §Q
|
|
368
|
+
* GROUND.8's producer never deletes, it counts the row `unreplaced`. That
|
|
369
|
+
* picture is the §7 hazard verbatim: an establishing shot, or somebody else's
|
|
370
|
+
* face, standing as the identity of a character the index says was not on
|
|
371
|
+
* screen. The ruling is SUPPRESS — never show a wrong frame, never delete data
|
|
372
|
+
* (the row stays, a re-grade resurrects it).
|
|
373
|
+
*
|
|
374
|
+
* ⛔ **KEYED ON `graded`, NOT ON THE LEVEL ALONE.** {@link CharacterGrounding}
|
|
375
|
+
* fails CLOSED to `absent` when the property is missing, and every video
|
|
376
|
+
* ingested before `ENABLE_GROUNDING_PRESENCE` was turned on (§P P56, 2026-08-05)
|
|
377
|
+
* has no CII at all — so a level-only test would blank the cast frames of every
|
|
378
|
+
* one of them. "We looked and saw nothing" withholds; "nobody looked" does
|
|
379
|
+
* not.
|
|
380
|
+
*
|
|
381
|
+
* ⛔ **WEAK AND VERIFIED ARE NEVER SUPPRESSED.** §7 stores WEAK flagged and
|
|
382
|
+
* VERIFIED plain; withholding those would hide evidence the index does back.
|
|
383
|
+
* There is also no override cell here — ABSENT is not overridable
|
|
384
|
+
* ({@link mayOverrideWeakGrounding}), so `weakOverride` cannot un-suppress.
|
|
385
|
+
*/
|
|
386
|
+
export function castFrameSuppressedByGrounding(grounding) {
|
|
387
|
+
if (!grounding || !grounding.graded)
|
|
388
|
+
return false;
|
|
389
|
+
return grounding.level === GROUNDING_LEVEL.ABSENT;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* A character named in the story that was never on screen. Spec Stage 9: it
|
|
393
|
+
* gets no frame, no portrait and no voice, and **the UI says so plainly**
|
|
394
|
+
* instead of inventing a face — this is the correct result, not a failure.
|
|
395
|
+
*/
|
|
396
|
+
export function isMentionedOnly(grounding) {
|
|
397
|
+
return grounding?.characterClass === CHARACTER_CLASS.MENTIONED_ONLY;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* A face the pipeline clustered but could not bind to a name (§13.6).
|
|
401
|
+
*
|
|
402
|
+
* ⚠ No read door serves these to a browser today — see this module's header.
|
|
403
|
+
* The predicate is here so the vocabulary has one home when one lands.
|
|
404
|
+
*/
|
|
405
|
+
export function isUnknownPerson(grounding) {
|
|
406
|
+
return grounding?.characterClass === CHARACTER_CLASS.UNKNOWN_PERSON;
|
|
407
|
+
}
|
|
408
|
+
//# sourceMappingURL=characterGrounding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characterGrounding.js","sourceRoot":"","sources":["../src/characterGrounding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACR,CAAC;AAIX,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAA8B,MAAM,CAAC,MAAM,CAAC;IAC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,OAAO,SAAS,CAAC,KAAK,KAAK,eAAe,CAAC,MAAM,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAgD;IAC9E,OAAO,SAAS,EAAE,cAAc,KAAK,eAAe,CAAC,cAAc,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,SAAgD;IAC9E,OAAO,SAAS,EAAE,cAAc,KAAK,eAAe,CAAC,cAAc,CAAC;AACtE,CAAC"}
|
|
@@ -73,6 +73,19 @@ export interface ConversationContextBinding {
|
|
|
73
73
|
* prompt is a no-op.
|
|
74
74
|
*/
|
|
75
75
|
systemPromptOverride?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* CHAT-U.3 — conversation-level keepalive knobs, threaded onto every per-turn
|
|
78
|
+
* send by `ConversationController.composeSendOptions` (chat-ws semantics:
|
|
79
|
+
* `SendActionMessage.heartbeatInterval` / `.idleTimeout`). These are NOT
|
|
80
|
+
* `buildHelloPayload` args (a hello carries no keepalive), so unlike every
|
|
81
|
+
* field above they are deliberately absent from {@link toHelloArgs} — the
|
|
82
|
+
* controller reads them off the binding directly. The ACTIVE participant's
|
|
83
|
+
* values win when it carries them (same overlay order as `personaId`), so a
|
|
84
|
+
* seated persona's own timings beat the conversation default. Undefined ⇒
|
|
85
|
+
* dropped from the frame; the backend then applies its 30s/120s defaults.
|
|
86
|
+
*/
|
|
87
|
+
heartbeatInterval?: number;
|
|
88
|
+
idleTimeout?: number;
|
|
76
89
|
}
|
|
77
90
|
/**
|
|
78
91
|
* The exact argument object `buildHelloPayload` accepts. Derived from the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../../src/conversation/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD;;;;;;;;;GASG;AACH,eAAO,MAAM,u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CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;OAUG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,0BAA0B,GAClC,IAAI,CACL,SAAS,EACP,SAAS,GACT,WAAW,GACX,UAAU,GACV,oBAAoB,GACpB,iBAAiB,GACjB,cAAc,GACd,sBAAsB,CACzB,CAkBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../src/conversation/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../src/conversation/binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,OAAO;IACd,cAAc,EAAE,gBAAgB;IAChC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAuEX;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,WAAW,CACzB,OAAmC;IAWnC,OAAO;QACL,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxD,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,OAAO,CAAC,kBAAkB;YAC5B,CAAC,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,EAAE;YACpD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YAC/D,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,EAAE;YACnD,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,YAAY;YACtB,CAAC,CAAC;gBACE,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,KAAK;aAC5D;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ChatSessionStore` + `ConversationTranscriptCache` (SP2 P1).
|
|
3
|
+
*
|
|
4
|
+
* Framework-agnostic owners of the two pieces of conversation persistence that
|
|
5
|
+
* lived INLINE in `web/app/chat-ws/page.tsx` (the proven creator/debug
|
|
6
|
+
* reference) and so could not be reused by the dashboard persona floater or
|
|
7
|
+
* `../Web-App`:
|
|
8
|
+
*
|
|
9
|
+
* 1. **Backend `ChatSession` CRUD orchestration** — the create-on-first-send,
|
|
10
|
+
* list-for-persona, restore→normalized-turns, persist user/assistant
|
|
11
|
+
* sequencing that the page wired by hand around the raw `ApiClient` session
|
|
12
|
+
* methods. The raw HTTP calls already live on `ApiClient` (the single
|
|
13
|
+
* transport); this is the ORCHESTRATION (the order + the shape mapping)
|
|
14
|
+
* lifted into one place so every persona-chat surface gets identical
|
|
15
|
+
* session behavior. The store NEVER re-implements transport — it composes
|
|
16
|
+
* the existing `ApiClient` methods.
|
|
17
|
+
*
|
|
18
|
+
* 2. **`localStorage` transcript cache** — the `videoId`-keyed conversation
|
|
19
|
+
* map the page persisted under `seer-agent-ws-chat-conversations-v2`, with
|
|
20
|
+
* the same tail-pruning (`MAX_CONVERSATION_MESSAGES`). Generic over the
|
|
21
|
+
* renderer's own message shape so the React `Message`/Vue equivalents both
|
|
22
|
+
* reuse it; storage access is injected (so it is testable + SSR-safe) and
|
|
23
|
+
* defaults to `globalThis.localStorage`.
|
|
24
|
+
*
|
|
25
|
+
* DRY: this is the SINGLE source of truth for session-persistence orchestration
|
|
26
|
+
* and transcript caching. The chat-ws page (and the floater) CONSUME it; they no
|
|
27
|
+
* longer keep inline copies. Additive-only — published as a new minor; no public
|
|
28
|
+
* export is removed/renamed (`../Web-App` pins client-core).
|
|
29
|
+
*/
|
|
30
|
+
import type { AddMessageRequest, ChatSession, CreateSessionRequest } from '../api';
|
|
31
|
+
/**
|
|
32
|
+
* The subset of `ApiClient` the store composes. Declared structurally (not as
|
|
33
|
+
* `Pick<ApiClient, …>`) so the store stays framework-agnostic and trivially
|
|
34
|
+
* mockable in tests; the real `ApiClient` satisfies it.
|
|
35
|
+
*/
|
|
36
|
+
export interface ChatSessionApi {
|
|
37
|
+
createSession(data: CreateSessionRequest): Promise<ChatSession>;
|
|
38
|
+
listSessions(params?: {
|
|
39
|
+
limit?: number;
|
|
40
|
+
nextToken?: string;
|
|
41
|
+
personaId?: string;
|
|
42
|
+
}): Promise<{
|
|
43
|
+
sessions: ChatSession[];
|
|
44
|
+
}>;
|
|
45
|
+
getSession(sessionId: string): Promise<ChatSession>;
|
|
46
|
+
addMessageToSession(sessionId: string, data: AddMessageRequest): Promise<ChatSession>;
|
|
47
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/** Page default — list size for the persona-scoped session sidebar. */
|
|
50
|
+
export declare const DEFAULT_SESSION_LIST_LIMIT = 50;
|
|
51
|
+
/**
|
|
52
|
+
* A session message normalized into the minimal shape every renderer needs to
|
|
53
|
+
* rebuild its transcript. The renderer maps these into its own message type
|
|
54
|
+
* (adding presentation-only fields — citations, images, a model id, an id), so
|
|
55
|
+
* the store stays free of any renderer schema. Mirrors the chat-ws page's
|
|
56
|
+
* restore mapping (page.tsx:852-860): `role` is narrowed to the chat roles, the
|
|
57
|
+
* timestamp is resolved to epoch-ms (now() when the backend omitted it).
|
|
58
|
+
*/
|
|
59
|
+
export interface RestoredSessionMessage {
|
|
60
|
+
role: 'user' | 'assistant';
|
|
61
|
+
content: string;
|
|
62
|
+
/** Epoch ms — `new Date(msg.timestamp).getTime()`, or now() when absent. */
|
|
63
|
+
timestamp: number;
|
|
64
|
+
}
|
|
65
|
+
/** The result of restoring a session — the normalized turns plus the
|
|
66
|
+
* session-level context (video/persona) the renderer re-selects. */
|
|
67
|
+
export interface RestoredSession {
|
|
68
|
+
sessionId: string;
|
|
69
|
+
videoId: string | null;
|
|
70
|
+
personaId: string | null;
|
|
71
|
+
messages: RestoredSessionMessage[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Wraps the backend `ChatSession` CRUD with the chat-ws page's exact
|
|
75
|
+
* orchestration so any persona-chat surface persists sessions identically.
|
|
76
|
+
* Stateless beyond the injected `ApiClient` — the renderer still owns
|
|
77
|
+
* `currentSessionId` / the session list state (this only performs the calls +
|
|
78
|
+
* the shape mapping). Construct one per `ApiClient`.
|
|
79
|
+
*/
|
|
80
|
+
export declare class ChatSessionStore {
|
|
81
|
+
private readonly api;
|
|
82
|
+
constructor(api: ChatSessionApi);
|
|
83
|
+
/**
|
|
84
|
+
* Create a backend session for the given persona/video. Mirrors
|
|
85
|
+
* `handleCreateSession` (page.tsx:808-827): the title defaults to a localized
|
|
86
|
+
* `Chat <date>` when omitted, and `videoId` is sent as `null` when unset.
|
|
87
|
+
*/
|
|
88
|
+
createSession(args: {
|
|
89
|
+
personaId: string;
|
|
90
|
+
videoId?: string | null;
|
|
91
|
+
title?: string;
|
|
92
|
+
}): Promise<ChatSession>;
|
|
93
|
+
/**
|
|
94
|
+
* List the sessions for a persona (the sidebar source). Mirrors the page's
|
|
95
|
+
* `listSessions({ limit: 50, personaId })` calls — one place for the limit
|
|
96
|
+
* default + the persona scope. `personaId` is optional and only forwarded
|
|
97
|
+
* when truthy (mirrors the page's `personaId: selectedPersonaId || undefined`
|
|
98
|
+
* — an unset persona lists the user's sessions unscoped).
|
|
99
|
+
*/
|
|
100
|
+
listForPersona(personaId?: string, limit?: number): Promise<ChatSession[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Restore a session and normalize its messages. Mirrors
|
|
103
|
+
* `handleRestoreSession` (page.tsx:844-882) — the renderer maps the returned
|
|
104
|
+
* `RestoredSessionMessage[]` into its own message objects and re-selects the
|
|
105
|
+
* session's `videoId` / `personaId`.
|
|
106
|
+
*/
|
|
107
|
+
restore(sessionId: string): Promise<RestoredSession>;
|
|
108
|
+
/**
|
|
109
|
+
* Append one message (user or assistant) to a session. Mirrors
|
|
110
|
+
* `handleSaveMessageToBackend` (page.tsx:830-841) — the single backend-persist
|
|
111
|
+
* call. The renderer decides WHEN to persist (e.g. assistant on stream-end);
|
|
112
|
+
* this owns only the call shape.
|
|
113
|
+
*/
|
|
114
|
+
saveMessage(sessionId: string, role: 'user' | 'assistant', content: string): Promise<ChatSession>;
|
|
115
|
+
/** Delete a session (sidebar trash). Mirrors `handleDeleteSession`. */
|
|
116
|
+
delete(sessionId: string): Promise<void>;
|
|
117
|
+
}
|
|
118
|
+
/** Bump when the persisted shape changes (the page used `'v2'`). Kept here so
|
|
119
|
+
* the storage key is single-sourced across consumers. */
|
|
120
|
+
export declare const TRANSCRIPT_CACHE_VERSION = "v2";
|
|
121
|
+
/** The page's storage key (`seer-agent-ws-chat-conversations-v2`). Single
|
|
122
|
+
* source of truth so a consumer can never drift the key. */
|
|
123
|
+
export declare const TRANSCRIPT_CACHE_KEY = "seer-agent-ws-chat-conversations-v2";
|
|
124
|
+
/** Max persisted turns per conversation (the page's `MAX_CONVERSATION_MESSAGES`). */
|
|
125
|
+
export declare const MAX_CONVERSATION_MESSAGES = 50;
|
|
126
|
+
/** The minimal `Storage` surface the cache needs — `globalThis.localStorage`
|
|
127
|
+
* satisfies it; tests inject a fake; SSR injects nothing (the cache no-ops). */
|
|
128
|
+
export interface TranscriptStorage {
|
|
129
|
+
getItem(key: string): string | null;
|
|
130
|
+
setItem(key: string, value: string): void;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Tail-prune a transcript to at most `limit` messages — keep the most recent.
|
|
134
|
+
* Mirrors the page's `pruneMessages` (page.tsx:171-174). Pure; exported so a
|
|
135
|
+
* consumer can prune before render too.
|
|
136
|
+
*/
|
|
137
|
+
export declare function pruneMessages<T>(messages: readonly T[], limit?: number): T[];
|
|
138
|
+
/**
|
|
139
|
+
* The `videoId`-keyed localStorage transcript cache (`ConversationTranscriptCache`).
|
|
140
|
+
* Generic over the renderer's message type `M` (it persists whatever the
|
|
141
|
+
* renderer hands it). All access goes through the injected `TranscriptStorage`,
|
|
142
|
+
* so it is SSR-safe (omit storage ⇒ every method no-ops) and testable. Mirrors
|
|
143
|
+
* the page's load/save/clear localStorage effects (page.tsx:944-980, 1773-1783)
|
|
144
|
+
* EXACTLY: same key, same per-`videoId` map, same tail-pruning on save, same
|
|
145
|
+
* malformed-JSON tolerance.
|
|
146
|
+
*/
|
|
147
|
+
export declare class ConversationTranscriptCache<M> {
|
|
148
|
+
private readonly storage;
|
|
149
|
+
private readonly key;
|
|
150
|
+
private readonly limit;
|
|
151
|
+
constructor(opts?: {
|
|
152
|
+
/** Defaults to `globalThis.localStorage` when available, else undefined
|
|
153
|
+
* (no-op — SSR / tests without a fake). */
|
|
154
|
+
storage?: TranscriptStorage;
|
|
155
|
+
/** Override the storage key (defaults to {@link TRANSCRIPT_CACHE_KEY}). */
|
|
156
|
+
key?: string;
|
|
157
|
+
/** Override the per-conversation tail limit. */
|
|
158
|
+
limit?: number;
|
|
159
|
+
});
|
|
160
|
+
/** The whole `{ [videoId]: M[] }` map (or `{}` on absent/malformed JSON). */
|
|
161
|
+
private readAll;
|
|
162
|
+
/**
|
|
163
|
+
* Load the persisted transcript for one conversation. Returns `[]` for an
|
|
164
|
+
* absent/empty/malformed entry (mirrors page.tsx:945-968). An empty `videoId`
|
|
165
|
+
* also yields `[]` (the page treated falsy `selectedVideoId` as "no
|
|
166
|
+
* conversation").
|
|
167
|
+
*/
|
|
168
|
+
load(videoId: string): M[];
|
|
169
|
+
/**
|
|
170
|
+
* Persist a conversation's transcript (tail-pruned to the limit). No-op when
|
|
171
|
+
* `videoId` is empty or `messages` is empty — matching the page's save effect
|
|
172
|
+
* guard (page.tsx:972: `if (!selectedVideoId || messages.length === 0) return`).
|
|
173
|
+
*/
|
|
174
|
+
save(videoId: string, messages: readonly M[]): void;
|
|
175
|
+
/** Drop one conversation's transcript (the page's `clearConversation`). */
|
|
176
|
+
clear(videoId: string): void;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=chatSessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatSessionStore.d.ts","sourceRoot":"","sources":["../../src/conversation/chatSessionStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACrB,MAAM,QAAQ,CAAC;AAEhB;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAChE,YAAY,CAAC,MAAM,CAAC,EAAE;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,S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