@bubblelab/bubble-core 0.1.9 → 0.1.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 (355) hide show
  1. package/dist/bubble-bundle.d.ts +633 -1658
  2. package/dist/bubble-factory.d.ts.map +1 -1
  3. package/dist/bubble-factory.js +165 -43
  4. package/dist/bubble-factory.js.map +1 -1
  5. package/dist/bubble-flow/bubble-flow-class.d.ts +22 -1
  6. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
  7. package/dist/bubble-flow/bubble-flow-class.js +36 -0
  8. package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
  9. package/dist/bubble-flow/sample/data-analyst-flow.d.ts +1 -1
  10. package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -1
  11. package/dist/bubble-flow/sample/error-ts.d.ts +1 -1
  12. package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -1
  13. package/dist/bubble-flow/sample/sanitytest.d.ts +1 -1
  14. package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -1
  15. package/dist/bubble-flow/sample/simple-webhook-2.d.ts +1 -1
  16. package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -1
  17. package/dist/bubble-flow/sample/simple-webhook.d.ts +1 -1
  18. package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -1
  19. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +1 -1
  20. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
  21. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
  22. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
  23. package/dist/bubble-flow/sample/slack-v0.1.d.ts +1 -1
  24. package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -1
  25. package/dist/bubble-flow/sample/slackagenttest.d.ts +1 -1
  26. package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -1
  27. package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
  28. package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
  29. package/dist/bubbles/service-bubble/agi-inc.js +730 -0
  30. package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
  31. package/dist/bubbles/service-bubble/ai-agent.d.ts +297 -85
  32. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  33. package/dist/bubbles/service-bubble/ai-agent.js +535 -399
  34. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  35. package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
  36. package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
  37. package/dist/bubbles/service-bubble/airtable.js +1173 -0
  38. package/dist/bubbles/service-bubble/airtable.js.map +1 -0
  39. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
  40. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
  41. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
  42. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
  43. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +38 -38
  44. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +56 -56
  45. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
  46. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
  47. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
  48. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
  49. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +27 -27
  50. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +38 -38
  51. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
  52. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
  53. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
  54. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
  55. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
  56. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
  57. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
  58. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
  59. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +184 -0
  60. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts.map +1 -0
  61. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js +145 -0
  62. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js.map +1 -0
  63. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts +52 -0
  64. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts.map +1 -0
  65. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js +29 -0
  66. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js.map +1 -0
  67. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1483 -123
  68. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
  69. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +48 -0
  70. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
  71. package/dist/bubbles/service-bubble/apify/apify.d.ts +156 -11
  72. package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
  73. package/dist/bubbles/service-bubble/apify/apify.js +205 -32
  74. package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
  75. package/dist/bubbles/service-bubble/apify/index.d.ts +2 -0
  76. package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -1
  77. package/dist/bubbles/service-bubble/apify/index.js +3 -0
  78. package/dist/bubbles/service-bubble/apify/index.js.map +1 -1
  79. package/dist/bubbles/service-bubble/apify/types.js +1 -2
  80. package/dist/bubbles/service-bubble/apify/types.js.map +1 -1
  81. package/dist/bubbles/service-bubble/eleven-labs.d.ts +421 -0
  82. package/dist/bubbles/service-bubble/eleven-labs.d.ts.map +1 -0
  83. package/dist/bubbles/service-bubble/eleven-labs.js +479 -0
  84. package/dist/bubbles/service-bubble/eleven-labs.js.map +1 -0
  85. package/dist/bubbles/service-bubble/firecrawl.d.ts +37748 -0
  86. package/dist/bubbles/service-bubble/firecrawl.d.ts.map +1 -0
  87. package/dist/bubbles/service-bubble/firecrawl.js +1489 -0
  88. package/dist/bubbles/service-bubble/firecrawl.js.map +1 -0
  89. package/dist/bubbles/service-bubble/followupboss.d.ts +6822 -0
  90. package/dist/bubbles/service-bubble/followupboss.d.ts.map +1 -0
  91. package/dist/bubbles/service-bubble/followupboss.js +1394 -0
  92. package/dist/bubbles/service-bubble/followupboss.js.map +1 -0
  93. package/dist/bubbles/service-bubble/github.d.ts +2399 -0
  94. package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
  95. package/dist/bubbles/service-bubble/github.js +1052 -0
  96. package/dist/bubbles/service-bubble/github.js.map +1 -0
  97. package/dist/bubbles/service-bubble/gmail.d.ts +726 -232
  98. package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -1
  99. package/dist/bubbles/service-bubble/gmail.js +435 -7
  100. package/dist/bubbles/service-bubble/gmail.js.map +1 -1
  101. package/dist/bubbles/service-bubble/google-calendar.d.ts +8 -8
  102. package/dist/bubbles/service-bubble/google-drive.d.ts +270 -40
  103. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
  104. package/dist/bubbles/service-bubble/google-drive.js +100 -78
  105. package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
  106. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
  107. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
  108. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
  109. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
  110. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
  111. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
  112. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
  113. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
  114. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
  115. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
  116. package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
  117. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
  118. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
  119. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
  120. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
  121. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
  122. package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
  123. package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
  124. package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
  125. package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
  126. package/dist/bubbles/service-bubble/hello-world.js +2 -2
  127. package/dist/bubbles/service-bubble/hello-world.js.map +1 -1
  128. package/dist/bubbles/service-bubble/http.d.ts +6 -6
  129. package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
  130. package/dist/bubbles/service-bubble/http.js +7 -1
  131. package/dist/bubbles/service-bubble/http.js.map +1 -1
  132. package/dist/bubbles/service-bubble/insforge-db.d.ts +140 -0
  133. package/dist/bubbles/service-bubble/insforge-db.d.ts.map +1 -0
  134. package/dist/bubbles/service-bubble/insforge-db.js +260 -0
  135. package/dist/bubbles/service-bubble/insforge-db.js.map +1 -0
  136. package/dist/bubbles/service-bubble/notion/index.d.ts +3 -0
  137. package/dist/bubbles/service-bubble/notion/index.d.ts.map +1 -0
  138. package/dist/bubbles/service-bubble/notion/index.js +3 -0
  139. package/dist/bubbles/service-bubble/notion/index.js.map +1 -0
  140. package/dist/bubbles/service-bubble/notion/notion.d.ts +35405 -0
  141. package/dist/bubbles/service-bubble/notion/notion.d.ts.map +1 -0
  142. package/dist/bubbles/service-bubble/notion/notion.js +1492 -0
  143. package/dist/bubbles/service-bubble/notion/notion.js.map +1 -0
  144. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +1148 -0
  145. package/dist/bubbles/service-bubble/notion/property-schemas.d.ts.map +1 -0
  146. package/dist/bubbles/service-bubble/notion/property-schemas.js +341 -0
  147. package/dist/bubbles/service-bubble/notion/property-schemas.js.map +1 -0
  148. package/dist/bubbles/service-bubble/postgresql.d.ts +8 -8
  149. package/dist/bubbles/service-bubble/resend.d.ts +30 -9
  150. package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
  151. package/dist/bubbles/service-bubble/resend.js +133 -2
  152. package/dist/bubbles/service-bubble/resend.js.map +1 -1
  153. package/dist/bubbles/service-bubble/slack.d.ts +525 -525
  154. package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
  155. package/dist/bubbles/service-bubble/slack.js +2 -2
  156. package/dist/bubbles/service-bubble/slack.js.map +1 -1
  157. package/dist/bubbles/service-bubble/storage.d.ts +21 -17
  158. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
  159. package/dist/bubbles/service-bubble/storage.js +59 -7
  160. package/dist/bubbles/service-bubble/storage.js.map +1 -1
  161. package/dist/bubbles/service-bubble/telegram.d.ts +7742 -0
  162. package/dist/bubbles/service-bubble/telegram.d.ts.map +1 -0
  163. package/dist/bubbles/service-bubble/telegram.js +1132 -0
  164. package/dist/bubbles/service-bubble/telegram.js.map +1 -0
  165. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +60 -4
  166. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
  167. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
  168. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
  169. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +4 -4
  170. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
  171. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
  172. package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
  173. package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
  174. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
  175. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
  176. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +132 -19
  177. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
  178. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
  179. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
  180. package/dist/bubbles/tool-bubble/google-maps-tool.js +205 -0
  181. package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
  182. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +90 -90
  183. package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
  184. package/dist/bubbles/tool-bubble/instagram-tool.js +2 -2
  185. package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
  186. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +808 -431
  187. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
  188. package/dist/bubbles/tool-bubble/linkedin-tool.js +232 -12
  189. package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
  190. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  191. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +21 -16
  192. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -1
  193. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +97 -22
  194. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -1
  195. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
  196. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
  197. package/dist/bubbles/tool-bubble/research-agent-tool.js +27 -17
  198. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
  199. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +4 -4
  200. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
  201. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
  202. package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
  203. package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
  204. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
  205. package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
  206. package/dist/bubbles/tool-bubble/twitter-tool.js +494 -0
  207. package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
  208. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +32 -26
  209. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
  210. package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
  211. package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
  212. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +4 -4
  213. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
  214. package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
  215. package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
  216. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +23 -115
  217. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
  218. package/dist/bubbles/tool-bubble/web-scrape-tool.js +51 -72
  219. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
  220. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +18 -6
  221. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
  222. package/dist/bubbles/tool-bubble/web-search-tool.js +46 -32
  223. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
  224. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +394 -0
  225. package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -0
  226. package/dist/bubbles/tool-bubble/youtube-tool.js +352 -0
  227. package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -0
  228. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +78 -78
  229. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
  230. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +62 -62
  231. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
  232. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +80 -80
  233. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
  234. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
  235. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
  236. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +52 -52
  237. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -1
  238. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +2 -2
  239. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
  240. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +32 -32
  241. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
  242. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
  243. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
  244. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +46 -46
  245. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
  246. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
  247. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
  248. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +27 -27
  249. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
  250. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
  251. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
  252. package/dist/bubbles.json +251 -88
  253. package/dist/index.d.ts +27 -6
  254. package/dist/index.d.ts.map +1 -1
  255. package/dist/index.js +18 -4
  256. package/dist/index.js.map +1 -1
  257. package/dist/logging/BubbleLogger.d.ts +45 -16
  258. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  259. package/dist/logging/BubbleLogger.js +197 -89
  260. package/dist/logging/BubbleLogger.js.map +1 -1
  261. package/dist/logging/StreamingBubbleLogger.d.ts +13 -1
  262. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
  263. package/dist/logging/StreamingBubbleLogger.js +56 -13
  264. package/dist/logging/StreamingBubbleLogger.js.map +1 -1
  265. package/dist/logging/WebhookStreamLogger.d.ts +66 -0
  266. package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
  267. package/dist/logging/WebhookStreamLogger.js +291 -0
  268. package/dist/logging/WebhookStreamLogger.js.map +1 -0
  269. package/dist/types/available-tools.d.ts +1 -1
  270. package/dist/types/available-tools.d.ts.map +1 -1
  271. package/dist/types/available-tools.js +1 -0
  272. package/dist/types/available-tools.js.map +1 -1
  273. package/dist/types/base-bubble-class.d.ts +7 -5
  274. package/dist/types/base-bubble-class.d.ts.map +1 -1
  275. package/dist/types/base-bubble-class.js +63 -40
  276. package/dist/types/base-bubble-class.js.map +1 -1
  277. package/dist/types/bubble.d.ts +3 -10
  278. package/dist/types/bubble.d.ts.map +1 -1
  279. package/dist/types/bubble.js +1 -1
  280. package/dist/types/bubble.js.map +1 -1
  281. package/dist/types/service-bubble-class.d.ts +2 -2
  282. package/dist/types/service-bubble-class.d.ts.map +1 -1
  283. package/dist/types/service-bubble-class.js +2 -2
  284. package/dist/types/service-bubble-class.js.map +1 -1
  285. package/dist/types/tool-bubble-class.d.ts +2 -2
  286. package/dist/types/tool-bubble-class.d.ts.map +1 -1
  287. package/dist/types/tool-bubble-class.js +2 -4
  288. package/dist/types/tool-bubble-class.js.map +1 -1
  289. package/dist/types/workflow-bubble-class.d.ts +2 -2
  290. package/dist/types/workflow-bubble-class.d.ts.map +1 -1
  291. package/dist/types/workflow-bubble-class.js +2 -2
  292. package/dist/types/workflow-bubble-class.js.map +1 -1
  293. package/dist/utils/agent-formatter.d.ts +14 -2
  294. package/dist/utils/agent-formatter.d.ts.map +1 -1
  295. package/dist/utils/agent-formatter.js +176 -28
  296. package/dist/utils/agent-formatter.js.map +1 -1
  297. package/dist/utils/bubbleflow-validation.d.ts +7 -0
  298. package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
  299. package/dist/utils/bubbleflow-validation.js +257 -35
  300. package/dist/utils/bubbleflow-validation.js.map +1 -1
  301. package/dist/utils/error-sanitizer.d.ts +12 -0
  302. package/dist/utils/error-sanitizer.d.ts.map +1 -0
  303. package/dist/utils/error-sanitizer.js +77 -0
  304. package/dist/utils/error-sanitizer.js.map +1 -0
  305. package/dist/utils/json-parsing.d.ts.map +1 -1
  306. package/dist/utils/json-parsing.js +146 -0
  307. package/dist/utils/json-parsing.js.map +1 -1
  308. package/dist/utils/safe-gemini-chat.d.ts +31 -0
  309. package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
  310. package/dist/utils/safe-gemini-chat.js +93 -0
  311. package/dist/utils/safe-gemini-chat.js.map +1 -0
  312. package/dist/utils/schema-comparison.d.ts +92 -0
  313. package/dist/utils/schema-comparison.d.ts.map +1 -0
  314. package/dist/utils/schema-comparison.js +716 -0
  315. package/dist/utils/schema-comparison.js.map +1 -0
  316. package/dist/utils/zod-schema.d.ts +24 -0
  317. package/dist/utils/zod-schema.d.ts.map +1 -0
  318. package/dist/utils/zod-schema.js +56 -0
  319. package/dist/utils/zod-schema.js.map +1 -0
  320. package/package.json +7 -6
  321. package/dist/bubble-trigger/index.d.ts +0 -2
  322. package/dist/bubble-trigger/index.d.ts.map +0 -1
  323. package/dist/bubble-trigger/index.js +0 -2
  324. package/dist/bubble-trigger/index.js.map +0 -1
  325. package/dist/bubble-trigger/types.d.ts +0 -87
  326. package/dist/bubble-trigger/types.d.ts.map +0 -1
  327. package/dist/bubble-trigger/types.js +0 -14
  328. package/dist/bubble-trigger/types.js.map +0 -1
  329. package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts +0 -370
  330. package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts.map +0 -1
  331. package/dist/bubbles/service-bubble/apify/api-scraper.schema.js +0 -14
  332. package/dist/bubbles/service-bubble/apify/api-scraper.schema.js.map +0 -1
  333. package/dist/bubbles/service-bubble/apify.d.ts +0 -136
  334. package/dist/bubbles/service-bubble/apify.d.ts.map +0 -1
  335. package/dist/bubbles/service-bubble/apify.js +0 -282
  336. package/dist/bubbles/service-bubble/apify.js.map +0 -1
  337. package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
  338. package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
  339. package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
  340. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -114
  341. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
  342. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -782
  343. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
  344. package/dist/types/ai-models.d.ts +0 -4
  345. package/dist/types/ai-models.d.ts.map +0 -1
  346. package/dist/types/ai-models.js +0 -20
  347. package/dist/types/ai-models.js.map +0 -1
  348. package/dist/types/api-scraper.schema.d.ts +0 -453
  349. package/dist/types/api-scraper.schema.d.ts.map +0 -1
  350. package/dist/types/api-scraper.schema.js +0 -160
  351. package/dist/types/api-scraper.schema.js.map +0 -1
  352. package/dist/utils/param-helper.d.ts +0 -2
  353. package/dist/utils/param-helper.d.ts.map +0 -1
  354. package/dist/utils/param-helper.js +0 -5
  355. package/dist/utils/param-helper.js.map +0 -1
@@ -0,0 +1,66 @@
1
+ import { BubbleLogger, type LoggerConfig, type LogMetadata } from './BubbleLogger.js';
2
+ import type { StreamCallback } from '@bubblelab/shared-schemas';
3
+ import { BubbleError } from '../types/bubble-errors';
4
+ interface WebhookStreamLoggerConfig extends Partial<Omit<LoggerConfig, 'pricingTable'>> {
5
+ pricingTable: Record<string, {
6
+ unit: string;
7
+ unitCost: number;
8
+ }>;
9
+ streamCallback?: StreamCallback;
10
+ }
11
+ /**
12
+ * Webhook-optimized streaming logger for terminal-friendly output
13
+ * Designed specifically for webhook streaming endpoints
14
+ * Shows only essential information with truncated data for readability
15
+ */
16
+ export declare class WebhookStreamLogger extends BubbleLogger {
17
+ private streamCallback?;
18
+ constructor(flowName: string, options?: WebhookStreamLoggerConfig);
19
+ /**
20
+ * Override logBubbleExecution to emit clean, truncated events
21
+ */
22
+ logBubbleExecution(variableId: number, bubbleName: string, variableName: string, parameters?: Record<string, unknown>): string;
23
+ /**
24
+ * Override logBubbleExecutionComplete to emit clean results
25
+ */
26
+ logBubbleExecutionComplete(variableId: number, bubbleName: string, variableName: string, result?: unknown): string;
27
+ /**
28
+ * Log execution completion with beautiful, terminal-friendly formatting
29
+ * Makes the final result super clear and easy to read
30
+ */
31
+ logExecutionComplete(success: boolean, finalResult?: unknown, error?: string): void;
32
+ /**
33
+ * Override error method to emit clean error events
34
+ */
35
+ error(message: string, error?: BubbleError, metadata?: Partial<LogMetadata>): void;
36
+ /**
37
+ * Override warn method to emit clean warning events
38
+ */
39
+ warn(message: string, metadata?: Partial<LogMetadata>): void;
40
+ /**
41
+ * Override info method to emit clean info events
42
+ */
43
+ info(message: string, metadata?: Partial<LogMetadata>): void;
44
+ /**
45
+ * Set or update the stream callback
46
+ */
47
+ setStreamCallback(callback: StreamCallback): void;
48
+ /**
49
+ * Clear the stream callback
50
+ */
51
+ clearStreamCallback(): void;
52
+ /**
53
+ * Emit a streaming event if callback is set
54
+ */
55
+ private emitStreamEvent;
56
+ /**
57
+ * Get current execution time in milliseconds
58
+ */
59
+ private getCurrentExecutionTime;
60
+ /**
61
+ * Get current memory usage in bytes
62
+ */
63
+ private getCurrentMemoryUsage;
64
+ }
65
+ export {};
66
+ //# sourceMappingURL=WebhookStreamLogger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebhookStreamLogger.d.ts","sourceRoot":"","sources":["../../src/logging/WebhookStreamLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,UAAU,yBACR,SAAQ,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAmDD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IACnD,OAAO,CAAC,cAAc,CAAC,CAAiB;gBAGtC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,yBAAgD;IAO3D;;OAEG;IACM,kBAAkB,CACzB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,MAAM;IAgCT;;OAEG;IACM,0BAA0B,CACjC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,OAAO,GACf,MAAM;IAmCT;;;OAGG;IACH,oBAAoB,CAClB,OAAO,EAAE,OAAO,EAChB,WAAW,CAAC,EAAE,OAAO,EACrB,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;IA2DP;;OAEG;IACM,KAAK,CACZ,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC9B,IAAI;IAyBP;;OAEG;IACM,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAgBrE;;OAEG;IACM,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAgBrE;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAIjD;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAI3B;;OAEG;IACH,OAAO,CAAC,eAAe;IAgBvB;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAK/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAM9B"}
@@ -0,0 +1,291 @@
1
+ import { BubbleLogger, LogLevel, } from './BubbleLogger.js';
2
+ import { sanitizeErrorMessage, sanitizeErrorStack, } from '../utils/error-sanitizer.js';
3
+ /**
4
+ * Helper function to format data for webhook stream display
5
+ * Truncates large objects/strings for terminal readability
6
+ */
7
+ function formatForWebhookStream(data, maxLength = 200) {
8
+ if (data === null)
9
+ return 'null';
10
+ if (data === undefined)
11
+ return 'undefined';
12
+ // Handle strings
13
+ if (typeof data === 'string') {
14
+ if (data.length <= maxLength)
15
+ return data;
16
+ return data.substring(0, maxLength) + '...';
17
+ }
18
+ // Handle primitives
19
+ if (typeof data !== 'object') {
20
+ return String(data);
21
+ }
22
+ // Handle arrays
23
+ if (Array.isArray(data)) {
24
+ if (data.length === 0)
25
+ return '[]';
26
+ const preview = `[${data.length} items]`;
27
+ if (data.length <= 3) {
28
+ const items = data
29
+ .map((item) => formatForWebhookStream(item, 50))
30
+ .join(', ');
31
+ return items.length <= maxLength ? `[${items}]` : preview;
32
+ }
33
+ return preview;
34
+ }
35
+ // Handle objects
36
+ try {
37
+ const stringified = JSON.stringify(data);
38
+ if (stringified.length <= maxLength)
39
+ return stringified;
40
+ // Show object keys as preview
41
+ const keys = Object.keys(data);
42
+ if (keys.length === 0)
43
+ return '{}';
44
+ if (keys.length <= 3) {
45
+ return `{${keys.join(', ')}}`;
46
+ }
47
+ return `{${keys.slice(0, 3).join(', ')}, ... +${keys.length - 3} more}`;
48
+ }
49
+ catch {
50
+ return '[Complex Object]';
51
+ }
52
+ }
53
+ /**
54
+ * Webhook-optimized streaming logger for terminal-friendly output
55
+ * Designed specifically for webhook streaming endpoints
56
+ * Shows only essential information with truncated data for readability
57
+ */
58
+ export class WebhookStreamLogger extends BubbleLogger {
59
+ streamCallback;
60
+ constructor(flowName, options = { pricingTable: {} }) {
61
+ const { streamCallback, ...loggerConfig } = options;
62
+ super(flowName, loggerConfig);
63
+ this.streamCallback = streamCallback;
64
+ }
65
+ /**
66
+ * Override logBubbleExecution to emit clean, truncated events
67
+ */
68
+ logBubbleExecution(variableId, bubbleName, variableName, parameters) {
69
+ // Call parent method and use the returned message
70
+ const logMessage = super.logBubbleExecution(variableId, bubbleName, variableName, parameters);
71
+ // Format parameters for webhook display - truncate to be terminal-friendly
72
+ const formattedParams = parameters
73
+ ? formatForWebhookStream(parameters, 150)
74
+ : undefined;
75
+ this.emitStreamEvent({
76
+ type: 'bubble_execution',
77
+ timestamp: new Date().toISOString(),
78
+ variableId,
79
+ message: logMessage,
80
+ bubbleName,
81
+ variableName,
82
+ additionalData: {
83
+ parameters: formattedParams,
84
+ variableId,
85
+ },
86
+ executionTime: this.getCurrentExecutionTime(),
87
+ memoryUsage: this.getCurrentMemoryUsage(),
88
+ });
89
+ return logMessage;
90
+ }
91
+ /**
92
+ * Override logBubbleExecutionComplete to emit clean results
93
+ */
94
+ logBubbleExecutionComplete(variableId, bubbleName, variableName, result) {
95
+ // Get individual bubble execution time BEFORE calling parent method
96
+ const individualExecutionTime = this.getBubbleExecutionTime(variableId);
97
+ // Call parent method and use the returned message
98
+ const logMessage = super.logBubbleExecutionComplete(variableId, bubbleName, variableName, result);
99
+ // Truncate result for webhook display
100
+ const formattedResult = result
101
+ ? formatForWebhookStream(result, 200)
102
+ : undefined;
103
+ this.emitStreamEvent({
104
+ type: 'bubble_execution_complete',
105
+ timestamp: new Date().toISOString(),
106
+ message: logMessage,
107
+ variableId,
108
+ bubbleName,
109
+ variableName,
110
+ additionalData: {
111
+ result: formattedResult,
112
+ variableId,
113
+ },
114
+ executionTime: individualExecutionTime,
115
+ memoryUsage: this.getCurrentMemoryUsage(),
116
+ });
117
+ return logMessage;
118
+ }
119
+ /**
120
+ * Log execution completion with beautiful, terminal-friendly formatting
121
+ * Makes the final result super clear and easy to read
122
+ */
123
+ logExecutionComplete(success, finalResult, error) {
124
+ const executionTime = (this.getCurrentExecutionTime() / 1000).toFixed(2);
125
+ const tokenUsage = this.getExecutionSummary().serviceUsage;
126
+ // Format the final result nicely for display - NO TRUNCATION
127
+ let displayResult;
128
+ if (success && finalResult !== undefined) {
129
+ try {
130
+ if (typeof finalResult === 'string') {
131
+ displayResult = finalResult;
132
+ }
133
+ else {
134
+ // For objects, extract string values and format them with actual newlines
135
+ const formatted = JSON.stringify(finalResult, null, 2);
136
+ // Replace escaped newlines with actual newlines for better readability
137
+ // This makes the output much more readable in terminal
138
+ displayResult = formatted.replace(/\\n/g, '\n');
139
+ }
140
+ }
141
+ catch {
142
+ displayResult = String(finalResult);
143
+ }
144
+ }
145
+ else if (error) {
146
+ displayResult = `Error: ${error}`;
147
+ }
148
+ else {
149
+ displayResult = 'No result returned';
150
+ }
151
+ // Create a beautiful, visually distinct message with better formatting
152
+ const separator = '═'.repeat(70);
153
+ const thinSeparator = '─'.repeat(70);
154
+ const message = success
155
+ ? `\n\n${separator}\n ✓ FLOW COMPLETED SUCCESSFULLY\n${separator}\n\n⏱️ Execution Time: ${executionTime}s\n🎯 Tokens Used: ${tokenUsage?.reduce((acc, curr) => acc + curr.totalCost, 0).toFixed(6)} total (${tokenUsage?.reduce((acc, curr) => acc + curr.usage, 0).toFixed(6)} in + ${tokenUsage?.reduce((acc, curr) => acc + curr.usage, 0).toFixed(6)} out)\n\n${thinSeparator}\n📤 FINAL RESULT:\n${thinSeparator}\n\n${displayResult}\n\n${separator}\n`
156
+ : `\n\n${separator}\n ✗ FLOW FAILED\n${separator}\n\n❌ Error: ${error || 'Unknown error'}\n\n${separator}\n`;
157
+ this.logLine(0, message, {
158
+ success,
159
+ finalResult,
160
+ error,
161
+ });
162
+ this.emitStreamEvent({
163
+ type: 'execution_complete',
164
+ timestamp: new Date().toISOString(),
165
+ message,
166
+ additionalData: {
167
+ success,
168
+ finalResult: displayResult,
169
+ error,
170
+ summary: {
171
+ executionTime: this.getCurrentExecutionTime(),
172
+ tokenUsage,
173
+ success,
174
+ },
175
+ },
176
+ executionTime: this.getCurrentExecutionTime(),
177
+ memoryUsage: this.getCurrentMemoryUsage(),
178
+ });
179
+ }
180
+ /**
181
+ * Override error method to emit clean error events
182
+ */
183
+ error(message, error, metadata) {
184
+ super.error(message, error, metadata);
185
+ this.emitStreamEvent({
186
+ type: 'error',
187
+ timestamp: new Date().toISOString(),
188
+ message,
189
+ lineNumber: metadata?.lineNumber,
190
+ bubbleName: error?.bubbleName,
191
+ variableId: error?.variableId,
192
+ additionalData: {
193
+ ...metadata?.additionalData,
194
+ error: error
195
+ ? {
196
+ message: sanitizeErrorMessage(error.message),
197
+ stack: sanitizeErrorStack(error),
198
+ name: error.name,
199
+ }
200
+ : undefined,
201
+ },
202
+ executionTime: this.getCurrentExecutionTime(),
203
+ memoryUsage: this.getCurrentMemoryUsage(),
204
+ logLevel: LogLevel[LogLevel.ERROR],
205
+ });
206
+ }
207
+ /**
208
+ * Override warn method to emit clean warning events
209
+ */
210
+ warn(message, metadata) {
211
+ super.warn(message, metadata);
212
+ this.emitStreamEvent({
213
+ type: 'warn',
214
+ timestamp: new Date().toISOString(),
215
+ message,
216
+ lineNumber: metadata?.lineNumber,
217
+ bubbleName: metadata?.bubbleName,
218
+ variableName: metadata?.variableName,
219
+ additionalData: metadata?.additionalData,
220
+ executionTime: this.getCurrentExecutionTime(),
221
+ memoryUsage: this.getCurrentMemoryUsage(),
222
+ logLevel: LogLevel[LogLevel.WARN],
223
+ });
224
+ }
225
+ /**
226
+ * Override info method to emit clean info events
227
+ */
228
+ info(message, metadata) {
229
+ super.info(message, metadata);
230
+ this.emitStreamEvent({
231
+ type: 'info',
232
+ timestamp: new Date().toISOString(),
233
+ message,
234
+ lineNumber: metadata?.lineNumber,
235
+ bubbleName: metadata?.bubbleName,
236
+ variableName: metadata?.variableName,
237
+ additionalData: metadata?.additionalData,
238
+ executionTime: this.getCurrentExecutionTime(),
239
+ memoryUsage: this.getCurrentMemoryUsage(),
240
+ logLevel: LogLevel[LogLevel.INFO],
241
+ });
242
+ }
243
+ /**
244
+ * Set or update the stream callback
245
+ */
246
+ setStreamCallback(callback) {
247
+ this.streamCallback = callback;
248
+ }
249
+ /**
250
+ * Clear the stream callback
251
+ */
252
+ clearStreamCallback() {
253
+ this.streamCallback = undefined;
254
+ }
255
+ /**
256
+ * Emit a streaming event if callback is set
257
+ */
258
+ emitStreamEvent(event) {
259
+ if (this.streamCallback) {
260
+ try {
261
+ // Handle both sync and async callbacks
262
+ const result = this.streamCallback(event);
263
+ if (result instanceof Promise) {
264
+ result.catch((error) => {
265
+ console.error('Stream callback error:', error);
266
+ });
267
+ }
268
+ }
269
+ catch (error) {
270
+ console.error('Stream callback error:', error);
271
+ }
272
+ }
273
+ }
274
+ /**
275
+ * Get current execution time in milliseconds
276
+ */
277
+ getCurrentExecutionTime() {
278
+ const summary = this.getExecutionSummary();
279
+ return summary.totalDuration;
280
+ }
281
+ /**
282
+ * Get current memory usage in bytes
283
+ */
284
+ getCurrentMemoryUsage() {
285
+ if (typeof process !== 'undefined' && process.memoryUsage) {
286
+ return process.memoryUsage().heapUsed;
287
+ }
288
+ return 0;
289
+ }
290
+ }
291
+ //# sourceMappingURL=WebhookStreamLogger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebhookStreamLogger.js","sourceRoot":"","sources":["../../src/logging/WebhookStreamLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,QAAQ,GAGT,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAQrC;;;GAGG;AACH,SAAS,sBAAsB,CAAC,IAAa,EAAE,SAAS,GAAG,GAAG;IAC5D,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IACjC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAE3C,iBAAiB;IACjB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,IAAI,SAAS;YAAE,OAAO,IAAI,CAAC;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;IAC9C,CAAC;IAED,oBAAoB;IACpB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,I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,CAAC;YACxB,IAAI,CAAC;gBACH,uCAAuC;gBACvC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,IAAI,MAAM,YAAY,OAAO,EAAE,CAAC;oBAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;wBACrB,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;oBACjD,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACK,uBAAuB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC,aAAa,CAAC;IAC/B,CAAC;IAED;;OAEG;IACK,qBAAqB;QAC3B,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;YAC1D,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QACxC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
@@ -1,4 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const AvailableTools: z.ZodEnum<["web-search-tool", "web-scrape-tool", "web-crawl-tool", "web-extract-tool", "research-agent-tool", "reddit-scrape-tool", "instagram-tool", "list-bubbles-tool", "get-bubble-details-tool", "bubbleflow-validation-tool", "chart-js-tool", "sql-query-tool"]>;
2
+ export declare const AvailableTools: z.ZodEnum<["web-search-tool", "web-scrape-tool", "web-crawl-tool", "web-extract-tool", "research-agent-tool", "reddit-scrape-tool", "instagram-tool", "list-bubbles-tool", "get-bubble-details-tool", "bubbleflow-validation-tool", "code-edit-tool", "chart-js-tool", "sql-query-tool"]>;
3
3
  export type AvailableTool = z.infer<typeof AvailableTools>;
4
4
  //# sourceMappingURL=available-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"available-tools.d.ts","sourceRoot":"","sources":["../../src/types/available-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc,yQAgBgB,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"available-tools.d.ts","sourceRoot":"","sources":["../../src/types/available-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc,2RAiBgB,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
@@ -15,6 +15,7 @@ export const AvailableTools = z.enum([
15
15
  'list-bubbles-tool',
16
16
  'get-bubble-details-tool',
17
17
  'bubbleflow-validation-tool',
18
+ 'code-edit-tool',
18
19
  'chart-js-tool',
19
20
  'sql-query-tool',
20
21
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"available-tools.js","sourceRoot":"","sources":["../../src/types/available-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,4DAA4D;AAC5D,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,gBAAgB;IAChB,4EAA4E;IAC5E,mBAAmB;IACnB,yBAAyB;IACzB,4BAA4B;IAC5B,eAAe;IACf,gBAAgB;CACwB,CAAC,CAAC"}
1
+ {"version":3,"file":"available-tools.js","sourceRoot":"","sources":["../../src/types/available-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,4DAA4D;AAC5D,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,YAAY;IACZ,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,qBAAqB;IACrB,gBAAgB;IAChB,4EAA4E;IAC5E,mBAAmB;IACnB,yBAAyB;IACzB,4BAA4B;IAC5B,gBAAgB;IAChB,eAAe;IACf,gBAAgB;CACwB,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import type { IBubble, BubbleContext, BubbleResult, BubbleOperationResult } from './bubble.js';
2
+ import type { IBubble, BubbleContext, BubbleResult, BubbleOperationResult } from '@bubblelab/bubble-core';
3
3
  /**
4
4
  * Abstract base class for all bubble types
5
5
  * Implements common properties and methods defined in IBubble interface
@@ -15,12 +15,14 @@ export declare abstract class BaseBubble<TParams = unknown, TResult extends Bubb
15
15
  protected readonly params: TParams;
16
16
  protected context?: BubbleContext;
17
17
  previousResult: BubbleResult<BubbleOperationResult> | undefined;
18
- constructor(params: unknown, context?: BubbleContext);
18
+ protected readonly instanceId?: string;
19
+ constructor(params: unknown, context?: BubbleContext, instanceId?: string);
19
20
  /**
20
21
  * Compute child context based on dependency graph and current unique id.
21
- * Finds the node matching currentUniqueId, then determines this child's unique id as
22
- * `${currentUniqueId}.${this.name}#k` for the next ordinal k, and assigns the variableId from
23
- * the dependency graph if present, otherwise keeps parent's variableId.
22
+ * Finds the node matching currentUniqueId, then determines this child's unique id as:
23
+ * - If instanceId is provided: `${currentUniqueId}.${this.name}#${instanceId}`
24
+ * - Otherwise: `${currentUniqueId}.${this.name}#k` for the next ordinal k
25
+ * Assigns the variableId from the dependency graph if present, otherwise keeps parent's variableId.
24
26
  */
25
27
  private computeChildContext;
26
28
  saveResult<R extends BubbleOperationResult>(result: BubbleResult<R>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"base-bubble-class.d.ts","sourceRoot":"","sources":["../../src/types/base-bubble-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAUrB;;;GAGG;AACH,8BAAsB,UAAU,CAC9B,OAAO,GAAG,OAAO,EACjB,OAAO,SAAS,qBAAqB,GAAG,qBAAqB,CAC7D,YAAW,OAAO,CAAC,OAAO,CAAC;IAE3B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACnD,SAAgB,YAAY,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACzD,SAAgB,gBAAgB,EAAE,MAAM,CAAC;IACzC,SAAgB,eAAe,EAAE,MAAM,CAAC;IACxC,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAyB,IAAI,EACzB,SAAS,GACT,UAAU,GACV,MAAM,GACN,IAAI,GACJ,OAAO,CAAC;IAEZ,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAC3B,cAAc,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC;gBAE3D,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa;IAkEpD;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAqE3B,UAAU,CAAC,CAAC,SAAS,qBAAqB,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;IAI1E,gBAAgB,IAAI,IAAI;IAIxB;;;OAGG;IACH,MAAM,IAAI,MAAM,CAAC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AC3B,cAAc,EAAE,YAAY,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAAC;IACvE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAE3B,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,MAAM;IAyDzE;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IA0F3B,UAAU,CAAC,CAAC,SAAS,qBAAqB,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;IAI1E,gBAAgB,IAAI,IAAI;IAIxB;;;OAGG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAWjC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IA8H9C;;;OAGG;IACH,kBAAkB,IAAI,YAAY,CAAC,OAAO,CAAC;IAI3C;;;OAGG;IACH,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC;IAc/D;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;CAC5E"}
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { randomUUID } from 'crypto';
3
3
  import { MockDataGenerator } from '@bubblelab/shared-schemas';
4
4
  import { BubbleValidationError, BubbleExecutionError, } from './bubble-errors.js';
5
- import { sanitizeParams } from '../utils/param-helper.js';
5
+ import { sanitizeParams } from '@bubblelab/shared-schemas';
6
6
  /**
7
7
  * Abstract base class for all bubble types
8
8
  * Implements common properties and methods defined in IBubble interface
@@ -17,7 +17,8 @@ export class BaseBubble {
17
17
  params;
18
18
  context;
19
19
  previousResult;
20
- constructor(params, context) {
20
+ instanceId;
21
+ constructor(params, context, instanceId) {
21
22
  // Use static properties from the class - typed as required static metadata
22
23
  const ctor = this.constructor;
23
24
  this.name = ctor.bubbleName;
@@ -26,36 +27,29 @@ export class BaseBubble {
26
27
  this.shortDescription = ctor.shortDescription;
27
28
  this.longDescription = ctor.longDescription;
28
29
  this.alias = ctor.alias;
30
+ this.instanceId = instanceId;
29
31
  try {
30
32
  this.params = this.schema.parse(params);
33
+ const normalizedContext = context;
31
34
  // Enrich context with child variableId/currentUniqueId if dependencyGraph is provided
32
- if (context && context.dependencyGraph && context.currentUniqueId) {
33
- console.debug('Computing child context');
34
- const next = this.computeChildContext(context);
35
+ if (normalizedContext &&
36
+ normalizedContext.dependencyGraph &&
37
+ normalizedContext.currentUniqueId) {
38
+ const next = this.computeChildContext(normalizedContext);
35
39
  this.context = next;
36
- console.debug('Computed child context unique id:', this.context?.currentUniqueId);
40
+ console.debug('[BaseBubble] Computed child context unique id:', this.context?.currentUniqueId);
37
41
  //Prnt the var id of the computed child context
38
- console.debug('Computed child context variable id:', this.context?.variableId);
42
+ console.debug('[BaseBubble] Computed child context variable id:', this.context?.variableId);
39
43
  }
40
44
  else {
41
- this.context = context;
45
+ this.context = normalizedContext;
42
46
  }
43
47
  }
44
48
  catch (error) {
45
- // Parse Zod validation errors to make them more user-friendly
46
- if (error instanceof z.ZodError) {
47
- const errorMessages = error.errors.map((err) => {
48
- const path = err.path.length > 0 ? `${err.path.join('.')}: ` : '';
49
- return `${path}${err.message}`;
50
- });
51
- throw new BubbleValidationError(`Parameter validation failed: ${errorMessages.join(', ')}`, {
52
- variableId: context?.variableId,
53
- bubbleName: ctor.bubbleName,
54
- validationErrors: errorMessages,
55
- cause: error,
56
- });
57
- }
58
- throw new BubbleValidationError(`Parameter validation failed: ${String(error)}`, {
49
+ const errorMessage = error instanceof z.ZodError
50
+ ? `Input Schema validation failed: ${error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')}`
51
+ : `Input Schema validation failed: ${error instanceof Error ? error.message : 'Unknown validation error'}`;
52
+ throw new BubbleValidationError(errorMessage, {
59
53
  variableId: context?.variableId,
60
54
  bubbleName: ctor.bubbleName,
61
55
  cause: error instanceof Error ? error : undefined,
@@ -64,9 +58,10 @@ export class BaseBubble {
64
58
  }
65
59
  /**
66
60
  * Compute child context based on dependency graph and current unique id.
67
- * Finds the node matching currentUniqueId, then determines this child's unique id as
68
- * `${currentUniqueId}.${this.name}#k` for the next ordinal k, and assigns the variableId from
69
- * the dependency graph if present, otherwise keeps parent's variableId.
61
+ * Finds the node matching currentUniqueId, then determines this child's unique id as:
62
+ * - If instanceId is provided: `${currentUniqueId}.${this.name}#${instanceId}`
63
+ * - Otherwise: `${currentUniqueId}.${this.name}#k` for the next ordinal k
64
+ * Assigns the variableId from the dependency graph if present, otherwise keeps parent's variableId.
70
65
  */
71
66
  computeChildContext(parentContext) {
72
67
  const graph = parentContext.dependencyGraph;
@@ -84,10 +79,14 @@ export class BaseBubble {
84
79
  }
85
80
  return null;
86
81
  };
82
+ console.log('Current ID:', this.name);
83
+ console.log('Current varid:', this.context?.variableId);
84
+ console.log('Finding parent node by uniqueId:', currentId);
87
85
  const parentNode = currentId ? findByUniqueId(graph, currentId) : graph;
88
86
  // If the current bubble matches the node at currentUniqueId, don't advance; keep IDs from that node
89
87
  if (parentNode && parentNode.name === this.name) {
90
- const sameNodeVarId = parentNode.variableId ??
88
+ const sameNodeVarId = parentContext.variableId ??
89
+ parentNode.variableId ??
91
90
  parentContext.variableId;
92
91
  return {
93
92
  ...parentContext,
@@ -96,22 +95,30 @@ export class BaseBubble {
96
95
  __uniqueIdCounters__: { ...(parentContext.__uniqueIdCounters__ || {}) },
97
96
  };
98
97
  }
99
- // Determine this bubble's ordinal under the parent using a counter map
98
+ // Determine this bubble's identifier under the parent
100
99
  const children = parentNode?.dependencies || [];
101
- const counterKey = `${currentId || 'ROOT'}|${this.name}`;
102
100
  const counters = { ...(parentContext.__uniqueIdCounters__ || {}) };
101
+ let selectedChild = undefined;
102
+ // Use ordinal counter as before
103
+ const counterKey = `${currentId || 'ROOT'}|${this.name}`;
103
104
  const ordinal = (counters[counterKey] || 0) + 1;
105
+ const suffix = `#${ordinal}`;
104
106
  counters[counterKey] = ordinal;
105
107
  // Try to select the nth child by name for an exact uniqueId match
106
108
  const sameNameChildren = children.filter((c) => c.name === this.name);
107
- const selectedChild = sameNameChildren[ordinal - 1];
109
+ selectedChild = sameNameChildren[ordinal - 1];
108
110
  const childUniqueId = selectedChild?.uniqueId ||
109
111
  (currentId
110
- ? `${currentId}.${this.name}#${ordinal}`
111
- : `${this.name}#${ordinal}`);
112
+ ? `${currentId}.${this.name}${suffix}`
113
+ : `${this.name}${suffix}`);
112
114
  // Try to find a matching child node to get variableId; fallback to parent's
113
- const matchingChild = selectedChild ||
114
- children.find((c) => c.uniqueId === childUniqueId || c.name === this.name);
115
+ let matchingChild = children.find((c) => c.variableName === this.instanceId);
116
+ console.log(`[BaseBubble] ${this.name}.computeChildContext: Matching child by variableName:`, matchingChild);
117
+ // if no match is found fallback to || c.uniqueId === childUniqueId || c.name === this.name
118
+ if (!matchingChild) {
119
+ matchingChild = children.find((c) => c.uniqueId === childUniqueId || c.name === this.name);
120
+ console.log(`[BaseBubble] ${this.name}.computeChildContext: Matching child by uniqueId:`, matchingChild);
121
+ }
115
122
  const childVariableId = (matchingChild && typeof matchingChild.variableId === 'number'
116
123
  ? matchingChild.variableId
117
124
  : parentContext.variableId) || parentContext.variableId;
@@ -158,16 +165,33 @@ export class BaseBubble {
158
165
  logger?.logBubbleExecutionComplete(this.context?.variableId ?? -999, this.name, this.name, savedResult);
159
166
  return savedResult;
160
167
  }
161
- const result = await this.performAction(this.context);
168
+ let result;
169
+ try {
170
+ result = await this.performAction(this.context);
171
+ }
172
+ catch (error) {
173
+ console.error('Error executing bubble:', error);
174
+ this.context?.logger?.logBubbleExecutionComplete(this.context?.variableId ?? -999, this.name, this.name, {
175
+ success: false,
176
+ error: error instanceof Error ? error.message : 'Unknown error',
177
+ executionId: randomUUID(),
178
+ timestamp: new Date(),
179
+ });
180
+ this.context?.logger?.error(`[${this.name}] Unexpected error when performing action: ${error instanceof Error ? error.message : 'Unknown error'}`);
181
+ throw new BubbleExecutionError(error instanceof Error ? error.message : 'Unknown error', {
182
+ variableId: this.context?.variableId,
183
+ bubbleName: this.name,
184
+ executionPhase: 'execution',
185
+ cause: error instanceof Error ? error : undefined,
186
+ });
187
+ }
162
188
  // Validate result if schema is provided
163
189
  if (this.resultSchema) {
164
190
  try {
165
191
  const validatedResult = this.resultSchema.parse(result);
166
192
  const finalResult = {
167
193
  success: result.success,
168
- // For data we strip out any excessive fields
169
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
170
- data: (({ ...rest }) => rest)(validatedResult),
194
+ data: result,
171
195
  executionId: randomUUID(),
172
196
  error: validatedResult.error || '',
173
197
  timestamp: new Date(),
@@ -180,14 +204,13 @@ export class BaseBubble {
180
204
  return finalResult;
181
205
  }
182
206
  catch (validationError) {
183
- // Throw execution error for result validation failures
207
+ // Validation error for result validation failures
184
208
  const errorMessage = validationError instanceof z.ZodError
185
209
  ? `Result schema validation failed: ${validationError.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')}`
186
210
  : `Result validation failed: ${validationError instanceof Error ? validationError.message : 'Unknown validation error'}`;
187
- throw new BubbleExecutionError(errorMessage, {
211
+ throw new BubbleValidationError(errorMessage, {
188
212
  variableId: this.context?.variableId,
189
213
  bubbleName: this.name,
190
- executionPhase: 'validation',
191
214
  cause: validationError instanceof Error ? validationError : undefined,
192
215
  });
193
216
  }