@nodetool-ai/base-nodes 0.7.0-rc.23 → 0.8.2

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 (367) hide show
  1. package/README.md +21 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/builtin-packs.d.ts +17 -0
  4. package/dist/builtin-packs.d.ts.map +1 -0
  5. package/dist/builtin-packs.js +95 -0
  6. package/dist/builtin-packs.js.map +1 -0
  7. package/dist/index.d.ts +63 -67
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +186 -173
  10. package/dist/index.js.map +1 -1
  11. package/dist/platforms/browser.d.ts +19 -0
  12. package/dist/platforms/browser.d.ts.map +1 -0
  13. package/dist/platforms/browser.js +29 -0
  14. package/dist/platforms/browser.js.map +1 -0
  15. package/package.json +72 -65
  16. package/dist/lib/audio-wav.d.ts +0 -66
  17. package/dist/lib/audio-wav.d.ts.map +0 -1
  18. package/dist/lib/audio-wav.js +0 -215
  19. package/dist/lib/audio-wav.js.map +0 -1
  20. package/dist/nodes/agent-tool-hydration.d.ts +0 -10
  21. package/dist/nodes/agent-tool-hydration.d.ts.map +0 -1
  22. package/dist/nodes/agent-tool-hydration.js +0 -43
  23. package/dist/nodes/agent-tool-hydration.js.map +0 -1
  24. package/dist/nodes/agents.d.ts +0 -262
  25. package/dist/nodes/agents.d.ts.map +0 -1
  26. package/dist/nodes/agents.js +0 -2856
  27. package/dist/nodes/agents.js.map +0 -1
  28. package/dist/nodes/anthropic.d.ts +0 -26
  29. package/dist/nodes/anthropic.d.ts.map +0 -1
  30. package/dist/nodes/anthropic.js +0 -133
  31. package/dist/nodes/anthropic.js.map +0 -1
  32. package/dist/nodes/apify.d.ts +0 -120
  33. package/dist/nodes/apify.d.ts.map +0 -1
  34. package/dist/nodes/apify.js +0 -618
  35. package/dist/nodes/apify.js.map +0 -1
  36. package/dist/nodes/audio.d.ts +0 -301
  37. package/dist/nodes/audio.d.ts.map +0 -1
  38. package/dist/nodes/audio.js +0 -1274
  39. package/dist/nodes/audio.js.map +0 -1
  40. package/dist/nodes/code-node.d.ts +0 -34
  41. package/dist/nodes/code-node.d.ts.map +0 -1
  42. package/dist/nodes/code-node.js +0 -343
  43. package/dist/nodes/code-node.js.map +0 -1
  44. package/dist/nodes/code.d.ts +0 -301
  45. package/dist/nodes/code.d.ts.map +0 -1
  46. package/dist/nodes/code.js +0 -850
  47. package/dist/nodes/code.js.map +0 -1
  48. package/dist/nodes/compare.d.ts +0 -18
  49. package/dist/nodes/compare.d.ts.map +0 -1
  50. package/dist/nodes/compare.js +0 -122
  51. package/dist/nodes/compare.js.map +0 -1
  52. package/dist/nodes/constant.d.ts +0 -315
  53. package/dist/nodes/constant.d.ts.map +0 -1
  54. package/dist/nodes/constant.js +0 -715
  55. package/dist/nodes/constant.js.map +0 -1
  56. package/dist/nodes/control.d.ts +0 -83
  57. package/dist/nodes/control.d.ts.map +0 -1
  58. package/dist/nodes/control.js +0 -212
  59. package/dist/nodes/control.js.map +0 -1
  60. package/dist/nodes/data.d.ts +0 -369
  61. package/dist/nodes/data.d.ts.map +0 -1
  62. package/dist/nodes/data.js +0 -1590
  63. package/dist/nodes/data.js.map +0 -1
  64. package/dist/nodes/document.d.ts +0 -134
  65. package/dist/nodes/document.d.ts.map +0 -1
  66. package/dist/nodes/document.js +0 -984
  67. package/dist/nodes/document.js.map +0 -1
  68. package/dist/nodes/extended-placeholders.d.ts +0 -6
  69. package/dist/nodes/extended-placeholders.d.ts.map +0 -1
  70. package/dist/nodes/extended-placeholders.js +0 -19
  71. package/dist/nodes/extended-placeholders.js.map +0 -1
  72. package/dist/nodes/gemini.d.ts +0 -110
  73. package/dist/nodes/gemini.d.ts.map +0 -1
  74. package/dist/nodes/gemini.js +0 -871
  75. package/dist/nodes/gemini.js.map +0 -1
  76. package/dist/nodes/generators.d.ts +0 -84
  77. package/dist/nodes/generators.d.ts.map +0 -1
  78. package/dist/nodes/generators.js +0 -968
  79. package/dist/nodes/generators.js.map +0 -1
  80. package/dist/nodes/image.d.ts +0 -232
  81. package/dist/nodes/image.d.ts.map +0 -1
  82. package/dist/nodes/image.js +0 -1395
  83. package/dist/nodes/image.js.map +0 -1
  84. package/dist/nodes/input.d.ts +0 -445
  85. package/dist/nodes/input.d.ts.map +0 -1
  86. package/dist/nodes/input.js +0 -1459
  87. package/dist/nodes/input.js.map +0 -1
  88. package/dist/nodes/kie-dynamic.d.ts +0 -31
  89. package/dist/nodes/kie-dynamic.d.ts.map +0 -1
  90. package/dist/nodes/kie-dynamic.js +0 -270
  91. package/dist/nodes/kie-dynamic.js.map +0 -1
  92. package/dist/nodes/lib-audio-dsp.d.ts +0 -85
  93. package/dist/nodes/lib-audio-dsp.d.ts.map +0 -1
  94. package/dist/nodes/lib-audio-dsp.js +0 -450
  95. package/dist/nodes/lib-audio-dsp.js.map +0 -1
  96. package/dist/nodes/lib-audio-effects.d.ts +0 -116
  97. package/dist/nodes/lib-audio-effects.d.ts.map +0 -1
  98. package/dist/nodes/lib-audio-effects.js +0 -905
  99. package/dist/nodes/lib-audio-effects.js.map +0 -1
  100. package/dist/nodes/lib-browser.d.ts +0 -99
  101. package/dist/nodes/lib-browser.d.ts.map +0 -1
  102. package/dist/nodes/lib-browser.js +0 -692
  103. package/dist/nodes/lib-browser.js.map +0 -1
  104. package/dist/nodes/lib-charts.d.ts +0 -20
  105. package/dist/nodes/lib-charts.d.ts.map +0 -1
  106. package/dist/nodes/lib-charts.js +0 -245
  107. package/dist/nodes/lib-charts.js.map +0 -1
  108. package/dist/nodes/lib-datetime.d.ts +0 -108
  109. package/dist/nodes/lib-datetime.d.ts.map +0 -1
  110. package/dist/nodes/lib-datetime.js +0 -421
  111. package/dist/nodes/lib-datetime.js.map +0 -1
  112. package/dist/nodes/lib-doc-convert.d.ts +0 -19
  113. package/dist/nodes/lib-doc-convert.d.ts.map +0 -1
  114. package/dist/nodes/lib-doc-convert.js +0 -257
  115. package/dist/nodes/lib-doc-convert.js.map +0 -1
  116. package/dist/nodes/lib-doc-transform.d.ts +0 -39
  117. package/dist/nodes/lib-doc-transform.d.ts.map +0 -1
  118. package/dist/nodes/lib-doc-transform.js +0 -335
  119. package/dist/nodes/lib-doc-transform.js.map +0 -1
  120. package/dist/nodes/lib-docx.d.ts +0 -106
  121. package/dist/nodes/lib-docx.d.ts.map +0 -1
  122. package/dist/nodes/lib-docx.js +0 -595
  123. package/dist/nodes/lib-docx.js.map +0 -1
  124. package/dist/nodes/lib-epub.d.ts +0 -55
  125. package/dist/nodes/lib-epub.d.ts.map +0 -1
  126. package/dist/nodes/lib-epub.js +0 -220
  127. package/dist/nodes/lib-epub.js.map +0 -1
  128. package/dist/nodes/lib-excel.d.ts +0 -74
  129. package/dist/nodes/lib-excel.d.ts.map +0 -1
  130. package/dist/nodes/lib-excel.js +0 -448
  131. package/dist/nodes/lib-excel.js.map +0 -1
  132. package/dist/nodes/lib-graphql.d.ts +0 -66
  133. package/dist/nodes/lib-graphql.d.ts.map +0 -1
  134. package/dist/nodes/lib-graphql.js +0 -333
  135. package/dist/nodes/lib-graphql.js.map +0 -1
  136. package/dist/nodes/lib-grid.d.ts +0 -27
  137. package/dist/nodes/lib-grid.d.ts.map +0 -1
  138. package/dist/nodes/lib-grid.js +0 -172
  139. package/dist/nodes/lib-grid.js.map +0 -1
  140. package/dist/nodes/lib-html-parse.d.ts +0 -108
  141. package/dist/nodes/lib-html-parse.d.ts.map +0 -1
  142. package/dist/nodes/lib-html-parse.js +0 -365
  143. package/dist/nodes/lib-html-parse.js.map +0 -1
  144. package/dist/nodes/lib-http.d.ts +0 -98
  145. package/dist/nodes/lib-http.d.ts.map +0 -1
  146. package/dist/nodes/lib-http.js +0 -267
  147. package/dist/nodes/lib-http.js.map +0 -1
  148. package/dist/nodes/lib-image-color-grading.d.ts +0 -3
  149. package/dist/nodes/lib-image-color-grading.d.ts.map +0 -1
  150. package/dist/nodes/lib-image-color-grading.js +0 -1386
  151. package/dist/nodes/lib-image-color-grading.js.map +0 -1
  152. package/dist/nodes/lib-image-draw.d.ts +0 -3
  153. package/dist/nodes/lib-image-draw.d.ts.map +0 -1
  154. package/dist/nodes/lib-image-draw.js +0 -470
  155. package/dist/nodes/lib-image-draw.js.map +0 -1
  156. package/dist/nodes/lib-image-enhance.d.ts +0 -3
  157. package/dist/nodes/lib-image-enhance.d.ts.map +0 -1
  158. package/dist/nodes/lib-image-enhance.js +0 -731
  159. package/dist/nodes/lib-image-enhance.js.map +0 -1
  160. package/dist/nodes/lib-image-filter.d.ts +0 -3
  161. package/dist/nodes/lib-image-filter.d.ts.map +0 -1
  162. package/dist/nodes/lib-image-filter.js +0 -684
  163. package/dist/nodes/lib-image-filter.js.map +0 -1
  164. package/dist/nodes/lib-image-utils.d.ts +0 -24
  165. package/dist/nodes/lib-image-utils.d.ts.map +0 -1
  166. package/dist/nodes/lib-image-utils.js +0 -150
  167. package/dist/nodes/lib-image-utils.js.map +0 -1
  168. package/dist/nodes/lib-mail.d.ts +0 -74
  169. package/dist/nodes/lib-mail.d.ts.map +0 -1
  170. package/dist/nodes/lib-mail.js +0 -452
  171. package/dist/nodes/lib-mail.js.map +0 -1
  172. package/dist/nodes/lib-markdown.d.ts +0 -70
  173. package/dist/nodes/lib-markdown.d.ts.map +0 -1
  174. package/dist/nodes/lib-markdown.js +0 -236
  175. package/dist/nodes/lib-markdown.js.map +0 -1
  176. package/dist/nodes/lib-nlp.d.ts +0 -98
  177. package/dist/nodes/lib-nlp.d.ts.map +0 -1
  178. package/dist/nodes/lib-nlp.js +0 -374
  179. package/dist/nodes/lib-nlp.js.map +0 -1
  180. package/dist/nodes/lib-notion.d.ts +0 -99
  181. package/dist/nodes/lib-notion.d.ts.map +0 -1
  182. package/dist/nodes/lib-notion.js +0 -601
  183. package/dist/nodes/lib-notion.js.map +0 -1
  184. package/dist/nodes/lib-ocr.d.ts +0 -31
  185. package/dist/nodes/lib-ocr.d.ts.map +0 -1
  186. package/dist/nodes/lib-ocr.js +0 -143
  187. package/dist/nodes/lib-ocr.js.map +0 -1
  188. package/dist/nodes/lib-os.d.ts +0 -312
  189. package/dist/nodes/lib-os.d.ts.map +0 -1
  190. package/dist/nodes/lib-os.js +0 -909
  191. package/dist/nodes/lib-os.js.map +0 -1
  192. package/dist/nodes/lib-pdf.d.ts +0 -142
  193. package/dist/nodes/lib-pdf.d.ts.map +0 -1
  194. package/dist/nodes/lib-pdf.js +0 -871
  195. package/dist/nodes/lib-pdf.js.map +0 -1
  196. package/dist/nodes/lib-pptx.d.ts +0 -29
  197. package/dist/nodes/lib-pptx.d.ts.map +0 -1
  198. package/dist/nodes/lib-pptx.js +0 -122
  199. package/dist/nodes/lib-pptx.js.map +0 -1
  200. package/dist/nodes/lib-rss.d.ts +0 -31
  201. package/dist/nodes/lib-rss.d.ts.map +0 -1
  202. package/dist/nodes/lib-rss.js +0 -163
  203. package/dist/nodes/lib-rss.js.map +0 -1
  204. package/dist/nodes/lib-s3.d.ts +0 -112
  205. package/dist/nodes/lib-s3.d.ts.map +0 -1
  206. package/dist/nodes/lib-s3.js +0 -521
  207. package/dist/nodes/lib-s3.js.map +0 -1
  208. package/dist/nodes/lib-secret.d.ts +0 -15
  209. package/dist/nodes/lib-secret.d.ts.map +0 -1
  210. package/dist/nodes/lib-secret.js +0 -42
  211. package/dist/nodes/lib-secret.js.map +0 -1
  212. package/dist/nodes/lib-sqlite.d.ts +0 -102
  213. package/dist/nodes/lib-sqlite.d.ts.map +0 -1
  214. package/dist/nodes/lib-sqlite.js +0 -532
  215. package/dist/nodes/lib-sqlite.js.map +0 -1
  216. package/dist/nodes/lib-supabase.d.ts +0 -86
  217. package/dist/nodes/lib-supabase.d.ts.map +0 -1
  218. package/dist/nodes/lib-supabase.js +0 -425
  219. package/dist/nodes/lib-supabase.js.map +0 -1
  220. package/dist/nodes/lib-svg.d.ts +0 -199
  221. package/dist/nodes/lib-svg.d.ts.map +0 -1
  222. package/dist/nodes/lib-svg.js +0 -1027
  223. package/dist/nodes/lib-svg.js.map +0 -1
  224. package/dist/nodes/lib-tensorflow.d.ts +0 -71
  225. package/dist/nodes/lib-tensorflow.d.ts.map +0 -1
  226. package/dist/nodes/lib-tensorflow.js +0 -351
  227. package/dist/nodes/lib-tensorflow.js.map +0 -1
  228. package/dist/nodes/lib-twilio.d.ts +0 -71
  229. package/dist/nodes/lib-twilio.d.ts.map +0 -1
  230. package/dist/nodes/lib-twilio.js +0 -469
  231. package/dist/nodes/lib-twilio.js.map +0 -1
  232. package/dist/nodes/lib-validate.d.ts +0 -84
  233. package/dist/nodes/lib-validate.d.ts.map +0 -1
  234. package/dist/nodes/lib-validate.js +0 -215
  235. package/dist/nodes/lib-validate.js.map +0 -1
  236. package/dist/nodes/lib-video-download.d.ts +0 -26
  237. package/dist/nodes/lib-video-download.d.ts.map +0 -1
  238. package/dist/nodes/lib-video-download.js +0 -299
  239. package/dist/nodes/lib-video-download.js.map +0 -1
  240. package/dist/nodes/messaging.d.ts +0 -88
  241. package/dist/nodes/messaging.d.ts.map +0 -1
  242. package/dist/nodes/messaging.js +0 -418
  243. package/dist/nodes/messaging.js.map +0 -1
  244. package/dist/nodes/mistral.d.ts +0 -83
  245. package/dist/nodes/mistral.d.ts.map +0 -1
  246. package/dist/nodes/mistral.js +0 -450
  247. package/dist/nodes/mistral.js.map +0 -1
  248. package/dist/nodes/model3d/analysis.d.ts +0 -13
  249. package/dist/nodes/model3d/analysis.d.ts.map +0 -1
  250. package/dist/nodes/model3d/analysis.js +0 -36
  251. package/dist/nodes/model3d/analysis.js.map +0 -1
  252. package/dist/nodes/model3d/base.d.ts +0 -11
  253. package/dist/nodes/model3d/base.d.ts.map +0 -1
  254. package/dist/nodes/model3d/base.js +0 -20
  255. package/dist/nodes/model3d/base.js.map +0 -1
  256. package/dist/nodes/model3d/boolean-ops.d.ts +0 -2
  257. package/dist/nodes/model3d/boolean-ops.d.ts.map +0 -1
  258. package/dist/nodes/model3d/boolean-ops.js +0 -172
  259. package/dist/nodes/model3d/boolean-ops.js.map +0 -1
  260. package/dist/nodes/model3d/cleanup.d.ts +0 -47
  261. package/dist/nodes/model3d/cleanup.d.ts.map +0 -1
  262. package/dist/nodes/model3d/cleanup.js +0 -136
  263. package/dist/nodes/model3d/cleanup.js.map +0 -1
  264. package/dist/nodes/model3d/convert.d.ts +0 -14
  265. package/dist/nodes/model3d/convert.d.ts.map +0 -1
  266. package/dist/nodes/model3d/convert.js +0 -64
  267. package/dist/nodes/model3d/convert.js.map +0 -1
  268. package/dist/nodes/model3d/defaults.d.ts +0 -34
  269. package/dist/nodes/model3d/defaults.d.ts.map +0 -1
  270. package/dist/nodes/model3d/defaults.js +0 -28
  271. package/dist/nodes/model3d/defaults.js.map +0 -1
  272. package/dist/nodes/model3d/document-ops.d.ts +0 -4
  273. package/dist/nodes/model3d/document-ops.d.ts.map +0 -1
  274. package/dist/nodes/model3d/document-ops.js +0 -40
  275. package/dist/nodes/model3d/document-ops.js.map +0 -1
  276. package/dist/nodes/model3d/generation.d.ts +0 -39
  277. package/dist/nodes/model3d/generation.d.ts.map +0 -1
  278. package/dist/nodes/model3d/generation.js +0 -179
  279. package/dist/nodes/model3d/generation.js.map +0 -1
  280. package/dist/nodes/model3d/glb.d.ts +0 -29
  281. package/dist/nodes/model3d/glb.d.ts.map +0 -1
  282. package/dist/nodes/model3d/glb.js +0 -255
  283. package/dist/nodes/model3d/glb.js.map +0 -1
  284. package/dist/nodes/model3d/index.d.ts +0 -20
  285. package/dist/nodes/model3d/index.d.ts.map +0 -1
  286. package/dist/nodes/model3d/index.js +0 -38
  287. package/dist/nodes/model3d/index.js.map +0 -1
  288. package/dist/nodes/model3d/io.d.ts +0 -38
  289. package/dist/nodes/model3d/io.d.ts.map +0 -1
  290. package/dist/nodes/model3d/io.js +0 -162
  291. package/dist/nodes/model3d/io.js.map +0 -1
  292. package/dist/nodes/model3d/mesh-ops.d.ts +0 -40
  293. package/dist/nodes/model3d/mesh-ops.d.ts.map +0 -1
  294. package/dist/nodes/model3d/mesh-ops.js +0 -775
  295. package/dist/nodes/model3d/mesh-ops.js.map +0 -1
  296. package/dist/nodes/model3d/nodes.d.ts +0 -2
  297. package/dist/nodes/model3d/nodes.d.ts.map +0 -1
  298. package/dist/nodes/model3d/nodes.js +0 -2
  299. package/dist/nodes/model3d/nodes.js.map +0 -1
  300. package/dist/nodes/model3d/ops.d.ts +0 -37
  301. package/dist/nodes/model3d/ops.d.ts.map +0 -1
  302. package/dist/nodes/model3d/ops.js +0 -137
  303. package/dist/nodes/model3d/ops.js.map +0 -1
  304. package/dist/nodes/model3d/transforms.d.ts +0 -49
  305. package/dist/nodes/model3d/transforms.d.ts.map +0 -1
  306. package/dist/nodes/model3d/transforms.js +0 -142
  307. package/dist/nodes/model3d/transforms.js.map +0 -1
  308. package/dist/nodes/model3d/types.d.ts +0 -81
  309. package/dist/nodes/model3d/types.d.ts.map +0 -1
  310. package/dist/nodes/model3d/types.js +0 -2
  311. package/dist/nodes/model3d/types.js.map +0 -1
  312. package/dist/nodes/model3d/utils.d.ts +0 -34
  313. package/dist/nodes/model3d/utils.d.ts.map +0 -1
  314. package/dist/nodes/model3d/utils.js +0 -185
  315. package/dist/nodes/model3d/utils.js.map +0 -1
  316. package/dist/nodes/model3d.d.ts +0 -2
  317. package/dist/nodes/model3d.d.ts.map +0 -1
  318. package/dist/nodes/model3d.js +0 -2
  319. package/dist/nodes/model3d.js.map +0 -1
  320. package/dist/nodes/openai.d.ts +0 -172
  321. package/dist/nodes/openai.d.ts.map +0 -1
  322. package/dist/nodes/openai.js +0 -1294
  323. package/dist/nodes/openai.js.map +0 -1
  324. package/dist/nodes/output.d.ts +0 -29
  325. package/dist/nodes/output.d.ts.map +0 -1
  326. package/dist/nodes/output.js +0 -87
  327. package/dist/nodes/output.js.map +0 -1
  328. package/dist/nodes/sandbox.d.ts +0 -63
  329. package/dist/nodes/sandbox.d.ts.map +0 -1
  330. package/dist/nodes/sandbox.js +0 -633
  331. package/dist/nodes/sandbox.js.map +0 -1
  332. package/dist/nodes/search.d.ts +0 -117
  333. package/dist/nodes/search.d.ts.map +0 -1
  334. package/dist/nodes/search.js +0 -607
  335. package/dist/nodes/search.js.map +0 -1
  336. package/dist/nodes/team.d.ts +0 -74
  337. package/dist/nodes/team.d.ts.map +0 -1
  338. package/dist/nodes/team.js +0 -309
  339. package/dist/nodes/team.js.map +0 -1
  340. package/dist/nodes/text-extra.d.ts +0 -633
  341. package/dist/nodes/text-extra.d.ts.map +0 -1
  342. package/dist/nodes/text-extra.js +0 -2226
  343. package/dist/nodes/text-extra.js.map +0 -1
  344. package/dist/nodes/tool-agents.d.ts +0 -334
  345. package/dist/nodes/tool-agents.d.ts.map +0 -1
  346. package/dist/nodes/tool-agents.js +0 -1861
  347. package/dist/nodes/tool-agents.js.map +0 -1
  348. package/dist/nodes/triggers.d.ts +0 -107
  349. package/dist/nodes/triggers.d.ts.map +0 -1
  350. package/dist/nodes/triggers.js +0 -706
  351. package/dist/nodes/triggers.js.map +0 -1
  352. package/dist/nodes/vector.d.ts +0 -168
  353. package/dist/nodes/vector.d.ts.map +0 -1
  354. package/dist/nodes/vector.js +0 -1121
  355. package/dist/nodes/vector.js.map +0 -1
  356. package/dist/nodes/video.d.ts +0 -387
  357. package/dist/nodes/video.d.ts.map +0 -1
  358. package/dist/nodes/video.js +0 -2383
  359. package/dist/nodes/video.js.map +0 -1
  360. package/dist/nodes/workflow.d.ts +0 -24
  361. package/dist/nodes/workflow.d.ts.map +0 -1
  362. package/dist/nodes/workflow.js +0 -146
  363. package/dist/nodes/workflow.js.map +0 -1
  364. package/dist/nodes/workspace.d.ts +0 -203
  365. package/dist/nodes/workspace.d.ts.map +0 -1
  366. package/dist/nodes/workspace.js +0 -795
  367. package/dist/nodes/workspace.js.map +0 -1
@@ -1,795 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BaseNode, prop } from "@nodetool-ai/node-sdk";
8
- import { promises as fs } from "node:fs";
9
- import path from "node:path";
10
- function workspaceDirFrom(props) {
11
- return String(props.workspace_dir ?? process.cwd());
12
- }
13
- export function ensureWorkspacePath(workspaceDir, relativePath) {
14
- if (!relativePath) {
15
- throw new Error("Path cannot be empty");
16
- }
17
- if (path.isAbsolute(relativePath)) {
18
- throw new Error("Absolute paths are not allowed. Use relative paths within workspace.");
19
- }
20
- if (relativePath.split(/[\\/]/).includes("..")) {
21
- throw new Error("Parent directory traversal (..) is not allowed");
22
- }
23
- const full = path.resolve(workspaceDir, relativePath);
24
- const root = path.resolve(workspaceDir);
25
- if (!full.startsWith(root)) {
26
- throw new Error("Path must be within workspace directory");
27
- }
28
- return full;
29
- }
30
- function formatTimestampedName(name) {
31
- const now = new Date();
32
- const pad = (v) => String(v).padStart(2, "0");
33
- return name
34
- .replaceAll("%Y", String(now.getFullYear()))
35
- .replaceAll("%m", pad(now.getMonth() + 1))
36
- .replaceAll("%d", pad(now.getDate()))
37
- .replaceAll("%H", pad(now.getHours()))
38
- .replaceAll("%M", pad(now.getMinutes()))
39
- .replaceAll("%S", pad(now.getSeconds()));
40
- }
41
- function wildcardToRegExp(pattern) {
42
- const escaped = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&");
43
- return new RegExp(`^${escaped.replaceAll("*", ".*")}$`);
44
- }
45
- async function walk(dir, recursive) {
46
- const out = [];
47
- const entries = await fs.readdir(dir, { withFileTypes: true });
48
- for (const entry of entries) {
49
- const full = path.join(dir, entry.name);
50
- out.push(full);
51
- if (recursive && entry.isDirectory()) {
52
- out.push(...(await walk(full, true)));
53
- }
54
- }
55
- return out;
56
- }
57
- function fileUri(fullPath) {
58
- return `file://${fullPath}`;
59
- }
60
- function bytesFromUnknown(value) {
61
- if (value instanceof Uint8Array) {
62
- return value;
63
- }
64
- if (Array.isArray(value) && value.every((x) => Number.isInteger(x))) {
65
- return new Uint8Array(value);
66
- }
67
- if (typeof value === "string") {
68
- return Uint8Array.from(Buffer.from(value, "base64"));
69
- }
70
- return new Uint8Array();
71
- }
72
- export class GetWorkspaceDirNode extends BaseNode {
73
- static nodeType = "nodetool.workspace.GetWorkspaceDir";
74
- static title = "Get Workspace Dir";
75
- static description = "Get the current workspace directory path.\n workspace, directory, path";
76
- static metadataOutputTypes = {
77
- output: "str"
78
- };
79
- async process() {
80
- return { output: workspaceDirFrom(this.serialize()) };
81
- }
82
- }
83
- __decorate([
84
- prop({
85
- type: "str",
86
- default: "",
87
- title: "Workspace Dir",
88
- description: "The workspace directory"
89
- })
90
- ], GetWorkspaceDirNode.prototype, "workspace_dir", void 0);
91
- export class ListWorkspaceFilesNode extends BaseNode {
92
- static nodeType = "nodetool.workspace.ListWorkspaceFiles";
93
- static title = "List Workspace Files";
94
- static description = "List files in the workspace directory matching a pattern.\n workspace, files, list, directory";
95
- static metadataOutputTypes = {
96
- file: "str",
97
- files: "list"
98
- };
99
- static isStreamingOutput = true;
100
- async process() {
101
- const workspace = workspaceDirFrom(this.serialize());
102
- const relative = String(this.path ?? ".");
103
- const pattern = String(this.pattern ?? "*");
104
- const recursive = Boolean(this.recursive ?? false);
105
- const root = ensureWorkspacePath(workspace, relative);
106
- const regex = wildcardToRegExp(pattern);
107
- const all = await walk(root, recursive);
108
- const results = [];
109
- for (const item of all) {
110
- if (regex.test(path.basename(item))) {
111
- results.push(path.relative(workspace, item));
112
- }
113
- }
114
- return {
115
- file: results[0] ?? "",
116
- files: results
117
- };
118
- }
119
- async *genProcess() {
120
- const workspace = workspaceDirFrom(this.serialize());
121
- const relative = String(this.path ?? ".");
122
- const pattern = String(this.pattern ?? "*");
123
- const recursive = Boolean(this.recursive ?? false);
124
- const root = ensureWorkspacePath(workspace, relative);
125
- const regex = wildcardToRegExp(pattern);
126
- const all = await walk(root, recursive);
127
- const results = [];
128
- for (const item of all) {
129
- if (regex.test(path.basename(item))) {
130
- const rel = path.relative(workspace, item);
131
- results.push(rel);
132
- yield { file: rel };
133
- }
134
- }
135
- yield { files: results };
136
- }
137
- }
138
- __decorate([
139
- prop({
140
- type: "str",
141
- default: ".",
142
- title: "Path",
143
- description: "Relative path within workspace (use . for workspace root)"
144
- })
145
- ], ListWorkspaceFilesNode.prototype, "path", void 0);
146
- __decorate([
147
- prop({
148
- type: "str",
149
- default: "*",
150
- title: "Pattern",
151
- description: "File pattern to match (e.g. *.txt, *.json)"
152
- })
153
- ], ListWorkspaceFilesNode.prototype, "pattern", void 0);
154
- __decorate([
155
- prop({
156
- type: "bool",
157
- default: false,
158
- title: "Recursive",
159
- description: "Search subdirectories recursively"
160
- })
161
- ], ListWorkspaceFilesNode.prototype, "recursive", void 0);
162
- export class ReadTextFileNode extends BaseNode {
163
- static nodeType = "nodetool.workspace.ReadTextFile";
164
- static title = "Read Text File";
165
- static description = "Read a text file from the workspace.\n workspace, file, read, text";
166
- static metadataOutputTypes = {
167
- output: "str"
168
- };
169
- async process() {
170
- const workspace = workspaceDirFrom(this.serialize());
171
- const relative = String(this.path ?? this.path ?? "");
172
- const encoding = String(this.encoding ?? this.encoding ?? "utf-8");
173
- const full = ensureWorkspacePath(workspace, relative);
174
- const text = await fs.readFile(full, { encoding });
175
- return { output: text };
176
- }
177
- }
178
- __decorate([
179
- prop({
180
- type: "str",
181
- default: "",
182
- title: "Path",
183
- description: "Relative path to file within workspace"
184
- })
185
- ], ReadTextFileNode.prototype, "path", void 0);
186
- __decorate([
187
- prop({
188
- type: "str",
189
- default: "utf-8",
190
- title: "Encoding",
191
- description: "Text encoding (utf-8, ascii, etc.)"
192
- })
193
- ], ReadTextFileNode.prototype, "encoding", void 0);
194
- export class WriteTextFileNode extends BaseNode {
195
- static nodeType = "nodetool.workspace.WriteTextFile";
196
- static title = "Write Text File";
197
- static description = "Write text to a file in the workspace.\n workspace, file, write, text, save";
198
- static metadataOutputTypes = {
199
- output: "str"
200
- };
201
- async process() {
202
- const workspace = workspaceDirFrom(this.serialize());
203
- const relative = String(this.path ?? this.path ?? "");
204
- const content = String(this.content ?? this.content ?? "");
205
- const append = Boolean(this.append ?? this.append ?? false);
206
- const encoding = String(this.encoding ?? this.encoding ?? "utf-8");
207
- const full = ensureWorkspacePath(workspace, relative);
208
- await fs.mkdir(path.dirname(full), { recursive: true });
209
- if (append) {
210
- await fs.appendFile(full, content, { encoding });
211
- }
212
- else {
213
- await fs.writeFile(full, content, { encoding });
214
- }
215
- return { output: relative };
216
- }
217
- }
218
- __decorate([
219
- prop({
220
- type: "str",
221
- default: "",
222
- title: "Path",
223
- description: "Relative path to file within workspace"
224
- })
225
- ], WriteTextFileNode.prototype, "path", void 0);
226
- __decorate([
227
- prop({
228
- type: "str",
229
- default: "",
230
- title: "Content",
231
- description: "Text content to write"
232
- })
233
- ], WriteTextFileNode.prototype, "content", void 0);
234
- __decorate([
235
- prop({
236
- type: "str",
237
- default: "utf-8",
238
- title: "Encoding",
239
- description: "Text encoding (utf-8, ascii, etc.)"
240
- })
241
- ], WriteTextFileNode.prototype, "encoding", void 0);
242
- __decorate([
243
- prop({
244
- type: "bool",
245
- default: false,
246
- title: "Append",
247
- description: "Append to file instead of overwriting"
248
- })
249
- ], WriteTextFileNode.prototype, "append", void 0);
250
- export class ReadBinaryFileNode extends BaseNode {
251
- static nodeType = "nodetool.workspace.ReadBinaryFile";
252
- static title = "Read Binary File";
253
- static description = "Read a binary file from the workspace as base64-encoded string.\n workspace, file, read, binary";
254
- static metadataOutputTypes = {
255
- output: "str"
256
- };
257
- async process() {
258
- const workspace = workspaceDirFrom(this.serialize());
259
- const relative = String(this.path ?? this.path ?? "");
260
- const full = ensureWorkspacePath(workspace, relative);
261
- const data = await fs.readFile(full);
262
- return { output: Buffer.from(data).toString("base64") };
263
- }
264
- }
265
- __decorate([
266
- prop({
267
- type: "str",
268
- default: "",
269
- title: "Path",
270
- description: "Relative path to file within workspace"
271
- })
272
- ], ReadBinaryFileNode.prototype, "path", void 0);
273
- export class WriteBinaryFileNode extends BaseNode {
274
- static nodeType = "nodetool.workspace.WriteBinaryFile";
275
- static title = "Write Binary File";
276
- static description = "Write binary data (base64-encoded) to a file in the workspace.\n workspace, file, write, binary, save";
277
- static metadataOutputTypes = {
278
- output: "str"
279
- };
280
- async process() {
281
- const workspace = workspaceDirFrom(this.serialize());
282
- const relative = String(this.path ?? this.path ?? "");
283
- const content = String(this.content ?? this.content ?? "");
284
- const full = ensureWorkspacePath(workspace, relative);
285
- await fs.mkdir(path.dirname(full), { recursive: true });
286
- await fs.writeFile(full, Buffer.from(content, "base64"));
287
- return { output: relative };
288
- }
289
- }
290
- __decorate([
291
- prop({
292
- type: "str",
293
- default: "",
294
- title: "Path",
295
- description: "Relative path to file within workspace"
296
- })
297
- ], WriteBinaryFileNode.prototype, "path", void 0);
298
- __decorate([
299
- prop({
300
- type: "str",
301
- default: "",
302
- title: "Content",
303
- description: "Base64-encoded binary content to write"
304
- })
305
- ], WriteBinaryFileNode.prototype, "content", void 0);
306
- export class DeleteWorkspaceFileNode extends BaseNode {
307
- static nodeType = "nodetool.workspace.DeleteWorkspaceFile";
308
- static title = "Delete Workspace File";
309
- static description = "Delete a file or directory from the workspace.\n workspace, file, delete, remove";
310
- static metadataOutputTypes = {
311
- output: "none"
312
- };
313
- async process() {
314
- const workspace = workspaceDirFrom(this.serialize());
315
- const relative = String(this.path ?? this.path ?? "");
316
- const recursive = Boolean(this.recursive ?? this.recursive ?? false);
317
- const full = ensureWorkspacePath(workspace, relative);
318
- const stat = await fs.stat(full);
319
- if (stat.isDirectory()) {
320
- if (!recursive) {
321
- throw new Error("Path is a directory. Set recursive=true to delete.");
322
- }
323
- await fs.rm(full, { recursive: true, force: false });
324
- }
325
- else {
326
- await fs.unlink(full);
327
- }
328
- return { output: null };
329
- }
330
- }
331
- __decorate([
332
- prop({
333
- type: "str",
334
- default: "",
335
- title: "Path",
336
- description: "Relative path to file or directory within workspace"
337
- })
338
- ], DeleteWorkspaceFileNode.prototype, "path", void 0);
339
- __decorate([
340
- prop({
341
- type: "bool",
342
- default: false,
343
- title: "Recursive",
344
- description: "Delete directories recursively"
345
- })
346
- ], DeleteWorkspaceFileNode.prototype, "recursive", void 0);
347
- export class CreateWorkspaceDirectoryNode extends BaseNode {
348
- static nodeType = "nodetool.workspace.CreateWorkspaceDirectory";
349
- static title = "Create Workspace Directory";
350
- static description = "Create a directory in the workspace.\n workspace, directory, create, folder";
351
- static metadataOutputTypes = {
352
- output: "str"
353
- };
354
- async process() {
355
- const workspace = workspaceDirFrom(this.serialize());
356
- const relative = String(this.path ?? this.path ?? "");
357
- const full = ensureWorkspacePath(workspace, relative);
358
- await fs.mkdir(full, { recursive: true });
359
- return { output: relative };
360
- }
361
- }
362
- __decorate([
363
- prop({
364
- type: "str",
365
- default: "",
366
- title: "Path",
367
- description: "Relative path to directory within workspace"
368
- })
369
- ], CreateWorkspaceDirectoryNode.prototype, "path", void 0);
370
- export class WorkspaceFileExistsNode extends BaseNode {
371
- static nodeType = "nodetool.workspace.WorkspaceFileExists";
372
- static title = "Workspace File Exists";
373
- static description = "Check if a file or directory exists in the workspace.\n workspace, file, exists, check";
374
- static metadataOutputTypes = {
375
- output: "bool"
376
- };
377
- async process() {
378
- const workspace = workspaceDirFrom(this.serialize());
379
- const relative = String(this.path ?? this.path ?? "");
380
- const full = ensureWorkspacePath(workspace, relative);
381
- try {
382
- await fs.access(full);
383
- return { output: true };
384
- }
385
- catch {
386
- return { output: false };
387
- }
388
- }
389
- }
390
- __decorate([
391
- prop({
392
- type: "str",
393
- default: "",
394
- title: "Path",
395
- description: "Relative path within workspace to check"
396
- })
397
- ], WorkspaceFileExistsNode.prototype, "path", void 0);
398
- export class GetWorkspaceFileInfoNode extends BaseNode {
399
- static nodeType = "nodetool.workspace.GetWorkspaceFileInfo";
400
- static title = "Get Workspace File Info";
401
- static description = "Get information about a file in the workspace.\n workspace, file, info, metadata";
402
- static metadataOutputTypes = {
403
- output: "dict"
404
- };
405
- async process() {
406
- const workspace = workspaceDirFrom(this.serialize());
407
- const relative = String(this.path ?? this.path ?? "");
408
- const full = ensureWorkspacePath(workspace, relative);
409
- const stats = await fs.stat(full);
410
- return {
411
- output: {
412
- path: relative,
413
- name: path.basename(relative),
414
- size: stats.size,
415
- is_file: stats.isFile(),
416
- is_directory: stats.isDirectory(),
417
- created: new Date(stats.birthtimeMs).toISOString(),
418
- modified: new Date(stats.mtimeMs).toISOString(),
419
- accessed: new Date(stats.atimeMs).toISOString()
420
- }
421
- };
422
- }
423
- }
424
- __decorate([
425
- prop({
426
- type: "str",
427
- default: "",
428
- title: "Path",
429
- description: "Relative path to file within workspace"
430
- })
431
- ], GetWorkspaceFileInfoNode.prototype, "path", void 0);
432
- export class CopyWorkspaceFileNode extends BaseNode {
433
- static nodeType = "nodetool.workspace.CopyWorkspaceFile";
434
- static title = "Copy Workspace File";
435
- static description = "Copy a file within the workspace.\n workspace, file, copy, duplicate";
436
- static metadataOutputTypes = {
437
- output: "str"
438
- };
439
- async process() {
440
- const workspace = workspaceDirFrom(this.serialize());
441
- const source = ensureWorkspacePath(workspace, String(this.source ?? this.source ?? ""));
442
- const destRelative = String(this.destination ?? this.destination ?? "");
443
- const destination = ensureWorkspacePath(workspace, destRelative);
444
- await fs.mkdir(path.dirname(destination), { recursive: true });
445
- await fs.cp(source, destination, { recursive: true });
446
- return { output: destRelative };
447
- }
448
- }
449
- __decorate([
450
- prop({
451
- type: "str",
452
- default: "",
453
- title: "Source",
454
- description: "Relative source path within workspace"
455
- })
456
- ], CopyWorkspaceFileNode.prototype, "source", void 0);
457
- __decorate([
458
- prop({
459
- type: "str",
460
- default: "",
461
- title: "Destination",
462
- description: "Relative destination path within workspace"
463
- })
464
- ], CopyWorkspaceFileNode.prototype, "destination", void 0);
465
- export class MoveWorkspaceFileNode extends BaseNode {
466
- static nodeType = "nodetool.workspace.MoveWorkspaceFile";
467
- static title = "Move Workspace File";
468
- static description = "Move or rename a file within the workspace.\n workspace, file, move, rename";
469
- static metadataOutputTypes = {
470
- output: "str"
471
- };
472
- async process() {
473
- const workspace = workspaceDirFrom(this.serialize());
474
- const source = ensureWorkspacePath(workspace, String(this.source ?? this.source ?? ""));
475
- const destRelative = String(this.destination ?? this.destination ?? "");
476
- const destination = ensureWorkspacePath(workspace, destRelative);
477
- await fs.mkdir(path.dirname(destination), { recursive: true });
478
- await fs.rename(source, destination);
479
- return { output: destRelative };
480
- }
481
- }
482
- __decorate([
483
- prop({
484
- type: "str",
485
- default: "",
486
- title: "Source",
487
- description: "Relative source path within workspace"
488
- })
489
- ], MoveWorkspaceFileNode.prototype, "source", void 0);
490
- __decorate([
491
- prop({
492
- type: "str",
493
- default: "",
494
- title: "Destination",
495
- description: "Relative destination path within workspace"
496
- })
497
- ], MoveWorkspaceFileNode.prototype, "destination", void 0);
498
- export class GetWorkspaceFileSizeNode extends BaseNode {
499
- static nodeType = "nodetool.workspace.GetWorkspaceFileSize";
500
- static title = "Get Workspace File Size";
501
- static description = "Get file size in bytes for a workspace file.\n workspace, file, size, bytes";
502
- static metadataOutputTypes = {
503
- output: "int"
504
- };
505
- async process() {
506
- const workspace = workspaceDirFrom(this.serialize());
507
- const relative = String(this.path ?? this.path ?? "");
508
- const full = ensureWorkspacePath(workspace, relative);
509
- const stats = await fs.stat(full);
510
- if (!stats.isFile()) {
511
- throw new Error(`Path is not a file: ${relative}`);
512
- }
513
- return { output: stats.size };
514
- }
515
- }
516
- __decorate([
517
- prop({
518
- type: "str",
519
- default: "",
520
- title: "Path",
521
- description: "Relative path to file within workspace"
522
- })
523
- ], GetWorkspaceFileSizeNode.prototype, "path", void 0);
524
- export class IsWorkspaceFileNode extends BaseNode {
525
- static nodeType = "nodetool.workspace.IsWorkspaceFile";
526
- static title = "Is Workspace File";
527
- static description = "Check if a path in the workspace is a file.\n workspace, file, check, type";
528
- static metadataOutputTypes = {
529
- output: "bool"
530
- };
531
- async process() {
532
- const workspace = workspaceDirFrom(this.serialize());
533
- const relative = String(this.path ?? this.path ?? "");
534
- const full = ensureWorkspacePath(workspace, relative);
535
- try {
536
- const stats = await fs.stat(full);
537
- return { output: stats.isFile() };
538
- }
539
- catch {
540
- return { output: false };
541
- }
542
- }
543
- }
544
- __decorate([
545
- prop({
546
- type: "str",
547
- default: "",
548
- title: "Path",
549
- description: "Relative path within workspace to check"
550
- })
551
- ], IsWorkspaceFileNode.prototype, "path", void 0);
552
- export class IsWorkspaceDirectoryNode extends BaseNode {
553
- static nodeType = "nodetool.workspace.IsWorkspaceDirectory";
554
- static title = "Is Workspace Directory";
555
- static description = "Check if a path in the workspace is a directory.\n workspace, directory, check, type";
556
- static metadataOutputTypes = {
557
- output: "bool"
558
- };
559
- async process() {
560
- const workspace = workspaceDirFrom(this.serialize());
561
- const relative = String(this.path ?? this.path ?? "");
562
- const full = ensureWorkspacePath(workspace, relative);
563
- try {
564
- const stats = await fs.stat(full);
565
- return { output: stats.isDirectory() };
566
- }
567
- catch {
568
- return { output: false };
569
- }
570
- }
571
- }
572
- __decorate([
573
- prop({
574
- type: "str",
575
- default: "",
576
- title: "Path",
577
- description: "Relative path within workspace to check"
578
- })
579
- ], IsWorkspaceDirectoryNode.prototype, "path", void 0);
580
- export class JoinWorkspacePathsNode extends BaseNode {
581
- static nodeType = "nodetool.workspace.JoinWorkspacePaths";
582
- static title = "Join Workspace Paths";
583
- static description = "Join path components relative to workspace.\n workspace, path, join, combine";
584
- static metadataOutputTypes = {
585
- output: "str"
586
- };
587
- async process() {
588
- const workspace = workspaceDirFrom(this.serialize());
589
- const parts = Array.isArray(this.paths ?? this.paths)
590
- ? (this.paths ?? this.paths)
591
- : [];
592
- if (parts.length === 0) {
593
- throw new Error("paths cannot be empty");
594
- }
595
- // Workspace-relative paths are part of the workflow contract and must
596
- // be portable across operating systems. Always emit POSIX separators
597
- // and use the OS-native form only for the worktree validation below.
598
- const joined = path.posix.join(...parts.map((p) => String(p)));
599
- ensureWorkspacePath(workspace, joined);
600
- return { output: joined };
601
- }
602
- }
603
- __decorate([
604
- prop({
605
- type: "list[str]",
606
- default: [],
607
- title: "Paths",
608
- description: "Path components to join (relative to workspace)"
609
- })
610
- ], JoinWorkspacePathsNode.prototype, "paths", void 0);
611
- export class SaveImageFileNode extends BaseNode {
612
- static nodeType = "nodetool.workspace.SaveImageFile";
613
- static title = "Save Image File";
614
- static description = "Save an image to a file in the workspace.\n workspace, image, save, file, output";
615
- static metadataOutputTypes = {
616
- output: "image"
617
- };
618
- async process() {
619
- const workspace = workspaceDirFrom(this.serialize());
620
- const image = (this.image ?? this.image ?? {});
621
- const folder = String(this.folder ?? this.folder ?? ".");
622
- const filename = formatTimestampedName(String(this.filename ?? this.filename ?? "image.png"));
623
- const overwrite = Boolean(this.overwrite ?? this.overwrite ?? false);
624
- let relative = path.join(folder, filename);
625
- let full = ensureWorkspacePath(workspace, relative);
626
- await fs.mkdir(path.dirname(full), { recursive: true });
627
- if (!overwrite) {
628
- let count = 1;
629
- while (true) {
630
- try {
631
- await fs.access(full);
632
- const ext = path.extname(filename);
633
- const base = filename.slice(0, Math.max(0, filename.length - ext.length));
634
- const next = `${base}_${count}${ext}`;
635
- relative = path.join(folder, next);
636
- full = ensureWorkspacePath(workspace, relative);
637
- count += 1;
638
- }
639
- catch {
640
- break;
641
- }
642
- }
643
- }
644
- const bytes = bytesFromUnknown(image.data);
645
- await fs.writeFile(full, bytes);
646
- return {
647
- output: {
648
- uri: fileUri(full),
649
- data: Buffer.from(bytes).toString("base64")
650
- }
651
- };
652
- }
653
- }
654
- __decorate([
655
- prop({
656
- type: "image",
657
- default: {
658
- type: "image",
659
- uri: "",
660
- asset_id: null,
661
- data: null,
662
- metadata: null
663
- },
664
- title: "Image",
665
- description: "The image to save"
666
- })
667
- ], SaveImageFileNode.prototype, "image", void 0);
668
- __decorate([
669
- prop({
670
- type: "str",
671
- default: ".",
672
- title: "Folder",
673
- description: "Relative folder path within workspace (use . for workspace root)"
674
- })
675
- ], SaveImageFileNode.prototype, "folder", void 0);
676
- __decorate([
677
- prop({
678
- type: "str",
679
- default: "image.png",
680
- title: "Filename",
681
- description: "\n The name of the image file.\n You can use time and date variables to create unique names:\n %Y - Year\n %m - Month\n %d - Day\n %H - Hour\n %M - Minute\n %S - Second\n "
682
- })
683
- ], SaveImageFileNode.prototype, "filename", void 0);
684
- __decorate([
685
- prop({
686
- type: "bool",
687
- default: false,
688
- title: "Overwrite",
689
- description: "Overwrite the file if it already exists, otherwise file will be renamed"
690
- })
691
- ], SaveImageFileNode.prototype, "overwrite", void 0);
692
- export class SaveVideoFileNode extends BaseNode {
693
- static nodeType = "nodetool.workspace.SaveVideoFile";
694
- static title = "Save Video File";
695
- static description = "Save a video file to the workspace.\n workspace, video, save, file, output\n\n The filename can include time and date variables:\n %Y - Year, %m - Month, %d - Day\n %H - Hour, %M - Minute, %S - Second";
696
- static metadataOutputTypes = {
697
- output: "video"
698
- };
699
- async process() {
700
- const workspace = workspaceDirFrom(this.serialize());
701
- const video = (this.video ?? this.video ?? {});
702
- const folder = String(this.folder ?? this.folder ?? ".");
703
- const filename = formatTimestampedName(String(this.filename ?? this.filename ?? "video.mp4"));
704
- const overwrite = Boolean(this.overwrite ?? this.overwrite ?? false);
705
- let relative = path.join(folder, filename);
706
- let full = ensureWorkspacePath(workspace, relative);
707
- await fs.mkdir(path.dirname(full), { recursive: true });
708
- if (!overwrite) {
709
- let count = 1;
710
- while (true) {
711
- try {
712
- await fs.access(full);
713
- const ext = path.extname(filename);
714
- const base = filename.slice(0, Math.max(0, filename.length - ext.length));
715
- const next = `${base}_${count}${ext}`;
716
- relative = path.join(folder, next);
717
- full = ensureWorkspacePath(workspace, relative);
718
- count += 1;
719
- }
720
- catch {
721
- break;
722
- }
723
- }
724
- }
725
- const bytes = bytesFromUnknown(video.data);
726
- await fs.writeFile(full, bytes);
727
- return {
728
- output: {
729
- uri: fileUri(full),
730
- data: Buffer.from(bytes).toString("base64")
731
- }
732
- };
733
- }
734
- }
735
- __decorate([
736
- prop({
737
- type: "video",
738
- default: {
739
- type: "video",
740
- uri: "",
741
- asset_id: null,
742
- data: null,
743
- metadata: null,
744
- duration: null,
745
- format: null
746
- },
747
- title: "Video",
748
- description: "The video to save"
749
- })
750
- ], SaveVideoFileNode.prototype, "video", void 0);
751
- __decorate([
752
- prop({
753
- type: "str",
754
- default: ".",
755
- title: "Folder",
756
- description: "Relative folder path within workspace (use . for workspace root)"
757
- })
758
- ], SaveVideoFileNode.prototype, "folder", void 0);
759
- __decorate([
760
- prop({
761
- type: "str",
762
- default: "video.mp4",
763
- title: "Filename",
764
- description: "\n Name of the file to save.\n You can use time and date variables to create unique names:\n %Y - Year\n %m - Month\n %d - Day\n %H - Hour\n %M - Minute\n %S - Second\n "
765
- })
766
- ], SaveVideoFileNode.prototype, "filename", void 0);
767
- __decorate([
768
- prop({
769
- type: "bool",
770
- default: false,
771
- title: "Overwrite",
772
- description: "Overwrite the file if it already exists, otherwise file will be renamed"
773
- })
774
- ], SaveVideoFileNode.prototype, "overwrite", void 0);
775
- export const WORKSPACE_NODES = [
776
- GetWorkspaceDirNode,
777
- ListWorkspaceFilesNode,
778
- ReadTextFileNode,
779
- WriteTextFileNode,
780
- ReadBinaryFileNode,
781
- WriteBinaryFileNode,
782
- DeleteWorkspaceFileNode,
783
- CreateWorkspaceDirectoryNode,
784
- WorkspaceFileExistsNode,
785
- GetWorkspaceFileInfoNode,
786
- CopyWorkspaceFileNode,
787
- MoveWorkspaceFileNode,
788
- GetWorkspaceFileSizeNode,
789
- IsWorkspaceFileNode,
790
- IsWorkspaceDirectoryNode,
791
- JoinWorkspacePathsNode,
792
- SaveImageFileNode,
793
- SaveVideoFileNode
794
- ];
795
- //# sourceMappingURL=workspace.js.map