@nodetool-ai/base-nodes 0.7.0-rc.11

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 (353) hide show
  1. package/dist/index.d.ts +72 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +270 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/lib/audio-wav.d.ts +66 -0
  6. package/dist/lib/audio-wav.d.ts.map +1 -0
  7. package/dist/lib/audio-wav.js +215 -0
  8. package/dist/lib/audio-wav.js.map +1 -0
  9. package/dist/nodes/agents.d.ts +253 -0
  10. package/dist/nodes/agents.d.ts.map +1 -0
  11. package/dist/nodes/agents.js +2784 -0
  12. package/dist/nodes/agents.js.map +1 -0
  13. package/dist/nodes/anthropic.d.ts +26 -0
  14. package/dist/nodes/anthropic.d.ts.map +1 -0
  15. package/dist/nodes/anthropic.js +133 -0
  16. package/dist/nodes/anthropic.js.map +1 -0
  17. package/dist/nodes/apify.d.ts +120 -0
  18. package/dist/nodes/apify.d.ts.map +1 -0
  19. package/dist/nodes/apify.js +618 -0
  20. package/dist/nodes/apify.js.map +1 -0
  21. package/dist/nodes/audio.d.ts +301 -0
  22. package/dist/nodes/audio.d.ts.map +1 -0
  23. package/dist/nodes/audio.js +1274 -0
  24. package/dist/nodes/audio.js.map +1 -0
  25. package/dist/nodes/code-node.d.ts +34 -0
  26. package/dist/nodes/code-node.d.ts.map +1 -0
  27. package/dist/nodes/code-node.js +343 -0
  28. package/dist/nodes/code-node.js.map +1 -0
  29. package/dist/nodes/code.d.ts +301 -0
  30. package/dist/nodes/code.d.ts.map +1 -0
  31. package/dist/nodes/code.js +850 -0
  32. package/dist/nodes/code.js.map +1 -0
  33. package/dist/nodes/compare.d.ts +18 -0
  34. package/dist/nodes/compare.d.ts.map +1 -0
  35. package/dist/nodes/compare.js +122 -0
  36. package/dist/nodes/compare.js.map +1 -0
  37. package/dist/nodes/constant.d.ts +315 -0
  38. package/dist/nodes/constant.d.ts.map +1 -0
  39. package/dist/nodes/constant.js +715 -0
  40. package/dist/nodes/constant.js.map +1 -0
  41. package/dist/nodes/control.d.ts +83 -0
  42. package/dist/nodes/control.d.ts.map +1 -0
  43. package/dist/nodes/control.js +212 -0
  44. package/dist/nodes/control.js.map +1 -0
  45. package/dist/nodes/data.d.ts +369 -0
  46. package/dist/nodes/data.d.ts.map +1 -0
  47. package/dist/nodes/data.js +1590 -0
  48. package/dist/nodes/data.js.map +1 -0
  49. package/dist/nodes/document.d.ts +134 -0
  50. package/dist/nodes/document.d.ts.map +1 -0
  51. package/dist/nodes/document.js +984 -0
  52. package/dist/nodes/document.js.map +1 -0
  53. package/dist/nodes/extended-placeholders.d.ts +6 -0
  54. package/dist/nodes/extended-placeholders.d.ts.map +1 -0
  55. package/dist/nodes/extended-placeholders.js +19 -0
  56. package/dist/nodes/extended-placeholders.js.map +1 -0
  57. package/dist/nodes/gemini.d.ts +109 -0
  58. package/dist/nodes/gemini.d.ts.map +1 -0
  59. package/dist/nodes/gemini.js +861 -0
  60. package/dist/nodes/gemini.js.map +1 -0
  61. package/dist/nodes/generators.d.ts +84 -0
  62. package/dist/nodes/generators.d.ts.map +1 -0
  63. package/dist/nodes/generators.js +937 -0
  64. package/dist/nodes/generators.js.map +1 -0
  65. package/dist/nodes/image.d.ts +232 -0
  66. package/dist/nodes/image.d.ts.map +1 -0
  67. package/dist/nodes/image.js +1395 -0
  68. package/dist/nodes/image.js.map +1 -0
  69. package/dist/nodes/input.d.ts +445 -0
  70. package/dist/nodes/input.d.ts.map +1 -0
  71. package/dist/nodes/input.js +1459 -0
  72. package/dist/nodes/input.js.map +1 -0
  73. package/dist/nodes/kie-dynamic.d.ts +31 -0
  74. package/dist/nodes/kie-dynamic.d.ts.map +1 -0
  75. package/dist/nodes/kie-dynamic.js +270 -0
  76. package/dist/nodes/kie-dynamic.js.map +1 -0
  77. package/dist/nodes/lib-audio-dsp.d.ts +85 -0
  78. package/dist/nodes/lib-audio-dsp.d.ts.map +1 -0
  79. package/dist/nodes/lib-audio-dsp.js +450 -0
  80. package/dist/nodes/lib-audio-dsp.js.map +1 -0
  81. package/dist/nodes/lib-audio-effects.d.ts +116 -0
  82. package/dist/nodes/lib-audio-effects.d.ts.map +1 -0
  83. package/dist/nodes/lib-audio-effects.js +905 -0
  84. package/dist/nodes/lib-audio-effects.js.map +1 -0
  85. package/dist/nodes/lib-browser.d.ts +99 -0
  86. package/dist/nodes/lib-browser.d.ts.map +1 -0
  87. package/dist/nodes/lib-browser.js +692 -0
  88. package/dist/nodes/lib-browser.js.map +1 -0
  89. package/dist/nodes/lib-charts.d.ts +20 -0
  90. package/dist/nodes/lib-charts.d.ts.map +1 -0
  91. package/dist/nodes/lib-charts.js +245 -0
  92. package/dist/nodes/lib-charts.js.map +1 -0
  93. package/dist/nodes/lib-datetime.d.ts +108 -0
  94. package/dist/nodes/lib-datetime.d.ts.map +1 -0
  95. package/dist/nodes/lib-datetime.js +421 -0
  96. package/dist/nodes/lib-datetime.js.map +1 -0
  97. package/dist/nodes/lib-doc-convert.d.ts +19 -0
  98. package/dist/nodes/lib-doc-convert.d.ts.map +1 -0
  99. package/dist/nodes/lib-doc-convert.js +257 -0
  100. package/dist/nodes/lib-doc-convert.js.map +1 -0
  101. package/dist/nodes/lib-doc-transform.d.ts +39 -0
  102. package/dist/nodes/lib-doc-transform.d.ts.map +1 -0
  103. package/dist/nodes/lib-doc-transform.js +335 -0
  104. package/dist/nodes/lib-doc-transform.js.map +1 -0
  105. package/dist/nodes/lib-docx.d.ts +106 -0
  106. package/dist/nodes/lib-docx.d.ts.map +1 -0
  107. package/dist/nodes/lib-docx.js +595 -0
  108. package/dist/nodes/lib-docx.js.map +1 -0
  109. package/dist/nodes/lib-epub.d.ts +55 -0
  110. package/dist/nodes/lib-epub.d.ts.map +1 -0
  111. package/dist/nodes/lib-epub.js +220 -0
  112. package/dist/nodes/lib-epub.js.map +1 -0
  113. package/dist/nodes/lib-excel.d.ts +74 -0
  114. package/dist/nodes/lib-excel.d.ts.map +1 -0
  115. package/dist/nodes/lib-excel.js +448 -0
  116. package/dist/nodes/lib-excel.js.map +1 -0
  117. package/dist/nodes/lib-graphql.d.ts +66 -0
  118. package/dist/nodes/lib-graphql.d.ts.map +1 -0
  119. package/dist/nodes/lib-graphql.js +333 -0
  120. package/dist/nodes/lib-graphql.js.map +1 -0
  121. package/dist/nodes/lib-grid.d.ts +27 -0
  122. package/dist/nodes/lib-grid.d.ts.map +1 -0
  123. package/dist/nodes/lib-grid.js +172 -0
  124. package/dist/nodes/lib-grid.js.map +1 -0
  125. package/dist/nodes/lib-html-parse.d.ts +108 -0
  126. package/dist/nodes/lib-html-parse.d.ts.map +1 -0
  127. package/dist/nodes/lib-html-parse.js +365 -0
  128. package/dist/nodes/lib-html-parse.js.map +1 -0
  129. package/dist/nodes/lib-http.d.ts +98 -0
  130. package/dist/nodes/lib-http.d.ts.map +1 -0
  131. package/dist/nodes/lib-http.js +267 -0
  132. package/dist/nodes/lib-http.js.map +1 -0
  133. package/dist/nodes/lib-image-color-grading.d.ts +3 -0
  134. package/dist/nodes/lib-image-color-grading.d.ts.map +1 -0
  135. package/dist/nodes/lib-image-color-grading.js +1386 -0
  136. package/dist/nodes/lib-image-color-grading.js.map +1 -0
  137. package/dist/nodes/lib-image-draw.d.ts +3 -0
  138. package/dist/nodes/lib-image-draw.d.ts.map +1 -0
  139. package/dist/nodes/lib-image-draw.js +470 -0
  140. package/dist/nodes/lib-image-draw.js.map +1 -0
  141. package/dist/nodes/lib-image-enhance.d.ts +3 -0
  142. package/dist/nodes/lib-image-enhance.d.ts.map +1 -0
  143. package/dist/nodes/lib-image-enhance.js +731 -0
  144. package/dist/nodes/lib-image-enhance.js.map +1 -0
  145. package/dist/nodes/lib-image-filter.d.ts +3 -0
  146. package/dist/nodes/lib-image-filter.d.ts.map +1 -0
  147. package/dist/nodes/lib-image-filter.js +684 -0
  148. package/dist/nodes/lib-image-filter.js.map +1 -0
  149. package/dist/nodes/lib-image-utils.d.ts +24 -0
  150. package/dist/nodes/lib-image-utils.d.ts.map +1 -0
  151. package/dist/nodes/lib-image-utils.js +150 -0
  152. package/dist/nodes/lib-image-utils.js.map +1 -0
  153. package/dist/nodes/lib-mail.d.ts +74 -0
  154. package/dist/nodes/lib-mail.d.ts.map +1 -0
  155. package/dist/nodes/lib-mail.js +452 -0
  156. package/dist/nodes/lib-mail.js.map +1 -0
  157. package/dist/nodes/lib-markdown.d.ts +70 -0
  158. package/dist/nodes/lib-markdown.d.ts.map +1 -0
  159. package/dist/nodes/lib-markdown.js +236 -0
  160. package/dist/nodes/lib-markdown.js.map +1 -0
  161. package/dist/nodes/lib-nlp.d.ts +98 -0
  162. package/dist/nodes/lib-nlp.d.ts.map +1 -0
  163. package/dist/nodes/lib-nlp.js +374 -0
  164. package/dist/nodes/lib-nlp.js.map +1 -0
  165. package/dist/nodes/lib-notion.d.ts +99 -0
  166. package/dist/nodes/lib-notion.d.ts.map +1 -0
  167. package/dist/nodes/lib-notion.js +601 -0
  168. package/dist/nodes/lib-notion.js.map +1 -0
  169. package/dist/nodes/lib-ocr.d.ts +31 -0
  170. package/dist/nodes/lib-ocr.d.ts.map +1 -0
  171. package/dist/nodes/lib-ocr.js +143 -0
  172. package/dist/nodes/lib-ocr.js.map +1 -0
  173. package/dist/nodes/lib-os.d.ts +312 -0
  174. package/dist/nodes/lib-os.d.ts.map +1 -0
  175. package/dist/nodes/lib-os.js +909 -0
  176. package/dist/nodes/lib-os.js.map +1 -0
  177. package/dist/nodes/lib-pdf.d.ts +142 -0
  178. package/dist/nodes/lib-pdf.d.ts.map +1 -0
  179. package/dist/nodes/lib-pdf.js +871 -0
  180. package/dist/nodes/lib-pdf.js.map +1 -0
  181. package/dist/nodes/lib-pptx.d.ts +29 -0
  182. package/dist/nodes/lib-pptx.d.ts.map +1 -0
  183. package/dist/nodes/lib-pptx.js +122 -0
  184. package/dist/nodes/lib-pptx.js.map +1 -0
  185. package/dist/nodes/lib-rss.d.ts +31 -0
  186. package/dist/nodes/lib-rss.d.ts.map +1 -0
  187. package/dist/nodes/lib-rss.js +163 -0
  188. package/dist/nodes/lib-rss.js.map +1 -0
  189. package/dist/nodes/lib-s3.d.ts +112 -0
  190. package/dist/nodes/lib-s3.d.ts.map +1 -0
  191. package/dist/nodes/lib-s3.js +521 -0
  192. package/dist/nodes/lib-s3.js.map +1 -0
  193. package/dist/nodes/lib-secret.d.ts +15 -0
  194. package/dist/nodes/lib-secret.d.ts.map +1 -0
  195. package/dist/nodes/lib-secret.js +42 -0
  196. package/dist/nodes/lib-secret.js.map +1 -0
  197. package/dist/nodes/lib-sqlite.d.ts +102 -0
  198. package/dist/nodes/lib-sqlite.d.ts.map +1 -0
  199. package/dist/nodes/lib-sqlite.js +532 -0
  200. package/dist/nodes/lib-sqlite.js.map +1 -0
  201. package/dist/nodes/lib-supabase.d.ts +86 -0
  202. package/dist/nodes/lib-supabase.d.ts.map +1 -0
  203. package/dist/nodes/lib-supabase.js +425 -0
  204. package/dist/nodes/lib-supabase.js.map +1 -0
  205. package/dist/nodes/lib-svg.d.ts +199 -0
  206. package/dist/nodes/lib-svg.d.ts.map +1 -0
  207. package/dist/nodes/lib-svg.js +1027 -0
  208. package/dist/nodes/lib-svg.js.map +1 -0
  209. package/dist/nodes/lib-tensorflow.d.ts +71 -0
  210. package/dist/nodes/lib-tensorflow.d.ts.map +1 -0
  211. package/dist/nodes/lib-tensorflow.js +351 -0
  212. package/dist/nodes/lib-tensorflow.js.map +1 -0
  213. package/dist/nodes/lib-twilio.d.ts +71 -0
  214. package/dist/nodes/lib-twilio.d.ts.map +1 -0
  215. package/dist/nodes/lib-twilio.js +469 -0
  216. package/dist/nodes/lib-twilio.js.map +1 -0
  217. package/dist/nodes/lib-validate.d.ts +84 -0
  218. package/dist/nodes/lib-validate.d.ts.map +1 -0
  219. package/dist/nodes/lib-validate.js +215 -0
  220. package/dist/nodes/lib-validate.js.map +1 -0
  221. package/dist/nodes/lib-video-download.d.ts +26 -0
  222. package/dist/nodes/lib-video-download.d.ts.map +1 -0
  223. package/dist/nodes/lib-video-download.js +299 -0
  224. package/dist/nodes/lib-video-download.js.map +1 -0
  225. package/dist/nodes/messaging.d.ts +88 -0
  226. package/dist/nodes/messaging.d.ts.map +1 -0
  227. package/dist/nodes/messaging.js +418 -0
  228. package/dist/nodes/messaging.js.map +1 -0
  229. package/dist/nodes/mistral.d.ts +83 -0
  230. package/dist/nodes/mistral.d.ts.map +1 -0
  231. package/dist/nodes/mistral.js +450 -0
  232. package/dist/nodes/mistral.js.map +1 -0
  233. package/dist/nodes/model3d/analysis.d.ts +13 -0
  234. package/dist/nodes/model3d/analysis.d.ts.map +1 -0
  235. package/dist/nodes/model3d/analysis.js +36 -0
  236. package/dist/nodes/model3d/analysis.js.map +1 -0
  237. package/dist/nodes/model3d/base.d.ts +11 -0
  238. package/dist/nodes/model3d/base.d.ts.map +1 -0
  239. package/dist/nodes/model3d/base.js +20 -0
  240. package/dist/nodes/model3d/base.js.map +1 -0
  241. package/dist/nodes/model3d/boolean-ops.d.ts +2 -0
  242. package/dist/nodes/model3d/boolean-ops.d.ts.map +1 -0
  243. package/dist/nodes/model3d/boolean-ops.js +172 -0
  244. package/dist/nodes/model3d/boolean-ops.js.map +1 -0
  245. package/dist/nodes/model3d/cleanup.d.ts +47 -0
  246. package/dist/nodes/model3d/cleanup.d.ts.map +1 -0
  247. package/dist/nodes/model3d/cleanup.js +136 -0
  248. package/dist/nodes/model3d/cleanup.js.map +1 -0
  249. package/dist/nodes/model3d/convert.d.ts +14 -0
  250. package/dist/nodes/model3d/convert.d.ts.map +1 -0
  251. package/dist/nodes/model3d/convert.js +64 -0
  252. package/dist/nodes/model3d/convert.js.map +1 -0
  253. package/dist/nodes/model3d/defaults.d.ts +34 -0
  254. package/dist/nodes/model3d/defaults.d.ts.map +1 -0
  255. package/dist/nodes/model3d/defaults.js +28 -0
  256. package/dist/nodes/model3d/defaults.js.map +1 -0
  257. package/dist/nodes/model3d/document-ops.d.ts +4 -0
  258. package/dist/nodes/model3d/document-ops.d.ts.map +1 -0
  259. package/dist/nodes/model3d/document-ops.js +40 -0
  260. package/dist/nodes/model3d/document-ops.js.map +1 -0
  261. package/dist/nodes/model3d/generation.d.ts +39 -0
  262. package/dist/nodes/model3d/generation.d.ts.map +1 -0
  263. package/dist/nodes/model3d/generation.js +179 -0
  264. package/dist/nodes/model3d/generation.js.map +1 -0
  265. package/dist/nodes/model3d/glb.d.ts +29 -0
  266. package/dist/nodes/model3d/glb.d.ts.map +1 -0
  267. package/dist/nodes/model3d/glb.js +255 -0
  268. package/dist/nodes/model3d/glb.js.map +1 -0
  269. package/dist/nodes/model3d/index.d.ts +20 -0
  270. package/dist/nodes/model3d/index.d.ts.map +1 -0
  271. package/dist/nodes/model3d/index.js +38 -0
  272. package/dist/nodes/model3d/index.js.map +1 -0
  273. package/dist/nodes/model3d/io.d.ts +38 -0
  274. package/dist/nodes/model3d/io.d.ts.map +1 -0
  275. package/dist/nodes/model3d/io.js +162 -0
  276. package/dist/nodes/model3d/io.js.map +1 -0
  277. package/dist/nodes/model3d/mesh-ops.d.ts +40 -0
  278. package/dist/nodes/model3d/mesh-ops.d.ts.map +1 -0
  279. package/dist/nodes/model3d/mesh-ops.js +775 -0
  280. package/dist/nodes/model3d/mesh-ops.js.map +1 -0
  281. package/dist/nodes/model3d/nodes.d.ts +2 -0
  282. package/dist/nodes/model3d/nodes.d.ts.map +1 -0
  283. package/dist/nodes/model3d/nodes.js +2 -0
  284. package/dist/nodes/model3d/nodes.js.map +1 -0
  285. package/dist/nodes/model3d/ops.d.ts +37 -0
  286. package/dist/nodes/model3d/ops.d.ts.map +1 -0
  287. package/dist/nodes/model3d/ops.js +137 -0
  288. package/dist/nodes/model3d/ops.js.map +1 -0
  289. package/dist/nodes/model3d/transforms.d.ts +49 -0
  290. package/dist/nodes/model3d/transforms.d.ts.map +1 -0
  291. package/dist/nodes/model3d/transforms.js +142 -0
  292. package/dist/nodes/model3d/transforms.js.map +1 -0
  293. package/dist/nodes/model3d/types.d.ts +81 -0
  294. package/dist/nodes/model3d/types.d.ts.map +1 -0
  295. package/dist/nodes/model3d/types.js +2 -0
  296. package/dist/nodes/model3d/types.js.map +1 -0
  297. package/dist/nodes/model3d/utils.d.ts +34 -0
  298. package/dist/nodes/model3d/utils.d.ts.map +1 -0
  299. package/dist/nodes/model3d/utils.js +185 -0
  300. package/dist/nodes/model3d/utils.js.map +1 -0
  301. package/dist/nodes/model3d.d.ts +2 -0
  302. package/dist/nodes/model3d.d.ts.map +1 -0
  303. package/dist/nodes/model3d.js +2 -0
  304. package/dist/nodes/model3d.js.map +1 -0
  305. package/dist/nodes/openai.d.ts +172 -0
  306. package/dist/nodes/openai.d.ts.map +1 -0
  307. package/dist/nodes/openai.js +1294 -0
  308. package/dist/nodes/openai.js.map +1 -0
  309. package/dist/nodes/output.d.ts +29 -0
  310. package/dist/nodes/output.d.ts.map +1 -0
  311. package/dist/nodes/output.js +87 -0
  312. package/dist/nodes/output.js.map +1 -0
  313. package/dist/nodes/sandbox.d.ts +67 -0
  314. package/dist/nodes/sandbox.d.ts.map +1 -0
  315. package/dist/nodes/sandbox.js +681 -0
  316. package/dist/nodes/sandbox.js.map +1 -0
  317. package/dist/nodes/search.d.ts +117 -0
  318. package/dist/nodes/search.d.ts.map +1 -0
  319. package/dist/nodes/search.js +607 -0
  320. package/dist/nodes/search.js.map +1 -0
  321. package/dist/nodes/team.d.ts +74 -0
  322. package/dist/nodes/team.d.ts.map +1 -0
  323. package/dist/nodes/team.js +304 -0
  324. package/dist/nodes/team.js.map +1 -0
  325. package/dist/nodes/text-extra.d.ts +633 -0
  326. package/dist/nodes/text-extra.d.ts.map +1 -0
  327. package/dist/nodes/text-extra.js +2226 -0
  328. package/dist/nodes/text-extra.js.map +1 -0
  329. package/dist/nodes/tool-agents.d.ts +334 -0
  330. package/dist/nodes/tool-agents.d.ts.map +1 -0
  331. package/dist/nodes/tool-agents.js +1861 -0
  332. package/dist/nodes/tool-agents.js.map +1 -0
  333. package/dist/nodes/triggers.d.ts +107 -0
  334. package/dist/nodes/triggers.d.ts.map +1 -0
  335. package/dist/nodes/triggers.js +706 -0
  336. package/dist/nodes/triggers.js.map +1 -0
  337. package/dist/nodes/vector.d.ts +168 -0
  338. package/dist/nodes/vector.d.ts.map +1 -0
  339. package/dist/nodes/vector.js +1121 -0
  340. package/dist/nodes/vector.js.map +1 -0
  341. package/dist/nodes/video.d.ts +387 -0
  342. package/dist/nodes/video.d.ts.map +1 -0
  343. package/dist/nodes/video.js +2361 -0
  344. package/dist/nodes/video.js.map +1 -0
  345. package/dist/nodes/workflow.d.ts +24 -0
  346. package/dist/nodes/workflow.d.ts.map +1 -0
  347. package/dist/nodes/workflow.js +146 -0
  348. package/dist/nodes/workflow.js.map +1 -0
  349. package/dist/nodes/workspace.d.ts +203 -0
  350. package/dist/nodes/workspace.d.ts.map +1 -0
  351. package/dist/nodes/workspace.js +795 -0
  352. package/dist/nodes/workspace.js.map +1 -0
  353. package/package.json +103 -0
@@ -0,0 +1,681 @@
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 { DockerSandboxProvider, SessionStore } from "@nodetool-ai/sandbox";
9
+ import { randomUUID } from "node:crypto";
10
+ import { runAgentLoop } from "./agents.js";
11
+ const DEFAULT_SCOPE_USER = "no-user";
12
+ const DEFAULT_SCOPE_WORKFLOW = "no-workflow";
13
+ const DEFAULT_SESSION_ID = "workflow";
14
+ const BROWSER_ACTIONS = {
15
+ view: {
16
+ toolName: "sandbox_browser_view",
17
+ description: "Inspect current sandbox browser page and elements.",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ include_screenshot: { type: "boolean" }
22
+ }
23
+ },
24
+ invoke: (client, params) => client.browserView(params)
25
+ },
26
+ navigate: {
27
+ toolName: "sandbox_browser_navigate",
28
+ description: "Navigate the sandbox browser to a URL.",
29
+ inputSchema: {
30
+ type: "object",
31
+ properties: {
32
+ url: { type: "string" },
33
+ wait_until: {
34
+ type: "string",
35
+ enum: ["load", "domcontentloaded", "networkidle"]
36
+ }
37
+ },
38
+ required: ["url"]
39
+ },
40
+ invoke: (client, params) => client.browserNavigate(params)
41
+ },
42
+ restart: {
43
+ toolName: "sandbox_browser_restart",
44
+ description: "Restart sandbox browser context.",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {
48
+ url: { type: "string" }
49
+ }
50
+ },
51
+ invoke: (client, params) => client.browserRestart(params)
52
+ },
53
+ click: {
54
+ toolName: "sandbox_browser_click",
55
+ description: "Click an element in the sandbox browser.",
56
+ inputSchema: {
57
+ type: "object",
58
+ properties: {
59
+ index: { type: "integer" },
60
+ coordinate_x: { type: "integer" },
61
+ coordinate_y: { type: "integer" }
62
+ }
63
+ },
64
+ invoke: (client, params) => client.browserClick(params)
65
+ },
66
+ input_text: {
67
+ toolName: "sandbox_browser_input_text",
68
+ description: "Type into an element in the sandbox browser.",
69
+ inputSchema: {
70
+ type: "object",
71
+ properties: {
72
+ text: { type: "string" },
73
+ press_enter: { type: "boolean" },
74
+ index: { type: "integer" },
75
+ coordinate_x: { type: "integer" },
76
+ coordinate_y: { type: "integer" }
77
+ },
78
+ required: ["text"]
79
+ },
80
+ invoke: (client, params) => client.browserInput(params)
81
+ },
82
+ move_mouse: {
83
+ toolName: "sandbox_browser_move_mouse",
84
+ description: "Move mouse in sandbox browser viewport.",
85
+ inputSchema: {
86
+ type: "object",
87
+ properties: {
88
+ coordinate_x: { type: "integer" },
89
+ coordinate_y: { type: "integer" }
90
+ },
91
+ required: ["coordinate_x", "coordinate_y"]
92
+ },
93
+ invoke: (client, params) => client.browserMoveMouse(params)
94
+ },
95
+ press_key: {
96
+ toolName: "sandbox_browser_press_key",
97
+ description: "Press a keyboard key in the sandbox browser.",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ key: { type: "string" }
102
+ },
103
+ required: ["key"]
104
+ },
105
+ invoke: (client, params) => client.browserPressKey(params)
106
+ },
107
+ select_option: {
108
+ toolName: "sandbox_browser_select_option",
109
+ description: "Select an option in a sandbox browser select element.",
110
+ inputSchema: {
111
+ type: "object",
112
+ properties: {
113
+ index: { type: "integer" },
114
+ option: { type: "string" }
115
+ },
116
+ required: ["index", "option"]
117
+ },
118
+ invoke: (client, params) => client.browserSelectOption(params)
119
+ },
120
+ scroll: {
121
+ toolName: "sandbox_browser_scroll",
122
+ description: "Scroll the sandbox browser page.",
123
+ inputSchema: {
124
+ type: "object",
125
+ properties: {
126
+ to_top: { type: "boolean" },
127
+ to_bottom: { type: "boolean" },
128
+ pixels: { type: "integer" }
129
+ }
130
+ },
131
+ invoke: (client, params) => client.browserScroll(params)
132
+ },
133
+ console_exec: {
134
+ toolName: "sandbox_browser_console_exec",
135
+ description: "Execute JavaScript in sandbox browser console.",
136
+ inputSchema: {
137
+ type: "object",
138
+ properties: {
139
+ javascript: { type: "string" }
140
+ },
141
+ required: ["javascript"]
142
+ },
143
+ invoke: (client, params) => client.browserConsoleExec(params)
144
+ },
145
+ console_view: {
146
+ toolName: "sandbox_browser_console_view",
147
+ description: "View sandbox browser console messages.",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ max_lines: { type: "integer" }
152
+ }
153
+ },
154
+ invoke: (client, params) => client.browserConsoleView(params)
155
+ }
156
+ };
157
+ const FILE_ACTIONS = {
158
+ read: {
159
+ toolName: "sandbox_file_read",
160
+ description: "Read a file from the sandbox.",
161
+ inputSchema: {
162
+ type: "object",
163
+ properties: {
164
+ file: { type: "string" },
165
+ start_line: { type: "integer" },
166
+ end_line: { type: "integer" }
167
+ },
168
+ required: ["file"]
169
+ },
170
+ invoke: (client, params) => client.fileRead(params)
171
+ },
172
+ write: {
173
+ toolName: "sandbox_file_write",
174
+ description: "Write a file in the sandbox.",
175
+ inputSchema: {
176
+ type: "object",
177
+ properties: {
178
+ file: { type: "string" },
179
+ content: { type: "string" },
180
+ append: { type: "boolean" },
181
+ leading_newline: { type: "boolean" },
182
+ trailing_newline: { type: "boolean" }
183
+ },
184
+ required: ["file", "content"]
185
+ },
186
+ invoke: (client, params) => client.fileWrite(params)
187
+ },
188
+ str_replace: {
189
+ toolName: "sandbox_file_str_replace",
190
+ description: "Replace string content inside a sandbox file.",
191
+ inputSchema: {
192
+ type: "object",
193
+ properties: {
194
+ file: { type: "string" },
195
+ old_str: { type: "string" },
196
+ new_str: { type: "string" }
197
+ },
198
+ required: ["file", "old_str", "new_str"]
199
+ },
200
+ invoke: (client, params) => client.fileStrReplace(params)
201
+ },
202
+ find_in_content: {
203
+ toolName: "sandbox_file_find_in_content",
204
+ description: "Find content in a sandbox file using regex.",
205
+ inputSchema: {
206
+ type: "object",
207
+ properties: {
208
+ file: { type: "string" },
209
+ regex: { type: "string" }
210
+ },
211
+ required: ["file", "regex"]
212
+ },
213
+ invoke: (client, params) => client.fileFindInContent(params)
214
+ },
215
+ find_by_name: {
216
+ toolName: "sandbox_file_find_by_name",
217
+ description: "Find files by glob pattern in sandbox workspace.",
218
+ inputSchema: {
219
+ type: "object",
220
+ properties: {
221
+ path: { type: "string" },
222
+ glob: { type: "string" }
223
+ },
224
+ required: ["path", "glob"]
225
+ },
226
+ invoke: (client, params) => client.fileFindByName(params)
227
+ }
228
+ };
229
+ const SHELL_AGENT_TOOLS = [
230
+ {
231
+ toolName: "sandbox_shell_exec",
232
+ description: "Start a shell command in the sandbox.",
233
+ inputSchema: {
234
+ type: "object",
235
+ properties: {
236
+ id: { type: "string" },
237
+ command: { type: "string" },
238
+ exec_dir: { type: "string" }
239
+ },
240
+ required: ["id", "command"]
241
+ },
242
+ invoke: (client, params) => client.shellExec(params)
243
+ },
244
+ {
245
+ toolName: "sandbox_shell_wait",
246
+ description: "Wait for a shell command in the sandbox and collect output.",
247
+ inputSchema: {
248
+ type: "object",
249
+ properties: {
250
+ id: { type: "string" },
251
+ seconds: { type: "number" }
252
+ },
253
+ required: ["id"]
254
+ },
255
+ invoke: (client, params) => client.shellWait(params)
256
+ },
257
+ {
258
+ toolName: "sandbox_shell_view",
259
+ description: "Read current shell command output in the sandbox.",
260
+ inputSchema: {
261
+ type: "object",
262
+ properties: { id: { type: "string" } },
263
+ required: ["id"]
264
+ },
265
+ invoke: (client, params) => client.shellView(params)
266
+ },
267
+ {
268
+ toolName: "sandbox_shell_write",
269
+ description: "Write to a running sandbox shell process.",
270
+ inputSchema: {
271
+ type: "object",
272
+ properties: {
273
+ id: { type: "string" },
274
+ input: { type: "string" },
275
+ press_enter: { type: "boolean" }
276
+ },
277
+ required: ["id", "input", "press_enter"]
278
+ },
279
+ invoke: (client, params) => client.shellWriteToProcess(params)
280
+ },
281
+ {
282
+ toolName: "sandbox_shell_kill",
283
+ description: "Kill a running sandbox shell process.",
284
+ inputSchema: {
285
+ type: "object",
286
+ properties: { id: { type: "string" } },
287
+ required: ["id"]
288
+ },
289
+ invoke: (client, params) => client.shellKillProcess(params)
290
+ }
291
+ ];
292
+ let sharedSandboxStore = null;
293
+ let sandboxStoreCleanupHooksRegistered = false;
294
+ let sharedSandboxStoreClosePromise = null;
295
+ async function closeSharedSandboxStore() {
296
+ if (sharedSandboxStoreClosePromise) {
297
+ return sharedSandboxStoreClosePromise;
298
+ }
299
+ if (!sharedSandboxStore) {
300
+ return;
301
+ }
302
+ const store = sharedSandboxStore;
303
+ sharedSandboxStore = null;
304
+ const closePromise = (async () => {
305
+ try {
306
+ await store.close();
307
+ }
308
+ catch {
309
+ // Best-effort shutdown cleanup: ignore close failures so signal handling can continue.
310
+ }
311
+ })();
312
+ sharedSandboxStoreClosePromise = closePromise;
313
+ try {
314
+ await closePromise;
315
+ }
316
+ finally {
317
+ if (sharedSandboxStoreClosePromise === closePromise) {
318
+ sharedSandboxStoreClosePromise = null;
319
+ }
320
+ }
321
+ }
322
+ function registerSandboxStoreCleanupHooks() {
323
+ if (sandboxStoreCleanupHooksRegistered ||
324
+ typeof process === "undefined" ||
325
+ typeof process.once !== "function") {
326
+ return;
327
+ }
328
+ sandboxStoreCleanupHooksRegistered = true;
329
+ const handleProcessShutdown = (exitCode) => {
330
+ closeSharedSandboxStore()
331
+ .catch(() => {
332
+ // Ignore cleanup errors while handling process shutdown signals.
333
+ })
334
+ .finally(() => process.exit(exitCode));
335
+ };
336
+ process.once("SIGINT", () => {
337
+ handleProcessShutdown(130);
338
+ });
339
+ process.once("SIGTERM", () => {
340
+ handleProcessShutdown(143);
341
+ });
342
+ }
343
+ function getSandboxStore() {
344
+ registerSandboxStoreCleanupHooks();
345
+ if (sharedSandboxStore) {
346
+ return sharedSandboxStore;
347
+ }
348
+ sharedSandboxStore = new SessionStore({
349
+ provider: new DockerSandboxProvider()
350
+ });
351
+ return sharedSandboxStore;
352
+ }
353
+ function asRecord(value) {
354
+ if (value === null ||
355
+ value === undefined ||
356
+ typeof value !== "object" ||
357
+ Array.isArray(value)) {
358
+ return {};
359
+ }
360
+ return value;
361
+ }
362
+ function asString(value) {
363
+ if (value === null || value === undefined) {
364
+ return "";
365
+ }
366
+ return String(value);
367
+ }
368
+ function asTrimmedString(value) {
369
+ return asString(value).trim();
370
+ }
371
+ /**
372
+ * Build a stable context scope used to isolate sandbox sessions per workflow run.
373
+ * Format: "<userId>:<workflowId>:<jobId>" with explicit fallback tokens.
374
+ */
375
+ function getContextScope(context) {
376
+ if (!context) {
377
+ return `${DEFAULT_SCOPE_USER}:${DEFAULT_SCOPE_WORKFLOW}`;
378
+ }
379
+ const userId = asTrimmedString(context.userId) || DEFAULT_SCOPE_USER;
380
+ const workflowId = asTrimmedString(context.workflowId) || DEFAULT_SCOPE_WORKFLOW;
381
+ return `${userId}:${workflowId}`;
382
+ }
383
+ function toEffectiveSessionId(sessionId, context) {
384
+ return `${getContextScope(context)}:${sessionId}`;
385
+ }
386
+ async function getClient(sessionId, workspaceDir, context) {
387
+ const store = getSandboxStore();
388
+ const options = {};
389
+ if (workspaceDir.length > 0) {
390
+ options.workspaceDir = workspaceDir;
391
+ }
392
+ if (context?.userId) {
393
+ options.env = { NODETOOL_USER_ID: context.userId };
394
+ }
395
+ const sandbox = await store.acquire(sessionId, options);
396
+ return sandbox.client;
397
+ }
398
+ function createAgentTools(client) {
399
+ const defs = [
400
+ ...SHELL_AGENT_TOOLS,
401
+ ...Object.values(FILE_ACTIONS),
402
+ ...Object.values(BROWSER_ACTIONS)
403
+ ];
404
+ return defs.map((def) => ({
405
+ name: def.toolName,
406
+ description: def.description,
407
+ inputSchema: def.inputSchema,
408
+ process: async (_context, params) => def.invoke(client, params)
409
+ }));
410
+ }
411
+ export class SandboxShellNode extends BaseNode {
412
+ static nodeType = "nodetool.sandbox.SandboxShell";
413
+ static title = "SandboxShell";
414
+ static description = "Execute shell commands in an isolated sandbox session.";
415
+ static metadataOutputTypes = {
416
+ output: "str",
417
+ running: "bool",
418
+ exit_code: "union[int, none]",
419
+ timed_out: "bool"
420
+ };
421
+ static exposeAsTool = true;
422
+ async process(context) {
423
+ const effectiveSessionId = toEffectiveSessionId(DEFAULT_SESSION_ID, context);
424
+ const workspaceDir = asTrimmedString(this.workspace_dir);
425
+ const command = asString(this.command);
426
+ const normalizedCommand = asTrimmedString(this.command);
427
+ const waitSeconds = Number(this.wait_seconds ?? 1);
428
+ const commandId = `cmd-${randomUUID().slice(0, 8)}`;
429
+ if (normalizedCommand.length === 0) {
430
+ throw new Error("Command is required");
431
+ }
432
+ const client = await getClient(effectiveSessionId, workspaceDir, context);
433
+ await client.shellExec({
434
+ id: commandId,
435
+ command,
436
+ exec_dir: workspaceDir || undefined
437
+ });
438
+ const shellResult = waitSeconds > 0
439
+ ? await client.shellWait({ id: commandId, seconds: waitSeconds })
440
+ : await client.shellView({ id: commandId });
441
+ return {
442
+ output: shellResult.output,
443
+ running: shellResult.running,
444
+ exit_code: shellResult.exit_code,
445
+ timed_out: "timed_out" in shellResult ? shellResult.timed_out : false
446
+ };
447
+ }
448
+ }
449
+ __decorate([
450
+ prop({
451
+ type: "str",
452
+ default: "",
453
+ title: "Workspace Dir",
454
+ description: "Optional sandbox workspace directory."
455
+ })
456
+ ], SandboxShellNode.prototype, "workspace_dir", void 0);
457
+ __decorate([
458
+ prop({
459
+ type: "str",
460
+ default: "",
461
+ title: "Command",
462
+ description: "Shell command to execute in the sandbox."
463
+ })
464
+ ], SandboxShellNode.prototype, "command", void 0);
465
+ __decorate([
466
+ prop({
467
+ type: "float",
468
+ default: 1,
469
+ title: "Wait Seconds",
470
+ description: "If greater than 0, wait this long for output after launching command."
471
+ })
472
+ ], SandboxShellNode.prototype, "wait_seconds", void 0);
473
+ export class SandboxBrowserNode extends BaseNode {
474
+ static nodeType = "nodetool.sandbox.SandboxBrowser";
475
+ static title = "SandboxBrowser";
476
+ static description = "Control the sandbox browser (navigate, inspect, click, input, and console actions).";
477
+ static metadataOutputTypes = {
478
+ output: "dict[str, any]"
479
+ };
480
+ static exposeAsTool = true;
481
+ async process(context) {
482
+ const effectiveSessionId = toEffectiveSessionId(DEFAULT_SESSION_ID, context);
483
+ const workspaceDir = asTrimmedString(this.workspace_dir);
484
+ const action = asTrimmedString(this.action || "view");
485
+ const params = asRecord(this.params);
486
+ const client = await getClient(effectiveSessionId, workspaceDir, context);
487
+ const actionDef = BROWSER_ACTIONS[action];
488
+ if (!actionDef) {
489
+ throw new Error(`Unsupported browser action: ${action}`);
490
+ }
491
+ const output = await actionDef.invoke(client, params);
492
+ return {
493
+ output
494
+ };
495
+ }
496
+ }
497
+ __decorate([
498
+ prop({
499
+ type: "str",
500
+ default: "",
501
+ title: "Workspace Dir",
502
+ description: "Optional sandbox workspace directory."
503
+ })
504
+ ], SandboxBrowserNode.prototype, "workspace_dir", void 0);
505
+ __decorate([
506
+ prop({
507
+ type: "enum",
508
+ default: "view",
509
+ title: "Action",
510
+ description: "Browser action to execute.",
511
+ values: [
512
+ "view",
513
+ "navigate",
514
+ "restart",
515
+ "click",
516
+ "input_text",
517
+ "move_mouse",
518
+ "press_key",
519
+ "select_option",
520
+ "scroll",
521
+ "console_exec",
522
+ "console_view"
523
+ ]
524
+ })
525
+ ], SandboxBrowserNode.prototype, "action", void 0);
526
+ __decorate([
527
+ prop({
528
+ type: "dict",
529
+ default: {},
530
+ title: "Params",
531
+ description: "Action parameters validated by the sandbox browser tool."
532
+ })
533
+ ], SandboxBrowserNode.prototype, "params", void 0);
534
+ export class SandboxFileNode extends BaseNode {
535
+ static nodeType = "nodetool.sandbox.SandboxFile";
536
+ static title = "SandboxFile";
537
+ static description = "Read, write, search, and replace files inside a sandbox session.";
538
+ static metadataOutputTypes = {
539
+ output: "dict[str, any]"
540
+ };
541
+ static exposeAsTool = true;
542
+ async process(context) {
543
+ const effectiveSessionId = toEffectiveSessionId(DEFAULT_SESSION_ID, context);
544
+ const workspaceDir = asTrimmedString(this.workspace_dir);
545
+ const action = asTrimmedString(this.action || "read");
546
+ const params = asRecord(this.params);
547
+ const client = await getClient(effectiveSessionId, workspaceDir, context);
548
+ const actionDef = FILE_ACTIONS[action];
549
+ if (!actionDef) {
550
+ throw new Error(`Unsupported file action: ${action}`);
551
+ }
552
+ const output = await actionDef.invoke(client, params);
553
+ return {
554
+ output
555
+ };
556
+ }
557
+ }
558
+ __decorate([
559
+ prop({
560
+ type: "str",
561
+ default: "",
562
+ title: "Workspace Dir",
563
+ description: "Optional sandbox workspace directory."
564
+ })
565
+ ], SandboxFileNode.prototype, "workspace_dir", void 0);
566
+ __decorate([
567
+ prop({
568
+ type: "enum",
569
+ default: "read",
570
+ title: "Action",
571
+ description: "File action to execute.",
572
+ values: ["read", "write", "str_replace", "find_in_content", "find_by_name"]
573
+ })
574
+ ], SandboxFileNode.prototype, "action", void 0);
575
+ __decorate([
576
+ prop({
577
+ type: "dict",
578
+ default: {},
579
+ title: "Params",
580
+ description: "Action parameters validated by the sandbox file tool."
581
+ })
582
+ ], SandboxFileNode.prototype, "params", void 0);
583
+ export class SandboxAgentNode extends BaseNode {
584
+ static nodeType = "nodetool.sandbox.SandboxAgent";
585
+ static title = "SandboxAgent";
586
+ static description = "Prompt-driven agent with access to configured sandbox shell, browser, and file tools.";
587
+ static metadataOutputTypes = {
588
+ text: "str"
589
+ };
590
+ static isStreamingOutput = true;
591
+ async process(context) {
592
+ const prompt = String(this.prompt ?? "").trim();
593
+ if (prompt.length === 0) {
594
+ throw new Error("Prompt is required");
595
+ }
596
+ if (!context || typeof context.getProvider !== "function") {
597
+ throw new Error("Processing context with provider access is required");
598
+ }
599
+ const model = (this.model ?? {});
600
+ const providerId = asTrimmedString(model.provider);
601
+ const modelId = asTrimmedString(model.id);
602
+ if (providerId.length === 0 || modelId.length === 0) {
603
+ throw new Error("Select a model for SandboxAgent.");
604
+ }
605
+ const effectiveSessionId = toEffectiveSessionId(DEFAULT_SESSION_ID, context);
606
+ const workspaceDir = asTrimmedString(this.workspace_dir);
607
+ const maxIterations = Number(this.max_iterations ?? 12);
608
+ const client = await getClient(effectiveSessionId, workspaceDir, context);
609
+ const tools = createAgentTools(client);
610
+ const { text } = await runAgentLoop({
611
+ context,
612
+ providerId,
613
+ modelId,
614
+ systemPrompt: String(this.system_prompt ?? "").trim() ||
615
+ "You are a careful sandbox execution agent. Use tools and provide concise results.",
616
+ prompt,
617
+ tools,
618
+ maxTokens: 4096,
619
+ maxIterations
620
+ });
621
+ return {
622
+ text
623
+ };
624
+ }
625
+ }
626
+ __decorate([
627
+ prop({
628
+ type: "language_model",
629
+ default: {
630
+ type: "language_model",
631
+ provider: "empty",
632
+ id: "",
633
+ name: "",
634
+ path: null,
635
+ supported_tasks: []
636
+ },
637
+ title: "Model",
638
+ description: "Model used by the sandbox agent."
639
+ })
640
+ ], SandboxAgentNode.prototype, "model", void 0);
641
+ __decorate([
642
+ prop({
643
+ type: "str",
644
+ default: "",
645
+ title: "Prompt",
646
+ description: "Prompt describing what the sandbox agent should do."
647
+ })
648
+ ], SandboxAgentNode.prototype, "prompt", void 0);
649
+ __decorate([
650
+ prop({
651
+ type: "str",
652
+ default: "",
653
+ title: "System Prompt",
654
+ description: "Optional system prompt."
655
+ })
656
+ ], SandboxAgentNode.prototype, "system_prompt", void 0);
657
+ __decorate([
658
+ prop({
659
+ type: "str",
660
+ default: "",
661
+ title: "Workspace Dir",
662
+ description: "Optional sandbox workspace directory."
663
+ })
664
+ ], SandboxAgentNode.prototype, "workspace_dir", void 0);
665
+ __decorate([
666
+ prop({
667
+ type: "int",
668
+ default: 12,
669
+ title: "Max Iterations",
670
+ description: "Maximum agent tool-calling iterations.",
671
+ min: 1,
672
+ max: 100
673
+ })
674
+ ], SandboxAgentNode.prototype, "max_iterations", void 0);
675
+ export const SANDBOX_NODES = [
676
+ SandboxShellNode,
677
+ SandboxBrowserNode,
678
+ SandboxFileNode,
679
+ SandboxAgentNode
680
+ ];
681
+ //# sourceMappingURL=sandbox.js.map