@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.
- package/LICENSE.txt +202 -0
- package/dist/bubble-bundle.d.ts +2021 -0
- package/dist/bubble-factory.d.ts +161 -0
- package/dist/bubble-factory.d.ts.map +1 -0
- package/dist/bubble-factory.js +426 -0
- package/dist/bubble-factory.js.map +1 -0
- package/dist/bubble-flow/bubble-flow-class.d.ts +19 -0
- package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -0
- package/dist/bubble-flow/bubble-flow-class.js +23 -0
- package/dist/bubble-flow/bubble-flow-class.js.map +1 -0
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts +15 -0
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -0
- package/dist/bubble-flow/sample/data-analyst-flow.js +63 -0
- package/dist/bubble-flow/sample/data-analyst-flow.js.map +1 -0
- package/dist/bubble-flow/sample/error-ts.d.ts +23 -0
- package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -0
- package/dist/bubble-flow/sample/error-ts.js +31 -0
- package/dist/bubble-flow/sample/error-ts.js.map +1 -0
- package/dist/bubble-flow/sample/sanitytest.d.ts +10 -0
- package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -0
- package/dist/bubble-flow/sample/sanitytest.js +13 -0
- package/dist/bubble-flow/sample/sanitytest.js.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts +19 -0
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook-2.js +23 -0
- package/dist/bubble-flow/sample/simple-webhook-2.js.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook.d.ts +10 -0
- package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simple-webhook.js +18 -0
- package/dist/bubble-flow/sample/simple-webhook.js.map +1 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +29 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +150 -0
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -0
- package/dist/bubble-flow/sample/slack-v0.1.d.ts +10 -0
- package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -0
- package/dist/bubble-flow/sample/slack-v0.1.js +59 -0
- package/dist/bubble-flow/sample/slack-v0.1.js.map +1 -0
- package/dist/bubble-flow/sample/slackagenttest.d.ts +10 -0
- package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -0
- package/dist/bubble-flow/sample/slackagenttest.js +59 -0
- package/dist/bubble-flow/sample/slackagenttest.js.map +1 -0
- package/dist/bubble-trigger/index.d.ts +2 -0
- package/dist/bubble-trigger/index.d.ts.map +1 -0
- package/dist/bubble-trigger/index.js +2 -0
- package/dist/bubble-trigger/index.js.map +1 -0
- package/dist/bubble-trigger/types.d.ts +87 -0
- package/dist/bubble-trigger/types.d.ts.map +1 -0
- package/dist/bubble-trigger/types.js +14 -0
- package/dist/bubble-trigger/types.js.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts +428 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.js +881 -0
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +3073 -0
- package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/gmail.js +908 -0
- package/dist/bubbles/service-bubble/gmail.js.map +1 -0
- package/dist/bubbles/service-bubble/google-calendar.d.ts +3377 -0
- package/dist/bubbles/service-bubble/google-calendar.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-calendar.js +527 -0
- package/dist/bubbles/service-bubble/google-calendar.js.map +1 -0
- package/dist/bubbles/service-bubble/google-drive.d.ts +1152 -0
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-drive.js +943 -0
- package/dist/bubbles/service-bubble/google-drive.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets.d.ts +1811 -0
- package/dist/bubbles/service-bubble/google-sheets.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets.js +904 -0
- package/dist/bubbles/service-bubble/google-sheets.js.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.d.ts +74 -0
- package/dist/bubbles/service-bubble/hello-world.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.js +67 -0
- package/dist/bubbles/service-bubble/hello-world.js.map +1 -0
- package/dist/bubbles/service-bubble/http.d.ts +134 -0
- package/dist/bubbles/service-bubble/http.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/http.js +184 -0
- package/dist/bubbles/service-bubble/http.js.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts +180 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.js +448 -0
- package/dist/bubbles/service-bubble/postgresql.js.map +1 -0
- package/dist/bubbles/service-bubble/resend.d.ts +301 -0
- package/dist/bubbles/service-bubble/resend.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/resend.js +253 -0
- package/dist/bubbles/service-bubble/resend.js.map +1 -0
- package/dist/bubbles/service-bubble/slack.d.ts +5869 -0
- package/dist/bubbles/service-bubble/slack.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/slack.js +1536 -0
- package/dist/bubbles/service-bubble/slack.js.map +1 -0
- package/dist/bubbles/service-bubble/storage.d.ts +571 -0
- package/dist/bubbles/service-bubble/storage.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/storage.js +504 -0
- package/dist/bubbles/service-bubble/storage.js.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +308 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +285 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +416 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.js +570 -0
- package/dist/bubbles/tool-bubble/chart-js-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +99 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +645 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +112 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.js +82 -0
- package/dist/bubbles/tool-bubble/list-bubbles-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +413 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +327 -0
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +122 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.js +343 -0
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +131 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.js +147 -0
- package/dist/bubbles/tool-bubble/sql-query-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/tool-template.d.ts +257 -0
- package/dist/bubbles/tool-bubble/tool-template.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/tool-template.js +238 -0
- package/dist/bubbles/tool-bubble/tool-template.js.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts +8 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.js +65 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor-example.js.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts +125 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js +169 -0
- package/dist/bubbles/tool-bubble/virtual-file-editor.tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +218 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.js +255 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +134 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.js +175 -0
- package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +228 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +214 -0
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +134 -0
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/web-search-tool.js +155 -0
- package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +114 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +777 -0
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts +97 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js +327 -0
- package/dist/bubbles/workflow-bubble/bubblscript-generateor.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +303 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js +297 -0
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts +157 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js +310 -0
- package/dist/bubbles/workflow-bubble/file-editor-agent.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +543 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +628 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +679 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +604 -0
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +1011 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +841 -0
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +883 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +781 -0
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +300 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +508 -0
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +731 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +690 -0
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +401 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +382 -0
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -0
- package/dist/bubbles/workflow-bubble/workflow-template.d.ts +144 -0
- package/dist/bubbles/workflow-bubble/workflow-template.d.ts.map +1 -0
- package/dist/bubbles/workflow-bubble/workflow-template.js +124 -0
- package/dist/bubbles/workflow-bubble/workflow-template.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/BubbleLogger.d.ts +146 -0
- package/dist/logging/BubbleLogger.d.ts.map +1 -0
- package/dist/logging/BubbleLogger.js +472 -0
- package/dist/logging/BubbleLogger.js.map +1 -0
- package/dist/logging/StreamingBubbleLogger.d.ts +85 -0
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -0
- package/dist/logging/StreamingBubbleLogger.js +340 -0
- package/dist/logging/StreamingBubbleLogger.js.map +1 -0
- package/dist/types/ai-models.d.ts +4 -0
- package/dist/types/ai-models.d.ts.map +1 -0
- package/dist/types/ai-models.js +14 -0
- package/dist/types/ai-models.js.map +1 -0
- package/dist/types/available-tools.d.ts +4 -0
- package/dist/types/available-tools.d.ts.map +1 -0
- package/dist/types/available-tools.js +19 -0
- package/dist/types/available-tools.js.map +1 -0
- package/dist/types/base-bubble-class.d.ts +47 -0
- package/dist/types/base-bubble-class.d.ts.map +1 -0
- package/dist/types/base-bubble-class.js +212 -0
- package/dist/types/base-bubble-class.js.map +1 -0
- package/dist/types/bubble-errors.d.ts +44 -0
- package/dist/types/bubble-errors.d.ts.map +1 -0
- package/dist/types/bubble-errors.js +51 -0
- package/dist/types/bubble-errors.js.map +1 -0
- package/dist/types/bubble.d.ts +73 -0
- package/dist/types/bubble.d.ts.map +1 -0
- package/dist/types/bubble.js +2 -0
- package/dist/types/bubble.js.map +1 -0
- package/dist/types/credentials.d.ts +6 -0
- package/dist/types/credentials.d.ts.map +1 -0
- package/dist/types/credentials.js +6 -0
- package/dist/types/credentials.js.map +1 -0
- package/dist/types/service-bubble-class.d.ts +31 -0
- package/dist/types/service-bubble-class.d.ts.map +1 -0
- package/dist/types/service-bubble-class.js +36 -0
- package/dist/types/service-bubble-class.js.map +1 -0
- package/dist/types/streaming-events.d.ts +18 -0
- package/dist/types/streaming-events.d.ts.map +1 -0
- package/dist/types/streaming-events.js +5 -0
- package/dist/types/streaming-events.js.map +1 -0
- package/dist/types/tool-bubble-class.d.ts +19 -0
- package/dist/types/tool-bubble-class.d.ts.map +1 -0
- package/dist/types/tool-bubble-class.js +48 -0
- package/dist/types/tool-bubble-class.js.map +1 -0
- package/dist/types/workflow-bubble-class.d.ts +25 -0
- package/dist/types/workflow-bubble-class.d.ts.map +1 -0
- package/dist/types/workflow-bubble-class.js +30 -0
- package/dist/types/workflow-bubble-class.js.map +1 -0
- package/dist/utils/bubbleflow-parser.d.ts +32 -0
- package/dist/utils/bubbleflow-parser.d.ts.map +1 -0
- package/dist/utils/bubbleflow-parser.js +332 -0
- package/dist/utils/bubbleflow-parser.js.map +1 -0
- package/dist/utils/bubbleflow-validation.d.ts +9 -0
- package/dist/utils/bubbleflow-validation.d.ts.map +1 -0
- package/dist/utils/bubbleflow-validation.js +116 -0
- package/dist/utils/bubbleflow-validation.js.map +1 -0
- package/dist/utils/json-parsing.d.ts +20 -0
- package/dist/utils/json-parsing.d.ts.map +1 -0
- package/dist/utils/json-parsing.js +394 -0
- package/dist/utils/json-parsing.js.map +1 -0
- package/dist/utils/mock-data-generator.d.ts +43 -0
- package/dist/utils/mock-data-generator.d.ts.map +1 -0
- package/dist/utils/mock-data-generator.js +312 -0
- package/dist/utils/mock-data-generator.js.map +1 -0
- package/dist/utils/param-helper.d.ts +2 -0
- package/dist/utils/param-helper.d.ts.map +1 -0
- package/dist/utils/param-helper.js +5 -0
- package/dist/utils/param-helper.js.map +1 -0
- package/dist/utils/source-bubble-parser.d.ts +31 -0
- package/dist/utils/source-bubble-parser.d.ts.map +1 -0
- package/dist/utils/source-bubble-parser.js +231 -0
- package/dist/utils/source-bubble-parser.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WorkflowBubble } from '../../types/workflow-bubble-class.js';
|
|
3
|
+
import { SlackBubble } from '../service-bubble/slack.js';
|
|
4
|
+
import { DatabaseAnalyzerWorkflowBubble } from './database-analyzer.workflow.js';
|
|
5
|
+
import { AIAgentBubble } from '../service-bubble/ai-agent.js';
|
|
6
|
+
import { SlackFormatterAgentBubble } from './slack-formatter-agent.js';
|
|
7
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
8
|
+
import { AvailableModels } from '../../types/ai-models.js';
|
|
9
|
+
// Define the parameters schema for the Slack Data Assistant workflow
|
|
10
|
+
const SlackDataAssistantParamsSchema = z.object({
|
|
11
|
+
// Slack configuration
|
|
12
|
+
slackChannel: z
|
|
13
|
+
.string()
|
|
14
|
+
.min(1)
|
|
15
|
+
.describe('Slack channel ID where the bot will respond'),
|
|
16
|
+
slackThreadTs: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Thread timestamp if replying to a thread'),
|
|
20
|
+
userQuestion: z.string().min(1).describe('The user question from Slack'),
|
|
21
|
+
userName: z
|
|
22
|
+
.string()
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Name of the user asking the question'),
|
|
25
|
+
name: z
|
|
26
|
+
.string()
|
|
27
|
+
.default('Data Assistant')
|
|
28
|
+
.describe('Name of the AI assistant (e.g., "DataBot", "Analytics Assistant")'),
|
|
29
|
+
// Database configuration
|
|
30
|
+
dataSourceType: z
|
|
31
|
+
.enum(['postgresql', 'mysql', 'sqlite', 'mariadb', 'mssql'])
|
|
32
|
+
.default('postgresql')
|
|
33
|
+
.describe('Type of database to analyze'),
|
|
34
|
+
databaseUrl: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Database connection URL (if not using credentials)'),
|
|
38
|
+
ignoreSSLErrors: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.default(false)
|
|
41
|
+
.describe('Ignore SSL certificate errors for database connection'),
|
|
42
|
+
// AI configuration
|
|
43
|
+
aiModel: AvailableModels.default('google/gemini-2.5-flash').describe('AI model to use for query generation'),
|
|
44
|
+
temperature: z
|
|
45
|
+
.number()
|
|
46
|
+
.min(0)
|
|
47
|
+
.max(2)
|
|
48
|
+
.default(0.3)
|
|
49
|
+
.describe('Temperature for AI responses (lower = more focused)'),
|
|
50
|
+
// Response configuration
|
|
51
|
+
verbosity: z
|
|
52
|
+
.enum(['1', '2', '3', '4', '5'])
|
|
53
|
+
.default('3')
|
|
54
|
+
.describe('Response verbosity level (1=concise, 5=comprehensive)'),
|
|
55
|
+
technicality: z
|
|
56
|
+
.enum(['1', '2', '3', '4', '5'])
|
|
57
|
+
.default('2')
|
|
58
|
+
.describe('Technical complexity level (1=plain English, 5=expert)'),
|
|
59
|
+
includeQuery: z
|
|
60
|
+
.boolean()
|
|
61
|
+
.default(true)
|
|
62
|
+
.describe('Include the SQL query in the response'),
|
|
63
|
+
includeExplanation: z
|
|
64
|
+
.boolean()
|
|
65
|
+
.default(true)
|
|
66
|
+
.describe('Include query explanation in the response'),
|
|
67
|
+
// Injected metadata from user credentials (database schema notes and rules)
|
|
68
|
+
injectedMetadata: z
|
|
69
|
+
.object({
|
|
70
|
+
tables: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
71
|
+
tableNotes: z.record(z.string(), z.string()).optional(),
|
|
72
|
+
rules: z.array(z.string()).optional(),
|
|
73
|
+
})
|
|
74
|
+
.optional()
|
|
75
|
+
.describe('Additional database context injected from user credentials metadata'),
|
|
76
|
+
additionalContext: z
|
|
77
|
+
.string()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('Additional context about how to answer the question'),
|
|
80
|
+
maxQueries: z
|
|
81
|
+
.number()
|
|
82
|
+
.default(20)
|
|
83
|
+
.describe('Maximum number of queries to run'),
|
|
84
|
+
// Credentials
|
|
85
|
+
credentials: z
|
|
86
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('Credentials for various services'),
|
|
89
|
+
});
|
|
90
|
+
// Define the result schema
|
|
91
|
+
const SlackDataAssistantResultSchema = z.object({
|
|
92
|
+
success: z.boolean().describe('Whether the workflow completed successfully'),
|
|
93
|
+
error: z.string().describe('Error message if workflow failed'),
|
|
94
|
+
query: z.string().optional().describe('Generated SQL query'),
|
|
95
|
+
queryExplanation: z.string().optional().describe('Explanation of the query'),
|
|
96
|
+
queryResults: z
|
|
97
|
+
.array(z.record(z.unknown()))
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Results from the database query'),
|
|
100
|
+
formattedResponse: z
|
|
101
|
+
.string()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Formatted response for Slack'),
|
|
104
|
+
slackBlocks: z
|
|
105
|
+
.array(z.unknown())
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Slack block kit formatted message'),
|
|
108
|
+
slackMessageTs: z
|
|
109
|
+
.string()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('Timestamp of sent Slack message'),
|
|
112
|
+
isDataQuestion: z
|
|
113
|
+
.boolean()
|
|
114
|
+
.optional()
|
|
115
|
+
.describe('Whether the question was data-related'),
|
|
116
|
+
metadata: z
|
|
117
|
+
.object({
|
|
118
|
+
executionTime: z
|
|
119
|
+
.number()
|
|
120
|
+
.describe('Total execution time in milliseconds'),
|
|
121
|
+
rowCount: z.number().optional().describe('Number of rows returned'),
|
|
122
|
+
wordCount: z.number().optional().describe('Word count of response'),
|
|
123
|
+
})
|
|
124
|
+
.optional(),
|
|
125
|
+
});
|
|
126
|
+
export class SlackDataAssistantWorkflow extends WorkflowBubble {
|
|
127
|
+
static type = 'workflow';
|
|
128
|
+
static service = 'slack-data-assistant';
|
|
129
|
+
static bubbleName = 'slack-data-assistant';
|
|
130
|
+
static schema = SlackDataAssistantParamsSchema;
|
|
131
|
+
static resultSchema = SlackDataAssistantResultSchema;
|
|
132
|
+
static shortDescription = 'AI-powered Slack bot that answers data questions by querying databases';
|
|
133
|
+
static longDescription = `
|
|
134
|
+
A comprehensive workflow that creates an intelligent Slack bot capable of:
|
|
135
|
+
- Receiving questions from Slack mentions
|
|
136
|
+
- Analyzing database schema
|
|
137
|
+
- Generating appropriate SQL queries using AI
|
|
138
|
+
- Executing queries safely (read-only)
|
|
139
|
+
- Formatting results in a user-friendly way
|
|
140
|
+
- Responding in Slack with rich block formatting
|
|
141
|
+
|
|
142
|
+
Perfect for:
|
|
143
|
+
- Business intelligence chat-bots
|
|
144
|
+
- Data analytics assistants
|
|
145
|
+
- Database query automation
|
|
146
|
+
- Self-service data access
|
|
147
|
+
`;
|
|
148
|
+
static alias = 'slack-data-bot';
|
|
149
|
+
constructor(params, context) {
|
|
150
|
+
super(params, context);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Extract first name from a full name string
|
|
154
|
+
*/
|
|
155
|
+
extractFirstName(fullName) {
|
|
156
|
+
if (!fullName)
|
|
157
|
+
return '';
|
|
158
|
+
return fullName.trim().split(/\s+/)[0];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Clean bot name by removing common suffixes and formatting
|
|
162
|
+
*/
|
|
163
|
+
cleanBotName(botName) {
|
|
164
|
+
if (!botName)
|
|
165
|
+
return 'Bot';
|
|
166
|
+
// Remove common bot suffixes (case insensitive)
|
|
167
|
+
const cleaned = botName.replace(/\s*(bot|Bot|BOT)$/g, '').trim();
|
|
168
|
+
// If we removed everything, fallback to original or 'Bot'
|
|
169
|
+
if (!cleaned)
|
|
170
|
+
return botName || 'Bot';
|
|
171
|
+
// Take first word if multiple words
|
|
172
|
+
return this.extractFirstName(cleaned);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Clean username by converting formats like "john.doe" to "John"
|
|
176
|
+
*/
|
|
177
|
+
cleanUsername(username) {
|
|
178
|
+
if (!username)
|
|
179
|
+
return '';
|
|
180
|
+
// Handle dot notation (john.doe -> John)
|
|
181
|
+
const parts = username.split(/[._-]/);
|
|
182
|
+
const firstName = parts[0];
|
|
183
|
+
// Capitalize first letter
|
|
184
|
+
return firstName.charAt(0).toUpperCase() + firstName.slice(1).toLowerCase();
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Generate a readable name from a Slack user ID when API calls fail
|
|
188
|
+
* Converts "U07UTL8MA9Y" to "User07" etc.
|
|
189
|
+
*/
|
|
190
|
+
generateReadableNameFromUserId(userId) {
|
|
191
|
+
if (!userId)
|
|
192
|
+
return 'User';
|
|
193
|
+
// Extract meaningful part from user ID (U07UTL8MA9Y -> 07UTL8MA9Y)
|
|
194
|
+
const idPart = userId.replace(/^U/, '');
|
|
195
|
+
// Take first few characters to make it readable but not too long
|
|
196
|
+
const shortId = idPart.substring(0, 4);
|
|
197
|
+
return `User${shortId}`;
|
|
198
|
+
}
|
|
199
|
+
async performAction() {
|
|
200
|
+
const startTime = Date.now();
|
|
201
|
+
let additionalError = '';
|
|
202
|
+
try {
|
|
203
|
+
// Step 1: Fetch thread history if this is a threaded conversation
|
|
204
|
+
let threadContext = '';
|
|
205
|
+
if (this.params.slackThreadTs) {
|
|
206
|
+
try {
|
|
207
|
+
// Use the new get_thread_replies operation to get all messages in the thread
|
|
208
|
+
const threadReplies = new SlackBubble({
|
|
209
|
+
operation: 'get_thread_replies',
|
|
210
|
+
channel: this.params.slackChannel,
|
|
211
|
+
ts: this.params.slackThreadTs,
|
|
212
|
+
limit: 100, // Get up to 100 messages in the thread
|
|
213
|
+
credentials: this.params.credentials,
|
|
214
|
+
}, this.context);
|
|
215
|
+
const threadResult = await threadReplies.action();
|
|
216
|
+
if (threadResult.success && threadResult.data?.messages) {
|
|
217
|
+
const allMessages = threadResult.data.messages;
|
|
218
|
+
// Sort messages chronologically (should already be sorted, but be safe)
|
|
219
|
+
allMessages.sort((a, b) => parseFloat(a.ts) - parseFloat(b.ts));
|
|
220
|
+
// Build thread context with user lookups if needed
|
|
221
|
+
if (allMessages.length > 1) {
|
|
222
|
+
// More than just the current message
|
|
223
|
+
threadContext = '\n\nPrevious messages in this thread:\n';
|
|
224
|
+
// Cache for user lookups to avoid repeated API calls
|
|
225
|
+
const userCache = new Map();
|
|
226
|
+
for (const msg of allMessages) {
|
|
227
|
+
let senderName = 'Bot';
|
|
228
|
+
if (msg.user) {
|
|
229
|
+
// Check cache first
|
|
230
|
+
if (userCache.has(msg.user)) {
|
|
231
|
+
senderName = userCache.get(msg.user);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
// Try to get user info and extract first name, but handle missing scope gracefully
|
|
235
|
+
try {
|
|
236
|
+
const userInfo = new SlackBubble({
|
|
237
|
+
operation: 'get_user_info',
|
|
238
|
+
user: msg.user,
|
|
239
|
+
credentials: this.params.credentials,
|
|
240
|
+
}, this.context);
|
|
241
|
+
const userResult = await userInfo.action();
|
|
242
|
+
if (userResult.success && userResult.data?.user) {
|
|
243
|
+
const user = userResult.data.user;
|
|
244
|
+
// Priority order for extracting first name
|
|
245
|
+
let firstName = '';
|
|
246
|
+
if (user.profile?.first_name) {
|
|
247
|
+
firstName = user.profile.first_name;
|
|
248
|
+
}
|
|
249
|
+
else if (user.profile?.display_name) {
|
|
250
|
+
firstName = this.extractFirstName(user.profile.display_name);
|
|
251
|
+
}
|
|
252
|
+
else if (user.profile?.real_name) {
|
|
253
|
+
firstName = this.extractFirstName(user.profile.real_name);
|
|
254
|
+
}
|
|
255
|
+
else if (user.real_name) {
|
|
256
|
+
firstName = this.extractFirstName(user.real_name);
|
|
257
|
+
}
|
|
258
|
+
else if (user.name) {
|
|
259
|
+
firstName = this.cleanUsername(user.name);
|
|
260
|
+
}
|
|
261
|
+
senderName = firstName || this.cleanUsername(msg.user);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
// API call failed (likely missing_scope), generate readable name from user ID
|
|
265
|
+
senderName = this.generateReadableNameFromUserId(msg.user);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
// API call failed, generate readable name from user ID
|
|
270
|
+
senderName = this.generateReadableNameFromUserId(msg.user);
|
|
271
|
+
}
|
|
272
|
+
// Cache the result
|
|
273
|
+
userCache.set(msg.user, senderName);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else if (msg.bot_id || msg.bot_profile) {
|
|
277
|
+
// This is a bot message - extract clean bot name
|
|
278
|
+
const botName = msg.bot_profile?.name ||
|
|
279
|
+
msg.username;
|
|
280
|
+
senderName = this.cleanBotName(botName);
|
|
281
|
+
}
|
|
282
|
+
const text = msg.text || '';
|
|
283
|
+
// Skip the current message being processed, but include all other messages
|
|
284
|
+
if (text !== this.params.userQuestion && text.trim() !== '') {
|
|
285
|
+
threadContext += `- ${senderName}: ${text}\n`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
additionalError += `Warning: Failed to get context from thread: ${threadResult.error || 'Unknown error'}. This means I am unable to answer the question with the context of the thread.`;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
// Continue without thread context if fetching fails
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Step 2: Analyze database schema
|
|
299
|
+
const schemaAnalyzer = new DatabaseAnalyzerWorkflowBubble({
|
|
300
|
+
dataSourceType: 'postgresql',
|
|
301
|
+
ignoreSSLErrors: this.params.ignoreSSLErrors,
|
|
302
|
+
includeMetadata: true,
|
|
303
|
+
injectedMetadata: this.params.injectedMetadata,
|
|
304
|
+
credentials: this.params.credentials,
|
|
305
|
+
}, this.context);
|
|
306
|
+
const schemaResult = await schemaAnalyzer.action();
|
|
307
|
+
if (!schemaResult.success || !schemaResult.data?.databaseSchema) {
|
|
308
|
+
throw new Error(`Failed to analyze database schema: ${schemaResult.error || 'Unknown error'}, Please contact Nodex support if this persists.`);
|
|
309
|
+
}
|
|
310
|
+
// Step 3: Use AI agent with SQL query tool to analyze data
|
|
311
|
+
const dataAnalysisPrompt = `You are a data analyst helping a colleague answer this question: "${this.params.userQuestion}"
|
|
312
|
+
|
|
313
|
+
Here is the context of the thread, take it into account when answering the question:
|
|
314
|
+
${threadContext}
|
|
315
|
+
|
|
316
|
+
Database schema:
|
|
317
|
+
${schemaResult.data.databaseSchema.cleanedJSON}
|
|
318
|
+
|
|
319
|
+
Additional context:
|
|
320
|
+
${this.params.additionalContext}
|
|
321
|
+
|
|
322
|
+
You have access to these tools:
|
|
323
|
+
1. SQL query tool - execute read-only queries to explore and analyze data
|
|
324
|
+
|
|
325
|
+
Use these tools to:
|
|
326
|
+
1. Explore the data to understand what's available
|
|
327
|
+
2. Run targeted queries to answer the specific question
|
|
328
|
+
4. Gather additional context if needed
|
|
329
|
+
5. You can run multiple queries to build a complete picture
|
|
330
|
+
6. IMPORTANT: You are only allowed up to ${(this.params.maxQueries ?? 5) / 2} queries. Do not make make queries that would return more than 20 rows. You should aggregate the data - no returning entire tables.
|
|
331
|
+
|
|
332
|
+
For each query, provide reasoning about why you're running it and what you hope to learn.
|
|
333
|
+
After running your queries, provide a comprehensive answer to the user's question based on all the data you've gathered.`;
|
|
334
|
+
const dataAnalyst = new AIAgentBubble({
|
|
335
|
+
message: dataAnalysisPrompt,
|
|
336
|
+
model: {
|
|
337
|
+
model: this.params.aiModel,
|
|
338
|
+
temperature: this.params.temperature,
|
|
339
|
+
},
|
|
340
|
+
systemPrompt: 'You are a helpful data analyst who uses SQL queries to answer questions and creates visualizations to make data insights clear. Use charts when they help explain trends, comparisons, or patterns in the data.',
|
|
341
|
+
tools: [
|
|
342
|
+
{
|
|
343
|
+
name: 'sql-query-tool',
|
|
344
|
+
credentials: this.params.credentials,
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
maxIterations: this.params.maxQueries,
|
|
348
|
+
credentials: this.params.credentials,
|
|
349
|
+
}, this.context);
|
|
350
|
+
const analysisResponse = await dataAnalyst.action();
|
|
351
|
+
if (!analysisResponse.success || !analysisResponse.data?.response) {
|
|
352
|
+
throw new Error(`Hey, I'm having trouble analyzing data: ${analysisResponse.error || 'Unknown error'}, Please contact Nodex support if this persists.`);
|
|
353
|
+
}
|
|
354
|
+
// Extract all SQL query tool calls and aggregate results
|
|
355
|
+
const toolCalls = analysisResponse.data.toolCalls || [];
|
|
356
|
+
const sqlToolCalls = toolCalls.filter((call) => call.tool === 'sql-query-tool');
|
|
357
|
+
// Aggregate all query results
|
|
358
|
+
const aggregatedResults = this.aggregateQueryResults(sqlToolCalls);
|
|
359
|
+
const totalRows = aggregatedResults.reduce((sum, result) => sum + (result.rowCount || 0), 0);
|
|
360
|
+
// Step 4: Prepare aggregated data for formatting
|
|
361
|
+
const hasDataResults = sqlToolCalls.length > 0;
|
|
362
|
+
const allQueryResults = aggregatedResults.flatMap((result) => result.rows || []);
|
|
363
|
+
const totalRowCount = totalRows;
|
|
364
|
+
// Step 5: Format comprehensive response with all analysis
|
|
365
|
+
let messageContent = `Question: ${this.params.userQuestion}\n\n`;
|
|
366
|
+
messageContent += `You have already analyzed the data and journaled your findings:\n${analysisResponse.data.response}\n\n`;
|
|
367
|
+
if (hasDataResults) {
|
|
368
|
+
messageContent += `Data Summary:\n`;
|
|
369
|
+
messageContent += `• Executed ${sqlToolCalls.length} SQL queries\n`;
|
|
370
|
+
messageContent += `• Analyzed ${totalRowCount} total rows\n`;
|
|
371
|
+
// Add sample results if available
|
|
372
|
+
if (allQueryResults.length > 0) {
|
|
373
|
+
const sampleResults = allQueryResults.slice(0, 5);
|
|
374
|
+
messageContent += `\n📊 Sample Data (first 5 rows):\n${JSON.stringify(sampleResults, null, 2)}\n`;
|
|
375
|
+
}
|
|
376
|
+
// Add queries if requested
|
|
377
|
+
if (this.params.includeQuery) {
|
|
378
|
+
messageContent += `\n🔍 SQL Queries Executed:\n`;
|
|
379
|
+
sqlToolCalls.forEach((call, index) => {
|
|
380
|
+
const queryInput = call.input;
|
|
381
|
+
messageContent += `${index + 1}. ${queryInput.reasoning || 'Data analysis query'}\n`;
|
|
382
|
+
messageContent += `\`\`\`sql\n${queryInput.query}\n\`\`\`\n`;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
messageContent += `Note: This question didn't require database queries - the answer was based on general knowledge.\n`;
|
|
388
|
+
}
|
|
389
|
+
// Step 6: Format with Slack formatter agent
|
|
390
|
+
const contextWithName = `You are ${this.params.name}, a data scientist who excels at answering questions about data.${this.params.additionalContext ? ` ${this.params.additionalContext}` : ''}`;
|
|
391
|
+
const slackFormatter = new SlackFormatterAgentBubble({
|
|
392
|
+
message: messageContent,
|
|
393
|
+
verbosity: this.params.verbosity,
|
|
394
|
+
technicality: this.params.technicality,
|
|
395
|
+
includeBlockKit: true,
|
|
396
|
+
includeQuery: this.params.includeQuery,
|
|
397
|
+
includeExplanation: this.params.includeExplanation,
|
|
398
|
+
additionalContext: contextWithName,
|
|
399
|
+
model: {
|
|
400
|
+
model: 'google/gemini-2.5-flash',
|
|
401
|
+
temperature: 0.7,
|
|
402
|
+
maxTokens: 50000,
|
|
403
|
+
},
|
|
404
|
+
credentials: this.params.credentials,
|
|
405
|
+
}, this.context);
|
|
406
|
+
const formatterResult = await slackFormatter.action();
|
|
407
|
+
if (!formatterResult.success) {
|
|
408
|
+
throw new Error(`Hey, I'm having trouble formatting the response for Slack: ${formatterResult.error || 'Unknown error'}, Please contact Nodex support if this persists.`);
|
|
409
|
+
}
|
|
410
|
+
// Step 7: Send to Slack
|
|
411
|
+
const blocksToSend = formatterResult.data?.blocks
|
|
412
|
+
? [
|
|
413
|
+
...formatterResult.data.blocks,
|
|
414
|
+
...(additionalError
|
|
415
|
+
? [
|
|
416
|
+
{
|
|
417
|
+
type: 'divider',
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
type: 'section',
|
|
421
|
+
text: {
|
|
422
|
+
type: 'mrkdwn',
|
|
423
|
+
text: `⚠️ *Warning*\n\`\`\`${additionalError}\`\`\``,
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
]
|
|
427
|
+
: []),
|
|
428
|
+
]
|
|
429
|
+
: additionalError
|
|
430
|
+
? [
|
|
431
|
+
{
|
|
432
|
+
type: 'section',
|
|
433
|
+
text: {
|
|
434
|
+
type: 'mrkdwn',
|
|
435
|
+
text: `⚠️ *Warning*\n\`\`\`${additionalError}\`\`\``,
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
]
|
|
439
|
+
: undefined;
|
|
440
|
+
const slackSender = new SlackBubble({
|
|
441
|
+
operation: 'send_message',
|
|
442
|
+
channel: this.params.slackChannel,
|
|
443
|
+
text: formatterResult.data?.response || messageContent,
|
|
444
|
+
blocks: blocksToSend,
|
|
445
|
+
thread_ts: this.params.slackThreadTs,
|
|
446
|
+
credentials: this.params.credentials,
|
|
447
|
+
}, this.context);
|
|
448
|
+
const slackResult = await slackSender.action();
|
|
449
|
+
if (!slackResult.success) {
|
|
450
|
+
throw new Error(`Hey, I'm having trouble sending the message to Slack: ${slackResult.error || 'Unknown error'}, Please contact Nodex support if this persists.`);
|
|
451
|
+
}
|
|
452
|
+
// Calculate execution time
|
|
453
|
+
const executionTime = Date.now() - startTime;
|
|
454
|
+
return {
|
|
455
|
+
success: true,
|
|
456
|
+
error: '',
|
|
457
|
+
query: sqlToolCalls
|
|
458
|
+
.map((call) => call.input.query)
|
|
459
|
+
.join('; '),
|
|
460
|
+
queryExplanation: `Executed ${sqlToolCalls.length} queries for comprehensive analysis`,
|
|
461
|
+
queryResults: allQueryResults,
|
|
462
|
+
formattedResponse: formatterResult.data?.response,
|
|
463
|
+
slackBlocks: formatterResult.data?.blocks,
|
|
464
|
+
slackMessageTs: slackResult.data?.message?.ts,
|
|
465
|
+
isDataQuestion: hasDataResults,
|
|
466
|
+
metadata: {
|
|
467
|
+
executionTime,
|
|
468
|
+
rowCount: totalRowCount,
|
|
469
|
+
wordCount: formatterResult.data?.metadata.wordCount || 0,
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
catch (error) {
|
|
474
|
+
// Try to send error message to Slack
|
|
475
|
+
try {
|
|
476
|
+
const errorSender = new SlackBubble({
|
|
477
|
+
operation: 'send_message',
|
|
478
|
+
channel: this.params.slackChannel,
|
|
479
|
+
text: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
480
|
+
thread_ts: this.params.slackThreadTs,
|
|
481
|
+
credentials: this.params.credentials,
|
|
482
|
+
}, this.context);
|
|
483
|
+
await errorSender.action();
|
|
484
|
+
}
|
|
485
|
+
catch {
|
|
486
|
+
// Ignore Slack send errors
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
success: false,
|
|
490
|
+
error: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
491
|
+
metadata: {
|
|
492
|
+
executionTime: Date.now() - startTime,
|
|
493
|
+
},
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
aggregateQueryResults(sqlToolCalls) {
|
|
498
|
+
return sqlToolCalls.map((call) => {
|
|
499
|
+
const output = call.output;
|
|
500
|
+
return {
|
|
501
|
+
rowCount: output?.rowCount || 0,
|
|
502
|
+
rows: output?.rows || [],
|
|
503
|
+
summary: `Query returned ${output?.rowCount || 0} rows`,
|
|
504
|
+
};
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
//# sourceMappingURL=slack-data-assistant.workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slack-data-assistant.workflow.js","sourceRoot":"","sources":["../../../src/bubbles/workflow-bubble/slack-data-assistant.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,qEAAqE;AACrE,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,sBAAsB;IACtB,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,6CAA6C,CAAC;IAC1D,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,QAAQ,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