@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,1253 @@
1
+ /**
2
+ * Visual-storyboard domain module (§Q SB-U.1, spec slice S1 —
3
+ * `specs/2026-07-24-storyboard-generator.md` §4.1/§4.5).
4
+ *
5
+ * Wire-type MIRROR of `shared/storyboard_models.py` (frozen by §Q SB.1,
6
+ * PR #1464) plus the §4.5 request surface. The BACKEND module is the single
7
+ * source of truth for this vocabulary: every union here is mirrored, never
8
+ * re-derived, and no consumer hard-codes a raw status/mode string. Additive-
9
+ * only, framework-agnostic (no React/Vue imports) — the `quests.ts`/
10
+ * `artifacts.ts` posture.
11
+ *
12
+ * Three shape decisions SB.1 PINNED, honoured here rather than re-litigated:
13
+ *
14
+ * 1. **Ordering lives ONLY in {@link Storyboard.frameIds}.** There is no
15
+ * per-frame `order` field and this module does not add one — a reorder is
16
+ * the single idempotent list patch
17
+ * {@link StoryboardsApi.reorderStoryboardFrames}, and
18
+ * {@link orderStoryboardFrames} is the ONE resolver that turns the id list
19
+ * into a rendered sequence.
20
+ * 2. **Frame status is DERIVED, never stored.** The backend computes it
21
+ * (`StoryboardFrame.status`, a pydantic `computed_field`) so it DOES ride
22
+ * the wire read-only; {@link deriveFrameStatus} mirrors the same rule for
23
+ * optimistic UI. Nothing client-side ever SENDS a frame status.
24
+ * 3. **Master frame is `1664×936` at exactly `16:9`**
25
+ * ({@link STORYBOARD_MASTER_FRAME_WIDTH}/{@link STORYBOARD_MASTER_FRAME_HEIGHT}/
26
+ * {@link STORYBOARD_MASTER_ASPECT_RATIO}). The old contradictory 1664×960
27
+ * appears nowhere — `StyleProfile` is REJECTED server-side when the declared
28
+ * ratio and the declared pixels disagree.
29
+ *
30
+ * `txnVer` is the store-owned optimistic-lock value. Clients never mint it:
31
+ * they read it off a frame and echo it back on the version-guarded writes
32
+ * ({@link StoryboardsApi.patchStoryboardFrame} /
33
+ * {@link StoryboardsApi.selectStoryboardFrameVariant}). Omitting it makes those
34
+ * calls last-writer-wins.
35
+ *
36
+ * Land-dark: the whole backend surface 404s until `SEER_STORYBOARD_ENABLED` is
37
+ * set server-side (SB.4 ships the routes; SB.15 flips staging). As of this
38
+ * slice NO storyboard route exists yet — this module is the contract every
39
+ * SB-U row builds against.
40
+ */
41
+ import type { Transport } from '../transport';
42
+ import type { CameraPose } from '../storyboardMask';
43
+ import type { GateExpr } from './quests';
44
+ import type { HappyOysterMode } from '../reactor/happyOysterWorld';
45
+ /** Board lifecycle (mirrors backend `StoryboardStatus`). */
46
+ export type StoryboardStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
47
+ /** Statuses no transition may leave (mirrors `STORYBOARD_TERMINAL_STATUSES`). */
48
+ export declare const STORYBOARD_TERMINAL_STATUSES: readonly StoryboardStatus[];
49
+ /** Poll predicate for the 202-create flow — prefer this over raw comparisons. */
50
+ export declare function isStoryboardTerminal(status: StoryboardStatus): boolean;
51
+ /** Whether the board matches the source film or restyles it (`StyleMode`). */
52
+ export type StoryboardStyleMode = 'original_similar' | 'restyled';
53
+ /** How a frame enters — compiles to LongLive `set_shot` vs `scene_cut`. */
54
+ export type ShotTransition = 'soft_shot' | 'hard_cut';
55
+ /** One generation attempt's outcome (`VariantStatus`). */
56
+ export type FrameVariantStatus = 'pending' | 'succeeded' | 'failed';
57
+ /** Which surface produced a variant (`VariantOrigin`). */
58
+ export type FrameVariantOrigin = 'generate' | 'regenerate' | 'region_edit';
59
+ /**
60
+ * DERIVED frame state (`FrameStatus`) — computed from the variant list by
61
+ * {@link deriveFrameStatus}, never authored by a client.
62
+ */
63
+ export type StoryboardFrameStatus = 'pending' | 'running' | 'succeeded' | 'failed';
64
+ /** Canonical master-frame width in pixels (`MASTER_FRAME_WIDTH`). */
65
+ export declare const STORYBOARD_MASTER_FRAME_WIDTH = 1664;
66
+ /** Canonical master-frame height — 1664 × 9/16, exactly 16:9 (`MASTER_FRAME_HEIGHT`). */
67
+ export declare const STORYBOARD_MASTER_FRAME_HEIGHT = 936;
68
+ /** The ONE aspect ratio v1 boards render at, `"W:H"` (`MASTER_ASPECT_RATIO`). */
69
+ export declare const STORYBOARD_MASTER_ASPECT_RATIO = "16:9";
70
+ /** Max frames one board may hold (`MAX_FRAMES_PER_BOARD`). */
71
+ export declare const MAX_FRAMES_PER_BOARD = 24;
72
+ /** Variant history kept per frame (`VARIANT_HISTORY_CAP`); overflow evicts the
73
+ * oldest NON-SELECTED variant server-side. */
74
+ export declare const FRAME_VARIANT_HISTORY_CAP = 8;
75
+ /** Marble multi-view degrees cap — ≤8 in reconstruction mode
76
+ * (`MULTI_VIEW_AZIMUTH_CAP`). */
77
+ export declare const MULTI_VIEW_AZIMUTH_CAP = 8;
78
+ /** Per-frame clip length; Veo 3.1's documented set is the binding constraint. */
79
+ export type FrameDurationSeconds = 4 | 6 | 8;
80
+ /** The same set as data, for pickers and validation messages
81
+ * (`FRAME_DURATION_CHOICES`). */
82
+ export declare const FRAME_DURATION_CHOICES: readonly FrameDurationSeconds[];
83
+ /** Our default when the composer does not choose (`DEFAULT_FRAME_DURATION_SECONDS`). */
84
+ export declare const DEFAULT_FRAME_DURATION_SECONDS: FrameDurationSeconds;
85
+ /** Per-tag length cap (`STYLE_TAG_MAX_LEN`) — the editor's own bound. */
86
+ export declare const STORYBOARD_STYLE_TAG_MAX_LEN = 64;
87
+ /** Style-tag count cap (`STYLE_TAGS_MAX`). */
88
+ export declare const STORYBOARD_STYLE_TAGS_MAX = 12;
89
+ /** Free-text prompt-field cap (`PROMPT_TEXT_MAX_LEN`). */
90
+ export declare const STORYBOARD_PROMPT_TEXT_MAX_LEN = 2000;
91
+ /** Dialogue-line count cap (`DIALOG_LINES_MAX`). */
92
+ export declare const STORYBOARD_DIALOG_LINES_MAX = 12;
93
+ /** Per-list reference cap for `characterRefs`/`settingRefs` (`FRAME_REFS_MAX`). */
94
+ export declare const STORYBOARD_FRAME_REFS_MAX = 12;
95
+ /**
96
+ * What generating a board from one arc variant will actually SPEND, in the only
97
+ * unit this product can state honestly: images.
98
+ *
99
+ * §Q `SB.22` — generation is PAID and irreversible, so no surface may fire it
100
+ * without first telling the creator how much work it commits. There is no
101
+ * per-image price anywhere in the catalogue (`shared/image_model_registry.py`
102
+ * carries capabilities, not dollars) and `Storyboard.costUsd` is written by the
103
+ * worker AFTER the fact, so a dollar figure here would be invented. The FRAME
104
+ * COUNT is not invented: it is exactly what the planner will draw.
105
+ */
106
+ export interface StoryboardFrameBudget {
107
+ /** Beats + endings the plan will walk — one candidate frame each. */
108
+ nodeCount: number;
109
+ /** Images that will actually be generated (`nodeCount` under the cap). */
110
+ frameCount: number;
111
+ /** True when {@link MAX_FRAMES_PER_BOARD} truncated the plan. */
112
+ capped: boolean;
113
+ }
114
+ /**
115
+ * The frame budget an arc variant would generate — mirror of the backend's
116
+ * frame planner (`services/storyboard/worker.py` `_plan_frames`), which walks
117
+ * `topological_node_order(variant)` (beats then endings — EVERY beat and EVERY
118
+ * ending, in a stable order) and stops at {@link MAX_FRAMES_PER_BOARD}.
119
+ *
120
+ * Only the COUNT is mirrored, never the ordering: the count is order-invariant,
121
+ * so this cannot drift from the planner the way a re-implemented topological
122
+ * sort would. Structurally typed rather than taking `ArcVariant` so the
123
+ * storyboard module keeps its one-way dependency (arcs types live in `api.ts`,
124
+ * which imports this module).
125
+ */
126
+ export declare function storyboardFrameBudget(variant: {
127
+ beats: readonly unknown[];
128
+ endings: readonly unknown[];
129
+ }): StoryboardFrameBudget;
130
+ /**
131
+ * Board-wide look + the master geometry every frame is generated at (mirrors
132
+ * backend `StyleProfile`). The backend REJECTS a profile whose
133
+ * {@link StyleProfile.aspectRatio} disagrees with the master pixels, so a UI
134
+ * that offers a custom master must keep the two in step.
135
+ */
136
+ export interface StyleProfile {
137
+ mode: StoryboardStyleMode;
138
+ /** Short look descriptors folded into every frame prompt. */
139
+ styleTags: string[];
140
+ /** Free-text art direction applied board-wide. */
141
+ styleDirection?: string | null;
142
+ /** Frame aspect as `"W:H"` — must agree with the master pixels. */
143
+ aspectRatio: string;
144
+ masterWidth: number;
145
+ masterHeight: number;
146
+ /** Board-wide generation seed — the consistency-v1 anchor. */
147
+ boardSeed?: number | null;
148
+ }
149
+ /**
150
+ * What a creator picked on an arc-generate surface (§Q `BOARD.5`).
151
+ *
152
+ * The UI holds tags and direction across a mode flip so a mis-click does not
153
+ * erase typing; {@link buildArcStyleProfile} is what decides they are only
154
+ * SENT on the restyled arm.
155
+ */
156
+ export interface ArcStyleSelection {
157
+ mode: StoryboardStyleMode;
158
+ /** Look descriptors, as typed — unnormalized. */
159
+ styleTags?: readonly string[];
160
+ /** Free-text art direction, as typed. */
161
+ styleDirection?: string | null;
162
+ }
163
+ /** The default a surface starts on — identical to what the backend assumes. */
164
+ export declare const DEFAULT_ARC_STYLE_SELECTION: ArcStyleSelection;
165
+ /**
166
+ * Trim, drop blanks, and de-duplicate style tags, preserving typed order.
167
+ *
168
+ * De-duplication is case-SENSITIVE on purpose: the backend folds tags into
169
+ * frame prompts verbatim, so `"Noir"` and `"noir"` are two different words to
170
+ * the image model and collapsing them would silently edit the creator's look.
171
+ * It only removes an exact repeat, which is always a typo.
172
+ */
173
+ export declare function normalizeArcStyleTags(tags: readonly string[] | undefined): string[];
174
+ /**
175
+ * Why this selection would 422, or `null` when it is sendable.
176
+ *
177
+ * The caps are the backend's (`STYLE_TAGS_MAX`, `STYLE_TAG_MAX_LEN`,
178
+ * `PROMPT_TEXT_MAX_LEN`) and they are checked HERE rather than left to the
179
+ * server because `StyleProfile` validation happens at ARC GENERATION — a 422
180
+ * there loses the whole request, not just the style.
181
+ *
182
+ * The `original_similar` arm never fails: {@link buildArcStyleProfile} sends
183
+ * nothing on it, so an over-cap tag the creator typed and then abandoned
184
+ * cannot block a generate.
185
+ */
186
+ export declare function arcStyleSelectionError(selection: ArcStyleSelection): string | null;
187
+ /**
188
+ * The `styleProfile` partial to put on a `GenerateArcRequest`, or `undefined`
189
+ * to OMIT the key entirely (§Q `BOARD.5`).
190
+ *
191
+ * ⛔ **THE DEFAULT ARM RETURNS `undefined`, NOT A NEUTRAL PROFILE.** Every
192
+ * arc-generate surface omitted the key before this row, and the backend's
193
+ * `StyleProfile()` defaults ARE `original_similar` with no tags — so omitting
194
+ * keeps an unstyled generate byte-identical to what shipped, which is the
195
+ * only way to be sure this row changed nothing for a creator who ignores it.
196
+ * ⚠ The reason is NOT that a sent key would 422: `styleProfile` is a declared
197
+ * optional field and `{}` validates straight through to those same defaults
198
+ * (codex corrected an earlier claim here that blamed `extra="forbid"`; that
199
+ * setting rejects UNDECLARED keys, which this is not). The reason is that a
200
+ * proposal recording an explicit profile and one recording "the creator did
201
+ * not choose" are different facts, and only the second is true here.
202
+ *
203
+ * ⛔ **THE `original_similar` ARM DROPS TAGS AND DIRECTION.** The backend's
204
+ * `sheet_style_recipe` treats a profile as STYLIZED when it carries tags or
205
+ * direction *regardless of mode*, so forwarding text a creator typed and then
206
+ * switched away from would quietly buy a stylized board they de-selected.
207
+ *
208
+ * ⛔ **GEOMETRY IS NEVER SENT.** `aspectRatio`/`masterWidth`/`masterHeight`
209
+ * must agree with each other or the backend 422s the ARC REQUEST (not the
210
+ * board), and this surface offers no master control — so the server's own
211
+ * defaults are the only correct source. `boardSeed` is likewise not a
212
+ * creator-facing choice here.
213
+ *
214
+ * A restyled pick with neither tags nor direction still sends `{mode}`: mode
215
+ * alone is meaningful to `sheet_style_recipe`, not a no-op.
216
+ */
217
+ export declare function buildArcStyleProfile(selection: ArcStyleSelection): Partial<StyleProfile> | undefined;
218
+ /**
219
+ * The `styleProfile` key spread straight into a `GenerateArcRequest` literal —
220
+ * `{}` on the default arm, so the request object is byte-identical to the
221
+ * pre-`BOARD.5` payload. One helper so no surface re-derives the omit rule.
222
+ */
223
+ export declare function arcStyleProfileField(selection: ArcStyleSelection): {
224
+ styleProfile?: Partial<StyleProfile>;
225
+ };
226
+ /**
227
+ * The structured prompt (mirrors backend `FramePrompt`) — self-sufficient
228
+ * because LongLive takes TEXT ONLY. The flattener `compiled_text()` stays
229
+ * SERVER-SIDE by design (it is the single source of the string every adapter
230
+ * and export target sends); the compiled result reaches the client as
231
+ * {@link StoryboardFrameVariant.promptText} provenance.
232
+ */
233
+ export interface FramePrompt {
234
+ sceneDescription: string;
235
+ /** Cast described IN WORDS (identity survives text-only targets). */
236
+ charactersInWords: string[];
237
+ action: string;
238
+ /** The camera leg every live target actually reads (SB-U.2's prose). */
239
+ cameraProse: string;
240
+ styleTags: string[];
241
+ dialogLines: string[];
242
+ negative?: string | null;
243
+ }
244
+ /** One reference image fed to a multi-reference adapter (`FrameRef`). */
245
+ export interface StoryboardFrameRef {
246
+ /** Cast member or setting name. */
247
+ entity: string;
248
+ imageId: string;
249
+ /** Stylized companion — Seedance rejects photoreal-face references. */
250
+ stylizedImageId?: string | null;
251
+ /** 1-based `@ImageN` address; null ⇒ the ref is unaddressed. */
252
+ imageSlot?: number | null;
253
+ }
254
+ /** One generation ATTEMPT and its provenance (`FrameVariant`, history cap 8). */
255
+ export interface StoryboardFrameVariant {
256
+ variantId: string;
257
+ status: FrameVariantStatus;
258
+ origin: FrameVariantOrigin;
259
+ /** S3 key (`shared.s3_keys.storyboard_frame_key`) — not directly fetchable. */
260
+ imageKey?: string | null;
261
+ /** S3 key of the region-edit mask, when `origin` is `region_edit`. */
262
+ maskKey?: string | null;
263
+ modelId?: string | null;
264
+ seed?: number | null;
265
+ /** The compiled prompt actually sent — regeneration provenance. */
266
+ promptText?: string | null;
267
+ error?: string | null;
268
+ /** ISO-8601. */
269
+ createdAt: string;
270
+ completedAt?: string | null;
271
+ /**
272
+ * Presigned URL for {@link StoryboardFrameVariant.imageKey}, attached by the
273
+ * DETAIL read only (spec §4.5 "detail + presigned frame URLs"); it is not a
274
+ * stored field and never rides a write. Absent until SB.4 ships the route.
275
+ */
276
+ imageUrl?: string | null;
277
+ }
278
+ /** Per-target extras the lowest-common-denominator frame cannot carry (§5). */
279
+ export interface FrameExtensions {
280
+ lastFrameImageKey?: string | null;
281
+ /** Helios seed adherence, `[0, 1]`. */
282
+ imageStrength?: number | null;
283
+ /** Marble multi-view degrees (≤{@link MULTI_VIEW_AZIMUTH_CAP}). */
284
+ multiViewAzimuths: number[];
285
+ /** SAM-3D per-object lift requested. Wire key is `lift3D` (backend
286
+ * `lift_3d` through pydantic `to_camel`) — note the capital D. */
287
+ lift3D: boolean;
288
+ }
289
+ /**
290
+ * One board frame (mirrors backend `StoryboardFrame`). Carries NO `videoId`/
291
+ * `historyScopeId` — those live on the board. There is deliberately **no
292
+ * `order` field**: position is this frame's index in
293
+ * {@link Storyboard.frameIds} (use {@link orderStoryboardFrames}).
294
+ */
295
+ export interface StoryboardFrame {
296
+ storyboardId: string;
297
+ frameId: string;
298
+ /**
299
+ * Join key → the PlotBeat node id, which is also the quests'
300
+ * `sourceBeatId` — this is what makes the quest view a JOIN rather than a
301
+ * second projection (spec §4.5).
302
+ */
303
+ beatId?: string | null;
304
+ /**
305
+ * The `PlotBeat` id this frame's beat carries IN THE GRAPH (§Q SB.92 /
306
+ * DM.105) — the id a cutscene for this frame posts as `beatId`, with the
307
+ * detail read's {@link StoryboardDetailResponse.graphStoryId} as `storyId`.
308
+ *
309
+ * ⛔ NOT {@link StoryboardFrame.beatId}: that id is hashed in the BOARD's
310
+ * scope (the video), which on a fork-approved arc is not where the arc's
311
+ * nodes live — every cutscene posted with it 404'd "PlotBeat not found"
312
+ * (measured 2026-10-19, 0 of 42 frames on three stories). Served only by a
313
+ * detail read whose {@link StoryboardDetailResponse.graphResolution} is
314
+ * `resolved`; `null`/absent otherwise.
315
+ */
316
+ graphBeatId?: string | null;
317
+ anchorSceneId?: string | null;
318
+ /** Scene grouping — a change implies a cut. */
319
+ sequenceId?: string | null;
320
+ shotTransition: ShotTransition;
321
+ durationSeconds: FrameDurationSeconds;
322
+ prompt: FramePrompt;
323
+ /**
324
+ * The parametric camera leg — the SAME shape as client-core's
325
+ * {@link CameraPose} (`storyboardMask.ts`), reused rather than redefined.
326
+ * Authoring intent only: no live target consumes a 6-DoF pose today, it
327
+ * compiles to {@link FramePrompt.cameraProse}.
328
+ */
329
+ cameraPose?: CameraPose | null;
330
+ characterRefs: StoryboardFrameRef[];
331
+ settingRefs: StoryboardFrameRef[];
332
+ /**
333
+ * The cast names this frame ASKED for, in roster order (§Q SB.41).
334
+ *
335
+ * With {@link StoryboardFrame.characterRefs} and
336
+ * {@link StoryboardFrame.unresolvedCast} it makes cast coverage answerable —
337
+ * "3 of 4 cast resolved, and here is the one that is missing".
338
+ */
339
+ requestedCast?: string[];
340
+ /**
341
+ * Requested cast members that resolved to NO reference image (§Q SB.41).
342
+ *
343
+ * A missing FIRST-BILLED character used to be invisible: on the `star-wars`
344
+ * board every beat named "Jedi Orin", every frame shipped without him, and
345
+ * the board reported success. Surface this — a frame that silently omits the
346
+ * character its beat is about is the defect, not the reporting.
347
+ *
348
+ * Absent on frames written before SB.41; treat that as UNKNOWN coverage
349
+ * rather than "nothing was missing".
350
+ */
351
+ unresolvedCast?: string[];
352
+ variants: StoryboardFrameVariant[];
353
+ selectedVariantId?: string | null;
354
+ extensions: FrameExtensions;
355
+ seed?: number | null;
356
+ audioEnabled: boolean;
357
+ /** Persisted HappyOyster `encrypted_world_id` once a world exists (SB-W.*). */
358
+ worldId?: string | null;
359
+ /**
360
+ * The mode-fixed HappyOyster model that OWNS {@link StoryboardFrame.worldId}
361
+ * (§Q DM.30). Required to reopen the world — `attachWorld` rejects the other
362
+ * mode's worlds with `MODE_MISMATCH`, so a bare id is not a usable handle.
363
+ *
364
+ * `null`/absent on frames bound before DM.30, and a reader must treat that as
365
+ * UNKNOWN rather than assume its own mode: assuming is exactly how the
366
+ * pre-flight in `launchHappyOysterWorld` was made unreachable.
367
+ */
368
+ worldMode?: HappyOysterMode | null;
369
+ /**
370
+ * §Q MOMENT.8 — permanent worlds this frame USED to open into, oldest first.
371
+ *
372
+ * A HappyOyster world cannot be reseeded and cannot be deleted, so
373
+ * "regenerate this world" means REPLACEMENT: the new id becomes
374
+ * {@link StoryboardFrame.worldId} and the old one moves here. Every id in the
375
+ * list is still billed and still reachable via `attachWorld` — the ledger is
376
+ * what keeps it so, which is why nothing drops one.
377
+ *
378
+ * Absent on frames written before MOMENT.8; treat that as "never superseded".
379
+ */
380
+ supersededWorldIds?: string[];
381
+ createdAt: string;
382
+ updatedAt?: string | null;
383
+ editedAt?: string | null;
384
+ editedBy?: string | null;
385
+ /**
386
+ * SERVER-DERIVED from {@link StoryboardFrame.variants} — never stored and
387
+ * never sent by a client. {@link deriveFrameStatus} is the same rule for
388
+ * optimistic rendering between a write and its refetch.
389
+ */
390
+ readonly status: StoryboardFrameStatus;
391
+ /**
392
+ * Store-owned optimistic-lock value. Echo it back on
393
+ * {@link StoryboardsApi.patchStoryboardFrame} /
394
+ * {@link StoryboardsApi.selectStoryboardFrameVariant}; never mint it.
395
+ */
396
+ txnVer?: number | null;
397
+ }
398
+ /**
399
+ * One board — the `META` item (mirrors backend `Storyboard`). List reads
400
+ * return exactly this (no frames); {@link Storyboard.frameIds} is the ordering
401
+ * source of truth AND the frame count.
402
+ */
403
+ export interface Storyboard {
404
+ storyboardId: string;
405
+ /** Owning story — `storyId` IS `videoId`. */
406
+ videoId: string;
407
+ /** Source arc proposal. */
408
+ proposalId?: string | null;
409
+ /** Source arc variant. */
410
+ variantId?: string | null;
411
+ status: StoryboardStatus;
412
+ styleProfile: StyleProfile;
413
+ /** ORDERING SOURCE OF TRUTH — a reorder is a list patch here (≤24). */
414
+ frameIds: string[];
415
+ modelId?: string | null;
416
+ /**
417
+ * EVERY composition model the board generates against, in the order the
418
+ * creator asked for (§Q SB.54). `modelId` is the PRIMARY — `modelIds[0]`.
419
+ *
420
+ * Absent or empty on every board created before SB.54, which is exactly the
421
+ * single-model case: read it as `modelIds?.length ? modelIds : [modelId]`.
422
+ */
423
+ modelIds?: string[] | null;
424
+ fallbackModelId?: string | null;
425
+ costUsd: number;
426
+ error?: string | null;
427
+ createdAt: string;
428
+ updatedAt?: string | null;
429
+ completedAt?: string | null;
430
+ createdBy?: string | null;
431
+ tenantId?: string | null;
432
+ historyScopeId?: string | null;
433
+ /** Store-owned optimistic-lock value. */
434
+ txnVer?: number | null;
435
+ }
436
+ /**
437
+ * The ONE place the ordering SSOT is applied: resolve
438
+ * {@link Storyboard.frameIds} against a detail read's frames, in board order.
439
+ *
440
+ * Ids with no loaded frame are skipped, and frames the board no longer lists
441
+ * are dropped — so a mid-reorder read renders a coherent (possibly short)
442
+ * board instead of a duplicated or mis-ordered one. Every SB-U board surface
443
+ * calls this rather than sorting frames itself.
444
+ */
445
+ export declare function orderStoryboardFrames(frameIds: readonly string[], frames: readonly StoryboardFrame[]): StoryboardFrame[];
446
+ /**
447
+ * Mirror of the backend's derived `StoryboardFrame.status` — in-flight wins
448
+ * (a regenerate on a succeeded frame reads `running`, so the board shows work
449
+ * happening), then any success, then all-failed, then empty ⇒ `pending`.
450
+ *
451
+ * The server value on {@link StoryboardFrame.status} is authoritative; this is
452
+ * for the optimistic window between appending a pending variant locally and
453
+ * the next poll.
454
+ */
455
+ export declare function deriveFrameStatus(variants: readonly StoryboardFrameVariant[]): StoryboardFrameStatus;
456
+ /**
457
+ * The variant {@link StoryboardFrame.selectedVariantId} names, if it is still
458
+ * held in the capped history (mirrors the backend's `selected_variant()`).
459
+ */
460
+ export declare function selectedFrameVariant(frame: StoryboardFrame): StoryboardFrameVariant | undefined;
461
+ /**
462
+ * Does this variant actually carry IMAGE BYTES a surface could render?
463
+ *
464
+ * ⛔ **"Has bytes" is `imageKey` OR `imageUrl`, and the `imageKey` half is the
465
+ * load-bearing one** — that is the durable field, and the one the
466
+ * select-variant route tests. `imageUrl` is only the detail read's presigned
467
+ * VIEW of it, so keying on the URL alone would call a genuinely rendered
468
+ * variant empty the moment presigning fails or the frame arrives from a read
469
+ * that does not presign.
470
+ *
471
+ * THE single definition, because two rules in this file disagreed about it and
472
+ * the disagreement was the §Q SB.71 defect (see {@link displayFrameVariant}).
473
+ */
474
+ export declare function variantHasBytes(variant: StoryboardFrameVariant): boolean;
475
+ /**
476
+ * The variant a surface should SHOW for a frame (§Q SB-U.4): the explicitly
477
+ * selected one when it is present, succeeded AND carries bytes, otherwise the
478
+ * newest such variant, otherwise nothing.
479
+ *
480
+ * Distinct from {@link selectedFrameVariant}, which answers only "what does
481
+ * `selectedVariantId` point at" and is deliberately undefined before a
482
+ * selection exists. A freshly generated frame has no `selectedVariantId` yet,
483
+ * so a board keyed on that alone would render a rendered frame as blank; and a
484
+ * selection pointing at a `pending`/`failed` variant must not blank out the
485
+ * image the creator can already see. Variants are appended in generation
486
+ * order, so "newest succeeded" is the last succeeded entry.
487
+ *
488
+ * **§Q SB.71 — the bytes clause is new, and its absence BLANKED THE BOARD.**
489
+ * The rule was succeeded-only, so a variant marked `succeeded` while carrying
490
+ * no `imageKey` was honoured as the display variant: {@link frameImageUrl} then
491
+ * returned `null` and every surface rendered NOTHING while the frame claimed an
492
+ * image. Silent by construction — the frame looks healthy, and the older
493
+ * variant that DOES have bytes is sitting right there in the same history,
494
+ * never reached because the walk stopped at the keyless one.
495
+ *
496
+ * Two things make this the right shape rather than a patch. The server mirror
497
+ * (`shared/storyboard_store._display_variant`) has ALWAYS required an
498
+ * `image_key` and says so; the client was the half that drifted, on a docstring
499
+ * claiming the client "needs no such clause" because it reads `imageUrl`. And
500
+ * {@link buildFrameVariantStrip} in this same file already refused to promote a
501
+ * keyless variant (`no-image`) — so one file held both rules and they
502
+ * contradicted each other. They now share {@link variantHasBytes}.
503
+ */
504
+ export declare function displayFrameVariant(frame: StoryboardFrame): StoryboardFrameVariant | undefined;
505
+ /**
506
+ * The presigned image URL a surface should render for a frame, or `null`.
507
+ *
508
+ * One line over {@link displayFrameVariant}, but kept here so every surface that
509
+ * only wants the URL (the timeline clip, the large preview, a future thumbnail)
510
+ * reads it from one place rather than repeating the `?.imageUrl ?? null` tail.
511
+ * `imageUrl` rides the DETAIL read only, so a list-shaped frame yields `null`.
512
+ */
513
+ export declare function frameImageUrl(frame: StoryboardFrame): string | null;
514
+ /**
515
+ * §Q `SB.34` — the variant a surface should read a frame's PROMPT from, which is
516
+ * deliberately NOT {@link displayFrameVariant}.
517
+ *
518
+ * `displayFrameVariant` is succeeded-only and must stay that way: it answers
519
+ * "which IMAGE do I show", and its rule defends a real invariant — a selection
520
+ * pointing at a `pending`/`failed` variant must not blank out the image the
521
+ * creator can already see. Reading the prompt through it, though, made a FAILED
522
+ * frame indistinguishable from a frame that does not exist: the DM world-entry
523
+ * path got `undefined` and reported "no world for this beat" on a beat that was
524
+ * fully storyboarded and merely refused by the image model.
525
+ *
526
+ * The prompt is a different kind of fact from the image. It is COMPOSED BEFORE
527
+ * the image call and is not itself what failed, and §Q `SB.38` (#1575) made the
528
+ * backend persist it on all four failure arms — so a failed variant carries the
529
+ * text of the beat it meant to draw. This accessor is what lets that text be
530
+ * read without touching the image rule.
531
+ *
532
+ * Order: the displayed (succeeded) variant when it carries prompt text — a
533
+ * rendered frame's own provenance always wins — then the newest variant of ANY
534
+ * status that carries some. Variants are appended in generation order, so
535
+ * "newest" is the last entry. `undefined` when no variant carries prompt text at
536
+ * all (including boards generated before `SB.38`, whose failed variants were
537
+ * written with an empty string).
538
+ */
539
+ export declare function promptFrameVariant(frame: StoryboardFrame): StoryboardFrameVariant | undefined;
540
+ /**
541
+ * §Q `SB.34` — why a frame's render FAILED, or `null` when it did not fail.
542
+ *
543
+ * A frame with no image can be in two completely different situations: still
544
+ * generating, or refused/errored and never coming back on its own. Both used to
545
+ * read as "not rendered yet", which told the owner to wait for something that
546
+ * was never going to happen. This is the ONE place that tells them apart, so no
547
+ * surface re-derives the distinction from raw variant statuses.
548
+ *
549
+ * Derived from the variants via {@link deriveFrameStatus} rather than the
550
+ * server's {@link StoryboardFrame.status} so it stays correct in the optimistic
551
+ * window between a regenerate and its refetch — the same reason
552
+ * `deriveFrameStatus` exists.
553
+ *
554
+ * Returns the newest failed variant's `error` — for a content-policy refusal
555
+ * that is `SB.36`'s classified message, which is the actionable half. Falls back
556
+ * to `null` text only if the backend recorded none; callers pair this with their
557
+ * own copy, so an empty reason still reads as "failed", never as "pending".
558
+ */
559
+ export declare function frameRenderFailure(frame: StoryboardFrame): string | null;
560
+ /**
561
+ * Whether a frame's render failed at all — {@link frameRenderFailure} answers
562
+ * "why", this answers "did it", and a failure the backend recorded no message
563
+ * for is still a failure. Kept beside it so the two can never disagree.
564
+ */
565
+ export declare function frameRenderFailed(frame: StoryboardFrame): boolean;
566
+ /** Why a variant cannot be promoted to be the frame's image ({@link FrameVariantChip}). */
567
+ export type VariantPromoteBlock = 'pending' | 'failed' | 'no-image' | 'already-current';
568
+ /**
569
+ * One attempt as the compare strip renders it (§Q SB-U.6) — every fact the chip
570
+ * shows and every decision the chip makes, decided HERE so `web/` and
571
+ * `../Web-App` cannot disagree about which attempt is current or which one may
572
+ * be promoted.
573
+ */
574
+ export interface FrameVariantChip {
575
+ variantId: string;
576
+ status: FrameVariantStatus;
577
+ origin: FrameVariantOrigin;
578
+ /** Which model produced this attempt — the compare axis of §Q SB.53. */
579
+ modelId: string | null;
580
+ seed: number | null;
581
+ imageUrl: string | null;
582
+ createdAt: string;
583
+ /** This attempt's failure message, when it failed. */
584
+ error: string | null;
585
+ /** {@link StoryboardFrame.selectedVariantId} points HERE. */
586
+ selected: boolean;
587
+ /** This is the attempt {@link displayFrameVariant} actually renders. */
588
+ displayed: boolean;
589
+ /** A version-guarded select-variant on this id would be accepted. */
590
+ promotable: boolean;
591
+ /** Why not, when {@link FrameVariantChip.promotable} is false. */
592
+ promoteBlock: VariantPromoteBlock | null;
593
+ }
594
+ /** The compare strip for one frame ({@link buildFrameVariantStrip}). */
595
+ export interface FrameVariantStrip {
596
+ chips: FrameVariantChip[];
597
+ /**
598
+ * TRUE when {@link StoryboardFrame.selectedVariantId} names something that is
599
+ * NOT A RENDERABLE ATTEMPT — so what the frame CLAIMS is its image and what
600
+ * the board actually shows cannot agree.
601
+ *
602
+ * Two reachable states, both of which the server permits on a frame the WORKER
603
+ * wrote, and they do DIFFERENT harm:
604
+ *
605
+ * - **the selection was EVICTED from the capped history** — nothing addresses
606
+ * it any more (select-variant 404s), and the board silently renders a
607
+ * DIFFERENT attempt than the one the creator chose;
608
+ * - **the selection is `succeeded` with NO rendered bytes** — the codex P2
609
+ * §Q SB.56 closed on the WRITE path only. {@link displayFrameVariant}
610
+ * honours it (it is succeeded), so the board renders NOTHING AT ALL while
611
+ * the frame still claims a selection, and the export 422s on the same
612
+ * frame. That is the state this flag exists to stop being invisible.
613
+ */
614
+ selectionAdrift: boolean;
615
+ /** How many attempts the history still has room for before it evicts. */
616
+ remainingSlots: number;
617
+ /**
618
+ * TRUE when the next attempt will EVICT the oldest one. Surfaced honestly per
619
+ * the row rather than discovered when a chip disappears: `append_variant`
620
+ * drops the oldest non-selected entry at
621
+ * {@link FRAME_VARIANT_HISTORY_CAP}, and an evicted variant can never be
622
+ * promoted again (select-variant 404s on it).
623
+ */
624
+ evictionImminent: boolean;
625
+ }
626
+ /**
627
+ * §Q SB-U.6 — the variant compare strip for one frame, as pure data.
628
+ *
629
+ * Chips are in GENERATION ORDER (oldest first), which is the order
630
+ * `append_variant` writes them and therefore the order eviction removes them —
631
+ * so left-to-right is also "closest to being evicted" first.
632
+ *
633
+ * `promotable` encodes the SERVER's rule rather than a looser client guess: the
634
+ * select-variant route accepts a variant only when it is `succeeded` AND carries
635
+ * rendered bytes, and 422s otherwise — so those chips are disabled with a reason
636
+ * instead of offering a click that fails.
637
+ *
638
+ * ⚠ **`already-current` is the one block that is NOT a server rejection.**
639
+ * Re-selecting the variant a frame already holds is accepted (200, idempotent);
640
+ * the chip hides the control because the click would be a no-op, not because it
641
+ * would fail. Do not read the four blocks as "the server would 422".
642
+ *
643
+ * ⛔ **"Has bytes" is {@link variantHasBytes}** — `imageKey` OR `imageUrl`, with
644
+ * the `imageKey` half load-bearing. §Q SB.71: this rule and
645
+ * {@link displayFrameVariant} used to disagree inside this one file, which is
646
+ * how a keyless variant could be refused promotion here and still be chosen as
647
+ * the thing to render.
648
+ */
649
+ export declare function buildFrameVariantStrip(frame: StoryboardFrame): FrameVariantStrip;
650
+ /** Which projection a detail read returns (spec §4.5 `?view=`). */
651
+ export type StoryboardView = 'arc' | 'quests';
652
+ /** Runtime enumeration of {@link StoryboardView} for view pickers. */
653
+ export declare const STORYBOARD_VIEWS: readonly StoryboardView[];
654
+ /**
655
+ * The quest-view join, COMPUTED per request and never stored (spec §4.5):
656
+ * quest definitions indexed by `sourceBeatId`, joined on
657
+ * {@link StoryboardFrame.beatId}. The client RENDERS {@link GateExpr}; it never
658
+ * evaluates one.
659
+ */
660
+ export interface StoryboardFrameQuestAnnotation {
661
+ frameId: string;
662
+ questId: string;
663
+ /** Serialized `GATED_BY` expression, or null for an ungated quest. */
664
+ gate?: GateExpr | null;
665
+ prereqQuestIds: string[];
666
+ }
667
+ /** `GET …/storyboards` — board summaries (META items only, no frames). */
668
+ export interface ListStoryboardsResponse {
669
+ traceId: string;
670
+ storyboards: Storyboard[];
671
+ }
672
+ /**
673
+ * `GET …/storyboards/{id}?view=arc|quests` — board + its frames, with
674
+ * presigned URLs on each variant. `questAnnotations` is populated only for
675
+ * `view=quests`.
676
+ */
677
+ export interface StoryboardDetailResponse {
678
+ traceId: string;
679
+ storyboard: Storyboard;
680
+ frames: StoryboardFrame[];
681
+ questAnnotations?: StoryboardFrameQuestAnnotation[] | null;
682
+ /**
683
+ * §Q DM.105 — the story scope the board's PlotBeats live in (the fork story
684
+ * on a fork-approved arc, the video otherwise). A cutscene for a frame posts
685
+ * this as `storyId`. `null` when the arc is not approved.
686
+ */
687
+ graphStoryId?: string | null;
688
+ /** §Q DM.105 — whether the frames' graph beat ids were checked. Absent on
689
+ * reads from before DM.105: read that as not resolved. */
690
+ graphResolution?: BoardGraphResolution;
691
+ /** §Q DM.105 — frames of a `resolved` board whose beat is no PlotBeat in the
692
+ * graph; a cutscene cannot be grounded on them. */
693
+ unresolvedGraphFrameIds?: string[];
694
+ }
695
+ /**
696
+ * §Q DM.105 — whether a board's frames resolved to graph `PlotBeat` ids
697
+ * (mirrors backend `services/storyboard/beat_scope.py::BoardGraphResolution`).
698
+ * Compare against these, never a raw literal.
699
+ */
700
+ export declare const BOARD_GRAPH_RESOLUTION: {
701
+ /** Every frame was checked; the unresolved ones are named. */
702
+ readonly RESOLVED: "resolved";
703
+ /** The board's arc variant is not the approved one — no PlotBeat of it exists. */
704
+ readonly ARC_NOT_APPROVED: "arc_not_approved";
705
+ /** The graph holds no node of the arc yet, could not be read, or the board is still generating. */
706
+ readonly UNVERIFIED: "unverified";
707
+ /** §Q SB.93 — the board's source arc is gone (deleted, another video's, or
708
+ * re-generated without the board's variant). PERMANENT: no later read resolves it. */
709
+ readonly ARC_GONE: "arc_gone";
710
+ };
711
+ /**
712
+ * {@link BOARD_GRAPH_RESOLUTION}'s values, OPEN for forward compatibility: the
713
+ * backend may add one (e.g. an arc that is gone), and a reader must treat any
714
+ * value it does not know as NOT resolved rather than fail.
715
+ */
716
+ export type BoardGraphResolution = (typeof BOARD_GRAPH_RESOLUTION)[keyof typeof BOARD_GRAPH_RESOLUTION] | (string & {});
717
+ /** Why a frame cannot ground a cutscene (§Q UX.38). */
718
+ export declare const FRAME_CUTSCENE_BLOCK: {
719
+ /** The board's arc is not approved, so none of its beats is in the graph. */
720
+ readonly ARC_NOT_APPROVED: "arc_not_approved";
721
+ /** The graph has not (yet) confirmed this board's beats — or answered a resolution this client does not know. */
722
+ readonly GRAPH_UNVERIFIED: "graph_unverified";
723
+ /** This frame's beat is no PlotBeat in the graph. */
724
+ readonly FRAME_UNRESOLVED: "frame_unresolved";
725
+ /** The board's source arc is gone — permanent, unlike {@link FRAME_CUTSCENE_BLOCK.GRAPH_UNVERIFIED}. */
726
+ readonly ARC_GONE: "arc_gone";
727
+ };
728
+ export type FrameCutsceneBlock = (typeof FRAME_CUTSCENE_BLOCK)[keyof typeof FRAME_CUTSCENE_BLOCK];
729
+ /** What a cutscene for one frame posts, or why it cannot (§Q UX.38). */
730
+ export type FrameCutsceneTarget = {
731
+ status: 'ready';
732
+ storyId: string;
733
+ beatId: string;
734
+ } | {
735
+ status: 'blocked';
736
+ reason: FrameCutsceneBlock;
737
+ };
738
+ /**
739
+ * §Q UX.38 — the `{storyId, beatId}` a "cutscene from this frame" posts to
740
+ * `POST /api/v1/videos/generate`, from the board detail read's DM.105 overlay.
741
+ *
742
+ * The ONE place the rule lives: the GRAPH ids (`graphStoryId` +
743
+ * `graphBeatId`), never the frame's board-scoped `beatId` (the measured 404
744
+ * class); and only on a `resolved` board for a frame it did not name as
745
+ * unresolved. Every other state is `blocked` with its reason — including a
746
+ * resolution value this client does not know.
747
+ */
748
+ export declare function storyboardFrameCutsceneTarget(detail: Pick<StoryboardDetailResponse, 'graphStoryId' | 'graphResolution' | 'unresolvedGraphFrameIds'>, frame: Pick<StoryboardFrame, 'frameId' | 'graphBeatId'>): FrameCutsceneTarget;
749
+ /**
750
+ * `POST …/storyboards` body. `styleProfile` is a PARTIAL — every field the
751
+ * backend `StyleProfile` declares has a default, so omitted fields take the
752
+ * pinned master geometry.
753
+ */
754
+ export interface CreateStoryboardRequest {
755
+ proposalId: string;
756
+ variantId: string;
757
+ styleProfile?: Partial<StyleProfile>;
758
+ modelId?: string;
759
+ /**
760
+ * Generate one variant per model per frame, in this order (§Q SB.54) — the
761
+ * general form of which `modelId` is the singleton case.
762
+ *
763
+ * Send ONE of the two, never both: naming both is a 422 rather than a
764
+ * precedence rule, because silently preferring one would let a creator pay
765
+ * for a board generated against a model they did not pick. Every id must
766
+ * declare `multi_reference` and there is a hard cap of TWO (a wall-clock
767
+ * bound — a maxed 24-frame board already runs 10–15 min at two arms).
768
+ */
769
+ modelIds?: string[];
770
+ }
771
+ /**
772
+ * `POST …/storyboards/{storyboardId}/frames/{frameId}/retry` body — OPTIONAL
773
+ * (§Q SB.55). The route has accepted a body-less POST since §Q SB.35 and still
774
+ * does; this exists to carry ONE thing.
775
+ */
776
+ export interface RetryStoryboardFrameRequest {
777
+ /**
778
+ * Re-compose this attempt with a DIFFERENT model than the board's. Omitted ⇒
779
+ * the board's primary model.
780
+ *
781
+ * This is the one untried lever for a content-blocked frame: every Gemini
782
+ * tier shares a single safety stack (§Q SB.32 measured `gemini-3-pro-image`
783
+ * returning the identical block at twice the price), so a genuine second
784
+ * opinion needs a second VENDOR. Capability-gated exactly as create is — an
785
+ * incapable id is a 422 before anything is billed.
786
+ */
787
+ modelId?: string;
788
+ }
789
+ /** 202 envelope from `POST …/storyboards` — poll the detail read until
790
+ * {@link isStoryboardTerminal}. */
791
+ export interface CreateStoryboardResponse {
792
+ traceId: string;
793
+ storyboard: Storyboard;
794
+ }
795
+ /**
796
+ * `PATCH …/frames/{frameId}` body — every field optional, absent = unchanged.
797
+ * `prompt`/`extensions` merge per-field. `cameraPose: null` clears the pose.
798
+ * There is no `status` and no `order` here by design.
799
+ */
800
+ export interface PatchStoryboardFrameRequest {
801
+ prompt?: Partial<FramePrompt>;
802
+ durationSeconds?: FrameDurationSeconds;
803
+ shotTransition?: ShotTransition;
804
+ sequenceId?: string | null;
805
+ cameraPose?: CameraPose | null;
806
+ characterRefs?: StoryboardFrameRef[];
807
+ settingRefs?: StoryboardFrameRef[];
808
+ extensions?: Partial<FrameExtensions>;
809
+ seed?: number | null;
810
+ audioEnabled?: boolean;
811
+ /** Version guard — the {@link StoryboardFrame.txnVer} the edit was based on. */
812
+ txnVer?: number;
813
+ }
814
+ /**
815
+ * `POST …/frames/{frameId}/region-edit` body. A mask routes to a
816
+ * `mask_inpaint`-capable adapter; no mask routes to `semantic_edit`.
817
+ */
818
+ export interface RegionEditFrameRequest {
819
+ instruction: string;
820
+ /**
821
+ * Base64 PNG mask, white = edit / black = keep — exactly what client-core's
822
+ * `renderMaskToCanvas` (`storyboardMask.ts`, SB-U.2) produces.
823
+ */
824
+ maskImageBase64?: string;
825
+ /** Prefer an identity-preserving adapter for this edit. */
826
+ keepIdentity?: boolean;
827
+ }
828
+ /**
829
+ * `PUT …/frames/{frameId}/world` body — bind the HappyOyster world this frame
830
+ * opens into (§Q DM.1; owner ruling Q2: ONE permanent world per frame).
831
+ *
832
+ * NOT version-guarded, deliberately. A HappyOyster world is paid, permanent and
833
+ * unlistable, and `worldId` is the only handle that can ever reach it again —
834
+ * so the persist must not be able to fail because an unrelated regenerate moved
835
+ * the frame's `txnVer` since it was read. The server write is a first-writer-
836
+ * wins claim instead: re-sending the SAME id succeeds (retry the persist freely
837
+ * after a dropped response), a DIFFERENT id **409s** and the error carries the
838
+ * id the frame already owns so the caller reopens that world rather than
839
+ * stranding it.
840
+ *
841
+ * §Q DM.30 — the MODE is part of this contract, and this doc used to say the
842
+ * opposite ("the client knows the mode it launched with; `attachWorld`
843
+ * pre-flights a mismatch on reopen"). A reopen rebuilds the handle from the
844
+ * STORED frame, so that pre-flight was comparing the session's mode with itself
845
+ * and could never fire; a World-Explorer (`directing`) world reattached from the
846
+ * adventure-mode DM reached the vendor and returned `[MODE_MISMATCH]` — after
847
+ * the world was paid for.
848
+ *
849
+ * `worldMode` is optional only so a bind that follows a PAID `createWorld` can
850
+ * never be rejected outright (losing a billed, unlistable world is worse than
851
+ * recording an under-described one). Always send it.
852
+ */
853
+ export interface SetFrameWorldRequest {
854
+ /** The `encryptedWorldId` returned by `createWorld`. */
855
+ worldId: string;
856
+ /** The mode-fixed model that owns the world — required to reopen it. */
857
+ worldMode?: HappyOysterMode;
858
+ /**
859
+ * §Q `WORLD.11` — the {@link PreparedWorldBeatEntry.leaseToken} this beat's
860
+ * `pending` entry came back with. It is what CONSUMES the reservation: the
861
+ * ledger append and the lease delete ride one transaction fenced on this exact
862
+ * token, so a mint against a lapsed authorisation can no longer consume a
863
+ * NEWER caller's lease for the same frame — which left that caller holding a
864
+ * phantom authorisation while the one-beat race re-opened underneath it.
865
+ *
866
+ * Omit it for a bind with no prepared authorisation (the DM's own world entry,
867
+ * a legacy client): the world is still recorded and still counted against the
868
+ * cap, and no lease is touched.
869
+ */
870
+ leaseToken?: string;
871
+ /**
872
+ * §Q MOMENT.8 — REQUIRED with `?supersede=true`, rejected without it (422
873
+ * either way). The world id you READ off the frame: the replacement write is
874
+ * fenced on it, so a frame that has meanwhile moved to some other world 409s
875
+ * instead of being overwritten. The superseded id lands in
876
+ * {@link StoryboardFrame.supersededWorldIds} and stays reachable.
877
+ */
878
+ supersedesWorldId?: string;
879
+ }
880
+ /** One beat's outcome from `POST …/worlds/prepare` (§Q MOMENT.6a). */
881
+ export type PreparedWorldDisposition =
882
+ /** The beat's anchor frame already owns a world — skipped, nothing to pay. */
883
+ 'bound'
884
+ /** AUTHORISED to mint. Mint it, then bind it with `setStoryboardFrameWorld`. */
885
+ | 'pending'
886
+ /** Refused — the story is at its permanent-world cap. */
887
+ | 'capped'
888
+ /** Unseedable: the anchor frame has no rendered image. */
889
+ | 'blocked'
890
+ /**
891
+ * §Q MOMENT.13 — a DIFFERENT authorisation for this beat is outstanding and
892
+ * has not been minted or lapsed yet. NOT `capped`: the story has slots free,
893
+ * and two live authorisations for one anchor frame would mean two permanent
894
+ * worlds billed and one of them refused by the bind. Mint the outstanding
895
+ * one, or re-run after `leaseExpiresAt`.
896
+ */
897
+ | 'held';
898
+ export interface PreparedWorldBeatEntry {
899
+ beatId: string;
900
+ frameId: string;
901
+ disposition: PreparedWorldDisposition;
902
+ /** The world the frame already owns (`bound`), or — under `supersede` — the
903
+ * one this beat's new mint replaces, to echo back as `supersedesWorldId`. */
904
+ worldId?: string | null;
905
+ worldMode?: HappyOysterMode | null;
906
+ /** Why, for the `capped`/`blocked`/`held` arms. */
907
+ reason?: string | null;
908
+ /**
909
+ * §Q MOMENT.13 — the authorisation LEASE this mint is covered by, on
910
+ * `pending` only. A permanent-world slot is RESERVED against the story the
911
+ * moment it is issued, and binding the world consumes it.
912
+ */
913
+ leaseToken?: string | null;
914
+ /**
915
+ * Unix epoch seconds the lease lapses at. On `pending` it is the deadline for
916
+ * minting; on `held` it is when the beat frees up.
917
+ */
918
+ leaseExpiresAt?: number | null;
919
+ }
920
+ /**
921
+ * One permanent world a story has paid for (§Q WORLD.9).
922
+ *
923
+ * HappyOyster worlds are billed once, exist forever, and **cannot be listed
924
+ * vendor-side** — the id is the only path back to one. Recording it on the
925
+ * frame alone meant deleting the frame or the board destroyed the sole copy, so
926
+ * these rows live in a story-level ledger no board delete touches.
927
+ * `storyboardId`/`frameId` are PROVENANCE and may name rows that no longer
928
+ * exist; that is the point of the ledger, not a stale reference.
929
+ */
930
+ export interface StoryWorldHandle {
931
+ worldId: string;
932
+ worldMode?: HappyOysterMode | null;
933
+ storyboardId?: string | null;
934
+ frameId?: string | null;
935
+ recordedAt?: string | null;
936
+ }
937
+ /**
938
+ * `POST …/storyboards/{storyboardId}/worlds/prepare` (§Q MOMENT.6a).
939
+ *
940
+ * ⚠ **The route AUTHORISES spend; it does not spend.** There is no server-side
941
+ * `createWorld` — the browser mints. So `pendingCount` is the number of
942
+ * PERMANENT, BILLED, undeletable worlds this caller is being cleared to create,
943
+ * and it is the number to show a human before anything happens.
944
+ */
945
+ export interface PrepareStoryboardWorldsResponse {
946
+ traceId: string;
947
+ beats: PreparedWorldBeatEntry[];
948
+ /** The per-STORY ceiling in force. */
949
+ cap: number;
950
+ /**
951
+ * Distinct permanent worlds the story already owns, superseded ones included.
952
+ * Read from the DURABLE story ledger (§Q MOMENT.14), so deleting a board no
953
+ * longer makes the worlds it paid for vanish from the accounting.
954
+ */
955
+ storyWorldCount: number;
956
+ /** Mints AUTHORISED by this call. THE SPEND NUMBER. */
957
+ pendingCount: number;
958
+ skippedCount: number;
959
+ cappedCount: number;
960
+ blockedCount: number;
961
+ /** §Q MOMENT.13 — beats another live authorisation already covers. */
962
+ heldCount?: number;
963
+ /**
964
+ * Slots reserved by authorisations nobody has minted yet. Without it, a
965
+ * refusal on a story owning 8 of 10 reads as a bug rather than as two
966
+ * authorisations still outstanding.
967
+ */
968
+ outstandingAuthorizations?: number;
969
+ /**
970
+ * §Q WORLD.9 — every permanent world this story has paid for. HappyOyster
971
+ * exposes no listing, so this is the only enumeration that exists anywhere.
972
+ */
973
+ permanentWorlds?: StoryWorldHandle[];
974
+ /**
975
+ * §Q `WORLD.14a` — permanent worlds this story PAID for that no surviving shot
976
+ * of any of its boards opens. Always a subset of {@link permanentWorlds}, and
977
+ * they still count against {@link cap}: the vendor has no delete, so nothing
978
+ * reclaims them and surfacing them IS the remedy. A non-empty list is the
979
+ * reading behind "my cap is consumed and I cannot see by what".
980
+ */
981
+ unopenedWorldIds?: string[];
982
+ supersede: boolean;
983
+ /** The mode every authorised mint must be created in — always `adventure`. */
984
+ worldMode: HappyOysterMode;
985
+ /**
986
+ * §Q WORLD.29 — `true` on the spend PREVIEW (`GET`): nothing was reserved,
987
+ * `pending` entries carry no `leaseToken`, and `pendingCount` is what a
988
+ * confirm WOULD authorise. `false`/absent on the leasing confirm (`POST`).
989
+ */
990
+ preview?: boolean;
991
+ /**
992
+ * §Q WORLD.29 — `true` only on a PREVIEW of a story whose pre-ledger worlds
993
+ * span more boards than one migration window: `storyWorldCount` (and
994
+ * `permanentWorlds`) is then a LOWER BOUND, and the confirm refuses until its
995
+ * migration has walked the rest. Always `false` on the leasing confirm.
996
+ */
997
+ storyWorldCountIsFloor?: boolean;
998
+ }
999
+ /** One authorisation a client is handing back (§Q WORLD.44). */
1000
+ export interface WorldLeaseHandle {
1001
+ frameId: string;
1002
+ /** The `leaseToken` the confirm returned on this frame's `pending` entry.
1003
+ * The release is fenced on it: a lease re-issued to another caller is never
1004
+ * released by this one. */
1005
+ leaseToken: string;
1006
+ }
1007
+ /** `POST …/storyboards/{storyboardId}/worlds/release` body (§Q WORLD.44). */
1008
+ export interface ReleaseStoryboardWorldsRequest {
1009
+ leases: WorldLeaseHandle[];
1010
+ }
1011
+ /**
1012
+ * What the release door actually released (§Q WORLD.44). `notReleased` is not
1013
+ * an error: the lease was already consumed by a bind, already lapsed and swept,
1014
+ * or carries another token.
1015
+ */
1016
+ export interface ReleaseStoryboardWorldsResponse {
1017
+ traceId: string;
1018
+ released: string[];
1019
+ notReleased: string[];
1020
+ }
1021
+ /**
1022
+ * The leases a CONFIRM issued — every `pending` entry carrying a `leaseToken`
1023
+ * (§Q WORLD.44). What a client hands back through
1024
+ * {@link StoryboardsApi.releaseStoryboardWorlds} when it will not spend them. A
1025
+ * preview's entries carry no token, so this is empty for a preview.
1026
+ */
1027
+ export declare function worldLeasesOf(beats: readonly Pick<PreparedWorldBeatEntry, 'frameId' | 'disposition' | 'leaseToken'>[]): WorldLeaseHandle[];
1028
+ /** `POST …/frames/{frameId}/select-variant` body — version-guarded. */
1029
+ export interface SelectFrameVariantRequest {
1030
+ variantId: string;
1031
+ /** Version guard — the {@link StoryboardFrame.txnVer} the choice was based on. */
1032
+ txnVer?: number;
1033
+ }
1034
+ /** Every frame-scoped write returns the refreshed frame. */
1035
+ export interface StoryboardFrameResponse {
1036
+ traceId: string;
1037
+ frame: StoryboardFrame;
1038
+ }
1039
+ /**
1040
+ * `PATCH …/storyboards/{id}/order` body — FULL-LIST replace, idempotent. The
1041
+ * list must be a permutation of the board's current `frameIds`.
1042
+ */
1043
+ export interface ReorderStoryboardFramesRequest {
1044
+ frameIds: string[];
1045
+ }
1046
+ /** Board-scoped writes return the refreshed META item. */
1047
+ export interface StoryboardResponse {
1048
+ traceId: string;
1049
+ storyboard: Storyboard;
1050
+ }
1051
+ /** Export v1 targets (spec §4.6). */
1052
+ export type StoryboardExportTarget = 'longlive' | 'seedance' | 'bundle';
1053
+ /** Runtime enumeration of {@link StoryboardExportTarget}. */
1054
+ export declare const STORYBOARD_EXPORT_TARGETS: readonly StoryboardExportTarget[];
1055
+ /**
1056
+ * `GET …/storyboards/{id}/export/{target}`. `payload` is the target-shaped
1057
+ * document (a LongLive shot script, a Seedance request payload, or the JSON
1058
+ * bundle) — deliberately untyped here because SB.8 owns those three shapes;
1059
+ * the export UI (SB-U.9) narrows it per target.
1060
+ */
1061
+ export interface ExportStoryboardResponse {
1062
+ traceId: string;
1063
+ target: StoryboardExportTarget;
1064
+ filename: string;
1065
+ payload: Record<string, unknown>;
1066
+ }
1067
+ /**
1068
+ * The visual-storyboard surface (spec §4.5), mounted on the STORIES app
1069
+ * alongside arcs — so every call goes to `transport.baseUrl`. Land-dark: 404s
1070
+ * until `SEER_STORYBOARD_ENABLED` is set server-side.
1071
+ *
1072
+ * Board creation is async (the arcs envelope): create returns **202** with a
1073
+ * QUEUED board, then poll {@link StoryboardsApi.getStoryboard} until
1074
+ * {@link isStoryboardTerminal}. `regenerate` and `region-edit` are likewise
1075
+ * 202 — they append a PENDING variant, which makes the frame read `running`.
1076
+ */
1077
+ export declare class StoryboardsApi {
1078
+ private readonly transport;
1079
+ constructor(transport: Transport);
1080
+ private boardsPath;
1081
+ private framePath;
1082
+ /**
1083
+ * Generate a board from an approved arc variant. `POST
1084
+ * /api/v1/stories/{storyId}/storyboards` → **202** + `Location` + the QUEUED
1085
+ * board; frames fill in as the worker completes them.
1086
+ */
1087
+ createStoryboard(storyId: string, req: CreateStoryboardRequest): Promise<CreateStoryboardResponse>;
1088
+ /**
1089
+ * List a story's boards newest-first (summaries — no frames). `GET
1090
+ * /api/v1/stories/{storyId}/storyboards`.
1091
+ */
1092
+ listStoryboards(storyId: string): Promise<ListStoryboardsResponse>;
1093
+ /**
1094
+ * Read one board in full — frames + presigned variant URLs, and (with
1095
+ * `view: 'quests'`) the computed quest join. `GET
1096
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}?view=…&sessionId=…`.
1097
+ * This is also the 202-create poll target.
1098
+ *
1099
+ * `sessionId` (§Q SEC.44, additive): the caller's OWN play session. The
1100
+ * storyboard reads take the fork-material grade, so a definition's player who
1101
+ * is not a member of the story's owner reads the board their run plays only
1102
+ * by naming that session — and only at the default `arc` view. A caller the
1103
+ * grade already admits is unaffected by it.
1104
+ */
1105
+ getStoryboard(storyId: string, storyboardId: string, params?: {
1106
+ view?: StoryboardView;
1107
+ sessionId?: string;
1108
+ }): Promise<StoryboardDetailResponse>;
1109
+ /**
1110
+ * Partial edit of ONE frame — prompt fields, duration, transition, camera,
1111
+ * refs, extensions. Absent fields are unchanged; pass the frame's `txnVer`
1112
+ * to make the write version-guarded (409 on a stale base). `PATCH
1113
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/frames/{frameId}`.
1114
+ */
1115
+ patchStoryboardFrame(storyId: string, storyboardId: string, frameId: string, body: PatchStoryboardFrameRequest): Promise<StoryboardFrameResponse>;
1116
+ /**
1117
+ * @deprecated Use {@link StoryboardsApi.retryStoryboardFrame} — it is the same
1118
+ * operation under the name the server actually implements, and it accepts the
1119
+ * `{modelId}` body this signature cannot express (§Q SB.55).
1120
+ *
1121
+ * Re-run generation for ONE frame with its CURRENT prompt (patch it first with
1122
+ * {@link StoryboardsApi.patchStoryboardFrame} to change it) → **202** + the
1123
+ * frame as it stands; poll the detail read for the appended variant.
1124
+ *
1125
+ * **§Q SB.70 — this used to POST `…/frames/{frameId}/regenerate`, a route that
1126
+ * never existed, so every call 404'd.** It was published by SB-U.1 (#1472)
1127
+ * against a planned endpoint and shipped ahead of it; `SB-U.6`'s row was
1128
+ * written against this method, hit the 404, and had to be rebuilt on `/retry`.
1129
+ * It now targets `/retry`, which has done exactly this job since §Q SB.35.
1130
+ *
1131
+ * Retargeting rather than removing is deliberate: client-core is a contract
1132
+ * with two consumers, one of them a pinned app outside this repo, so the
1133
+ * method must keep existing. Two behaviours you inherit from the real route
1134
+ * and should know about — it **409s a board that is not terminal** (a running
1135
+ * generation already owns the frame), and a retry of an ALREADY-SUCCEEDED
1136
+ * frame is allowed and is a PAID re-roll.
1137
+ */
1138
+ regenerateStoryboardFrame(storyId: string, storyboardId: string, frameId: string): Promise<StoryboardFrameResponse>;
1139
+ /**
1140
+ * Edit a REGION of one frame — with a mask (inpaint) or without (semantic
1141
+ * edit). `POST …/frames/{frameId}/region-edit` → **202** + the frame with a
1142
+ * PENDING `region_edit` variant appended.
1143
+ */
1144
+ regionEditStoryboardFrame(storyId: string, storyboardId: string, frameId: string, body: RegionEditFrameRequest): Promise<StoryboardFrameResponse>;
1145
+ /**
1146
+ * Choose which variant is the frame's image — SYNCHRONOUS and
1147
+ * version-guarded (echo the frame's `txnVer`; a stale value 409s rather than
1148
+ * clobbering a concurrent edit). `POST …/frames/{frameId}/select-variant`.
1149
+ */
1150
+ selectStoryboardFrameVariant(storyId: string, storyboardId: string, frameId: string, body: SelectFrameVariantRequest): Promise<StoryboardFrameResponse>;
1151
+ /**
1152
+ * Regenerate ONE frame of a terminal board — 202, the board stays terminal
1153
+ * (§Q SB.35, `POST
1154
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/frames/{frameId}/retry`).
1155
+ *
1156
+ * The recovery action for a PARTIALLY failed board: without it the only way
1157
+ * to repair one blocked frame is regenerating the whole storyboard, which
1158
+ * re-pays for every frame that already rendered. Pass
1159
+ * {@link RetryStoryboardFrameRequest.modelId} to re-compose with a different
1160
+ * model (§Q SB.55); omit the body entirely to use the board's own.
1161
+ *
1162
+ * **It is asynchronous and PAID.** The response carries the frame as it
1163
+ * stands NOW — poll {@link StoryboardsApi.getStoryboard} for the appended
1164
+ * variant. Two dispatches for the same frame are refused: the second gets a
1165
+ * **409** rather than composing a second billed image (§Q SB.44), so a UI
1166
+ * should disable the control while one is outstanding and treat a 409 as
1167
+ * "already running", not as an error to surface.
1168
+ *
1169
+ * ⚠ **The 202 returns the frame UNCHANGED — no pending variant is appended**
1170
+ * (the worker appends it asynchronously). So the response is a receipt, not
1171
+ * new state: a caller cannot tell from it that the retry is in flight, and
1172
+ * must keep its own outstanding flag and watch the detail read for a variant
1173
+ * id it did not already hold. Watching the variant COUNT does not work at
1174
+ * {@link FRAME_VARIANT_HISTORY_CAP} — `append_variant` evicts one to add one,
1175
+ * so the length does not change (§Q SB-U.6).
1176
+ */
1177
+ retryStoryboardFrame(storyId: string, storyboardId: string, frameId: string, body?: RetryStoryboardFrameRequest): Promise<StoryboardFrameResponse>;
1178
+ /**
1179
+ * Persist the HappyOyster world this frame opens into — the DM world-entry
1180
+ * write (§Q DM.1). `PUT
1181
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/frames/{frameId}/world`.
1182
+ *
1183
+ * Call it IMMEDIATELY after `createWorld` resolves, and also from
1184
+ * `HappyOysterLaunchError.handle` when `startTravel` failed on a world that
1185
+ * was nonetheless created — that world is already billed, and this call is the
1186
+ * only thing that keeps it findable. Idempotent: safe to retry with the same
1187
+ * id. See {@link SetFrameWorldRequest} for the 409 semantics.
1188
+ */
1189
+ setStoryboardFrameWorld(storyId: string, storyboardId: string, frameId: string, body: SetFrameWorldRequest, options?: {
1190
+ supersede?: boolean;
1191
+ }): Promise<StoryboardFrameResponse>;
1192
+ /**
1193
+ * Plan pre-minting one adventure world per BEAT (§Q MOMENT.6a) —
1194
+ * `/api/v1/stories/{storyId}/storyboards/{storyboardId}/worlds/prepare`.
1195
+ *
1196
+ * **§Q WORLD.29 — two arms, and the DEFAULT reserves nothing.** Without
1197
+ * `confirm` this is the spend PREVIEW (`GET`): the same plan with
1198
+ * `preview: true`, no lease taken, no cap slot consumed — so a preview a
1199
+ * creator abandons blocks no board/video delete. With `confirm: true` it is
1200
+ * the creator's CONFIRM (`POST`): every `pending` entry is LEASED (a story
1201
+ * cap slot reserved for an hour) and carries the `leaseToken` the bind must
1202
+ * echo. Only an explicit "mint" click may pass `confirm` — the owner ruled
1203
+ * leases are taken only on confirm. The confirm answers a 409
1204
+ * `reactor_disabled` while the admin Reactor switch is off (§Q WORLD.30).
1205
+ *
1206
+ * ⚠ **CREATOR-INVOKED ONLY, and the confirm authorises SPEND.** `pendingCount`
1207
+ * is a count of permanent, billed, undeletable worlds — show it before
1208
+ * minting. Then, for each `pending` entry of the CONFIRM, `createWorld` from
1209
+ * that frame's image + compiled prompt and persist the result with
1210
+ * {@link StoryboardsApi.setStoryboardFrameWorld}. Nothing is minted server-side.
1211
+ *
1212
+ * `supersede` (§Q MOMENT.8) re-opens already-bound beats for replacement
1213
+ * instead of skipping them; each authorised entry carries the `worldId` to
1214
+ * echo back as `supersedesWorldId`.
1215
+ *
1216
+ * **§Q WORLD.44 — `frameIds` SCOPES the confirm.** Pass the anchor frames the
1217
+ * run will actually mint (the `frameId` of each confirmed target): only those
1218
+ * beats are leased, and the response reports only them. A confirm without it
1219
+ * leases EVERY pending beat for an hour, holding board and video DELETE at 409
1220
+ * over beats nobody mints. Ignored on the preview. Leases the run then will
1221
+ * not spend go back through {@link StoryboardsApi.releaseStoryboardWorlds}.
1222
+ */
1223
+ prepareStoryboardWorlds(storyId: string, storyboardId: string, options?: {
1224
+ supersede?: boolean;
1225
+ confirm?: boolean;
1226
+ frameIds?: readonly string[];
1227
+ }): Promise<PrepareStoryboardWorldsResponse>;
1228
+ /**
1229
+ * Hand back world-mint authorisations this client will not spend (§Q
1230
+ * WORLD.44) — `POST
1231
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/worlds/release`.
1232
+ *
1233
+ * Call it for a confirm the drift check refused, and for targets a run never
1234
+ * reached or skipped before `createWorld`. ⛔ NEVER for a target whose mint may
1235
+ * have been billed — a release frees the slot for another prepare while that
1236
+ * world is still unrecorded. Token-fenced and idempotent; not Reactor-gated.
1237
+ */
1238
+ releaseStoryboardWorlds(storyId: string, storyboardId: string, body: ReleaseStoryboardWorldsRequest): Promise<ReleaseStoryboardWorldsResponse>;
1239
+ /**
1240
+ * Reorder the board — a FULL-LIST replace of {@link Storyboard.frameIds},
1241
+ * which is the ONE ordering source of truth, so this is idempotent and
1242
+ * cannot diverge from a per-frame order. `PATCH
1243
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/order`.
1244
+ */
1245
+ reorderStoryboardFrames(storyId: string, storyboardId: string, body: ReorderStoryboardFramesRequest): Promise<StoryboardResponse>;
1246
+ /**
1247
+ * Export the board to one of the v1 targets (`longlive` / `seedance` /
1248
+ * `bundle`). `GET
1249
+ * /api/v1/stories/{storyId}/storyboards/{storyboardId}/export/{target}`.
1250
+ */
1251
+ exportStoryboard(storyId: string, storyboardId: string, target: StoryboardExportTarget): Promise<ExportStoryboardResponse>;
1252
+ }
1253
+ //# sourceMappingURL=storyboards.d.ts.map