@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,909 +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 { existsSync } from "node:fs";
10
- import os from "node:os";
11
- import path from "node:path";
12
- import { spawn } from "node:child_process";
13
- function expandUser(p) {
14
- if (!p)
15
- return p;
16
- if (p === "~")
17
- return os.homedir();
18
- if (p.startsWith("~/"))
19
- return path.join(os.homedir(), p.slice(2));
20
- return p;
21
- }
22
- function toDateTimeValue(date) {
23
- const offsetMin = -date.getTimezoneOffset();
24
- const sign = offsetMin >= 0 ? "+" : "-";
25
- const abs = Math.abs(offsetMin);
26
- const hh = String(Math.floor(abs / 60)).padStart(2, "0");
27
- const mm = String(abs % 60).padStart(2, "0");
28
- return {
29
- year: date.getFullYear(),
30
- month: date.getMonth() + 1,
31
- day: date.getDate(),
32
- hour: date.getHours(),
33
- minute: date.getMinutes(),
34
- second: date.getSeconds(),
35
- millisecond: date.getMilliseconds(),
36
- tzinfo: date.toString().match(/\(([^)]+)\)$/)?.[1] ?? "",
37
- utc_offset: `${sign}${hh}${mm}`
38
- };
39
- }
40
- function wildcardToRegExp(pattern, caseSensitive) {
41
- const escaped = pattern
42
- .replace(/[.+^${}()|[\]\\]/g, "\\$&")
43
- .replace(/\*/g, ".*")
44
- .replace(/\?/g, ".");
45
- return new RegExp(`^${escaped}$`, caseSensitive ? "" : "i");
46
- }
47
- async function walk(dir, recursive) {
48
- const out = [];
49
- const entries = await fs.readdir(dir, { withFileTypes: true });
50
- for (const entry of entries) {
51
- const full = path.join(dir, entry.name);
52
- out.push(full);
53
- if (recursive && entry.isDirectory()) {
54
- out.push(...(await walk(full, recursive)));
55
- }
56
- }
57
- return out;
58
- }
59
- function openPath(target) {
60
- const cmd = process.platform === "darwin"
61
- ? "open"
62
- : process.platform === "win32"
63
- ? "explorer"
64
- : "xdg-open";
65
- return new Promise((resolve, reject) => {
66
- const child = spawn(cmd, [target], { stdio: "ignore" });
67
- child.on("error", reject);
68
- child.on("close", (code) => {
69
- if (code === 0)
70
- resolve();
71
- else
72
- reject(new Error(`Failed to open path: exit ${code}`));
73
- });
74
- });
75
- }
76
- export class WorkspaceDirectoryLibNode extends BaseNode {
77
- static nodeType = "lib.os.WorkspaceDirectory";
78
- static title = "Workspace Directory";
79
- static description = "Get the workspace directory.\n files, workspace, directory";
80
- static metadataOutputTypes = {
81
- output: "str"
82
- };
83
- async process(context) {
84
- return { output: context?.workspaceDir ?? "" };
85
- }
86
- }
87
- export class OpenWorkspaceDirectoryLibNode extends BaseNode {
88
- static nodeType = "lib.os.OpenWorkspaceDirectory";
89
- static title = "Open Workspace Directory";
90
- static description = "Open the workspace directory.\n files, workspace, directory";
91
- static metadataOutputTypes = {
92
- output: "none"
93
- };
94
- async process(context) {
95
- const dir = context?.workspaceDir;
96
- if (!dir)
97
- return {};
98
- await openPath(dir);
99
- return {};
100
- }
101
- }
102
- export class FileExistsLibNode extends BaseNode {
103
- static nodeType = "lib.os.FileExists";
104
- static title = "File Exists";
105
- static description = "Check if a file or directory exists at the specified path.\n files, check, exists\n\n Use cases:\n - Validate file presence before processing\n - Implement conditional logic based on file existence";
106
- static metadataOutputTypes = {
107
- output: "bool"
108
- };
109
- async process() {
110
- const p = String(this.path ?? "");
111
- if (!p)
112
- throw new Error("'path' field cannot be empty");
113
- return { output: existsSync(expandUser(p)) };
114
- }
115
- }
116
- __decorate([
117
- prop({
118
- type: "str",
119
- default: "",
120
- title: "Path",
121
- description: "Path to check for existence"
122
- })
123
- ], FileExistsLibNode.prototype, "path", void 0);
124
- export class ListFilesLibNode extends BaseNode {
125
- static nodeType = "lib.os.ListFiles";
126
- static title = "List Files";
127
- static description = "list files in a directory matching a pattern.\n files, list, directory\n\n Use cases:\n - Get files for batch processing\n - Filter files by extension or pattern";
128
- static metadataOutputTypes = {
129
- file: "str",
130
- files: "list"
131
- };
132
- static isStreamingOutput = true;
133
- async process() {
134
- const folder = expandUser(String(this.folder ?? "~"));
135
- const pattern = String(this.pattern ?? "*");
136
- const includeSubdirectories = Boolean(this.include_subdirectories ?? false);
137
- if (!folder)
138
- throw new Error("directory cannot be empty");
139
- const rx = wildcardToRegExp(pattern, true);
140
- const results = [];
141
- for (const p of await walk(folder, includeSubdirectories)) {
142
- if (rx.test(path.basename(p))) {
143
- results.push(p);
144
- }
145
- }
146
- return {
147
- file: results[0] ?? "",
148
- files: results
149
- };
150
- }
151
- async *genProcess() {
152
- const folder = expandUser(String(this.folder ?? "~"));
153
- const pattern = String(this.pattern ?? "*");
154
- const includeSubdirectories = Boolean(this.include_subdirectories ?? false);
155
- if (!folder)
156
- throw new Error("directory cannot be empty");
157
- const rx = wildcardToRegExp(pattern, true);
158
- const results = [];
159
- for (const p of await walk(folder, includeSubdirectories)) {
160
- if (rx.test(path.basename(p))) {
161
- results.push(p);
162
- yield { file: p };
163
- }
164
- }
165
- yield { files: results };
166
- }
167
- }
168
- __decorate([
169
- prop({
170
- type: "str",
171
- default: "~",
172
- title: "Folder",
173
- description: "Directory to scan"
174
- })
175
- ], ListFilesLibNode.prototype, "folder", void 0);
176
- __decorate([
177
- prop({
178
- type: "str",
179
- default: "*",
180
- title: "Pattern",
181
- description: "File pattern to match (e.g. *.txt)"
182
- })
183
- ], ListFilesLibNode.prototype, "pattern", void 0);
184
- __decorate([
185
- prop({
186
- type: "bool",
187
- default: false,
188
- title: "Include Subdirectories",
189
- description: "Search subdirectories"
190
- })
191
- ], ListFilesLibNode.prototype, "include_subdirectories", void 0);
192
- export class CopyFileLibNode extends BaseNode {
193
- static nodeType = "lib.os.CopyFile";
194
- static title = "Copy File";
195
- static description = "Copy a file from source to destination path.\n files, copy, manage\n\n Use cases:\n - Create file backups\n - Duplicate files for processing\n - Copy files to new locations";
196
- static metadataOutputTypes = {
197
- output: "str"
198
- };
199
- async process() {
200
- const src = expandUser(String(this.source_path ?? ""));
201
- const dst = expandUser(String(this.destination_path ?? ""));
202
- if (!src)
203
- throw new Error("'source_path' field cannot be empty");
204
- if (!dst)
205
- throw new Error("'destination_path' field cannot be empty");
206
- await fs.mkdir(path.dirname(dst), { recursive: true });
207
- const stat = await fs.stat(src);
208
- if (stat.isDirectory()) {
209
- await fs.cp(src, dst, { recursive: true });
210
- }
211
- else {
212
- await fs.copyFile(src, dst);
213
- }
214
- return { output: String(this.destination_path ?? "") };
215
- }
216
- }
217
- __decorate([
218
- prop({
219
- type: "str",
220
- default: "",
221
- title: "Source Path",
222
- description: "Source file path"
223
- })
224
- ], CopyFileLibNode.prototype, "source_path", void 0);
225
- __decorate([
226
- prop({
227
- type: "str",
228
- default: "",
229
- title: "Destination Path",
230
- description: "Destination file path"
231
- })
232
- ], CopyFileLibNode.prototype, "destination_path", void 0);
233
- export class MoveFileLibNode extends BaseNode {
234
- static nodeType = "lib.os.MoveFile";
235
- static title = "Move File";
236
- static description = "Move a file from source to destination path.\n files, move, manage\n\n Use cases:\n - Organize files into directories\n - Process and archive files\n - Relocate completed files";
237
- async process() {
238
- const src = expandUser(String(this.source_path ?? ""));
239
- const dst = expandUser(String(this.destination_path ?? ""));
240
- await fs.mkdir(path.dirname(dst), { recursive: true });
241
- await fs.rename(src, dst);
242
- return {};
243
- }
244
- }
245
- __decorate([
246
- prop({
247
- type: "str",
248
- default: "",
249
- title: "Source Path",
250
- description: "Source file path"
251
- })
252
- ], MoveFileLibNode.prototype, "source_path", void 0);
253
- __decorate([
254
- prop({
255
- type: "str",
256
- default: "",
257
- title: "Destination Path",
258
- description: "Destination file path"
259
- })
260
- ], MoveFileLibNode.prototype, "destination_path", void 0);
261
- export class CreateDirectoryLibNode extends BaseNode {
262
- static nodeType = "lib.os.CreateDirectory";
263
- static title = "Create Directory";
264
- static description = "Create a new directory at specified path.\n files, directory, create\n\n Use cases:\n - Set up directory structure for file organization\n - Create output directories for processed files";
265
- async process() {
266
- const p = expandUser(String(this.path ?? ""));
267
- if (!p)
268
- throw new Error("'path' field cannot be empty");
269
- await fs.mkdir(p, { recursive: Boolean(this.exist_ok ?? true) });
270
- return {};
271
- }
272
- }
273
- __decorate([
274
- prop({
275
- type: "str",
276
- default: "",
277
- title: "Path",
278
- description: "Directory path to create"
279
- })
280
- ], CreateDirectoryLibNode.prototype, "path", void 0);
281
- __decorate([
282
- prop({
283
- type: "bool",
284
- default: true,
285
- title: "Exist Ok",
286
- description: "Don't error if directory already exists"
287
- })
288
- ], CreateDirectoryLibNode.prototype, "exist_ok", void 0);
289
- export class GetFileSizeLibNode extends BaseNode {
290
- static nodeType = "lib.os.GetFileSize";
291
- static title = "Get File Size";
292
- static description = "Get file size in bytes.\n files, metadata, size";
293
- static metadataOutputTypes = {
294
- output: "int"
295
- };
296
- async process() {
297
- const p = expandUser(String(this.path ?? ""));
298
- if (!p)
299
- throw new Error("'path' field cannot be empty");
300
- const stat = await fs.stat(p);
301
- return { output: stat.size };
302
- }
303
- }
304
- __decorate([
305
- prop({
306
- type: "str",
307
- default: "",
308
- title: "Path",
309
- description: "Path to file"
310
- })
311
- ], GetFileSizeLibNode.prototype, "path", void 0);
312
- class FileTimeBase extends BaseNode {
313
- async getTime(kind) {
314
- const p = expandUser(String(this.path ?? ""));
315
- if (!p)
316
- throw new Error("'path' field cannot be empty");
317
- const stat = await fs.stat(p);
318
- const d = kind === "atime"
319
- ? stat.atime
320
- : kind === "ctime"
321
- ? stat.ctime
322
- : stat.mtime;
323
- return { output: toDateTimeValue(d) };
324
- }
325
- }
326
- export class CreatedTimeLibNode extends FileTimeBase {
327
- static nodeType = "lib.os.CreatedTime";
328
- static title = "Created Time";
329
- static description = "Get file creation timestamp.\n files, metadata, created, time";
330
- static metadataOutputTypes = {
331
- output: "datetime"
332
- };
333
- async process() {
334
- return this.getTime("ctime");
335
- }
336
- }
337
- __decorate([
338
- prop({
339
- type: "str",
340
- default: "",
341
- title: "Path",
342
- description: "Path to file"
343
- })
344
- ], CreatedTimeLibNode.prototype, "path", void 0);
345
- export class ModifiedTimeLibNode extends FileTimeBase {
346
- static nodeType = "lib.os.ModifiedTime";
347
- static title = "Modified Time";
348
- static description = "Get file last modified timestamp.\n files, metadata, modified, time";
349
- static metadataOutputTypes = {
350
- output: "datetime"
351
- };
352
- async process() {
353
- return this.getTime("mtime");
354
- }
355
- }
356
- __decorate([
357
- prop({
358
- type: "str",
359
- default: "",
360
- title: "Path",
361
- description: "Path to file"
362
- })
363
- ], ModifiedTimeLibNode.prototype, "path", void 0);
364
- export class AccessedTimeLibNode extends FileTimeBase {
365
- static nodeType = "lib.os.AccessedTime";
366
- static title = "Accessed Time";
367
- static description = "Get file last accessed timestamp.\n files, metadata, accessed, time";
368
- static metadataOutputTypes = {
369
- output: "datetime"
370
- };
371
- async process() {
372
- return this.getTime("atime");
373
- }
374
- }
375
- __decorate([
376
- prop({
377
- type: "str",
378
- default: "",
379
- title: "Path",
380
- description: "Path to file"
381
- })
382
- ], AccessedTimeLibNode.prototype, "path", void 0);
383
- class PathBoolNode extends BaseNode {
384
- readPath() {
385
- const p = expandUser(String(this.path ?? ""));
386
- if (!p)
387
- throw new Error("'path' field cannot be empty");
388
- return p;
389
- }
390
- }
391
- __decorate([
392
- prop({ type: "str", default: "" })
393
- ], PathBoolNode.prototype, "path", void 0);
394
- export class IsFileLibNode extends PathBoolNode {
395
- static nodeType = "lib.os.IsFile";
396
- static title = "Is File";
397
- static description = "Check if path is a file.\n files, metadata, type";
398
- static metadataOutputTypes = {
399
- output: "bool"
400
- };
401
- async process() {
402
- const p = this.readPath();
403
- try {
404
- return { output: (await fs.stat(p)).isFile() };
405
- }
406
- catch {
407
- return { output: false };
408
- }
409
- }
410
- }
411
- __decorate([
412
- prop({
413
- type: "str",
414
- default: "",
415
- title: "Path",
416
- description: "Path to check"
417
- })
418
- ], IsFileLibNode.prototype, "path", void 0);
419
- export class IsDirectoryLibNode extends PathBoolNode {
420
- static nodeType = "lib.os.IsDirectory";
421
- static title = "Is Directory";
422
- static description = "Check if path is a directory.\n files, metadata, type";
423
- static metadataOutputTypes = {
424
- output: "bool"
425
- };
426
- async process() {
427
- const p = this.readPath();
428
- try {
429
- return { output: (await fs.stat(p)).isDirectory() };
430
- }
431
- catch {
432
- return { output: false };
433
- }
434
- }
435
- }
436
- __decorate([
437
- prop({
438
- type: "str",
439
- default: "",
440
- title: "Path",
441
- description: "Path to check"
442
- })
443
- ], IsDirectoryLibNode.prototype, "path", void 0);
444
- export class FileExtensionLibNode extends PathBoolNode {
445
- static nodeType = "lib.os.FileExtension";
446
- static title = "File Extension";
447
- static description = "Get file extension.\n files, metadata, extension";
448
- static metadataOutputTypes = {
449
- output: "str"
450
- };
451
- async process() {
452
- return { output: path.extname(this.readPath()) };
453
- }
454
- }
455
- __decorate([
456
- prop({
457
- type: "str",
458
- default: "",
459
- title: "Path",
460
- description: "Path to file"
461
- })
462
- ], FileExtensionLibNode.prototype, "path", void 0);
463
- export class FileNameLibNode extends PathBoolNode {
464
- static nodeType = "lib.os.FileName";
465
- static title = "File Name";
466
- static description = "Get file name without path.\n files, metadata, name";
467
- static metadataOutputTypes = {
468
- output: "str"
469
- };
470
- async process() {
471
- return { output: path.basename(this.readPath()) };
472
- }
473
- }
474
- __decorate([
475
- prop({
476
- type: "str",
477
- default: "",
478
- title: "Path",
479
- description: "Path to file"
480
- })
481
- ], FileNameLibNode.prototype, "path", void 0);
482
- export class GetDirectoryLibNode extends PathBoolNode {
483
- static nodeType = "lib.os.GetDirectory";
484
- static title = "Get Directory";
485
- static description = "Get directory containing the file.\n files, metadata, directory";
486
- static metadataOutputTypes = {
487
- output: "str"
488
- };
489
- async process() {
490
- return { output: path.dirname(this.readPath()) };
491
- }
492
- }
493
- __decorate([
494
- prop({
495
- type: "str",
496
- default: "",
497
- title: "Path",
498
- description: "Path to file"
499
- })
500
- ], GetDirectoryLibNode.prototype, "path", void 0);
501
- export class FileNameMatchLibNode extends BaseNode {
502
- static nodeType = "lib.os.FileNameMatch";
503
- static title = "File Name Match";
504
- static description = "Match a filename against a pattern using Unix shell-style wildcards.\n files, pattern, match, filter\n\n Use cases:\n - Filter files by name pattern\n - Validate file naming conventions\n - Match file extensions";
505
- static metadataOutputTypes = {
506
- output: "bool"
507
- };
508
- async process() {
509
- const filename = String(this.filename ?? "");
510
- const pattern = String(this.pattern ?? "*");
511
- const caseSensitive = Boolean(this.case_sensitive ?? true);
512
- return {
513
- output: wildcardToRegExp(pattern, caseSensitive).test(caseSensitive ? filename : filename.toLowerCase())
514
- };
515
- }
516
- }
517
- __decorate([
518
- prop({
519
- type: "str",
520
- default: "",
521
- title: "Filename",
522
- description: "Filename to check"
523
- })
524
- ], FileNameMatchLibNode.prototype, "filename", void 0);
525
- __decorate([
526
- prop({
527
- type: "str",
528
- default: "*",
529
- title: "Pattern",
530
- description: "Pattern to match against (e.g. *.txt, data_*.csv)"
531
- })
532
- ], FileNameMatchLibNode.prototype, "pattern", void 0);
533
- __decorate([
534
- prop({
535
- type: "bool",
536
- default: true,
537
- title: "Case Sensitive",
538
- description: "Whether the pattern matching should be case-sensitive"
539
- })
540
- ], FileNameMatchLibNode.prototype, "case_sensitive", void 0);
541
- export class FilterFileNamesLibNode extends BaseNode {
542
- static nodeType = "lib.os.FilterFileNames";
543
- static title = "Filter File Names";
544
- static description = "Filter a list of filenames using Unix shell-style wildcards.\n files, pattern, filter, list\n\n Use cases:\n - Filter multiple files by pattern\n - Batch process files matching criteria\n - Select files by extension";
545
- static metadataOutputTypes = {
546
- output: "list[str]"
547
- };
548
- async process() {
549
- const filenames = Array.isArray(this.filenames)
550
- ? (this.filenames ?? []).map(String)
551
- : [];
552
- const pattern = String(this.pattern ?? "*");
553
- const caseSensitive = Boolean(this.case_sensitive ?? true);
554
- const rx = wildcardToRegExp(pattern, caseSensitive);
555
- const output = filenames.filter((name) => rx.test(caseSensitive ? name : name.toLowerCase()));
556
- return { output };
557
- }
558
- }
559
- __decorate([
560
- prop({
561
- type: "list[str]",
562
- default: [],
563
- title: "Filenames",
564
- description: "list of filenames to filter"
565
- })
566
- ], FilterFileNamesLibNode.prototype, "filenames", void 0);
567
- __decorate([
568
- prop({
569
- type: "str",
570
- default: "*",
571
- title: "Pattern",
572
- description: "Pattern to filter by (e.g. *.txt, data_*.csv)"
573
- })
574
- ], FilterFileNamesLibNode.prototype, "pattern", void 0);
575
- __decorate([
576
- prop({
577
- type: "bool",
578
- default: true,
579
- title: "Case Sensitive",
580
- description: "Whether the pattern matching should be case-sensitive"
581
- })
582
- ], FilterFileNamesLibNode.prototype, "case_sensitive", void 0);
583
- export class BasenameLibNode extends BaseNode {
584
- static nodeType = "lib.os.Basename";
585
- static title = "Basename";
586
- static description = "Get the base name component of a file path.\n files, path, basename\n\n Use cases:\n - Extract filename from full path\n - Get file name without directory\n - Process file names independently";
587
- static metadataOutputTypes = {
588
- output: "str"
589
- };
590
- async process() {
591
- const p = expandUser(String(this.path ?? ""));
592
- if (p.trim() === "")
593
- throw new Error("path is empty");
594
- const basename = path.basename(p);
595
- if (this.remove_extension ?? false) {
596
- return { output: path.parse(basename).name };
597
- }
598
- return { output: basename };
599
- }
600
- }
601
- __decorate([
602
- prop({
603
- type: "str",
604
- default: "",
605
- title: "Path",
606
- description: "File path to get basename from"
607
- })
608
- ], BasenameLibNode.prototype, "path", void 0);
609
- __decorate([
610
- prop({
611
- type: "bool",
612
- default: false,
613
- title: "Remove Extension",
614
- description: "Remove file extension from basename"
615
- })
616
- ], BasenameLibNode.prototype, "remove_extension", void 0);
617
- export class DirnameLibNode extends BaseNode {
618
- static nodeType = "lib.os.Dirname";
619
- static title = "Dirname";
620
- static description = "Get the directory name component of a file path.\n files, path, dirname\n\n Use cases:\n - Extract directory path from full path\n - Get parent directory\n - Process directory paths";
621
- static metadataOutputTypes = {
622
- output: "str"
623
- };
624
- async process() {
625
- return { output: path.dirname(expandUser(String(this.path ?? ""))) };
626
- }
627
- }
628
- __decorate([
629
- prop({
630
- type: "str",
631
- default: "",
632
- title: "Path",
633
- description: "File path to get dirname from"
634
- })
635
- ], DirnameLibNode.prototype, "path", void 0);
636
- export class JoinPathsLibNode extends BaseNode {
637
- static nodeType = "lib.os.JoinPaths";
638
- static title = "Join Paths";
639
- static description = "Joins path components.\n path, join, combine\n\n Use cases:\n - Build file paths\n - Create cross-platform paths";
640
- static metadataOutputTypes = {
641
- output: "str"
642
- };
643
- async process() {
644
- const parts = Array.isArray(this.paths)
645
- ? (this.paths ?? []).map(String)
646
- : [];
647
- if (parts.length === 0)
648
- throw new Error("paths cannot be empty");
649
- return { output: path.join(...parts) };
650
- }
651
- }
652
- __decorate([
653
- prop({
654
- type: "list[str]",
655
- default: [],
656
- title: "Paths",
657
- description: "Path components to join"
658
- })
659
- ], JoinPathsLibNode.prototype, "paths", void 0);
660
- export class NormalizePathLibNode extends BaseNode {
661
- static nodeType = "lib.os.NormalizePath";
662
- static title = "Normalize Path";
663
- static description = "Normalizes a path.\n path, normalize, clean\n\n Use cases:\n - Standardize paths\n - Remove redundant separators";
664
- static metadataOutputTypes = {
665
- output: "str"
666
- };
667
- async process() {
668
- const p = String(this.path ?? "");
669
- if (!p)
670
- throw new Error("path cannot be empty");
671
- return { output: path.normalize(p) };
672
- }
673
- }
674
- __decorate([
675
- prop({
676
- type: "str",
677
- default: "",
678
- title: "Path",
679
- description: "Path to normalize"
680
- })
681
- ], NormalizePathLibNode.prototype, "path", void 0);
682
- export class GetPathInfoLibNode extends BaseNode {
683
- static nodeType = "lib.os.GetPathInfo";
684
- static title = "Get Path Info";
685
- static description = "Gets information about a path.\n path, info, metadata\n\n Use cases:\n - Extract path components\n - Parse file paths";
686
- static metadataOutputTypes = {
687
- output: "dict"
688
- };
689
- async process() {
690
- const p = String(this.path ?? "");
691
- const abs = path.resolve(p);
692
- let stat = null;
693
- try {
694
- stat = await fs.lstat(p);
695
- }
696
- catch {
697
- /* stat stays null if path doesn't exist */
698
- }
699
- return {
700
- output: {
701
- dirname: path.dirname(p),
702
- basename: path.basename(p),
703
- extension: path.extname(p),
704
- absolute: abs,
705
- exists: existsSync(p),
706
- is_file: stat?.isFile() ?? false,
707
- is_dir: stat?.isDirectory() ?? false,
708
- is_symlink: stat?.isSymbolicLink() ?? false
709
- }
710
- };
711
- }
712
- }
713
- __decorate([
714
- prop({
715
- type: "str",
716
- default: "",
717
- title: "Path",
718
- description: "Path to analyze"
719
- })
720
- ], GetPathInfoLibNode.prototype, "path", void 0);
721
- export class AbsolutePathLibNode extends BaseNode {
722
- static nodeType = "lib.os.AbsolutePath";
723
- static title = "Absolute Path";
724
- static description = "Return the absolute path of a file or directory.\n files, path, absolute\n\n Use cases:\n - Convert relative paths to absolute\n - Get full system path\n - Resolve path references";
725
- static metadataOutputTypes = {
726
- output: "str"
727
- };
728
- async process() {
729
- const p = expandUser(String(this.path ?? ""));
730
- if (!p)
731
- throw new Error("path cannot be empty");
732
- return { output: path.resolve(p) };
733
- }
734
- }
735
- __decorate([
736
- prop({
737
- type: "str",
738
- default: "",
739
- title: "Path",
740
- description: "Path to convert to absolute"
741
- })
742
- ], AbsolutePathLibNode.prototype, "path", void 0);
743
- export class SplitPathLibNode extends BaseNode {
744
- static nodeType = "lib.os.SplitPath";
745
- static title = "Split Path";
746
- static description = "Split a path into directory and file components.\n files, path, split\n\n Use cases:\n - Separate directory from filename\n - Process path components separately\n - Extract path parts";
747
- static metadataOutputTypes = {
748
- output: "dict"
749
- };
750
- async process() {
751
- const p = expandUser(String(this.path ?? ""));
752
- return { dirname: path.dirname(p), basename: path.basename(p) };
753
- }
754
- }
755
- __decorate([
756
- prop({
757
- type: "str",
758
- default: "",
759
- title: "Path",
760
- description: "Path to split"
761
- })
762
- ], SplitPathLibNode.prototype, "path", void 0);
763
- export class SplitExtensionLibNode extends BaseNode {
764
- static nodeType = "lib.os.SplitExtension";
765
- static title = "Split Extension";
766
- static description = "Split a path into root and extension components.\n files, path, extension, split\n\n Use cases:\n - Extract file extension\n - Process filename without extension\n - Handle file types";
767
- static metadataOutputTypes = {
768
- output: "dict"
769
- };
770
- async process() {
771
- const p = expandUser(String(this.path ?? ""));
772
- const parsed = path.parse(p);
773
- return { root: path.join(parsed.dir, parsed.name), extension: parsed.ext };
774
- }
775
- }
776
- __decorate([
777
- prop({
778
- type: "str",
779
- default: "",
780
- title: "Path",
781
- description: "Path to split"
782
- })
783
- ], SplitExtensionLibNode.prototype, "path", void 0);
784
- export class RelativePathLibNode extends BaseNode {
785
- static nodeType = "lib.os.RelativePath";
786
- static title = "Relative Path";
787
- static description = "Return a relative path to a target from a start directory.\n files, path, relative\n\n Use cases:\n - Create relative path references\n - Generate portable paths\n - Compare file locations";
788
- static metadataOutputTypes = {
789
- output: "str"
790
- };
791
- async process() {
792
- const target = expandUser(String(this.target_path ?? ""));
793
- const start = expandUser(String(this.start_path ?? "."));
794
- if (!target)
795
- throw new Error("target_path cannot be empty");
796
- return { output: path.relative(start, target) };
797
- }
798
- }
799
- __decorate([
800
- prop({
801
- type: "str",
802
- default: "",
803
- title: "Target Path",
804
- description: "Target path to convert to relative"
805
- })
806
- ], RelativePathLibNode.prototype, "target_path", void 0);
807
- __decorate([
808
- prop({
809
- type: "str",
810
- default: ".",
811
- title: "Start Path",
812
- description: "Start path for relative conversion"
813
- })
814
- ], RelativePathLibNode.prototype, "start_path", void 0);
815
- export class PathToStringLibNode extends BaseNode {
816
- static nodeType = "lib.os.PathToString";
817
- static title = "Path To String";
818
- static description = "Convert a FilePath object to a string.\n files, path, string, convert\n\n Use cases:\n - Get raw string path from FilePath object\n - Convert FilePath for string operations\n - Extract path string for external use";
819
- static metadataOutputTypes = {
820
- output: "str"
821
- };
822
- async process() {
823
- const filePath = String(this.file_path ?? "");
824
- if (!filePath)
825
- throw new Error("file_path cannot be empty");
826
- return { output: filePath };
827
- }
828
- }
829
- __decorate([
830
- prop({
831
- type: "str",
832
- default: "",
833
- title: "File Path",
834
- description: "File path to convert to string"
835
- })
836
- ], PathToStringLibNode.prototype, "file_path", void 0);
837
- export class ShowNotificationLibNode extends BaseNode {
838
- static nodeType = "lib.os.ShowNotification";
839
- static title = "Show Notification";
840
- static description = "Shows a system notification.\n notification, system, alert\n\n Use cases:\n - Alert user of completed tasks\n - Show process status\n - Display important messages";
841
- static metadataOutputTypes = {
842
- output: "none"
843
- };
844
- async process() {
845
- const title = String(this.title ?? "");
846
- const message = String(this.message ?? "");
847
- if (!title)
848
- throw new Error("title cannot be empty");
849
- if (!message)
850
- throw new Error("message cannot be empty");
851
- return {};
852
- }
853
- }
854
- __decorate([
855
- prop({
856
- type: "str",
857
- default: "",
858
- title: "Title",
859
- description: "Title of the notification"
860
- })
861
- ], ShowNotificationLibNode.prototype, "title", void 0);
862
- __decorate([
863
- prop({
864
- type: "str",
865
- default: "",
866
- title: "Message",
867
- description: "Content of the notification"
868
- })
869
- ], ShowNotificationLibNode.prototype, "message", void 0);
870
- __decorate([
871
- prop({
872
- type: "int",
873
- default: 10,
874
- title: "Timeout",
875
- description: "How long the notification should stay visible (in seconds)"
876
- })
877
- ], ShowNotificationLibNode.prototype, "timeout", void 0);
878
- export const LIB_OS_NODES = [
879
- WorkspaceDirectoryLibNode,
880
- OpenWorkspaceDirectoryLibNode,
881
- FileExistsLibNode,
882
- ListFilesLibNode,
883
- CopyFileLibNode,
884
- MoveFileLibNode,
885
- CreateDirectoryLibNode,
886
- GetFileSizeLibNode,
887
- CreatedTimeLibNode,
888
- ModifiedTimeLibNode,
889
- AccessedTimeLibNode,
890
- IsFileLibNode,
891
- IsDirectoryLibNode,
892
- FileExtensionLibNode,
893
- FileNameLibNode,
894
- GetDirectoryLibNode,
895
- FileNameMatchLibNode,
896
- FilterFileNamesLibNode,
897
- BasenameLibNode,
898
- DirnameLibNode,
899
- JoinPathsLibNode,
900
- NormalizePathLibNode,
901
- GetPathInfoLibNode,
902
- AbsolutePathLibNode,
903
- SplitPathLibNode,
904
- SplitExtensionLibNode,
905
- RelativePathLibNode,
906
- PathToStringLibNode,
907
- ShowNotificationLibNode
908
- ];
909
- //# sourceMappingURL=lib-os.js.map