@bubblelab/bubble-core 0.1.10 → 0.1.12

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 (350) hide show
  1. package/dist/bubble-bundle.d.ts +803 -351
  2. package/dist/bubble-factory.d.ts.map +1 -1
  3. package/dist/bubble-factory.js +130 -35
  4. package/dist/bubble-factory.js.map +1 -1
  5. package/dist/bubble-flow/bubble-flow-class.d.ts +5 -0
  6. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
  7. package/dist/bubble-flow/bubble-flow-class.js +20 -0
  8. package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
  9. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
  10. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
  11. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
  12. package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
  13. package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
  14. package/dist/bubbles/service-bubble/agi-inc.js +730 -0
  15. package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
  16. package/dist/bubbles/service-bubble/ai-agent.d.ts +273 -61
  17. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  18. package/dist/bubbles/service-bubble/ai-agent.js +536 -405
  19. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  20. package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
  21. package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
  22. package/dist/bubbles/service-bubble/airtable.js +1173 -0
  23. package/dist/bubbles/service-bubble/airtable.js.map +1 -0
  24. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
  25. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
  26. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
  27. package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
  28. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +4 -4
  29. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +14 -14
  30. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
  31. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
  32. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
  33. package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
  34. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +6 -6
  35. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +32 -32
  36. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
  37. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
  38. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
  39. package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
  40. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
  41. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
  42. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
  43. package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
  44. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +12 -12
  45. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1301 -170
  46. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
  47. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +32 -0
  48. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
  49. package/dist/bubbles/service-bubble/apify/apify.d.ts +158 -13
  50. package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
  51. package/dist/bubbles/service-bubble/apify/apify.js +222 -37
  52. package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
  53. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +542 -0
  54. package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts.map +1 -0
  55. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts +37 -0
  56. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.d.ts.map +1 -0
  57. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js +203 -0
  58. package/dist/bubbles/service-bubble/browserbase/browserbase.integration.flow.js.map +1 -0
  59. package/dist/bubbles/service-bubble/browserbase/browserbase.js +593 -0
  60. package/dist/bubbles/service-bubble/browserbase/browserbase.js.map +1 -0
  61. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts +518 -0
  62. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.d.ts.map +1 -0
  63. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js +311 -0
  64. package/dist/bubbles/service-bubble/browserbase/browserbase.schema.js.map +1 -0
  65. package/dist/bubbles/service-bubble/browserbase/index.d.ts +3 -0
  66. package/dist/bubbles/service-bubble/browserbase/index.d.ts.map +1 -0
  67. package/dist/bubbles/service-bubble/browserbase/index.js +3 -0
  68. package/dist/bubbles/service-bubble/browserbase/index.js.map +1 -0
  69. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +1358 -0
  70. package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts.map +1 -0
  71. package/dist/bubbles/service-bubble/crustdata/crustdata.js +219 -0
  72. package/dist/bubbles/service-bubble/crustdata/crustdata.js.map +1 -0
  73. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts +1604 -0
  74. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.d.ts.map +1 -0
  75. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js +194 -0
  76. package/dist/bubbles/service-bubble/crustdata/crustdata.schema.js.map +1 -0
  77. package/dist/bubbles/service-bubble/crustdata/index.d.ts +3 -0
  78. package/dist/bubbles/service-bubble/crustdata/index.d.ts.map +1 -0
  79. package/dist/bubbles/service-bubble/crustdata/index.js +3 -0
  80. package/dist/bubbles/service-bubble/crustdata/index.js.map +1 -0
  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 +2393 -0
  94. package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
  95. package/dist/bubbles/service-bubble/github.js +1046 -0
  96. package/dist/bubbles/service-bubble/github.js.map +1 -0
  97. package/dist/bubbles/service-bubble/gmail.d.ts +180 -180
  98. package/dist/bubbles/service-bubble/google-calendar.d.ts +60 -60
  99. package/dist/bubbles/service-bubble/google-drive.d.ts +69 -68
  100. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
  101. package/dist/bubbles/service-bubble/google-drive.js +35 -3
  102. package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
  103. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
  104. package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
  105. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
  106. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
  107. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
  108. package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
  109. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
  110. package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
  111. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
  112. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
  113. package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
  114. package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
  115. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
  116. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
  117. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
  118. package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
  119. package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
  120. package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
  121. package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
  122. package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
  123. package/dist/bubbles/service-bubble/hello-world.d.ts +4 -4
  124. package/dist/bubbles/service-bubble/http.d.ts +17 -5
  125. package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
  126. package/dist/bubbles/service-bubble/http.integration.flow.d.ts +49 -0
  127. package/dist/bubbles/service-bubble/http.integration.flow.d.ts.map +1 -0
  128. package/dist/bubbles/service-bubble/http.integration.flow.js +425 -0
  129. package/dist/bubbles/service-bubble/http.integration.flow.js.map +1 -0
  130. package/dist/bubbles/service-bubble/http.js +47 -5
  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 +12 -12
  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 +1741 -798
  154. package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
  155. package/dist/bubbles/service-bubble/slack.js +322 -28
  156. package/dist/bubbles/service-bubble/slack.js.map +1 -1
  157. package/dist/bubbles/service-bubble/storage.d.ts +26 -22
  158. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
  159. package/dist/bubbles/service-bubble/storage.js +45 -4
  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/amazon-shopping-tool/amazon-shopping-tool.d.ts +494 -0
  166. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts.map +1 -0
  167. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts +31 -0
  168. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.d.ts.map +1 -0
  169. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js +100 -0
  170. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.integration.flow.js.map +1 -0
  171. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js +1301 -0
  172. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.js.map +1 -0
  173. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +473 -0
  174. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts.map +1 -0
  175. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js +230 -0
  176. package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.js.map +1 -0
  177. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts +3 -0
  178. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.d.ts.map +1 -0
  179. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js +3 -0
  180. package/dist/bubbles/tool-bubble/amazon-shopping-tool/index.js.map +1 -0
  181. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +76 -20
  182. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
  183. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
  184. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
  185. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +14 -14
  186. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
  187. package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
  188. package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
  189. package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
  190. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +740 -0
  191. package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts.map +1 -0
  192. package/dist/bubbles/tool-bubble/company-enrichment-tool.js +350 -0
  193. package/dist/bubbles/tool-bubble/company-enrichment-tool.js.map +1 -0
  194. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
  195. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
  196. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +115 -10
  197. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
  198. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
  199. package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
  200. package/dist/bubbles/tool-bubble/google-maps-tool.js +206 -0
  201. package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
  202. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +36 -36
  203. package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
  204. package/dist/bubbles/tool-bubble/instagram-tool.js +4 -2
  205. package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
  206. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +830 -453
  207. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
  208. package/dist/bubbles/tool-bubble/linkedin-tool.js +236 -14
  209. package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
  210. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
  211. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +66 -66
  212. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
  213. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
  214. package/dist/bubbles/tool-bubble/research-agent-tool.js +32 -17
  215. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
  216. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
  217. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
  218. package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
  219. package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
  220. package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
  221. package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
  222. package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
  223. package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
  224. package/dist/bubbles/tool-bubble/twitter-tool.js +497 -0
  225. package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
  226. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +22 -16
  227. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
  228. package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
  229. package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
  230. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +8 -8
  231. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
  232. package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
  233. package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
  234. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +21 -113
  235. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
  236. package/dist/bubbles/tool-bubble/web-scrape-tool.js +55 -73
  237. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
  238. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +20 -9
  239. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
  240. package/dist/bubbles/tool-bubble/web-search-tool.js +45 -35
  241. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
  242. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +25 -25
  243. package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -1
  244. package/dist/bubbles/tool-bubble/youtube-tool.js +8 -5
  245. package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -1
  246. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
  247. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +30 -30
  248. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
  249. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +22 -22
  250. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
  251. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +70 -70
  252. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
  253. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
  254. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
  255. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +36 -36
  256. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +1 -1
  257. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +14 -14
  258. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
  259. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
  260. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
  261. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +18 -18
  262. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
  263. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
  264. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
  265. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +19 -19
  266. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
  267. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
  268. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
  269. package/dist/bubbles.json +260 -77
  270. package/dist/index.d.ts +25 -4
  271. package/dist/index.d.ts.map +1 -1
  272. package/dist/index.js +18 -3
  273. package/dist/index.js.map +1 -1
  274. package/dist/logging/BubbleLogger.d.ts +55 -16
  275. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  276. package/dist/logging/BubbleLogger.js +192 -77
  277. package/dist/logging/BubbleLogger.js.map +1 -1
  278. package/dist/logging/StreamingBubbleLogger.d.ts +21 -1
  279. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
  280. package/dist/logging/StreamingBubbleLogger.js +80 -8
  281. package/dist/logging/StreamingBubbleLogger.js.map +1 -1
  282. package/dist/logging/WebhookStreamLogger.d.ts +66 -0
  283. package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
  284. package/dist/logging/WebhookStreamLogger.js +291 -0
  285. package/dist/logging/WebhookStreamLogger.js.map +1 -0
  286. package/dist/types/available-tools.d.ts +1 -1
  287. package/dist/types/available-tools.d.ts.map +1 -1
  288. package/dist/types/available-tools.js +7 -0
  289. package/dist/types/available-tools.js.map +1 -1
  290. package/dist/types/base-bubble-class.d.ts +6 -4
  291. package/dist/types/base-bubble-class.d.ts.map +1 -1
  292. package/dist/types/base-bubble-class.js +30 -23
  293. package/dist/types/base-bubble-class.js.map +1 -1
  294. package/dist/types/bubble.d.ts +2 -0
  295. package/dist/types/bubble.d.ts.map +1 -1
  296. package/dist/types/service-bubble-class.d.ts +1 -1
  297. package/dist/types/service-bubble-class.d.ts.map +1 -1
  298. package/dist/types/service-bubble-class.js +2 -2
  299. package/dist/types/service-bubble-class.js.map +1 -1
  300. package/dist/types/tool-bubble-class.d.ts +1 -1
  301. package/dist/types/tool-bubble-class.d.ts.map +1 -1
  302. package/dist/types/tool-bubble-class.js +60 -10
  303. package/dist/types/tool-bubble-class.js.map +1 -1
  304. package/dist/types/workflow-bubble-class.d.ts +1 -1
  305. package/dist/types/workflow-bubble-class.d.ts.map +1 -1
  306. package/dist/types/workflow-bubble-class.js +2 -2
  307. package/dist/types/workflow-bubble-class.js.map +1 -1
  308. package/dist/utils/agent-formatter.d.ts +14 -2
  309. package/dist/utils/agent-formatter.d.ts.map +1 -1
  310. package/dist/utils/agent-formatter.js +174 -26
  311. package/dist/utils/agent-formatter.js.map +1 -1
  312. package/dist/utils/bubbleflow-validation.d.ts +7 -0
  313. package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
  314. package/dist/utils/bubbleflow-validation.js +171 -6
  315. package/dist/utils/bubbleflow-validation.js.map +1 -1
  316. package/dist/utils/json-parsing.d.ts.map +1 -1
  317. package/dist/utils/json-parsing.js +146 -0
  318. package/dist/utils/json-parsing.js.map +1 -1
  319. package/dist/utils/safe-gemini-chat.d.ts +31 -0
  320. package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
  321. package/dist/utils/safe-gemini-chat.js +93 -0
  322. package/dist/utils/safe-gemini-chat.js.map +1 -0
  323. package/dist/utils/schema-comparison.d.ts +92 -0
  324. package/dist/utils/schema-comparison.d.ts.map +1 -0
  325. package/dist/utils/schema-comparison.js +716 -0
  326. package/dist/utils/schema-comparison.js.map +1 -0
  327. package/dist/utils/zod-schema.d.ts +24 -0
  328. package/dist/utils/zod-schema.d.ts.map +1 -0
  329. package/dist/utils/zod-schema.js +56 -0
  330. package/dist/utils/zod-schema.js.map +1 -0
  331. package/package.json +6 -4
  332. package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
  333. package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
  334. package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
  335. package/dist/bubbles/service-bubble/x-twitter.d.ts +0 -814
  336. package/dist/bubbles/service-bubble/x-twitter.d.ts.map +0 -1
  337. package/dist/bubbles/service-bubble/x-twitter.js +0 -445
  338. package/dist/bubbles/service-bubble/x-twitter.js.map +0 -1
  339. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -125
  340. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
  341. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -808
  342. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
  343. package/dist/test-gm.d.ts +0 -10
  344. package/dist/test-gm.d.ts.map +0 -1
  345. package/dist/test-gm.js +0 -95
  346. package/dist/test-gm.js.map +0 -1
  347. package/dist/utils/param-helper.d.ts +0 -2
  348. package/dist/utils/param-helper.d.ts.map +0 -1
  349. package/dist/utils/param-helper.js +0 -5
  350. package/dist/utils/param-helper.js.map +0 -1
@@ -28,9 +28,9 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
28
28
  yAxisLabel?: string | undefined;
29
29
  }, {
30
30
  title?: string | undefined;
31
+ colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
31
32
  xAxisLabel?: string | undefined;
32
33
  yAxisLabel?: string | undefined;
33
- colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
34
34
  responsive?: boolean | undefined;
35
35
  maintainAspectRatio?: boolean | undefined;
36
36
  showLegend?: boolean | undefined;
@@ -76,9 +76,9 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
76
76
  chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
77
77
  options?: {
78
78
  title?: string | undefined;
79
+ colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
79
80
  xAxisLabel?: string | undefined;
80
81
  yAxisLabel?: string | undefined;
81
- colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
82
82
  responsive?: boolean | undefined;
83
83
  maintainAspectRatio?: boolean | undefined;
84
84
  showLegend?: boolean | undefined;
@@ -86,9 +86,9 @@ declare const ChartJSToolParamsSchema: z.ZodObject<{
86
86
  } | undefined;
87
87
  credentials?: Partial<Record<CredentialType, string>> | undefined;
88
88
  config?: Record<string, unknown> | undefined;
89
- fileName?: string | undefined;
90
89
  width?: number | undefined;
91
90
  height?: number | undefined;
91
+ fileName?: string | undefined;
92
92
  xColumn?: string | undefined;
93
93
  yColumn?: string | undefined;
94
94
  groupByColumn?: string | undefined;
@@ -139,6 +139,8 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
139
139
  success: z.ZodBoolean;
140
140
  error: z.ZodString;
141
141
  }, "strip", z.ZodTypeAny, {
142
+ error: string;
143
+ success: boolean;
142
144
  metadata: {
143
145
  colorScheme: string;
144
146
  generatedAt: string;
@@ -146,8 +148,6 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
146
148
  yColumn?: string | undefined;
147
149
  groupByColumn?: string | undefined;
148
150
  };
149
- success: boolean;
150
- error: string;
151
151
  chartType: string;
152
152
  chartConfig: Record<string, unknown>;
153
153
  datasetCount: number;
@@ -160,6 +160,8 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
160
160
  filePath?: string | undefined;
161
161
  fileExists?: boolean | undefined;
162
162
  }, {
163
+ error: string;
164
+ success: boolean;
163
165
  metadata: {
164
166
  colorScheme: string;
165
167
  generatedAt: string;
@@ -167,8 +169,6 @@ declare const ChartJSToolResultSchema: z.ZodObject<{
167
169
  yColumn?: string | undefined;
168
170
  groupByColumn?: string | undefined;
169
171
  };
170
- success: boolean;
171
- error: string;
172
172
  chartType: string;
173
173
  chartConfig: Record<string, unknown>;
174
174
  datasetCount: number;
@@ -216,9 +216,9 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
216
216
  yAxisLabel?: string | undefined;
217
217
  }, {
218
218
  title?: string | undefined;
219
+ colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
219
220
  xAxisLabel?: string | undefined;
220
221
  yAxisLabel?: string | undefined;
221
- colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
222
222
  responsive?: boolean | undefined;
223
223
  maintainAspectRatio?: boolean | undefined;
224
224
  showLegend?: boolean | undefined;
@@ -264,9 +264,9 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
264
264
  chartType: "line" | "bar" | "pie" | "doughnut" | "radar" | "scatter" | "bubble" | "polarArea";
265
265
  options?: {
266
266
  title?: string | undefined;
267
+ colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
267
268
  xAxisLabel?: string | undefined;
268
269
  yAxisLabel?: string | undefined;
269
- colorScheme?: "default" | "viridis" | "plasma" | "inferno" | "magma" | "blues" | "greens" | "reds" | "oranges" | "categorical" | undefined;
270
270
  responsive?: boolean | undefined;
271
271
  maintainAspectRatio?: boolean | undefined;
272
272
  showLegend?: boolean | undefined;
@@ -274,9 +274,9 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
274
274
  } | undefined;
275
275
  credentials?: Partial<Record<CredentialType, string>> | undefined;
276
276
  config?: Record<string, unknown> | undefined;
277
- fileName?: string | undefined;
278
277
  width?: number | undefined;
279
278
  height?: number | undefined;
279
+ fileName?: string | undefined;
280
280
  xColumn?: string | undefined;
281
281
  yColumn?: string | undefined;
282
282
  groupByColumn?: string | undefined;
@@ -324,6 +324,8 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
324
324
  success: z.ZodBoolean;
325
325
  error: z.ZodString;
326
326
  }, "strip", z.ZodTypeAny, {
327
+ error: string;
328
+ success: boolean;
327
329
  metadata: {
328
330
  colorScheme: string;
329
331
  generatedAt: string;
@@ -331,8 +333,6 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
331
333
  yColumn?: string | undefined;
332
334
  groupByColumn?: string | undefined;
333
335
  };
334
- success: boolean;
335
- error: string;
336
336
  chartType: string;
337
337
  chartConfig: Record<string, unknown>;
338
338
  datasetCount: number;
@@ -345,6 +345,8 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
345
345
  filePath?: string | undefined;
346
346
  fileExists?: boolean | undefined;
347
347
  }, {
348
+ error: string;
349
+ success: boolean;
348
350
  metadata: {
349
351
  colorScheme: string;
350
352
  generatedAt: string;
@@ -352,8 +354,6 @@ export declare class ChartJSTool extends ToolBubble<ChartJSToolParams, ChartJSTo
352
354
  yColumn?: string | undefined;
353
355
  groupByColumn?: string | undefined;
354
356
  };
355
- success: boolean;
356
- error: string;
357
357
  chartType: string;
358
358
  chartConfig: Record<string, unknown>;
359
359
  datasetCount: number;
@@ -0,0 +1,188 @@
1
+ /**
2
+ * EDIT BUBBLEFLOW TOOL
3
+ *
4
+ * A tool bubble that applies code edits to BubbleFlow files using Morph Fast Apply.
5
+ * This tool uses the Morph API via OpenRouter to intelligently merge code changes
6
+ * specified by an AI agent into existing BubbleFlow code, following the Fast Apply
7
+ * pattern used in Cursor.
8
+ *
9
+ * Features:
10
+ * - Intelligent code merging using Morph Fast Apply model
11
+ * - Support for lazy edits with "// ... existing code ..." markers
12
+ * - Minimal context repetition for efficient edits
13
+ * - Automatic validation after edits
14
+ * - Detailed diff reporting
15
+ */
16
+ import { z } from 'zod';
17
+ import { ToolBubble } from '../../types/tool-bubble-class.js';
18
+ /**
19
+ * Define the parameters schema using Zod
20
+ * This schema validates and types the input parameters for the edit tool
21
+ */
22
+ declare const EditBubbleFlowToolParamsSchema: z.ZodObject<{
23
+ initialCode: z.ZodString;
24
+ instructions: z.ZodString;
25
+ codeEdit: z.ZodString;
26
+ morphModel: z.ZodOptional<z.ZodDefault<z.ZodString>>;
27
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
28
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ instructions: string;
31
+ initialCode: string;
32
+ codeEdit: string;
33
+ credentials?: Record<string, string> | undefined;
34
+ config?: Record<string, unknown> | undefined;
35
+ morphModel?: string | undefined;
36
+ }, {
37
+ instructions: string;
38
+ initialCode: string;
39
+ codeEdit: string;
40
+ credentials?: Record<string, string> | undefined;
41
+ config?: Record<string, unknown> | undefined;
42
+ morphModel?: string | undefined;
43
+ }>;
44
+ /**
45
+ * Type definitions derived from schemas
46
+ */
47
+ type EditBubbleFlowToolParams = z.output<typeof EditBubbleFlowToolParamsSchema>;
48
+ type EditBubbleFlowToolResult = z.output<typeof EditBubbleFlowToolResultSchema>;
49
+ /**
50
+ * Define the result schema
51
+ * This schema defines what the edit tool returns
52
+ */
53
+ declare const EditBubbleFlowToolResultSchema: z.ZodObject<{
54
+ mergedCode: z.ZodString;
55
+ applied: z.ZodBoolean;
56
+ diff: z.ZodOptional<z.ZodString>;
57
+ metadata: z.ZodObject<{
58
+ editedAt: z.ZodString;
59
+ originalLength: z.ZodNumber;
60
+ finalLength: z.ZodNumber;
61
+ morphModel: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ originalLength: number;
64
+ morphModel: string;
65
+ editedAt: string;
66
+ finalLength: number;
67
+ }, {
68
+ originalLength: number;
69
+ morphModel: string;
70
+ editedAt: string;
71
+ finalLength: number;
72
+ }>;
73
+ success: z.ZodBoolean;
74
+ error: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ error: string;
77
+ success: boolean;
78
+ metadata: {
79
+ originalLength: number;
80
+ morphModel: string;
81
+ editedAt: string;
82
+ finalLength: number;
83
+ };
84
+ mergedCode: string;
85
+ applied: boolean;
86
+ diff?: string | undefined;
87
+ }, {
88
+ error: string;
89
+ success: boolean;
90
+ metadata: {
91
+ originalLength: number;
92
+ morphModel: string;
93
+ editedAt: string;
94
+ finalLength: number;
95
+ };
96
+ mergedCode: string;
97
+ applied: boolean;
98
+ diff?: string | undefined;
99
+ }>;
100
+ /**
101
+ * Edit BubbleFlow Tool
102
+ * Applies code edits using Morph Fast Apply API via AIAgent
103
+ */
104
+ export declare class EditBubbleFlowTool extends ToolBubble<EditBubbleFlowToolParams, EditBubbleFlowToolResult> {
105
+ /**
106
+ * REQUIRED STATIC METADATA
107
+ */
108
+ static readonly type: "tool";
109
+ static readonly bubbleName = "code-edit-tool";
110
+ static readonly schema: z.ZodObject<{
111
+ initialCode: z.ZodString;
112
+ instructions: z.ZodString;
113
+ codeEdit: z.ZodString;
114
+ morphModel: z.ZodOptional<z.ZodDefault<z.ZodString>>;
115
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
116
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ instructions: string;
119
+ initialCode: string;
120
+ codeEdit: string;
121
+ credentials?: Record<string, string> | undefined;
122
+ config?: Record<string, unknown> | undefined;
123
+ morphModel?: string | undefined;
124
+ }, {
125
+ instructions: string;
126
+ initialCode: string;
127
+ codeEdit: string;
128
+ credentials?: Record<string, string> | undefined;
129
+ config?: Record<string, unknown> | undefined;
130
+ morphModel?: string | undefined;
131
+ }>;
132
+ static readonly resultSchema: z.ZodObject<{
133
+ mergedCode: z.ZodString;
134
+ applied: z.ZodBoolean;
135
+ diff: z.ZodOptional<z.ZodString>;
136
+ metadata: z.ZodObject<{
137
+ editedAt: z.ZodString;
138
+ originalLength: z.ZodNumber;
139
+ finalLength: z.ZodNumber;
140
+ morphModel: z.ZodString;
141
+ }, "strip", z.ZodTypeAny, {
142
+ originalLength: number;
143
+ morphModel: string;
144
+ editedAt: string;
145
+ finalLength: number;
146
+ }, {
147
+ originalLength: number;
148
+ morphModel: string;
149
+ editedAt: string;
150
+ finalLength: number;
151
+ }>;
152
+ success: z.ZodBoolean;
153
+ error: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ error: string;
156
+ success: boolean;
157
+ metadata: {
158
+ originalLength: number;
159
+ morphModel: string;
160
+ editedAt: string;
161
+ finalLength: number;
162
+ };
163
+ mergedCode: string;
164
+ applied: boolean;
165
+ diff?: string | undefined;
166
+ }, {
167
+ error: string;
168
+ success: boolean;
169
+ metadata: {
170
+ originalLength: number;
171
+ morphModel: string;
172
+ editedAt: string;
173
+ finalLength: number;
174
+ };
175
+ mergedCode: string;
176
+ applied: boolean;
177
+ diff?: string | undefined;
178
+ }>;
179
+ static readonly shortDescription = "Applies code edits to BubbleFlow files using Morph Fast Apply";
180
+ static readonly longDescription = "\n A tool for intelligently applying code edits to BubbleFlow TypeScript files.\n Uses the Morph Fast Apply API via OpenRouter to merge lazy code edits into existing code.\n\n What it does:\n - Merges code edits specified with \"// ... existing code ...\" markers\n - Uses Morph's apply model for intelligent code merging\n - Minimizes context repetition for efficient edits\n - Returns the final merged code\n\n How it works:\n - Takes original code, edit instructions, and code edit as input\n - Sends to Morph API via OpenRouter using HttpBubble\n - Receives merged code from Morph's apply model\n - Returns the final code ready to be written to file\n\n Use cases:\n - When an AI agent needs to make edits to BubbleFlow code\n - When applying multiple distinct edits to a file at once\n - When making targeted changes without rewriting entire files\n - When following the Cursor Fast Apply pattern for code edits\n\n Important:\n - The codeEdit parameter should use \"// ... existing code ...\" to mark unchanged sections\n - The instructions parameter should be generated by the model in first person\n - Requires OPENROUTER_CRED credential for Morph API access via OpenRouter\n ";
181
+ static readonly alias = "code-edit";
182
+ /**
183
+ * Main action method - performs code edit merging
184
+ */
185
+ performAction(): Promise<EditBubbleFlowToolResult>;
186
+ }
187
+ export {};
188
+ //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DIT BUBBLEFLOW TOOL
3
+ *
4
+ * A tool bubble that applies code edits to BubbleFlow files using Morph Fast Apply.
5
+ * This tool uses the Morph API via OpenRouter to intelligently merge code changes
6
+ * specified by an AI agent into existing BubbleFlow code, following the Fast Apply
7
+ * pattern used in Cursor.
8
+ *
9
+ * Features:
10
+ * - Intelligent code merging using Morph Fast Apply model
11
+ * - Support for lazy edits with "// ... existing code ..." markers
12
+ * - Minimal context repetition for efficient edits
13
+ * - Automatic validation after edits
14
+ * - Detailed diff reporting
15
+ */
16
+ import { z } from 'zod';
17
+ import { ToolBubble } from '../../types/tool-bubble-class.js';
18
+ import { CredentialType } from '@bubblelab/shared-schemas';
19
+ import { HttpBubble } from '../service-bubble/http.js';
20
+ /**
21
+ * Define the parameters schema using Zod
22
+ * This schema validates and types the input parameters for the edit tool
23
+ */
24
+ const EditBubbleFlowToolParamsSchema = z.object({
25
+ // The original BubbleFlow code
26
+ initialCode: z.string().describe('The original code to be edited'),
27
+ // The edit instructions
28
+ instructions: z
29
+ .string()
30
+ .describe('A single sentence instruction in first person describing what changes are being made (e.g., "I am adding error handling to the user auth and removing the old auth functions"). Used to help disambiguate uncertainty in the edit.'),
31
+ // The code edit with markers
32
+ codeEdit: z
33
+ .string()
34
+ .describe('The code changes to apply. Specify ONLY the precise lines of code that you wish to edit. Use "// ... existing code ..." to represent unchanged sections. DO NOT omit spans of pre-existing code without using the marker, as this may cause inadvertent deletion.'),
35
+ // Optional Morph model configuration
36
+ morphModel: z
37
+ .string()
38
+ .default('morph/morph-v3-large')
39
+ .optional()
40
+ .describe('Morph model to use for applying edits via OpenRouter'),
41
+ // Credentials (injected at runtime)
42
+ credentials: z
43
+ .record(z.string(), z.string())
44
+ .optional()
45
+ .describe('Credentials (HIDDEN from AI - injected at runtime)'),
46
+ // Optional configuration
47
+ config: z
48
+ .record(z.string(), z.unknown())
49
+ .optional()
50
+ .describe('Configuration for the edit tool (HIDDEN from AI - injected at runtime)'),
51
+ });
52
+ /**
53
+ * Define the result schema
54
+ * This schema defines what the edit tool returns
55
+ */
56
+ const EditBubbleFlowToolResultSchema = z.object({
57
+ // The final merged code
58
+ mergedCode: z.string().describe('The final code after applying edits'),
59
+ // Success indicator
60
+ applied: z.boolean().describe('Whether the edit was successfully applied'),
61
+ // Optional diff information
62
+ diff: z
63
+ .string()
64
+ .optional()
65
+ .describe('Unified diff showing the changes made (if available)'),
66
+ // Metadata
67
+ metadata: z.object({
68
+ editedAt: z.string().describe('Timestamp when edit was performed'),
69
+ originalLength: z
70
+ .number()
71
+ .describe('Length of original code in characters'),
72
+ finalLength: z.number().describe('Length of final code in characters'),
73
+ morphModel: z.string().describe('Morph model used for the edit'),
74
+ }),
75
+ // Standard result fields
76
+ success: z.boolean().describe('Whether the edit operation was successful'),
77
+ error: z.string().describe('Error message if edit failed'),
78
+ });
79
+ /**
80
+ * Edit BubbleFlow Tool
81
+ * Applies code edits using Morph Fast Apply API via AIAgent
82
+ */
83
+ export class EditBubbleFlowTool extends ToolBubble {
84
+ /**
85
+ * REQUIRED STATIC METADATA
86
+ */
87
+ // Bubble type - always 'tool' for tool bubbles
88
+ static type = 'tool';
89
+ // Unique identifier for the tool
90
+ static bubbleName = 'code-edit-tool';
91
+ // Schemas for validation
92
+ static schema = EditBubbleFlowToolParamsSchema;
93
+ static resultSchema = EditBubbleFlowToolResultSchema;
94
+ // Short description
95
+ static shortDescription = 'Applies code edits to BubbleFlow files using Morph Fast Apply';
96
+ // Long description with detailed information
97
+ static longDescription = `
98
+ A tool for intelligently applying code edits to BubbleFlow TypeScript files.
99
+ Uses the Morph Fast Apply API via OpenRouter to merge lazy code edits into existing code.
100
+
101
+ What it does:
102
+ - Merges code edits specified with "// ... existing code ..." markers
103
+ - Uses Morph's apply model for intelligent code merging
104
+ - Minimizes context repetition for efficient edits
105
+ - Returns the final merged code
106
+
107
+ How it works:
108
+ - Takes original code, edit instructions, and code edit as input
109
+ - Sends to Morph API via OpenRouter using HttpBubble
110
+ - Receives merged code from Morph's apply model
111
+ - Returns the final code ready to be written to file
112
+
113
+ Use cases:
114
+ - When an AI agent needs to make edits to BubbleFlow code
115
+ - When applying multiple distinct edits to a file at once
116
+ - When making targeted changes without rewriting entire files
117
+ - When following the Cursor Fast Apply pattern for code edits
118
+
119
+ Important:
120
+ - The codeEdit parameter should use "// ... existing code ..." to mark unchanged sections
121
+ - The instructions parameter should be generated by the model in first person
122
+ - Requires OPENROUTER_CRED credential for Morph API access via OpenRouter
123
+ `;
124
+ // Short alias for the tool
125
+ static alias = 'code-edit';
126
+ /**
127
+ * Main action method - performs code edit merging
128
+ */
129
+ async performAction() {
130
+ try {
131
+ // Extract parameters
132
+ const { initialCode, instructions, codeEdit, morphModel } = this.params;
133
+ // Validate inputs
134
+ if (!initialCode || initialCode.trim().length === 0) {
135
+ return {
136
+ mergedCode: '',
137
+ applied: false,
138
+ metadata: {
139
+ editedAt: new Date().toISOString(),
140
+ originalLength: 0,
141
+ finalLength: 0,
142
+ morphModel: morphModel ?? 'morph/morph-v3-large',
143
+ },
144
+ success: false,
145
+ error: 'Initial code cannot be empty',
146
+ };
147
+ }
148
+ if (!instructions || instructions.trim().length === 0) {
149
+ return {
150
+ mergedCode: initialCode,
151
+ applied: false,
152
+ metadata: {
153
+ editedAt: new Date().toISOString(),
154
+ originalLength: initialCode.length,
155
+ finalLength: initialCode.length,
156
+ morphModel: morphModel ?? 'morph/morph-v3-large',
157
+ },
158
+ success: false,
159
+ error: 'Instructions cannot be empty',
160
+ };
161
+ }
162
+ if (!codeEdit || codeEdit.trim().length === 0) {
163
+ return {
164
+ mergedCode: initialCode,
165
+ applied: false,
166
+ metadata: {
167
+ editedAt: new Date().toISOString(),
168
+ originalLength: initialCode.length,
169
+ finalLength: initialCode.length,
170
+ morphModel: morphModel ?? 'morph/morph-v3-large',
171
+ },
172
+ success: false,
173
+ error: 'Code edit cannot be empty',
174
+ };
175
+ }
176
+ // Get OpenRouter API key from credentials
177
+ const apiKey = this.params.credentials?.[CredentialType.OPENROUTER_CRED];
178
+ if (!apiKey) {
179
+ return {
180
+ mergedCode: initialCode,
181
+ applied: false,
182
+ metadata: {
183
+ editedAt: new Date().toISOString(),
184
+ originalLength: initialCode.length,
185
+ finalLength: initialCode.length,
186
+ morphModel: morphModel ?? 'morph/morph-v3-large',
187
+ },
188
+ success: false,
189
+ error: 'OpenRouter API key not found. Please provide OPENROUTER_CRED credential.',
190
+ };
191
+ }
192
+ // Construct the message for Morph API following the recommended format
193
+ const morphPrompt = `<instruction>${instructions}</instruction>\n<code>${initialCode}</code>\n<update>${codeEdit}</update>`;
194
+ // Use HttpBubble to call OpenRouter API
195
+ const httpBubble = new HttpBubble({
196
+ url: 'https://openrouter.ai/api/v1/chat/completions',
197
+ method: 'POST',
198
+ headers: {
199
+ Authorization: `Bearer ${apiKey}`,
200
+ 'Content-Type': 'application/json',
201
+ },
202
+ body: {
203
+ model: 'morph/morph-v3-large',
204
+ messages: [
205
+ {
206
+ role: 'user',
207
+ content: morphPrompt,
208
+ },
209
+ ],
210
+ },
211
+ timeout: 60000, // 60 second timeout for code generation
212
+ }, this.context);
213
+ // Execute the HTTP request
214
+ const result = await httpBubble.action();
215
+ if (!result.success || !result.data?.json) {
216
+ return {
217
+ mergedCode: initialCode,
218
+ applied: false,
219
+ metadata: {
220
+ editedAt: new Date().toISOString(),
221
+ originalLength: initialCode.length,
222
+ finalLength: initialCode.length,
223
+ morphModel: morphModel ?? 'morph/morph-v3-large',
224
+ },
225
+ success: false,
226
+ error: result.error || 'Morph API returned empty response',
227
+ };
228
+ }
229
+ const responseData = result.data.json;
230
+ // Extract token usage - OpenRouter uses 'usage' field (OpenAI format)
231
+ // Fallback to usage_metadata if present (some providers use this)
232
+ let inputTokens = 0;
233
+ let outputTokens = 0;
234
+ let totalTokens = 0;
235
+ if (responseData.usage) {
236
+ // OpenAI format: usage.prompt_tokens, usage.completion_tokens
237
+ inputTokens = responseData.usage.prompt_tokens ?? 0;
238
+ outputTokens = responseData.usage.completion_tokens ?? 0;
239
+ totalTokens = responseData.usage.total_tokens ?? 0;
240
+ }
241
+ else if (responseData.usage_metadata) {
242
+ // Alternative format: usage_metadata.input_tokens, usage_metadata.output_tokens
243
+ inputTokens = responseData.usage_metadata.input_tokens ?? 0;
244
+ outputTokens = responseData.usage_metadata.output_tokens ?? 0;
245
+ totalTokens = responseData.usage_metadata.total_tokens ?? 0;
246
+ }
247
+ const tokenUsage = {
248
+ inputTokens,
249
+ outputTokens,
250
+ totalTokens,
251
+ modelName: morphModel ?? 'morph/morph-v3-large',
252
+ };
253
+ if (this.context?.logger) {
254
+ this.context.logger.logTokenUsage({
255
+ usage: tokenUsage.inputTokens,
256
+ service: CredentialType.OPENROUTER_CRED,
257
+ unit: 'input_tokens',
258
+ subService: morphModel ?? 'morph/morph-v3-large',
259
+ }, `LLM completion: ${tokenUsage.inputTokens} input`, {
260
+ bubbleName: 'code-edit-tool',
261
+ variableId: this.context?.variableId,
262
+ operationType: 'bubble_execution',
263
+ });
264
+ this.context.logger.logTokenUsage({
265
+ usage: tokenUsage.outputTokens,
266
+ service: CredentialType.OPENROUTER_CRED,
267
+ unit: 'output_tokens',
268
+ subService: morphModel ?? 'morph/morph-v3-large',
269
+ }, `LLM completion: ${tokenUsage.outputTokens} output`, {
270
+ bubbleName: 'code-edit-tool',
271
+ variableId: this.context?.variableId,
272
+ operationType: 'bubble_execution',
273
+ });
274
+ }
275
+ const mergedCode = responseData.choices?.[0]?.message?.content;
276
+ if (!mergedCode) {
277
+ return {
278
+ mergedCode: initialCode,
279
+ applied: false,
280
+ metadata: {
281
+ editedAt: new Date().toISOString(),
282
+ originalLength: initialCode.length,
283
+ finalLength: initialCode.length,
284
+ morphModel: morphModel ?? 'morph/morph-v3-large',
285
+ },
286
+ success: false,
287
+ error: 'Morph API returned empty content',
288
+ };
289
+ }
290
+ // Return successful result
291
+ return {
292
+ mergedCode,
293
+ applied: true,
294
+ metadata: {
295
+ editedAt: new Date().toISOString(),
296
+ originalLength: initialCode.length,
297
+ finalLength: mergedCode.length,
298
+ morphModel: morphModel ?? 'openrouter/morph/morph-v3-large',
299
+ },
300
+ success: true,
301
+ error: '',
302
+ };
303
+ }
304
+ catch (error) {
305
+ // Handle unexpected errors gracefully
306
+ return {
307
+ mergedCode: this.params.initialCode || '',
308
+ applied: false,
309
+ metadata: {
310
+ editedAt: new Date().toISOString(),
311
+ originalLength: this.params.initialCode?.length || 0,
312
+ finalLength: this.params.initialCode?.length || 0,
313
+ morphModel: this.params.morphModel ?? 'openrouter/morph/morph-v3-large',
314
+ },
315
+ success: false,
316
+ error: error instanceof Error ? error.message : 'Unknown error occurred',
317
+ };
318
+ }
319
+ }
320
+ }
321
+ //# sourceMappingURL=code-edit-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-edit-tool.js","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/code-edit-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;GAGG;AACH,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,+BAA+B;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAElE,wBAAwB;IACxB,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,QAAQ,CACP,oOAAoO,CACrO;IAEH,6BAA6B;IAC7B,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CACP,mQAAmQ,CACpQ;IAEH,qCAAqC;IACrC,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,OAAO,CAAC,sBAAsB,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ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