@nodetool-ai/protocol 0.7.0-rc.23 → 0.8.1

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 (419) hide show
  1. package/README.md +56 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/ai-video-production.d.ts +249 -0
  4. package/dist/ai-video-production.d.ts.map +1 -0
  5. package/dist/ai-video-production.js +131 -0
  6. package/dist/ai-video-production.js.map +1 -0
  7. package/dist/api-schemas/agent-access.d.ts +134 -0
  8. package/dist/api-schemas/agent-access.d.ts.map +1 -0
  9. package/dist/api-schemas/agent-access.js +93 -0
  10. package/dist/api-schemas/agent-access.js.map +1 -0
  11. package/dist/api-schemas/api-error-code.d.ts +11 -1
  12. package/dist/api-schemas/api-error-code.d.ts.map +1 -1
  13. package/dist/api-schemas/api-error-code.js +10 -0
  14. package/dist/api-schemas/api-error-code.js.map +1 -1
  15. package/dist/api-schemas/applications.d.ts +1411 -0
  16. package/dist/api-schemas/applications.d.ts.map +1 -0
  17. package/dist/api-schemas/applications.js +333 -0
  18. package/dist/api-schemas/applications.js.map +1 -0
  19. package/dist/api-schemas/assets.d.ts +230 -0
  20. package/dist/api-schemas/assets.d.ts.map +1 -1
  21. package/dist/api-schemas/assets.js +131 -5
  22. package/dist/api-schemas/assets.js.map +1 -1
  23. package/dist/api-schemas/code-gen.d.ts +176 -0
  24. package/dist/api-schemas/code-gen.d.ts.map +1 -0
  25. package/dist/api-schemas/code-gen.js +205 -0
  26. package/dist/api-schemas/code-gen.js.map +1 -0
  27. package/dist/api-schemas/collections.d.ts.map +1 -1
  28. package/dist/api-schemas/collections.js +3 -4
  29. package/dist/api-schemas/collections.js.map +1 -1
  30. package/dist/api-schemas/costs.d.ts +179 -0
  31. package/dist/api-schemas/costs.d.ts.map +1 -1
  32. package/dist/api-schemas/costs.js +100 -4
  33. package/dist/api-schemas/costs.js.map +1 -1
  34. package/dist/api-schemas/credits.d.ts +42 -0
  35. package/dist/api-schemas/credits.d.ts.map +1 -0
  36. package/dist/api-schemas/credits.js +43 -0
  37. package/dist/api-schemas/credits.js.map +1 -0
  38. package/dist/api-schemas/documents.d.ts +163 -0
  39. package/dist/api-schemas/documents.d.ts.map +1 -0
  40. package/dist/api-schemas/documents.js +75 -0
  41. package/dist/api-schemas/documents.js.map +1 -0
  42. package/dist/api-schemas/files.d.ts +13 -0
  43. package/dist/api-schemas/files.d.ts.map +1 -1
  44. package/dist/api-schemas/files.js +8 -0
  45. package/dist/api-schemas/files.js.map +1 -1
  46. package/dist/api-schemas/fonts.d.ts +17 -1
  47. package/dist/api-schemas/fonts.d.ts.map +1 -1
  48. package/dist/api-schemas/fonts.js +19 -3
  49. package/dist/api-schemas/fonts.js.map +1 -1
  50. package/dist/api-schemas/index.d.ts +23 -1
  51. package/dist/api-schemas/index.d.ts.map +1 -1
  52. package/dist/api-schemas/index.js +23 -1
  53. package/dist/api-schemas/index.js.map +1 -1
  54. package/dist/api-schemas/jobs.d.ts +12 -0
  55. package/dist/api-schemas/jobs.d.ts.map +1 -1
  56. package/dist/api-schemas/jobs.js +12 -2
  57. package/dist/api-schemas/jobs.js.map +1 -1
  58. package/dist/api-schemas/js-scripts.d.ts +364 -0
  59. package/dist/api-schemas/js-scripts.d.ts.map +1 -0
  60. package/dist/api-schemas/js-scripts.js +333 -0
  61. package/dist/api-schemas/js-scripts.js.map +1 -0
  62. package/dist/api-schemas/mcp-config.d.ts.map +1 -1
  63. package/dist/api-schemas/mcp-config.js +3 -1
  64. package/dist/api-schemas/mcp-config.js.map +1 -1
  65. package/dist/api-schemas/memories.d.ts +84 -0
  66. package/dist/api-schemas/memories.d.ts.map +1 -0
  67. package/dist/api-schemas/memories.js +54 -0
  68. package/dist/api-schemas/memories.js.map +1 -0
  69. package/dist/api-schemas/messages.d.ts +1 -0
  70. package/dist/api-schemas/messages.d.ts.map +1 -1
  71. package/dist/api-schemas/messages.js +4 -4
  72. package/dist/api-schemas/messages.js.map +1 -1
  73. package/dist/api-schemas/models.d.ts +156 -0
  74. package/dist/api-schemas/models.d.ts.map +1 -1
  75. package/dist/api-schemas/models.js +51 -6
  76. package/dist/api-schemas/models.js.map +1 -1
  77. package/dist/api-schemas/nodes.d.ts +97 -0
  78. package/dist/api-schemas/nodes.d.ts.map +1 -1
  79. package/dist/api-schemas/nodes.js +89 -0
  80. package/dist/api-schemas/nodes.js.map +1 -1
  81. package/dist/api-schemas/projects.d.ts +427 -0
  82. package/dist/api-schemas/projects.d.ts.map +1 -0
  83. package/dist/api-schemas/projects.js +224 -0
  84. package/dist/api-schemas/projects.js.map +1 -0
  85. package/dist/api-schemas/recipes.d.ts +172 -0
  86. package/dist/api-schemas/recipes.d.ts.map +1 -0
  87. package/dist/api-schemas/recipes.js +144 -0
  88. package/dist/api-schemas/recipes.js.map +1 -0
  89. package/dist/api-schemas/resources.d.ts +112 -0
  90. package/dist/api-schemas/resources.d.ts.map +1 -0
  91. package/dist/api-schemas/resources.js +44 -0
  92. package/dist/api-schemas/resources.js.map +1 -0
  93. package/dist/api-schemas/scripts.d.ts +1571 -0
  94. package/dist/api-schemas/scripts.d.ts.map +1 -0
  95. package/dist/api-schemas/scripts.js +153 -0
  96. package/dist/api-schemas/scripts.js.map +1 -0
  97. package/dist/api-schemas/sdk-execution-v1.d.ts +467 -0
  98. package/dist/api-schemas/sdk-execution-v1.d.ts.map +1 -0
  99. package/dist/api-schemas/sdk-execution-v1.js +115 -0
  100. package/dist/api-schemas/sdk-execution-v1.js.map +1 -0
  101. package/dist/api-schemas/sdk-lifecycle-v1.d.ts +217 -0
  102. package/dist/api-schemas/sdk-lifecycle-v1.d.ts.map +1 -0
  103. package/dist/api-schemas/sdk-lifecycle-v1.js +117 -0
  104. package/dist/api-schemas/sdk-lifecycle-v1.js.map +1 -0
  105. package/dist/api-schemas/sdk-models-v1.d.ts +181 -0
  106. package/dist/api-schemas/sdk-models-v1.d.ts.map +1 -0
  107. package/dist/api-schemas/sdk-models-v1.js +108 -0
  108. package/dist/api-schemas/sdk-models-v1.js.map +1 -0
  109. package/dist/api-schemas/sdk-v1-http-operations.d.ts +941 -0
  110. package/dist/api-schemas/sdk-v1-http-operations.d.ts.map +1 -0
  111. package/dist/api-schemas/sdk-v1-http-operations.js +465 -0
  112. package/dist/api-schemas/sdk-v1-http-operations.js.map +1 -0
  113. package/dist/api-schemas/sdk-v1-operations.d.ts +151 -0
  114. package/dist/api-schemas/sdk-v1-operations.d.ts.map +1 -0
  115. package/dist/api-schemas/sdk-v1-operations.js +97 -0
  116. package/dist/api-schemas/sdk-v1-operations.js.map +1 -0
  117. package/dist/api-schemas/sdk-v1-websocket-operations.d.ts +97 -0
  118. package/dist/api-schemas/sdk-v1-websocket-operations.d.ts.map +1 -0
  119. package/dist/api-schemas/sdk-v1-websocket-operations.js +96 -0
  120. package/dist/api-schemas/sdk-v1-websocket-operations.js.map +1 -0
  121. package/dist/api-schemas/sdk-v1.d.ts +15 -0
  122. package/dist/api-schemas/sdk-v1.d.ts.map +1 -0
  123. package/dist/api-schemas/sdk-v1.js +22 -0
  124. package/dist/api-schemas/sdk-v1.js.map +1 -0
  125. package/dist/api-schemas/segmentation.d.ts +75 -0
  126. package/dist/api-schemas/segmentation.d.ts.map +1 -0
  127. package/dist/api-schemas/segmentation.js +54 -0
  128. package/dist/api-schemas/segmentation.js.map +1 -0
  129. package/dist/api-schemas/settings.d.ts +159 -0
  130. package/dist/api-schemas/settings.d.ts.map +1 -1
  131. package/dist/api-schemas/settings.js +70 -0
  132. package/dist/api-schemas/settings.js.map +1 -1
  133. package/dist/api-schemas/sketch.d.ts +847 -0
  134. package/dist/api-schemas/sketch.d.ts.map +1 -0
  135. package/dist/api-schemas/sketch.js +544 -0
  136. package/dist/api-schemas/sketch.js.map +1 -0
  137. package/dist/api-schemas/skills.d.ts +27 -14
  138. package/dist/api-schemas/skills.d.ts.map +1 -1
  139. package/dist/api-schemas/skills.js +64 -11
  140. package/dist/api-schemas/skills.js.map +1 -1
  141. package/dist/api-schemas/storage.d.ts +8 -0
  142. package/dist/api-schemas/storage.d.ts.map +1 -1
  143. package/dist/api-schemas/storage.js +7 -0
  144. package/dist/api-schemas/storage.js.map +1 -1
  145. package/dist/api-schemas/storyboards.d.ts +7026 -0
  146. package/dist/api-schemas/storyboards.d.ts.map +1 -0
  147. package/dist/api-schemas/storyboards.js +393 -0
  148. package/dist/api-schemas/storyboards.js.map +1 -0
  149. package/dist/api-schemas/threads.d.ts +12 -4
  150. package/dist/api-schemas/threads.d.ts.map +1 -1
  151. package/dist/api-schemas/threads.js +12 -4
  152. package/dist/api-schemas/threads.js.map +1 -1
  153. package/dist/api-schemas/timeline-tool-contracts.d.ts +1650 -0
  154. package/dist/api-schemas/timeline-tool-contracts.d.ts.map +1 -0
  155. package/dist/api-schemas/timeline-tool-contracts.js +725 -0
  156. package/dist/api-schemas/timeline-tool-contracts.js.map +1 -0
  157. package/dist/api-schemas/timeline-tool-params.d.ts +1237 -0
  158. package/dist/api-schemas/timeline-tool-params.d.ts.map +1 -0
  159. package/dist/api-schemas/timeline-tool-params.js +1518 -0
  160. package/dist/api-schemas/timeline-tool-params.js.map +1 -0
  161. package/dist/api-schemas/timeline.d.ts +12803 -0
  162. package/dist/api-schemas/timeline.d.ts.map +1 -0
  163. package/dist/api-schemas/timeline.js +1838 -0
  164. package/dist/api-schemas/timeline.js.map +1 -0
  165. package/dist/api-schemas/ui-tool-contract.d.ts +35 -0
  166. package/dist/api-schemas/ui-tool-contract.d.ts.map +1 -0
  167. package/dist/api-schemas/ui-tool-contract.js +31 -0
  168. package/dist/api-schemas/ui-tool-contract.js.map +1 -0
  169. package/dist/api-schemas/workflows.d.ts +852 -18
  170. package/dist/api-schemas/workflows.d.ts.map +1 -1
  171. package/dist/api-schemas/workflows.js +484 -6
  172. package/dist/api-schemas/workflows.js.map +1 -1
  173. package/dist/api-schemas/workspace.d.ts +45 -0
  174. package/dist/api-schemas/workspace.d.ts.map +1 -1
  175. package/dist/api-schemas/workspace.js +47 -1
  176. package/dist/api-schemas/workspace.js.map +1 -1
  177. package/dist/api-types.d.ts +621 -27
  178. package/dist/api-types.d.ts.map +1 -1
  179. package/dist/api-types.js +246 -1
  180. package/dist/api-types.js.map +1 -1
  181. package/dist/app-deployment.d.ts +37 -0
  182. package/dist/app-deployment.d.ts.map +1 -0
  183. package/dist/app-deployment.js +42 -0
  184. package/dist/app-deployment.js.map +1 -0
  185. package/dist/asset-generation.d.ts +58 -0
  186. package/dist/asset-generation.d.ts.map +1 -0
  187. package/dist/asset-generation.js +147 -0
  188. package/dist/asset-generation.js.map +1 -0
  189. package/dist/blend-modes.d.ts +20 -0
  190. package/dist/blend-modes.d.ts.map +1 -0
  191. package/dist/blend-modes.js +33 -0
  192. package/dist/blend-modes.js.map +1 -0
  193. package/dist/bridge-frames.d.ts +654 -0
  194. package/dist/bridge-frames.d.ts.map +1 -0
  195. package/dist/bridge-frames.js +448 -0
  196. package/dist/bridge-frames.js.map +1 -0
  197. package/dist/bridge-frames.schema.json +862 -0
  198. package/dist/bridge-protocol.d.ts +57 -20
  199. package/dist/bridge-protocol.d.ts.map +1 -1
  200. package/dist/bridge-protocol.js +57 -20
  201. package/dist/bridge-protocol.js.map +1 -1
  202. package/dist/builtin-packs.d.ts +45 -0
  203. package/dist/builtin-packs.d.ts.map +1 -0
  204. package/dist/builtin-packs.js +115 -0
  205. package/dist/builtin-packs.js.map +1 -0
  206. package/dist/caption-word.d.ts +15 -0
  207. package/dist/caption-word.d.ts.map +1 -0
  208. package/dist/caption-word.js +10 -0
  209. package/dist/caption-word.js.map +1 -0
  210. package/dist/cloud-profile.d.ts +187 -0
  211. package/dist/cloud-profile.d.ts.map +1 -0
  212. package/dist/cloud-profile.js +281 -0
  213. package/dist/cloud-profile.js.map +1 -0
  214. package/dist/creative.d.ts +486 -0
  215. package/dist/creative.d.ts.map +1 -0
  216. package/dist/creative.js +269 -0
  217. package/dist/creative.js.map +1 -0
  218. package/dist/custom-providers.d.ts +70 -0
  219. package/dist/custom-providers.d.ts.map +1 -0
  220. package/dist/custom-providers.js +125 -0
  221. package/dist/custom-providers.js.map +1 -0
  222. package/dist/document-ops.d.ts +15 -0
  223. package/dist/document-ops.d.ts.map +1 -0
  224. package/dist/document-ops.js +2 -0
  225. package/dist/document-ops.js.map +1 -0
  226. package/dist/game-assets.d.ts +344 -0
  227. package/dist/game-assets.d.ts.map +1 -0
  228. package/dist/game-assets.js +297 -0
  229. package/dist/game-assets.js.map +1 -0
  230. package/dist/game-design.d.ts +90 -0
  231. package/dist/game-design.d.ts.map +1 -0
  232. package/dist/game-design.js +417 -0
  233. package/dist/game-design.js.map +1 -0
  234. package/dist/game-flow-prompt.d.ts +68 -0
  235. package/dist/game-flow-prompt.d.ts.map +1 -0
  236. package/dist/game-flow-prompt.js +121 -0
  237. package/dist/game-flow-prompt.js.map +1 -0
  238. package/dist/game-graph.d.ts +96 -0
  239. package/dist/game-graph.d.ts.map +1 -0
  240. package/dist/game-graph.js +481 -0
  241. package/dist/game-graph.js.map +1 -0
  242. package/dist/game-migration.d.ts +4 -0
  243. package/dist/game-migration.d.ts.map +1 -0
  244. package/dist/game-migration.js +6 -0
  245. package/dist/game-migration.js.map +1 -0
  246. package/dist/game-slot-prompt.d.ts +90 -0
  247. package/dist/game-slot-prompt.d.ts.map +1 -0
  248. package/dist/game-slot-prompt.js +237 -0
  249. package/dist/game-slot-prompt.js.map +1 -0
  250. package/dist/game.d.ts +1663 -0
  251. package/dist/game.d.ts.map +1 -0
  252. package/dist/game.js +228 -0
  253. package/dist/game.js.map +1 -0
  254. package/dist/graph.d.ts +191 -5
  255. package/dist/graph.d.ts.map +1 -1
  256. package/dist/graph.js +497 -0
  257. package/dist/graph.js.map +1 -1
  258. package/dist/index.d.ts +47 -2
  259. package/dist/index.d.ts.map +1 -1
  260. package/dist/index.js +46 -2
  261. package/dist/index.js.map +1 -1
  262. package/dist/loop.d.ts +38 -0
  263. package/dist/loop.d.ts.map +1 -0
  264. package/dist/loop.js +69 -0
  265. package/dist/loop.js.map +1 -0
  266. package/dist/mcp-server-config.d.ts +113 -0
  267. package/dist/mcp-server-config.d.ts.map +1 -0
  268. package/dist/mcp-server-config.js +147 -0
  269. package/dist/mcp-server-config.js.map +1 -0
  270. package/dist/messages.d.ts +1565 -243
  271. package/dist/messages.d.ts.map +1 -1
  272. package/dist/messages.js +709 -22
  273. package/dist/messages.js.map +1 -1
  274. package/dist/model-selection.d.ts +20 -0
  275. package/dist/model-selection.d.ts.map +1 -0
  276. package/dist/model-selection.js +27 -0
  277. package/dist/model-selection.js.map +1 -0
  278. package/dist/nodetool-models.d.ts +71 -0
  279. package/dist/nodetool-models.d.ts.map +1 -0
  280. package/dist/nodetool-models.js +138 -0
  281. package/dist/nodetool-models.js.map +1 -0
  282. package/dist/package-assets.d.ts +39 -0
  283. package/dist/package-assets.d.ts.map +1 -0
  284. package/dist/package-assets.js +63 -0
  285. package/dist/package-assets.js.map +1 -0
  286. package/dist/platform.d.ts +66 -0
  287. package/dist/platform.d.ts.map +1 -0
  288. package/dist/platform.js +68 -0
  289. package/dist/platform.js.map +1 -0
  290. package/dist/predicates.d.ts +43 -0
  291. package/dist/predicates.d.ts.map +1 -0
  292. package/dist/predicates.js +65 -0
  293. package/dist/predicates.js.map +1 -0
  294. package/dist/processing-messages.schema.json +2525 -0
  295. package/dist/production-authoring.d.ts +757 -0
  296. package/dist/production-authoring.d.ts.map +1 -0
  297. package/dist/production-authoring.js +736 -0
  298. package/dist/production-authoring.js.map +1 -0
  299. package/dist/render-record.d.ts +86 -0
  300. package/dist/render-record.d.ts.map +1 -0
  301. package/dist/render-record.js +133 -0
  302. package/dist/render-record.js.map +1 -0
  303. package/dist/resource-id.d.ts +22 -0
  304. package/dist/resource-id.d.ts.map +1 -0
  305. package/dist/resource-id.js +32 -0
  306. package/dist/resource-id.js.map +1 -0
  307. package/dist/resource-uri.d.ts +15 -0
  308. package/dist/resource-uri.d.ts.map +1 -0
  309. package/dist/resource-uri.js +88 -0
  310. package/dist/resource-uri.js.map +1 -0
  311. package/dist/sandbox-capability.d.ts +86 -0
  312. package/dist/sandbox-capability.d.ts.map +1 -0
  313. package/dist/sandbox-capability.js +106 -0
  314. package/dist/sandbox-capability.js.map +1 -0
  315. package/dist/sandbox-host.d.ts +98 -0
  316. package/dist/sandbox-host.d.ts.map +1 -0
  317. package/dist/sandbox-host.js +311 -0
  318. package/dist/sandbox-host.js.map +1 -0
  319. package/dist/sandbox-package.d.ts +674 -0
  320. package/dist/sandbox-package.d.ts.map +1 -0
  321. package/dist/sandbox-package.js +622 -0
  322. package/dist/sandbox-package.js.map +1 -0
  323. package/dist/sandbox-wasm.d.ts +84 -0
  324. package/dist/sandbox-wasm.d.ts.map +1 -0
  325. package/dist/sandbox-wasm.js +139 -0
  326. package/dist/sandbox-wasm.js.map +1 -0
  327. package/dist/screenplay-authoring.d.ts +69 -0
  328. package/dist/screenplay-authoring.d.ts.map +1 -0
  329. package/dist/screenplay-authoring.js +351 -0
  330. package/dist/screenplay-authoring.js.map +1 -0
  331. package/dist/script-authoring.d.ts +161 -0
  332. package/dist/script-authoring.d.ts.map +1 -0
  333. package/dist/script-authoring.js +503 -0
  334. package/dist/script-authoring.js.map +1 -0
  335. package/dist/script-fill.d.ts +39 -0
  336. package/dist/script-fill.d.ts.map +1 -0
  337. package/dist/script-fill.js +67 -0
  338. package/dist/script-fill.js.map +1 -0
  339. package/dist/script-link.d.ts +110 -0
  340. package/dist/script-link.d.ts.map +1 -0
  341. package/dist/script-link.js +252 -0
  342. package/dist/script-link.js.map +1 -0
  343. package/dist/sha256.d.ts +11 -0
  344. package/dist/sha256.d.ts.map +1 -0
  345. package/dist/sha256.js +110 -0
  346. package/dist/sha256.js.map +1 -0
  347. package/dist/shot-prompt.d.ts +78 -0
  348. package/dist/shot-prompt.d.ts.map +1 -0
  349. package/dist/shot-prompt.js +120 -0
  350. package/dist/shot-prompt.js.map +1 -0
  351. package/dist/skill-document.d.ts +36 -0
  352. package/dist/skill-document.d.ts.map +1 -0
  353. package/dist/skill-document.js +137 -0
  354. package/dist/skill-document.js.map +1 -0
  355. package/dist/style-presets.d.ts +73 -0
  356. package/dist/style-presets.d.ts.map +1 -0
  357. package/dist/style-presets.js +147 -0
  358. package/dist/style-presets.js.map +1 -0
  359. package/dist/supervisor.d.ts +227 -0
  360. package/dist/supervisor.d.ts.map +1 -0
  361. package/dist/supervisor.js +116 -0
  362. package/dist/supervisor.js.map +1 -0
  363. package/dist/token-providers.d.ts +31 -0
  364. package/dist/token-providers.d.ts.map +1 -0
  365. package/dist/token-providers.js +52 -0
  366. package/dist/token-providers.js.map +1 -0
  367. package/dist/toolSchemas.d.ts +10 -14
  368. package/dist/toolSchemas.d.ts.map +1 -1
  369. package/dist/toolSchemas.js +13 -23
  370. package/dist/toolSchemas.js.map +1 -1
  371. package/dist/triggers.d.ts +41 -0
  372. package/dist/triggers.d.ts.map +1 -0
  373. package/dist/triggers.js +50 -0
  374. package/dist/triggers.js.map +1 -0
  375. package/dist/trpc-policy.d.ts +3 -0
  376. package/dist/trpc-policy.d.ts.map +1 -0
  377. package/dist/trpc-policy.js +3 -0
  378. package/dist/trpc-policy.js.map +1 -0
  379. package/dist/type-metadata.d.ts +5 -0
  380. package/dist/type-metadata.d.ts.map +1 -1
  381. package/dist/type-metadata.js +17 -8
  382. package/dist/type-metadata.js.map +1 -1
  383. package/dist/typecheck.d.ts.map +1 -1
  384. package/dist/typecheck.js +5 -4
  385. package/dist/typecheck.js.map +1 -1
  386. package/dist/wasm-binary.d.ts +61 -0
  387. package/dist/wasm-binary.d.ts.map +1 -0
  388. package/dist/wasm-binary.js +215 -0
  389. package/dist/wasm-binary.js.map +1 -0
  390. package/dist/workflow-plan.d.ts +197 -0
  391. package/dist/workflow-plan.d.ts.map +1 -0
  392. package/dist/workflow-plan.js +438 -0
  393. package/dist/workflow-plan.js.map +1 -0
  394. package/dist/wrap-primitives.d.ts +0 -11
  395. package/dist/wrap-primitives.d.ts.map +1 -1
  396. package/dist/wrap-primitives.js +3 -9
  397. package/dist/wrap-primitives.js.map +1 -1
  398. package/dist/ws-commands.d.ts +665 -0
  399. package/dist/ws-commands.d.ts.map +1 -0
  400. package/dist/ws-commands.js +610 -0
  401. package/dist/ws-commands.js.map +1 -0
  402. package/dist/zod-schema.d.ts +20 -0
  403. package/dist/zod-schema.d.ts.map +1 -0
  404. package/dist/zod-schema.js +298 -0
  405. package/dist/zod-schema.js.map +1 -0
  406. package/package.json +84 -7
  407. package/schema/sdk-v1.asyncapi.implemented.json +65 -0
  408. package/schema/sdk-v1.asyncapi.json +65 -0
  409. package/schema/sdk-v1.discovery.schema.json +1218 -0
  410. package/schema/sdk-v1.execution.schema.json +2792 -0
  411. package/schema/sdk-v1.lifecycle.schema.json +1031 -0
  412. package/schema/sdk-v1.manifest.json +71 -0
  413. package/schema/sdk-v1.openapi.implemented.json +730 -0
  414. package/schema/sdk-v1.openapi.json +730 -0
  415. package/schema/sdk-v1.operations.json +732 -0
  416. package/dist/agent-protocol.d.ts +0 -217
  417. package/dist/agent-protocol.d.ts.map +0 -1
  418. package/dist/agent-protocol.js +0 -85
  419. package/dist/agent-protocol.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @nodetool-ai/protocol – Script ↔ storyboard link
3
+ *
4
+ * The two pre-production documents stay separate: the script owns words and
5
+ * voice, the storyboard owns visuals and motion. What connects them is a set of
6
+ * keys on the board — {@link Screenplay.script_id} and each shot's
7
+ * {@link Shot.script_line_ids} — and the pure mappings in this module:
8
+ *
9
+ * - {@link extractScriptFromScreenplay}: board → script document.
10
+ * - {@link deriveShotScaffold}: script → the linkage half of a board.
11
+ * - {@link validateScriptLink}: the invariants both directions must hold.
12
+ * - {@link shotDialogueDrifted} / {@link orphanedLineIds}: derived, never
13
+ * stored, like `needsVoicing` in `@nodetool-ai/timeline`.
14
+ *
15
+ * Protocol, because it maps between two protocol document shapes and must stay
16
+ * dependency-free — the web editors, the agent tools, and the evals all read
17
+ * these same answers.
18
+ */
19
+ import { type Entity, type Screenplay, type Shot } from "./creative.js";
20
+ import type { ScriptDocumentSchema, ScriptLine, ScriptSection, Speaker } from "./api-schemas/scripts.js";
21
+ /** Cast id of the voice that reads narration, minted by the extractor. */
22
+ export declare const NARRATOR_SPEAKER_ID = "speaker_narrator";
23
+ /** Display name of the narrator speaker. */
24
+ export declare const NARRATOR_SPEAKER_NAME = "Narrator";
25
+ /** Text of the linked lines as one block, the form a snapshot is stored in. */
26
+ export declare const joinLineTexts: (texts: string[]) => string;
27
+ /** What {@link extractScriptFromScreenplay} produces. */
28
+ export interface ExtractedScript {
29
+ document: ScriptDocumentSchema;
30
+ /** Ordered line ids per shot, ready to stamp onto `script_line_ids`. */
31
+ lineIdsByShotId: Record<string, string[]>;
32
+ }
33
+ /**
34
+ * Project a screenplay's words into a script document, deterministically and
35
+ * without a model call: one section for the board, one line per shot dialogue
36
+ * and one per shot narration, in `index` order.
37
+ *
38
+ * The returned `lineIdsByShotId` is what the caller stamps onto the shots in
39
+ * the same save, so extraction and linking are one transaction.
40
+ */
41
+ export declare function extractScriptFromScreenplay(screenplay: Screenplay, entities: Entity[]): ExtractedScript;
42
+ /** Why a link is broken. One code per rule in the design's invariant list. */
43
+ export type ScriptLinkIssueCode = "duplicate_line_reference" | "unknown_line_reference" | "missing_script" | "unlinked_board_reference";
44
+ /** One finding. `severity` decides whether a save is refused or annotated. */
45
+ export interface ScriptLinkIssue {
46
+ severity: "error" | "warning";
47
+ code: ScriptLinkIssueCode;
48
+ message: string;
49
+ shotId?: string;
50
+ lineId?: string;
51
+ }
52
+ export interface ScriptLinkValidation {
53
+ errors: ScriptLinkIssue[];
54
+ warnings: ScriptLinkIssue[];
55
+ }
56
+ /** Just the part of a script document the link rules read. */
57
+ export interface ScriptLinkDocument {
58
+ sections: ScriptSection[];
59
+ }
60
+ /** Every line of a script in reading order. */
61
+ export declare const linkedScriptLines: (script: ScriptLinkDocument) => ScriptLine[];
62
+ /**
63
+ * Check a board against the script it links, per design §1.3. A missing script
64
+ * (deleted, or not loadable) is a warning — the board still works, only the
65
+ * link affordances go dead — while a reference that cannot be satisfied is an
66
+ * error naming the shot that carries it.
67
+ */
68
+ export declare function validateScriptLink(screenplay: Screenplay, scriptDoc: ScriptLinkDocument | null | undefined): ScriptLinkValidation;
69
+ /**
70
+ * The linkage half of a shot: which lines it covers, in what order, and the
71
+ * text projected from them. Shot *content* — action, camera, motion, slug,
72
+ * entities — is the Director agent's job.
73
+ */
74
+ export interface ShotScaffold {
75
+ index: number;
76
+ script_line_ids: string[];
77
+ /** Joined text of the covered lines spoken by a cast member. */
78
+ dialogue?: string;
79
+ /** Joined text of the covered narrator lines. */
80
+ narration?: string;
81
+ }
82
+ export interface DeriveShotScaffoldOptions {
83
+ /** Lines one shot may cover. Default 1; a shot never spans two sections. */
84
+ maxLinesPerShot?: number;
85
+ }
86
+ /** Just the part of a script {@link deriveShotScaffold} reads. */
87
+ export interface ScaffoldScript {
88
+ id: string;
89
+ cast: Speaker[];
90
+ sections: ScriptSection[];
91
+ }
92
+ /**
93
+ * Chunk a script's lines into shots: reading order, at most
94
+ * `maxLinesPerShot` per shot, never crossing a section boundary. Lines with no
95
+ * text are skipped — there is nothing for a shot to cover.
96
+ */
97
+ export declare function deriveShotScaffold(script: ScaffoldScript, options?: DeriveShotScaffoldOptions): ShotScaffold[];
98
+ /**
99
+ * Whether the linked lines now read differently from what was last projected
100
+ * into the shot. A line the map does not carry contributes nothing, so a
101
+ * deleted line drifts the shot it belonged to.
102
+ */
103
+ export declare function shotDialogueDrifted(shot: Shot, linesById: Map<string, ScriptLine>): boolean;
104
+ /**
105
+ * Lines of the linked script that no shot covers, in reading order. Empty for
106
+ * an unlinked board: without a `script_id` there is nothing to be orphaned
107
+ * from.
108
+ */
109
+ export declare function orphanedLineIds(screenplay: Screenplay, scriptDoc: ScriptLinkDocument): string[];
110
+ //# sourceMappingURL=script-link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-link.d.ts","sourceRoot":"","sources":["../src/script-link.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AAED,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,WACpB,kBAAkB,KACzB,UAAU,EAAyD,CAAC;AAEvE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAC/C,oBAAoB,CAoDtB;AAMD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,kEAAkE;AAClE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAkBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,yBAA8B,GACtC,YAAY,EAAE,CA4BhB;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GACjC,OAAO,CAWT;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,kBAAkB,GAC5B,MAAM,EAAE,CAUV"}
@@ -0,0 +1,252 @@
1
+ /**
2
+ * @nodetool-ai/protocol – Script ↔ storyboard link
3
+ *
4
+ * The two pre-production documents stay separate: the script owns words and
5
+ * voice, the storyboard owns visuals and motion. What connects them is a set of
6
+ * keys on the board — {@link Screenplay.script_id} and each shot's
7
+ * {@link Shot.script_line_ids} — and the pure mappings in this module:
8
+ *
9
+ * - {@link extractScriptFromScreenplay}: board → script document.
10
+ * - {@link deriveShotScaffold}: script → the linkage half of a board.
11
+ * - {@link validateScriptLink}: the invariants both directions must hold.
12
+ * - {@link shotDialogueDrifted} / {@link orphanedLineIds}: derived, never
13
+ * stored, like `needsVoicing` in `@nodetool-ai/timeline`.
14
+ *
15
+ * Protocol, because it maps between two protocol document shapes and must stay
16
+ * dependency-free — the web editors, the agent tools, and the evals all read
17
+ * these same answers.
18
+ */
19
+ import { entitiesForShot } from "./creative.js";
20
+ /** Cast id of the voice that reads narration, minted by the extractor. */
21
+ export const NARRATOR_SPEAKER_ID = "speaker_narrator";
22
+ /** Display name of the narrator speaker. */
23
+ export const NARRATOR_SPEAKER_NAME = "Narrator";
24
+ /** Text of the linked lines as one block, the form a snapshot is stored in. */
25
+ export const joinLineTexts = (texts) => texts.join("\n");
26
+ const dialogueLineId = (shotId) => `line_${shotId}_dialogue`;
27
+ const narrationLineId = (shotId) => `line_${shotId}_narration`;
28
+ const speakerIdForEntity = (entityId) => `speaker_${entityId}`;
29
+ const nonEmpty = (value) => {
30
+ const text = value?.trim();
31
+ return text ? text : undefined;
32
+ };
33
+ /**
34
+ * The character entity that speaks a shot's dialogue: the first character in
35
+ * the board's own {@link entitiesForShot} selection, so an extracted script
36
+ * casts a shot exactly the way a render seasons it.
37
+ */
38
+ function speakingEntity(shot, entities) {
39
+ return entitiesForShot(shot, entities).find((entity) => entity.kind === "character");
40
+ }
41
+ /**
42
+ * A character's cast entry. `voice_id` seeds the voice selection; provider and
43
+ * model stay empty for the cast panel (or Studio's curated lineup) to fill,
44
+ * because the board never records which TTS provider a voice id belongs to.
45
+ */
46
+ function speakerForEntity(entity) {
47
+ const voiceId = nonEmpty(entity.voice_id ?? undefined);
48
+ return {
49
+ id: speakerIdForEntity(entity.id),
50
+ name: entity.name,
51
+ voice: voiceId ? { provider: "", model: "", voice: voiceId } : null
52
+ };
53
+ }
54
+ function emptyLine(id, speakerId, text) {
55
+ return { id, speakerId, text, takes: [] };
56
+ }
57
+ /**
58
+ * Project a screenplay's words into a script document, deterministically and
59
+ * without a model call: one section for the board, one line per shot dialogue
60
+ * and one per shot narration, in `index` order.
61
+ *
62
+ * The returned `lineIdsByShotId` is what the caller stamps onto the shots in
63
+ * the same save, so extraction and linking are one transaction.
64
+ */
65
+ export function extractScriptFromScreenplay(screenplay, entities) {
66
+ const shots = [...screenplay.shots].sort((a, b) => a.index - b.index);
67
+ const lines = [];
68
+ const lineIdsByShotId = {};
69
+ const cast = [];
70
+ const castIds = new Set();
71
+ const addSpeaker = (speaker) => {
72
+ if (castIds.has(speaker.id)) {
73
+ return;
74
+ }
75
+ castIds.add(speaker.id);
76
+ cast.push(speaker);
77
+ };
78
+ for (const shot of shots) {
79
+ const shotLineIds = [];
80
+ const dialogue = nonEmpty(shot.dialogue);
81
+ if (dialogue) {
82
+ const entity = speakingEntity(shot, entities);
83
+ if (entity) {
84
+ addSpeaker(speakerForEntity(entity));
85
+ }
86
+ const id = dialogueLineId(shot.id);
87
+ lines.push(emptyLine(id, entity ? speakerIdForEntity(entity.id) : null, dialogue));
88
+ shotLineIds.push(id);
89
+ }
90
+ const narration = nonEmpty(shot.narration);
91
+ if (narration) {
92
+ addSpeaker({
93
+ id: NARRATOR_SPEAKER_ID,
94
+ name: NARRATOR_SPEAKER_NAME,
95
+ voice: null
96
+ });
97
+ const id = narrationLineId(shot.id);
98
+ lines.push(emptyLine(id, NARRATOR_SPEAKER_ID, narration));
99
+ shotLineIds.push(id);
100
+ }
101
+ if (shotLineIds.length > 0) {
102
+ lineIdsByShotId[shot.id] = shotLineIds;
103
+ }
104
+ }
105
+ const section = {
106
+ id: `section_${screenplay.id}`,
107
+ title: screenplay.title,
108
+ lines
109
+ };
110
+ return { document: { cast, sections: [section] }, lineIdsByShotId };
111
+ }
112
+ /** Every line of a script in reading order. */
113
+ export const linkedScriptLines = (script) => script.sections.flatMap((section) => section.lines);
114
+ /**
115
+ * Check a board against the script it links, per design §1.3. A missing script
116
+ * (deleted, or not loadable) is a warning — the board still works, only the
117
+ * link affordances go dead — while a reference that cannot be satisfied is an
118
+ * error naming the shot that carries it.
119
+ */
120
+ export function validateScriptLink(screenplay, scriptDoc) {
121
+ const errors = [];
122
+ const warnings = [];
123
+ const linked = !!nonEmpty(screenplay.script_id ?? undefined);
124
+ const knownLineIds = scriptDoc
125
+ ? new Set(linkedScriptLines(scriptDoc).map((line) => line.id))
126
+ : null;
127
+ const ownerByLineId = new Map();
128
+ for (const shot of screenplay.shots) {
129
+ const lineIds = shot.script_line_ids ?? [];
130
+ if (lineIds.length > 0 && !linked) {
131
+ errors.push({
132
+ severity: "error",
133
+ code: "unlinked_board_reference",
134
+ shotId: shot.id,
135
+ message: `Shot ${shot.id} references script lines, but the board has no \`script_id\`.`
136
+ });
137
+ }
138
+ for (const lineId of lineIds) {
139
+ const owner = ownerByLineId.get(lineId);
140
+ if (owner === undefined) {
141
+ ownerByLineId.set(lineId, shot.id);
142
+ }
143
+ else {
144
+ errors.push({
145
+ severity: "error",
146
+ code: "duplicate_line_reference",
147
+ shotId: shot.id,
148
+ lineId,
149
+ message: `Line ${lineId} is referenced by shot ${owner} and shot ${shot.id}; a line belongs to one shot.`
150
+ });
151
+ }
152
+ if (knownLineIds && !knownLineIds.has(lineId)) {
153
+ errors.push({
154
+ severity: "error",
155
+ code: "unknown_line_reference",
156
+ shotId: shot.id,
157
+ lineId,
158
+ message: `Shot ${shot.id} references line ${lineId}, which the linked script does not have.`
159
+ });
160
+ }
161
+ }
162
+ }
163
+ if (linked && !scriptDoc) {
164
+ warnings.push({
165
+ severity: "warning",
166
+ code: "missing_script",
167
+ message: `Linked script ${screenplay.script_id} was not found; the board keeps its text but link actions are unavailable.`
168
+ });
169
+ }
170
+ return { errors, warnings };
171
+ }
172
+ /**
173
+ * A line reads as narration when nothing casts it or its speaker is the
174
+ * narrator — the inverse of what {@link extractScriptFromScreenplay} writes, so
175
+ * a board extracted from a script and derived back projects the same fields.
176
+ */
177
+ function isNarrationLine(line, cast) {
178
+ if (!line.speakerId) {
179
+ return true;
180
+ }
181
+ if (line.speakerId === NARRATOR_SPEAKER_ID) {
182
+ return true;
183
+ }
184
+ const speaker = cast.find((entry) => entry.id === line.speakerId);
185
+ return speaker?.name.trim().toLowerCase() === NARRATOR_SPEAKER_NAME.toLowerCase();
186
+ }
187
+ /**
188
+ * Chunk a script's lines into shots: reading order, at most
189
+ * `maxLinesPerShot` per shot, never crossing a section boundary. Lines with no
190
+ * text are skipped — there is nothing for a shot to cover.
191
+ */
192
+ export function deriveShotScaffold(script, options = {}) {
193
+ const perShot = Math.max(1, Math.floor(options.maxLinesPerShot ?? 1));
194
+ const scaffolds = [];
195
+ for (const section of script.sections) {
196
+ const lines = section.lines.filter((line) => !!nonEmpty(line.text));
197
+ for (let start = 0; start < lines.length; start += perShot) {
198
+ const group = lines.slice(start, start + perShot);
199
+ const dialogue = group
200
+ .filter((line) => !isNarrationLine(line, script.cast))
201
+ .map((line) => line.text.trim());
202
+ const narration = group
203
+ .filter((line) => isNarrationLine(line, script.cast))
204
+ .map((line) => line.text.trim());
205
+ const scaffold = {
206
+ index: scaffolds.length,
207
+ script_line_ids: group.map((line) => line.id)
208
+ };
209
+ if (dialogue.length > 0) {
210
+ scaffold.dialogue = joinLineTexts(dialogue);
211
+ }
212
+ if (narration.length > 0) {
213
+ scaffold.narration = joinLineTexts(narration);
214
+ }
215
+ scaffolds.push(scaffold);
216
+ }
217
+ }
218
+ return scaffolds;
219
+ }
220
+ // ---------------------------------------------------------------------------
221
+ // Drift
222
+ // ---------------------------------------------------------------------------
223
+ /**
224
+ * Whether the linked lines now read differently from what was last projected
225
+ * into the shot. A line the map does not carry contributes nothing, so a
226
+ * deleted line drifts the shot it belonged to.
227
+ */
228
+ export function shotDialogueDrifted(shot, linesById) {
229
+ const lineIds = shot.script_line_ids ?? [];
230
+ if (lineIds.length === 0) {
231
+ return false;
232
+ }
233
+ const live = joinLineTexts(lineIds
234
+ .map((id) => linesById.get(id)?.text)
235
+ .filter((text) => text !== undefined));
236
+ return live !== (shot.script_text_snapshot ?? "");
237
+ }
238
+ /**
239
+ * Lines of the linked script that no shot covers, in reading order. Empty for
240
+ * an unlinked board: without a `script_id` there is nothing to be orphaned
241
+ * from.
242
+ */
243
+ export function orphanedLineIds(screenplay, scriptDoc) {
244
+ if (!nonEmpty(screenplay.script_id ?? undefined)) {
245
+ return [];
246
+ }
247
+ const covered = new Set(screenplay.shots.flatMap((shot) => shot.script_line_ids ?? []));
248
+ return linkedScriptLines(scriptDoc)
249
+ .map((line) => line.id)
250
+ .filter((id) => !covered.has(id));
251
+ }
252
+ //# sourceMappingURL=script-link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-link.js","sourceRoot":"","sources":["../src/script-link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,eAAe,EAA2C,MAAM,eAAe,CAAC;AAQzF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAEtD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAEhD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAe,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAa3E,MAAM,cAAc,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,QAAQ,MAAM,WAAW,CAAC;AAC7E,MAAM,eAAe,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,QAAQ,MAAM,YAAY,CAAC;AAE/E,MAAM,kBAAkB,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,WAAW,QAAQ,EAAE,CAAC;AAE/E,MAAM,QAAQ,GAAG,CAAC,KAAyB,EAAsB,EAAE;IACjE,MAAM,IAAI,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC3B,OAAO,IAAI,CAAC,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C,IAAU,EACV,SAAkC;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC;IAC3C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAG,aAAa,CACxB,OAAO;SACJ,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;SACpC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CACxD,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,UAAsB,EACtB,SAA6B;IAE7B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,IAAI,SAAS,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC,CAC/D,CAAC;IACF,OAAO,iBAAiB,CAAC,SAAS,CAAC;SAChC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;SACtB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @nodetool-ai/protocol – SHA-256
3
+ *
4
+ * A synchronous SHA-256 with no dependencies, because the callers that need it
5
+ * run in both places and cannot wait: `node:crypto` is absent in the browser
6
+ * bundle and `crypto.subtle.digest` is async, so a render record cannot hash
7
+ * its prompt inline while composing one. FIPS 180-4, ~40 lines of integer math.
8
+ */
9
+ /** Lowercase hex sha-256 of a UTF-8 string. Sync, no deps, browser + node. */
10
+ export declare function sha256Hex(text: string): string;
11
+ //# sourceMappingURL=sha256.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqDH,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA8D9C"}
package/dist/sha256.js ADDED
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @nodetool-ai/protocol – SHA-256
3
+ *
4
+ * A synchronous SHA-256 with no dependencies, because the callers that need it
5
+ * run in both places and cannot wait: `node:crypto` is absent in the browser
6
+ * bundle and `crypto.subtle.digest` is async, so a render record cannot hash
7
+ * its prompt inline while composing one. FIPS 180-4, ~40 lines of integer math.
8
+ */
9
+ /** Round constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes. */
10
+ const K = new Uint32Array([
11
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
12
+ 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
13
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
14
+ 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
15
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
16
+ 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
17
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
18
+ 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
19
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
20
+ 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
21
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
22
+ ]);
23
+ const rotr = (x, n) => (x >>> n) | (x << (32 - n));
24
+ /** UTF-8 bytes of `text`, without TextEncoder so the module has no host surface. */
25
+ function utf8Bytes(text) {
26
+ const out = [];
27
+ for (let i = 0; i < text.length; i++) {
28
+ let code = text.charCodeAt(i);
29
+ if (code >= 0xd800 && code <= 0xdbff && i + 1 < text.length) {
30
+ const low = text.charCodeAt(i + 1);
31
+ if (low >= 0xdc00 && low <= 0xdfff) {
32
+ code = 0x10000 + ((code - 0xd800) << 10) + (low - 0xdc00);
33
+ i++;
34
+ }
35
+ }
36
+ if (code < 0x80) {
37
+ out.push(code);
38
+ }
39
+ else if (code < 0x800) {
40
+ out.push(0xc0 | (code >> 6), 0x80 | (code & 0x3f));
41
+ }
42
+ else if (code < 0x10000) {
43
+ out.push(0xe0 | (code >> 12), 0x80 | ((code >> 6) & 0x3f), 0x80 | (code & 0x3f));
44
+ }
45
+ else {
46
+ out.push(0xf0 | (code >> 18), 0x80 | ((code >> 12) & 0x3f), 0x80 | ((code >> 6) & 0x3f), 0x80 | (code & 0x3f));
47
+ }
48
+ }
49
+ return Uint8Array.from(out);
50
+ }
51
+ /** Lowercase hex sha-256 of a UTF-8 string. Sync, no deps, browser + node. */
52
+ export function sha256Hex(text) {
53
+ const bytes = utf8Bytes(text);
54
+ const bitLength = bytes.length * 8;
55
+ // Message + 0x80 + zero padding to 56 mod 64, then the 64-bit length.
56
+ const padded = new Uint8Array(Math.ceil((bytes.length + 9) / 64) * 64);
57
+ padded.set(bytes);
58
+ padded[bytes.length] = 0x80;
59
+ // Lengths above 2^32 bits never occur here, so the high word is the carry
60
+ // of the float division rather than a BigInt.
61
+ const view = new DataView(padded.buffer);
62
+ view.setUint32(padded.length - 8, Math.floor(bitLength / 0x100000000));
63
+ view.setUint32(padded.length - 4, bitLength >>> 0);
64
+ const h = new Uint32Array([
65
+ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c,
66
+ 0x1f83d9ab, 0x5be0cd19
67
+ ]);
68
+ const w = new Uint32Array(64);
69
+ for (let offset = 0; offset < padded.length; offset += 64) {
70
+ for (let t = 0; t < 16; t++) {
71
+ w[t] = view.getUint32(offset + t * 4);
72
+ }
73
+ for (let t = 16; t < 64; t++) {
74
+ const s0 = rotr(w[t - 15], 7) ^ rotr(w[t - 15], 18) ^ (w[t - 15] >>> 3);
75
+ const s1 = rotr(w[t - 2], 17) ^ rotr(w[t - 2], 19) ^ (w[t - 2] >>> 10);
76
+ w[t] = (w[t - 16] + s0 + w[t - 7] + s1) >>> 0;
77
+ }
78
+ let [a, b, c, d, e, f, g, hh] = h;
79
+ for (let t = 0; t < 64; t++) {
80
+ const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
81
+ const ch = (e & f) ^ (~e & g);
82
+ const temp1 = (hh + S1 + ch + K[t] + w[t]) >>> 0;
83
+ const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
84
+ const maj = (a & b) ^ (a & c) ^ (b & c);
85
+ const temp2 = (S0 + maj) >>> 0;
86
+ hh = g;
87
+ g = f;
88
+ f = e;
89
+ e = (d + temp1) >>> 0;
90
+ d = c;
91
+ c = b;
92
+ b = a;
93
+ a = (temp1 + temp2) >>> 0;
94
+ }
95
+ h[0] = (h[0] + a) >>> 0;
96
+ h[1] = (h[1] + b) >>> 0;
97
+ h[2] = (h[2] + c) >>> 0;
98
+ h[3] = (h[3] + d) >>> 0;
99
+ h[4] = (h[4] + e) >>> 0;
100
+ h[5] = (h[5] + f) >>> 0;
101
+ h[6] = (h[6] + g) >>> 0;
102
+ h[7] = (h[7] + hh) >>> 0;
103
+ }
104
+ let hex = "";
105
+ for (let i = 0; i < 8; i++) {
106
+ hex += h[i].toString(16).padStart(8, "0");
107
+ }
108
+ return hex;
109
+ }
110
+ //# sourceMappingURL=sha256.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../src/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uGAAuG;AACvG,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC;IACxB,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;CAC/C,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAA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 *
4
+ * One pure module so the editor (`useGenerateShot`) and the headless render
5
+ * capabilities (`render_storyboard_stills`, `render_storyboard_clips`) send the
6
+ * same words to the same model. A prompt that differs between the two surfaces
7
+ * makes a board impossible to reason about: the same shot would come back
8
+ * looking different depending on who pressed render.
9
+ *
10
+ * The field → mode mapping is the contract (PRD § 7.7.5):
11
+ *
12
+ * | Field | Still | Clip (keyframe) | Clip (direct) |
13
+ * | ------------------ | ---------------- | --------------- | --------------- |
14
+ * | `action` | yes | yes | yes |
15
+ * | `camera.framing` | `<framing> shot` | — | `<framing> shot`|
16
+ * | `camera.angle` | yes | — | yes |
17
+ * | `camera.lens` | `<lens> lens` | — | `<lens> lens` |
18
+ * | scene `lighting` | yes | — | yes |
19
+ * | `motion` | — | yes | yes |
20
+ * | `camera.movement` | — | yes | yes |
21
+ * | `camera.equipment` | — | yes | yes |
22
+ * | board `style` | yes | — | yes |
23
+ *
24
+ * A keyframe-mode clip animates a still that already carries framing, lens,
25
+ * lighting and style, so repeating them in the video prompt only fights the
26
+ * first-frame conditioning. A direct clip has no still, so it carries
27
+ * everything. A reference clip has no still either — its entity images
28
+ * condition the render, not a first frame — so it composes like a direct one.
29
+ *
30
+ * {@link clipPromptFor} is the one place that mapping lives: every render
31
+ * surface and the staleness record call it rather than branching on the mode
32
+ * themselves, because a surface that branched differently would render one
33
+ * prompt and hash another.
34
+ *
35
+ * `dialogue`, `notes` and `duration_seconds` never enter a prompt: the first
36
+ * two are words for people, the third is a render parameter.
37
+ *
38
+ * Entity seasoning is not here — the two surfaces pass entities differently
39
+ * (the editor appends `entity://` tokens for the server to expand, the
40
+ * capabilities send a structured `entities` param), and both start from
41
+ * `entitiesForShot`.
42
+ */
43
+ import { shotRenderMode } from "./creative.js";
44
+ import type { Scene, Shot } from "./creative.js";
45
+ /** What a prompt needs beyond the shot itself. */
46
+ export interface ShotPromptContext {
47
+ /** The shot's scene, when it has one. Supplies `lighting`. */
48
+ scene?: Scene | null;
49
+ /** The board's style descriptor, applied to every shot. */
50
+ style?: string;
51
+ }
52
+ /**
53
+ * The scene a shot belongs to, or null when it has none (legacy shots) or the
54
+ * scene has been dropped. Both render surfaces need it to reach `lighting`.
55
+ */
56
+ export declare function sceneForShot(shot: Shot, scenes?: readonly Scene[] | null): Scene | null;
57
+ /** Still prompt: what is in frame, how it is shot, how it is lit, the look. */
58
+ export declare function keyframePrompt(shot: Shot, context?: ShotPromptContext): string;
59
+ /**
60
+ * Keyframe-mode clip prompt: what moves, what is in frame, and how the camera
61
+ * moves. Framing, lighting and style come from the still being animated, so
62
+ * they are deliberately absent — this takes no context.
63
+ */
64
+ export declare function clipPrompt(shot: Shot): string;
65
+ /**
66
+ * Direct-mode clip prompt: no still carries the look into the render, so the
67
+ * prompt carries all of it — the still's fields plus the motion ones.
68
+ */
69
+ export declare function directClipPrompt(shot: Shot, context?: ShotPromptContext): string;
70
+ /**
71
+ * The clip prompt for a shot in `mode` — `directClipPrompt` for a mode with no
72
+ * still to condition on (`direct`, `reference`), `clipPrompt` for `keyframe`.
73
+ *
74
+ * Pass `mode` when a call overrides the shot's own; omit it to read
75
+ * `shot.render_mode`.
76
+ */
77
+ export declare function clipPromptFor(shot: Shot, context?: ShotPromptContext, mode?: ReturnType<typeof shotRenderMode>): string;
78
+ //# sourceMappingURL=shot-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shot-prompt.d.ts","sourceRoot":"","sources":["../src/shot-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEjD,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,MAAM,CAAC,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI,GAC/B,KAAK,GAAG,IAAI,CAKd;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAUR;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAQ7C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAaR;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,iBAAsB,EAC/B,IAAI,GAAE,UAAU,CAAC,OAAO,cAAc,CAAwB,GAC7D,MAAM,CAIR"}