@escapeaihq/client-core 0.52.0 → 0.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +445 -153
- package/dist/adapters/capabilities.d.ts +20 -3
- package/dist/adapters/capabilities.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.d.ts +5 -4
- package/dist/adapters/directorAdapter.d.ts.map +1 -1
- package/dist/adapters/directorAdapter.js +5 -4
- package/dist/adapters/directorAdapter.js.map +1 -1
- package/dist/adapters/experienceModelCatalog.d.ts +382 -0
- package/dist/adapters/experienceModelCatalog.d.ts.map +1 -0
- package/dist/adapters/experienceModelCatalog.js +401 -0
- package/dist/adapters/experienceModelCatalog.js.map +1 -0
- package/dist/adapters/extractionAdapter.d.ts +81 -0
- package/dist/adapters/extractionAdapter.d.ts.map +1 -0
- package/dist/adapters/extractionAdapter.js +98 -0
- package/dist/adapters/extractionAdapter.js.map +1 -0
- package/dist/adapters/imageAdapter.d.ts +5 -1
- package/dist/adapters/imageAdapter.d.ts.map +1 -1
- package/dist/adapters/imageAdapter.js +5 -1
- package/dist/adapters/imageAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +54 -16
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +62 -11
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/momentDirective.d.ts +66 -0
- package/dist/adapters/momentDirective.d.ts.map +1 -0
- package/dist/adapters/momentDirective.js +78 -0
- package/dist/adapters/momentDirective.js.map +1 -0
- package/dist/adapters/momentPolicy.d.ts +132 -0
- package/dist/adapters/momentPolicy.d.ts.map +1 -0
- package/dist/adapters/momentPolicy.js +165 -0
- package/dist/adapters/momentPolicy.js.map +1 -0
- package/dist/adapters/registry.d.ts +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/videoGenAdapter.d.ts +55 -0
- package/dist/adapters/videoGenAdapter.d.ts.map +1 -0
- package/dist/adapters/videoGenAdapter.js +78 -0
- package/dist/adapters/videoGenAdapter.js.map +1 -0
- package/dist/adapters/worldAdapter.d.ts +132 -11
- package/dist/adapters/worldAdapter.d.ts.map +1 -1
- package/dist/adapters/worldAdapter.js +127 -11
- package/dist/adapters/worldAdapter.js.map +1 -1
- package/dist/adapters/worldModelPreference.d.ts +173 -0
- package/dist/adapters/worldModelPreference.d.ts.map +1 -0
- package/dist/adapters/worldModelPreference.js +209 -0
- package/dist/adapters/worldModelPreference.js.map +1 -0
- package/dist/adapters/worldModelTradeoffs.d.ts +120 -0
- package/dist/adapters/worldModelTradeoffs.d.ts.map +1 -0
- package/dist/adapters/worldModelTradeoffs.js +154 -0
- package/dist/adapters/worldModelTradeoffs.js.map +1 -0
- package/dist/admin.d.ts +545 -0
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +230 -16
- package/dist/admin.js.map +1 -1
- package/dist/api.d.ts +10295 -2216
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4187 -1240
- package/dist/api.js.map +1 -1
- package/dist/arcBoardJoin.d.ts +38 -0
- package/dist/arcBoardJoin.d.ts.map +1 -0
- package/dist/arcBoardJoin.js +37 -0
- package/dist/arcBoardJoin.js.map +1 -0
- package/dist/arcPreview.d.ts +49 -0
- package/dist/arcPreview.d.ts.map +1 -0
- package/dist/arcPreview.js +65 -0
- package/dist/arcPreview.js.map +1 -0
- package/dist/audio.d.ts +259 -16
- package/dist/audio.d.ts.map +1 -1
- package/dist/audio.js +605 -114
- package/dist/audio.js.map +1 -1
- package/dist/audioDsp.d.ts +45 -0
- package/dist/audioDsp.d.ts.map +1 -0
- package/dist/audioDsp.js +108 -0
- package/dist/audioDsp.js.map +1 -0
- package/dist/audioProtocol.d.ts +160 -0
- package/dist/audioProtocol.d.ts.map +1 -1
- package/dist/audioProtocol.js +99 -0
- package/dist/audioProtocol.js.map +1 -1
- package/dist/beatTitles.d.ts +33 -0
- package/dist/beatTitles.d.ts.map +1 -0
- package/dist/beatTitles.js +39 -0
- package/dist/beatTitles.js.map +1 -0
- package/dist/castProjection.d.ts +204 -1
- package/dist/castProjection.d.ts.map +1 -1
- package/dist/castProjection.js +202 -0
- package/dist/castProjection.js.map +1 -1
- package/dist/characterGrounding.d.ts +369 -0
- package/dist/characterGrounding.d.ts.map +1 -0
- package/dist/characterGrounding.js +408 -0
- package/dist/characterGrounding.js.map +1 -0
- package/dist/conversation/binding.d.ts +13 -0
- package/dist/conversation/binding.d.ts.map +1 -1
- package/dist/conversation/binding.js.map +1 -1
- package/dist/conversation/chatSessionStore.d.ts +178 -0
- package/dist/conversation/chatSessionStore.d.ts.map +1 -0
- package/dist/conversation/chatSessionStore.js +196 -0
- package/dist/conversation/chatSessionStore.js.map +1 -0
- package/dist/conversation/controller.d.ts +44 -0
- package/dist/conversation/controller.d.ts.map +1 -1
- package/dist/conversation/controller.js +82 -3
- package/dist/conversation/controller.js.map +1 -1
- package/dist/conversation/index.d.ts +2 -0
- package/dist/conversation/index.d.ts.map +1 -1
- package/dist/conversation/index.js +2 -0
- package/dist/conversation/index.js.map +1 -1
- package/dist/conversation/participant.d.ts +16 -0
- package/dist/conversation/participant.d.ts.map +1 -1
- package/dist/conversation/readSequencer.d.ts +38 -0
- package/dist/conversation/readSequencer.d.ts.map +1 -0
- package/dist/conversation/readSequencer.js +42 -0
- package/dist/conversation/readSequencer.js.map +1 -0
- package/dist/conversation/roster.d.ts +5 -1
- package/dist/conversation/roster.d.ts.map +1 -1
- package/dist/conversation/roster.js.map +1 -1
- package/dist/conversation/rosterProjection.d.ts +74 -1
- package/dist/conversation/rosterProjection.d.ts.map +1 -1
- package/dist/conversation/rosterProjection.js +135 -1
- package/dist/conversation/rosterProjection.js.map +1 -1
- package/dist/conversation/runtime.d.ts +20 -3
- package/dist/conversation/runtime.d.ts.map +1 -1
- package/dist/conversation/runtime.js +66 -7
- package/dist/conversation/runtime.js.map +1 -1
- package/dist/conversation/types.d.ts +43 -4
- package/dist/conversation/types.d.ts.map +1 -1
- package/dist/conversation/voice.d.ts +290 -13
- package/dist/conversation/voice.d.ts.map +1 -1
- package/dist/conversation/voice.js +565 -42
- package/dist/conversation/voice.js.map +1 -1
- package/dist/creatorCuration.d.ts +134 -0
- package/dist/creatorCuration.d.ts.map +1 -0
- package/dist/creatorCuration.js +228 -0
- package/dist/creatorCuration.js.map +1 -0
- package/dist/creatorDashboard.d.ts +155 -0
- package/dist/creatorDashboard.d.ts.map +1 -0
- package/dist/creatorDashboard.js +237 -0
- package/dist/creatorDashboard.js.map +1 -0
- package/dist/creatorUniverse.d.ts +95 -0
- package/dist/creatorUniverse.d.ts.map +1 -0
- package/dist/creatorUniverse.js +136 -0
- package/dist/creatorUniverse.js.map +1 -0
- package/dist/curationWrite.d.ts +76 -0
- package/dist/curationWrite.d.ts.map +1 -0
- package/dist/curationWrite.js +106 -0
- package/dist/curationWrite.js.map +1 -0
- package/dist/designTokens.d.ts +64 -0
- package/dist/designTokens.d.ts.map +1 -0
- package/dist/designTokens.js +117 -0
- package/dist/designTokens.js.map +1 -0
- package/dist/dialogAttribution.d.ts +79 -0
- package/dist/dialogAttribution.d.ts.map +1 -0
- package/dist/dialogAttribution.js +144 -0
- package/dist/dialogAttribution.js.map +1 -0
- package/dist/dmRunWorldReadiness.d.ts +605 -0
- package/dist/dmRunWorldReadiness.d.ts.map +1 -0
- package/dist/dmRunWorldReadiness.js +775 -0
- package/dist/dmRunWorldReadiness.js.map +1 -0
- package/dist/domains/access.d.ts +32 -0
- package/dist/domains/access.d.ts.map +1 -0
- package/dist/domains/access.js +43 -0
- package/dist/domains/access.js.map +1 -0
- package/dist/domains/adventureDefinitions.d.ts +159 -0
- package/dist/domains/adventureDefinitions.d.ts.map +1 -0
- package/dist/domains/adventureDefinitions.js +168 -0
- package/dist/domains/adventureDefinitions.js.map +1 -0
- package/dist/domains/adventures.d.ts +329 -0
- package/dist/domains/adventures.d.ts.map +1 -0
- package/dist/domains/adventures.js +359 -0
- package/dist/domains/adventures.js.map +1 -0
- package/dist/domains/arcs.d.ts +146 -0
- package/dist/domains/arcs.d.ts.map +1 -0
- package/dist/domains/arcs.js +202 -0
- package/dist/domains/arcs.js.map +1 -0
- package/dist/domains/artifacts.d.ts +259 -0
- package/dist/domains/artifacts.d.ts.map +1 -0
- package/dist/domains/artifacts.js +125 -0
- package/dist/domains/artifacts.js.map +1 -0
- package/dist/domains/chat.d.ts +158 -0
- package/dist/domains/chat.d.ts.map +1 -0
- package/dist/domains/chat.js +224 -0
- package/dist/domains/chat.js.map +1 -0
- package/dist/domains/decisions.d.ts +31 -0
- package/dist/domains/decisions.d.ts.map +1 -0
- package/dist/domains/decisions.js +42 -0
- package/dist/domains/decisions.js.map +1 -0
- package/dist/domains/documents.d.ts +218 -0
- package/dist/domains/documents.d.ts.map +1 -0
- package/dist/domains/documents.js +252 -0
- package/dist/domains/documents.js.map +1 -0
- package/dist/domains/enhancements.d.ts +106 -0
- package/dist/domains/enhancements.d.ts.map +1 -0
- package/dist/domains/enhancements.js +160 -0
- package/dist/domains/enhancements.js.map +1 -0
- package/dist/domains/graph.d.ts +454 -0
- package/dist/domains/graph.d.ts.map +1 -0
- package/dist/domains/graph.js +648 -0
- package/dist/domains/graph.js.map +1 -0
- package/dist/domains/images.d.ts +220 -0
- package/dist/domains/images.d.ts.map +1 -0
- package/dist/domains/images.js +307 -0
- package/dist/domains/images.js.map +1 -0
- package/dist/domains/ingestion.d.ts +312 -0
- package/dist/domains/ingestion.d.ts.map +1 -0
- package/dist/domains/ingestion.js +495 -0
- package/dist/domains/ingestion.js.map +1 -0
- package/dist/domains/me.d.ts +21 -0
- package/dist/domains/me.d.ts.map +1 -0
- package/dist/domains/me.js +23 -0
- package/dist/domains/me.js.map +1 -0
- package/dist/domains/orgs.d.ts +47 -0
- package/dist/domains/orgs.d.ts.map +1 -0
- package/dist/domains/orgs.js +75 -0
- package/dist/domains/orgs.js.map +1 -0
- package/dist/domains/personas.d.ts +138 -0
- package/dist/domains/personas.d.ts.map +1 -0
- package/dist/domains/personas.js +322 -0
- package/dist/domains/personas.js.map +1 -0
- package/dist/domains/projects.d.ts +53 -0
- package/dist/domains/projects.d.ts.map +1 -0
- package/dist/domains/projects.js +94 -0
- package/dist/domains/projects.js.map +1 -0
- package/dist/domains/quests.d.ts +431 -0
- package/dist/domains/quests.d.ts.map +1 -0
- package/dist/domains/quests.js +61 -0
- package/dist/domains/quests.js.map +1 -0
- package/dist/domains/reactor.d.ts +98 -0
- package/dist/domains/reactor.d.ts.map +1 -0
- package/dist/domains/reactor.js +131 -0
- package/dist/domains/reactor.js.map +1 -0
- package/dist/domains/showcase.d.ts +28 -0
- package/dist/domains/showcase.d.ts.map +1 -0
- package/dist/domains/showcase.js +28 -0
- package/dist/domains/showcase.js.map +1 -0
- package/dist/domains/storyboards.d.ts +1253 -0
- package/dist/domains/storyboards.d.ts.map +1 -0
- package/dist/domains/storyboards.js +781 -0
- package/dist/domains/storyboards.js.map +1 -0
- package/dist/domains/studioSettings.d.ts +39 -0
- package/dist/domains/studioSettings.d.ts.map +1 -0
- package/dist/domains/studioSettings.js +80 -0
- package/dist/domains/studioSettings.js.map +1 -0
- package/dist/domains/universes.d.ts +191 -0
- package/dist/domains/universes.d.ts.map +1 -0
- package/dist/domains/universes.js +276 -0
- package/dist/domains/universes.js.map +1 -0
- package/dist/domains/userDefaults.d.ts +18 -0
- package/dist/domains/userDefaults.d.ts.map +1 -0
- package/dist/domains/userDefaults.js +27 -0
- package/dist/domains/userDefaults.js.map +1 -0
- package/dist/domains/visemeBundles.d.ts +262 -0
- package/dist/domains/visemeBundles.d.ts.map +1 -0
- package/dist/domains/visemeBundles.js +373 -0
- package/dist/domains/visemeBundles.js.map +1 -0
- package/dist/domains/workflows.d.ts +142 -0
- package/dist/domains/workflows.d.ts.map +1 -0
- package/dist/domains/workflows.js +245 -0
- package/dist/domains/workflows.js.map +1 -0
- package/dist/enhancementDiff.d.ts +56 -0
- package/dist/enhancementDiff.d.ts.map +1 -0
- package/dist/enhancementDiff.js +110 -0
- package/dist/enhancementDiff.js.map +1 -0
- package/dist/generated/contract.d.ts +372 -0
- package/dist/generated/contract.d.ts.map +1 -0
- package/dist/generated/contract.js +395 -0
- package/dist/generated/contract.js.map +1 -0
- package/dist/graphSchema.d.ts +36 -5
- package/dist/graphSchema.d.ts.map +1 -1
- package/dist/graphSchema.js +88 -2
- package/dist/graphSchema.js.map +1 -1
- package/dist/http.d.ts +70 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +263 -11
- package/dist/http.js.map +1 -1
- package/dist/identity.d.ts +81 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +65 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -1
- package/dist/messageContent.d.ts +174 -0
- package/dist/messageContent.d.ts.map +1 -0
- package/dist/messageContent.js +405 -0
- package/dist/messageContent.js.map +1 -0
- package/dist/mutationEpoch.d.ts +83 -0
- package/dist/mutationEpoch.d.ts.map +1 -0
- package/dist/mutationEpoch.js +109 -0
- package/dist/mutationEpoch.js.map +1 -0
- package/dist/obo.d.ts +144 -0
- package/dist/obo.d.ts.map +1 -0
- package/dist/obo.js +135 -0
- package/dist/obo.js.map +1 -0
- package/dist/opusTransport.d.ts +113 -0
- package/dist/opusTransport.d.ts.map +1 -0
- package/dist/opusTransport.js +170 -0
- package/dist/opusTransport.js.map +1 -0
- package/dist/pagination.d.ts +18 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +26 -0
- package/dist/pagination.js.map +1 -0
- package/dist/platformAssistant.d.ts +55 -1
- package/dist/platformAssistant.d.ts.map +1 -1
- package/dist/platformAssistant.js +39 -1
- package/dist/platformAssistant.js.map +1 -1
- package/dist/pollUtils.d.ts +19 -0
- package/dist/pollUtils.d.ts.map +1 -0
- package/dist/pollUtils.js +35 -0
- package/dist/pollUtils.js.map +1 -0
- package/dist/questLog.d.ts +232 -0
- package/dist/questLog.d.ts.map +1 -0
- package/dist/questLog.js +522 -0
- package/dist/questLog.js.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts +300 -0
- package/dist/reactor/dmDirectiveToExperience.d.ts.map +1 -0
- package/dist/reactor/dmDirectiveToExperience.js +401 -0
- package/dist/reactor/dmDirectiveToExperience.js.map +1 -0
- package/dist/reactor/dmSceneControlPrompt.d.ts.map +1 -1
- package/dist/reactor/dmSceneControlPrompt.js +64 -2
- package/dist/reactor/dmSceneControlPrompt.js.map +1 -1
- package/dist/reactor/dmWorldEntry.d.ts +1278 -0
- package/dist/reactor/dmWorldEntry.d.ts.map +1 -0
- package/dist/reactor/dmWorldEntry.js +1396 -0
- package/dist/reactor/dmWorldEntry.js.map +1 -0
- package/dist/reactor/framePromptCompaction.d.ts +223 -0
- package/dist/reactor/framePromptCompaction.d.ts.map +1 -0
- package/dist/reactor/framePromptCompaction.js +393 -0
- package/dist/reactor/framePromptCompaction.js.map +1 -0
- package/dist/reactor/frameWorldBind.d.ts +86 -0
- package/dist/reactor/frameWorldBind.d.ts.map +1 -0
- package/dist/reactor/frameWorldBind.js +79 -0
- package/dist/reactor/frameWorldBind.js.map +1 -0
- package/dist/reactor/happyOysterSeed.d.ts +166 -0
- package/dist/reactor/happyOysterSeed.d.ts.map +1 -0
- package/dist/reactor/happyOysterSeed.js +233 -0
- package/dist/reactor/happyOysterSeed.js.map +1 -0
- package/dist/reactor/happyOysterWalk.d.ts +274 -0
- package/dist/reactor/happyOysterWalk.d.ts.map +1 -0
- package/dist/reactor/happyOysterWalk.js +407 -0
- package/dist/reactor/happyOysterWalk.js.map +1 -0
- package/dist/reactor/happyOysterWorld.d.ts +718 -0
- package/dist/reactor/happyOysterWorld.d.ts.map +1 -0
- package/dist/reactor/happyOysterWorld.js +826 -0
- package/dist/reactor/happyOysterWorld.js.map +1 -0
- package/dist/reactor/heliosCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/heliosCommandDispatcher.js +5 -2
- package/dist/reactor/heliosCommandDispatcher.js.map +1 -1
- package/dist/reactor/hiddenWorldLifecycle.d.ts +101 -0
- package/dist/reactor/hiddenWorldLifecycle.d.ts.map +1 -0
- package/dist/reactor/hiddenWorldLifecycle.js +119 -0
- package/dist/reactor/hiddenWorldLifecycle.js.map +1 -0
- package/dist/reactor/imageCanvas.d.ts +15 -0
- package/dist/reactor/imageCanvas.d.ts.map +1 -0
- package/dist/reactor/imageCanvas.js +33 -0
- package/dist/reactor/imageCanvas.js.map +1 -0
- package/dist/reactor/index.d.ts +19 -0
- package/dist/reactor/index.d.ts.map +1 -1
- package/dist/reactor/index.js +78 -0
- package/dist/reactor/index.js.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.d.ts +23 -8
- package/dist/reactor/longLiveCommandDispatcher.d.ts.map +1 -1
- package/dist/reactor/longLiveCommandDispatcher.js +16 -4
- package/dist/reactor/longLiveCommandDispatcher.js.map +1 -1
- package/dist/reactor/longLiveSceneEntry.d.ts +203 -0
- package/dist/reactor/longLiveSceneEntry.d.ts.map +1 -0
- package/dist/reactor/longLiveSceneEntry.js +280 -0
- package/dist/reactor/longLiveSceneEntry.js.map +1 -0
- package/dist/reactor/momentCut.d.ts +153 -0
- package/dist/reactor/momentCut.d.ts.map +1 -0
- package/dist/reactor/momentCut.js +142 -0
- package/dist/reactor/momentCut.js.map +1 -0
- package/dist/reactor/promptAddonRegistry.d.ts +39 -3
- package/dist/reactor/promptAddonRegistry.d.ts.map +1 -1
- package/dist/reactor/promptAddonRegistry.js +42 -3
- package/dist/reactor/promptAddonRegistry.js.map +1 -1
- package/dist/reactor/promptTemplatePreview.d.ts +97 -0
- package/dist/reactor/promptTemplatePreview.d.ts.map +1 -0
- package/dist/reactor/promptTemplatePreview.js +185 -0
- package/dist/reactor/promptTemplatePreview.js.map +1 -0
- package/dist/reactor/reactorAvailability.d.ts +80 -0
- package/dist/reactor/reactorAvailability.d.ts.map +1 -0
- package/dist/reactor/reactorAvailability.js +121 -0
- package/dist/reactor/reactorAvailability.js.map +1 -0
- package/dist/reactor/reactorSessionRefusal.d.ts +125 -0
- package/dist/reactor/reactorSessionRefusal.d.ts.map +1 -0
- package/dist/reactor/reactorSessionRefusal.js +197 -0
- package/dist/reactor/reactorSessionRefusal.js.map +1 -0
- package/dist/reactor/reactorTokenScope.d.ts +47 -0
- package/dist/reactor/reactorTokenScope.d.ts.map +1 -0
- package/dist/reactor/reactorTokenScope.js +64 -0
- package/dist/reactor/reactorTokenScope.js.map +1 -0
- package/dist/reactor/resolveDirectorBeats.d.ts +65 -0
- package/dist/reactor/resolveDirectorBeats.d.ts.map +1 -0
- package/dist/reactor/resolveDirectorBeats.js +86 -0
- package/dist/reactor/resolveDirectorBeats.js.map +1 -0
- package/dist/reactor/sanaLiveEdit.d.ts +117 -0
- package/dist/reactor/sanaLiveEdit.d.ts.map +1 -0
- package/dist/reactor/sanaLiveEdit.js +105 -0
- package/dist/reactor/sanaLiveEdit.js.map +1 -0
- package/dist/reactor/sceneEntry.d.ts +66 -9
- package/dist/reactor/sceneEntry.d.ts.map +1 -1
- package/dist/reactor/sceneEntry.js +59 -66
- package/dist/reactor/sceneEntry.js.map +1 -1
- package/dist/reactor/sceneSeedImage.d.ts +199 -0
- package/dist/reactor/sceneSeedImage.d.ts.map +1 -0
- package/dist/reactor/sceneSeedImage.js +239 -0
- package/dist/reactor/sceneSeedImage.js.map +1 -0
- package/dist/reactor/seedImageOrchestrator.d.ts +70 -3
- package/dist/reactor/seedImageOrchestrator.d.ts.map +1 -1
- package/dist/reactor/seedImageOrchestrator.js +92 -28
- package/dist/reactor/seedImageOrchestrator.js.map +1 -1
- package/dist/reactor/toolPromptAddon.d.ts.map +1 -1
- package/dist/reactor/toolPromptAddon.js +16 -2
- package/dist/reactor/toolPromptAddon.js.map +1 -1
- package/dist/reactor/worldMintLoop.d.ts +286 -0
- package/dist/reactor/worldMintLoop.d.ts.map +1 -0
- package/dist/reactor/worldMintLoop.js +381 -0
- package/dist/reactor/worldMintLoop.js.map +1 -0
- package/dist/reactor/worldSteerOutcome.d.ts +98 -0
- package/dist/reactor/worldSteerOutcome.d.ts.map +1 -0
- package/dist/reactor/worldSteerOutcome.js +81 -0
- package/dist/reactor/worldSteerOutcome.js.map +1 -0
- package/dist/retryAfter.d.ts +15 -0
- package/dist/retryAfter.d.ts.map +1 -0
- package/dist/retryAfter.js +75 -0
- package/dist/retryAfter.js.map +1 -0
- package/dist/seriesKey.d.ts +31 -0
- package/dist/seriesKey.d.ts.map +1 -0
- package/dist/seriesKey.js +33 -0
- package/dist/seriesKey.js.map +1 -0
- package/dist/sessionRefresh.d.ts +135 -0
- package/dist/sessionRefresh.d.ts.map +1 -0
- package/dist/sessionRefresh.js +215 -0
- package/dist/sessionRefresh.js.map +1 -0
- package/dist/sharedAudioContext.d.ts +39 -0
- package/dist/sharedAudioContext.d.ts.map +1 -0
- package/dist/sharedAudioContext.js +63 -0
- package/dist/sharedAudioContext.js.map +1 -0
- package/dist/singleFlight.d.ts +51 -0
- package/dist/singleFlight.d.ts.map +1 -0
- package/dist/singleFlight.js +87 -0
- package/dist/singleFlight.js.map +1 -0
- package/dist/storyGraph.d.ts +83 -0
- package/dist/storyGraph.d.ts.map +1 -1
- package/dist/storyGraph.js +169 -4
- package/dist/storyGraph.js.map +1 -1
- package/dist/storyboardMask.d.ts +343 -0
- package/dist/storyboardMask.d.ts.map +1 -0
- package/dist/storyboardMask.js +505 -0
- package/dist/storyboardMask.js.map +1 -0
- package/dist/storyboardTimeline.d.ts +93 -0
- package/dist/storyboardTimeline.d.ts.map +1 -0
- package/dist/storyboardTimeline.js +131 -0
- package/dist/storyboardTimeline.js.map +1 -0
- package/dist/studioAutomation.d.ts +104 -0
- package/dist/studioAutomation.d.ts.map +1 -0
- package/dist/studioAutomation.js +178 -0
- package/dist/studioAutomation.js.map +1 -0
- package/dist/tenantClaim.d.ts +86 -0
- package/dist/tenantClaim.d.ts.map +1 -0
- package/dist/tenantClaim.js +164 -0
- package/dist/tenantClaim.js.map +1 -0
- package/dist/timeFormat.d.ts +25 -0
- package/dist/timeFormat.d.ts.map +1 -1
- package/dist/timeFormat.js +56 -0
- package/dist/timeFormat.js.map +1 -1
- package/dist/toolSchemas.d.ts +58 -10
- package/dist/toolSchemas.d.ts.map +1 -1
- package/dist/toolSchemas.js +37 -9
- package/dist/toolSchemas.js.map +1 -1
- package/dist/transport.d.ts +120 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +282 -0
- package/dist/transport.js.map +1 -0
- package/dist/videoGenFacade.d.ts +63 -0
- package/dist/videoGenFacade.d.ts.map +1 -0
- package/dist/videoGenFacade.js +49 -0
- package/dist/videoGenFacade.js.map +1 -0
- package/dist/visemeScheduler.d.ts +24 -2
- package/dist/visemeScheduler.d.ts.map +1 -1
- package/dist/visemeScheduler.js +31 -2
- package/dist/visemeScheduler.js.map +1 -1
- package/dist/vision/VisionPublisher.d.ts +88 -0
- package/dist/vision/VisionPublisher.d.ts.map +1 -1
- package/dist/vision/VisionPublisher.js +196 -13
- package/dist/vision/VisionPublisher.js.map +1 -1
- package/dist/vision/VisionSourceController.d.ts +67 -1
- package/dist/vision/VisionSourceController.d.ts.map +1 -1
- package/dist/vision/VisionSourceController.js +147 -5
- package/dist/vision/VisionSourceController.js.map +1 -1
- package/dist/vision/index.d.ts +2 -1
- package/dist/vision/index.d.ts.map +1 -1
- package/dist/vision/index.js +2 -1
- package/dist/vision/index.js.map +1 -1
- package/dist/vision/sourceKinds.d.ts +18 -5
- package/dist/vision/sourceKinds.d.ts.map +1 -1
- package/dist/vision/sourceKinds.js +15 -2
- package/dist/vision/sourceKinds.js.map +1 -1
- package/dist/vision/types.d.ts +7 -4
- package/dist/vision/types.d.ts.map +1 -1
- package/dist/vision/visionErrors.d.ts +45 -0
- package/dist/vision/visionErrors.d.ts.map +1 -0
- package/dist/vision/visionErrors.js +66 -0
- package/dist/vision/visionErrors.js.map +1 -0
- package/dist/voiceCloneCaption.d.ts +33 -0
- package/dist/voiceCloneCaption.d.ts.map +1 -0
- package/dist/voiceCloneCaption.js +69 -0
- package/dist/voiceCloneCaption.js.map +1 -0
- package/dist/websocket.d.ts +273 -10
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +79 -0
- package/dist/websocket.js.map +1 -1
- package/dist/workflowAuthoring.d.ts +139 -0
- package/dist/workflowAuthoring.d.ts.map +1 -0
- package/dist/workflowAuthoring.js +557 -0
- package/dist/workflowAuthoring.js.map +1 -0
- package/package.json +15 -5
- package/src/__tests__/adapters-director.test.ts +9 -6
- package/src/__tests__/adapters-extraction.test.ts +175 -0
- package/src/__tests__/adapters-image.test.ts +66 -0
- package/src/__tests__/adapters-momentPolicy.test.ts +218 -0
- package/src/__tests__/adapters-platform.test.ts +110 -4
- package/src/__tests__/adapters-videogen.test.ts +53 -0
- package/src/__tests__/adapters-world.test.ts +117 -7
- package/src/__tests__/admin.enhancement-defaults.test.ts +115 -0
- package/src/__tests__/admin.test.ts +282 -0
- package/src/__tests__/adventures-world-state.test.ts +156 -0
- package/src/__tests__/adventures.test.ts +111 -1
- package/src/__tests__/api-pollers.test.ts +113 -23
- package/src/__tests__/api.adventure-definitions.test.ts +312 -0
- package/src/__tests__/api.anchor-beat.test.ts +75 -0
- package/src/__tests__/api.arc-approval.test.ts +171 -0
- package/src/__tests__/api.arc-beats-floor.test.ts +56 -0
- package/src/__tests__/api.arc-generation.test.ts +168 -0
- package/src/__tests__/api.arc-templates.test.ts +78 -0
- package/src/__tests__/api.assignVideoSeries.test.ts +81 -0
- package/src/__tests__/api.cast-frame-choices.test.ts +141 -0
- package/src/__tests__/api.cutscene-registry.test.ts +148 -0
- package/src/__tests__/api.enhancement-addition-actions.test.ts +137 -0
- package/src/__tests__/api.enrichVideo-serialization.test.ts +116 -0
- package/src/__tests__/api.extraction-base.test.ts +87 -0
- package/src/__tests__/api.generateVideo-cutscene.test.ts +148 -0
- package/src/__tests__/api.job-pipeline-stages.test.ts +128 -0
- package/src/__tests__/api.list-images-filters.test.ts +6 -3
- package/src/__tests__/api.quest-curation.test.ts +169 -0
- package/src/__tests__/api.reprocessVideo.test.ts +71 -0
- package/src/__tests__/api.scene-split-merge.test.ts +129 -0
- package/src/__tests__/api.session-quests.test.ts +184 -0
- package/src/__tests__/api.test.ts +122 -0
- package/src/__tests__/api.transferSeries.test.ts +114 -0
- package/src/__tests__/api.unknown-clusters.test.ts +225 -0
- package/src/__tests__/api.uploadVideo-options.test.ts +156 -0
- package/src/__tests__/arcPreview.test.ts +71 -0
- package/src/__tests__/arcStyleProfile.test.ts +204 -0
- package/src/__tests__/artifacts-delete.test.ts +109 -0
- package/src/__tests__/audio.test.ts +864 -5
- package/src/__tests__/audioDsp.test.ts +196 -0
- package/src/__tests__/audioUnavailable.test.ts +43 -0
- package/src/__tests__/cast.test.ts +10 -1
- package/src/__tests__/castCurationProjection.test.ts +84 -0
- package/src/__tests__/castFramePipelinePending.test.ts +171 -0
- package/src/__tests__/castProjection.test.ts +497 -5
- package/src/__tests__/characterGrounding.test.ts +357 -0
- package/src/__tests__/contract.test.ts +97 -0
- package/src/__tests__/conversation/chatSessionStore.test.ts +243 -0
- package/src/__tests__/conversation/controller.test.ts +211 -0
- package/src/__tests__/conversation/readSequencer.test.ts +52 -0
- package/src/__tests__/conversation/rosterProjection.test.ts +204 -3
- package/src/__tests__/conversation/runtime.test.ts +118 -1
- package/src/__tests__/conversation/voice.test.ts +741 -7
- package/src/__tests__/creatorCuration.test.ts +256 -0
- package/src/__tests__/creatorDashboard.test.ts +444 -0
- package/src/__tests__/creatorUniverse.test.ts +138 -0
- package/src/__tests__/curationWrite.test.ts +179 -0
- package/src/__tests__/decisions.test.ts +89 -0
- package/src/__tests__/designTokens.test.ts +72 -0
- package/src/__tests__/dialogAttribution.test.ts +187 -0
- package/src/__tests__/dmDirectiveToExperience.test.ts +198 -0
- package/src/__tests__/dmWorldEntry.test.ts +2102 -0
- package/src/__tests__/enhancementDiff.test.ts +132 -0
- package/src/__tests__/experienceModelCatalog.test.ts +292 -0
- package/src/__tests__/extractionStageState.test.ts +67 -0
- package/src/__tests__/getVideo.test.ts +95 -0
- package/src/__tests__/graphReadAfterWrite.test.ts +211 -0
- package/src/__tests__/graphSchema.test.ts +55 -4
- package/src/__tests__/happyOysterSeed.test.ts +208 -0
- package/src/__tests__/happyOysterWorld.test.ts +1241 -0
- package/src/__tests__/happyOysterWorldRefusal.test.ts +224 -0
- package/src/__tests__/hiddenWorldLifecycle.test.ts +203 -0
- package/src/__tests__/http.session-refresh.test.ts +424 -0
- package/src/__tests__/http.test.ts +316 -0
- package/src/__tests__/identity.test.ts +132 -0
- package/src/__tests__/loadBundleManifest.test.ts +192 -22
- package/src/__tests__/longLiveSceneEntry.test.ts +371 -0
- package/src/__tests__/me.test.ts +74 -0
- package/src/__tests__/messageContent.test.ts +395 -0
- package/src/__tests__/momentCut.test.ts +229 -0
- package/src/__tests__/mutationEpoch.test.ts +218 -0
- package/src/__tests__/obo.test.ts +159 -0
- package/src/__tests__/opusTransport.test.ts +182 -0
- package/src/__tests__/opusTransportLibopus.test.ts +125 -0
- package/src/__tests__/orgs.test.ts +229 -0
- package/src/__tests__/persona-generation.test.ts +208 -1
- package/src/__tests__/platformAssistant.test.ts +140 -0
- package/src/__tests__/projects.test.ts +338 -0
- package/src/__tests__/promptTemplatePreview.test.ts +160 -0
- package/src/__tests__/reactor/__fixtures__/realFramePromptText.ts +23 -0
- package/src/__tests__/reactor/api-reactor.test.ts +60 -21
- package/src/__tests__/reactor/framePromptCompaction.test.ts +300 -0
- package/src/__tests__/reactor/promptAddonRegistry.test.ts +79 -0
- package/src/__tests__/reactor/reactorTokenScope.test.ts +50 -0
- package/src/__tests__/reactor/resolveDirectorBeats.test.ts +156 -0
- package/src/__tests__/reactor/sceneEntry.test.ts +3 -0
- package/src/__tests__/reactor/sceneSeedImage.test.ts +361 -0
- package/src/__tests__/reactor/seedImageOrchestrator.test.ts +43 -5
- package/src/__tests__/reactor-happyOysterWalk.test.ts +294 -0
- package/src/__tests__/reactorAvailability.test.ts +217 -0
- package/src/__tests__/reactorSessionRefusal.test.ts +189 -0
- package/src/__tests__/regeneration.test.ts +9 -9
- package/src/__tests__/reprocessBlockedReason.test.ts +30 -0
- package/src/__tests__/retryAfter.test.ts +65 -0
- package/src/__tests__/roleClaim.test.ts +102 -0
- package/src/__tests__/sanaLiveEdit.test.ts +84 -0
- package/src/__tests__/seriesKey.test.ts +24 -0
- package/src/__tests__/settings-set9.test.ts +238 -0
- package/src/__tests__/singleFlight.test.ts +348 -0
- package/src/__tests__/storyGraph.test.ts +111 -1
- package/src/__tests__/storyboardFrameCutscene.test.ts +115 -0
- package/src/__tests__/storyboardMask.test.ts +527 -0
- package/src/__tests__/storyboardTimeline.test.ts +228 -0
- package/src/__tests__/storyboards.test.ts +639 -0
- package/src/__tests__/studioAutomation.test.ts +325 -0
- package/src/__tests__/toolSchemas.test.ts +11 -18
- package/src/__tests__/transport.test.ts +312 -0
- package/src/__tests__/videoGenFacade.test.ts +141 -0
- package/src/__tests__/videoGraph.test.ts +43 -1
- package/src/__tests__/visemeScheduler.test.ts +55 -1
- package/src/__tests__/visibility.test.ts +143 -0
- package/src/__tests__/voiceCloneCaption.test.ts +80 -0
- package/src/__tests__/voiceFallback.test.ts +55 -0
- package/src/__tests__/websocket-error-turn-ended.test.ts +49 -0
- package/src/__tests__/websocket-vision.test.ts +141 -0
- package/src/__tests__/websocket.test.ts +75 -1
- package/src/__tests__/workflowAuthoring.test.ts +187 -0
- package/src/__tests__/workflows.test.ts +640 -0
- package/src/__tests__/worldMintLoop.test.ts +448 -0
- package/src/__tests__/worldModelPreference.test.ts +302 -0
- package/src/__tests__/worldModelTradeoffs.test.ts +89 -0
- package/src/__tests__/worldSteerOutcome.test.ts +62 -0
- package/src/adapters/capabilities.ts +39 -3
- package/src/adapters/directorAdapter.ts +5 -4
- package/src/adapters/experienceModelCatalog.ts +538 -0
- package/src/adapters/extractionAdapter.ts +150 -0
- package/src/adapters/imageAdapter.ts +5 -1
- package/src/adapters/index.ts +104 -17
- package/src/adapters/momentDirective.ts +109 -0
- package/src/adapters/momentPolicy.ts +209 -0
- package/src/adapters/registry.ts +1 -1
- package/src/adapters/videoGenAdapter.ts +124 -0
- package/src/adapters/worldAdapter.ts +221 -16
- package/src/adapters/worldModelPreference.ts +247 -0
- package/src/adapters/worldModelTradeoffs.ts +247 -0
- package/src/admin.ts +842 -16
- package/src/api.ts +12687 -3446
- package/src/arcBoardJoin.ts +46 -0
- package/src/arcPreview.ts +103 -0
- package/src/audio.ts +691 -130
- package/src/audioDsp.ts +132 -0
- package/src/audioProtocol.ts +235 -0
- package/src/beatTitles.ts +51 -0
- package/src/castProjection.ts +311 -0
- package/src/characterGrounding.ts +491 -0
- package/src/conversation/binding.ts +13 -0
- package/src/conversation/chatSessionStore.ts +281 -0
- package/src/conversation/controller.ts +96 -3
- package/src/conversation/index.ts +2 -0
- package/src/conversation/participant.ts +16 -0
- package/src/conversation/readSequencer.ts +55 -0
- package/src/conversation/roster.ts +5 -1
- package/src/conversation/rosterProjection.ts +166 -2
- package/src/conversation/runtime.ts +66 -7
- package/src/conversation/types.ts +43 -4
- package/src/conversation/voice.ts +655 -51
- package/src/creatorCuration.ts +316 -0
- package/src/creatorDashboard.ts +344 -0
- package/src/creatorUniverse.ts +222 -0
- package/src/curationWrite.ts +108 -0
- package/src/designTokens.ts +157 -0
- package/src/dialogAttribution.ts +182 -0
- package/src/dmRunWorldReadiness.ts +1168 -0
- package/src/domains/access.ts +92 -0
- package/src/domains/adventureDefinitions.ts +313 -0
- package/src/domains/adventures.ts +557 -0
- package/src/domains/arcs.ts +350 -0
- package/src/domains/artifacts.ts +349 -0
- package/src/domains/chat.ts +338 -0
- package/src/domains/decisions.ts +62 -0
- package/src/domains/documents.ts +389 -0
- package/src/domains/enhancements.ts +259 -0
- package/src/domains/graph.ts +959 -0
- package/src/domains/images.ts +451 -0
- package/src/domains/ingestion.ts +695 -0
- package/src/domains/me.ts +27 -0
- package/src/domains/orgs.ts +168 -0
- package/src/domains/personas.ts +440 -0
- package/src/domains/projects.ts +177 -0
- package/src/domains/quests.ts +587 -0
- package/src/domains/reactor.ts +163 -0
- package/src/domains/showcase.ts +35 -0
- package/src/domains/storyboards.ts +1698 -0
- package/src/domains/studioSettings.ts +149 -0
- package/src/domains/universes.ts +433 -0
- package/src/domains/userDefaults.ts +37 -0
- package/src/domains/visemeBundles.ts +541 -0
- package/src/domains/workflows.ts +376 -0
- package/src/enhancementDiff.ts +171 -0
- package/src/generated/contract.ts +1016 -0
- package/src/graphSchema.ts +154 -6
- package/src/http.ts +295 -11
- package/src/identity.ts +123 -0
- package/src/index.ts +131 -0
- package/src/messageContent.ts +500 -0
- package/src/mutationEpoch.ts +107 -0
- package/src/obo.ts +201 -0
- package/src/opusTransport.ts +268 -0
- package/src/pagination.ts +29 -0
- package/src/platformAssistant.ts +97 -1
- package/src/pollUtils.ts +35 -0
- package/src/questLog.ts +704 -0
- package/src/reactor/dmDirectiveToExperience.ts +636 -0
- package/src/reactor/dmSceneControlPrompt.ts +69 -2
- package/src/reactor/dmWorldEntry.ts +2226 -0
- package/src/reactor/framePromptCompaction.ts +544 -0
- package/src/reactor/frameWorldBind.ts +133 -0
- package/src/reactor/happyOysterSeed.ts +329 -0
- package/src/reactor/happyOysterWalk.ts +541 -0
- package/src/reactor/happyOysterWorld.ts +1270 -0
- package/src/reactor/heliosCommandDispatcher.ts +5 -1
- package/src/reactor/hiddenWorldLifecycle.ts +182 -0
- package/src/reactor/imageCanvas.ts +38 -0
- package/src/reactor/index.ts +78 -0
- package/src/reactor/longLiveCommandDispatcher.ts +23 -8
- package/src/reactor/longLiveSceneEntry.ts +409 -0
- package/src/reactor/momentCut.ts +219 -0
- package/src/reactor/promptAddonRegistry.ts +81 -3
- package/src/reactor/promptTemplatePreview.ts +240 -0
- package/src/reactor/reactorAvailability.ts +155 -0
- package/src/reactor/reactorSessionRefusal.ts +260 -0
- package/src/reactor/reactorTokenScope.ts +69 -0
- package/src/reactor/resolveDirectorBeats.ts +140 -0
- package/src/reactor/sanaLiveEdit.ts +158 -0
- package/src/reactor/sceneEntry.ts +106 -88
- package/src/reactor/sceneSeedImage.ts +338 -0
- package/src/reactor/seedImageOrchestrator.ts +116 -34
- package/src/reactor/toolPromptAddon.ts +16 -2
- package/src/reactor/worldMintLoop.ts +545 -0
- package/src/reactor/worldSteerOutcome.ts +132 -0
- package/src/retryAfter.ts +71 -0
- package/src/seriesKey.ts +42 -0
- package/src/sessionRefresh.ts +237 -0
- package/src/sharedAudioContext.ts +67 -0
- package/src/singleFlight.ts +91 -0
- package/src/storyGraph.ts +247 -4
- package/src/storyboardMask.ts +756 -0
- package/src/storyboardTimeline.ts +220 -0
- package/src/studioAutomation.ts +208 -0
- package/src/tenantClaim.ts +170 -0
- package/src/timeFormat.ts +51 -0
- package/src/toolSchemas.ts +40 -10
- package/src/transport.ts +327 -0
- package/src/videoGenFacade.ts +90 -0
- package/src/visemeScheduler.ts +36 -3
- package/src/vision/VisionPublisher.ts +204 -14
- package/src/vision/VisionSourceController.ts +187 -6
- package/src/vision/__tests__/VisionPublisher.kvs.test.ts +50 -0
- package/src/vision/__tests__/VisionPublisher.test.ts +291 -0
- package/src/vision/__tests__/VisionSourceController.test.ts +376 -6
- package/src/vision/index.ts +5 -1
- package/src/vision/sourceKinds.ts +19 -5
- package/src/vision/types.ts +7 -4
- package/src/vision/visionErrors.ts +70 -0
- package/src/voiceCloneCaption.ts +77 -0
- package/src/websocket.ts +361 -12
- package/src/workflowAuthoring.ts +664 -0
|
@@ -0,0 +1,281 @@
|
|
|
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
|
+
|
|
31
|
+
import type {
|
|
32
|
+
AddMessageRequest,
|
|
33
|
+
ChatSession,
|
|
34
|
+
CreateSessionRequest,
|
|
35
|
+
} from '../api';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The subset of `ApiClient` the store composes. Declared structurally (not as
|
|
39
|
+
* `Pick<ApiClient, …>`) so the store stays framework-agnostic and trivially
|
|
40
|
+
* mockable in tests; the real `ApiClient` satisfies it.
|
|
41
|
+
*/
|
|
42
|
+
export interface ChatSessionApi {
|
|
43
|
+
createSession(data: CreateSessionRequest): Promise<ChatSession>;
|
|
44
|
+
listSessions(params?: {
|
|
45
|
+
limit?: number;
|
|
46
|
+
nextToken?: string;
|
|
47
|
+
personaId?: string;
|
|
48
|
+
}): Promise<{ sessions: ChatSession[] }>;
|
|
49
|
+
getSession(sessionId: string): Promise<ChatSession>;
|
|
50
|
+
addMessageToSession(
|
|
51
|
+
sessionId: string,
|
|
52
|
+
data: AddMessageRequest,
|
|
53
|
+
): Promise<ChatSession>;
|
|
54
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Page default — list size for the persona-scoped session sidebar. */
|
|
58
|
+
export const DEFAULT_SESSION_LIST_LIMIT = 50;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A session message normalized into the minimal shape every renderer needs to
|
|
62
|
+
* rebuild its transcript. The renderer maps these into its own message type
|
|
63
|
+
* (adding presentation-only fields — citations, images, a model id, an id), so
|
|
64
|
+
* the store stays free of any renderer schema. Mirrors the chat-ws page's
|
|
65
|
+
* restore mapping (page.tsx:852-860): `role` is narrowed to the chat roles, the
|
|
66
|
+
* timestamp is resolved to epoch-ms (now() when the backend omitted it).
|
|
67
|
+
*/
|
|
68
|
+
export interface RestoredSessionMessage {
|
|
69
|
+
role: 'user' | 'assistant';
|
|
70
|
+
content: string;
|
|
71
|
+
/** Epoch ms — `new Date(msg.timestamp).getTime()`, or now() when absent. */
|
|
72
|
+
timestamp: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The result of restoring a session — the normalized turns plus the
|
|
76
|
+
* session-level context (video/persona) the renderer re-selects. */
|
|
77
|
+
export interface RestoredSession {
|
|
78
|
+
sessionId: string;
|
|
79
|
+
videoId: string | null;
|
|
80
|
+
personaId: string | null;
|
|
81
|
+
messages: RestoredSessionMessage[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Wraps the backend `ChatSession` CRUD with the chat-ws page's exact
|
|
86
|
+
* orchestration so any persona-chat surface persists sessions identically.
|
|
87
|
+
* Stateless beyond the injected `ApiClient` — the renderer still owns
|
|
88
|
+
* `currentSessionId` / the session list state (this only performs the calls +
|
|
89
|
+
* the shape mapping). Construct one per `ApiClient`.
|
|
90
|
+
*/
|
|
91
|
+
export class ChatSessionStore {
|
|
92
|
+
constructor(private readonly api: ChatSessionApi) {}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Create a backend session for the given persona/video. Mirrors
|
|
96
|
+
* `handleCreateSession` (page.tsx:808-827): the title defaults to a localized
|
|
97
|
+
* `Chat <date>` when omitted, and `videoId` is sent as `null` when unset.
|
|
98
|
+
*/
|
|
99
|
+
async createSession(args: {
|
|
100
|
+
personaId: string;
|
|
101
|
+
videoId?: string | null;
|
|
102
|
+
title?: string;
|
|
103
|
+
}): Promise<ChatSession> {
|
|
104
|
+
return this.api.createSession({
|
|
105
|
+
persona_id: args.personaId,
|
|
106
|
+
video_id: args.videoId ?? null,
|
|
107
|
+
title: args.title ?? `Chat ${new Date().toLocaleDateString()}`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* List the sessions for a persona (the sidebar source). Mirrors the page's
|
|
113
|
+
* `listSessions({ limit: 50, personaId })` calls — one place for the limit
|
|
114
|
+
* default + the persona scope. `personaId` is optional and only forwarded
|
|
115
|
+
* when truthy (mirrors the page's `personaId: selectedPersonaId || undefined`
|
|
116
|
+
* — an unset persona lists the user's sessions unscoped).
|
|
117
|
+
*/
|
|
118
|
+
async listForPersona(
|
|
119
|
+
personaId?: string,
|
|
120
|
+
limit: number = DEFAULT_SESSION_LIST_LIMIT,
|
|
121
|
+
): Promise<ChatSession[]> {
|
|
122
|
+
const response = await this.api.listSessions({
|
|
123
|
+
limit,
|
|
124
|
+
...(personaId ? { personaId } : {}),
|
|
125
|
+
});
|
|
126
|
+
return response.sessions;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Restore a session and normalize its messages. Mirrors
|
|
131
|
+
* `handleRestoreSession` (page.tsx:844-882) — the renderer maps the returned
|
|
132
|
+
* `RestoredSessionMessage[]` into its own message objects and re-selects the
|
|
133
|
+
* session's `videoId` / `personaId`.
|
|
134
|
+
*/
|
|
135
|
+
async restore(sessionId: string): Promise<RestoredSession> {
|
|
136
|
+
const session = await this.api.getSession(sessionId);
|
|
137
|
+
return {
|
|
138
|
+
sessionId: session.session_id,
|
|
139
|
+
videoId: session.video_id ?? null,
|
|
140
|
+
personaId: session.persona_id ?? null,
|
|
141
|
+
messages: session.messages.map((msg) => ({
|
|
142
|
+
role: msg.role as 'user' | 'assistant',
|
|
143
|
+
content: msg.content,
|
|
144
|
+
timestamp: msg.timestamp ? new Date(msg.timestamp).getTime() : Date.now(),
|
|
145
|
+
})),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Append one message (user or assistant) to a session. Mirrors
|
|
151
|
+
* `handleSaveMessageToBackend` (page.tsx:830-841) — the single backend-persist
|
|
152
|
+
* call. The renderer decides WHEN to persist (e.g. assistant on stream-end);
|
|
153
|
+
* this owns only the call shape.
|
|
154
|
+
*/
|
|
155
|
+
async saveMessage(
|
|
156
|
+
sessionId: string,
|
|
157
|
+
role: 'user' | 'assistant',
|
|
158
|
+
content: string,
|
|
159
|
+
): Promise<ChatSession> {
|
|
160
|
+
return this.api.addMessageToSession(sessionId, { role, content });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Delete a session (sidebar trash). Mirrors `handleDeleteSession`. */
|
|
164
|
+
async delete(sessionId: string): Promise<void> {
|
|
165
|
+
await this.api.deleteSession(sessionId);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// ── localStorage transcript cache ───────────────────────────────────────────
|
|
170
|
+
|
|
171
|
+
/** Bump when the persisted shape changes (the page used `'v2'`). Kept here so
|
|
172
|
+
* the storage key is single-sourced across consumers. */
|
|
173
|
+
export const TRANSCRIPT_CACHE_VERSION = 'v2';
|
|
174
|
+
|
|
175
|
+
/** The page's storage key (`seer-agent-ws-chat-conversations-v2`). Single
|
|
176
|
+
* source of truth so a consumer can never drift the key. */
|
|
177
|
+
export const TRANSCRIPT_CACHE_KEY = `seer-agent-ws-chat-conversations-${TRANSCRIPT_CACHE_VERSION}`;
|
|
178
|
+
|
|
179
|
+
/** Max persisted turns per conversation (the page's `MAX_CONVERSATION_MESSAGES`). */
|
|
180
|
+
export const MAX_CONVERSATION_MESSAGES = 50;
|
|
181
|
+
|
|
182
|
+
/** The minimal `Storage` surface the cache needs — `globalThis.localStorage`
|
|
183
|
+
* satisfies it; tests inject a fake; SSR injects nothing (the cache no-ops). */
|
|
184
|
+
export interface TranscriptStorage {
|
|
185
|
+
getItem(key: string): string | null;
|
|
186
|
+
setItem(key: string, value: string): void;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Tail-prune a transcript to at most `limit` messages — keep the most recent.
|
|
191
|
+
* Mirrors the page's `pruneMessages` (page.tsx:171-174). Pure; exported so a
|
|
192
|
+
* consumer can prune before render too.
|
|
193
|
+
*/
|
|
194
|
+
export function pruneMessages<T>(
|
|
195
|
+
messages: readonly T[],
|
|
196
|
+
limit: number = MAX_CONVERSATION_MESSAGES,
|
|
197
|
+
): T[] {
|
|
198
|
+
if (messages.length <= limit) return [...messages];
|
|
199
|
+
return messages.slice(-limit);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* The `videoId`-keyed localStorage transcript cache (`ConversationTranscriptCache`).
|
|
204
|
+
* Generic over the renderer's message type `M` (it persists whatever the
|
|
205
|
+
* renderer hands it). All access goes through the injected `TranscriptStorage`,
|
|
206
|
+
* so it is SSR-safe (omit storage ⇒ every method no-ops) and testable. Mirrors
|
|
207
|
+
* the page's load/save/clear localStorage effects (page.tsx:944-980, 1773-1783)
|
|
208
|
+
* EXACTLY: same key, same per-`videoId` map, same tail-pruning on save, same
|
|
209
|
+
* malformed-JSON tolerance.
|
|
210
|
+
*/
|
|
211
|
+
export class ConversationTranscriptCache<M> {
|
|
212
|
+
private readonly storage: TranscriptStorage | undefined;
|
|
213
|
+
private readonly key: string;
|
|
214
|
+
private readonly limit: number;
|
|
215
|
+
|
|
216
|
+
constructor(opts?: {
|
|
217
|
+
/** Defaults to `globalThis.localStorage` when available, else undefined
|
|
218
|
+
* (no-op — SSR / tests without a fake). */
|
|
219
|
+
storage?: TranscriptStorage;
|
|
220
|
+
/** Override the storage key (defaults to {@link TRANSCRIPT_CACHE_KEY}). */
|
|
221
|
+
key?: string;
|
|
222
|
+
/** Override the per-conversation tail limit. */
|
|
223
|
+
limit?: number;
|
|
224
|
+
}) {
|
|
225
|
+
this.storage =
|
|
226
|
+
opts?.storage ??
|
|
227
|
+
(typeof globalThis !== 'undefined' &&
|
|
228
|
+
(globalThis as { localStorage?: TranscriptStorage }).localStorage
|
|
229
|
+
? (globalThis as unknown as { localStorage: TranscriptStorage })
|
|
230
|
+
.localStorage
|
|
231
|
+
: undefined);
|
|
232
|
+
this.key = opts?.key ?? TRANSCRIPT_CACHE_KEY;
|
|
233
|
+
this.limit = opts?.limit ?? MAX_CONVERSATION_MESSAGES;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** The whole `{ [videoId]: M[] }` map (or `{}` on absent/malformed JSON). */
|
|
237
|
+
private readAll(): Record<string, M[]> {
|
|
238
|
+
if (!this.storage) return {};
|
|
239
|
+
const stored = this.storage.getItem(this.key);
|
|
240
|
+
if (!stored) return {};
|
|
241
|
+
try {
|
|
242
|
+
const parsed = JSON.parse(stored);
|
|
243
|
+
return parsed && typeof parsed === 'object' ? parsed : {};
|
|
244
|
+
} catch {
|
|
245
|
+
return {};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Load the persisted transcript for one conversation. Returns `[]` for an
|
|
251
|
+
* absent/empty/malformed entry (mirrors page.tsx:945-968). An empty `videoId`
|
|
252
|
+
* also yields `[]` (the page treated falsy `selectedVideoId` as "no
|
|
253
|
+
* conversation").
|
|
254
|
+
*/
|
|
255
|
+
load(videoId: string): M[] {
|
|
256
|
+
if (!videoId) return [];
|
|
257
|
+
const conversation = this.readAll()[videoId];
|
|
258
|
+
return Array.isArray(conversation) ? conversation : [];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Persist a conversation's transcript (tail-pruned to the limit). No-op when
|
|
263
|
+
* `videoId` is empty or `messages` is empty — matching the page's save effect
|
|
264
|
+
* guard (page.tsx:972: `if (!selectedVideoId || messages.length === 0) return`).
|
|
265
|
+
*/
|
|
266
|
+
save(videoId: string, messages: readonly M[]): void {
|
|
267
|
+
if (!this.storage || !videoId || messages.length === 0) return;
|
|
268
|
+
const all = this.readAll();
|
|
269
|
+
all[videoId] = pruneMessages(messages, this.limit);
|
|
270
|
+
this.storage.setItem(this.key, JSON.stringify(all));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Drop one conversation's transcript (the page's `clearConversation`). */
|
|
274
|
+
clear(videoId: string): void {
|
|
275
|
+
if (!this.storage || !videoId) return;
|
|
276
|
+
const all = this.readAll();
|
|
277
|
+
if (!(videoId in all)) return;
|
|
278
|
+
delete all[videoId];
|
|
279
|
+
this.storage.setItem(this.key, JSON.stringify(all));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -76,6 +76,15 @@ export interface ConversationSendOptions {
|
|
|
76
76
|
* `systemPromptOverride`).
|
|
77
77
|
*/
|
|
78
78
|
systemPromptOverride?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* CHAT-U.3 — per-send keepalive overrides. Highest precedence in
|
|
81
|
+
* `composeSendOptions` (over the active participant's persona timings and the
|
|
82
|
+
* binding's), for a renderer that owns a keepalive control of its own — the
|
|
83
|
+
* `/chat-ws` shape, where the page holds the two values in state. Omit both
|
|
84
|
+
* (every caller today) and the participant/binding values ride instead.
|
|
85
|
+
*/
|
|
86
|
+
heartbeatInterval?: number;
|
|
87
|
+
idleTimeout?: number;
|
|
79
88
|
}
|
|
80
89
|
|
|
81
90
|
export interface ConversationControllerOptions {
|
|
@@ -118,6 +127,16 @@ export class ConversationController {
|
|
|
118
127
|
private readonly socket: ChatWebSocket;
|
|
119
128
|
/** True iff the controller created `socket` (and must dispose it). */
|
|
120
129
|
private readonly ownsSocket: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Reconnect listeners (#471). Registered by a renderer that owns a
|
|
132
|
+
* `VoiceSession` over this controller's socket so it can re-prime voice after
|
|
133
|
+
* a socket reconnect. Fired AFTER the socket's own `onReconnected`, on an OWNED
|
|
134
|
+
* socket only — an ADOPTED socket's reconnect is the surface owner's concern
|
|
135
|
+
* (and the overlay decommissions an adopted session when that socket dies, so
|
|
136
|
+
* there is nothing to re-prime). A list so multiple listeners can register; each
|
|
137
|
+
* `onReconnected()` returns its own unsubscribe.
|
|
138
|
+
*/
|
|
139
|
+
private readonly reconnectListeners = new Set<() => void>();
|
|
121
140
|
|
|
122
141
|
constructor(opts: ConversationControllerOptions) {
|
|
123
142
|
this.participants = [...(opts.participants ?? [])];
|
|
@@ -137,7 +156,18 @@ export class ConversationController {
|
|
|
137
156
|
'ConversationController: socketOptions is required when no existingSocket is provided.',
|
|
138
157
|
);
|
|
139
158
|
}
|
|
140
|
-
|
|
159
|
+
// Compose the caller's `onReconnected` with the controller's reconnect
|
|
160
|
+
// fan-out (#471) so a renderer can register a `VoiceSession` re-prime
|
|
161
|
+
// listener without the caller threading a callback through socketOptions.
|
|
162
|
+
// The caller's hook (if any) still fires first; then the listeners.
|
|
163
|
+
const callerOnReconnected = opts.socketOptions.onReconnected;
|
|
164
|
+
this.socket = new ChatWebSocket({
|
|
165
|
+
...opts.socketOptions,
|
|
166
|
+
onReconnected: () => {
|
|
167
|
+
callerOnReconnected?.();
|
|
168
|
+
this.emitReconnected();
|
|
169
|
+
},
|
|
170
|
+
});
|
|
141
171
|
this.ownsSocket = true;
|
|
142
172
|
}
|
|
143
173
|
|
|
@@ -228,6 +258,21 @@ export class ConversationController {
|
|
|
228
258
|
if (!this.connected) {
|
|
229
259
|
throw new Error('ConversationController: call connect() before send().');
|
|
230
260
|
}
|
|
261
|
+
this.socket.send(text, this.composeSendOptions(opts));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Compose the per-turn `ChatWebSocket.send` options for the active binding +
|
|
266
|
+
* participant — the SINGLE place the send frame is shaped. Exposed so the SP1
|
|
267
|
+
* TTS-on-typed-input path (the panel's `VoiceSession.synthesizeReply`) sends a
|
|
268
|
+
* frame IDENTICAL to a normal text turn: same context scope, same persona
|
|
269
|
+
* prompt threading, same history — only the transport differs (the typed turn
|
|
270
|
+
* rides an already-armed `tts_stt` audio session so the reply is synthesized).
|
|
271
|
+
* No second composition site; `send()` and the synth path share this exactly.
|
|
272
|
+
*/
|
|
273
|
+
composeSendOptions(
|
|
274
|
+
opts?: ConversationSendOptions,
|
|
275
|
+
): Parameters<ChatWebSocket['send']>[1] {
|
|
231
276
|
const active = this.activeParticipant();
|
|
232
277
|
const args = this.toHelloArgs();
|
|
233
278
|
const modelId = this.modelOverride ?? active?.modelId;
|
|
@@ -249,7 +294,13 @@ export class ConversationController {
|
|
|
249
294
|
opts?.systemPrompt != null
|
|
250
295
|
? (opts.systemPromptOverride ?? false)
|
|
251
296
|
: (args.systemPromptOverride ?? false);
|
|
252
|
-
|
|
297
|
+
const heartbeatInterval =
|
|
298
|
+
opts?.heartbeatInterval ??
|
|
299
|
+
active?.heartbeatInterval ??
|
|
300
|
+
this.binding.heartbeatInterval;
|
|
301
|
+
const idleTimeout =
|
|
302
|
+
opts?.idleTimeout ?? active?.idleTimeout ?? this.binding.idleTimeout;
|
|
303
|
+
return {
|
|
253
304
|
...(args.videoId ? { videoId: args.videoId } : {}),
|
|
254
305
|
...(args.entityId ? { entityId: args.entityId } : {}),
|
|
255
306
|
...(args.adventureSessionId
|
|
@@ -274,7 +325,19 @@ export class ConversationController {
|
|
|
274
325
|
// Omitted when empty so a zero-history send stays byte-identical to the
|
|
275
326
|
// pre-0.30.0 wire (the backend defaults a missing `messages` to []).
|
|
276
327
|
...(opts?.messages?.length ? { messages: opts.messages } : {}),
|
|
277
|
-
|
|
328
|
+
// CHAT-U.3 — the keepalive pair `/chat-ws` has always sent from its
|
|
329
|
+
// selected persona (`page.tsx` `options.heartbeatInterval/idleTimeout`),
|
|
330
|
+
// which the self-driving panel omitted: a persona configured for a long
|
|
331
|
+
// idle timeout still got the server's 120s default and had its socket
|
|
332
|
+
// reaped mid-turn. PRECEDENCE, highest first: an explicit per-send
|
|
333
|
+
// `opts` value > the ACTIVE participant's persona timings > the
|
|
334
|
+
// conversation binding's. Nullish (not `||`) so an explicit `0`
|
|
335
|
+
// heartbeat — the documented "disable keepalive, I have my own" value —
|
|
336
|
+
// survives instead of falling back. All three absent ⇒ no key on the
|
|
337
|
+
// wire (byte-identical; the backend applies 30s/120s).
|
|
338
|
+
...(heartbeatInterval != null ? { heartbeatInterval } : {}),
|
|
339
|
+
...(idleTimeout != null ? { idleTimeout } : {}),
|
|
340
|
+
};
|
|
278
341
|
}
|
|
279
342
|
|
|
280
343
|
/**
|
|
@@ -306,6 +369,36 @@ export class ConversationController {
|
|
|
306
369
|
return this.socket;
|
|
307
370
|
}
|
|
308
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Register a listener fired after the controller's OWNED socket reconnects
|
|
374
|
+
* (#471). A renderer that drives a `VoiceSession` over `voiceSocket()` uses
|
|
375
|
+
* this to re-prime voice (`VoiceSession.handleReconnect()`) on a reconnect —
|
|
376
|
+
* the single re-prime path, mirroring the `/chat-ws` host's `onReconnected`
|
|
377
|
+
* wiring. Returns an unsubscribe.
|
|
378
|
+
*
|
|
379
|
+
* No-op registration on an ADOPTED socket (returns a no-op unsubscribe): the
|
|
380
|
+
* surface that constructed the adopted socket owns its reconnect callbacks, and
|
|
381
|
+
* the overlay decommissions an adopted session when that socket dies (#444), so
|
|
382
|
+
* the controller cannot (and need not) re-prime across an adopted reconnect.
|
|
383
|
+
*/
|
|
384
|
+
onReconnected(listener: () => void): () => void {
|
|
385
|
+
if (!this.ownsSocket) return () => {};
|
|
386
|
+
this.reconnectListeners.add(listener);
|
|
387
|
+
return () => this.reconnectListeners.delete(listener);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** Fan the OWNED socket's reconnect out to registered listeners (#471). */
|
|
391
|
+
private emitReconnected(): void {
|
|
392
|
+
for (const listener of this.reconnectListeners) {
|
|
393
|
+
try {
|
|
394
|
+
listener();
|
|
395
|
+
} catch (err) {
|
|
396
|
+
// A faulty listener must not break the others or the socket's reconnect.
|
|
397
|
+
console.error('ConversationController: onReconnected listener threw', err);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
309
402
|
/**
|
|
310
403
|
* The hello-args for the active binding + participant overlay — the SAME shape
|
|
311
404
|
* `buildHello()` spreads, exposed so a `VoiceSession` (R7.5) layers its voice
|
|
@@ -22,6 +22,8 @@ export * from './router';
|
|
|
22
22
|
export * from './roster';
|
|
23
23
|
export * from './rosterProjection';
|
|
24
24
|
export * from './runtime';
|
|
25
|
+
export * from './readSequencer';
|
|
25
26
|
export * from './presence';
|
|
26
27
|
export * from './presenceBus';
|
|
27
28
|
export * from './voice';
|
|
29
|
+
export * from './chatSessionStore';
|
|
@@ -68,4 +68,20 @@ export interface ConversationParticipant {
|
|
|
68
68
|
* the auto-switch decision.
|
|
69
69
|
*/
|
|
70
70
|
capabilities?: ChatModelCapability[];
|
|
71
|
+
/**
|
|
72
|
+
* CHAT-U.3 — the seat persona's WebSocket keepalive interval in seconds
|
|
73
|
+
* (`PersonaConfig.heartbeat_interval`). Threaded onto EVERY per-turn send by
|
|
74
|
+
* `ConversationController.composeSendOptions`, which is what `/chat-ws` has
|
|
75
|
+
* always done from its selected persona (`SendActionMessage.heartbeatInterval`);
|
|
76
|
+
* the self-driving panel used to omit it and silently take the server default
|
|
77
|
+
* (30s). Undefined ⇒ dropped from the frame (byte-identical wire).
|
|
78
|
+
*/
|
|
79
|
+
heartbeatInterval?: number;
|
|
80
|
+
/**
|
|
81
|
+
* CHAT-U.3 — the seat persona's idle timeout in seconds
|
|
82
|
+
* (`PersonaConfig.idle_timeout`). Same per-turn threading + drop-when-absent
|
|
83
|
+
* contract as {@link heartbeatInterval}; the server default is 120s, which is
|
|
84
|
+
* shorter than a slow multi-tool DM turn on a persona configured for longer.
|
|
85
|
+
*/
|
|
86
|
+
idleTimeout?: number;
|
|
71
87
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `createReadSequencer` (§Q DM.37) — last-issued-wins ordering for overlapping
|
|
3
|
+
* reads of a single server-authoritative value.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS: `ConversationRuntime`'s adventure-state signal is
|
|
6
|
+
* edge-shaped — a DM mutation `tool_result` tells the host "re-read the
|
|
7
|
+
* `AdventureState`". Two mutations in one turn therefore issue two reads, and
|
|
8
|
+
* HTTP responses are not ordered: the earlier request resolving LAST would
|
|
9
|
+
* write the intermediate beat over the newer one and leave the chapter rail
|
|
10
|
+
* permanently behind. That is the codex P2 finding on #1579 (`DM.31`), and the
|
|
11
|
+
* fix it landed in `useDmSessionRoster` is the same three lines chat-ws's own
|
|
12
|
+
* refresh needed — so the rule lives here once instead of in two React hooks.
|
|
13
|
+
*
|
|
14
|
+
* Framework-agnostic and synchronous: the caller takes a ticket at ISSUE time
|
|
15
|
+
* and asks whether it may still apply once its response lands.
|
|
16
|
+
*
|
|
17
|
+
* const seq = sequencer.issue();
|
|
18
|
+
* const res = await fetch(...);
|
|
19
|
+
* if (sequencer.accept(seq)) applyState(res);
|
|
20
|
+
*
|
|
21
|
+
* `accept` is the commit point — it both answers and advances the watermark,
|
|
22
|
+
* so a caller must call it exactly once per ticket.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** A monotonic issue/accept gate for overlapping reads of one value. */
|
|
26
|
+
export interface ReadSequencer {
|
|
27
|
+
/** Take a ticket for a read about to be issued. Strictly increasing. */
|
|
28
|
+
issue(): number;
|
|
29
|
+
/**
|
|
30
|
+
* True when `seq` is the newest response seen so far (so its value may be
|
|
31
|
+
* applied), advancing the applied watermark. False for a superseded read,
|
|
32
|
+
* whose value must be discarded.
|
|
33
|
+
*/
|
|
34
|
+
accept(seq: number): boolean;
|
|
35
|
+
/** The watermark of the newest response accepted so far (0 before any). */
|
|
36
|
+
readonly applied: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function createReadSequencer(): ReadSequencer {
|
|
40
|
+
let issued = 0;
|
|
41
|
+
let applied = 0;
|
|
42
|
+
return {
|
|
43
|
+
issue(): number {
|
|
44
|
+
return ++issued;
|
|
45
|
+
},
|
|
46
|
+
accept(seq: number): boolean {
|
|
47
|
+
if (seq < applied) return false;
|
|
48
|
+
applied = seq;
|
|
49
|
+
return true;
|
|
50
|
+
},
|
|
51
|
+
get applied(): number {
|
|
52
|
+
return applied;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -85,7 +85,11 @@ export function shouldRefreshAdventureRail(
|
|
|
85
85
|
*/
|
|
86
86
|
export interface PartyCandidatePersona {
|
|
87
87
|
persona_id: string;
|
|
88
|
-
status
|
|
88
|
+
/** Widened to match `PersonaConfig.status` (§Q A11.10) so a full
|
|
89
|
+
* `PersonaConfig[]` still satisfies this interface structurally.
|
|
90
|
+
* `'pending_upload'` personas are excluded from `listPersonas` server-side
|
|
91
|
+
* and are not expected to reach this filter in practice. */
|
|
92
|
+
status: 'pending' | 'approved' | 'pending_upload';
|
|
89
93
|
entity_id?: string | null;
|
|
90
94
|
is_dungeon_master?: boolean;
|
|
91
95
|
}
|