@bubblelab/bubble-core 0.1.0

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 (275) hide show
  1. package/LICENSE.txt +202 -0
  2. package/dist/bubble-bundle.d.ts +2021 -0
  3. package/dist/bubble-factory.d.ts +161 -0
  4. package/dist/bubble-factory.d.ts.map +1 -0
  5. package/dist/bubble-factory.js +426 -0
  6. package/dist/bubble-factory.js.map +1 -0
  7. package/dist/bubble-flow/bubble-flow-class.d.ts +19 -0
  8. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -0
  9. package/dist/bubble-flow/bubble-flow-class.js +23 -0
  10. package/dist/bubble-flow/bubble-flow-class.js.map +1 -0
  11. package/dist/bubble-flow/sample/data-analyst-flow.d.ts +15 -0
  12. package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -0
  13. package/dist/bubble-flow/sample/data-analyst-flow.js +63 -0
  14. package/dist/bubble-flow/sample/data-analyst-flow.js.map +1 -0
  15. package/dist/bubble-flow/sample/error-ts.d.ts +23 -0
  16. package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -0
  17. package/dist/bubble-flow/sample/error-ts.js +31 -0
  18. package/dist/bubble-flow/sample/error-ts.js.map +1 -0
  19. package/dist/bubble-flow/sample/sanitytest.d.ts +10 -0
  20. package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -0
  21. package/dist/bubble-flow/sample/sanitytest.js +13 -0
  22. package/dist/bubble-flow/sample/sanitytest.js.map +1 -0
  23. package/dist/bubble-flow/sample/simple-webhook-2.d.ts +19 -0
  24. package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -0
  25. package/dist/bubble-flow/sample/simple-webhook-2.js +23 -0
  26. package/dist/bubble-flow/sample/simple-webhook-2.js.map +1 -0
  27. package/dist/bubble-flow/sample/simple-webhook.d.ts +10 -0
  28. package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -0
  29. package/dist/bubble-flow/sample/simple-webhook.js +18 -0
  30. package/dist/bubble-flow/sample/simple-webhook.js.map +1 -0
  31. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +29 -0
  32. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -0
  33. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +150 -0
  34. package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -0
  35. package/dist/bubble-flow/sample/slack-v0.1.d.ts +10 -0
  36. package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -0
  37. package/dist/bubble-flow/sample/slack-v0.1.js +59 -0
  38. package/dist/bubble-flow/sample/slack-v0.1.js.map +1 -0
  39. package/dist/bubble-flow/sample/slackagenttest.d.ts +10 -0
  40. package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -0
  41. package/dist/bubble-flow/sample/slackagenttest.js +59 -0
  42. package/dist/bubble-flow/sample/slackagenttest.js.map +1 -0
  43. package/dist/bubble-trigger/index.d.ts +2 -0
  44. package/dist/bubble-trigger/index.d.ts.map +1 -0
  45. package/dist/bubble-trigger/index.js +2 -0
  46. package/dist/bubble-trigger/index.js.map +1 -0
  47. package/dist/bubble-trigger/types.d.ts +87 -0
  48. package/dist/bubble-trigger/types.d.ts.map +1 -0
  49. package/dist/bubble-trigger/types.js +14 -0
  50. package/dist/bubble-trigger/types.js.map +1 -0
  51. package/dist/bubbles/service-bubble/ai-agent.d.ts +428 -0
  52. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -0
  53. package/dist/bubbles/service-bubble/ai-agent.js +881 -0
  54. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -0
  55. package/dist/bubbles/service-bubble/gmail.d.ts +3073 -0
  56. package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -0
  57. package/dist/bubbles/service-bubble/gmail.js +908 -0
  58. package/dist/bubbles/service-bubble/gmail.js.map +1 -0
  59. package/dist/bubbles/service-bubble/google-calendar.d.ts +3377 -0
  60. package/dist/bubbles/service-bubble/google-calendar.d.ts.map +1 -0
  61. package/dist/bubbles/service-bubble/google-calendar.js +527 -0
  62. package/dist/bubbles/service-bubble/google-calendar.js.map +1 -0
  63. package/dist/bubbles/service-bubble/google-drive.d.ts +1152 -0
  64. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -0
  65. package/dist/bubbles/service-bubble/google-drive.js +943 -0
  66. package/dist/bubbles/service-bubble/google-drive.js.map +1 -0
  67. package/dist/bubbles/service-bubble/google-sheets.d.ts +1811 -0
  68. package/dist/bubbles/service-bubble/google-sheets.d.ts.map +1 -0
  69. package/dist/bubbles/service-bubble/google-sheets.js +904 -0
  70. package/dist/bubbles/service-bubble/google-sheets.js.map +1 -0
  71. package/dist/bubbles/service-bubble/hello-world.d.ts +74 -0
  72. package/dist/bubbles/service-bubble/hello-world.d.ts.map +1 -0
  73. package/dist/bubbles/service-bubble/hello-world.js +67 -0
  74. package/dist/bubbles/service-bubble/hello-world.js.map +1 -0
  75. package/dist/bubbles/service-bubble/http.d.ts +134 -0
  76. package/dist/bubbles/service-bubble/http.d.ts.map +1 -0
  77. package/dist/bubbles/service-bubble/http.js +184 -0
  78. package/dist/bubbles/service-bubble/http.js.map +1 -0
  79. package/dist/bubbles/service-bubble/postgresql.d.ts +180 -0
  80. package/dist/bubbles/service-bubble/postgresql.d.ts.map +1 -0
  81. package/dist/bubbles/service-bubble/postgresql.js +448 -0
  82. package/dist/bubbles/service-bubble/postgresql.js.map +1 -0
  83. package/dist/bubbles/service-bubble/resend.d.ts +301 -0
  84. package/dist/bubbles/service-bubble/resend.d.ts.map +1 -0
  85. package/dist/bubbles/service-bubble/resend.js +253 -0
  86. package/dist/bubbles/service-bubble/resend.js.map +1 -0
  87. package/dist/bubbles/service-bubble/slack.d.ts +5869 -0
  88. package/dist/bubbles/service-bubble/slack.d.ts.map +1 -0
  89. package/dist/bubbles/service-bubble/slack.js +1536 -0
  90. package/dist/bubbles/service-bubble/slack.js.map +1 -0
  91. package/dist/bubbles/service-bubble/storage.d.ts +571 -0
  92. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -0
  93. package/dist/bubbles/service-bubble/storage.js +504 -0
  94. package/dist/bubbles/service-bubble/storage.js.map +1 -0
  95. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +308 -0
  96. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -0
  97. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +285 -0
  98. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -0
  99. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +416 -0
  100. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts.map +1 -0
  101. package/dist/bubbles/tool-bubble/chart-js-tool.js +570 -0
  102. package/dist/bubbles/tool-bubble/chart-js-tool.js.map +1 -0
  103. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +99 -0
  104. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -0
  105. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +645 -0
  106. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -0
  107. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +112 -0
  108. package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts.map +1 -0
  109. package/dist/bubbles/tool-bubble/list-bubbles-tool.js +82 -0
  110. package/dist/bubbles/tool-bubble/list-bubbles-tool.js.map +1 -0
  111. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +413 -0
  112. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -0
  113. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +327 -0
  114. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -0
  115. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +122 -0
  116. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -0
  117. package/dist/bubbles/tool-bubble/research-agent-tool.js +343 -0
  118. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -0
  119. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +131 -0
  120. package/dist/bubbles/tool-bubble/sql-query-tool.d.ts.map +1 -0
  121. package/dist/bubbles/tool-bubble/sql-query-tool.js +147 -0
  122. package/dist/bubbles/tool-bubble/sql-query-tool.js.map +1 -0
  123. package/dist/bubbles/tool-bubble/tool-template.d.ts +257 -0
  124. package/dist/bubbles/tool-bubble/tool-template.d.ts.map +1 -0
  125. package/dist/bubbles/tool-bubble/tool-template.js +238 -0
  126. package/dist/bubbles/tool-bubble/tool-template.js.map +1 -0
  127. package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts +8 -0
  128. package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts.map +1 -0
  129. package/dist/bubbles/tool-bubble/virtual-file-editor-example.js +65 -0
  130. package/dist/bubbles/tool-bubble/virtual-file-editor-example.js.map +1 -0
  131. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts +125 -0
  132. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts.map +1 -0
  133. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js +169 -0
  134. package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js.map +1 -0
  135. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +218 -0
  136. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -0
  137. package/dist/bubbles/tool-bubble/web-crawl-tool.js +255 -0
  138. package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -0
  139. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +134 -0
  140. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -0
  141. package/dist/bubbles/tool-bubble/web-extract-tool.js +175 -0
  142. package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -0
  143. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +228 -0
  144. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -0
  145. package/dist/bubbles/tool-bubble/web-scrape-tool.js +214 -0
  146. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -0
  147. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +134 -0
  148. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -0
  149. package/dist/bubbles/tool-bubble/web-search-tool.js +155 -0
  150. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -0
  151. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +114 -0
  152. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +1 -0
  153. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +777 -0
  154. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +1 -0
  155. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts +97 -0
  156. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts.map +1 -0
  157. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js +327 -0
  158. package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js.map +1 -0
  159. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +303 -0
  160. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts.map +1 -0
  161. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js +297 -0
  162. package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js.map +1 -0
  163. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts +157 -0
  164. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts.map +1 -0
  165. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js +310 -0
  166. package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js.map +1 -0
  167. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +543 -0
  168. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts.map +1 -0
  169. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +628 -0
  170. package/dist/bubbles/workflow-bubble/generate-document.workflow.js.map +1 -0
  171. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +679 -0
  172. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts.map +1 -0
  173. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +604 -0
  174. package/dist/bubbles/workflow-bubble/parse-document.workflow.js.map +1 -0
  175. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +1011 -0
  176. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -0
  177. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +841 -0
  178. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -0
  179. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +883 -0
  180. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -0
  181. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +781 -0
  182. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -0
  183. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +300 -0
  184. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -0
  185. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +508 -0
  186. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -0
  187. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +731 -0
  188. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -0
  189. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +690 -0
  190. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -0
  191. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +401 -0
  192. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -0
  193. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +382 -0
  194. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -0
  195. package/dist/bubbles/workflow-bubble/workflow-template.d.ts +144 -0
  196. package/dist/bubbles/workflow-bubble/workflow-template.d.ts.map +1 -0
  197. package/dist/bubbles/workflow-bubble/workflow-template.js +124 -0
  198. package/dist/bubbles/workflow-bubble/workflow-template.js.map +1 -0
  199. package/dist/index.d.ts +46 -0
  200. package/dist/index.d.ts.map +1 -0
  201. package/dist/index.js +53 -0
  202. package/dist/index.js.map +1 -0
  203. package/dist/logging/BubbleLogger.d.ts +146 -0
  204. package/dist/logging/BubbleLogger.d.ts.map +1 -0
  205. package/dist/logging/BubbleLogger.js +472 -0
  206. package/dist/logging/BubbleLogger.js.map +1 -0
  207. package/dist/logging/StreamingBubbleLogger.d.ts +85 -0
  208. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -0
  209. package/dist/logging/StreamingBubbleLogger.js +340 -0
  210. package/dist/logging/StreamingBubbleLogger.js.map +1 -0
  211. package/dist/types/ai-models.d.ts +4 -0
  212. package/dist/types/ai-models.d.ts.map +1 -0
  213. package/dist/types/ai-models.js +14 -0
  214. package/dist/types/ai-models.js.map +1 -0
  215. package/dist/types/available-tools.d.ts +4 -0
  216. package/dist/types/available-tools.d.ts.map +1 -0
  217. package/dist/types/available-tools.js +19 -0
  218. package/dist/types/available-tools.js.map +1 -0
  219. package/dist/types/base-bubble-class.d.ts +47 -0
  220. package/dist/types/base-bubble-class.d.ts.map +1 -0
  221. package/dist/types/base-bubble-class.js +212 -0
  222. package/dist/types/base-bubble-class.js.map +1 -0
  223. package/dist/types/bubble-errors.d.ts +44 -0
  224. package/dist/types/bubble-errors.d.ts.map +1 -0
  225. package/dist/types/bubble-errors.js +51 -0
  226. package/dist/types/bubble-errors.js.map +1 -0
  227. package/dist/types/bubble.d.ts +73 -0
  228. package/dist/types/bubble.d.ts.map +1 -0
  229. package/dist/types/bubble.js +2 -0
  230. package/dist/types/bubble.js.map +1 -0
  231. package/dist/types/credentials.d.ts +6 -0
  232. package/dist/types/credentials.d.ts.map +1 -0
  233. package/dist/types/credentials.js +6 -0
  234. package/dist/types/credentials.js.map +1 -0
  235. package/dist/types/service-bubble-class.d.ts +31 -0
  236. package/dist/types/service-bubble-class.d.ts.map +1 -0
  237. package/dist/types/service-bubble-class.js +36 -0
  238. package/dist/types/service-bubble-class.js.map +1 -0
  239. package/dist/types/streaming-events.d.ts +18 -0
  240. package/dist/types/streaming-events.d.ts.map +1 -0
  241. package/dist/types/streaming-events.js +5 -0
  242. package/dist/types/streaming-events.js.map +1 -0
  243. package/dist/types/tool-bubble-class.d.ts +19 -0
  244. package/dist/types/tool-bubble-class.d.ts.map +1 -0
  245. package/dist/types/tool-bubble-class.js +48 -0
  246. package/dist/types/tool-bubble-class.js.map +1 -0
  247. package/dist/types/workflow-bubble-class.d.ts +25 -0
  248. package/dist/types/workflow-bubble-class.d.ts.map +1 -0
  249. package/dist/types/workflow-bubble-class.js +30 -0
  250. package/dist/types/workflow-bubble-class.js.map +1 -0
  251. package/dist/utils/bubbleflow-parser.d.ts +32 -0
  252. package/dist/utils/bubbleflow-parser.d.ts.map +1 -0
  253. package/dist/utils/bubbleflow-parser.js +332 -0
  254. package/dist/utils/bubbleflow-parser.js.map +1 -0
  255. package/dist/utils/bubbleflow-validation.d.ts +9 -0
  256. package/dist/utils/bubbleflow-validation.d.ts.map +1 -0
  257. package/dist/utils/bubbleflow-validation.js +116 -0
  258. package/dist/utils/bubbleflow-validation.js.map +1 -0
  259. package/dist/utils/json-parsing.d.ts +20 -0
  260. package/dist/utils/json-parsing.d.ts.map +1 -0
  261. package/dist/utils/json-parsing.js +394 -0
  262. package/dist/utils/json-parsing.js.map +1 -0
  263. package/dist/utils/mock-data-generator.d.ts +43 -0
  264. package/dist/utils/mock-data-generator.d.ts.map +1 -0
  265. package/dist/utils/mock-data-generator.js +312 -0
  266. package/dist/utils/mock-data-generator.js.map +1 -0
  267. package/dist/utils/param-helper.d.ts +2 -0
  268. package/dist/utils/param-helper.d.ts.map +1 -0
  269. package/dist/utils/param-helper.js +5 -0
  270. package/dist/utils/param-helper.js.map +1 -0
  271. package/dist/utils/source-bubble-parser.d.ts +31 -0
  272. package/dist/utils/source-bubble-parser.d.ts.map +1 -0
  273. package/dist/utils/source-bubble-parser.js +231 -0
  274. package/dist/utils/source-bubble-parser.js.map +1 -0
  275. package/package.json +63 -0
@@ -0,0 +1,125 @@
1
+ /**
2
+ * VIRTUAL FILE EDITOR TOOL
3
+ *
4
+ * Provides line-based edits on a virtual file represented as an array of lines.
5
+ * This tool does not touch disk; it returns the updated array and a rendered view.
6
+ */
7
+ import { z } from 'zod';
8
+ import { ToolBubble } from '../../types/tool-bubble-class.js';
9
+ import type { BubbleContext } from '../../types/bubble.js';
10
+ import { CredentialType } from '@nodex/shared-schemas';
11
+ declare const VirtualFileEditorParamsSchema: z.ZodObject<{
12
+ edit: z.ZodObject<{
13
+ op: z.ZodEnum<["insert", "delete", "replace"]>;
14
+ startLine: z.ZodNumber;
15
+ endLine: z.ZodOptional<z.ZodNumber>;
16
+ text: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ op: "insert" | "delete" | "replace";
19
+ startLine: number;
20
+ endLine?: number | undefined;
21
+ text?: string | undefined;
22
+ }, {
23
+ op: "insert" | "delete" | "replace";
24
+ startLine: number;
25
+ endLine?: number | undefined;
26
+ text?: string | undefined;
27
+ }>;
28
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
29
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ edit: {
32
+ op: "insert" | "delete" | "replace";
33
+ startLine: number;
34
+ endLine?: number | undefined;
35
+ text?: string | undefined;
36
+ };
37
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
38
+ config?: Record<string, unknown> | undefined;
39
+ }, {
40
+ edit: {
41
+ op: "insert" | "delete" | "replace";
42
+ startLine: number;
43
+ endLine?: number | undefined;
44
+ text?: string | undefined;
45
+ };
46
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
47
+ config?: Record<string, unknown> | undefined;
48
+ }>;
49
+ declare const VirtualFileEditorResultSchema: z.ZodObject<{
50
+ updatedCodeLines: z.ZodArray<z.ZodString, "many">;
51
+ success: z.ZodBoolean;
52
+ error: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ updatedCodeLines: string[];
55
+ success: boolean;
56
+ error: string;
57
+ }, {
58
+ updatedCodeLines: string[];
59
+ success: boolean;
60
+ error: string;
61
+ }>;
62
+ type VFEParams = z.input<typeof VirtualFileEditorParamsSchema>;
63
+ type VFEResult = z.output<typeof VirtualFileEditorResultSchema>;
64
+ export declare class VirtualFileEditorTool extends ToolBubble<VFEParams, VFEResult> {
65
+ static readonly type: "tool";
66
+ static readonly bubbleName = "virtual-file-editor-tool";
67
+ static readonly schema: z.ZodObject<{
68
+ edit: z.ZodObject<{
69
+ op: z.ZodEnum<["insert", "delete", "replace"]>;
70
+ startLine: z.ZodNumber;
71
+ endLine: z.ZodOptional<z.ZodNumber>;
72
+ text: z.ZodOptional<z.ZodString>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ op: "insert" | "delete" | "replace";
75
+ startLine: number;
76
+ endLine?: number | undefined;
77
+ text?: string | undefined;
78
+ }, {
79
+ op: "insert" | "delete" | "replace";
80
+ startLine: number;
81
+ endLine?: number | undefined;
82
+ text?: string | undefined;
83
+ }>;
84
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
85
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ edit: {
88
+ op: "insert" | "delete" | "replace";
89
+ startLine: number;
90
+ endLine?: number | undefined;
91
+ text?: string | undefined;
92
+ };
93
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
94
+ config?: Record<string, unknown> | undefined;
95
+ }, {
96
+ edit: {
97
+ op: "insert" | "delete" | "replace";
98
+ startLine: number;
99
+ endLine?: number | undefined;
100
+ text?: string | undefined;
101
+ };
102
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
103
+ config?: Record<string, unknown> | undefined;
104
+ }>;
105
+ static readonly resultSchema: z.ZodObject<{
106
+ updatedCodeLines: z.ZodArray<z.ZodString, "many">;
107
+ success: z.ZodBoolean;
108
+ error: z.ZodString;
109
+ }, "strip", z.ZodTypeAny, {
110
+ updatedCodeLines: string[];
111
+ success: boolean;
112
+ error: string;
113
+ }, {
114
+ updatedCodeLines: string[];
115
+ success: boolean;
116
+ error: string;
117
+ }>;
118
+ static readonly shortDescription = "Edits a virtual file using a single insert/delete/replace operation per call.";
119
+ static readonly longDescription = "\n A utility tool for agentic coding loops. Applies a single edit to a virtual file and\n returns the updated file content and a rendered numbered view for the prompt.\n The current file content is maintained in the tool's internal state.\n Only one edit operation is allowed per call.\n\n OPERATION TYPES:\n \n 1. INSERT: Adds new lines BEFORE the specified startLine\n Example: { \"op\": \"insert\", \"startLine\": 5, \"text\": \"const x = 1;\" }\n - This adds the new line BEFORE line 5, pushing existing line 5 to line 6\n \n 2. DELETE: Removes lines from startLine to endLine (inclusive)\n Example: { \"op\": \"delete\", \"startLine\": 3, \"endLine\": 5 }\n - This removes lines 3, 4, and 5\n - For single line: { \"op\": \"delete\", \"startLine\": 3 } (endLine defaults to startLine)\n - DO NOT include 'text' parameter for delete operations\n \n 3. REPLACE: Replaces lines from startLine to endLine with new text\n Example: { \"op\": \"replace\", \"startLine\": 2, \"endLine\": 4, \"text\": \"new content\\nline 2\" }\n - This replaces lines 2, 3, and 4 with the new text\n - For single line: { \"op\": \"replace\", \"startLine\": 2, \"text\": \"new content\" }\n - For multi-line replacement, ALWAYS specify both startLine AND endLine\n \n CRITICAL RULES:\n - Line numbers are 1-based (first line is 1, not 0)\n - For multi-line operations, ALWAYS specify both startLine AND endLine\n - For delete operations, NEVER include the 'text' parameter\n - Use \\n in text to create multiple lines\n - Each call can only perform ONE operation\n ";
120
+ static readonly alias = "vfe";
121
+ constructor(params: VFEParams, context?: BubbleContext);
122
+ performAction(context?: BubbleContext): Promise<VFEResult>;
123
+ }
124
+ export {};
125
+ //# sourceMappingURL=virtual-file-editor.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-file-editor.tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/virtual-file-editor.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA+BvD,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AAEH,QAAA,MAAM,6BAA6B;;;;;;;;;;;;EAMjC,CAAC;AAEH,KAAK,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAC/D,KAAK,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAuDhE,qBAAa,qBAAsB,SAAQ,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;IACzE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAU;IACvC,MAAM,CAAC,QAAQ,CAAC,UAAU,8BAA8B;IACxD,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAiC;IACvD,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;OAAiC;IAC7D,MAAM,CAAC,QAAQ,CAAC,gBAAgB,mFACkD;IAClF,MAAM,CAAC,QAAQ,CAAC,eAAe,koDA8B7B;IACF,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS;gBAElB,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,aAAa;IAIhD,aAAa,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC;CAsDjE"}
@@ -0,0 +1,169 @@
1
+ /**
2
+ * VIRTUAL FILE EDITOR TOOL
3
+ *
4
+ * Provides line-based edits on a virtual file represented as an array of lines.
5
+ * This tool does not touch disk; it returns the updated array and a rendered view.
6
+ */
7
+ import { z } from 'zod';
8
+ import { ToolBubble } from '../../types/tool-bubble-class.js';
9
+ import { CredentialType } from '@nodex/shared-schemas';
10
+ const FileEditSchema = z.object({
11
+ op: z
12
+ .enum(['insert', 'delete', 'replace'])
13
+ .describe('Operation type: "insert" adds new lines BEFORE startLine, "delete" removes lines from startLine to endLine (inclusive), "replace" replaces lines from startLine to endLine with new text. For delete operations, do NOT include text parameter.'),
14
+ startLine: z
15
+ .number()
16
+ .int()
17
+ .min(1)
18
+ .describe('Line number (1-based). For insert: new lines added BEFORE this line. For delete/replace: first line to modify (inclusive)'),
19
+ endLine: z
20
+ .number()
21
+ .int()
22
+ .min(1)
23
+ .optional()
24
+ .describe('Last line to modify (inclusive). OPTIONAL - defaults to startLine for single-line delete/replace. Specify range for multi-line operations.'),
25
+ text: z
26
+ .string()
27
+ .optional()
28
+ .describe('Text content for insert or replace operations. Use \\n for multiple lines. DO NOT include this parameter for delete operations.'),
29
+ });
30
+ const VirtualFileEditorParamsSchema = z.object({
31
+ edit: FileEditSchema.describe('Single edit operation. Examples: Replace line 2: { "op": "replace", "startLine": 2, "text": "new content" }. Insert before line 1: { "op": "insert", "startLine": 1, "text": "new line" }. Delete line 5: { "op": "delete", "startLine": 5 }. Multi-line replace: { "op": "replace", "startLine": 2, "endLine": 4, "text": "new content" }. For delete operations, do NOT include text parameter.'),
32
+ credentials: z.record(z.nativeEnum(CredentialType), z.string()).optional(),
33
+ config: z.record(z.string(), z.unknown()).optional(),
34
+ });
35
+ const VirtualFileEditorResultSchema = z.object({
36
+ updatedCodeLines: z
37
+ .array(z.string())
38
+ .describe('Updated file content as array of lines'),
39
+ success: z.boolean(),
40
+ error: z.string(),
41
+ });
42
+ function splitLines(text) {
43
+ return text.replace(/\r\n?/g, '\n').split('\n');
44
+ }
45
+ function applyEdit(codeLines, edit) {
46
+ const lines = [...codeLines];
47
+ const startIdx = Math.max(1, edit.startLine) - 1;
48
+ // Default endLine to startLine for single-line operations if not provided
49
+ const endIdx = edit.endLine !== undefined
50
+ ? Math.max(1, edit.endLine) - 1
51
+ : edit.op === 'delete' || edit.op === 'replace'
52
+ ? startIdx // Default to single line for delete/replace
53
+ : undefined;
54
+ if (edit.op === 'insert') {
55
+ const insertLines = splitLines(edit.text ?? '');
56
+ const clampIdx = Math.min(Math.max(0, startIdx), lines.length);
57
+ lines.splice(clampIdx, 0, ...insertLines);
58
+ return lines;
59
+ }
60
+ // For delete/replace, endIdx should now always be defined (defaulted to startIdx)
61
+ if (endIdx === undefined) {
62
+ console.warn('[VirtualFileEditor] Invalid edit: endIdx is undefined for', edit.op);
63
+ return lines; // Safety fallback
64
+ }
65
+ const from = Math.min(Math.max(0, startIdx), lines.length - 1);
66
+ const to = Math.min(Math.max(from, endIdx), lines.length - 1);
67
+ const deleteCount = to - from + 1;
68
+ if (edit.op === 'delete') {
69
+ lines.splice(from, deleteCount);
70
+ return lines;
71
+ }
72
+ if (edit.op === 'replace') {
73
+ const replaceLines = splitLines(edit.text ?? '');
74
+ lines.splice(from, deleteCount, ...replaceLines);
75
+ return lines;
76
+ }
77
+ return lines;
78
+ }
79
+ export class VirtualFileEditorTool extends ToolBubble {
80
+ static type = 'tool';
81
+ static bubbleName = 'virtual-file-editor-tool';
82
+ static schema = VirtualFileEditorParamsSchema;
83
+ static resultSchema = VirtualFileEditorResultSchema;
84
+ static shortDescription = 'Edits a virtual file using a single insert/delete/replace operation per call.';
85
+ static longDescription = `
86
+ A utility tool for agentic coding loops. Applies a single edit to a virtual file and
87
+ returns the updated file content and a rendered numbered view for the prompt.
88
+ The current file content is maintained in the tool's internal state.
89
+ Only one edit operation is allowed per call.
90
+
91
+ OPERATION TYPES:
92
+
93
+ 1. INSERT: Adds new lines BEFORE the specified startLine
94
+ Example: { "op": "insert", "startLine": 5, "text": "const x = 1;" }
95
+ - This adds the new line BEFORE line 5, pushing existing line 5 to line 6
96
+
97
+ 2. DELETE: Removes lines from startLine to endLine (inclusive)
98
+ Example: { "op": "delete", "startLine": 3, "endLine": 5 }
99
+ - This removes lines 3, 4, and 5
100
+ - For single line: { "op": "delete", "startLine": 3 } (endLine defaults to startLine)
101
+ - DO NOT include 'text' parameter for delete operations
102
+
103
+ 3. REPLACE: Replaces lines from startLine to endLine with new text
104
+ Example: { "op": "replace", "startLine": 2, "endLine": 4, "text": "new content\\nline 2" }
105
+ - This replaces lines 2, 3, and 4 with the new text
106
+ - For single line: { "op": "replace", "startLine": 2, "text": "new content" }
107
+ - For multi-line replacement, ALWAYS specify both startLine AND endLine
108
+
109
+ CRITICAL RULES:
110
+ - Line numbers are 1-based (first line is 1, not 0)
111
+ - For multi-line operations, ALWAYS specify both startLine AND endLine
112
+ - For delete operations, NEVER include the 'text' parameter
113
+ - Use \\n in text to create multiple lines
114
+ - Each call can only perform ONE operation
115
+ `;
116
+ static alias = 'vfe';
117
+ constructor(params, context) {
118
+ super(params, context);
119
+ }
120
+ async performAction(context) {
121
+ void context; // Context available but not currently used
122
+ try {
123
+ // Get codeLines from config (injected at runtime)
124
+ const codeLines = this.params.config?.codeLines || [];
125
+ console.log('[VirtualFileEditorTool] PARAMS DEBUG:', {
126
+ 'this.params.edit': this.params.edit,
127
+ 'this.params.config': this.params.config
128
+ ? {
129
+ hasCodeLines: !!this.params.config.codeLines,
130
+ codeLinesLength: this.params.config.codeLines
131
+ ?.length,
132
+ isArray: Array.isArray(this.params.config.codeLines),
133
+ }
134
+ : 'NO CONFIG',
135
+ });
136
+ console.log('[VirtualFileEditorTool] INPUT:', {
137
+ operation: this.params.edit.op,
138
+ startLine: this.params.edit.startLine,
139
+ endLine: this.params.edit.endLine,
140
+ inputLines: codeLines.length,
141
+ });
142
+ // If no codeLines in config, initialize with empty array
143
+ if (codeLines.length === 0) {
144
+ console.log('[VirtualFileEditorTool] No existing codeLines in config, starting with empty file');
145
+ }
146
+ const updated = applyEdit(codeLines, this.params.edit);
147
+ console.log('[VirtualFileEditorTool] OUTPUT:', {
148
+ outputLines: updated.length,
149
+ changed: updated.length !== codeLines.length,
150
+ });
151
+ // Return the updated file - the workflow's afterToolCall will update the shared state
152
+ return {
153
+ updatedCodeLines: updated,
154
+ success: true,
155
+ error: '',
156
+ };
157
+ }
158
+ catch (e) {
159
+ // Fallback to empty file on error
160
+ const fallbackCodeLines = [];
161
+ return {
162
+ updatedCodeLines: fallbackCodeLines,
163
+ success: false,
164
+ error: e instanceof Error ? e.message : 'Unknown error',
165
+ };
166
+ }
167
+ }
168
+ }
169
+ //# sourceMappingURL=virtual-file-editor.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-file-editor.tool.js","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/virtual-file-editor.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,EAAE,EAAE,CAAC;SACF,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;SACrC,QAAQ,CACP,iPAAiP,CAClP;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,2HAA2H,CAC5H;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gBAAgB,EAAE,iBAAiB;gBACnC,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aACxD,CAAC;QACJ,CAAC;IACH,CAAC"}
@@ -0,0 +1,218 @@
1
+ import { z } from 'zod';
2
+ import { ToolBubble } from '../../types/tool-bubble-class.js';
3
+ import type { BubbleContext } from '../../types/bubble.js';
4
+ import { CredentialType, type BubbleName } from '@bubblelab/shared-schemas';
5
+ declare const WebCrawlToolParamsSchema: z.ZodObject<{
6
+ url: z.ZodString;
7
+ format: z.ZodDefault<z.ZodEnum<["markdown"]>>;
8
+ onlyMainContent: z.ZodDefault<z.ZodBoolean>;
9
+ maxPages: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
10
+ crawlDepth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
11
+ includePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
12
+ excludePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
13
+ waitFor: z.ZodDefault<z.ZodNumber>;
14
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ format: "markdown";
17
+ url: string;
18
+ onlyMainContent: boolean;
19
+ waitFor: number;
20
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
21
+ maxPages?: number | undefined;
22
+ crawlDepth?: number | undefined;
23
+ includePaths?: string[] | undefined;
24
+ excludePaths?: string[] | undefined;
25
+ }, {
26
+ url: string;
27
+ format?: "markdown" | undefined;
28
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
29
+ onlyMainContent?: boolean | undefined;
30
+ maxPages?: number | undefined;
31
+ crawlDepth?: number | undefined;
32
+ includePaths?: string[] | undefined;
33
+ excludePaths?: string[] | undefined;
34
+ waitFor?: number | undefined;
35
+ }>;
36
+ declare const WebCrawlToolResultSchema: z.ZodObject<{
37
+ url: z.ZodString;
38
+ success: z.ZodBoolean;
39
+ error: z.ZodString;
40
+ pages: z.ZodArray<z.ZodObject<{
41
+ url: z.ZodString;
42
+ title: z.ZodOptional<z.ZodString>;
43
+ content: z.ZodString;
44
+ depth: z.ZodOptional<z.ZodNumber>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ content: string;
47
+ url: string;
48
+ title?: string | undefined;
49
+ depth?: number | undefined;
50
+ }, {
51
+ content: string;
52
+ url: string;
53
+ title?: string | undefined;
54
+ depth?: number | undefined;
55
+ }>, "many">;
56
+ totalPages: z.ZodNumber;
57
+ metadata: z.ZodOptional<z.ZodObject<{
58
+ loadTime: z.ZodOptional<z.ZodNumber>;
59
+ crawlDepth: z.ZodOptional<z.ZodNumber>;
60
+ maxPagesReached: z.ZodOptional<z.ZodBoolean>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ crawlDepth?: number | undefined;
63
+ loadTime?: number | undefined;
64
+ maxPagesReached?: boolean | undefined;
65
+ }, {
66
+ crawlDepth?: number | undefined;
67
+ loadTime?: number | undefined;
68
+ maxPagesReached?: boolean | undefined;
69
+ }>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ success: boolean;
72
+ error: string;
73
+ url: string;
74
+ pages: {
75
+ content: string;
76
+ url: string;
77
+ title?: string | undefined;
78
+ depth?: number | undefined;
79
+ }[];
80
+ totalPages: number;
81
+ metadata?: {
82
+ crawlDepth?: number | undefined;
83
+ loadTime?: number | undefined;
84
+ maxPagesReached?: boolean | undefined;
85
+ } | undefined;
86
+ }, {
87
+ success: boolean;
88
+ error: string;
89
+ url: string;
90
+ pages: {
91
+ content: string;
92
+ url: string;
93
+ title?: string | undefined;
94
+ depth?: number | undefined;
95
+ }[];
96
+ totalPages: number;
97
+ metadata?: {
98
+ crawlDepth?: number | undefined;
99
+ loadTime?: number | undefined;
100
+ maxPagesReached?: boolean | undefined;
101
+ } | undefined;
102
+ }>;
103
+ type WebCrawlToolParams = z.input<typeof WebCrawlToolParamsSchema>;
104
+ type WebCrawlToolResult = z.output<typeof WebCrawlToolResultSchema>;
105
+ type WebCrawlToolParamsInput = z.input<typeof WebCrawlToolParamsSchema>;
106
+ export declare class WebCrawlTool extends ToolBubble<WebCrawlToolParams, WebCrawlToolResult> {
107
+ static readonly bubbleName: BubbleName;
108
+ static readonly schema: z.ZodObject<{
109
+ url: z.ZodString;
110
+ format: z.ZodDefault<z.ZodEnum<["markdown"]>>;
111
+ onlyMainContent: z.ZodDefault<z.ZodBoolean>;
112
+ maxPages: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
113
+ crawlDepth: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
114
+ includePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
115
+ excludePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
116
+ waitFor: z.ZodDefault<z.ZodNumber>;
117
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ format: "markdown";
120
+ url: string;
121
+ onlyMainContent: boolean;
122
+ waitFor: number;
123
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
124
+ maxPages?: number | undefined;
125
+ crawlDepth?: number | undefined;
126
+ includePaths?: string[] | undefined;
127
+ excludePaths?: string[] | undefined;
128
+ }, {
129
+ url: string;
130
+ format?: "markdown" | undefined;
131
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
132
+ onlyMainContent?: boolean | undefined;
133
+ maxPages?: number | undefined;
134
+ crawlDepth?: number | undefined;
135
+ includePaths?: string[] | undefined;
136
+ excludePaths?: string[] | undefined;
137
+ waitFor?: number | undefined;
138
+ }>;
139
+ static readonly resultSchema: z.ZodObject<{
140
+ url: z.ZodString;
141
+ success: z.ZodBoolean;
142
+ error: z.ZodString;
143
+ pages: z.ZodArray<z.ZodObject<{
144
+ url: z.ZodString;
145
+ title: z.ZodOptional<z.ZodString>;
146
+ content: z.ZodString;
147
+ depth: z.ZodOptional<z.ZodNumber>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ content: string;
150
+ url: string;
151
+ title?: string | undefined;
152
+ depth?: number | undefined;
153
+ }, {
154
+ content: string;
155
+ url: string;
156
+ title?: string | undefined;
157
+ depth?: number | undefined;
158
+ }>, "many">;
159
+ totalPages: z.ZodNumber;
160
+ metadata: z.ZodOptional<z.ZodObject<{
161
+ loadTime: z.ZodOptional<z.ZodNumber>;
162
+ crawlDepth: z.ZodOptional<z.ZodNumber>;
163
+ maxPagesReached: z.ZodOptional<z.ZodBoolean>;
164
+ }, "strip", z.ZodTypeAny, {
165
+ crawlDepth?: number | undefined;
166
+ loadTime?: number | undefined;
167
+ maxPagesReached?: boolean | undefined;
168
+ }, {
169
+ crawlDepth?: number | undefined;
170
+ loadTime?: number | undefined;
171
+ maxPagesReached?: boolean | undefined;
172
+ }>>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ success: boolean;
175
+ error: string;
176
+ url: string;
177
+ pages: {
178
+ content: string;
179
+ url: string;
180
+ title?: string | undefined;
181
+ depth?: number | undefined;
182
+ }[];
183
+ totalPages: number;
184
+ metadata?: {
185
+ crawlDepth?: number | undefined;
186
+ loadTime?: number | undefined;
187
+ maxPagesReached?: boolean | undefined;
188
+ } | undefined;
189
+ }, {
190
+ success: boolean;
191
+ error: string;
192
+ url: string;
193
+ pages: {
194
+ content: string;
195
+ url: string;
196
+ title?: string | undefined;
197
+ depth?: number | undefined;
198
+ }[];
199
+ totalPages: number;
200
+ metadata?: {
201
+ crawlDepth?: number | undefined;
202
+ loadTime?: number | undefined;
203
+ maxPagesReached?: boolean | undefined;
204
+ } | undefined;
205
+ }>;
206
+ static readonly shortDescription = "Multi-page web crawling tool for exploring entire websites and subdomains.";
207
+ static readonly longDescription = "\n A powerful web crawling tool that can systematically explore websites and extract content from multiple pages.\n \n \uD83D\uDD77\uFE0F CRAWL Features:\n - Recursively crawl websites and subdomains\n - Configurable crawl depth and page limits (up to 100 pages)\n - URL pattern filtering (include/exclude paths)\n - Multiple format support (markdown, html, links, rawHtml)\n - Main content focus filtering\n - Discover and extract content from entire sites\n \n Technical Features:\n - Handles JavaScript-rendered pages and dynamic content\n - Robust error handling and retry mechanisms\n - Configurable wait times for dynamic content\n - Requires FIRECRAWL_API_KEY credential\n \n Use Cases:\n - Site mapping and competitive analysis\n - Documentation aggregation across multiple pages \n - Content analysis and research across domains\n - SEO analysis and site structure discovery\n - Building comprehensive datasets from websites\n ";
208
+ static readonly alias = "crawl";
209
+ static readonly type = "tool";
210
+ constructor(params?: WebCrawlToolParamsInput, context?: BubbleContext);
211
+ performAction(context?: BubbleContext): Promise<WebCrawlToolResult>;
212
+ /**
213
+ * Execute crawl operation - multi-page site exploration
214
+ */
215
+ private executeCrawl;
216
+ }
217
+ export {};
218
+ //# sourceMappingURL=web-crawl-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-crawl-tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/web-crawl-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5E,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqD5B,CAAC;AAGH,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B5B,CAAC;AAGH,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACnE,KAAK,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wBAAwB,CAAC,C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