@bubblelab/bubble-core 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bubble-bundle.d.ts +633 -1658
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +165 -43
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.d.ts +22 -1
- package/dist/bubble-flow/bubble-flow-class.d.ts.map +1 -1
- package/dist/bubble-flow/bubble-flow-class.js +36 -0
- package/dist/bubble-flow/bubble-flow-class.js.map +1 -1
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts +1 -1
- package/dist/bubble-flow/sample/data-analyst-flow.d.ts.map +1 -1
- package/dist/bubble-flow/sample/error-ts.d.ts +1 -1
- package/dist/bubble-flow/sample/error-ts.d.ts.map +1 -1
- package/dist/bubble-flow/sample/sanitytest.d.ts +1 -1
- package/dist/bubble-flow/sample/sanitytest.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts +1 -1
- package/dist/bubble-flow/sample/simple-webhook-2.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simple-webhook.d.ts +1 -1
- package/dist/bubble-flow/sample/simple-webhook.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.d.ts.map +1 -1
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js +6 -3
- package/dist/bubble-flow/sample/simplified-data-analysis.flow.js.map +1 -1
- package/dist/bubble-flow/sample/slack-v0.1.d.ts +1 -1
- package/dist/bubble-flow/sample/slack-v0.1.d.ts.map +1 -1
- package/dist/bubble-flow/sample/slackagenttest.d.ts +1 -1
- package/dist/bubble-flow/sample/slackagenttest.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/agi-inc.d.ts +1121 -0
- package/dist/bubbles/service-bubble/agi-inc.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/agi-inc.js +730 -0
- package/dist/bubbles/service-bubble/agi-inc.js.map +1 -0
- package/dist/bubbles/service-bubble/ai-agent.d.ts +297 -85
- package/dist/bubbles/service-bubble/ai-agent.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/ai-agent.js +535 -399
- package/dist/bubbles/service-bubble/ai-agent.js.map +1 -1
- package/dist/bubbles/service-bubble/airtable.d.ts +1753 -0
- package/dist/bubbles/service-bubble/airtable.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/airtable.js +1173 -0
- package/dist/bubbles/service-bubble/airtable.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts +240 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js +119 -0
- package/dist/bubbles/service-bubble/apify/actors/google-maps-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/instagram-hashtag-scraper.d.ts +38 -38
- package/dist/bubbles/service-bubble/apify/actors/instagram-scraper.d.ts +56 -56
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts +137 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js +81 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-jobs-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/linkedin-posts-search.d.ts +27 -27
- package/dist/bubbles/service-bubble/apify/actors/linkedin-profile-posts.d.ts +38 -38
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts +488 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js +463 -0
- package/dist/bubbles/service-bubble/apify/actors/tiktok-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts +262 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js +291 -0
- package/dist/bubbles/service-bubble/apify/actors/twitter-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts +184 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js +145 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts +52 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js +29 -0
- package/dist/bubbles/service-bubble/apify/actors/youtube-transcript-scraper.js.map +1 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts +1483 -123
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js +48 -0
- package/dist/bubbles/service-bubble/apify/apify-scraper.schema.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.d.ts +156 -11
- package/dist/bubbles/service-bubble/apify/apify.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/apify.js +205 -32
- package/dist/bubbles/service-bubble/apify/apify.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/index.d.ts +2 -0
- package/dist/bubbles/service-bubble/apify/index.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/apify/index.js +3 -0
- package/dist/bubbles/service-bubble/apify/index.js.map +1 -1
- package/dist/bubbles/service-bubble/apify/types.js +1 -2
- package/dist/bubbles/service-bubble/apify/types.js.map +1 -1
- package/dist/bubbles/service-bubble/eleven-labs.d.ts +421 -0
- package/dist/bubbles/service-bubble/eleven-labs.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/eleven-labs.js +479 -0
- package/dist/bubbles/service-bubble/eleven-labs.js.map +1 -0
- package/dist/bubbles/service-bubble/firecrawl.d.ts +37748 -0
- package/dist/bubbles/service-bubble/firecrawl.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/firecrawl.js +1489 -0
- package/dist/bubbles/service-bubble/firecrawl.js.map +1 -0
- package/dist/bubbles/service-bubble/followupboss.d.ts +6822 -0
- package/dist/bubbles/service-bubble/followupboss.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/followupboss.js +1394 -0
- package/dist/bubbles/service-bubble/followupboss.js.map +1 -0
- package/dist/bubbles/service-bubble/github.d.ts +2399 -0
- package/dist/bubbles/service-bubble/github.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/github.js +1052 -0
- package/dist/bubbles/service-bubble/github.js.map +1 -0
- package/dist/bubbles/service-bubble/gmail.d.ts +726 -232
- package/dist/bubbles/service-bubble/gmail.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/gmail.js +435 -7
- package/dist/bubbles/service-bubble/gmail.js.map +1 -1
- package/dist/bubbles/service-bubble/google-calendar.d.ts +8 -8
- package/dist/bubbles/service-bubble/google-drive.d.ts +270 -40
- package/dist/bubbles/service-bubble/google-drive.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/google-drive.js +100 -78
- package/dist/bubbles/service-bubble/google-drive.js.map +1 -1
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +943 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts +31 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js +184 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.integration.flow.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.js +401 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts +1024 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/{google-sheets.js → google-sheets/google-sheets.schema.js} +45 -409
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts +38 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js +183 -0
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/google-sheets/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/google-sheets/index.js +4 -0
- package/dist/bubbles/service-bubble/google-sheets/index.js.map +1 -0
- package/dist/bubbles/service-bubble/hello-world.js +2 -2
- package/dist/bubbles/service-bubble/hello-world.js.map +1 -1
- package/dist/bubbles/service-bubble/http.d.ts +6 -6
- package/dist/bubbles/service-bubble/http.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/http.js +7 -1
- package/dist/bubbles/service-bubble/http.js.map +1 -1
- package/dist/bubbles/service-bubble/insforge-db.d.ts +140 -0
- package/dist/bubbles/service-bubble/insforge-db.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/insforge-db.js +260 -0
- package/dist/bubbles/service-bubble/insforge-db.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/index.d.ts +3 -0
- package/dist/bubbles/service-bubble/notion/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/index.js +3 -0
- package/dist/bubbles/service-bubble/notion/index.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/notion.d.ts +35405 -0
- package/dist/bubbles/service-bubble/notion/notion.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/notion.js +1492 -0
- package/dist/bubbles/service-bubble/notion/notion.js.map +1 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.d.ts +1148 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.js +341 -0
- package/dist/bubbles/service-bubble/notion/property-schemas.js.map +1 -0
- package/dist/bubbles/service-bubble/postgresql.d.ts +8 -8
- package/dist/bubbles/service-bubble/resend.d.ts +30 -9
- package/dist/bubbles/service-bubble/resend.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/resend.js +133 -2
- package/dist/bubbles/service-bubble/resend.js.map +1 -1
- package/dist/bubbles/service-bubble/slack.d.ts +525 -525
- package/dist/bubbles/service-bubble/slack.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/slack.js +2 -2
- package/dist/bubbles/service-bubble/slack.js.map +1 -1
- package/dist/bubbles/service-bubble/storage.d.ts +21 -17
- package/dist/bubbles/service-bubble/storage.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/storage.js +59 -7
- package/dist/bubbles/service-bubble/storage.js.map +1 -1
- package/dist/bubbles/service-bubble/telegram.d.ts +7742 -0
- package/dist/bubbles/service-bubble/telegram.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/telegram.js +1132 -0
- package/dist/bubbles/service-bubble/telegram.js.map +1 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +60 -4
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js +12 -0
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +188 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.js +321 -0
- package/dist/bubbles/tool-bubble/code-edit-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +8 -4
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js +132 -19
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +455 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.js +205 -0
- package/dist/bubbles/tool-bubble/google-maps-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +90 -90
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/instagram-tool.js +2 -2
- package/dist/bubbles/tool-bubble/instagram-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +808 -431
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/linkedin-tool.js +232 -12
- package/dist/bubbles/tool-bubble/linkedin-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +21 -16
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js +97 -22
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +17 -16
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/research-agent-tool.js +27 -17
- package/dist/bubbles/tool-bubble/research-agent-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +485 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.js +226 -0
- package/dist/bubbles/tool-bubble/tiktok-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +947 -0
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/twitter-tool.js +494 -0
- package/dist/bubbles/tool-bubble/twitter-tool.js.map +1 -0
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +32 -26
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-crawl-tool.js +58 -59
- package/dist/bubbles/tool-bubble/web-crawl-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-extract-tool.js +17 -17
- package/dist/bubbles/tool-bubble/web-extract-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +23 -115
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-scrape-tool.js +51 -72
- package/dist/bubbles/tool-bubble/web-scrape-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +18 -6
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts.map +1 -1
- package/dist/bubbles/tool-bubble/web-search-tool.js +46 -32
- package/dist/bubbles/tool-bubble/web-search-tool.js.map +1 -1
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +394 -0
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts.map +1 -0
- package/dist/bubbles/tool-bubble/youtube-tool.js +352 -0
- package/dist/bubbles/tool-bubble/youtube-tool.js.map +1 -0
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +78 -78
- package/dist/bubbles/workflow-bubble/generate-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +62 -62
- package/dist/bubbles/workflow-bubble/parse-document.workflow.js +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +80 -80
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js +4 -4
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +52 -52
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js +2 -2
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +32 -32
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js +6 -6
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +46 -46
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js +24 -4
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.js.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +27 -27
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts.map +1 -1
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js +8 -8
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.js.map +1 -1
- package/dist/bubbles.json +251 -88
- package/dist/index.d.ts +27 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -4
- package/dist/index.js.map +1 -1
- package/dist/logging/BubbleLogger.d.ts +45 -16
- package/dist/logging/BubbleLogger.d.ts.map +1 -1
- package/dist/logging/BubbleLogger.js +197 -89
- package/dist/logging/BubbleLogger.js.map +1 -1
- package/dist/logging/StreamingBubbleLogger.d.ts +13 -1
- package/dist/logging/StreamingBubbleLogger.d.ts.map +1 -1
- package/dist/logging/StreamingBubbleLogger.js +56 -13
- package/dist/logging/StreamingBubbleLogger.js.map +1 -1
- package/dist/logging/WebhookStreamLogger.d.ts +66 -0
- package/dist/logging/WebhookStreamLogger.d.ts.map +1 -0
- package/dist/logging/WebhookStreamLogger.js +291 -0
- package/dist/logging/WebhookStreamLogger.js.map +1 -0
- package/dist/types/available-tools.d.ts +1 -1
- package/dist/types/available-tools.d.ts.map +1 -1
- package/dist/types/available-tools.js +1 -0
- package/dist/types/available-tools.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts +7 -5
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +63 -40
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/types/bubble.d.ts +3 -10
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/bubble.js +1 -1
- package/dist/types/bubble.js.map +1 -1
- package/dist/types/service-bubble-class.d.ts +2 -2
- package/dist/types/service-bubble-class.d.ts.map +1 -1
- package/dist/types/service-bubble-class.js +2 -2
- package/dist/types/service-bubble-class.js.map +1 -1
- package/dist/types/tool-bubble-class.d.ts +2 -2
- package/dist/types/tool-bubble-class.d.ts.map +1 -1
- package/dist/types/tool-bubble-class.js +2 -4
- package/dist/types/tool-bubble-class.js.map +1 -1
- package/dist/types/workflow-bubble-class.d.ts +2 -2
- package/dist/types/workflow-bubble-class.d.ts.map +1 -1
- package/dist/types/workflow-bubble-class.js +2 -2
- package/dist/types/workflow-bubble-class.js.map +1 -1
- package/dist/utils/agent-formatter.d.ts +14 -2
- package/dist/utils/agent-formatter.d.ts.map +1 -1
- package/dist/utils/agent-formatter.js +176 -28
- package/dist/utils/agent-formatter.js.map +1 -1
- package/dist/utils/bubbleflow-validation.d.ts +7 -0
- package/dist/utils/bubbleflow-validation.d.ts.map +1 -1
- package/dist/utils/bubbleflow-validation.js +257 -35
- package/dist/utils/bubbleflow-validation.js.map +1 -1
- package/dist/utils/error-sanitizer.d.ts +12 -0
- package/dist/utils/error-sanitizer.d.ts.map +1 -0
- package/dist/utils/error-sanitizer.js +77 -0
- package/dist/utils/error-sanitizer.js.map +1 -0
- package/dist/utils/json-parsing.d.ts.map +1 -1
- package/dist/utils/json-parsing.js +146 -0
- package/dist/utils/json-parsing.js.map +1 -1
- package/dist/utils/safe-gemini-chat.d.ts +31 -0
- package/dist/utils/safe-gemini-chat.d.ts.map +1 -0
- package/dist/utils/safe-gemini-chat.js +93 -0
- package/dist/utils/safe-gemini-chat.js.map +1 -0
- package/dist/utils/schema-comparison.d.ts +92 -0
- package/dist/utils/schema-comparison.d.ts.map +1 -0
- package/dist/utils/schema-comparison.js +716 -0
- package/dist/utils/schema-comparison.js.map +1 -0
- package/dist/utils/zod-schema.d.ts +24 -0
- package/dist/utils/zod-schema.d.ts.map +1 -0
- package/dist/utils/zod-schema.js +56 -0
- package/dist/utils/zod-schema.js.map +1 -0
- package/package.json +7 -6
- package/dist/bubble-trigger/index.d.ts +0 -2
- package/dist/bubble-trigger/index.d.ts.map +0 -1
- package/dist/bubble-trigger/index.js +0 -2
- package/dist/bubble-trigger/index.js.map +0 -1
- package/dist/bubble-trigger/types.d.ts +0 -87
- package/dist/bubble-trigger/types.d.ts.map +0 -1
- package/dist/bubble-trigger/types.js +0 -14
- package/dist/bubble-trigger/types.js.map +0 -1
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts +0 -370
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js +0 -14
- package/dist/bubbles/service-bubble/apify/api-scraper.schema.js.map +0 -1
- package/dist/bubbles/service-bubble/apify.d.ts +0 -136
- package/dist/bubbles/service-bubble/apify.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/apify.js +0 -282
- package/dist/bubbles/service-bubble/apify.js.map +0 -1
- package/dist/bubbles/service-bubble/google-sheets.d.ts +0 -1811
- package/dist/bubbles/service-bubble/google-sheets.d.ts.map +0 -1
- package/dist/bubbles/service-bubble/google-sheets.js.map +0 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts +0 -114
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.d.ts.map +0 -1
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js +0 -782
- package/dist/bubbles/workflow-bubble/bubbleflow-generator.workflow.js.map +0 -1
- package/dist/types/ai-models.d.ts +0 -4
- package/dist/types/ai-models.d.ts.map +0 -1
- package/dist/types/ai-models.js +0 -20
- package/dist/types/ai-models.js.map +0 -1
- package/dist/types/api-scraper.schema.d.ts +0 -453
- package/dist/types/api-scraper.schema.d.ts.map +0 -1
- package/dist/types/api-scraper.schema.js +0 -160
- package/dist/types/api-scraper.schema.js.map +0 -1
- package/dist/utils/param-helper.d.ts +0 -2
- package/dist/utils/param-helper.d.ts.map +0 -1
- package/dist/utils/param-helper.js +0 -5
- package/dist/utils/param-helper.js.map +0 -1
|
@@ -1,55 +1,118 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
2
|
import { parseBubbleFlow } from './bubbleflow-parser.js';
|
|
3
|
+
import { enhanceErrorMessage } from '@bubblelab/shared-schemas';
|
|
4
|
+
// Language Service-based validator (persistent across calls for performance)
|
|
5
|
+
let cachedLanguageService = null;
|
|
6
|
+
let cachedCompilerOptions = null;
|
|
7
|
+
const scriptVersions = new Map();
|
|
8
|
+
const scriptSnapshots = new Map();
|
|
9
|
+
function getOrCreateLanguageService() {
|
|
10
|
+
if (cachedLanguageService && cachedCompilerOptions) {
|
|
11
|
+
return cachedLanguageService;
|
|
12
|
+
}
|
|
13
|
+
// Get TypeScript compiler options (similar to bubble-core config)
|
|
14
|
+
// Disable file generation options for runtime validation performance
|
|
15
|
+
const compilerOptions = {
|
|
16
|
+
target: ts.ScriptTarget.ES2022,
|
|
17
|
+
module: ts.ModuleKind.ESNext,
|
|
18
|
+
moduleResolution: ts.ModuleResolutionKind.Bundler,
|
|
19
|
+
esModuleInterop: true,
|
|
20
|
+
allowSyntheticDefaultImports: true,
|
|
21
|
+
strict: true,
|
|
22
|
+
noImplicitAny: false,
|
|
23
|
+
skipLibCheck: true,
|
|
24
|
+
forceConsistentCasingInFileNames: true,
|
|
25
|
+
declaration: false,
|
|
26
|
+
declarationMap: false,
|
|
27
|
+
sourceMap: false,
|
|
28
|
+
incremental: false,
|
|
29
|
+
noUnusedLocals: true,
|
|
30
|
+
noUnusedParameters: true,
|
|
31
|
+
noImplicitReturns: true,
|
|
32
|
+
noFallthroughCasesInSwitch: true,
|
|
33
|
+
resolveJsonModule: true,
|
|
34
|
+
isolatedModules: true,
|
|
35
|
+
};
|
|
36
|
+
// Create Language Service Host with full file system access
|
|
37
|
+
const host = {
|
|
38
|
+
getScriptFileNames: () => Array.from(scriptSnapshots.keys()),
|
|
39
|
+
getScriptVersion: (fileName) => scriptVersions.get(fileName)?.toString() ?? '0',
|
|
40
|
+
getScriptSnapshot: (fileName) => {
|
|
41
|
+
// First check our in-memory snapshots
|
|
42
|
+
const snapshot = scriptSnapshots.get(fileName);
|
|
43
|
+
if (snapshot) {
|
|
44
|
+
return snapshot;
|
|
45
|
+
}
|
|
46
|
+
// Then try to read from file system (for node_modules, etc.)
|
|
47
|
+
if (ts.sys.fileExists(fileName)) {
|
|
48
|
+
const text = ts.sys.readFile(fileName);
|
|
49
|
+
if (text !== undefined) {
|
|
50
|
+
return ts.ScriptSnapshot.fromString(text);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
},
|
|
55
|
+
getCurrentDirectory: () => ts.sys.getCurrentDirectory(),
|
|
56
|
+
getCompilationSettings: () => compilerOptions,
|
|
57
|
+
getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options),
|
|
58
|
+
fileExists: ts.sys.fileExists,
|
|
59
|
+
readFile: ts.sys.readFile,
|
|
60
|
+
readDirectory: ts.sys.readDirectory,
|
|
61
|
+
directoryExists: ts.sys.directoryExists,
|
|
62
|
+
getDirectories: ts.sys.getDirectories,
|
|
63
|
+
useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames,
|
|
64
|
+
};
|
|
65
|
+
cachedCompilerOptions = compilerOptions;
|
|
66
|
+
cachedLanguageService = ts.createLanguageService(host, ts.createDocumentRegistry());
|
|
67
|
+
return cachedLanguageService;
|
|
68
|
+
}
|
|
3
69
|
export async function validateBubbleFlow(code, bubbleFactory) {
|
|
4
70
|
try {
|
|
5
71
|
// Create a temporary file name for the validation
|
|
6
|
-
const fileName = '
|
|
7
|
-
// Get
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const sourceFile =
|
|
25
|
-
// Create program
|
|
26
|
-
const host = ts.createCompilerHost(compilerOptions);
|
|
27
|
-
// Override getSourceFile to return our code
|
|
28
|
-
const originalGetSourceFile = host.getSourceFile;
|
|
29
|
-
host.getSourceFile = (name, languageVersion, onError, shouldCreateNewSourceFile) => {
|
|
30
|
-
if (name === fileName) {
|
|
31
|
-
return sourceFile;
|
|
32
|
-
}
|
|
33
|
-
return originalGetSourceFile.call(host, name, languageVersion, onError, shouldCreateNewSourceFile);
|
|
34
|
-
};
|
|
35
|
-
const program = ts.createProgram([fileName], compilerOptions, host);
|
|
36
|
-
// Get diagnostics
|
|
37
|
-
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
72
|
+
const fileName = 'virtual-bubble-flow.ts';
|
|
73
|
+
// Get or create the language service
|
|
74
|
+
const languageService = getOrCreateLanguageService();
|
|
75
|
+
// Update script version and snapshot
|
|
76
|
+
const version = (scriptVersions.get(fileName) ?? 0) + 1;
|
|
77
|
+
scriptVersions.set(fileName, version);
|
|
78
|
+
scriptSnapshots.set(fileName, ts.ScriptSnapshot.fromString(code));
|
|
79
|
+
// Get diagnostics using Language Service
|
|
80
|
+
const syntacticDiagnostics = languageService.getSyntacticDiagnostics(fileName);
|
|
81
|
+
const semanticDiagnostics = languageService.getSemanticDiagnostics(fileName);
|
|
82
|
+
// Filter out TS6133 (unused variables) like the server does
|
|
83
|
+
const diagnostics = [
|
|
84
|
+
...syntacticDiagnostics,
|
|
85
|
+
...semanticDiagnostics,
|
|
86
|
+
].filter((d) => d.code !== 6133);
|
|
87
|
+
// Additional validation: Check if it extends BubbleFlow
|
|
88
|
+
// Get source file from language service for AST analysis
|
|
89
|
+
const program = languageService.getProgram();
|
|
90
|
+
const sourceFile = program?.getSourceFile(fileName);
|
|
38
91
|
if (diagnostics.length > 0) {
|
|
92
|
+
const variableTypes = sourceFile
|
|
93
|
+
? extractVariableTypes(sourceFile, program)
|
|
94
|
+
: [];
|
|
39
95
|
const errors = diagnostics.map((diagnostic) => {
|
|
40
96
|
if (diagnostic.file && diagnostic.start !== undefined) {
|
|
41
97
|
const { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
42
98
|
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
|
|
43
|
-
return `Line ${line + 1}, Column ${character + 1}: ${message}`;
|
|
99
|
+
return `Line ${line + 1}, Column ${character + 1}: ${enhanceErrorMessage(message)}`;
|
|
44
100
|
}
|
|
45
|
-
|
|
101
|
+
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
|
|
102
|
+
return enhanceErrorMessage(message);
|
|
46
103
|
});
|
|
47
104
|
return {
|
|
48
105
|
valid: false,
|
|
49
106
|
errors,
|
|
107
|
+
variableTypes,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (!sourceFile) {
|
|
111
|
+
return {
|
|
112
|
+
valid: false,
|
|
113
|
+
errors: ['Failed to get source file for validation'],
|
|
50
114
|
};
|
|
51
115
|
}
|
|
52
|
-
// Additional validation: Check if it extends BubbleFlow
|
|
53
116
|
const hasValidBubbleFlow = validateBubbleFlowClass(sourceFile);
|
|
54
117
|
if (!hasValidBubbleFlow.valid) {
|
|
55
118
|
return hasValidBubbleFlow;
|
|
@@ -63,9 +126,14 @@ export async function validateBubbleFlow(code, bubbleFactory) {
|
|
|
63
126
|
errors: parseResult.errors || ['Failed to parse bubble parameters'],
|
|
64
127
|
};
|
|
65
128
|
}
|
|
129
|
+
// Extract type definitions for all variables
|
|
130
|
+
const variableTypes = sourceFile
|
|
131
|
+
? extractVariableTypes(sourceFile, program)
|
|
132
|
+
: [];
|
|
66
133
|
return {
|
|
67
134
|
valid: true,
|
|
68
135
|
bubbleParameters: parseResult.bubbles,
|
|
136
|
+
variableTypes,
|
|
69
137
|
};
|
|
70
138
|
}
|
|
71
139
|
catch (error) {
|
|
@@ -113,4 +181,158 @@ function validateBubbleFlowClass(sourceFile) {
|
|
|
113
181
|
errors: errors.length > 0 ? errors : undefined,
|
|
114
182
|
};
|
|
115
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* Expands a type to show its full structure, not just the type name
|
|
186
|
+
*/
|
|
187
|
+
function expandTypeString(type, typeChecker, sourceFile, visited = new Set()) {
|
|
188
|
+
// Prevent infinite recursion
|
|
189
|
+
if (visited.has(type)) {
|
|
190
|
+
return typeChecker.typeToString(type);
|
|
191
|
+
}
|
|
192
|
+
visited.add(type);
|
|
193
|
+
// Get the base type string
|
|
194
|
+
const baseTypeString = typeChecker.typeToString(type);
|
|
195
|
+
// If it's an object type, expand it to show properties
|
|
196
|
+
if (type.isClassOrInterface() || type.getSymbol()) {
|
|
197
|
+
const symbol = type.getSymbol();
|
|
198
|
+
if (symbol) {
|
|
199
|
+
// Check if it's a type alias or interface that we should expand
|
|
200
|
+
const declarations = symbol.getDeclarations();
|
|
201
|
+
if (declarations && declarations.length > 0) {
|
|
202
|
+
const declaration = declarations[0];
|
|
203
|
+
// If it's a type alias, try to get the aliased type
|
|
204
|
+
if (ts.isTypeAliasDeclaration(declaration)) {
|
|
205
|
+
const aliasedType = typeChecker.getTypeAtLocation(declaration.type);
|
|
206
|
+
if (aliasedType !== type) {
|
|
207
|
+
const expanded = expandTypeString(aliasedType, typeChecker, sourceFile, visited);
|
|
208
|
+
// Only use expanded if it's different and more detailed
|
|
209
|
+
if (expanded !== baseTypeString &&
|
|
210
|
+
expanded.length > baseTypeString.length) {
|
|
211
|
+
return expanded;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// For object types, try to get a more detailed representation
|
|
218
|
+
const properties = type.getProperties();
|
|
219
|
+
if (properties.length > 0) {
|
|
220
|
+
// Check if the type string is just the name (not expanded)
|
|
221
|
+
// If it's a simple name without braces, try to expand it
|
|
222
|
+
if (!baseTypeString.includes('{') &&
|
|
223
|
+
!baseTypeString.includes('[') &&
|
|
224
|
+
!baseTypeString.includes('|')) {
|
|
225
|
+
// Try to get the expanded type by checking the type's structure
|
|
226
|
+
const expandedParts = [];
|
|
227
|
+
for (const prop of properties.slice(0, 20)) {
|
|
228
|
+
// Limit to 20 properties to avoid huge output
|
|
229
|
+
const propDeclaration = prop.valueDeclaration || prop.getDeclarations()?.[0] || sourceFile;
|
|
230
|
+
const propType = typeChecker.getTypeOfSymbolAtLocation(prop, propDeclaration);
|
|
231
|
+
const propTypeString = expandTypeString(propType, typeChecker, sourceFile, new Set(visited));
|
|
232
|
+
const optional = prop.getFlags() & ts.SymbolFlags.Optional ? '?' : '';
|
|
233
|
+
expandedParts.push(`${prop.getName()}${optional}: ${propTypeString}`);
|
|
234
|
+
}
|
|
235
|
+
if (expandedParts.length > 0) {
|
|
236
|
+
const remaining = properties.length > 20 ? `... ${properties.length - 20} more` : '';
|
|
237
|
+
return `{ ${expandedParts.join('; ')}${remaining ? `; ${remaining}` : ''} }`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// For union types, expand each member
|
|
243
|
+
if (type.isUnion()) {
|
|
244
|
+
const unionTypes = type.types.map((t) => expandTypeString(t, typeChecker, sourceFile, new Set(visited)));
|
|
245
|
+
return unionTypes.join(' | ');
|
|
246
|
+
}
|
|
247
|
+
// For intersection types, expand each member
|
|
248
|
+
if (type.isIntersection()) {
|
|
249
|
+
const intersectionTypes = type.types.map((t) => expandTypeString(t, typeChecker, sourceFile, new Set(visited)));
|
|
250
|
+
return intersectionTypes.join(' & ');
|
|
251
|
+
}
|
|
252
|
+
return baseTypeString;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Extracts type definitions for all variables in the source file
|
|
256
|
+
*/
|
|
257
|
+
function extractVariableTypes(sourceFile, program) {
|
|
258
|
+
if (!program) {
|
|
259
|
+
return [];
|
|
260
|
+
}
|
|
261
|
+
const typeChecker = program.getTypeChecker();
|
|
262
|
+
const variableTypes = [];
|
|
263
|
+
function visit(node) {
|
|
264
|
+
// Extract variable declarations
|
|
265
|
+
if (ts.isVariableDeclaration(node)) {
|
|
266
|
+
const name = node.name;
|
|
267
|
+
if (ts.isIdentifier(name)) {
|
|
268
|
+
const variableName = name.text;
|
|
269
|
+
const type = typeChecker.getTypeAtLocation(node);
|
|
270
|
+
const typeString = expandTypeString(type, typeChecker, sourceFile);
|
|
271
|
+
// Get position information
|
|
272
|
+
const position = name.getStart(sourceFile);
|
|
273
|
+
const { line, character } = ts.getLineAndCharacterOfPosition(sourceFile, position);
|
|
274
|
+
variableTypes.push({
|
|
275
|
+
name: variableName,
|
|
276
|
+
type: typeString,
|
|
277
|
+
line: line + 1,
|
|
278
|
+
column: character + 1,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
else if (ts.isObjectBindingPattern(name) ||
|
|
282
|
+
ts.isArrayBindingPattern(name)) {
|
|
283
|
+
// Handle destructuring patterns (e.g., const { a, b } = ... or const [a, b] = ...)
|
|
284
|
+
name.elements.forEach((element) => {
|
|
285
|
+
if (ts.isBindingElement(element) && element.name) {
|
|
286
|
+
if (ts.isIdentifier(element.name)) {
|
|
287
|
+
const variableName = element.name.text;
|
|
288
|
+
const type = typeChecker.getTypeAtLocation(element);
|
|
289
|
+
const typeString = expandTypeString(type, typeChecker, sourceFile);
|
|
290
|
+
const position = element.name.getStart(sourceFile);
|
|
291
|
+
const { line, character } = ts.getLineAndCharacterOfPosition(sourceFile, position);
|
|
292
|
+
variableTypes.push({
|
|
293
|
+
name: variableName,
|
|
294
|
+
type: typeString,
|
|
295
|
+
line: line + 1,
|
|
296
|
+
column: character + 1,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// Extract function parameters
|
|
304
|
+
if (ts.isParameter(node) && ts.isIdentifier(node.name)) {
|
|
305
|
+
const parameterName = node.name.text;
|
|
306
|
+
const type = typeChecker.getTypeAtLocation(node);
|
|
307
|
+
const typeString = expandTypeString(type, typeChecker, sourceFile);
|
|
308
|
+
const position = node.name.getStart(sourceFile);
|
|
309
|
+
const { line, character } = ts.getLineAndCharacterOfPosition(sourceFile, position);
|
|
310
|
+
variableTypes.push({
|
|
311
|
+
name: parameterName,
|
|
312
|
+
type: typeString,
|
|
313
|
+
line: line + 1,
|
|
314
|
+
column: character + 1,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
// Extract class properties
|
|
318
|
+
if (ts.isPropertyDeclaration(node) && node.name) {
|
|
319
|
+
if (ts.isIdentifier(node.name)) {
|
|
320
|
+
const propertyName = node.name.text;
|
|
321
|
+
const type = typeChecker.getTypeAtLocation(node);
|
|
322
|
+
const typeString = expandTypeString(type, typeChecker, sourceFile);
|
|
323
|
+
const position = node.name.getStart(sourceFile);
|
|
324
|
+
const { line, character } = ts.getLineAndCharacterOfPosition(sourceFile, position);
|
|
325
|
+
variableTypes.push({
|
|
326
|
+
name: propertyName,
|
|
327
|
+
type: typeString,
|
|
328
|
+
line: line + 1,
|
|
329
|
+
column: character + 1,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
ts.forEachChild(node, visit);
|
|
334
|
+
}
|
|
335
|
+
visit(sourceFile);
|
|
336
|
+
return variableTypes;
|
|
337
|
+
}
|
|
116
338
|
//# sourceMappingURL=bubbleflow-validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bubbleflow-validation.js","sourceRoot":"","sources":["../../src/utils/bubbleflow-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAUzD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,aAA4B;IAE5B,IAAI,CAAC;QACH,kDAAkD;QAClD,MAAM,QAAQ,GAAG,qBAAqB,CAAC;QAEvC,kEAAkE;QAClE,MAAM,eAAe,GAAuB;YAC1C,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;YAC9B,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM;YAC5B,gBAAgB,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO;YACjD,4BAA4B,EAAE,IAAI;YAClC,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,IAAI;YACZ,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,IAAI;YAClB,oBAAoB,EAAE,IAAI;YAC1B,KAAK,EAAE;gBACL,wBAAwB,EAAE,CAAC,gCAAgC,CAAC;aAC7D;YACD,OAAO,EAAE,GAAG;SACb,CAAC;QAEF,iCAAiC;QACjC,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,IAAI,EACJ,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;QAEF,iBAAiB;QACjB,MAAM,IAAI,GAAG,EAAE,CA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,SAAS,EAAE,GAAG,EAAE,CAAC,6BAA6B,CAC1D,UAAU,EACV,QAAQ,CACT,CAAC;gBAEF,aAAa,CAAC,IAAI,CAAC;oBACjB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,IAAI,GAAG,CAAC;oBACd,MAAM,EAAE,SAAS,GAAG,CAAC;iBACtB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,CAAC;IAElB,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitizes error messages to remove sensitive credential information
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sanitizes error stack traces
|
|
6
|
+
*/
|
|
7
|
+
export declare function sanitizeErrorStack(error: Error | undefined): string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Sanitizes error messages
|
|
10
|
+
*/
|
|
11
|
+
export declare function sanitizeErrorMessage(message: string): string;
|
|
12
|
+
//# sourceMappingURL=error-sanitizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-sanitizer.d.ts","sourceRoot":"","sources":["../../src/utils/error-sanitizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwFH;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,GAAG,SAAS,GACvB,MAAM,GAAG,SAAS,CAGpB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitizes error messages to remove sensitive credential information
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sanitizes a string to remove credential patterns
|
|
6
|
+
*/
|
|
7
|
+
function sanitizeString(str) {
|
|
8
|
+
if (!str)
|
|
9
|
+
return str;
|
|
10
|
+
let sanitized = str;
|
|
11
|
+
// Common credential field name patterns (case-insensitive)
|
|
12
|
+
const credentialFieldPatterns = [
|
|
13
|
+
'api[_-]?key',
|
|
14
|
+
'access[_-]?key',
|
|
15
|
+
'secret[_-]?key',
|
|
16
|
+
'secret',
|
|
17
|
+
'token',
|
|
18
|
+
'password',
|
|
19
|
+
'passwd',
|
|
20
|
+
'pwd',
|
|
21
|
+
'auth[_-]?token',
|
|
22
|
+
'bearer[_-]?token',
|
|
23
|
+
'account[_-]?id',
|
|
24
|
+
'client[_-]?id',
|
|
25
|
+
'client[_-]?secret',
|
|
26
|
+
'private[_-]?key',
|
|
27
|
+
'public[_-]?key',
|
|
28
|
+
'api[_-]?secret',
|
|
29
|
+
'credential',
|
|
30
|
+
'auth',
|
|
31
|
+
'authentication',
|
|
32
|
+
];
|
|
33
|
+
// Create pattern to match any credential field name
|
|
34
|
+
const credentialPattern = new RegExp(`(${credentialFieldPatterns.join('|')})["\\s]*:["\\s]*(["'])([^"']+)\\2`, 'gi');
|
|
35
|
+
// Replace credential values with [REDACTED]
|
|
36
|
+
sanitized = sanitized.replace(credentialPattern, (match, fieldName, quote, value) => {
|
|
37
|
+
// Only replace if it looks like a credential value (long alphanumeric/hex string)
|
|
38
|
+
if (value.length > 8 && /^[a-zA-Z0-9+/\-=]+$/.test(value)) {
|
|
39
|
+
return `${fieldName}: ${quote}[REDACTED]${quote}`;
|
|
40
|
+
}
|
|
41
|
+
return match;
|
|
42
|
+
});
|
|
43
|
+
// Sanitize entire credentials objects that might be in the error
|
|
44
|
+
// Match: credentials: { ... }
|
|
45
|
+
sanitized = sanitized.replace(/credentials["\s]*:["\s]*\{[^}]*\}/gi, 'credentials: { [REDACTED] }');
|
|
46
|
+
// Sanitize any object literal that contains credential-like keys
|
|
47
|
+
// This catches objects like { CLOUDFLARE_R2_ACCESS_KEY: "...", ... }
|
|
48
|
+
sanitized = sanitized.replace(/\{[^}]*\b(?:API[_-]?KEY|ACCESS[_-]?KEY|SECRET[_-]?KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL)\b[^}]*\}/gi, (match) => {
|
|
49
|
+
// Replace all values in this object that look like credentials
|
|
50
|
+
return match.replace(/([\w_]+)["\s]*:["\s]*(["'])([^"']+)\2/g, (fullMatch, key, quote, value) => {
|
|
51
|
+
// Check if the key looks like a credential field
|
|
52
|
+
const isCredentialKey = credentialFieldPatterns.some((pattern) => new RegExp(pattern, 'i').test(key));
|
|
53
|
+
// Check if the value looks like a credential
|
|
54
|
+
const isCredentialValue = value.length > 8 && /^[a-zA-Z0-9+/\-=]+$/.test(value);
|
|
55
|
+
if (isCredentialKey || isCredentialValue) {
|
|
56
|
+
return `${key}: ${quote}[REDACTED]${quote}`;
|
|
57
|
+
}
|
|
58
|
+
return fullMatch;
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return sanitized;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Sanitizes error stack traces
|
|
65
|
+
*/
|
|
66
|
+
export function sanitizeErrorStack(error) {
|
|
67
|
+
if (!error || !error.stack)
|
|
68
|
+
return error?.stack;
|
|
69
|
+
return sanitizeString(error.stack);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Sanitizes error messages
|
|
73
|
+
*/
|
|
74
|
+
export function sanitizeErrorMessage(message) {
|
|
75
|
+
return sanitizeString(message);
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=error-sanitizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-sanitizer.js","sourceRoot":"","sources":["../../src/utils/error-sanitizer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IAErB,IAAI,SAAS,GAAG,GAAG,CAAC;IAEpB,2DA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,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACnC,CAAC;YAEF,6CAA6C;YAC7C,MAAM,iBAAiB,GACrB,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAExD,IAAI,eAAe,IAAI,iBAAiB,EAAE,CAAC;gBACzC,OAAO,GAAG,GAAG,KAAK,KAAK,aAAa,KAAK,EAAE,CAAC;YAC9C,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC,CACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAwB;IAExB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK;QAAE,OAAO,KAAK,EAAE,KAAK,CAAC;IAChD,OAAO,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-parsing.d.ts","sourceRoot":"","sources":["../../src/utils/json-parsing.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"json-parsing.d.ts","sourceRoot":"","sources":["../../src/utils/json-parsing.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6aH;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoEhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA4I1D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAwHA"}
|
|
@@ -1,6 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON parsing utilities extracted from AI Agent for reusability and testing
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if input has an incomplete code block (opening fence but no closing fence)
|
|
6
|
+
*/
|
|
7
|
+
function hasIncompleteCodeBlock(input) {
|
|
8
|
+
const codeFencePattern = /```(?:json)?\s*\n?/g;
|
|
9
|
+
const matches = [...input.matchAll(codeFencePattern)];
|
|
10
|
+
if (matches.length === 0)
|
|
11
|
+
return false;
|
|
12
|
+
// Count opening and closing fences
|
|
13
|
+
let openCount = 0;
|
|
14
|
+
let closeCount = 0;
|
|
15
|
+
for (const match of matches) {
|
|
16
|
+
const afterMatch = input.slice(match.index + match[0].length);
|
|
17
|
+
// Check if there's a closing fence after this opening fence
|
|
18
|
+
const closingFenceIndex = afterMatch.search(/```/);
|
|
19
|
+
if (closingFenceIndex !== -1) {
|
|
20
|
+
closeCount++;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
openCount++;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// If we have more opening fences than closing fences, it's incomplete
|
|
27
|
+
return openCount > closeCount;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Check if JSON appears to be embedded in markdown documentation
|
|
31
|
+
* Only rejects if there's substantial documentation text outside the JSON structure
|
|
32
|
+
*/
|
|
33
|
+
function isJsonEmbeddedInDocumentation(input) {
|
|
34
|
+
// First, check if the input is valid JSON as-is (not embedded in documentation)
|
|
35
|
+
try {
|
|
36
|
+
JSON.parse(input);
|
|
37
|
+
// If original input is valid JSON, it's not documentation
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Not parseable as-is, continue checking
|
|
42
|
+
}
|
|
43
|
+
// Check for markdown formatting indicators
|
|
44
|
+
const hasMarkdownFormatting = input.includes('**') ||
|
|
45
|
+
input.includes('*') ||
|
|
46
|
+
input.includes('#') ||
|
|
47
|
+
input.includes('1.') || // numbered lists
|
|
48
|
+
input.includes('-') || // bullet lists
|
|
49
|
+
input.includes('`'); // inline code
|
|
50
|
+
if (!hasMarkdownFormatting)
|
|
51
|
+
return false;
|
|
52
|
+
// Check if there's a code block (complete or incomplete)
|
|
53
|
+
const hasCodeBlock = input.includes('```');
|
|
54
|
+
if (!hasCodeBlock)
|
|
55
|
+
return false;
|
|
56
|
+
// Check if there's substantial text content before or after the code block
|
|
57
|
+
// This indicates it's documentation, not just a JSON response with markdown formatting
|
|
58
|
+
const lines = input.split('\n');
|
|
59
|
+
const codeBlockStartIndex = input.indexOf('```');
|
|
60
|
+
const codeBlockEndIndex = input.lastIndexOf('```');
|
|
61
|
+
// Count non-empty lines before and after code block
|
|
62
|
+
let linesBefore = 0;
|
|
63
|
+
let linesAfter = 0;
|
|
64
|
+
let currentIndex = 0;
|
|
65
|
+
for (let i = 0; i < lines.length; i++) {
|
|
66
|
+
const line = lines[i];
|
|
67
|
+
const lineStart = currentIndex;
|
|
68
|
+
const lineEnd = currentIndex + line.length;
|
|
69
|
+
if (lineStart < codeBlockStartIndex && line.trim().length > 0) {
|
|
70
|
+
linesBefore++;
|
|
71
|
+
}
|
|
72
|
+
else if (lineEnd > codeBlockEndIndex + 3 && line.trim().length > 0) {
|
|
73
|
+
// +3 for the closing ```
|
|
74
|
+
linesAfter++;
|
|
75
|
+
}
|
|
76
|
+
currentIndex = lineEnd + 1; // +1 for the newline character
|
|
77
|
+
}
|
|
78
|
+
// If there are multiple lines of documentation text before or after the code block,
|
|
79
|
+
// it's likely documentation, not a JSON response
|
|
80
|
+
// Even if JSON inside the code block can be parsed, if there's substantial text outside,
|
|
81
|
+
// it's still documentation
|
|
82
|
+
if (linesBefore > 2 || linesAfter > 2) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
// If there's no substantial documentation text outside, try to parse the JSON
|
|
86
|
+
// If we can successfully parse it, it's valid JSON (even if it contains markdown in strings)
|
|
87
|
+
const stripped = stripCodeFences(input);
|
|
88
|
+
const scanned = extractTopLevelJson(stripped);
|
|
89
|
+
if (scanned) {
|
|
90
|
+
try {
|
|
91
|
+
const cleaned = postProcessJSON(scanned);
|
|
92
|
+
JSON.parse(cleaned);
|
|
93
|
+
// If we can parse it and there's no substantial documentation text, it's valid JSON
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// JSON extraction found something but it's not parseable
|
|
98
|
+
// Continue to check if it's documentation
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// If we can't parse JSON and there's markdown formatting, it's likely documentation
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
4
104
|
/**
|
|
5
105
|
* Strip markdown code fences and return inner content.
|
|
6
106
|
*/
|
|
@@ -304,6 +404,24 @@ function removeTrailingCommasOutsideStrings(input) {
|
|
|
304
404
|
* Extract JSON from mixed text/JSON responses with robust cleanup
|
|
305
405
|
*/
|
|
306
406
|
export function extractAndCleanJSON(input) {
|
|
407
|
+
// Check for incomplete code blocks - if found and input looks like documentation,
|
|
408
|
+
// reject it to avoid extracting JSON from markdown documentation
|
|
409
|
+
if (hasIncompleteCodeBlock(input)) {
|
|
410
|
+
// If input has markdown formatting (bullets, headers, multiple lines), it's likely documentation
|
|
411
|
+
const hasMarkdownFormatting = input.includes('**') ||
|
|
412
|
+
input.includes('*') ||
|
|
413
|
+
input.includes('#') ||
|
|
414
|
+
(input.split('\n').length > 5 && input.includes('```'));
|
|
415
|
+
if (hasMarkdownFormatting) {
|
|
416
|
+
// This looks like documentation with an incomplete code block - reject it
|
|
417
|
+
return null;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
// Check for complete code blocks embedded in documentation
|
|
421
|
+
// This catches cases where JSON is in a code block but surrounded by documentation text
|
|
422
|
+
if (isJsonEmbeddedInDocumentation(input)) {
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
307
425
|
const stripped = stripCodeFences(input);
|
|
308
426
|
// Preferred: scan/extract top-level JSON
|
|
309
427
|
const scanned = extractTopLevelJson(stripped);
|
|
@@ -485,6 +603,34 @@ export function postProcessJSON(jsonString) {
|
|
|
485
603
|
* Multi-stage JSON parsing approach with various fallback strategies
|
|
486
604
|
*/
|
|
487
605
|
export function parseJsonWithFallbacks(finalResponse) {
|
|
606
|
+
// Check for incomplete code blocks - if found and input looks like documentation,
|
|
607
|
+
// reject it early to avoid extracting JSON from markdown documentation
|
|
608
|
+
if (hasIncompleteCodeBlock(finalResponse)) {
|
|
609
|
+
// If input has markdown formatting (bullets, headers, multiple lines), it's likely documentation
|
|
610
|
+
const hasMarkdownFormatting = finalResponse.includes('**') ||
|
|
611
|
+
finalResponse.includes('*') ||
|
|
612
|
+
finalResponse.includes('#') ||
|
|
613
|
+
(finalResponse.split('\n').length > 5 && finalResponse.includes('```'));
|
|
614
|
+
if (hasMarkdownFormatting) {
|
|
615
|
+
// This looks like documentation with an incomplete code block - reject it
|
|
616
|
+
return {
|
|
617
|
+
response: finalResponse,
|
|
618
|
+
parsed: null,
|
|
619
|
+
success: false,
|
|
620
|
+
error: 'AI Agent failed to generate valid JSON. Input appears to be markdown documentation with an incomplete code block, not valid JSON.',
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
// Check for complete code blocks embedded in documentation
|
|
625
|
+
// This catches cases where JSON is in a code block but surrounded by documentation text
|
|
626
|
+
if (isJsonEmbeddedInDocumentation(finalResponse)) {
|
|
627
|
+
return {
|
|
628
|
+
response: finalResponse,
|
|
629
|
+
parsed: null,
|
|
630
|
+
success: false,
|
|
631
|
+
error: 'AI Agent failed to generate valid JSON. Input appears to be markdown documentation with a code block, not valid JSON.',
|
|
632
|
+
};
|
|
633
|
+
}
|
|
488
634
|
const attempts = [
|
|
489
635
|
// Attempt 1: Try parsing the original response as-is
|
|
490
636
|
() => {
|