@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.
Files changed (782) hide show
  1. package/README.md +445 -153
  2. package/dist/adapters/capabilities.d.ts +20 -3
  3. package/dist/adapters/capabilities.d.ts.map +1 -1
  4. package/dist/adapters/directorAdapter.d.ts +5 -4
  5. package/dist/adapters/directorAdapter.d.ts.map +1 -1
  6. package/dist/adapters/directorAdapter.js +5 -4
  7. package/dist/adapters/directorAdapter.js.map +1 -1
  8. package/dist/adapters/experienceModelCatalog.d.ts +382 -0
  9. package/dist/adapters/experienceModelCatalog.d.ts.map +1 -0
  10. package/dist/adapters/experienceModelCatalog.js +401 -0
  11. package/dist/adapters/experienceModelCatalog.js.map +1 -0
  12. package/dist/adapters/extractionAdapter.d.ts +81 -0
  13. package/dist/adapters/extractionAdapter.d.ts.map +1 -0
  14. package/dist/adapters/extractionAdapter.js +98 -0
  15. package/dist/adapters/extractionAdapter.js.map +1 -0
  16. package/dist/adapters/imageAdapter.d.ts +5 -1
  17. package/dist/adapters/imageAdapter.d.ts.map +1 -1
  18. package/dist/adapters/imageAdapter.js +5 -1
  19. package/dist/adapters/imageAdapter.js.map +1 -1
  20. package/dist/adapters/index.d.ts +54 -16
  21. package/dist/adapters/index.d.ts.map +1 -1
  22. package/dist/adapters/index.js +62 -11
  23. package/dist/adapters/index.js.map +1 -1
  24. package/dist/adapters/momentDirective.d.ts +66 -0
  25. package/dist/adapters/momentDirective.d.ts.map +1 -0
  26. package/dist/adapters/momentDirective.js +78 -0
  27. package/dist/adapters/momentDirective.js.map +1 -0
  28. package/dist/adapters/momentPolicy.d.ts +132 -0
  29. package/dist/adapters/momentPolicy.d.ts.map +1 -0
  30. package/dist/adapters/momentPolicy.js +165 -0
  31. package/dist/adapters/momentPolicy.js.map +1 -0
  32. package/dist/adapters/registry.d.ts +1 -1
  33. package/dist/adapters/registry.d.ts.map +1 -1
  34. package/dist/adapters/videoGenAdapter.d.ts +55 -0
  35. package/dist/adapters/videoGenAdapter.d.ts.map +1 -0
  36. package/dist/adapters/videoGenAdapter.js +78 -0
  37. package/dist/adapters/videoGenAdapter.js.map +1 -0
  38. package/dist/adapters/worldAdapter.d.ts +132 -11
  39. package/dist/adapters/worldAdapter.d.ts.map +1 -1
  40. package/dist/adapters/worldAdapter.js +127 -11
  41. package/dist/adapters/worldAdapter.js.map +1 -1
  42. package/dist/adapters/worldModelPreference.d.ts +173 -0
  43. package/dist/adapters/worldModelPreference.d.ts.map +1 -0
  44. package/dist/adapters/worldModelPreference.js +209 -0
  45. package/dist/adapters/worldModelPreference.js.map +1 -0
  46. package/dist/adapters/worldModelTradeoffs.d.ts +120 -0
  47. package/dist/adapters/worldModelTradeoffs.d.ts.map +1 -0
  48. package/dist/adapters/worldModelTradeoffs.js +154 -0
  49. package/dist/adapters/worldModelTradeoffs.js.map +1 -0
  50. package/dist/admin.d.ts +545 -0
  51. package/dist/admin.d.ts.map +1 -1
  52. package/dist/admin.js +230 -16
  53. package/dist/admin.js.map +1 -1
  54. package/dist/api.d.ts +10295 -2216
  55. package/dist/api.d.ts.map +1 -1
  56. package/dist/api.js +4187 -1240
  57. package/dist/api.js.map +1 -1
  58. package/dist/arcBoardJoin.d.ts +38 -0
  59. package/dist/arcBoardJoin.d.ts.map +1 -0
  60. package/dist/arcBoardJoin.js +37 -0
  61. package/dist/arcBoardJoin.js.map +1 -0
  62. package/dist/arcPreview.d.ts +49 -0
  63. package/dist/arcPreview.d.ts.map +1 -0
  64. package/dist/arcPreview.js +65 -0
  65. package/dist/arcPreview.js.map +1 -0
  66. package/dist/audio.d.ts +259 -16
  67. package/dist/audio.d.ts.map +1 -1
  68. package/dist/audio.js +605 -114
  69. package/dist/audio.js.map +1 -1
  70. package/dist/audioDsp.d.ts +45 -0
  71. package/dist/audioDsp.d.ts.map +1 -0
  72. package/dist/audioDsp.js +108 -0
  73. package/dist/audioDsp.js.map +1 -0
  74. package/dist/audioProtocol.d.ts +160 -0
  75. package/dist/audioProtocol.d.ts.map +1 -1
  76. package/dist/audioProtocol.js +99 -0
  77. package/dist/audioProtocol.js.map +1 -1
  78. package/dist/beatTitles.d.ts +33 -0
  79. package/dist/beatTitles.d.ts.map +1 -0
  80. package/dist/beatTitles.js +39 -0
  81. package/dist/beatTitles.js.map +1 -0
  82. package/dist/castProjection.d.ts +204 -1
  83. package/dist/castProjection.d.ts.map +1 -1
  84. package/dist/castProjection.js +202 -0
  85. package/dist/castProjection.js.map +1 -1
  86. package/dist/characterGrounding.d.ts +369 -0
  87. package/dist/characterGrounding.d.ts.map +1 -0
  88. package/dist/characterGrounding.js +408 -0
  89. package/dist/characterGrounding.js.map +1 -0
  90. package/dist/conversation/binding.d.ts +13 -0
  91. package/dist/conversation/binding.d.ts.map +1 -1
  92. package/dist/conversation/binding.js.map +1 -1
  93. package/dist/conversation/chatSessionStore.d.ts +178 -0
  94. package/dist/conversation/chatSessionStore.d.ts.map +1 -0
  95. package/dist/conversation/chatSessionStore.js +196 -0
  96. package/dist/conversation/chatSessionStore.js.map +1 -0
  97. package/dist/conversation/controller.d.ts +44 -0
  98. package/dist/conversation/controller.d.ts.map +1 -1
  99. package/dist/conversation/controller.js +82 -3
  100. package/dist/conversation/controller.js.map +1 -1
  101. package/dist/conversation/index.d.ts +2 -0
  102. package/dist/conversation/index.d.ts.map +1 -1
  103. package/dist/conversation/index.js +2 -0
  104. package/dist/conversation/index.js.map +1 -1
  105. package/dist/conversation/participant.d.ts +16 -0
  106. package/dist/conversation/participant.d.ts.map +1 -1
  107. package/dist/conversation/readSequencer.d.ts +38 -0
  108. package/dist/conversation/readSequencer.d.ts.map +1 -0
  109. package/dist/conversation/readSequencer.js +42 -0
  110. package/dist/conversation/readSequencer.js.map +1 -0
  111. package/dist/conversation/roster.d.ts +5 -1
  112. package/dist/conversation/roster.d.ts.map +1 -1
  113. package/dist/conversation/roster.js.map +1 -1
  114. package/dist/conversation/rosterProjection.d.ts +74 -1
  115. package/dist/conversation/rosterProjection.d.ts.map +1 -1
  116. package/dist/conversation/rosterProjection.js +135 -1
  117. package/dist/conversation/rosterProjection.js.map +1 -1
  118. package/dist/conversation/runtime.d.ts +20 -3
  119. package/dist/conversation/runtime.d.ts.map +1 -1
  120. package/dist/conversation/runtime.js +66 -7
  121. package/dist/conversation/runtime.js.map +1 -1
  122. package/dist/conversation/types.d.ts +43 -4
  123. package/dist/conversation/types.d.ts.map +1 -1
  124. package/dist/conversation/voice.d.ts +290 -13
  125. package/dist/conversation/voice.d.ts.map +1 -1
  126. package/dist/conversation/voice.js +565 -42
  127. package/dist/conversation/voice.js.map +1 -1
  128. package/dist/creatorCuration.d.ts +134 -0
  129. package/dist/creatorCuration.d.ts.map +1 -0
  130. package/dist/creatorCuration.js +228 -0
  131. package/dist/creatorCuration.js.map +1 -0
  132. package/dist/creatorDashboard.d.ts +155 -0
  133. package/dist/creatorDashboard.d.ts.map +1 -0
  134. package/dist/creatorDashboard.js +237 -0
  135. package/dist/creatorDashboard.js.map +1 -0
  136. package/dist/creatorUniverse.d.ts +95 -0
  137. package/dist/creatorUniverse.d.ts.map +1 -0
  138. package/dist/creatorUniverse.js +136 -0
  139. package/dist/creatorUniverse.js.map +1 -0
  140. package/dist/curationWrite.d.ts +76 -0
  141. package/dist/curationWrite.d.ts.map +1 -0
  142. package/dist/curationWrite.js +106 -0
  143. package/dist/curationWrite.js.map +1 -0
  144. package/dist/designTokens.d.ts +64 -0
  145. package/dist/designTokens.d.ts.map +1 -0
  146. package/dist/designTokens.js +117 -0
  147. package/dist/designTokens.js.map +1 -0
  148. package/dist/dialogAttribution.d.ts +79 -0
  149. package/dist/dialogAttribution.d.ts.map +1 -0
  150. package/dist/dialogAttribution.js +144 -0
  151. package/dist/dialogAttribution.js.map +1 -0
  152. package/dist/dmRunWorldReadiness.d.ts +605 -0
  153. package/dist/dmRunWorldReadiness.d.ts.map +1 -0
  154. package/dist/dmRunWorldReadiness.js +775 -0
  155. package/dist/dmRunWorldReadiness.js.map +1 -0
  156. package/dist/domains/access.d.ts +32 -0
  157. package/dist/domains/access.d.ts.map +1 -0
  158. package/dist/domains/access.js +43 -0
  159. package/dist/domains/access.js.map +1 -0
  160. package/dist/domains/adventureDefinitions.d.ts +159 -0
  161. package/dist/domains/adventureDefinitions.d.ts.map +1 -0
  162. package/dist/domains/adventureDefinitions.js +168 -0
  163. package/dist/domains/adventureDefinitions.js.map +1 -0
  164. package/dist/domains/adventures.d.ts +329 -0
  165. package/dist/domains/adventures.d.ts.map +1 -0
  166. package/dist/domains/adventures.js +359 -0
  167. package/dist/domains/adventures.js.map +1 -0
  168. package/dist/domains/arcs.d.ts +146 -0
  169. package/dist/domains/arcs.d.ts.map +1 -0
  170. package/dist/domains/arcs.js +202 -0
  171. package/dist/domains/arcs.js.map +1 -0
  172. package/dist/domains/artifacts.d.ts +259 -0
  173. package/dist/domains/artifacts.d.ts.map +1 -0
  174. package/dist/domains/artifacts.js +125 -0
  175. package/dist/domains/artifacts.js.map +1 -0
  176. package/dist/domains/chat.d.ts +158 -0
  177. package/dist/domains/chat.d.ts.map +1 -0
  178. package/dist/domains/chat.js +224 -0
  179. package/dist/domains/chat.js.map +1 -0
  180. package/dist/domains/decisions.d.ts +31 -0
  181. package/dist/domains/decisions.d.ts.map +1 -0
  182. package/dist/domains/decisions.js +42 -0
  183. package/dist/domains/decisions.js.map +1 -0
  184. package/dist/domains/documents.d.ts +218 -0
  185. package/dist/domains/documents.d.ts.map +1 -0
  186. package/dist/domains/documents.js +252 -0
  187. package/dist/domains/documents.js.map +1 -0
  188. package/dist/domains/enhancements.d.ts +106 -0
  189. package/dist/domains/enhancements.d.ts.map +1 -0
  190. package/dist/domains/enhancements.js +160 -0
  191. package/dist/domains/enhancements.js.map +1 -0
  192. package/dist/domains/graph.d.ts +454 -0
  193. package/dist/domains/graph.d.ts.map +1 -0
  194. package/dist/domains/graph.js +648 -0
  195. package/dist/domains/graph.js.map +1 -0
  196. package/dist/domains/images.d.ts +220 -0
  197. package/dist/domains/images.d.ts.map +1 -0
  198. package/dist/domains/images.js +307 -0
  199. package/dist/domains/images.js.map +1 -0
  200. package/dist/domains/ingestion.d.ts +312 -0
  201. package/dist/domains/ingestion.d.ts.map +1 -0
  202. package/dist/domains/ingestion.js +495 -0
  203. package/dist/domains/ingestion.js.map +1 -0
  204. package/dist/domains/me.d.ts +21 -0
  205. package/dist/domains/me.d.ts.map +1 -0
  206. package/dist/domains/me.js +23 -0
  207. package/dist/domains/me.js.map +1 -0
  208. package/dist/domains/orgs.d.ts +47 -0
  209. package/dist/domains/orgs.d.ts.map +1 -0
  210. package/dist/domains/orgs.js +75 -0
  211. package/dist/domains/orgs.js.map +1 -0
  212. package/dist/domains/personas.d.ts +138 -0
  213. package/dist/domains/personas.d.ts.map +1 -0
  214. package/dist/domains/personas.js +322 -0
  215. package/dist/domains/personas.js.map +1 -0
  216. package/dist/domains/projects.d.ts +53 -0
  217. package/dist/domains/projects.d.ts.map +1 -0
  218. package/dist/domains/projects.js +94 -0
  219. package/dist/domains/projects.js.map +1 -0
  220. package/dist/domains/quests.d.ts +431 -0
  221. package/dist/domains/quests.d.ts.map +1 -0
  222. package/dist/domains/quests.js +61 -0
  223. package/dist/domains/quests.js.map +1 -0
  224. package/dist/domains/reactor.d.ts +98 -0
  225. package/dist/domains/reactor.d.ts.map +1 -0
  226. package/dist/domains/reactor.js +131 -0
  227. package/dist/domains/reactor.js.map +1 -0
  228. package/dist/domains/showcase.d.ts +28 -0
  229. package/dist/domains/showcase.d.ts.map +1 -0
  230. package/dist/domains/showcase.js +28 -0
  231. package/dist/domains/showcase.js.map +1 -0
  232. package/dist/domains/storyboards.d.ts +1253 -0
  233. package/dist/domains/storyboards.d.ts.map +1 -0
  234. package/dist/domains/storyboards.js +781 -0
  235. package/dist/domains/storyboards.js.map +1 -0
  236. package/dist/domains/studioSettings.d.ts +39 -0
  237. package/dist/domains/studioSettings.d.ts.map +1 -0
  238. package/dist/domains/studioSettings.js +80 -0
  239. package/dist/domains/studioSettings.js.map +1 -0
  240. package/dist/domains/universes.d.ts +191 -0
  241. package/dist/domains/universes.d.ts.map +1 -0
  242. package/dist/domains/universes.js +276 -0
  243. package/dist/domains/universes.js.map +1 -0
  244. package/dist/domains/userDefaults.d.ts +18 -0
  245. package/dist/domains/userDefaults.d.ts.map +1 -0
  246. package/dist/domains/userDefaults.js +27 -0
  247. package/dist/domains/userDefaults.js.map +1 -0
  248. package/dist/domains/visemeBundles.d.ts +262 -0
  249. package/dist/domains/visemeBundles.d.ts.map +1 -0
  250. package/dist/domains/visemeBundles.js +373 -0
  251. package/dist/domains/visemeBundles.js.map +1 -0
  252. package/dist/domains/workflows.d.ts +142 -0
  253. package/dist/domains/workflows.d.ts.map +1 -0
  254. package/dist/domains/workflows.js +245 -0
  255. package/dist/domains/workflows.js.map +1 -0
  256. package/dist/enhancementDiff.d.ts +56 -0
  257. package/dist/enhancementDiff.d.ts.map +1 -0
  258. package/dist/enhancementDiff.js +110 -0
  259. package/dist/enhancementDiff.js.map +1 -0
  260. package/dist/generated/contract.d.ts +372 -0
  261. package/dist/generated/contract.d.ts.map +1 -0
  262. package/dist/generated/contract.js +395 -0
  263. package/dist/generated/contract.js.map +1 -0
  264. package/dist/graphSchema.d.ts +36 -5
  265. package/dist/graphSchema.d.ts.map +1 -1
  266. package/dist/graphSchema.js +88 -2
  267. package/dist/graphSchema.js.map +1 -1
  268. package/dist/http.d.ts +70 -1
  269. package/dist/http.d.ts.map +1 -1
  270. package/dist/http.js +263 -11
  271. package/dist/http.js.map +1 -1
  272. package/dist/identity.d.ts +81 -0
  273. package/dist/identity.d.ts.map +1 -0
  274. package/dist/identity.js +65 -0
  275. package/dist/identity.js.map +1 -0
  276. package/dist/index.d.ts +35 -0
  277. package/dist/index.d.ts.map +1 -1
  278. package/dist/index.js +118 -0
  279. package/dist/index.js.map +1 -1
  280. package/dist/messageContent.d.ts +174 -0
  281. package/dist/messageContent.d.ts.map +1 -0
  282. package/dist/messageContent.js +405 -0
  283. package/dist/messageContent.js.map +1 -0
  284. package/dist/mutationEpoch.d.ts +83 -0
  285. package/dist/mutationEpoch.d.ts.map +1 -0
  286. package/dist/mutationEpoch.js +109 -0
  287. package/dist/mutationEpoch.js.map +1 -0
  288. package/dist/obo.d.ts +144 -0
  289. package/dist/obo.d.ts.map +1 -0
  290. package/dist/obo.js +135 -0
  291. package/dist/obo.js.map +1 -0
  292. package/dist/opusTransport.d.ts +113 -0
  293. package/dist/opusTransport.d.ts.map +1 -0
  294. package/dist/opusTransport.js +170 -0
  295. package/dist/opusTransport.js.map +1 -0
  296. package/dist/pagination.d.ts +18 -0
  297. package/dist/pagination.d.ts.map +1 -0
  298. package/dist/pagination.js +26 -0
  299. package/dist/pagination.js.map +1 -0
  300. package/dist/platformAssistant.d.ts +55 -1
  301. package/dist/platformAssistant.d.ts.map +1 -1
  302. package/dist/platformAssistant.js +39 -1
  303. package/dist/platformAssistant.js.map +1 -1
  304. package/dist/pollUtils.d.ts +19 -0
  305. package/dist/pollUtils.d.ts.map +1 -0
  306. package/dist/pollUtils.js +35 -0
  307. package/dist/pollUtils.js.map +1 -0
  308. package/dist/questLog.d.ts +232 -0
  309. package/dist/questLog.d.ts.map +1 -0
  310. package/dist/questLog.js +522 -0
  311. package/dist/questLog.js.map +1 -0
  312. package/dist/reactor/dmDirectiveToExperience.d.ts +300 -0
  313. package/dist/reactor/dmDirectiveToExperience.d.ts.map +1 -0
  314. package/dist/reactor/dmDirectiveToExperience.js +401 -0
  315. package/dist/reactor/dmDirectiveToExperience.js.map +1 -0
  316. package/dist/reactor/dmSceneControlPrompt.d.ts.map +1 -1
  317. package/dist/reactor/dmSceneControlPrompt.js +64 -2
  318. package/dist/reactor/dmSceneControlPrompt.js.map +1 -1
  319. package/dist/reactor/dmWorldEntry.d.ts +1278 -0
  320. package/dist/reactor/dmWorldEntry.d.ts.map +1 -0
  321. package/dist/reactor/dmWorldEntry.js +1396 -0
  322. package/dist/reactor/dmWorldEntry.js.map +1 -0
  323. package/dist/reactor/framePromptCompaction.d.ts +223 -0
  324. package/dist/reactor/framePromptCompaction.d.ts.map +1 -0
  325. package/dist/reactor/framePromptCompaction.js +393 -0
  326. package/dist/reactor/framePromptCompaction.js.map +1 -0
  327. package/dist/reactor/frameWorldBind.d.ts +86 -0
  328. package/dist/reactor/frameWorldBind.d.ts.map +1 -0
  329. package/dist/reactor/frameWorldBind.js +79 -0
  330. package/dist/reactor/frameWorldBind.js.map +1 -0
  331. package/dist/reactor/happyOysterSeed.d.ts +166 -0
  332. package/dist/reactor/happyOysterSeed.d.ts.map +1 -0
  333. package/dist/reactor/happyOysterSeed.js +233 -0
  334. package/dist/reactor/happyOysterSeed.js.map +1 -0
  335. package/dist/reactor/happyOysterWalk.d.ts +274 -0
  336. package/dist/reactor/happyOysterWalk.d.ts.map +1 -0
  337. package/dist/reactor/happyOysterWalk.js +407 -0
  338. package/dist/reactor/happyOysterWalk.js.map +1 -0
  339. package/dist/reactor/happyOysterWorld.d.ts +718 -0
  340. package/dist/reactor/happyOysterWorld.d.ts.map +1 -0
  341. package/dist/reactor/happyOysterWorld.js +826 -0
  342. package/dist/reactor/happyOysterWorld.js.map +1 -0
  343. package/dist/reactor/heliosCommandDispatcher.d.ts.map +1 -1
  344. package/dist/reactor/heliosCommandDispatcher.js +5 -2
  345. package/dist/reactor/heliosCommandDispatcher.js.map +1 -1
  346. package/dist/reactor/hiddenWorldLifecycle.d.ts +101 -0
  347. package/dist/reactor/hiddenWorldLifecycle.d.ts.map +1 -0
  348. package/dist/reactor/hiddenWorldLifecycle.js +119 -0
  349. package/dist/reactor/hiddenWorldLifecycle.js.map +1 -0
  350. package/dist/reactor/imageCanvas.d.ts +15 -0
  351. package/dist/reactor/imageCanvas.d.ts.map +1 -0
  352. package/dist/reactor/imageCanvas.js +33 -0
  353. package/dist/reactor/imageCanvas.js.map +1 -0
  354. package/dist/reactor/index.d.ts +19 -0
  355. package/dist/reactor/index.d.ts.map +1 -1
  356. package/dist/reactor/index.js +78 -0
  357. package/dist/reactor/index.js.map +1 -1
  358. package/dist/reactor/longLiveCommandDispatcher.d.ts +23 -8
  359. package/dist/reactor/longLiveCommandDispatcher.d.ts.map +1 -1
  360. package/dist/reactor/longLiveCommandDispatcher.js +16 -4
  361. package/dist/reactor/longLiveCommandDispatcher.js.map +1 -1
  362. package/dist/reactor/longLiveSceneEntry.d.ts +203 -0
  363. package/dist/reactor/longLiveSceneEntry.d.ts.map +1 -0
  364. package/dist/reactor/longLiveSceneEntry.js +280 -0
  365. package/dist/reactor/longLiveSceneEntry.js.map +1 -0
  366. package/dist/reactor/momentCut.d.ts +153 -0
  367. package/dist/reactor/momentCut.d.ts.map +1 -0
  368. package/dist/reactor/momentCut.js +142 -0
  369. package/dist/reactor/momentCut.js.map +1 -0
  370. package/dist/reactor/promptAddonRegistry.d.ts +39 -3
  371. package/dist/reactor/promptAddonRegistry.d.ts.map +1 -1
  372. package/dist/reactor/promptAddonRegistry.js +42 -3
  373. package/dist/reactor/promptAddonRegistry.js.map +1 -1
  374. package/dist/reactor/promptTemplatePreview.d.ts +97 -0
  375. package/dist/reactor/promptTemplatePreview.d.ts.map +1 -0
  376. package/dist/reactor/promptTemplatePreview.js +185 -0
  377. package/dist/reactor/promptTemplatePreview.js.map +1 -0
  378. package/dist/reactor/reactorAvailability.d.ts +80 -0
  379. package/dist/reactor/reactorAvailability.d.ts.map +1 -0
  380. package/dist/reactor/reactorAvailability.js +121 -0
  381. package/dist/reactor/reactorAvailability.js.map +1 -0
  382. package/dist/reactor/reactorSessionRefusal.d.ts +125 -0
  383. package/dist/reactor/reactorSessionRefusal.d.ts.map +1 -0
  384. package/dist/reactor/reactorSessionRefusal.js +197 -0
  385. package/dist/reactor/reactorSessionRefusal.js.map +1 -0
  386. package/dist/reactor/reactorTokenScope.d.ts +47 -0
  387. package/dist/reactor/reactorTokenScope.d.ts.map +1 -0
  388. package/dist/reactor/reactorTokenScope.js +64 -0
  389. package/dist/reactor/reactorTokenScope.js.map +1 -0
  390. package/dist/reactor/resolveDirectorBeats.d.ts +65 -0
  391. package/dist/reactor/resolveDirectorBeats.d.ts.map +1 -0
  392. package/dist/reactor/resolveDirectorBeats.js +86 -0
  393. package/dist/reactor/resolveDirectorBeats.js.map +1 -0
  394. package/dist/reactor/sanaLiveEdit.d.ts +117 -0
  395. package/dist/reactor/sanaLiveEdit.d.ts.map +1 -0
  396. package/dist/reactor/sanaLiveEdit.js +105 -0
  397. package/dist/reactor/sanaLiveEdit.js.map +1 -0
  398. package/dist/reactor/sceneEntry.d.ts +66 -9
  399. package/dist/reactor/sceneEntry.d.ts.map +1 -1
  400. package/dist/reactor/sceneEntry.js +59 -66
  401. package/dist/reactor/sceneEntry.js.map +1 -1
  402. package/dist/reactor/sceneSeedImage.d.ts +199 -0
  403. package/dist/reactor/sceneSeedImage.d.ts.map +1 -0
  404. package/dist/reactor/sceneSeedImage.js +239 -0
  405. package/dist/reactor/sceneSeedImage.js.map +1 -0
  406. package/dist/reactor/seedImageOrchestrator.d.ts +70 -3
  407. package/dist/reactor/seedImageOrchestrator.d.ts.map +1 -1
  408. package/dist/reactor/seedImageOrchestrator.js +92 -28
  409. package/dist/reactor/seedImageOrchestrator.js.map +1 -1
  410. package/dist/reactor/toolPromptAddon.d.ts.map +1 -1
  411. package/dist/reactor/toolPromptAddon.js +16 -2
  412. package/dist/reactor/toolPromptAddon.js.map +1 -1
  413. package/dist/reactor/worldMintLoop.d.ts +286 -0
  414. package/dist/reactor/worldMintLoop.d.ts.map +1 -0
  415. package/dist/reactor/worldMintLoop.js +381 -0
  416. package/dist/reactor/worldMintLoop.js.map +1 -0
  417. package/dist/reactor/worldSteerOutcome.d.ts +98 -0
  418. package/dist/reactor/worldSteerOutcome.d.ts.map +1 -0
  419. package/dist/reactor/worldSteerOutcome.js +81 -0
  420. package/dist/reactor/worldSteerOutcome.js.map +1 -0
  421. package/dist/retryAfter.d.ts +15 -0
  422. package/dist/retryAfter.d.ts.map +1 -0
  423. package/dist/retryAfter.js +75 -0
  424. package/dist/retryAfter.js.map +1 -0
  425. package/dist/seriesKey.d.ts +31 -0
  426. package/dist/seriesKey.d.ts.map +1 -0
  427. package/dist/seriesKey.js +33 -0
  428. package/dist/seriesKey.js.map +1 -0
  429. package/dist/sessionRefresh.d.ts +135 -0
  430. package/dist/sessionRefresh.d.ts.map +1 -0
  431. package/dist/sessionRefresh.js +215 -0
  432. package/dist/sessionRefresh.js.map +1 -0
  433. package/dist/sharedAudioContext.d.ts +39 -0
  434. package/dist/sharedAudioContext.d.ts.map +1 -0
  435. package/dist/sharedAudioContext.js +63 -0
  436. package/dist/sharedAudioContext.js.map +1 -0
  437. package/dist/singleFlight.d.ts +51 -0
  438. package/dist/singleFlight.d.ts.map +1 -0
  439. package/dist/singleFlight.js +87 -0
  440. package/dist/singleFlight.js.map +1 -0
  441. package/dist/storyGraph.d.ts +83 -0
  442. package/dist/storyGraph.d.ts.map +1 -1
  443. package/dist/storyGraph.js +169 -4
  444. package/dist/storyGraph.js.map +1 -1
  445. package/dist/storyboardMask.d.ts +343 -0
  446. package/dist/storyboardMask.d.ts.map +1 -0
  447. package/dist/storyboardMask.js +505 -0
  448. package/dist/storyboardMask.js.map +1 -0
  449. package/dist/storyboardTimeline.d.ts +93 -0
  450. package/dist/storyboardTimeline.d.ts.map +1 -0
  451. package/dist/storyboardTimeline.js +131 -0
  452. package/dist/storyboardTimeline.js.map +1 -0
  453. package/dist/studioAutomation.d.ts +104 -0
  454. package/dist/studioAutomation.d.ts.map +1 -0
  455. package/dist/studioAutomation.js +178 -0
  456. package/dist/studioAutomation.js.map +1 -0
  457. package/dist/tenantClaim.d.ts +86 -0
  458. package/dist/tenantClaim.d.ts.map +1 -0
  459. package/dist/tenantClaim.js +164 -0
  460. package/dist/tenantClaim.js.map +1 -0
  461. package/dist/timeFormat.d.ts +25 -0
  462. package/dist/timeFormat.d.ts.map +1 -1
  463. package/dist/timeFormat.js +56 -0
  464. package/dist/timeFormat.js.map +1 -1
  465. package/dist/toolSchemas.d.ts +58 -10
  466. package/dist/toolSchemas.d.ts.map +1 -1
  467. package/dist/toolSchemas.js +37 -9
  468. package/dist/toolSchemas.js.map +1 -1
  469. package/dist/transport.d.ts +120 -0
  470. package/dist/transport.d.ts.map +1 -0
  471. package/dist/transport.js +282 -0
  472. package/dist/transport.js.map +1 -0
  473. package/dist/videoGenFacade.d.ts +63 -0
  474. package/dist/videoGenFacade.d.ts.map +1 -0
  475. package/dist/videoGenFacade.js +49 -0
  476. package/dist/videoGenFacade.js.map +1 -0
  477. package/dist/visemeScheduler.d.ts +24 -2
  478. package/dist/visemeScheduler.d.ts.map +1 -1
  479. package/dist/visemeScheduler.js +31 -2
  480. package/dist/visemeScheduler.js.map +1 -1
  481. package/dist/vision/VisionPublisher.d.ts +88 -0
  482. package/dist/vision/VisionPublisher.d.ts.map +1 -1
  483. package/dist/vision/VisionPublisher.js +196 -13
  484. package/dist/vision/VisionPublisher.js.map +1 -1
  485. package/dist/vision/VisionSourceController.d.ts +67 -1
  486. package/dist/vision/VisionSourceController.d.ts.map +1 -1
  487. package/dist/vision/VisionSourceController.js +147 -5
  488. package/dist/vision/VisionSourceController.js.map +1 -1
  489. package/dist/vision/index.d.ts +2 -1
  490. package/dist/vision/index.d.ts.map +1 -1
  491. package/dist/vision/index.js +2 -1
  492. package/dist/vision/index.js.map +1 -1
  493. package/dist/vision/sourceKinds.d.ts +18 -5
  494. package/dist/vision/sourceKinds.d.ts.map +1 -1
  495. package/dist/vision/sourceKinds.js +15 -2
  496. package/dist/vision/sourceKinds.js.map +1 -1
  497. package/dist/vision/types.d.ts +7 -4
  498. package/dist/vision/types.d.ts.map +1 -1
  499. package/dist/vision/visionErrors.d.ts +45 -0
  500. package/dist/vision/visionErrors.d.ts.map +1 -0
  501. package/dist/vision/visionErrors.js +66 -0
  502. package/dist/vision/visionErrors.js.map +1 -0
  503. package/dist/voiceCloneCaption.d.ts +33 -0
  504. package/dist/voiceCloneCaption.d.ts.map +1 -0
  505. package/dist/voiceCloneCaption.js +69 -0
  506. package/dist/voiceCloneCaption.js.map +1 -0
  507. package/dist/websocket.d.ts +273 -10
  508. package/dist/websocket.d.ts.map +1 -1
  509. package/dist/websocket.js +79 -0
  510. package/dist/websocket.js.map +1 -1
  511. package/dist/workflowAuthoring.d.ts +139 -0
  512. package/dist/workflowAuthoring.d.ts.map +1 -0
  513. package/dist/workflowAuthoring.js +557 -0
  514. package/dist/workflowAuthoring.js.map +1 -0
  515. package/package.json +15 -5
  516. package/src/__tests__/adapters-director.test.ts +9 -6
  517. package/src/__tests__/adapters-extraction.test.ts +175 -0
  518. package/src/__tests__/adapters-image.test.ts +66 -0
  519. package/src/__tests__/adapters-momentPolicy.test.ts +218 -0
  520. package/src/__tests__/adapters-platform.test.ts +110 -4
  521. package/src/__tests__/adapters-videogen.test.ts +53 -0
  522. package/src/__tests__/adapters-world.test.ts +117 -7
  523. package/src/__tests__/admin.enhancement-defaults.test.ts +115 -0
  524. package/src/__tests__/admin.test.ts +282 -0
  525. package/src/__tests__/adventures-world-state.test.ts +156 -0
  526. package/src/__tests__/adventures.test.ts +111 -1
  527. package/src/__tests__/api-pollers.test.ts +113 -23
  528. package/src/__tests__/api.adventure-definitions.test.ts +312 -0
  529. package/src/__tests__/api.anchor-beat.test.ts +75 -0
  530. package/src/__tests__/api.arc-approval.test.ts +171 -0
  531. package/src/__tests__/api.arc-beats-floor.test.ts +56 -0
  532. package/src/__tests__/api.arc-generation.test.ts +168 -0
  533. package/src/__tests__/api.arc-templates.test.ts +78 -0
  534. package/src/__tests__/api.assignVideoSeries.test.ts +81 -0
  535. package/src/__tests__/api.cast-frame-choices.test.ts +141 -0
  536. package/src/__tests__/api.cutscene-registry.test.ts +148 -0
  537. package/src/__tests__/api.enhancement-addition-actions.test.ts +137 -0
  538. package/src/__tests__/api.enrichVideo-serialization.test.ts +116 -0
  539. package/src/__tests__/api.extraction-base.test.ts +87 -0
  540. package/src/__tests__/api.generateVideo-cutscene.test.ts +148 -0
  541. package/src/__tests__/api.job-pipeline-stages.test.ts +128 -0
  542. package/src/__tests__/api.list-images-filters.test.ts +6 -3
  543. package/src/__tests__/api.quest-curation.test.ts +169 -0
  544. package/src/__tests__/api.reprocessVideo.test.ts +71 -0
  545. package/src/__tests__/api.scene-split-merge.test.ts +129 -0
  546. package/src/__tests__/api.session-quests.test.ts +184 -0
  547. package/src/__tests__/api.test.ts +122 -0
  548. package/src/__tests__/api.transferSeries.test.ts +114 -0
  549. package/src/__tests__/api.unknown-clusters.test.ts +225 -0
  550. package/src/__tests__/api.uploadVideo-options.test.ts +156 -0
  551. package/src/__tests__/arcPreview.test.ts +71 -0
  552. package/src/__tests__/arcStyleProfile.test.ts +204 -0
  553. package/src/__tests__/artifacts-delete.test.ts +109 -0
  554. package/src/__tests__/audio.test.ts +864 -5
  555. package/src/__tests__/audioDsp.test.ts +196 -0
  556. package/src/__tests__/audioUnavailable.test.ts +43 -0
  557. package/src/__tests__/cast.test.ts +10 -1
  558. package/src/__tests__/castCurationProjection.test.ts +84 -0
  559. package/src/__tests__/castFramePipelinePending.test.ts +171 -0
  560. package/src/__tests__/castProjection.test.ts +497 -5
  561. package/src/__tests__/characterGrounding.test.ts +357 -0
  562. package/src/__tests__/contract.test.ts +97 -0
  563. package/src/__tests__/conversation/chatSessionStore.test.ts +243 -0
  564. package/src/__tests__/conversation/controller.test.ts +211 -0
  565. package/src/__tests__/conversation/readSequencer.test.ts +52 -0
  566. package/src/__tests__/conversation/rosterProjection.test.ts +204 -3
  567. package/src/__tests__/conversation/runtime.test.ts +118 -1
  568. package/src/__tests__/conversation/voice.test.ts +741 -7
  569. package/src/__tests__/creatorCuration.test.ts +256 -0
  570. package/src/__tests__/creatorDashboard.test.ts +444 -0
  571. package/src/__tests__/creatorUniverse.test.ts +138 -0
  572. package/src/__tests__/curationWrite.test.ts +179 -0
  573. package/src/__tests__/decisions.test.ts +89 -0
  574. package/src/__tests__/designTokens.test.ts +72 -0
  575. package/src/__tests__/dialogAttribution.test.ts +187 -0
  576. package/src/__tests__/dmDirectiveToExperience.test.ts +198 -0
  577. package/src/__tests__/dmWorldEntry.test.ts +2102 -0
  578. package/src/__tests__/enhancementDiff.test.ts +132 -0
  579. package/src/__tests__/experienceModelCatalog.test.ts +292 -0
  580. package/src/__tests__/extractionStageState.test.ts +67 -0
  581. package/src/__tests__/getVideo.test.ts +95 -0
  582. package/src/__tests__/graphReadAfterWrite.test.ts +211 -0
  583. package/src/__tests__/graphSchema.test.ts +55 -4
  584. package/src/__tests__/happyOysterSeed.test.ts +208 -0
  585. package/src/__tests__/happyOysterWorld.test.ts +1241 -0
  586. package/src/__tests__/happyOysterWorldRefusal.test.ts +224 -0
  587. package/src/__tests__/hiddenWorldLifecycle.test.ts +203 -0
  588. package/src/__tests__/http.session-refresh.test.ts +424 -0
  589. package/src/__tests__/http.test.ts +316 -0
  590. package/src/__tests__/identity.test.ts +132 -0
  591. package/src/__tests__/loadBundleManifest.test.ts +192 -22
  592. package/src/__tests__/longLiveSceneEntry.test.ts +371 -0
  593. package/src/__tests__/me.test.ts +74 -0
  594. package/src/__tests__/messageContent.test.ts +395 -0
  595. package/src/__tests__/momentCut.test.ts +229 -0
  596. package/src/__tests__/mutationEpoch.test.ts +218 -0
  597. package/src/__tests__/obo.test.ts +159 -0
  598. package/src/__tests__/opusTransport.test.ts +182 -0
  599. package/src/__tests__/opusTransportLibopus.test.ts +125 -0
  600. package/src/__tests__/orgs.test.ts +229 -0
  601. package/src/__tests__/persona-generation.test.ts +208 -1
  602. package/src/__tests__/platformAssistant.test.ts +140 -0
  603. package/src/__tests__/projects.test.ts +338 -0
  604. package/src/__tests__/promptTemplatePreview.test.ts +160 -0
  605. package/src/__tests__/reactor/__fixtures__/realFramePromptText.ts +23 -0
  606. package/src/__tests__/reactor/api-reactor.test.ts +60 -21
  607. package/src/__tests__/reactor/framePromptCompaction.test.ts +300 -0
  608. package/src/__tests__/reactor/promptAddonRegistry.test.ts +79 -0
  609. package/src/__tests__/reactor/reactorTokenScope.test.ts +50 -0
  610. package/src/__tests__/reactor/resolveDirectorBeats.test.ts +156 -0
  611. package/src/__tests__/reactor/sceneEntry.test.ts +3 -0
  612. package/src/__tests__/reactor/sceneSeedImage.test.ts +361 -0
  613. package/src/__tests__/reactor/seedImageOrchestrator.test.ts +43 -5
  614. package/src/__tests__/reactor-happyOysterWalk.test.ts +294 -0
  615. package/src/__tests__/reactorAvailability.test.ts +217 -0
  616. package/src/__tests__/reactorSessionRefusal.test.ts +189 -0
  617. package/src/__tests__/regeneration.test.ts +9 -9
  618. package/src/__tests__/reprocessBlockedReason.test.ts +30 -0
  619. package/src/__tests__/retryAfter.test.ts +65 -0
  620. package/src/__tests__/roleClaim.test.ts +102 -0
  621. package/src/__tests__/sanaLiveEdit.test.ts +84 -0
  622. package/src/__tests__/seriesKey.test.ts +24 -0
  623. package/src/__tests__/settings-set9.test.ts +238 -0
  624. package/src/__tests__/singleFlight.test.ts +348 -0
  625. package/src/__tests__/storyGraph.test.ts +111 -1
  626. package/src/__tests__/storyboardFrameCutscene.test.ts +115 -0
  627. package/src/__tests__/storyboardMask.test.ts +527 -0
  628. package/src/__tests__/storyboardTimeline.test.ts +228 -0
  629. package/src/__tests__/storyboards.test.ts +639 -0
  630. package/src/__tests__/studioAutomation.test.ts +325 -0
  631. package/src/__tests__/toolSchemas.test.ts +11 -18
  632. package/src/__tests__/transport.test.ts +312 -0
  633. package/src/__tests__/videoGenFacade.test.ts +141 -0
  634. package/src/__tests__/videoGraph.test.ts +43 -1
  635. package/src/__tests__/visemeScheduler.test.ts +55 -1
  636. package/src/__tests__/visibility.test.ts +143 -0
  637. package/src/__tests__/voiceCloneCaption.test.ts +80 -0
  638. package/src/__tests__/voiceFallback.test.ts +55 -0
  639. package/src/__tests__/websocket-error-turn-ended.test.ts +49 -0
  640. package/src/__tests__/websocket-vision.test.ts +141 -0
  641. package/src/__tests__/websocket.test.ts +75 -1
  642. package/src/__tests__/workflowAuthoring.test.ts +187 -0
  643. package/src/__tests__/workflows.test.ts +640 -0
  644. package/src/__tests__/worldMintLoop.test.ts +448 -0
  645. package/src/__tests__/worldModelPreference.test.ts +302 -0
  646. package/src/__tests__/worldModelTradeoffs.test.ts +89 -0
  647. package/src/__tests__/worldSteerOutcome.test.ts +62 -0
  648. package/src/adapters/capabilities.ts +39 -3
  649. package/src/adapters/directorAdapter.ts +5 -4
  650. package/src/adapters/experienceModelCatalog.ts +538 -0
  651. package/src/adapters/extractionAdapter.ts +150 -0
  652. package/src/adapters/imageAdapter.ts +5 -1
  653. package/src/adapters/index.ts +104 -17
  654. package/src/adapters/momentDirective.ts +109 -0
  655. package/src/adapters/momentPolicy.ts +209 -0
  656. package/src/adapters/registry.ts +1 -1
  657. package/src/adapters/videoGenAdapter.ts +124 -0
  658. package/src/adapters/worldAdapter.ts +221 -16
  659. package/src/adapters/worldModelPreference.ts +247 -0
  660. package/src/adapters/worldModelTradeoffs.ts +247 -0
  661. package/src/admin.ts +842 -16
  662. package/src/api.ts +12687 -3446
  663. package/src/arcBoardJoin.ts +46 -0
  664. package/src/arcPreview.ts +103 -0
  665. package/src/audio.ts +691 -130
  666. package/src/audioDsp.ts +132 -0
  667. package/src/audioProtocol.ts +235 -0
  668. package/src/beatTitles.ts +51 -0
  669. package/src/castProjection.ts +311 -0
  670. package/src/characterGrounding.ts +491 -0
  671. package/src/conversation/binding.ts +13 -0
  672. package/src/conversation/chatSessionStore.ts +281 -0
  673. package/src/conversation/controller.ts +96 -3
  674. package/src/conversation/index.ts +2 -0
  675. package/src/conversation/participant.ts +16 -0
  676. package/src/conversation/readSequencer.ts +55 -0
  677. package/src/conversation/roster.ts +5 -1
  678. package/src/conversation/rosterProjection.ts +166 -2
  679. package/src/conversation/runtime.ts +66 -7
  680. package/src/conversation/types.ts +43 -4
  681. package/src/conversation/voice.ts +655 -51
  682. package/src/creatorCuration.ts +316 -0
  683. package/src/creatorDashboard.ts +344 -0
  684. package/src/creatorUniverse.ts +222 -0
  685. package/src/curationWrite.ts +108 -0
  686. package/src/designTokens.ts +157 -0
  687. package/src/dialogAttribution.ts +182 -0
  688. package/src/dmRunWorldReadiness.ts +1168 -0
  689. package/src/domains/access.ts +92 -0
  690. package/src/domains/adventureDefinitions.ts +313 -0
  691. package/src/domains/adventures.ts +557 -0
  692. package/src/domains/arcs.ts +350 -0
  693. package/src/domains/artifacts.ts +349 -0
  694. package/src/domains/chat.ts +338 -0
  695. package/src/domains/decisions.ts +62 -0
  696. package/src/domains/documents.ts +389 -0
  697. package/src/domains/enhancements.ts +259 -0
  698. package/src/domains/graph.ts +959 -0
  699. package/src/domains/images.ts +451 -0
  700. package/src/domains/ingestion.ts +695 -0
  701. package/src/domains/me.ts +27 -0
  702. package/src/domains/orgs.ts +168 -0
  703. package/src/domains/personas.ts +440 -0
  704. package/src/domains/projects.ts +177 -0
  705. package/src/domains/quests.ts +587 -0
  706. package/src/domains/reactor.ts +163 -0
  707. package/src/domains/showcase.ts +35 -0
  708. package/src/domains/storyboards.ts +1698 -0
  709. package/src/domains/studioSettings.ts +149 -0
  710. package/src/domains/universes.ts +433 -0
  711. package/src/domains/userDefaults.ts +37 -0
  712. package/src/domains/visemeBundles.ts +541 -0
  713. package/src/domains/workflows.ts +376 -0
  714. package/src/enhancementDiff.ts +171 -0
  715. package/src/generated/contract.ts +1016 -0
  716. package/src/graphSchema.ts +154 -6
  717. package/src/http.ts +295 -11
  718. package/src/identity.ts +123 -0
  719. package/src/index.ts +131 -0
  720. package/src/messageContent.ts +500 -0
  721. package/src/mutationEpoch.ts +107 -0
  722. package/src/obo.ts +201 -0
  723. package/src/opusTransport.ts +268 -0
  724. package/src/pagination.ts +29 -0
  725. package/src/platformAssistant.ts +97 -1
  726. package/src/pollUtils.ts +35 -0
  727. package/src/questLog.ts +704 -0
  728. package/src/reactor/dmDirectiveToExperience.ts +636 -0
  729. package/src/reactor/dmSceneControlPrompt.ts +69 -2
  730. package/src/reactor/dmWorldEntry.ts +2226 -0
  731. package/src/reactor/framePromptCompaction.ts +544 -0
  732. package/src/reactor/frameWorldBind.ts +133 -0
  733. package/src/reactor/happyOysterSeed.ts +329 -0
  734. package/src/reactor/happyOysterWalk.ts +541 -0
  735. package/src/reactor/happyOysterWorld.ts +1270 -0
  736. package/src/reactor/heliosCommandDispatcher.ts +5 -1
  737. package/src/reactor/hiddenWorldLifecycle.ts +182 -0
  738. package/src/reactor/imageCanvas.ts +38 -0
  739. package/src/reactor/index.ts +78 -0
  740. package/src/reactor/longLiveCommandDispatcher.ts +23 -8
  741. package/src/reactor/longLiveSceneEntry.ts +409 -0
  742. package/src/reactor/momentCut.ts +219 -0
  743. package/src/reactor/promptAddonRegistry.ts +81 -3
  744. package/src/reactor/promptTemplatePreview.ts +240 -0
  745. package/src/reactor/reactorAvailability.ts +155 -0
  746. package/src/reactor/reactorSessionRefusal.ts +260 -0
  747. package/src/reactor/reactorTokenScope.ts +69 -0
  748. package/src/reactor/resolveDirectorBeats.ts +140 -0
  749. package/src/reactor/sanaLiveEdit.ts +158 -0
  750. package/src/reactor/sceneEntry.ts +106 -88
  751. package/src/reactor/sceneSeedImage.ts +338 -0
  752. package/src/reactor/seedImageOrchestrator.ts +116 -34
  753. package/src/reactor/toolPromptAddon.ts +16 -2
  754. package/src/reactor/worldMintLoop.ts +545 -0
  755. package/src/reactor/worldSteerOutcome.ts +132 -0
  756. package/src/retryAfter.ts +71 -0
  757. package/src/seriesKey.ts +42 -0
  758. package/src/sessionRefresh.ts +237 -0
  759. package/src/sharedAudioContext.ts +67 -0
  760. package/src/singleFlight.ts +91 -0
  761. package/src/storyGraph.ts +247 -4
  762. package/src/storyboardMask.ts +756 -0
  763. package/src/storyboardTimeline.ts +220 -0
  764. package/src/studioAutomation.ts +208 -0
  765. package/src/tenantClaim.ts +170 -0
  766. package/src/timeFormat.ts +51 -0
  767. package/src/toolSchemas.ts +40 -10
  768. package/src/transport.ts +327 -0
  769. package/src/videoGenFacade.ts +90 -0
  770. package/src/visemeScheduler.ts +36 -3
  771. package/src/vision/VisionPublisher.ts +204 -14
  772. package/src/vision/VisionSourceController.ts +187 -6
  773. package/src/vision/__tests__/VisionPublisher.kvs.test.ts +50 -0
  774. package/src/vision/__tests__/VisionPublisher.test.ts +291 -0
  775. package/src/vision/__tests__/VisionSourceController.test.ts +376 -6
  776. package/src/vision/index.ts +5 -1
  777. package/src/vision/sourceKinds.ts +19 -5
  778. package/src/vision/types.ts +7 -4
  779. package/src/vision/visionErrors.ts +70 -0
  780. package/src/voiceCloneCaption.ts +77 -0
  781. package/src/websocket.ts +361 -12
  782. package/src/workflowAuthoring.ts +664 -0
@@ -0,0 +1,718 @@
1
+ /**
2
+ * HappyOyster world adapter — the client-core half of the Reactor HappyOyster
3
+ * launch path (§Q SB-W.1, spec `specs/2026-07-24-storyboard-generator.md` §6).
4
+ *
5
+ * WHAT THE SDK OWNS vs WHAT LIVES HERE. HappyOyster ships a dedicated typed SDK
6
+ * (`@reactor-models/happy-oyster`, v0.2.1 / model v2.0.0) — NOT the generic
7
+ * `@reactor-team/js-sdk` command session the Helios/LongLive/Sana adapters
8
+ * drive. Its `HappyOysterModel` facade owns the transport, the world lifecycle
9
+ * (`connect` → `createWorld`/`attachWorld` → `startTravel`), the seed-image
10
+ * validation (`firstFrameImageIssue`: the 2 MB cap + the 1.5–2.0 landscape
11
+ * aspect-ratio bound), and the `<video>` attachment. This module owns the parts
12
+ * the SDK does NOT provide and that BOTH the React `web/` app and the Vue
13
+ * `../Web-App` need identically:
14
+ *
15
+ * 1. **Prompt validation.** The 2000-character cap is documented but the SDK
16
+ * does NOT enforce it client-side (verified against the published
17
+ * `createWorldPayload` — it forwards `params.prompt` verbatim). An
18
+ * over-long prompt fails server-side after a session is already open, so
19
+ * {@link happyOysterPromptIssue} fails fast instead.
20
+ * 2. **The world handle.** Worlds are PERMANENT and there is no listing API —
21
+ * the `encrypted_world_id` is the only way back. It is NOT sufficient on
22
+ * its own: the two experiences are separate mode-fixed Reactor models
23
+ * (`reactor/happy-oyster-adventure` / `reactor/happy-oyster-director`) and
24
+ * `attachWorld` rejects a world belonging to the other mode with
25
+ * `MODE_MISMATCH`. So the persisted handle is `{encryptedWorldId, mode}` —
26
+ * see {@link HappyOysterWorldHandle}.
27
+ * 3. **Error classification.** The SDK throws `HappyOysterActionError` with a
28
+ * raw gate code and surfaces upstream numeric codes untranslated;
29
+ * {@link classifyHappyOysterError} maps both onto the one reason vocabulary
30
+ * every surface renders.
31
+ * 4. **The launch sequence** — {@link launchHappyOysterWorld}, the
32
+ * create-or-reopen orchestrator (the HappyOyster analogue of
33
+ * `bootstrapSceneInReactor` / `bootstrapSanaLiveEdit`).
34
+ *
35
+ * FRAMEWORK- AND SDK-AGNOSTIC: pure data + functions, NO React/Vue/DOM/SDK
36
+ * imports (the discipline of the rest of `reactor/`). The launcher drives the
37
+ * structural {@link HappyOysterBridge}, which `HappyOysterModel` satisfies
38
+ * as-is; `web/` owns the one `@reactor-models/happy-oyster` import.
39
+ */
40
+ import { type ReactorSessionRefusal } from './reactorSessionRefusal';
41
+ import type { WorldCapability } from '../adapters/capabilities';
42
+ /**
43
+ * The two HappyOyster experiences. The mode is fixed at client construction —
44
+ * it selects WHICH Reactor model the session connects to, so it cannot change
45
+ * for the life of a session or of a world.
46
+ *
47
+ * Deliberately the SDK's CANONICAL spellings only. SDK 0.2.1 still accepts the
48
+ * legacy `'director'` alias for source compatibility but marks it
49
+ * `@deprecated`; admitting it here would let two spellings of one mode reach
50
+ * persisted world handles.
51
+ */
52
+ export type HappyOysterMode = 'adventure' | 'directing';
53
+ /** Every valid {@link HappyOysterMode}, for runtime validation of a persisted
54
+ * or user-supplied mode (a stored handle is untrusted input). */
55
+ export declare const HAPPY_OYSTER_MODES: readonly HappyOysterMode[];
56
+ /**
57
+ * Maximum `createWorld` prompt length. Documented by the vendor and enforced
58
+ * upstream; **the SDK does not check it client-side**, so this module does.
59
+ */
60
+ export declare const HAPPY_OYSTER_PROMPT_MAX_CHARS = 2000;
61
+ /**
62
+ * Why a prompt is unusable, or `null` when it is fine. Returns a
63
+ * human-readable sentence (the `firstFrameImageIssue` convention the SDK uses
64
+ * for seed images) so a surface can render it verbatim.
65
+ */
66
+ export declare function happyOysterPromptIssue(prompt: string): string | null;
67
+ /**
68
+ * How long `createWorld` takes before the world is enterable — MEASURED, not
69
+ * documented. SB-W.1 timed ~105 s on one live staging run and still `building`
70
+ * past 240 s on another, and the vendor publishes no figure. A host must
71
+ * therefore render a long-running progress affordance (elapsed time + the
72
+ * phase) rather than a spinner that implies seconds, and must not impose a
73
+ * short client-side timeout.
74
+ */
75
+ export declare const HAPPY_OYSTER_BUILD_FAST_MS = 105000;
76
+ export declare const HAPPY_OYSTER_BUILD_OBSERVED_MAX_MS = 240000;
77
+ /**
78
+ * §Q `DM.42` — how long the vendor gives the LIVE STREAM to arrive after the
79
+ * world is already built, before it ends the travel itself. **60 s, and it is
80
+ * NOT tunable from this codebase.**
81
+ *
82
+ * Read out of the shipped SDK, not guessed: `HappyOysterModel.doStartTravel`
83
+ * calls `startTravel({credentials, videoElement})` with no `streamReadyTimeout`,
84
+ * and `travel.ts` then constructs the engine with
85
+ * `streamReadyTimeout: options.streamReadyTimeout ?? 6e4`. There is no seam
86
+ * between those two lines, so no host can lengthen this.
87
+ *
88
+ * Why a host must know the number anyway: this bound is the ONLY thing
89
+ * separating "the world is still building" (105–240 s, and fine) from "the
90
+ * world is built and no video ever came" (a dead travel). A surface that shows
91
+ * one progress message across both windows tells the player the build is slow
92
+ * when the build finished minutes ago — measured 2026-08-01, where the pane
93
+ * held *"Reopening this world…"* for the full 60 s on a world whose own phase
94
+ * had already reached `traveling`.
95
+ *
96
+ * What happens at the deadline, measured on staging the same day: the SDK POSTs
97
+ * `travels/end`, rejects `startTravel()` with a message containing the word
98
+ * "timeout", and `doStartTravel`'s `isTransientGatewayError` regex matches that
99
+ * word — so it re-requests credentials and tries again, up to 3 attempts. The
100
+ * repeated `enter-travel`/`end` pairs a host sees are that ladder, not a host
101
+ * bug and not something a host can interrupt.
102
+ */
103
+ export declare const HAPPY_OYSTER_STREAM_START_TIMEOUT_MS = 60000;
104
+ /**
105
+ * How many times the SDK's `doStartTravel` tries to open the stream before it
106
+ * gives up — the ladder described on {@link HAPPY_OYSTER_STREAM_START_TIMEOUT_MS}
107
+ * (read out of the shipped SDK, not tunable from here).
108
+ */
109
+ export declare const HAPPY_OYSTER_STREAM_START_ATTEMPTS = 3;
110
+ /**
111
+ * §Q `WORLD.24` — THE LONGEST A HEALTHY LAUNCH IS ALLOWED TO GO UNSETTLED.
112
+ *
113
+ * A host keys its session management on the launch SETTLING, so that a build
114
+ * is never interrupted mid-`createWorld` (an abort there can lose the id of a
115
+ * world the vendor already minted). That rule has a hole: a vendor call that
116
+ * hangs after the session connected never settles, and a session nobody
117
+ * manages bills for the rest of the page. Past this bound the host stops
118
+ * waiting for the launch and manages the session it can SEE.
119
+ *
120
+ * Derived, not guessed, and deliberately LONG — the note on
121
+ * {@link HAPPY_OYSTER_BUILD_OBSERVED_MAX_MS} forbids a short client-side
122
+ * timeout. Twice the longest build ever observed (that 240 s run was still
123
+ * `building`, so it is a floor, not a ceiling) plus the whole stream-start
124
+ * ladder: 11 minutes. It never aborts anything; it only ends the wait.
125
+ */
126
+ export declare const HAPPY_OYSTER_LAUNCH_SETTLE_BOUND_MS: number;
127
+ /**
128
+ * How long the media track takes to come back after `resume()` — MEASURED.
129
+ * `pause()` does not freeze the stream, it TEARS THE TRACK DOWN: the video
130
+ * element drops to `readyState 0` with `videoWidth`/`videoHeight` 0 and
131
+ * `currentTime` reset, so the pane is BLACK (not a held frame) until the
132
+ * track is re-established ~5–10 s later on a RESET timeline.
133
+ *
134
+ * Two consequences every HappyOyster host inherits: it owes a "resuming…"
135
+ * state for that window (SB-W.2), and a playhead must never be derived from
136
+ * `video.currentTime` across a pause (SB-W.4).
137
+ */
138
+ export declare const HAPPY_OYSTER_RESUME_MEDIA_MIN_MS = 5000;
139
+ export declare const HAPPY_OYSTER_RESUME_MEDIA_MAX_MS = 10000;
140
+ /**
141
+ * What a `<video>` element reports about the live HappyOyster track. Declared
142
+ * structurally so this module stays DOM-free and a host can feed it a sampled
143
+ * snapshot (or a test a literal).
144
+ */
145
+ export interface HappyOysterVideoSample {
146
+ /** `HTMLMediaElement.readyState`. */
147
+ readyState: number;
148
+ videoWidth: number;
149
+ videoHeight: number;
150
+ }
151
+ /**
152
+ * `HAVE_CURRENT_DATA` — the lowest `readyState` at which the element has a
153
+ * frame to paint. Below it the pane is black.
154
+ */
155
+ export declare const HAPPY_OYSTER_VIDEO_READY_STATE_MIN = 2;
156
+ /**
157
+ * Whether the pane is actually showing live video. This is the ONE test for
158
+ * "the track is back", used to clear a resuming state and (SB-W.4) to
159
+ * re-baseline a playhead. The element is the only trustworthy witness: a
160
+ * paused HappyOyster stream reports `readyState 0` with zero dimensions long
161
+ * after the pause/resume call has returned, so a host that waits on the
162
+ * facade's own flags uncovers a black stage.
163
+ */
164
+ export declare function happyOysterVideoIsLive(sample: HappyOysterVideoSample): boolean;
165
+ /**
166
+ * The permanent handle to a HappyOyster world — what a frame / Library artifact
167
+ * stores so the world can be REOPENED later.
168
+ *
169
+ * `mode` is part of the handle, not incidental metadata: worlds live on the
170
+ * mode-fixed model that created them and `attachWorld` rejects the other mode's
171
+ * worlds with `MODE_MISMATCH`, so reopening requires knowing which model to
172
+ * connect to BEFORE connecting.
173
+ */
174
+ export interface HappyOysterWorldHandle {
175
+ /** The vendor's opaque, permanent world id (`encrypted_world_id`). */
176
+ encryptedWorldId: string;
177
+ /** The mode-fixed model that owns the world — required to reopen it. */
178
+ mode: HappyOysterMode;
179
+ }
180
+ /** Whether an unknown value (a persisted record, an API payload) is a usable
181
+ * {@link HappyOysterWorldHandle}. Rejects an unknown/legacy mode spelling
182
+ * rather than letting it reach `attachWorld` and fail with MODE_MISMATCH. */
183
+ export declare function isHappyOysterWorldHandle(value: unknown): value is HappyOysterWorldHandle;
184
+ /**
185
+ * Build a handle from a raw `world_state` snapshot. Returns `null` when the
186
+ * snapshot carries no world id yet (the `no_world` / `creating` / `building`
187
+ * phases all report `encrypted_world_id: null`).
188
+ */
189
+ export declare function happyOysterWorldHandle(snapshot: {
190
+ encrypted_world_id: string | null;
191
+ }, mode: HappyOysterMode): HappyOysterWorldHandle | null;
192
+ /**
193
+ * Upstream (HappyOyster gateway) numeric error codes, as shipped in the SDK's
194
+ * bundled `BackendErrorCode` table. Recorded here because the surfaces need to
195
+ * tell a retryable failure from a permanent rejection, and because the SPEC's
196
+ * §13.2 risk note is WRONG about one of them: it calls 403005 the
197
+ * "image/prompt-mismatch rejection". Per the shipped table 403005 is a
198
+ * COPYRIGHT violation and 403004 is the content-moderation rejection; there is
199
+ * no distinct "image does not match the prompt" code at all. A seed image the
200
+ * model refuses surfaces as one of the two content codes, and a seed image with
201
+ * the wrong shape surfaces as {@link HAPPY_OYSTER_ERROR_PARAM_INVALID}.
202
+ */
203
+ export declare const HAPPY_OYSTER_ERROR_PARAM_INVALID = 400000;
204
+ export declare const HAPPY_OYSTER_ERROR_WORLD_NOT_OWNED = 403001;
205
+ export declare const HAPPY_OYSTER_ERROR_WORLD_NOT_READY = 403002;
206
+ export declare const HAPPY_OYSTER_ERROR_MAIN_API_KEY_REQUIRED = 403003;
207
+ export declare const HAPPY_OYSTER_ERROR_CONTENT_MODERATION = 403004;
208
+ export declare const HAPPY_OYSTER_ERROR_CONTENT_COPYRIGHT = 403005;
209
+ /**
210
+ * The single reason vocabulary every HappyOyster surface renders. Collapses the
211
+ * SDK's string gate codes (`TRAVELING` / `BUSY` / `NO_WORLD` /
212
+ * `WORLD_NOT_READY` / `MODE_MISMATCH`) and the upstream numeric codes above
213
+ * into the distinctions a UI actually acts on.
214
+ */
215
+ export type HappyOysterFailureReason =
216
+ /** The world/prompt/seed was rejected on content grounds (403004 / 403005). */
217
+ 'content_rejected'
218
+ /** The request itself was malformed — e.g. a seed image outside the 2 MB /
219
+ * 1.5–2.0 landscape bounds, or an over-long prompt that reached upstream. */
220
+ | 'invalid_request'
221
+ /** The saved world id is unknown or belongs to another account (403001). */
222
+ | 'world_not_found'
223
+ /** The stored handle's mode does not match the connected model. */
224
+ | 'mode_mismatch'
225
+ /** A travel is live, so the world API is locked — end the travel first. */
226
+ | 'traveling'
227
+ /** The world exists but is not ready to enter yet; retry. */
228
+ | 'not_ready'
229
+ /** Anything else (transport, gateway, unclassified). */
230
+ | 'unknown';
231
+ /** A classified HappyOyster failure, ready to render. */
232
+ export interface HappyOysterFailure {
233
+ reason: HappyOysterFailureReason;
234
+ /** The underlying message, for the detail line / console. */
235
+ message: string;
236
+ /** Whether retrying the SAME call can plausibly succeed. */
237
+ retryable: boolean;
238
+ }
239
+ /**
240
+ * Classify a thrown SDK error into the {@link HappyOysterFailureReason}
241
+ * vocabulary. Reads the `code` carried by `HappyOysterActionError` (a string
242
+ * gate code) and, failing that, looks for an upstream numeric code in the
243
+ * message — the SDK surfaces gateway rejections as message text, so the numeric
244
+ * codes are matched there rather than assumed to be structured.
245
+ */
246
+ export declare function classifyHappyOysterError(error: unknown): HappyOysterFailure;
247
+ /**
248
+ * The HappyOyster adapter descriptor. STRUCTURALLY mirrors
249
+ * `WorldAdapterDescriptor` but is a STANDALONE record (not registered in
250
+ * `createWorldRegistry()`) for the same reason the Sana descriptor is: the
251
+ * registry's `dispatchWorldCommand` speaks the generic `@reactor-team/js-sdk`
252
+ * command grammar, and HappyOyster is driven through its own typed SDK facade
253
+ * instead. Its catalog row is appended from {@link HAPPY_OYSTER_MODEL_ID}.
254
+ *
255
+ * `capabilities` reuses the EXISTING {@link WorldCapability} members only — no
256
+ * union widening (adding a member breaks `web/`'s exhaustive consumers).
257
+ * `set_scene` is the abstract scene-steering axis, which HappyOyster fulfills
258
+ * via `instruct` the way LongLive fulfills it via `set_shot`.
259
+ */
260
+ export interface HappyOysterAdapterDescriptor {
261
+ readonly id: string;
262
+ readonly displayName: string;
263
+ readonly provider: string;
264
+ readonly capabilities: readonly WorldCapability[];
265
+ readonly supportedCommands: readonly string[];
266
+ /** The ADVENTURE session's held-input verbs (§Q MOMENT.3) — see the field
267
+ * comment on {@link happyOysterWorldAdapter}. */
268
+ readonly adventureCommands: readonly string[];
269
+ }
270
+ export declare const happyOysterWorldAdapter: {
271
+ readonly id: "happy-oyster";
272
+ readonly displayName: "HappyOyster";
273
+ readonly provider: "reactor";
274
+ readonly capabilities: readonly ["world_stream", "set_scene", "swap_seed", "pause_resume"];
275
+ readonly supportedCommands: readonly ["createWorld", "attachWorld", "startTravel", "instruct", "pause", "resume", "rewind"];
276
+ readonly adventureCommands: readonly ["move", "look", "interact", "hold", "release", "stop"];
277
+ };
278
+ /**
279
+ * The minimum `world_state` snapshot shape the launcher reads. Structural
280
+ * subset of the SDK's `WorldStateMessage` so this module imports no SDK types.
281
+ */
282
+ export interface HappyOysterWorldSnapshot {
283
+ phase: string;
284
+ encrypted_world_id: string | null;
285
+ first_frame: string | null;
286
+ prompt: string | null;
287
+ }
288
+ /**
289
+ * §Q `DM.77` — THE ONE SESSION STATUS `connect()` WILL ACCEPT.
290
+ *
291
+ * `Reactor.connect` opens with `if (this.status !== 'disconnected') throw new
292
+ * Error('Already connected or connecting')`
293
+ * (`@reactor-team/js-sdk/dist/index.mjs:3319`). HappyOyster's own override only
294
+ * de-dupes an IN-FLIGHT connect (it memoises `connectPromise` and clears it in
295
+ * `finally`), so a connect issued after the first one SETTLED goes straight
296
+ * through to that throw.
297
+ */
298
+ export declare const HAPPY_OYSTER_SESSION_DISCONNECTED = "disconnected";
299
+ /** The session status that means an open, usable session — the state a second
300
+ * world entry re-uses instead of re-connecting. */
301
+ export declare const HAPPY_OYSTER_SESSION_READY = "ready";
302
+ /**
303
+ * The SDK's own connect-guard message, verbatim. It is the ONLY signal that
304
+ * separates a connect attempt that has SETTLED and left the status stuck from
305
+ * one that is still IN FLIGHT — the four-value status cannot tell them apart
306
+ * (codex on #1690).
307
+ */
308
+ export declare const HAPPY_OYSTER_CONNECT_GUARD_MESSAGE = "Already connected or connecting";
309
+ /** Whether a thrown value is the SDK's connect guard. */
310
+ export declare function isHappyOysterConnectGuardError(error: unknown): boolean;
311
+ /**
312
+ * What a launch must do about the session before it touches the world API.
313
+ *
314
+ * - `'connect'` — no session yet (or the host does not report one): open it.
315
+ * - `'reuse'` — a READY session is already open; `connect()` would throw.
316
+ * - `'reset'` — a session is half-open (`connecting`/`waiting`). AMBIGUOUS by
317
+ * construction: that is BOTH what a connect still in flight looks like and
318
+ * what the SDK leaves behind after a FAILED one (only the session-loss
319
+ * retry path calls `setStatus('disconnected')`). The status cannot separate
320
+ * them, so the launcher connects FIRST and only tears down when the connect
321
+ * comes back with the guard — see {@link launchHappyOysterWorld}.
322
+ */
323
+ export type HappyOysterConnectStep = 'connect' | 'reuse' | 'reset';
324
+ /**
325
+ * §Q `DM.77` — DECIDE THE CONNECT STEP FROM THE SESSION STATUS.
326
+ *
327
+ * Measured live on staging AND on a PR preview, 3/3 runs (DM.71 #1687): ANY
328
+ * second world entry in one page load died on `data-launch-kind="error"`,
329
+ * `unknown / "Already connected or connecting"`. The vendor's own natural stop
330
+ * at ~t+70 s leaves the SDK's `HappyOysterModel` at phase `'connected'` with
331
+ * its Reactor status still `'ready'` — the session is deliberately KEPT so the
332
+ * permanent world stays attachable — and the launcher unconditionally called
333
+ * `connect()` again. So the recovery affordance `DM.66` shipped for exactly
334
+ * that moment threw on every click.
335
+ *
336
+ * Why a REUSE and not a disconnect-then-reconnect: `HappyOysterModel.disconnect`
337
+ * does not clear `worldState`, and `doConnect`'s `waitForFirstSnapshot`
338
+ * short-circuits while `worldState` is non-null — so a reset carries the same
339
+ * snapshot staleness a reuse does, plus a session teardown. Re-using a ready
340
+ * session is what the vendor's own `attachWorld` contract expects.
341
+ *
342
+ * An UNREPORTED status (`null`/`undefined` — a bridge that predates this, e.g.
343
+ * the Vue app's) keeps the old unconditional connect. This is additive: no
344
+ * existing caller changes behaviour until it supplies `sessionStatus`.
345
+ */
346
+ export declare function happyOysterConnectStep(status: string | null | undefined): HappyOysterConnectStep;
347
+ /** §Q `WORLD.17` — the slice of the SDK's `ReactorError` the launcher reads. */
348
+ export interface HappyOysterConnectionError {
349
+ code: string;
350
+ message: string;
351
+ }
352
+ /**
353
+ * The structural bridge the launcher drives — satisfied as-is by the SDK's
354
+ * `HappyOysterModel`. Structural so client-core takes NO
355
+ * `@reactor-models/happy-oyster` dependency (mirrors `SanaReactorBridge`).
356
+ */
357
+ export interface HappyOysterBridge {
358
+ /** Open the Reactor session (does NOT create a world). */
359
+ connect: (jwt?: string) => Promise<void>;
360
+ /**
361
+ * §Q `DM.77` — the SDK session status (`Reactor.getStatus()`), read by
362
+ * {@link happyOysterConnectStep} so a SECOND entry in one page load does not
363
+ * re-`connect()` an already-open session and throw.
364
+ *
365
+ * OPTIONAL, and its absence is the pre-DM.77 behaviour, because
366
+ * `HappyOysterBridge` is published and `../Web-App` is pinned. A host that
367
+ * can report it SHOULD: without it, re-entry is broken.
368
+ */
369
+ sessionStatus?: () => string | null | undefined;
370
+ /**
371
+ * §Q `DM.77` — tear a half-open session down so a fresh `connect()` is legal.
372
+ * Only reached on {@link HappyOysterConnectStep} `'reset'`; a bridge that
373
+ * cannot do it falls back to connecting (and to the vendor's throw), which is
374
+ * exactly what it did before.
375
+ */
376
+ disconnect?: () => Promise<void>;
377
+ /**
378
+ * §Q `DM.78` — the identity of the vendor SESSION this bridge drives (hosts
379
+ * pass the SDK model). Launches whose bridges share it share ONE launch lock
380
+ * (see {@link HAPPY_OYSTER_CREATE_IN_FLIGHT_MESSAGE} and §Q `DM.97`'s
381
+ * {@link HAPPY_OYSTER_REOPEN_IN_FLIGHT_MESSAGE}).
382
+ *
383
+ * It exists because a bridge object is not a session: a React host that
384
+ * builds its bridge in a `useMemo` over unmemoised facade members gets a NEW
385
+ * bridge every render, so a lock keyed on the bridge would never see the
386
+ * second launch. OPTIONAL — the bridge is published and `../Web-App` is
387
+ * pinned — and absent it the bridge object itself is the key, which still
388
+ * covers a host that hands the same bridge (or the model itself) to every
389
+ * launch.
390
+ */
391
+ sessionKey?: object;
392
+ /**
393
+ * §Q `WORLD.17` — the SDK's last connection error (`Reactor.getLastError()`).
394
+ *
395
+ * Read because a REFUSED connect never settles on this SDK: `Reactor.connect`
396
+ * reports the failure (`createError('CONNECTION_FAILED', …)`) and then awaits
397
+ * `this.disconnect(false)` before rethrowing, and `HappyOysterModel`
398
+ * overrides `disconnect()` to await its own in-flight `connectPromise` —
399
+ * which is the connect doing the awaiting. The promise hangs forever, the
400
+ * status stays `connecting`, and on the 2026-10-09 staging walk a 402
401
+ * `credits_depleted` left the pane on "Building the world…" for the whole
402
+ * run. The error is the only part of that failure that ever surfaces.
403
+ *
404
+ * OPTIONAL for the same reason as {@link sessionStatus}: the bridge is
405
+ * published and `../Web-App` is pinned. Without it a refused connect hangs
406
+ * exactly as it did before.
407
+ */
408
+ connectionError?: () => HappyOysterConnectionError | null | undefined;
409
+ /**
410
+ * §Q `WORLD.17` — subscribe to the SDK's `error` event; returns the
411
+ * unsubscribe. Lets the launcher reject the moment a connect is refused
412
+ * instead of awaiting the promise the SDK never settles (see
413
+ * {@link connectionError}).
414
+ */
415
+ onConnectionError?: (handler: (error: HappyOysterConnectionError) => void) => () => void;
416
+ /** Create a new world of the bridge's fixed mode and wait for it to be ready. */
417
+ createWorld: (params: {
418
+ prompt: string;
419
+ firstFrameImage?: File | Blob;
420
+ firstFrameImageUrl?: string;
421
+ }) => Promise<HappyOysterWorldSnapshot>;
422
+ /** Reopen a permanent world by its encrypted id. */
423
+ attachWorld: (encryptedWorldId: string) => Promise<HappyOysterWorldSnapshot>;
424
+ /** Open the live video stream for the bound world. */
425
+ startTravel: () => Promise<{
426
+ streaming: boolean;
427
+ }>;
428
+ }
429
+ /** What to launch: a brand-new world, or a reopen of a permanent one. */
430
+ export type HappyOysterLaunchInput = {
431
+ kind: 'create';
432
+ /** The composed world prompt (≤ {@link HAPPY_OYSTER_PROMPT_MAX_CHARS}). */
433
+ prompt: string;
434
+ /** A local seed image. The SDK validates its size + aspect ratio and
435
+ * uploads it; mutually exclusive with `firstFrameImageUrl`. */
436
+ firstFrameImage?: File | Blob;
437
+ /** A publicly-fetchable seed image URL (HappyOyster fetches it itself). */
438
+ firstFrameImageUrl?: string;
439
+ } | {
440
+ kind: 'reopen';
441
+ handle: HappyOysterWorldHandle;
442
+ };
443
+ /** The outcome of a successful launch. */
444
+ export interface HappyOysterLaunchResult {
445
+ /** The permanent handle — persist it to reopen this world later. */
446
+ handle: HappyOysterWorldHandle;
447
+ /** The world snapshot the model reported ready. */
448
+ snapshot: HappyOysterWorldSnapshot;
449
+ /** False when the session ran against the vendor's mock backend (nothing
450
+ * streams) — the SDK reports this rather than throwing — and false whenever
451
+ * the launch was asked not to travel at all (§Q `MOMENT.15`
452
+ * {@link HappyOysterLaunchOptions.skipTravel}). Read
453
+ * {@link HappyOysterLaunchResult.traveled} to tell those apart: `streaming`
454
+ * answers "is video flowing", not "was a travel attempted". */
455
+ streaming: boolean;
456
+ /**
457
+ * §Q `MOMENT.15` — whether {@link HappyOysterBridge.startTravel} was CALLED.
458
+ *
459
+ * A mint-loop launch skips travel: it exists to create the world and bind its
460
+ * handle, and opening a live stream per world would add the vendor's 60 s
461
+ * stream-start bound (plus its 3-attempt ladder) to every beat and stream
462
+ * video nobody is watching. Without this field a caller cannot distinguish
463
+ * "no travel was attempted" from "a travel ran against the mock backend".
464
+ */
465
+ traveled: boolean;
466
+ }
467
+ /**
468
+ * Thrown by {@link launchHappyOysterWorld}; carries the classified reason so a
469
+ * surface renders one message path for every failure mode.
470
+ */
471
+ export declare class HappyOysterLaunchError extends Error {
472
+ readonly reason: HappyOysterFailureReason;
473
+ readonly retryable: boolean;
474
+ /**
475
+ * The world that ALREADY EXISTS despite this failure, or `null` when the
476
+ * launch failed before any world was created.
477
+ *
478
+ * This is not a convenience — it is the only thing standing between a
479
+ * failed `startTravel()` and an orphaned asset. Worlds are permanent, the
480
+ * vendor has no listing API, and `createWorld` bills whether or not the
481
+ * stream then opens. A caller MUST persist this handle in its failure path
482
+ * exactly as it persists a successful launch's.
483
+ */
484
+ readonly handle: HappyOysterWorldHandle | null;
485
+ /**
486
+ * §Q `WORLD.17` — the vendor's refusal of the SESSION itself (HTTP 402
487
+ * `credits_depleted`, capacity, any refused session create), or `null` when
488
+ * the launch failed for any other reason. Carried beside `reason` rather
489
+ * than as a new {@link HappyOysterFailureReason} member because that union is
490
+ * published and consumers switch on it exhaustively. OPTIONAL so a
491
+ * structural mock of this class written before WORLD.17 still type-checks;
492
+ * read it as `err.vendorRefusal ?? null`.
493
+ */
494
+ readonly vendorRefusal?: ReactorSessionRefusal | null;
495
+ constructor(failure: HappyOysterFailure, options?: {
496
+ cause?: unknown;
497
+ handle?: HappyOysterWorldHandle | null;
498
+ vendorRefusal?: ReactorSessionRefusal | null;
499
+ });
500
+ }
501
+ /**
502
+ * §Q `WORLD.17` — the refusal a session is WEDGED on, or `null`.
503
+ *
504
+ * After a refused connect the SDK leaves the status `connecting` and memoises
505
+ * the connect promise it never settles (see
506
+ * {@link HappyOysterBridge.connectionError}), so a later entry's `connect()`
507
+ * joins that hung promise and its `error` event has already fired — nothing
508
+ * would ever answer it. A half-open status beside a `CONNECTION_FAILED` error
509
+ * is exactly that state on this SDK: it records `CONNECTION_FAILED` only on the
510
+ * way out of `connect()`, and on `HappyOysterModel` that exit never completes,
511
+ * so the status cannot leave `connecting` again. (`lastError` is never cleared,
512
+ * so an SDK that one day DOES recover would leave this error stale; the status
513
+ * would then read `disconnected` after the failure and this returns `null`.)
514
+ */
515
+ export declare function happyOysterWedgedRefusal(bridge: Pick<HappyOysterBridge, 'sessionStatus' | 'connectionError'>): HappyOysterConnectionError | null;
516
+ /**
517
+ * §Q `DM.78` — the refusal a launch gets while a `create` is still in flight on
518
+ * the same session: a second create would mint a second paid, permanent world,
519
+ * and a reopen would re-point the session's current world under the create.
520
+ * Exported so a surface or a probe can name the refusal without matching
521
+ * rendered copy.
522
+ */
523
+ export declare const HAPPY_OYSTER_CREATE_IN_FLIGHT_MESSAGE = "A world is still being created on this session \u2014 wait for it to finish. A second create now would mint a second paid, permanent world.";
524
+ /**
525
+ * §Q `DM.78` — the refusal a create gets when its session was taken over while
526
+ * it was in flight (its holder's lock was voided and a later launch reopened the
527
+ * session). The world it minted is real and is handed back on the error; the
528
+ * stream is NOT opened, because the session it would open on is no longer the
529
+ * one this launch connected. Exported for the same reason as
530
+ * {@link HAPPY_OYSTER_CREATE_IN_FLIGHT_MESSAGE}: this is the refusal that
531
+ * carries a minted handle, and a host grading it should not match prose.
532
+ */
533
+ export declare const HAPPY_OYSTER_CREATE_SESSION_REPLACED_MESSAGE = "The session this world was created on was closed and reopened by a later launch before the world could be entered \u2014 the world is saved; enter it again.";
534
+ /**
535
+ * §Q `DM.97` — the refusal a launch gets while a `reopen` is still in flight on
536
+ * the same session. `attachWorld` mints nothing, but it re-points the session's
537
+ * current world until the reopen's own `startTravel` engages the vendor's
538
+ * travel lock, so a create or a second reopen started inside that window would
539
+ * have one of the two launches enter the other's world. Exported for the same
540
+ * reason as {@link HAPPY_OYSTER_CREATE_IN_FLIGHT_MESSAGE}.
541
+ */
542
+ export declare const HAPPY_OYSTER_REOPEN_IN_FLIGHT_MESSAGE = "A world is still being opened on this session \u2014 wait for it to finish before launching another.";
543
+ /**
544
+ * §Q `DM.97` — the reopen counterpart of
545
+ * {@link HAPPY_OYSTER_CREATE_SESSION_REPLACED_MESSAGE}: the reopen's session was
546
+ * closed and taken over by a later launch while it was attaching, so it does
547
+ * NOT open the stream on the session that later launch owns. The handle it
548
+ * reopened is handed back on the error.
549
+ */
550
+ export declare const HAPPY_OYSTER_REOPEN_SESSION_REPLACED_MESSAGE = "The session this world was being opened on was closed and reopened by a later launch before the world could be entered \u2014 enter it again.";
551
+ /**
552
+ * Create-or-reopen a HappyOyster world and start streaming it. The ONE launch
553
+ * sequence both the React and Vue surfaces run:
554
+ *
555
+ * 1. validate the prompt (the SDK does not) — fails BEFORE a session opens;
556
+ * 2. open the mode-fixed session — `connect()`, or REUSE an already-ready one
557
+ * (§Q `DM.77`: a second `connect()` throws);
558
+ * 3. `createWorld(...)` or `attachWorld(handle.encryptedWorldId)`;
559
+ * 4. `startTravel()` to open the live stream.
560
+ *
561
+ * `bridge` must already be constructed for `mode` — the SDK fixes the mode at
562
+ * construction, so a reopen whose handle carries the other mode is rejected
563
+ * HERE (before the round-trip) rather than upstream with `MODE_MISMATCH`.
564
+ *
565
+ * Every failure surfaces as a {@link HappyOysterLaunchError} carrying a
566
+ * classified {@link HappyOysterFailureReason}.
567
+ */
568
+ export declare function launchHappyOysterWorld(input: HappyOysterLaunchInput, bridge: HappyOysterBridge, mode: HappyOysterMode, options?: {
569
+ jwt?: string;
570
+ /**
571
+ * §Q `DM.43` — THE WORLD EXISTS FROM HERE ON, so record it from here on.
572
+ *
573
+ * Called the instant `createWorld`/`attachWorld` yields a world id and
574
+ * BEFORE {@link HappyOysterBridge.startTravel}, which is the call that can
575
+ * hang for minutes. Everything after this point — the vendor's 60 s
576
+ * stream-start bound (see
577
+ * {@link HAPPY_OYSTER_STREAM_START_TIMEOUT_MS}), its 3-attempt retry
578
+ * ladder, a reload, a tab close, a component unmount — happens to a world
579
+ * that is ALREADY PERMANENT AND ALREADY BILLED.
580
+ *
581
+ * The pre-existing `HappyOysterLaunchError.handle` rail is not a
582
+ * substitute: it only surrenders the id once the launch has finished
583
+ * failing, which is up to ~3 minutes later on a create. Anything that ends
584
+ * the page inside that window destroys the only reference to a paid asset,
585
+ * because HappyOyster worlds cannot be listed.
586
+ *
587
+ * A throw here is swallowed deliberately: recording is best-effort at this
588
+ * point and the success/failure paths persist again, so a transient
589
+ * write failure must not abort a launch that is otherwise fine.
590
+ */
591
+ onWorldCreated?: (handle: HappyOysterWorldHandle) => void | Promise<void>;
592
+ /**
593
+ * §Q `MOMENT.15` — CREATE (or attach) and STOP, without opening a stream.
594
+ *
595
+ * The mint loop pre-mints one world per beat at BOARD time so that play-time
596
+ * entry becomes an `attachWorld`. It needs step 3 and nothing after it: a
597
+ * `startTravel` per world would add the vendor's 60 s stream-start bound and
598
+ * its 3-attempt retry ladder to every beat — up to ~3 minutes each — and
599
+ * stream video to nobody.
600
+ *
601
+ * It is an option on THIS function rather than a second create path on
602
+ * purpose. The sequence's hard-won part is the §Q `DM.77` connect ladder
603
+ * (a second `connect()` throws `Already connected or connecting`, which is
604
+ * exactly what a loop does on its second iteration), and a separate
605
+ * mint-only function would re-derive it and get that wrong.
606
+ *
607
+ * The world is just as permanent and just as billed either way, so the §Q
608
+ * `DM.43` `onWorldCreated` rail still fires before this option can change
609
+ * anything.
610
+ */
611
+ skipTravel?: boolean;
612
+ }): Promise<HappyOysterLaunchResult>;
613
+ /**
614
+ * The world phase during which the vendor LOCKS `createWorld` and `attachWorld`
615
+ * (`WorldPhase` in `@reactor-models/happy-oyster` — *"A travel is live: the
616
+ * world API (create/attach/credentials) is locked"*).
617
+ */
618
+ export declare const HAPPY_OYSTER_WORLD_PHASE_TRAVELING = "traveling";
619
+ /** Client phases during which the vendor locks the world API. */
620
+ export declare const HAPPY_OYSTER_LOCKED_CLIENT_PHASES: readonly string[];
621
+ /**
622
+ * The vendor's own refusal, quoted. `assertWorldApiUnlocked` throws
623
+ * `<method>() is locked while a travel is live — end the travel first`, and
624
+ * this fragment is what a surface (or a harness verdict) matches to say the
625
+ * refusal was the travel lock rather than any other launch failure.
626
+ */
627
+ export declare const HAPPY_OYSTER_TRAVEL_LOCK_MESSAGE = "locked while a travel is live";
628
+ /** Whether an error is the vendor's travel-lock refusal. */
629
+ export declare function isHappyOysterTravelLockError(error: unknown): boolean;
630
+ /**
631
+ * §Q WORLD.10 — IS THE WORLD API LOCKED RIGHT NOW? The vendor's condition,
632
+ * mirrored, because the surface has to answer it BEFORE it calls create/attach.
633
+ *
634
+ * ⛔ **THREE ARMS, AND THE SHIPPED GUARD TESTED ONE.** The SDK's
635
+ * `assertWorldApiUnlocked` refuses when the CLIENT phase is `streaming` **or**
636
+ * `starting_stream`, **or** when the model's last `world_state` snapshot says
637
+ * `traveling`. Both panes guarded on `facade.streaming` alone — which is
638
+ * exactly `phase === 'streaming'` — so a lock held by either of the other two
639
+ * arms was invisible to the very code whose job was to clear it.
640
+ *
641
+ * The world phase is the arm that made the failure PERMANENT (measured on the
642
+ * §Q GROUND.82 connected run: world entries #2 and #3 both died on
643
+ * `createWorld() is locked while a travel is live`). See
644
+ * {@link ensureHappyOysterWorldApiUnlocked} for why ending the travel is not by
645
+ * itself enough to clear it.
646
+ */
647
+ export declare function happyOysterWorldApiIsLocked(input: {
648
+ clientPhase?: string | null;
649
+ worldPhase?: string | null;
650
+ }): boolean;
651
+ /**
652
+ * What a host must expose for {@link ensureHappyOysterWorldApiUnlocked} to
653
+ * clear a travel lock. Every member is read from the vendor MODEL rather than
654
+ * from React state on purpose: the model mirrors each message synchronously, so
655
+ * a getter cannot hand back a value a re-render had not committed yet.
656
+ */
657
+ export interface HappyOysterTravelLockGate {
658
+ /** `model.phase` — the client lifecycle phase. */
659
+ clientPhase: () => string | null | undefined;
660
+ /** `model.worldState?.phase` — the model's own world lifecycle phase. */
661
+ worldPhase: () => string | null | undefined;
662
+ /** `model.endTravelSession()` — end the live stream, keep the world. */
663
+ endTravelSession: () => Promise<void>;
664
+ /**
665
+ * `model.requestState()` — ask the model for a fresh `world_state`.
666
+ *
667
+ * OPTIONAL because this package is published and `../Web-App` is pinned; a
668
+ * host that cannot refresh keeps the pre-WORLD.10 behaviour (end the travel,
669
+ * and hope the snapshot was current).
670
+ */
671
+ refreshWorldState?: () => Promise<void>;
672
+ }
673
+ /** What clearing the lock actually took — reported, never swallowed. */
674
+ export type HappyOysterUnlockOutcome = 'unlocked' | 'travel_ended' | 'state_refreshed' | 'still_locked';
675
+ /** How long to wait for the refreshed `world_state` snapshot to arrive. */
676
+ export declare const HAPPY_OYSTER_WORLD_STATE_REFRESH_MS = 5000;
677
+ /** How often to re-read the model's snapshot while waiting for that refresh. */
678
+ export declare const HAPPY_OYSTER_WORLD_STATE_POLL_MS = 250;
679
+ /**
680
+ * §Q WORLD.10 — MAKE THE WORLD API LEGAL AGAIN BEFORE OPENING THE NEXT WORLD.
681
+ *
682
+ * ⛔ **`endTravelSession()` CANNOT CLEAR THE LOCK ON ITS OWN, AND THAT IS THE
683
+ * WHOLE ROW.** Read the vendor in order:
684
+ *
685
+ * 1. `travel_state` messages are mirrored onto `model.travelState` — and
686
+ * **nulled** the moment the status is `completed` or `failed`
687
+ * (`HappyOysterBase`'s constructor subscription).
688
+ * 2. `endTravelSession()` reads `travelState?.encrypted_travel_id` and sends
689
+ * the model's `end_travel` **and** `requestState()` ONLY when that id is
690
+ * non-null. After a completion it is null, so the call collapses to
691
+ * "clear the hold, drop the session, reset the client phase".
692
+ * 3. `handleTravelCompleted()` — the SDK's own completion handler — likewise
693
+ * never asks for a fresh snapshot.
694
+ *
695
+ * So once a travel COMPLETES, `model.worldState.phase` keeps saying `traveling`
696
+ * with nothing in the session that will ever say otherwise, and every later
697
+ * `createWorld`/`attachWorld` is refused. That is why the GROUND.82 run's world
698
+ * entries #2 and #3 failed for the rest of the session while entry #1 had
699
+ * painted: not a vendor bug, and not the missing exit hook the row guessed at,
700
+ * but a snapshot nobody re-read.
701
+ *
702
+ * The sequence is therefore: end the travel (which clears the client-phase
703
+ * arms, and the world-phase arm too whenever the SDK still knows the travel
704
+ * id), then — if the world phase is STILL `traveling` — ask for a fresh
705
+ * snapshot and wait for it, because `requestState()` only sends the request;
706
+ * the answer arrives as a message.
707
+ *
708
+ * Returns what it took. A `'still_locked'` result is deliberately not a throw:
709
+ * the caller proceeds and the vendor's own refusal stays the report, rather
710
+ * than this function inventing a second failure vocabulary for the same fact.
711
+ */
712
+ export declare function ensureHappyOysterWorldApiUnlocked(gate: HappyOysterTravelLockGate, options?: {
713
+ waitMs?: number;
714
+ pollMs?: number;
715
+ sleep?: (ms: number) => Promise<void>;
716
+ now?: () => number;
717
+ }): Promise<HappyOysterUnlockOutcome>;
718
+ //# sourceMappingURL=happyOysterWorld.d.ts.map