@bubblelab/bubble-core 0.1.8 → 0.1.10

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 (224) hide show
  1. package/dist/bubble-bundle.d.ts +333 -1438
  2. package/dist/bubble-factory.d.ts.map +1 -1
  3. package/dist/bubble-factory.js +64 -28
  4. package/dist/bubble-factory.js.map +1 -1
  5. package/dist/bubble-flow/bubble-flow-class.d.ts +17 -1
  6. package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
  7. package/dist/bubble-flow/bubble-flow-class.js +16 -0
  8. package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
  9. package/dist/bubble-flow/sample/data-analyst-flow.d.ts +1 -1
  10. package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -1
  11. package/dist/bubble-flow/sample/error-ts.d.ts +1 -1
  12. package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -1
  13. package/dist/bubble-flow/sample/sanitytest.d.ts +1 -1
  14. package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -1
  15. package/dist/bubble-flow/sample/simple-webhook-2.d.ts +1 -1
  16. package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -1
  17. package/dist/bubble-flow/sample/simple-webhook.d.ts +1 -1
  18. package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -1
  19. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +1 -1
  20. package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
  21. package/dist/bubble-flow/sample/slack-v0.1.d.ts +1 -1
  22. package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -1
  23. package/dist/bubble-flow/sample/slackagenttest.d.ts +1 -1
  24. package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -1
  25. package/dist/bubbles/service-bubble/ai-agent.d.ts +115 -97
  26. package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
  27. package/dist/bubbles/service-bubble/ai-agent.js +276 -96
  28. package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
  29. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +805 -0
  30. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts.map +1 -0
  31. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.js +131 -0
  32. package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.js.map +1 -0
  33. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +485 -0
  34. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts.map +1 -0
  35. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.js +176 -0
  36. package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.js.map +1 -0
  37. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +302 -0
  38. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts.map +1 -0
  39. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.js +138 -0
  40. package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.js.map +1 -0
  41. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +642 -0
  42. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts.map +1 -0
  43. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.js +123 -0
  44. package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.js.map +1 -0
  45. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +184 -0
  46. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts.map +1 -0
  47. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js +145 -0
  48. package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js.map +1 -0
  49. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts +52 -0
  50. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts.map +1 -0
  51. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js +29 -0
  52. package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js.map +1 -0
  53. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1999 -0
  54. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -0
  55. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +54 -0
  56. package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -0
  57. package/dist/bubbles/service-bubble/apify/apify.d.ts +143 -0
  58. package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -0
  59. package/dist/bubbles/service-bubble/apify/apify.js +276 -0
  60. package/dist/bubbles/service-bubble/apify/apify.js.map +1 -0
  61. package/dist/bubbles/service-bubble/apify/index.d.ts +6 -0
  62. package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -0
  63. package/dist/bubbles/service-bubble/apify/index.js +6 -0
  64. package/dist/bubbles/service-bubble/apify/index.js.map +1 -0
  65. package/dist/bubbles/service-bubble/apify/types.d.ts +7 -0
  66. package/dist/bubbles/service-bubble/apify/types.d.ts.map +1 -0
  67. package/dist/bubbles/service-bubble/apify/types.js +5 -0
  68. package/dist/bubbles/service-bubble/apify/types.js.map +1 -0
  69. package/dist/bubbles/service-bubble/gmail.d.ts +626 -132
  70. package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -1
  71. package/dist/bubbles/service-bubble/gmail.js +435 -7
  72. package/dist/bubbles/service-bubble/gmail.js.map +1 -1
  73. package/dist/bubbles/service-bubble/google-calendar.d.ts +36 -36
  74. package/dist/bubbles/service-bubble/google-drive.d.ts +233 -4
  75. package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
  76. package/dist/bubbles/service-bubble/google-drive.js +65 -75
  77. package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
  78. package/dist/bubbles/service-bubble/google-sheets.d.ts +52 -52
  79. package/dist/bubbles/service-bubble/hello-world.js +2 -2
  80. package/dist/bubbles/service-bubble/hello-world.js.map +1 -1
  81. package/dist/bubbles/service-bubble/http.d.ts +6 -6
  82. package/dist/bubbles/service-bubble/postgresql.d.ts +4 -4
  83. package/dist/bubbles/service-bubble/resend.d.ts +5 -5
  84. package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
  85. package/dist/bubbles/service-bubble/resend.js +16 -5
  86. package/dist/bubbles/service-bubble/resend.js.map +1 -1
  87. package/dist/bubbles/service-bubble/slack.d.ts +18 -18
  88. package/dist/bubbles/service-bubble/storage.d.ts +4 -4
  89. package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
  90. package/dist/bubbles/service-bubble/storage.js +16 -5
  91. package/dist/bubbles/service-bubble/storage.js.map +1 -1
  92. package/dist/bubbles/service-bubble/x-twitter.d.ts +814 -0
  93. package/dist/bubbles/service-bubble/x-twitter.d.ts.map +1 -0
  94. package/dist/bubbles/service-bubble/x-twitter.js +445 -0
  95. package/dist/bubbles/service-bubble/x-twitter.js.map +1 -0
  96. package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +20 -20
  97. package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +16 -16
  98. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +14 -1
  99. package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
  100. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +101 -47
  101. package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
  102. package/dist/bubbles/tool-bubble/instagram-tool.d.ts +435 -0
  103. package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -0
  104. package/dist/bubbles/tool-bubble/instagram-tool.js +474 -0
  105. package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -0
  106. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +2136 -0
  107. package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -0
  108. package/dist/bubbles/tool-bubble/linkedin-tool.js +608 -0
  109. package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -0
  110. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +69 -64
  111. package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -1
  112. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +97 -22
  113. package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -1
  114. package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +6 -6
  115. package/dist/bubbles/tool-bubble/research-agent-tool.js +5 -5
  116. package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
  117. package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
  118. package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +14 -14
  119. package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +4 -4
  120. package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +28 -28
  121. package/dist/bubbles/tool-bubble/web-scrape-tool.js +1 -1
  122. package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
  123. package/dist/bubbles/tool-bubble/web-search-tool.d.ts +5 -4
  124. package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
  125. package/dist/bubbles/tool-bubble/web-search-tool.js +6 -2
  126. package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
  127. package/dist/bubbles/tool-bubble/youtube-tool.d.ts +394 -0
  128. package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -0
  129. package/dist/bubbles/tool-bubble/youtube-tool.js +352 -0
  130. package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -0
  131. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +47 -36
  132. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +1 -1
  133. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +96 -65
  134. package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +1 -1
  135. package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +38 -38
  136. package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
  137. package/dist/bubbles/workflow-bubble/generate-document.workflow.js.map +1 -1
  138. package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +42 -42
  139. package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
  140. package/dist/bubbles/workflow-bubble/parse-document.workflow.js.map +1 -1
  141. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +22 -22
  142. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
  143. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +1 -4
  144. package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
  145. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +60 -60
  146. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -1
  147. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +2 -2
  148. package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
  149. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +20 -20
  150. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +1 -1
  151. package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
  152. package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +66 -66
  153. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +1 -1
  154. package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
  155. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +18 -18
  156. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
  157. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +1 -2
  158. package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
  159. package/dist/bubbles.json +489 -0
  160. package/dist/index.d.ts +16 -3
  161. package/dist/index.d.ts.map +1 -1
  162. package/dist/index.js +8 -1
  163. package/dist/index.js.map +1 -1
  164. package/dist/logging/BubbleLogger.d.ts +11 -0
  165. package/dist/logging/BubbleLogger.d.ts.map +1 -1
  166. package/dist/logging/BubbleLogger.js +87 -33
  167. package/dist/logging/BubbleLogger.js.map +1 -1
  168. package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
  169. package/dist/logging/StreamingBubbleLogger.js +23 -16
  170. package/dist/logging/StreamingBubbleLogger.js.map +1 -1
  171. package/dist/test-gm.d.ts +10 -0
  172. package/dist/test-gm.d.ts.map +1 -0
  173. package/dist/test-gm.js +95 -0
  174. package/dist/test-gm.js.map +1 -0
  175. package/dist/types/available-tools.d.ts +1 -1
  176. package/dist/types/available-tools.d.ts.map +1 -1
  177. package/dist/types/available-tools.js +2 -0
  178. package/dist/types/available-tools.js.map +1 -1
  179. package/dist/types/base-bubble-class.d.ts +6 -1
  180. package/dist/types/base-bubble-class.d.ts.map +1 -1
  181. package/dist/types/base-bubble-class.js +47 -24
  182. package/dist/types/base-bubble-class.js.map +1 -1
  183. package/dist/types/bubble.d.ts +3 -13
  184. package/dist/types/bubble.d.ts.map +1 -1
  185. package/dist/types/bubble.js +1 -1
  186. package/dist/types/bubble.js.map +1 -1
  187. package/dist/types/service-bubble-class.d.ts +5 -5
  188. package/dist/types/service-bubble-class.d.ts.map +1 -1
  189. package/dist/types/service-bubble-class.js +6 -7
  190. package/dist/types/service-bubble-class.js.map +1 -1
  191. package/dist/types/tool-bubble-class.d.ts +1 -1
  192. package/dist/types/tool-bubble-class.d.ts.map +1 -1
  193. package/dist/types/tool-bubble-class.js +9 -3
  194. package/dist/types/tool-bubble-class.js.map +1 -1
  195. package/dist/types/workflow-bubble-class.d.ts +1 -1
  196. package/dist/types/workflow-bubble-class.d.ts.map +1 -1
  197. package/dist/utils/agent-formatter.d.ts +17 -0
  198. package/dist/utils/agent-formatter.d.ts.map +1 -0
  199. package/dist/utils/agent-formatter.js +139 -0
  200. package/dist/utils/agent-formatter.js.map +1 -0
  201. package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
  202. package/dist/utils/bubbleflow-validation.js +89 -32
  203. package/dist/utils/bubbleflow-validation.js.map +1 -1
  204. package/dist/utils/error-sanitizer.d.ts +12 -0
  205. package/dist/utils/error-sanitizer.d.ts.map +1 -0
  206. package/dist/utils/error-sanitizer.js +77 -0
  207. package/dist/utils/error-sanitizer.js.map +1 -0
  208. package/dist/utils/json-parsing.d.ts +1 -0
  209. package/dist/utils/json-parsing.d.ts.map +1 -1
  210. package/dist/utils/json-parsing.js +205 -32
  211. package/dist/utils/json-parsing.js.map +1 -1
  212. package/package.json +6 -5
  213. package/dist/bubble-trigger/index.d.ts +0 -2
  214. package/dist/bubble-trigger/index.d.ts.map +0 -1
  215. package/dist/bubble-trigger/index.js +0 -2
  216. package/dist/bubble-trigger/index.js.map +0 -1
  217. package/dist/bubble-trigger/types.d.ts +0 -87
  218. package/dist/bubble-trigger/types.d.ts.map +0 -1
  219. package/dist/bubble-trigger/types.js +0 -14
  220. package/dist/bubble-trigger/types.js.map +0 -1
  221. package/dist/types/ai-models.d.ts +0 -4
  222. package/dist/types/ai-models.d.ts.map +0 -1
  223. package/dist/types/ai-models.js +0 -16
  224. package/dist/types/ai-models.js.map +0 -1
@@ -0,0 +1,435 @@
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 InstagramPostSchema: z.ZodObject<{
6
+ url: z.ZodNullable<z.ZodString>;
7
+ caption: z.ZodNullable<z.ZodString>;
8
+ likesCount: z.ZodNullable<z.ZodNumber>;
9
+ commentsCount: z.ZodNullable<z.ZodNumber>;
10
+ ownerUsername: z.ZodNullable<z.ZodString>;
11
+ timestamp: z.ZodNullable<z.ZodString>;
12
+ type: z.ZodNullable<z.ZodEnum<["image", "video", "carousel"]>>;
13
+ displayUrl: z.ZodNullable<z.ZodString>;
14
+ hashtags: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: "image" | "video" | "carousel" | null;
17
+ url: string | null;
18
+ timestamp: string | null;
19
+ caption: string | null;
20
+ hashtags: string[] | null;
21
+ commentsCount: number | null;
22
+ displayUrl: string | null;
23
+ likesCount: number | null;
24
+ ownerUsername: string | null;
25
+ }, {
26
+ type: "image" | "video" | "carousel" | null;
27
+ url: string | null;
28
+ timestamp: string | null;
29
+ caption: string | null;
30
+ hashtags: string[] | null;
31
+ commentsCount: number | null;
32
+ displayUrl: string | null;
33
+ likesCount: number | null;
34
+ ownerUsername: string | null;
35
+ }>;
36
+ declare const InstagramProfileSchema: z.ZodObject<{
37
+ username: z.ZodString;
38
+ fullName: z.ZodNullable<z.ZodString>;
39
+ bio: z.ZodNullable<z.ZodString>;
40
+ followersCount: z.ZodNullable<z.ZodNumber>;
41
+ followingCount: z.ZodNullable<z.ZodNumber>;
42
+ postsCount: z.ZodNullable<z.ZodNumber>;
43
+ isVerified: z.ZodNullable<z.ZodBoolean>;
44
+ profilePicUrl: z.ZodNullable<z.ZodString>;
45
+ }, "strip", z.ZodTypeAny, {
46
+ username: string;
47
+ fullName: string | null;
48
+ followersCount: number | null;
49
+ postsCount: number | null;
50
+ profilePicUrl: string | null;
51
+ bio: string | null;
52
+ followingCount: number | null;
53
+ isVerified: boolean | null;
54
+ }, {
55
+ username: string;
56
+ fullName: string | null;
57
+ followersCount: number | null;
58
+ postsCount: number | null;
59
+ profilePicUrl: string | null;
60
+ bio: string | null;
61
+ followingCount: number | null;
62
+ isVerified: boolean | null;
63
+ }>;
64
+ declare const InstagramToolParamsSchema: z.ZodObject<{
65
+ operation: z.ZodEnum<["scrapeProfile", "scrapeHashtag"]>;
66
+ profiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
67
+ hashtags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
69
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ operation: "scrapeProfile" | "scrapeHashtag";
72
+ limit?: number | undefined;
73
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
74
+ hashtags?: string[] | undefined;
75
+ profiles?: string[] | undefined;
76
+ }, {
77
+ operation: "scrapeProfile" | "scrapeHashtag";
78
+ limit?: number | undefined;
79
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
80
+ hashtags?: string[] | undefined;
81
+ profiles?: string[] | undefined;
82
+ }>;
83
+ declare const InstagramToolResultSchema: z.ZodObject<{
84
+ operation: z.ZodEnum<["scrapeProfile", "scrapeHashtag"]>;
85
+ posts: z.ZodArray<z.ZodObject<{
86
+ url: z.ZodNullable<z.ZodString>;
87
+ caption: z.ZodNullable<z.ZodString>;
88
+ likesCount: z.ZodNullable<z.ZodNumber>;
89
+ commentsCount: z.ZodNullable<z.ZodNumber>;
90
+ ownerUsername: z.ZodNullable<z.ZodString>;
91
+ timestamp: z.ZodNullable<z.ZodString>;
92
+ type: z.ZodNullable<z.ZodEnum<["image", "video", "carousel"]>>;
93
+ displayUrl: z.ZodNullable<z.ZodString>;
94
+ hashtags: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ type: "image" | "video" | "carousel" | null;
97
+ url: string | null;
98
+ timestamp: string | null;
99
+ caption: string | null;
100
+ hashtags: string[] | null;
101
+ commentsCount: number | null;
102
+ displayUrl: string | null;
103
+ likesCount: number | null;
104
+ ownerUsername: string | null;
105
+ }, {
106
+ type: "image" | "video" | "carousel" | null;
107
+ url: string | null;
108
+ timestamp: string | null;
109
+ caption: string | null;
110
+ hashtags: string[] | null;
111
+ commentsCount: number | null;
112
+ displayUrl: string | null;
113
+ likesCount: number | null;
114
+ ownerUsername: string | null;
115
+ }>, "many">;
116
+ profiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
117
+ username: z.ZodString;
118
+ fullName: z.ZodNullable<z.ZodString>;
119
+ bio: z.ZodNullable<z.ZodString>;
120
+ followersCount: z.ZodNullable<z.ZodNumber>;
121
+ followingCount: z.ZodNullable<z.ZodNumber>;
122
+ postsCount: z.ZodNullable<z.ZodNumber>;
123
+ isVerified: z.ZodNullable<z.ZodBoolean>;
124
+ profilePicUrl: z.ZodNullable<z.ZodString>;
125
+ }, "strip", z.ZodTypeAny, {
126
+ username: string;
127
+ fullName: string | null;
128
+ followersCount: number | null;
129
+ postsCount: number | null;
130
+ profilePicUrl: string | null;
131
+ bio: string | null;
132
+ followingCount: number | null;
133
+ isVerified: boolean | null;
134
+ }, {
135
+ username: string;
136
+ fullName: string | null;
137
+ followersCount: number | null;
138
+ postsCount: number | null;
139
+ profilePicUrl: string | null;
140
+ bio: string | null;
141
+ followingCount: number | null;
142
+ isVerified: boolean | null;
143
+ }>, "many">>;
144
+ scrapedHashtags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
145
+ scrapedProfiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
+ totalPosts: z.ZodNumber;
147
+ success: z.ZodBoolean;
148
+ error: z.ZodString;
149
+ }, "strip", z.ZodTypeAny, {
150
+ posts: {
151
+ type: "image" | "video" | "carousel" | null;
152
+ url: string | null;
153
+ timestamp: string | null;
154
+ caption: string | null;
155
+ hashtags: string[] | null;
156
+ commentsCount: number | null;
157
+ displayUrl: string | null;
158
+ likesCount: number | null;
159
+ ownerUsername: string | null;
160
+ }[];
161
+ success: boolean;
162
+ error: string;
163
+ operation: "scrapeProfile" | "scrapeHashtag";
164
+ totalPosts: number;
165
+ profiles?: {
166
+ username: string;
167
+ fullName: string | null;
168
+ followersCount: number | null;
169
+ postsCount: number | null;
170
+ profilePicUrl: string | null;
171
+ bio: string | null;
172
+ followingCount: number | null;
173
+ isVerified: boolean | null;
174
+ }[] | undefined;
175
+ scrapedHashtags?: string[] | undefined;
176
+ scrapedProfiles?: string[] | undefined;
177
+ }, {
178
+ posts: {
179
+ type: "image" | "video" | "carousel" | null;
180
+ url: string | null;
181
+ timestamp: string | null;
182
+ caption: string | null;
183
+ hashtags: string[] | null;
184
+ commentsCount: number | null;
185
+ displayUrl: string | null;
186
+ likesCount: number | null;
187
+ ownerUsername: string | null;
188
+ }[];
189
+ success: boolean;
190
+ error: string;
191
+ operation: "scrapeProfile" | "scrapeHashtag";
192
+ totalPosts: number;
193
+ profiles?: {
194
+ username: string;
195
+ fullName: string | null;
196
+ followersCount: number | null;
197
+ postsCount: number | null;
198
+ profilePicUrl: string | null;
199
+ bio: string | null;
200
+ followingCount: number | null;
201
+ isVerified: boolean | null;
202
+ }[] | undefined;
203
+ scrapedHashtags?: string[] | undefined;
204
+ scrapedProfiles?: string[] | undefined;
205
+ }>;
206
+ type InstagramToolParams = z.output<typeof InstagramToolParamsSchema>;
207
+ type InstagramToolResult = z.output<typeof InstagramToolResultSchema>;
208
+ type InstagramToolParamsInput = z.input<typeof InstagramToolParamsSchema>;
209
+ export type InstagramPost = z.output<typeof InstagramPostSchema>;
210
+ export type InstagramProfile = z.output<typeof InstagramProfileSchema>;
211
+ export type InstagramOperationResult<T extends InstagramToolParams['operation']> = Extract<InstagramToolResult, {
212
+ operation: T;
213
+ }>;
214
+ /**
215
+ * Generic Instagram scraping tool with unified interface
216
+ *
217
+ * This tool abstracts away the underlying scraping service (currently Apify)
218
+ * and provides a simple, opinionated interface for Instagram data extraction.
219
+ *
220
+ * Supports two operations:
221
+ * - scrapeProfile: Scrape user profiles and their posts
222
+ * - scrapeHashtag: Scrape posts by hashtag
223
+ *
224
+ * Future versions can add support for other services (BrightData, custom scrapers)
225
+ * while maintaining the same interface.
226
+ */
227
+ export declare class InstagramTool extends ToolBubble<InstagramToolParams, InstagramToolResult> {
228
+ static readonly bubbleName: BubbleName;
229
+ static readonly schema: z.ZodObject<{
230
+ operation: z.ZodEnum<["scrapeProfile", "scrapeHashtag"]>;
231
+ profiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
232
+ hashtags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
233
+ limit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
234
+ credentials: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<typeof CredentialType>, z.ZodString>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ operation: "scrapeProfile" | "scrapeHashtag";
237
+ limit?: number | undefined;
238
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
239
+ hashtags?: string[] | undefined;
240
+ profiles?: string[] | undefined;
241
+ }, {
242
+ operation: "scrapeProfile" | "scrapeHashtag";
243
+ limit?: number | undefined;
244
+ credentials?: Partial<Record<CredentialType, string>> | undefined;
245
+ hashtags?: string[] | undefined;
246
+ profiles?: string[] | undefined;
247
+ }>;
248
+ static readonly resultSchema: z.ZodObject<{
249
+ operation: z.ZodEnum<["scrapeProfile", "scrapeHashtag"]>;
250
+ posts: z.ZodArray<z.ZodObject<{
251
+ url: z.ZodNullable<z.ZodString>;
252
+ caption: z.ZodNullable<z.ZodString>;
253
+ likesCount: z.ZodNullable<z.ZodNumber>;
254
+ commentsCount: z.ZodNullable<z.ZodNumber>;
255
+ ownerUsername: z.ZodNullable<z.ZodString>;
256
+ timestamp: z.ZodNullable<z.ZodString>;
257
+ type: z.ZodNullable<z.ZodEnum<["image", "video", "carousel"]>>;
258
+ displayUrl: z.ZodNullable<z.ZodString>;
259
+ hashtags: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
260
+ }, "strip", z.ZodTypeAny, {
261
+ type: "image" | "video" | "carousel" | null;
262
+ url: string | null;
263
+ timestamp: string | null;
264
+ caption: string | null;
265
+ hashtags: string[] | null;
266
+ commentsCount: number | null;
267
+ displayUrl: string | null;
268
+ likesCount: number | null;
269
+ ownerUsername: string | null;
270
+ }, {
271
+ type: "image" | "video" | "carousel" | null;
272
+ url: string | null;
273
+ timestamp: string | null;
274
+ caption: string | null;
275
+ hashtags: string[] | null;
276
+ commentsCount: number | null;
277
+ displayUrl: string | null;
278
+ likesCount: number | null;
279
+ ownerUsername: string | null;
280
+ }>, "many">;
281
+ profiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
282
+ username: z.ZodString;
283
+ fullName: z.ZodNullable<z.ZodString>;
284
+ bio: z.ZodNullable<z.ZodString>;
285
+ followersCount: z.ZodNullable<z.ZodNumber>;
286
+ followingCount: z.ZodNullable<z.ZodNumber>;
287
+ postsCount: z.ZodNullable<z.ZodNumber>;
288
+ isVerified: z.ZodNullable<z.ZodBoolean>;
289
+ profilePicUrl: z.ZodNullable<z.ZodString>;
290
+ }, "strip", z.ZodTypeAny, {
291
+ username: string;
292
+ fullName: string | null;
293
+ followersCount: number | null;
294
+ postsCount: number | null;
295
+ profilePicUrl: string | null;
296
+ bio: string | null;
297
+ followingCount: number | null;
298
+ isVerified: boolean | null;
299
+ }, {
300
+ username: string;
301
+ fullName: string | null;
302
+ followersCount: number | null;
303
+ postsCount: number | null;
304
+ profilePicUrl: string | null;
305
+ bio: string | null;
306
+ followingCount: number | null;
307
+ isVerified: boolean | null;
308
+ }>, "many">>;
309
+ scrapedHashtags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
310
+ scrapedProfiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
311
+ totalPosts: z.ZodNumber;
312
+ success: z.ZodBoolean;
313
+ error: z.ZodString;
314
+ }, "strip", z.ZodTypeAny, {
315
+ posts: {
316
+ type: "image" | "video" | "carousel" | null;
317
+ url: string | null;
318
+ timestamp: string | null;
319
+ caption: string | null;
320
+ hashtags: string[] | null;
321
+ commentsCount: number | null;
322
+ displayUrl: string | null;
323
+ likesCount: number | null;
324
+ ownerUsername: string | null;
325
+ }[];
326
+ success: boolean;
327
+ error: string;
328
+ operation: "scrapeProfile" | "scrapeHashtag";
329
+ totalPosts: number;
330
+ profiles?: {
331
+ username: string;
332
+ fullName: string | null;
333
+ followersCount: number | null;
334
+ postsCount: number | null;
335
+ profilePicUrl: string | null;
336
+ bio: string | null;
337
+ followingCount: number | null;
338
+ isVerified: boolean | null;
339
+ }[] | undefined;
340
+ scrapedHashtags?: string[] | undefined;
341
+ scrapedProfiles?: string[] | undefined;
342
+ }, {
343
+ posts: {
344
+ type: "image" | "video" | "carousel" | null;
345
+ url: string | null;
346
+ timestamp: string | null;
347
+ caption: string | null;
348
+ hashtags: string[] | null;
349
+ commentsCount: number | null;
350
+ displayUrl: string | null;
351
+ likesCount: number | null;
352
+ ownerUsername: string | null;
353
+ }[];
354
+ success: boolean;
355
+ error: string;
356
+ operation: "scrapeProfile" | "scrapeHashtag";
357
+ totalPosts: number;
358
+ profiles?: {
359
+ username: string;
360
+ fullName: string | null;
361
+ followersCount: number | null;
362
+ postsCount: number | null;
363
+ profilePicUrl: string | null;
364
+ bio: string | null;
365
+ followingCount: number | null;
366
+ isVerified: boolean | null;
367
+ }[] | undefined;
368
+ scrapedHashtags?: string[] | undefined;
369
+ scrapedProfiles?: string[] | undefined;
370
+ }>;
371
+ static readonly shortDescription = "Scrape Instagram profiles and posts with a simple, unified interface. Works with individual user profiles and hashtags.";
372
+ static readonly longDescription = "\n Universal Instagram scraping tool that provides a simple, opinionated interface for extracting Instagram data.\n \n **OPERATIONS:**\n 1. **scrapeProfile**: Scrape user profiles and their posts\n - Get profile information (bio, followers, verified status)\n - Fetch recent posts from specific users\n - Track influencer or brand accounts\n \n 2. **scrapeHashtag**: Scrape posts by hashtag\n - Find trending content by hashtag\n - Monitor brand mentions and campaigns\n - Research hashtag performance\n \n **WHEN TO USE THIS TOOL:**\n - **Any Instagram scraping task** - profiles, posts, hashtags, engagement data\n - **Social media research** - influencer analysis, competitor monitoring\n - **Content gathering** - posts, captions, hashtags, engagement metrics\n - **Market research** - brand mentions, user sentiment on Instagram\n - **Trend analysis** - hashtag tracking, viral content discovery\n \n **DO NOT USE research-agent-tool or web-scrape-tool for Instagram** - This tool is specifically optimized for Instagram and provides:\n - Unified data format across all Instagram sources\n - Automatic service selection and optimization\n - Rate limiting and reliability handling\n - Clean, structured data ready for analysis\n \n **Simple Interface:**\n Just specify the operation and provide Instagram usernames/URLs or hashtags to get back clean, structured data.\n The tool automatically handles:\n - URL normalization (accepts usernames, profile URLs, hashtag URLs)\n - Service selection (currently Apify, future: multiple sources)\n - Data transformation to unified format\n - Error handling and retries\n \n **What you get:**\n - Posts with captions, likes, comments, timestamps\n - Profile information (for scrapeProfile operation)\n - Hashtags and engagement metrics\n - Owner information\n \n **Use cases:**\n - Influencer analysis and discovery\n - Brand monitoring and sentiment analysis\n - Competitor research on Instagram\n - Content strategy and trend analysis\n - Market research through Instagram data\n - Campaign performance tracking\n - Hashtag research and optimization\n \n The tool uses best-available services behind the scenes while maintaining a consistent, simple interface.\n ";
373
+ static readonly alias = "ig";
374
+ static readonly type = "tool";
375
+ constructor(params?: InstagramToolParamsInput, context?: BubbleContext);
376
+ performAction(): Promise<InstagramToolResult>;
377
+ /**
378
+ * Create an error result
379
+ */
380
+ private createErrorResult;
381
+ /**
382
+ * Handle scrapeProfile operation
383
+ */
384
+ private handleScrapeProfile;
385
+ /**
386
+ * Handle scrapeHashtag operation
387
+ */
388
+ private handleScrapeHashtag;
389
+ /**
390
+ * Scrape hashtags using Apify service
391
+ * This is the current implementation - future versions could add other services
392
+ */
393
+ private scrapeWithApifyHashtags;
394
+ /**
395
+ * Normalize various profile inputs to Instagram URLs
396
+ * Accepts: @username, username, https://instagram.com/username/
397
+ */
398
+ private normalizeProfiles;
399
+ /**
400
+ * Normalize hashtags for Apify actor
401
+ * Removes # symbol and cleans format to match Apify requirements
402
+ */
403
+ private normalizeHashtags;
404
+ /**
405
+ * Scrape profiles using Apify service
406
+ * This is the current implementation - future versions could add other services
407
+ * Always fetches both profile details and posts for maximum flexibility
408
+ */
409
+ private scrapeWithApifyProfiles;
410
+ /**
411
+ * Extract username from Instagram URL
412
+ */
413
+ private extractUsername;
414
+ /**
415
+ * Normalize post type to standard enum
416
+ */
417
+ private normalizePostType;
418
+ /**
419
+ * Extract posts from Apify results
420
+ * Handles both 'details' and 'posts' resultsType formats
421
+ */
422
+ private extractPosts;
423
+ /**
424
+ * Extract profile information from Apify results
425
+ * Handles the 'details' resultsType format
426
+ */
427
+ private extractProfileInfo;
428
+ /**
429
+ * Extract posts from hashtag scraper results
430
+ * Hashtag scraper returns posts directly (not nested)
431
+ */
432
+ private extractHashtagPosts;
433
+ }
434
+ export {};
435
+ //# sourceMappingURL=instagram-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instagram-tool.d.ts","sourceRoot":"","sources":["../../../src/bubbles/tool-bubble/instagram-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;AAC3D,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK5E,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAavB,CAAC;AAEH,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS1B,CAAC;AAGH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAsC7B,CAAC;AAGH,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsC7B,CAAC;AAGH,KAAK,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACtE,KAAK,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACtE,KAAK,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGvE,MAAM,MAAM,wBAAwB,CAClC,CAAC,SAAS,mBAAmB,CAAC,WAAW,CAAC,IACxC,OAAO,CAAC,mBAAmB,EAAE;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,UAAU,CAC3C,mBAAmB,EACnB,mBAAmB,CACpB;IAEC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAoB;IAC1D,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;OAA6B;IACnD,MAAM,CAAC,QAAQ,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAA6B;IACzD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,6HAC4F;IAC5H,MAAM,CAAC,QAAQ,CAAC,eAAe,i1EAmD7B;IACF,MAAM,CAAC,QAAQ,CAAC,KAAK,QAAQ;IAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;gBAG5B,MAAM,GAAE,wBAIP,EACD,OAAO,CAAC,EAAE,aAAa;IAKnB,aAAa,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAiDnD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;OAEG;YACW,mBAAmB;IAuBjC;;OAEG;YACW,mBAAmB;IAoBjC;;;OAGG;YACW,uBAAuB;IAyDrC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAiBzB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAoBzB;;;;OAIG;YACW,uBAAuB;IA6DrC;;OAEG;IACH,OAAO,CAAC,eAAe;IAKvB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAczB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAgCpB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CA0B5B"}