@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,197 @@
1
+ /**
2
+ * The Workflow flow's planner contract and its plan→graph builder (PRD § 11).
3
+ *
4
+ * Three pure pieces, shared by the browser flow and the headless capabilities so
5
+ * a plan means the same thing on both:
6
+ *
7
+ * - the structured-output contract the planner asks a model for
8
+ * ({@link buildWorkflowPlanSchema}, {@link parseWorkflowPlan});
9
+ * - {@link resolveWorkflowPlan}, which turns a plan into the review step's
10
+ * markers — a step whose node type the registry does not know, a step whose
11
+ * model role has no configured provider (D23);
12
+ * - {@link planToPlacement}, which turns a resolved plan into the ordered node
13
+ * and edge list the build replays through `ui_add_node` / `ui_connect_nodes`
14
+ * / `ui_update_node_data`.
15
+ *
16
+ * Nothing here places a node, calls a provider or touches a store, which is
17
+ * what makes criterion 3 assertable: planning is text, and the build is a
18
+ * separate step the creator has to press (D4).
19
+ *
20
+ * R6 lives in the last piece. A plan whose steps name real node types can still
21
+ * build a graph that validates and produces nothing, so `planToPlacement`
22
+ * reports every step it could not wire in {@link WorkflowPlacement.issues}
23
+ * rather than emitting a plausible-looking island — and the harness grades the
24
+ * run's output, not the validation.
25
+ */
26
+ import { type WorkflowPlanStep, type WorkflowSetupPlan } from "./api-schemas/workflows.js";
27
+ export declare const WORKFLOW_PLAN_TOOL_NAME = "workflow_plan";
28
+ export declare const WORKFLOW_PLAN_TOOL_DESCRIPTION = "The steps a NodeTool workflow needs to do the task, each mapped to a node type that exists in the registry.";
29
+ export declare const WORKFLOW_PLANNER_SYSTEM_PROMPT: string;
30
+ /** The structured-output schema the planner asks for. */
31
+ export declare function buildWorkflowPlanSchema(): Record<string, unknown>;
32
+ /**
33
+ * Read a planner answer into a plan, filling in the step ids the model is not
34
+ * asked for. Returns null when the answer is not a plan shape at all, so the
35
+ * caller reports a refused run rather than opening an empty review.
36
+ */
37
+ export declare function parseWorkflowPlan(data: unknown, options?: {
38
+ generateId?: (index: number) => string;
39
+ }): WorkflowSetupPlan | null;
40
+ /** Why a step blocks `Continue to setup`, or null when it does not. */
41
+ export type WorkflowStepBlock = "unknown-node-type" | "missing-provider";
42
+ export interface ResolvedWorkflowStep {
43
+ step: WorkflowPlanStep;
44
+ /** Red marker: the plan named a node type the registry does not have. */
45
+ unknownNodeType: boolean;
46
+ /**
47
+ * Amber marker: the step needs a model role no configured provider covers.
48
+ * Carries the role so the `Connect` button can name it.
49
+ */
50
+ missingProvider: string | null;
51
+ block: WorkflowStepBlock | null;
52
+ }
53
+ export interface ResolvedWorkflowPlan {
54
+ steps: ResolvedWorkflowStep[];
55
+ /** Distinct model roles the plan needs, in first-use order. */
56
+ roles: string[];
57
+ /** Roles with no configured provider behind them. */
58
+ missingRoles: string[];
59
+ /** False while any step is unknown or any needed provider is missing. */
60
+ canContinue: boolean;
61
+ }
62
+ export interface ResolveWorkflowPlanOptions {
63
+ /** True when the live registry has this node type. */
64
+ knownNodeType: (nodeType: string) => boolean;
65
+ /** True when a configured provider covers this model role. */
66
+ providerConfigured: (role: string) => boolean;
67
+ }
68
+ /**
69
+ * Grade every step of a plan against the live registry and the configured
70
+ * providers. One pass over the steps with a role cache, so a fifty-step plan
71
+ * costs one lookup per step and one per distinct role — never a scan per step.
72
+ */
73
+ export declare function resolveWorkflowPlan(plan: WorkflowSetupPlan, options: ResolveWorkflowPlanOptions): ResolvedWorkflowPlan;
74
+ /** One handle of a node type, as the registry describes it. */
75
+ export interface PlanNodeHandle {
76
+ name: string;
77
+ /** The handle's type name, e.g. "str", "image", "any". */
78
+ type: string;
79
+ required?: boolean;
80
+ }
81
+ /** What the builder needs to know about a node type to wire it. */
82
+ export interface PlanNodeShape {
83
+ /**
84
+ * The node's input properties, in the order the builder should try them.
85
+ * `planNodeShape` puts the node's declared input handles first: a Summarizer
86
+ * has `text` and `system_prompt`, and a chain that lands on the prompt looks
87
+ * wired and summarizes nothing.
88
+ */
89
+ inputs: readonly PlanNodeHandle[];
90
+ outputs: readonly PlanNodeHandle[];
91
+ /** The node takes named dynamic inputs (Concat, Template, Code). */
92
+ supportsDynamicInputs?: boolean;
93
+ }
94
+ /** Registry lookup. Returns null for a type the registry does not have. */
95
+ export type PlanNodeLookup = (nodeType: string) => PlanNodeShape | null;
96
+ /** One node the build places, in the order it places them. */
97
+ export interface PlacementNode {
98
+ id: string;
99
+ type: string;
100
+ position: {
101
+ x: number;
102
+ y: number;
103
+ };
104
+ properties: Record<string, unknown>;
105
+ /** Dynamic slots to declare before an edge can land on them. */
106
+ dynamicProperties?: Record<string, unknown>;
107
+ /** The plan step this node came from (PRD § 11.5). Absent on I/O nodes. */
108
+ setupStepId?: string;
109
+ }
110
+ export interface PlacementEdge {
111
+ source: string;
112
+ sourceHandle: string;
113
+ target: string;
114
+ targetHandle: string;
115
+ }
116
+ export interface WorkflowPlacement {
117
+ nodes: PlacementNode[];
118
+ edges: PlacementEdge[];
119
+ /**
120
+ * What the builder could not do: a step with no node type, a node type the
121
+ * registry lacks, a step with nowhere to take its input, an output with
122
+ * nothing upstream. A placement with issues is a graph that may still
123
+ * validate and still produce nothing — R6 — so the build reports them
124
+ * instead of shipping a green-looking island.
125
+ */
126
+ issues: string[];
127
+ }
128
+ export declare const PLAN_OUTPUT_NODE_TYPE = "nodetool.output.Output";
129
+ /** Handle types a chain must never land on — a model is chosen, not wired. */
130
+ export declare const MODEL_HANDLE_TYPES: Readonly<Record<string, string>>;
131
+ /**
132
+ * Turn a plan into the nodes and edges that make it run.
133
+ *
134
+ * The shape is a chain: one input node per plan input, the steps in plan order
135
+ * each fed by the one before it, one output node per plan output fed by the
136
+ * last step. Inputs after the first land on the first step's remaining free
137
+ * handles, in order.
138
+ *
139
+ * Every handle choice is made from a per-node cursor, so the walk is linear in
140
+ * the number of steps times the handles of one node — never a scan of the
141
+ * edges inside the node loop.
142
+ */
143
+ export interface PlanToPlacementOptions {
144
+ /**
145
+ * The model each role runs on, as chosen on the setup step (PRD § 11.3),
146
+ * keyed by role. A step whose role has no entry is placed with its model
147
+ * property unset, which the static check then reports.
148
+ */
149
+ models?: Readonly<Record<string, unknown>>;
150
+ }
151
+ export declare function planToPlacement(plan: WorkflowSetupPlan, lookup: PlanNodeLookup, options?: PlanToPlacementOptions): WorkflowPlacement;
152
+ /**
153
+ * The subset of a node's registry metadata the builder reads. Structural on
154
+ * purpose: `NodeMetadata` in `node-sdk` and the one the browser's metadata
155
+ * store holds are the same shape, and this module depends on neither.
156
+ */
157
+ export interface PlanNodeMetadataLike {
158
+ properties?: readonly {
159
+ name: string;
160
+ type?: {
161
+ type?: string;
162
+ } | null;
163
+ required?: boolean;
164
+ }[];
165
+ outputs?: readonly {
166
+ name: string;
167
+ type?: {
168
+ type?: string;
169
+ } | null;
170
+ }[];
171
+ /** The node's primary content field, shown on its body. */
172
+ inline_fields?: readonly string[];
173
+ /** Property names the node declares as its input handles. */
174
+ input_fields?: readonly string[];
175
+ supports_dynamic_inputs?: boolean;
176
+ }
177
+ /** Read one node's metadata into the shape {@link planToPlacement} wires from. */
178
+ export declare function planNodeShape(meta: PlanNodeMetadataLike): PlanNodeShape;
179
+ /**
180
+ * The three starting points step 1 offers, each with the plan a creator gets by
181
+ * pressing it.
182
+ *
183
+ * The plans are pinned rather than generated so criterion 5 is assertable: the
184
+ * harness builds each one against the live registry and checks the graph, and a
185
+ * chip whose plan stops naming real node types fails there instead of in front
186
+ * of a creator. Pressing a chip in the browser still re-plans from the brief
187
+ * when a provider is configured — the pinned plan is what it falls back to, and
188
+ * what the harness grades.
189
+ */
190
+ export interface WorkflowInspirationChip {
191
+ id: string;
192
+ /** The chip's label, which is also the brief it writes. */
193
+ brief: string;
194
+ plan: WorkflowSetupPlan;
195
+ }
196
+ export declare const WORKFLOW_INSPIRATION_CHIPS: readonly WorkflowInspirationChip[];
197
+ //# sourceMappingURL=workflow-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-plan.d.ts","sourceRoot":"","sources":["../src/workflow-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AAIpC,eAAO,MAAM,uBAAuB,kBAAkB,CAAC;AAEvD,eAAO,MAAM,8BAA8B,gHACoE,CAAC;AAEhH,eAAO,MAAM,8BAA8B,QAa/B,CAAC;AAEb,yDAAyD;AACzD,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqDjE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAAO,GACvD,iBAAiB,GAAG,IAAI,CAkB1B;AAID,uEAAuE;AACvE,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAEzE,MAAM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AAG,IAAI,CAAC;QAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,EAAE,CAAC;IACJ,OAAO,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IACvE,2DAA2D;IAC3D,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,aAAa,CAwBvE;AAID;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,eAAO,MAAM,0BAA0B,EAAE,SAAS,uBAAuB,EAqExE,CAAC"}
@@ -0,0 +1,438 @@
1
+ /**
2
+ * The Workflow flow's planner contract and its plan→graph builder (PRD § 11).
3
+ *
4
+ * Three pure pieces, shared by the browser flow and the headless capabilities so
5
+ * a plan means the same thing on both:
6
+ *
7
+ * - the structured-output contract the planner asks a model for
8
+ * ({@link buildWorkflowPlanSchema}, {@link parseWorkflowPlan});
9
+ * - {@link resolveWorkflowPlan}, which turns a plan into the review step's
10
+ * markers — a step whose node type the registry does not know, a step whose
11
+ * model role has no configured provider (D23);
12
+ * - {@link planToPlacement}, which turns a resolved plan into the ordered node
13
+ * and edge list the build replays through `ui_add_node` / `ui_connect_nodes`
14
+ * / `ui_update_node_data`.
15
+ *
16
+ * Nothing here places a node, calls a provider or touches a store, which is
17
+ * what makes criterion 3 assertable: planning is text, and the build is a
18
+ * separate step the creator has to press (D4).
19
+ *
20
+ * R6 lives in the last piece. A plan whose steps name real node types can still
21
+ * build a graph that validates and produces nothing, so `planToPlacement`
22
+ * reports every step it could not wire in {@link WorkflowPlacement.issues}
23
+ * rather than emitting a plausible-looking island — and the harness grades the
24
+ * run's output, not the validation.
25
+ */
26
+ import { isRecord, isString } from "./predicates.js";
27
+ import { workflowSetupPlan } from "./api-schemas/workflows.js";
28
+ // ── The planner's contract ──────────────────────────────────────────────────
29
+ export const WORKFLOW_PLAN_TOOL_NAME = "workflow_plan";
30
+ export const WORKFLOW_PLAN_TOOL_DESCRIPTION = "The steps a NodeTool workflow needs to do the task, each mapped to a node type that exists in the registry.";
31
+ export const WORKFLOW_PLANNER_SYSTEM_PROMPT = [
32
+ "You plan NodeTool workflows. You do not build them.",
33
+ "",
34
+ "Return the inputs the workflow takes, the steps it runs in order, and the",
35
+ "outputs it produces. Every step names one node type from the candidate list",
36
+ "you are given, copied exactly. When no candidate fits a step, set its",
37
+ "node_type to null and say what the step needs in its summary — a named guess",
38
+ "that turns out to be the wrong node builds a graph that runs and produces",
39
+ "nothing, which is worse than an unnamed step.",
40
+ "",
41
+ "Set model_role only on a step that calls a model: language, image, video or",
42
+ "audio. Keep the plan to the steps the task actually needs.",
43
+ "Give each input a sample value the creator can run the workflow with."
44
+ ].join("\n");
45
+ /** The structured-output schema the planner asks for. */
46
+ export function buildWorkflowPlanSchema() {
47
+ return {
48
+ type: "object",
49
+ additionalProperties: false,
50
+ required: ["inputs", "steps", "outputs"],
51
+ properties: {
52
+ inputs: {
53
+ type: "array",
54
+ items: {
55
+ type: "object",
56
+ additionalProperties: false,
57
+ required: ["name", "type"],
58
+ properties: {
59
+ name: { type: "string" },
60
+ type: {
61
+ type: "string",
62
+ enum: ["string", "image", "audio", "video", "document", "number"]
63
+ },
64
+ sample: { type: "string" }
65
+ }
66
+ }
67
+ },
68
+ steps: {
69
+ type: "array",
70
+ items: {
71
+ type: "object",
72
+ additionalProperties: false,
73
+ required: ["title", "summary", "node_type"],
74
+ properties: {
75
+ title: { type: "string" },
76
+ summary: { type: "string" },
77
+ node_type: { type: ["string", "null"] },
78
+ model_role: {
79
+ type: "string",
80
+ enum: ["language", "image", "video", "audio"]
81
+ }
82
+ }
83
+ }
84
+ },
85
+ outputs: {
86
+ type: "array",
87
+ items: {
88
+ type: "object",
89
+ additionalProperties: false,
90
+ required: ["name", "type"],
91
+ properties: {
92
+ name: { type: "string" },
93
+ type: { type: "string" }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ };
99
+ }
100
+ /**
101
+ * Read a planner answer into a plan, filling in the step ids the model is not
102
+ * asked for. Returns null when the answer is not a plan shape at all, so the
103
+ * caller reports a refused run rather than opening an empty review.
104
+ */
105
+ export function parseWorkflowPlan(data, options = {}) {
106
+ if (!isRecord(data)) {
107
+ return null;
108
+ }
109
+ const generateId = options.generateId ?? ((index) => `step-${index + 1}`);
110
+ const steps = Array.isArray(data["steps"]) ? data["steps"] : [];
111
+ const withIds = steps.map((step, index) => {
112
+ const base = isRecord(step) ? step : {};
113
+ return {
114
+ ...base,
115
+ id: isString(base["id"]) && base["id"].length > 0
116
+ ? base["id"]
117
+ : generateId(index),
118
+ node_type: isString(base["node_type"]) ? base["node_type"] : null
119
+ };
120
+ });
121
+ const parsed = workflowSetupPlan.safeParse({ ...data, steps: withIds });
122
+ return parsed.success ? parsed.data : null;
123
+ }
124
+ /**
125
+ * Grade every step of a plan against the live registry and the configured
126
+ * providers. One pass over the steps with a role cache, so a fifty-step plan
127
+ * costs one lookup per step and one per distinct role — never a scan per step.
128
+ */
129
+ export function resolveWorkflowPlan(plan, options) {
130
+ const roleConfigured = new Map();
131
+ const roles = [];
132
+ const steps = plan.steps.map((step) => {
133
+ const unknownNodeType = step.node_type === null || !options.knownNodeType(step.node_type);
134
+ const role = step.model_role;
135
+ let missingProvider = null;
136
+ if (isString(role) && role.length > 0) {
137
+ let configured = roleConfigured.get(role);
138
+ if (configured === undefined) {
139
+ configured = options.providerConfigured(role);
140
+ roleConfigured.set(role, configured);
141
+ roles.push(role);
142
+ }
143
+ missingProvider = configured ? null : role;
144
+ }
145
+ const block = unknownNodeType
146
+ ? "unknown-node-type"
147
+ : missingProvider !== null
148
+ ? "missing-provider"
149
+ : null;
150
+ return { step, unknownNodeType, missingProvider, block };
151
+ });
152
+ const missingRoles = roles.filter((role) => roleConfigured.get(role) === false);
153
+ return {
154
+ steps,
155
+ roles,
156
+ missingRoles,
157
+ canContinue: steps.every((entry) => entry.block === null)
158
+ };
159
+ }
160
+ /** Plan input type → the input node that carries it. */
161
+ const INPUT_NODE_TYPES = {
162
+ string: "nodetool.input.StringInput",
163
+ number: "nodetool.input.FloatInput",
164
+ integer: "nodetool.input.IntegerInput",
165
+ boolean: "nodetool.input.BooleanInput",
166
+ image: "nodetool.input.ImageInput",
167
+ audio: "nodetool.input.AudioInput",
168
+ video: "nodetool.input.VideoInput",
169
+ document: "nodetool.input.DocumentInput"
170
+ };
171
+ export const PLAN_OUTPUT_NODE_TYPE = "nodetool.output.Output";
172
+ /** Handle types that take anything — a chain can always land on one. */
173
+ const WILDCARD_TYPES = new Set(["any", "union", "object"]);
174
+ /** Handle types a chain must never land on — a model is chosen, not wired. */
175
+ export const MODEL_HANDLE_TYPES = {
176
+ language: "language_model",
177
+ image: "image_model",
178
+ video: "video_model",
179
+ audio: "tts_model"
180
+ };
181
+ const MODEL_TYPES = new Set([
182
+ ...Object.values(MODEL_HANDLE_TYPES),
183
+ "asr_model",
184
+ "embedding_model"
185
+ ]);
186
+ const acceptsType = (target, source) => WILDCARD_TYPES.has(target) || WILDCARD_TYPES.has(source) || target === source;
187
+ /** The dynamic slot name the builder declares when a node has no free handle. */
188
+ const DYNAMIC_SLOT = "input";
189
+ /** Layout only: a readable left-to-right chain on the canvas. */
190
+ const COLUMN_WIDTH = 260;
191
+ const ROW_HEIGHT = 170;
192
+ const position = (column, row) => ({
193
+ x: 80 + column * COLUMN_WIDTH,
194
+ y: 80 + row * ROW_HEIGHT
195
+ });
196
+ export function planToPlacement(plan, lookup, options = {}) {
197
+ const nodes = [];
198
+ const edges = [];
199
+ const issues = [];
200
+ // 1. Inputs.
201
+ const inputs = [];
202
+ plan.inputs.forEach((input, index) => {
203
+ const nodeType = INPUT_NODE_TYPES[input.type] ?? INPUT_NODE_TYPES["string"];
204
+ const id = `input_${index + 1}`;
205
+ const properties = { name: input.name };
206
+ if (input.sample !== undefined) {
207
+ properties["value"] = input.sample;
208
+ }
209
+ nodes.push({ id, type: nodeType, position: position(0, index), properties });
210
+ const shape = lookup(nodeType);
211
+ const handle = shape?.outputs[0]?.name ?? "output";
212
+ inputs.push({ nodeId: id, handle, type: shape?.outputs[0]?.type ?? "any" });
213
+ });
214
+ // 2. Steps, chained.
215
+ let upstream = inputs[0] ?? null;
216
+ // Inputs the chain has not consumed yet, oldest first.
217
+ let spareInput = 1;
218
+ let lastStep = null;
219
+ plan.steps.forEach((step, index) => {
220
+ const label = `step ${index + 1} ("${step.title}")`;
221
+ if (step.node_type === null) {
222
+ issues.push(`${label} names no node type, so nothing was placed for it.`);
223
+ return;
224
+ }
225
+ const shape = lookup(step.node_type);
226
+ if (!shape) {
227
+ issues.push(`${label} names "${step.node_type}", which the registry does not have.`);
228
+ return;
229
+ }
230
+ const id = `step_${index + 1}`;
231
+ const node = {
232
+ id,
233
+ type: step.node_type,
234
+ position: position(index + 1, 0),
235
+ properties: {},
236
+ setupStepId: step.id
237
+ };
238
+ // The model a step calls is assigned, never wired: a chain that landed on
239
+ // a model property would build a graph that validates and never runs.
240
+ const role = step.model_role;
241
+ if (isString(role) && role.length > 0) {
242
+ const wanted = MODEL_HANDLE_TYPES[role];
243
+ const slot = shape.inputs.find((handle) => handle.type === wanted);
244
+ const chosen = options.models?.[role];
245
+ if (slot && chosen !== undefined) {
246
+ node.properties[slot.name] = chosen;
247
+ }
248
+ else if (slot) {
249
+ issues.push(`${label} needs a ${role} model and none was chosen, so its "${slot.name}" is unset.`);
250
+ }
251
+ }
252
+ // Free handles of this node, consumed left to right.
253
+ const free = shape.inputs.filter((handle) => !MODEL_TYPES.has(handle.type));
254
+ let cursor = 0;
255
+ const takeHandle = (sourceType) => {
256
+ while (cursor < free.length) {
257
+ const candidate = free[cursor];
258
+ cursor += 1;
259
+ if (acceptsType(candidate.type, sourceType)) {
260
+ return candidate.name;
261
+ }
262
+ }
263
+ if (shape.supportsDynamicInputs === true) {
264
+ // A dynamic node has no declared handle to land on; the slot has to be
265
+ // declared before the edge, which is what the build's
266
+ // `ui_update_node_data` call in plan order is for.
267
+ const slot = `${DYNAMIC_SLOT}_${Object.keys(node.dynamicProperties ?? {}).length + 1}`;
268
+ node.dynamicProperties = { ...(node.dynamicProperties ?? {}), [slot]: "" };
269
+ return slot;
270
+ }
271
+ return null;
272
+ };
273
+ if (upstream === null) {
274
+ issues.push(`${label} has no input: the plan declares none.`);
275
+ }
276
+ else {
277
+ const handle = takeHandle(upstream.type);
278
+ if (handle === null) {
279
+ issues.push(`${label} maps to "${step.node_type}", which has no input that takes ${upstream.type}.`);
280
+ }
281
+ else {
282
+ edges.push({
283
+ source: upstream.nodeId,
284
+ sourceHandle: upstream.handle,
285
+ target: id,
286
+ targetHandle: handle
287
+ });
288
+ }
289
+ }
290
+ // Extra plan inputs feed the first step that has room for them.
291
+ while (spareInput < inputs.length) {
292
+ const extra = inputs[spareInput];
293
+ const handle = takeHandle(extra.type);
294
+ if (handle === null) {
295
+ break;
296
+ }
297
+ edges.push({
298
+ source: extra.nodeId,
299
+ sourceHandle: extra.handle,
300
+ target: id,
301
+ targetHandle: handle
302
+ });
303
+ spareInput += 1;
304
+ }
305
+ nodes.push(node);
306
+ const out = shape.outputs[0];
307
+ if (!out) {
308
+ issues.push(`${label} maps to "${step.node_type}", which produces no output.`);
309
+ upstream = null;
310
+ }
311
+ else {
312
+ upstream = { nodeId: id, handle: out.name, type: out.type };
313
+ lastStep = upstream;
314
+ }
315
+ });
316
+ if (spareInput < inputs.length) {
317
+ issues.push(`${inputs.length - spareInput} plan input(s) reached no step and were left unconnected.`);
318
+ }
319
+ // 3. Outputs.
320
+ plan.outputs.forEach((output, index) => {
321
+ const id = `output_${index + 1}`;
322
+ nodes.push({
323
+ id,
324
+ type: PLAN_OUTPUT_NODE_TYPE,
325
+ position: position(plan.steps.length + 1, index),
326
+ properties: { name: output.name }
327
+ });
328
+ const source = lastStep;
329
+ if (source === null) {
330
+ issues.push(`output "${output.name}" has no step upstream, so the workflow produces nothing.`);
331
+ return;
332
+ }
333
+ edges.push({
334
+ source: source.nodeId,
335
+ sourceHandle: source.handle,
336
+ target: id,
337
+ targetHandle: "value"
338
+ });
339
+ });
340
+ if (plan.outputs.length === 0) {
341
+ issues.push("the plan declares no output, so a run produces nothing.");
342
+ }
343
+ return { nodes, edges, issues };
344
+ }
345
+ /** Read one node's metadata into the shape {@link planToPlacement} wires from. */
346
+ export function planNodeShape(meta) {
347
+ // The node author's own statement of what each property is for: the content
348
+ // field first, then the declared input handles, then whatever is left in
349
+ // declaration order. Without it a chain lands on a Summarizer's
350
+ // `system_prompt` — wired, validating, and summarizing nothing.
351
+ const ranked = [...(meta.inline_fields ?? []), ...(meta.input_fields ?? [])];
352
+ const rank = new Map(ranked.map((name, index) => [name, index]));
353
+ const properties = [...(meta.properties ?? [])].sort((a, b) => (rank.get(a.name) ?? Number.MAX_SAFE_INTEGER) -
354
+ (rank.get(b.name) ?? Number.MAX_SAFE_INTEGER));
355
+ return {
356
+ inputs: properties.map((property) => ({
357
+ name: property.name,
358
+ type: property.type?.type ?? "any",
359
+ required: property.required === true
360
+ })),
361
+ outputs: (meta.outputs ?? []).map((output) => ({
362
+ name: output.name,
363
+ type: output.type?.type ?? "any"
364
+ })),
365
+ supportsDynamicInputs: meta.supports_dynamic_inputs === true
366
+ };
367
+ }
368
+ export const WORKFLOW_INSPIRATION_CHIPS = [
369
+ {
370
+ id: "summarize-pdf",
371
+ brief: "Summarize a PDF and email it",
372
+ plan: {
373
+ inputs: [{ name: "document", type: "document" }],
374
+ steps: [
375
+ {
376
+ id: "extract",
377
+ title: "Read the PDF",
378
+ summary: "Pull the text out of the uploaded document.",
379
+ node_type: "lib.pdf.ExtractText"
380
+ },
381
+ {
382
+ id: "summarize",
383
+ title: "Summarize it",
384
+ summary: "Write a short summary of the extracted text.",
385
+ node_type: "nodetool.agents.Summarizer",
386
+ model_role: "language"
387
+ }
388
+ ],
389
+ outputs: [{ name: "summary", type: "string" }]
390
+ }
391
+ },
392
+ {
393
+ id: "product-shots",
394
+ brief: "Batch-generate product shots from a CSV",
395
+ plan: {
396
+ inputs: [{ name: "rows", type: "string" }],
397
+ steps: [
398
+ {
399
+ id: "prompt",
400
+ title: "Compose the shot prompt",
401
+ summary: "Turn each row into the prompt one shot is rendered from.",
402
+ node_type: "nodetool.text.Template"
403
+ },
404
+ {
405
+ id: "render",
406
+ title: "Render the shot",
407
+ summary: "Generate the product image for the row.",
408
+ node_type: "nodetool.fake.GenerateImage",
409
+ model_role: "image"
410
+ }
411
+ ],
412
+ outputs: [{ name: "shot", type: "image" }]
413
+ }
414
+ },
415
+ {
416
+ id: "url-to-post",
417
+ brief: "Turn a YouTube URL into a blog post",
418
+ plan: {
419
+ inputs: [{ name: "url", type: "string" }],
420
+ steps: [
421
+ {
422
+ id: "download",
423
+ title: "Download the video",
424
+ summary: "Fetch the video behind the URL.",
425
+ node_type: "lib.video.download.YtDlpDownload"
426
+ },
427
+ {
428
+ id: "audio",
429
+ title: "Take the audio",
430
+ summary: "Split the audio track off the video.",
431
+ node_type: "nodetool.video.ExtractAudio"
432
+ }
433
+ ],
434
+ outputs: [{ name: "audio", type: "audio" }]
435
+ }
436
+ }
437
+ ];
438
+ //# sourceMappingURL=workflow-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-plan.js","sourceRoot":"","sources":["../src/workflow-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL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