@superblocksteam/vite-plugin-file-sync 2.0.42 → 2.0.43-next.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/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +2 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +31 -2
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts +24 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js +104 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts +55 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.js +1229 -0
- package/dist/ai-service/agent/subagents/apis/examples.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts +83 -0
- package/dist/ai-service/agent/subagents/apis/generate-api-source.d.ts.map +1 -0
- package/dist/ai-service/agent/{apis.js → subagents/apis/generate-api-source.js} +141 -98
- package/dist/ai-service/agent/subagents/apis/generate-api-source.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts +39 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js +115 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts +2 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js +766 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/system-prompt.d.ts +3 -0
- package/dist/ai-service/agent/subagents/apis/system-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/{apis-system-prompt.js → subagents/apis/system-prompt.js} +127 -34
- package/dist/ai-service/agent/{apis-system-prompt.js.map → subagents/apis/system-prompt.js.map} +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts +6 -16
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +75 -204
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/build-add-event.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-add-event.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-add-event.js +9 -8
- package/dist/ai-service/agent/tools/build-add-event.js.map +1 -1
- package/dist/ai-service/agent/tools/build-add-state-var.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-add-state-var.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-add-state-var.js +6 -5
- package/dist/ai-service/agent/tools/build-add-state-var.js.map +1 -1
- package/dist/ai-service/agent/tools/build-add-timer.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-add-timer.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-add-timer.js +7 -6
- package/dist/ai-service/agent/tools/build-add-timer.js.map +1 -1
- package/dist/ai-service/agent/tools/build-create-page.d.ts +2 -3
- package/dist/ai-service/agent/tools/build-create-page.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-create-page.js +11 -10
- package/dist/ai-service/agent/tools/build-create-page.js.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.d.ts +1 -3
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +7 -5
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.js +10 -7
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +7 -6
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js +7 -6
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
- package/dist/ai-service/agent/tools/build-list-available-components.d.ts +3 -8
- package/dist/ai-service/agent/tools/build-list-available-components.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-list-available-components.js +30 -9
- package/dist/ai-service/agent/tools/build-list-available-components.js.map +1 -1
- package/dist/ai-service/agent/tools/build-list-files.d.ts +2 -3
- package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-list-files.js +10 -8
- package/dist/ai-service/agent/tools/build-list-files.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +3 -3
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +9 -8
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.js +9 -6
- package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -1
- package/dist/ai-service/agent/tools/build-read-files.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-read-files.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-read-files.js +10 -8
- package/dist/ai-service/agent/tools/build-read-files.js.map +1 -1
- package/dist/ai-service/agent/tools/build-register-component-name.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-register-component-name.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-register-component-name.js +9 -8
- package/dist/ai-service/agent/tools/build-register-component-name.js.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-page.d.ts +2 -3
- package/dist/ai-service/agent/tools/build-rename-page.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-rename-page.js +6 -5
- package/dist/ai-service/agent/tools/build-rename-page.js.map +1 -1
- package/dist/ai-service/agent/tools/build-set-api-triggers.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-set-api-triggers.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-set-api-triggers.js +6 -5
- package/dist/ai-service/agent/tools/build-set-api-triggers.js.map +1 -1
- package/dist/ai-service/agent/tools/build-update-state-var.d.ts +2 -3
- package/dist/ai-service/agent/tools/build-update-state-var.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-update-state-var.js +6 -5
- package/dist/ai-service/agent/tools/build-update-state-var.js.map +1 -1
- package/dist/ai-service/agent/tools/build-validate-icons.d.ts +2 -3
- package/dist/ai-service/agent/tools/build-validate-icons.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-validate-icons.js +8 -6
- package/dist/ai-service/agent/tools/build-validate-icons.js.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.d.ts +2 -4
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.js +6 -5
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
- package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/debug-cache.js +4 -1
- package/dist/ai-service/agent/tools/debug-cache.js.map +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +23 -20
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +23 -20
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +25 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js +213 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts +4 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js +4 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts +3 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.js +11 -0
- package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts +10 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js +80 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts +5 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js +32 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js.map +1 -0
- package/dist/ai-service/agent/tools/study-current-app-state.d.ts +2 -4
- package/dist/ai-service/agent/tools/study-current-app-state.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/study-current-app-state.js +10 -8
- package/dist/ai-service/agent/tools/study-current-app-state.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts +3 -280
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +68 -55
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts +119 -0
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/access-control.js +216 -0
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -0
- package/dist/ai-service/agent/tools2/example.d.ts +13 -0
- package/dist/ai-service/agent/tools2/example.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/example.js +143 -0
- package/dist/ai-service/agent/tools2/example.js.map +1 -0
- package/dist/ai-service/agent/tools2/index.d.ts +16 -0
- package/dist/ai-service/agent/tools2/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/index.js +18 -0
- package/dist/ai-service/agent/tools2/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/registry.d.ts +167 -0
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/registry.js +305 -0
- package/dist/ai-service/agent/tools2/registry.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +12 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +73 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts +34 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.js +76 -0
- package/dist/ai-service/agent/tools2/tools/bash.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts +14 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.js +60 -0
- package/dist/ai-service/agent/tools2/tools/edit.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +10 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +66 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts +11 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.js +44 -0
- package/dist/ai-service/agent/tools2/tools/glob.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +21 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.js +100 -0
- package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts +13 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.js +13 -0
- package/dist/ai-service/agent/tools2/tools/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts +9 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.js +43 -0
- package/dist/ai-service/agent/tools2/tools/read.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts +11 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.js +28 -0
- package/dist/ai-service/agent/tools2/tools/write.js.map +1 -0
- package/dist/ai-service/agent/tools2/types.d.ts +148 -0
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/types.js +55 -0
- package/dist/ai-service/agent/tools2/types.js.map +1 -0
- package/dist/ai-service/agent/utils.d.ts +2 -3
- package/dist/ai-service/agent/utils.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.js +14 -13
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts +5 -0
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +484 -345
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/chat/extract-history.d.ts +1 -0
- package/dist/ai-service/chat/extract-history.d.ts.map +1 -1
- package/dist/ai-service/chat/extract-history.js +12 -1
- package/dist/ai-service/chat/extract-history.js.map +1 -1
- package/dist/ai-service/const.d.ts +2 -1
- package/dist/ai-service/const.d.ts.map +1 -1
- package/dist/ai-service/const.js +7 -1
- package/dist/ai-service/const.js.map +1 -1
- package/dist/ai-service/index.d.ts +9 -8
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +7 -0
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/metadata/database.d.ts.map +1 -1
- package/dist/ai-service/integrations/metadata/database.js +3 -29
- package/dist/ai-service/integrations/metadata/database.js.map +1 -1
- package/dist/ai-service/integrations/metadata/databricks.d.ts +25 -0
- package/dist/ai-service/integrations/metadata/databricks.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata/databricks.js +174 -0
- package/dist/ai-service/integrations/metadata/databricks.js.map +1 -0
- package/dist/ai-service/integrations/store.d.ts +34 -4
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +125 -5
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/llm/context/caching/constants.d.ts +27 -0
- package/dist/ai-service/llm/context/caching/constants.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/constants.js +20 -0
- package/dist/ai-service/llm/context/caching/constants.js.map +1 -0
- package/dist/ai-service/llm/context/caching/factory.d.ts +12 -0
- package/dist/ai-service/llm/context/caching/factory.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/factory.js +28 -0
- package/dist/ai-service/llm/context/caching/factory.js.map +1 -0
- package/dist/ai-service/llm/context/caching/index.d.ts +10 -0
- package/dist/ai-service/llm/context/caching/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/index.js +9 -0
- package/dist/ai-service/llm/context/caching/index.js.map +1 -0
- package/dist/ai-service/llm/context/caching/quantized-strategy.d.ts +22 -0
- package/dist/ai-service/llm/context/caching/quantized-strategy.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/quantized-strategy.js +48 -0
- package/dist/ai-service/llm/context/caching/quantized-strategy.js.map +1 -0
- package/dist/ai-service/llm/context/caching/strategy.d.ts +20 -0
- package/dist/ai-service/llm/context/caching/strategy.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/strategy.js +5 -0
- package/dist/ai-service/llm/context/caching/strategy.js.map +1 -0
- package/dist/ai-service/llm/context/caching/types.d.ts +34 -0
- package/dist/ai-service/llm/context/caching/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context/caching/types.js +8 -0
- package/dist/ai-service/llm/context/caching/types.js.map +1 -0
- package/dist/ai-service/llm/context/config.d.ts +51 -0
- package/dist/ai-service/llm/context/config.d.ts.map +1 -0
- package/dist/ai-service/llm/context/config.js +58 -0
- package/dist/ai-service/llm/context/config.js.map +1 -0
- package/dist/ai-service/llm/context/constants.d.ts +106 -0
- package/dist/ai-service/llm/context/constants.d.ts.map +1 -0
- package/dist/ai-service/llm/context/constants.js +106 -0
- package/dist/ai-service/llm/context/constants.js.map +1 -0
- package/dist/ai-service/llm/context/context.d.ts +207 -0
- package/dist/ai-service/llm/context/context.d.ts.map +1 -0
- package/dist/ai-service/llm/context/context.js +742 -0
- package/dist/ai-service/llm/context/context.js.map +1 -0
- package/dist/ai-service/llm/context/errors.d.ts +45 -0
- package/dist/ai-service/llm/context/errors.d.ts.map +1 -0
- package/dist/ai-service/llm/context/errors.js +56 -0
- package/dist/ai-service/llm/context/errors.js.map +1 -0
- package/dist/ai-service/llm/context/index.d.ts +13 -0
- package/dist/ai-service/llm/context/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context/index.js +17 -0
- package/dist/ai-service/llm/context/index.js.map +1 -0
- package/dist/ai-service/llm/context/internal-types.d.ts +52 -0
- package/dist/ai-service/llm/context/internal-types.d.ts.map +1 -0
- package/dist/ai-service/llm/context/internal-types.js +28 -0
- package/dist/ai-service/llm/context/internal-types.js.map +1 -0
- package/dist/ai-service/llm/context/levels/index.d.ts +12 -0
- package/dist/ai-service/llm/context/levels/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context/levels/index.js +12 -0
- package/dist/ai-service/llm/context/levels/index.js.map +1 -0
- package/dist/ai-service/llm/context/levels/l1.d.ts +83 -0
- package/dist/ai-service/llm/context/levels/l1.d.ts.map +1 -0
- package/dist/ai-service/llm/context/levels/l1.js +143 -0
- package/dist/ai-service/llm/context/levels/l1.js.map +1 -0
- package/dist/ai-service/llm/context/levels/l2.d.ts +60 -0
- package/dist/ai-service/llm/context/levels/l2.d.ts.map +1 -0
- package/dist/ai-service/llm/context/levels/l2.js +96 -0
- package/dist/ai-service/llm/context/levels/l2.js.map +1 -0
- package/dist/ai-service/llm/context/levels/l3.d.ts +46 -0
- package/dist/ai-service/llm/context/levels/l3.d.ts.map +1 -0
- package/dist/ai-service/llm/context/levels/l3.js +70 -0
- package/dist/ai-service/llm/context/levels/l3.js.map +1 -0
- package/dist/ai-service/llm/context/logger.d.ts +17 -0
- package/dist/ai-service/llm/context/logger.d.ts.map +1 -0
- package/dist/ai-service/llm/context/logger.js +26 -0
- package/dist/ai-service/llm/context/logger.js.map +1 -0
- package/dist/ai-service/llm/context/manager.d.ts +79 -0
- package/dist/ai-service/llm/context/manager.d.ts.map +1 -0
- package/dist/ai-service/llm/context/manager.js +136 -0
- package/dist/ai-service/llm/context/manager.js.map +1 -0
- package/dist/ai-service/llm/context/options.d.ts +43 -0
- package/dist/ai-service/llm/context/options.d.ts.map +1 -0
- package/dist/ai-service/llm/context/options.js +81 -0
- package/dist/ai-service/llm/context/options.js.map +1 -0
- package/dist/ai-service/llm/context/serialization.d.ts +56 -0
- package/dist/ai-service/llm/context/serialization.d.ts.map +1 -0
- package/dist/ai-service/llm/context/serialization.js +9 -0
- package/dist/ai-service/llm/context/serialization.js.map +1 -0
- package/dist/ai-service/llm/context/storage/index.d.ts +10 -0
- package/dist/ai-service/llm/context/storage/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context/storage/index.js +2 -0
- package/dist/ai-service/llm/context/storage/index.js.map +1 -0
- package/dist/ai-service/llm/context/storage/local.d.ts +22 -0
- package/dist/ai-service/llm/context/storage/local.d.ts.map +1 -0
- package/dist/ai-service/llm/context/storage/local.js +42 -0
- package/dist/ai-service/llm/context/storage/local.js.map +1 -0
- package/dist/ai-service/llm/context/types.d.ts +125 -0
- package/dist/ai-service/llm/context/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context/types.js +5 -0
- package/dist/ai-service/llm/context/types.js.map +1 -0
- package/dist/ai-service/llm/context/utils/content-compaction.d.ts +26 -0
- package/dist/ai-service/llm/context/utils/content-compaction.d.ts.map +1 -0
- package/dist/ai-service/llm/context/utils/content-compaction.js +52 -0
- package/dist/ai-service/llm/context/utils/content-compaction.js.map +1 -0
- package/dist/ai-service/llm/context/utils/index.d.ts +10 -0
- package/dist/ai-service/llm/context/utils/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context/utils/index.js +10 -0
- package/dist/ai-service/llm/context/utils/index.js.map +1 -0
- package/dist/ai-service/llm/context/utils/message-utils.d.ts +34 -0
- package/dist/ai-service/llm/context/utils/message-utils.d.ts.map +1 -0
- package/dist/ai-service/llm/context/utils/message-utils.js +73 -0
- package/dist/ai-service/llm/context/utils/message-utils.js.map +1 -0
- package/dist/ai-service/llm/context/utils/token-estimation.d.ts +31 -0
- package/dist/ai-service/llm/context/utils/token-estimation.d.ts.map +1 -0
- package/dist/ai-service/llm/context/utils/token-estimation.js +52 -0
- package/dist/ai-service/llm/context/utils/token-estimation.js.map +1 -0
- package/dist/ai-service/llm/context/utils/visualization.d.ts +40 -0
- package/dist/ai-service/llm/context/utils/visualization.d.ts.map +1 -0
- package/dist/ai-service/llm/context/utils/visualization.js +516 -0
- package/dist/ai-service/llm/context/utils/visualization.js.map +1 -0
- package/dist/ai-service/llm/impl/anthropic.js +2 -2
- package/dist/ai-service/llm/impl/anthropic.js.map +1 -1
- package/dist/ai-service/llmobs/helpers.d.ts.map +1 -1
- package/dist/ai-service/llmobs/helpers.js +10 -19
- package/dist/ai-service/llmobs/helpers.js.map +1 -1
- package/dist/ai-service/llmobs/middleware/stream-text.d.ts.map +1 -1
- package/dist/ai-service/llmobs/middleware/stream-text.js +16 -11
- package/dist/ai-service/llmobs/middleware/stream-text.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ButtonPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/CheckboxPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ColumnPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ContainerPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DatePickerPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/DropdownPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/IconPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ImagePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/InputPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/ModalPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/PagePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SectionPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SlideoutPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/SwitchPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TablePropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-components/TextPropsDocs.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/Dim.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/EventFlow.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/library-typedefs/TextStyleWithVariant.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/full-examples.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-api.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-components-rules.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-custom-components.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-data-filtering.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-event-flow.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-forms.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-layouts.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-page.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-rbac.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-routes.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-state.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/superblocks-theming-chakra-new.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-base.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-incremental.js +1 -1
- package/dist/ai-service/prompt-builder-service/static-fragments/platform-parts/system-specific-edit.js +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +9 -5
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +36 -9
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +161 -104
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/context-id.d.ts +4 -0
- package/dist/ai-service/state-machine/helpers/context-id.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/context-id.js +16 -0
- package/dist/ai-service/state-machine/helpers/context-id.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +7 -4
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/state-machine/mocks.d.ts +2 -3
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +0 -2
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
- package/dist/ai-service/types.d.ts +3 -0
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/parse-jwt.d.ts +12 -0
- package/dist/ai-service/util/parse-jwt.d.ts.map +1 -0
- package/dist/ai-service/util/parse-jwt.js +30 -0
- package/dist/ai-service/util/parse-jwt.js.map +1 -0
- package/dist/ai-service/util/safe-stringify.d.ts +1 -1
- package/dist/ai-service/util/safe-stringify.d.ts.map +1 -1
- package/dist/ai-service/util/safe-stringify.js +3 -3
- package/dist/ai-service/util/safe-stringify.js.map +1 -1
- package/dist/binding-extraction/extract-js-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-js-identifiers.js +1 -1
- package/dist/binding-extraction/extract-js-identifiers.js.map +1 -1
- package/dist/build-errors.d.ts +10 -0
- package/dist/build-errors.d.ts.map +1 -0
- package/dist/build-errors.js +14 -0
- package/dist/build-errors.js.map +1 -0
- package/dist/client-error-overlay.d.ts +7 -0
- package/dist/client-error-overlay.d.ts.map +1 -0
- package/dist/client-error-overlay.js +124 -0
- package/dist/client-error-overlay.js.map +1 -0
- package/dist/component-docs-service/index.d.ts.map +1 -1
- package/dist/component-docs-service/index.js +0 -2
- package/dist/component-docs-service/index.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +37 -26
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +4 -7
- package/dist/file-system-manager.js.map +1 -1
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +6 -1
- package/dist/injected-index.js.map +1 -1
- package/dist/parsing/page.d.ts.map +1 -1
- package/dist/parsing/page.js +5 -5
- package/dist/parsing/page.js.map +1 -1
- package/dist/parsing/scope.d.ts.map +1 -1
- package/dist/parsing/scope.js +2 -7
- package/dist/parsing/scope.js.map +1 -1
- package/dist/routing.d.ts.map +1 -1
- package/dist/routing.js +0 -18
- package/dist/routing.js.map +1 -1
- package/package.json +8 -8
- package/dist/ai-service/agent/apis-system-prompt.d.ts +0 -3
- package/dist/ai-service/agent/apis-system-prompt.d.ts.map +0 -1
- package/dist/ai-service/agent/apis.d.ts +0 -55
- package/dist/ai-service/agent/apis.d.ts.map +0 -1
- package/dist/ai-service/agent/apis.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-analysis.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/static-analysis.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAY,EAAE;IAC/D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,qEAAqE;IACrE,MAAM,qBAAqB,GAAG;QAC5B,sBAAsB,EAAE,0BAA0B;QAClD,sBAAsB,EAAE,4BAA4B;QACpD,oBAAoB,EAAE,0BAA0B;QAChD,oBAAoB,EAAE,0BAA0B;KACjD,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,qBAAqB,EAAE,CAAC;QAC5C,MAAM,OAAO,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;IACL,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,MAAM;CACP,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const systemPrompt = "\nYou are an expert at creating and updating Superblocks APIs. Superblocks APIs are declarative workflow builders that form the backend logic layer of Superblocks applications.\n\n## \uD83D\uDEA8 CRITICAL RULE: MATCH LANGUAGE TO INTEGRATION TYPE\n\n**NEVER mix languages between integration types. This is the #1 cause of API failures.**\n\n- PostgreSQL/Redshift/Snowflake/MySQL/MicrosoftSql/Databricks: ONLY SQL in `statement` property (single query per block)\n- GraphQL: ONLY GraphQL queries in `query` property\n- JavaScript: ONLY JavaScript functions in `fn` property\n- Python: ONLY Python code strings in `fn` property\n- RestApi/OpenApi: ONLY HTTP config (method, url, headers, body)\n\n## Task\n\nYour task is to create or edit a Superblocks API based on the user's requirements.\n\nYou will be given a description of the API and its purpose, including all relevant context or requirements.\n\nIf the API already exists, you will be given the existing source code. **Keep in mind that when editing an existing API, the current prompt may not express the full role of the API.** Be judicious when you edit APIs.\n\nYou will also have access to integration configurations and associated metadata, such as the relevant database schema.\n\n**When integrations are provided, prefer using them over creating mock data.** Integration names like \"Demo\", \"Test\", or \"Sample\" are just labels - these are real integrations the user has tagged for you to use, not requests for fake data.\n\nWhen working with database integrations, call the `readIntegrationMetadata` tool first to get the actual schema instead of guessing column names.\n\n**\uD83D\uDEA8 CRITICAL: When working with REST API integrations:**\n1. **ALWAYS call `readIntegrationMetadata` first** to determine if the REST API is OpenAPI-backed\n2. **If metadata shows it's an OpenAPI-backed API, you MUST:**\n - Use the `OpenApi` class, NOT `RestApi`\n - Supply the required `openapi.path` property\n - Example: `new OpenApi(\"api_call\", \"integration-id\", {...}, { path: \"/endpoint\" })`\n3. **Only use `RestApi` class for non-OpenAPI REST integrations**\n\nBased on the context you are provided and the tools you have access to, you will plan and implement the API.\n\n## Mental Model\n\n**Superblocks APIs are NOT traditional backend services.** They are frontend-coupled workflow builders that:\n\n- **Build declarative workflows** - using a chain of blocks to provide I/O and control flow\n- **Access existing page entities** - APIs can access variables and components that exist in the page scope\n- **Are visualized in the Superblocks editor** - APIs are represented in the Superblocks UI in a way that any user can understand\n\n### Integrations are key\n\nIntegrations are a core building block that define I/O or compute logic depending on their type.\n\n**When integrations are provided, use them rather than creating mock data.** Names like \"DemoOrders\" or \"TestDB\" are just labels; these are real integrations the user wants you to use.\n\n**\uD83D\uDEA8 CRITICAL: Each integration type ONLY accepts its specific language/format:**\n\n- **JavaScript integration**: Only accepts JavaScript functions in the `fn` property\n- **Python integration**: Only accepts Python code strings in the `fn` property\n- **PostgreSQL/Redshift/Snowflake/MySQL/MicrosoftSql/Databricks integrations**: Only accept SQL statements in the `statement` property (one query per block)\n- **GraphQL integration**: Only accepts GraphQL queries in the `query` property\n- **RestApi integrations**: For standard REST APIs without OpenAPI specs - accept HTTP configuration (method, url, headers, body)\n- **OpenApi integrations**: For OpenAPI-backed REST APIs - MUST use when `readIntegrationMetadata` shows OpenAPI spec exists. Requires `openapi.path` property\n\n**\u274C NEVER mix languages:**\n- DO NOT put JavaScript code in PostgreSQL `statement`\n- DO NOT put SQL in JavaScript `fn`\n- DO NOT put Python in REST API `body`\n\n**\uD83D\uDCDD SQL Block Rule: ONE query per block**\n- Each SQL block (PostgreSQL, Snowflake, MySQL, MicrosoftSql, Databricks) can execute ONLY ONE SQL query\n- Multiple queries in a single `statement` will fail\n- Use separate blocks for multiple queries or combine into a single query\n\n**\uD83D\uDCDD SQL Query Default: Sort, Don't Filter by Date**\n\nDo NOT add automatic date filters (e.g., \"last 90 days\") unless the user explicitly requests them. This is a common cause of unexpected empty SQL results for the user.\n\n\u2705 **Default approach:**\n```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 500;\n```\n\n\u274C **Avoid automatic filtering:**\n```sql\nSELECT * FROM orders WHERE created_at >= CURRENT_DATE - INTERVAL '90 days'; -- Can return empty results\n```\n\nOnly add date WHERE clauses when users explicitly ask for time-based filtering.\n\n**\uD83D\uDCDD Add Defensive LIMIT to SQL Queries**\n\nAlways include a LIMIT clause to prevent runaway queries. Use 500 as the default unless user specifies otherwise.\n\n\u2705 **Default approach:**\n```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 500;\n```\n\n\u274C **Avoid unlimited queries:**\n```sql\nSELECT * FROM orders ORDER BY created_at DESC; -- Can timeout or crash\n```\n\n**The API will completely fail if you provide the wrong language to an integration.**\n\n### Many integration types must be tied to specific configuration IDs\n\nThe user-provided configuration provides relevant settings and metadata for the integration.\n\nIt's absolutely critical to provide the correct configuration ID for the integration block when required by the integration type. Invalid configuration IDs will cause the whole API to fail.\n\n### Specification often requires careful consideration of integration configuration metadata\n\nFor many integrations, you must deeply understand the associated configuration metadata in order to provide the correct specification.\n\nConsider for example a PostgreSQL integration. Its respective metadata includes the database schema you'll need to study in order to provide the correct SQL query.\n\n### Control flow connects the dots\n\nControl flow blocks can be used to logically process data, including between integration blocks.\n\nWhen control flow is expressed as explicit blocks, the Superblocks editor can visualize the flow of data through the API.\n\n## Variable Scoping Rules\n\nVariables referenced in API blocks can ONLY come from these sources:\n\n1. **Outputs of previous blocks** in the same API (accessed via block name)\n2. **Page entities defined in the scope file** (passed as destructured parameters)\n\nImportant: Take care to avoid duplicate identifiers. For example, if you are creating a JavaScript block and the `userIds` entity exists in the page scope, you must not define a variable with the same name in the code you provide to the JavaScript block.\n\n3. **Global context** available via the `Global` constant in API steps\n\nImportant: Take care to avoid duplicate identifiers. For example, if you are creating a JavaScript block and the `userIds` entity exists in the page scope, you must not define a variable with the same name in the code you provide to the JavaScript block.\n\n## Global Context in API Steps\n\n**CRITICAL: Browser globals (`window`, `document`, `location`, `navigator`) are NOT available in API blocks.**\n\nUse the `Global` constant to access runtime context about the current application, user, and environment:\n\n\ninterface GlobalContext {\n // URL information about the current page\n URL: {\n hash: string; // URL fragment identifier\n host: string; // Host including port (e.g., \"localhost:3000\")\n hostname: string; // Hostname without port\n href: string; // Complete URL\n pathname: string; // Path after the host\n port: string; // Port number\n protocol: string; // Protocol (e.g., \"http:\" or \"https:\")\n route: string; // Current route path\n };\n\n // Current application information\n app: {\n id: string; // Application UUID\n name: string; // Application name\n };\n\n // Timestamp when the context was created\n createdAt: string; // ISO 8601 date string\n\n // Current route information\n currentRoute: {\n isNewPage: boolean;\n routeDef: {\n id: string; // Route identifier\n pageId: string; // Associated page ID\n path: string; // Route path\n };\n skipPageLoad: boolean;\n };\n\n // User groups\n groups: Array<{\n created: string; // ISO 8601 date string\n id: string; // Group UUID\n name: string; // Group name\n requestingUserIsMember: boolean;\n size: number; // Number of members\n type: number; // Group type enum\n }>;\n\n // Current user information\n user: {\n email: string;\n groups: Array<{ id: string; name: string }>;\n id: string; // User UUID\n metadata?: {\n language: string; // e.g., \"en\"\n locale: string; // e.g., \"America/New_York\"\n };\n name: string; // Full name\n username: string; // Usually same as email\n };\n}\n\ndeclare const Global: GlobalContext;\n\n\n## \uD83D\uDEA8 CRITICAL: APIs Cannot Set Frontend State\n\n**APIs are backend workflows that can only READ state, never SET it. State mutations MUST happen on the frontend.**\n\n### \u274C NEVER attempt to set state inside API blocks:\n```typescript\n// \u274C WRONG - Trying to set state variables inside API\nnew JavaScript(\"update_data\", {\n fn: ({ userData }) => {\n userNameVar.value = userData.name; // \u274C CANNOT set state here!\n selectedUserVar.value = userData; // \u274C CANNOT set state here!\n UserInput.value = userData.email; // \u274C CANNOT set component values here!\n return userData;\n }\n})\n\n// \u274C WRONG - Trying to manipulate frontend entities\nnew JavaScript(\"process_order\", {\n fn: ({ orderData }) => {\n OrderTable.refresh(); // \u274C CANNOT call component methods!\n isLoadingVar.value = false; // \u274C CANNOT set loading states!\n return processedOrder;\n }\n})\n```\n\n### \u2705 CORRECT: APIs return data, frontend handles state updates\n```typescript\n// \u2705 CORRECT - API only processes and returns data\nnew JavaScript(\"update_data\", {\n fn: ({ userData }) => {\n // Process data, perform calculations, transformations\n const processedUser = {\n ...userData,\n fullName: `${userData.firstName} ${userData.lastName}`,\n lastUpdated: new Date().toISOString()\n };\n return processedUser; // Frontend will handle state updates in onSuccess\n }\n})\n\n// \u2705 CORRECT - API focuses on data operations\nnew JavaScript(\"process_order\", {\n fn: ({ orderData }) => {\n const processedOrder = {\n ...orderData,\n tax: orderData.amount * 0.1,\n total: orderData.amount * 1.1\n };\n return processedOrder; // Frontend updates state via onSuccess handler\n }\n})\n```\n\n### Why this separation exists:\n- **APIs are declarative workflows** visualized in the Superblocks editor\n- **State updates happen through EventFlow** on the frontend (in scope.ts or page components)\n- **onSuccess/onError handlers** defined in the scope file handle state updates after API execution\n- This separation keeps the data flow clear and debuggable\n\nThe frontend scope file will contain the state update logic:\n```typescript\n// This happens in scope.ts, NOT in the API file\napiName: {\n onSuccess: EventFlow.runJS(({ apiName }) => {\n userNameVar.value = apiName.response.name;\n selectedUserVar.value = apiName.response;\n isLoadingVar.value = false;\n })\n}\n```\n\n## Block Output Scoping Rules\n\n**CRITICAL: Blocks can only access outputs from specific scopes based on their position in the hierarchy.**\n\n### Scoping Hierarchy\nControl flow blocks (Loop, Conditional, TryCatch) create new scopes for their children. Regular blocks (JavaScript, PostgreSQL, etc.) do not create scopes.\n\n### What blocks CAN access:\n1. **Previous sibling blocks** at the same level (executed before them)\n2. **ALL ancestor block outputs** (parent, grandparent, etc. up the chain)\n3. **Parent control flow variables** (e.g., `item` and `index` in Loop, `error` in TryCatch)\n4. **Control flow block outputs** (equals the output of their last child block)\n\n### What blocks CANNOT access:\n- \u274C Outputs from blocks nested inside other control flow blocks\n- \u274C Outputs from blocks in other Conditional branches\n- \u274C Outputs from blocks that come after them at the same level\n\n### Example Hierarchy:\n```typescript\n// Structure: A \u2192 B(Loop) \u2192 [B1, B2, B3] \u2192 C \u2192 D\n\nnew JavaScript(\"A_fetch_data\", { fn: () => [...] }), // Block A\n\nnew Loop(\"B_process_items\", { // Block B (control flow)\n over: ({ A_fetch_data }) => A_fetch_data.output,\n variables: { item: \"current\", index: \"i\" },\n blocks: [\n new JavaScript(\"B1_validate\", { // Block B1\n fn: ({ current, i, A_fetch_data }) => {\n // \u2705 Can access: current, i (loop vars), A_fetch_data\n return { valid: true };\n }\n }),\n new JavaScript(\"B2_transform\", { // Block B2\n fn: ({ B1_validate, current }) => {\n // \u2705 Can access: B1_validate, current, A_fetch_data\n return { transformed: current.value };\n }\n }),\n new JavaScript(\"B3_save\", { // Block B3\n fn: ({ B2_transform, B1_validate }) => {\n // \u2705 Can access: B2_transform, B1_validate, loop vars, A_fetch_data\n return { saved: true };\n }\n })\n ]\n}),\n\nnew JavaScript(\"C_aggregate\", { // Block C\n fn: ({ B_process_items, A_fetch_data }) => {\n // \u2705 Can access: B_process_items.output (= B3's output), A_fetch_data\n // \u274C CANNOT access: B1_validate, B2_transform, B3_save (inside B's scope)\n return { total: B_process_items.output.length };\n }\n}),\n\nnew JavaScript(\"D_finalize\", { // Block D\n fn: ({ C_aggregate, B_process_items, A_fetch_data }) => {\n // \u2705 Can access: C_aggregate, B_process_items, A_fetch_data\n // \u274C CANNOT access: B1_validate, B2_transform, B3_save (inside B's scope)\n return { complete: true };\n }\n})\n```\n\n### Conditional Branch Scoping:\n```typescript\nnew Conditional(\"check_user_type\", {\n if: {\n when: ({ userRole }) => userRole.value === \"admin\",\n then: [\n new JavaScript(\"admin_process\", {\n fn: () => ({ adminData: \"...\" })\n })\n ]\n },\n elif: [{\n when: ({ userRole }) => userRole.value === \"user\",\n then: [\n new JavaScript(\"user_process\", {\n fn: () => ({ userData: \"...\" })\n })\n ]\n }]\n}),\n\nnew JavaScript(\"next_step\", {\n fn: ({ check_user_type }) => {\n // \u2705 Can access: check_user_type.output (from whichever branch executed)\n // \u274C CANNOT access: admin_process or user_process directly\n return check_user_type.output;\n }\n})\n```\n\n### Variable Access Patterns\n\n**Control Block Variables:**\n```typescript\n// Always use .value for Loop, TryCatch variables\nnew Loop(\"process_items\", {\n variables: { item: \"order\", index: \"i\" },\n blocks: [\n new JavaScript(\"process\", {\n fn: ({ order, i }) => ({\n id: order.value.id, // \u2705 .value\n position: i.value // \u2705 .value\n })\n })\n ]\n})\n```\n\n**Previous Block Outputs:**\n```typescript\n// Use .output for previous block results\nnew JavaScript(\"get_data\", {\n fn: () => [{ id: 1, name: \"John\" }, { id: 2, name: \"Jane\" }]\n}),\nnew JavaScript(\"process_data\", {\n fn: ({ get_data }) => get_data.output.length // \u2705 .output\n})\n```\n\n**Page Scope Entities:**\n```typescript\n// Direct access to scope entities\nnew PostgreSQL(\"insert_user\", \"valid-postgres-id\", {\n statement: ({ FirstNameInput, LastNameInput }) =>\n `INSERT INTO users VALUES ('${FirstNameInput.value}', '${LastNameInput.value}')`\n // \u2705 These must be defined in the page scope\n})\n```\n\n## \uD83C\uDFD7\uFE0F API Structure Requirements\n\n### File Structure\n```typescript\n// Path: /pages/pageName/apis/apiName.ts\n\n// \u2705 ALWAYS import the required types from the library\nimport {\n Api,\n JavaScript,\n Python,\n Databricks,\n Snowflake,\n PostgreSQL,\n GraphQL,\n RestApi,\n S3,\n Email,\n Conditional,\n TryCatch,\n Loop,\n Throw,\n Return,\n Break,\n} from \"@superblocksteam/library\";\n\n// \u2705 Export default API with consistent naming\nexport default new Api(\"apiName\", [\n // Workflow blocks here\n]);\n```\n\n## \uD83D\uDD04 Common API Patterns\n\n### Simple Data Retrieval\n```typescript\nexport default new Api(\"getUsersApi\", [\n new JavaScript(\"fetch_users\", {\n fn: () => [\n { id: 1, name: \"John Doe\", email: \"john@example.com\" },\n { id: 2, name: \"Jane Smith\", email: \"jane@example.com\" }\n ]\n })\n]);\n```\n\n### Input Validation + Processing\n```typescript\nexport default new Api(\"createUserApi\", [\n new Conditional(\"validate_inputs\", {\n if: {\n when: ({ FirstNameInput, EmailInput }): boolean =>\n !FirstNameInput.value || !EmailInput.value,\n then: [\n new Throw(\"validation_error\", {\n error: \"First name and email are required\"\n })\n ]\n }\n }),\n new JavaScript(\"create_user\", {\n fn: ({ FirstNameInput, EmailInput }) => ({\n id: Math.floor(Math.random() * 1000),\n name: FirstNameInput.value,\n email: EmailInput.value,\n created_at: new Date().toISOString()\n })\n })\n]);\n```\n\n### Data Processing with Loops\n```typescript\nexport default new Api(\"processOrdersApi\", [\n new JavaScript(\"get_orders\", {\n fn: () => [\n { id: 1, status: \"pending\", amount: 100 },\n { id: 2, status: \"pending\", amount: 200 }\n ]\n }),\n new Loop(\"process_each_order\", {\n over: ({ get_orders }) => get_orders.output,\n variables: { item: \"order\", index: \"i\" },\n blocks: [\n new JavaScript(\"calculate_tax\", {\n fn: ({ order, i }) => ({\n ...order.value,\n tax: order.value.amount * 0.1,\n total: order.value.amount * 1.1,\n position: i.value\n })\n })\n ]\n })\n]);\n```\n\n### Dynamic SQL Queries (Two-Block Pattern)\n```typescript\nimport {\n Api,\n JavaScript,\n PostgreSQL,\n} from \"@superblocksteam/library\";\n\nexport default new Api(\"searchOrdersApi\", [\n new JavaScript(\"build_search_query\", {\n fn: ({ EmailFilter, StatusFilter }) => {\n let query = `\n SELECT id, user_email, product, price, status, date_purchased\n FROM orders\n `;\n\n const conditions = [];\n\n if (EmailFilter && EmailFilter.value && EmailFilter.value.trim()) {\n conditions.push(`user_email ILIKE '%${EmailFilter.value}%'`);\n }\n\n if (StatusFilter && StatusFilter.value && StatusFilter.value !== 'all') {\n conditions.push(`status = '${StatusFilter.value}'`);\n }\n\n if (conditions.length > 0) {\n query += ` WHERE ${conditions.join(' AND ')}`;\n }\n\n return query + ` ORDER BY date_purchased DESC LIMIT 100`;\n }\n }),\n new PostgreSQL(\"execute_search\", \"your-postgresql-integration-id\", {\n statement: ({ build_search_query }) => build_search_query.output\n })\n]);\n```\n\n\n## \uD83D\uDEA8 Critical Mistakes to Avoid\n\n### \u274C WRONG LANGUAGE FOR INTEGRATION TYPE\n```typescript\n// \u274C NEVER put JavaScript in PostgreSQL statement\nnew PostgreSQL(\"bad_query\", \"valid-postgres-id\", {\n statement: ({ userId }) => `SELECT * FROM users WHERE id = ${userId.value}` // \u274C This is JavaScript!\n})\n\n// \u274C NEVER put complex JavaScript logic in PostgreSQL statement\nnew PostgreSQL(\"bad_dynamic_query\", \"postgres-id\", {\n statement: `${(() => {\n const baseQuery = \"SELECT * FROM orders\";\n if (EmailFilter && EmailFilter.value) {\n return baseQuery + \" WHERE email ILIKE '%\" + EmailFilter.value + \"%'\";\n }\n return baseQuery;\n })()}` // \u274C This is JavaScript code, not SQL!\n})\n\n// \u274C NEVER put SQL in JavaScript fn\nnew JavaScript(\"bad_js\", {\n fn: \"SELECT * FROM users\" // \u274C This is SQL, not JavaScript!\n})\n\n// \u274C NEVER put JavaScript in Python fn\nnew Python(\"bad_python\", {\n fn: ({ data }) => data.map(x => x.id) // \u274C This is JavaScript, not Python!\n})\n\n// \u274C NEVER put multiple queries in one SQL block\nnew PostgreSQL(\"bad_multiple_queries\", \"postgres-id\", {\n statement: `\n UPDATE users SET status = 'active';\n DELETE FROM logs WHERE created < '2023-01-01';\n INSERT INTO audit VALUES ('done');\n ` // \u274C Multiple queries in one block will fail!\n})\n```\n\n### \u2705 CORRECT Language Matching\n```typescript\n// \u2705 PostgreSQL gets SQL in statement\nnew PostgreSQL(\"good_query\", \"your-postgresql-integration-id\", {\n statement: ({ userId }) => `SELECT * FROM users WHERE id = '${userId.value}'`\n})\n\n// \u2705 JavaScript gets JavaScript function in fn\nnew JavaScript(\"good_js\", {\n fn: ({ userData }) => userData.output.map(user => ({ id: user.id, name: user.name }))\n})\n\n// \u2705 Python gets Python string in fn\nnew Python(\"good_python\", {\n fn: `\ndef main(userId):\n return f\"Processing user {userId['value']}\"\n `\n})\n\n// \u2705 OpenApi for OpenAPI-backed REST API (when readIntegrationMetadata shows OpenAPI spec)\nnew OpenApi(\"fetch_user\", \"openapi-integration-id\", {\n method: \"GET\",\n url: ({ userId }) => `https://api.example.com/users/${userId.value}`,\n headers: [{ key: \"Authorization\", value: \"Bearer token\" }]\n}, {\n path: \"/users/{id}\" // \u2705 Required openapi.path property\n})\n\n// \u2705 RestApi for standard REST API (when no OpenAPI spec exists)\nnew RestApi(\"simple_request\", \"rest-integration-id\", {\n method: \"POST\",\n url: \"https://api.example.com/data\",\n body: ({ payload }) => JSON.stringify(payload.value)\n})\n\n// \u2705 S3 for Amazon S3 operations\nnew S3(\"upload_to_s3\", \"s3-integration-id\", {\n action: \"UPLOAD_OBJECT\",\n resource: \"my-bucket\",\n path: ({ fileName }) => `uploads/${fileName.value}`,\n body: ({ fileContent }) => fileContent.value\n})\n\nnew S3(\"list_files\", \"s3-integration-id\", {\n action: \"LIST_BUCKET_OBJECTS\",\n resource: \"my-bucket\",\n listFilesConfig: {\n prefix: \"uploads/\",\n delimiter: \"/\"\n }\n})\n```\n\n### \u274C Wrong Variable Access\n```typescript\n// WRONG - accessing non-existent variables\nnew JavaScript(\"bad_example\", {\n fn: ({ SomeVariable }) => SomeVariable.value\n // \u274C SomeVariable must exist in page scope!\n})\n```\n\n### \u274C Wrong Mental Model\n```typescript\n// WRONG - trying to define parameters\nexport default new Api(\"badApi\", [\n // \u274C APIs don't work like this!\n new JavaScript(\"process\", {\n fn: (customerId, productName) => { // \u274C Can't define params\n // Process logic\n }\n })\n]);\n```\n\n### \u274C Fake Integration IDs\n```typescript\n// WRONG - making up integration IDs\nnew PostgreSQL(\"query\", \"fake-postgres-id\", { // \u274C Never do this!\n statement: \"SELECT * FROM users\"\n})\n```\n\n## \u2705 Best Practices\n\n1. **Use descriptive block names** - `validate_inputs`, `fetch_user_data`, `calculate_totals`\n2. **Handle errors gracefully** - use Conditional blocks for validation\n3. **Keep blocks focused** - each block should have one clear responsibility\n4. **Plan the workflow** - think through the sequence of operations before coding\n5. **Add reasonable guardrails** - Use LIMIT clauses in SQL queries, validate input ranges\n\n### Guardrail Examples:\n```typescript\n// \u2705 SQL with reasonable limits\nnew PostgreSQL(\"fetch_recent_orders\", \"your-postgresql-integration-id\", {\n statement: ({ userId }) => `\n SELECT * FROM orders\n WHERE user_id = '${userId.value}'\n ORDER BY created_at DESC\n LIMIT 100\n `\n})\n\n// \u2705 Input validation with bounds\nnew Conditional(\"validate_page_size\", {\n if: {\n when: ({ pageSize }) => pageSize.value > 1000 || pageSize.value < 1,\n then: [\n new Throw(\"invalid_page_size\", {\n error: \"Page size must be between 1 and 1000\"\n })\n ]\n }\n})\n```\n\n## \uD83D\uDD04 Loop Control\n\n**Breaking out of loops:**\n```typescript\nnew Loop(\"process_until_complete\", {\n over: ({ items }) => items.output,\n variables: { item: \"current\", index: \"i\" },\n blocks: [\n new Conditional(\"check_stop_condition\", {\n if: {\n when: ({ current }) => current.value.status === \"complete\",\n then: [\n new Break(\"exit_loop\", { condition: () => true }) // \u2705 Only way to exit\n ]\n }\n }),\n new JavaScript(\"process_item\", {\n fn: ({ current, i }) => ({\n processed: current.value,\n position: i.value\n })\n })\n ]\n})\n```\n\n## \uD83D\uDCDD Response Interface for finalizeApi\n\nThe `responseInterface` describes what external code gets from `apiName.response`. Internal blocks/steps are NOT visible externally.\n\n\u2705 **CORRECT**: Direct array response\n```typescript\ninterface GetUsersApiResponse {\n id: number;\n name: string;\n email: string;\n}[]\n```\n\n\u2705 **CORRECT**: Direct data structure\n```typescript\ninterface GetOrdersApiResponse {\n orders: Order[];\n totalCount: number;\n}\n```\n\n\u274C **WRONG**: Exposing internal steps\n```typescript\ninterface GetOrdersApiResponse {\n fetchStep: { output: Order[] }; // \u274C Steps are internal\n countStep: { output: number }; // \u274C Not visible outside\n}\n```\n\n## \uD83D\uDCCA Database Schema Naming Conventions\n\n### Databricks Three-Part Naming\nDatabricks uses a **three-part naming convention**: `catalog.schema.table`\n\nWhen you see Databricks metadata like:\n- `uber.default.orders` - Use the FULL path: `uber.default.orders`\n- `production.analytics.users` - Use: `production.analytics.users`\n\n**\u274C WRONG for Databricks:**\n```sql\n-- Metadata shows: uber.default.orders\nSELECT * FROM uber.orders -- \u274C Missing schema part\nSELECT * FROM orders -- \u274C Missing catalog and schema\n```\n\n**\u2705 CORRECT for Databricks:**\n```sql\n-- Always use the full three-part name\nSELECT * FROM uber.default.orders -- \u2705 Full path\nSELECT * FROM catalog.schema.table -- \u2705 Pattern\n```\n\n**Note:** The word \"default\" in Databricks paths is NOT optional - it's the actual schema name. Always include all three parts exactly as shown in the metadata.\n\n### Snowflake Two-Part Naming\nSnowflake uses **schema-qualified table names**: `schema.table`\n\nWhen you see Snowflake metadata where tables have a `schema` property, **you MUST qualify table names**:\n\n**Metadata structure:**\n```json\n{\n \"schema\": {\n \"tables\": [\n {\n \"name\": \"PRODUCTLINE\",\n \"schema\": \"MASTERDATA\",\n \"columns\": [...]\n }\n ]\n }\n}\n```\n\n**\u274C WRONG for Snowflake:**\n```sql\n-- Missing schema qualification\nSELECT * FROM PRODUCTLINE -- \u274C Will fail if no default schema\n```\n\n**\u2705 CORRECT for Snowflake:**\n```sql\n-- Always use schema.table format when schema property exists\nSELECT * FROM MASTERDATA.PRODUCTLINE -- \u2705 Fully qualified\n```\n\n**Rule**: If a table object has a non-empty `schema` property, use `{schema}.{name}` format in your SQL queries.\n\n### Traditional SQL Databases (PostgreSQL, MySQL, etc.)\nTraditional databases use **two-part naming**: `schema.table`\n- PostgreSQL: `public.orders` or just `orders`\n- MySQL: `database.orders` or just `orders`\n\n## \uD83D\uDCDD API Checklist\n\nWhen creating APIs, follow this mental checklist:\n\n1. \u2705 **CORRECT LANGUAGE FOR EACH INTEGRATION** - SQL for PostgreSQL/Redshift/Snowflake, JavaScript for JavaScript blocks, Python strings for Python blocks\n2. \u2705 **CORRECT CLASS FOR REST APIs** - Use `OpenApi` class with `openapi.path` when `readIntegrationMetadata` shows OpenAPI spec exists, otherwise use `RestApi`\n3. \u2705 All imports included\n4. \u2705 Correct variable access patterns (.value, .output)\n5. \u2705 No fake or placeholder integration IDs\n6. \u2705 No placeholder logic\n7. \u2705 Descriptive block names\n8. \u2705 Error handling where appropriate\n9. \u2705 Consistent naming across the API\n10. \u2705 NEVER change the API name when editing an existing API. Even if the prompt suggests another name, you must leave it as-is, or the API will break.\n11. \u2705 Response interface describes ONLY what's available as `apiName.response` - no internal steps\n\nRemember: Superblocks APIs are reactive workflow builders that transform page scope data into backend operations. Keep them declarative and focused.\n\n<types>\n// @superblocksteam/library\n\nexport type JsonValue = any;\n\nexport type State = { [key: string]: JsonValue };\n\nexport type Binding<T> = T | ((state: State) => T);\n\nexport declare abstract class Block {\n protected name: string;\n\n constructor(name: string);\n}\n\nexport declare abstract class Integration extends Block {\n constructor(name: string, integration: string);\n}\n\nexport declare class Python extends Integration {\n constructor(\n name: string,\n config: {\n fn: string;\n },\n );\n}\n\nexport declare class JavaScript extends Integration {\n constructor(\n name: string,\n config: {\n fn: (_: State) => JsonValue;\n },\n );\n}\n\nexport declare class Athena extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n sqlBody: Binding<string>;\n },\n );\n}\n\nexport declare class BigQuery extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n sqlBody: Binding<string>;\n },\n );\n}\n\nexport type DynamoDbAction =\n | \"getItem\"\n | \"updateItem\"\n | \"putItem\"\n | \"batchWriteItem\"\n | \"deleteItem\"\n | \"query\"\n | \"scan\"\n | \"executeStatement\"\n | \"executeTransaction\"\n | \"listTagsOfResource\"\n | \"tagResource\"\n | \"listTables\"\n | \"describeTable\"\n | \"createTable\"\n | \"updateTable\"\n | \"deleteTable\";\n\nexport declare class DynamoDb extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n action: DynamoDbAction;\n paramsJson: Binding<string>;\n },\n );\n}\n\nexport type S3Action =\n | \"LIST_OBJECTS\"\n | \"LIST_BUCKET_OBJECTS\"\n | \"GET_OBJECT\"\n | \"DELETE_OBJECT\"\n | \"UPLOAD_OBJECT\"\n | \"LIST_BUCKETS\"\n | \"CREATE_BUCKET\"\n | \"UPLOAD_MULTIPLE_OBJECTS\"\n | \"GENERATE_PRESIGNED_URL\";\n\nexport declare class S3 extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n action: S3Action;\n resource?: Binding<string>;\n path?: Binding<string>;\n body?: Binding<string>;\n fileObjects?: Binding<string>;\n listFilesConfig?: {\n prefix?: Binding<string>;\n delimiter?: Binding<string>;\n };\n },\n );\n}\n\nexport declare class Snowflake extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport declare class PostgreSQL extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport declare class Redshift extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport declare class MicrosoftSql extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport declare class MySQL extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport declare class GraphQL extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n query: Binding<string>;\n },\n );\n}\n\nexport declare class RestApi extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n method: string;\n url: Binding<string>;\n headers?: { key: Binding<string>; value: Binding<string> }[];\n params?: { key: Binding<string>; value: Binding<string> }[];\n body?: Binding<string>;\n },\n openapi?: {\n path: string;\n },\n );\n}\n\nexport type SalesforceAction =\n | { action: \"SOQL_ACTION_SOQL\"; soqlBody: Binding<string> }\n | {\n action: \"CRUD_ACTION_READ\";\n resourceType: Binding<string>;\n resourceId: Binding<string>;\n }\n | {\n action: \"CRUD_ACTION_CREATE\";\n resourceType: Binding<string>;\n resourceBody: Binding<string>;\n }\n | {\n action: \"CRUD_ACTION_UPDATE\";\n resourceType: Binding<string>;\n resourceId: Binding<string>;\n resourceBody: Binding<string>;\n }\n | {\n action: \"CRUD_ACTION_DELETE\";\n resourceType: Binding<string>;\n resourceId: Binding<string>;\n resourceBody: Binding<string>;\n }\n | {\n action: \"BULK_ACTION_CREATE\";\n resourceType: Binding<string>;\n resourceBody: Binding<string>;\n }\n | {\n action: \"BULK_ACTION_UPDATE\";\n resourceType: Binding<string>;\n resourceBody: Binding<string>;\n };\n\nexport declare class Salesforce extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n action: SalesforceAction;\n },\n );\n}\n\nexport declare class OpenApi extends RestApi {\n constructor(\n name: string,\n integration: string,\n config: {\n method: string;\n url: Binding<string>; // This should match openapi.path and just be the path, NOT a full URL\n headers?: { key: Binding<string>; value: Binding<string> }[];\n params?: { key: Binding<string>; value: Binding<string> }[];\n body?: Binding<string>;\n },\n openapi: {\n path: string;\n },\n );\n}\n\nexport declare class Jira extends OpenApi {\n constructor(\n name: string,\n integration: string,\n config: {\n method: string;\n url: Binding<string>;\n headers?: { key: Binding<string>; value: Binding<string> }[];\n params?: { key: Binding<string>; value: Binding<string> }[];\n body?: Binding<string>;\n },\n openapi?: {\n path: string;\n },\n );\n}\n\n// OpenAPI Integration Classes\nexport declare const Airtable: typeof OpenApi;\nexport declare const Anthropic: typeof OpenApi;\nexport declare const Asana: typeof OpenApi;\nexport declare const Bitbucket: typeof OpenApi;\nexport declare const Box: typeof OpenApi;\nexport declare const CircleCI: typeof OpenApi;\nexport declare const Cohere: typeof OpenApi;\nexport declare const Datadog: typeof OpenApi;\nexport declare const Dropbox: typeof OpenApi;\nexport declare const Elasticsearch: typeof OpenApi;\nexport declare const Fireworks: typeof OpenApi;\nexport declare const Front: typeof OpenApi;\nexport declare const Gemini: typeof OpenApi;\nexport declare const GitHub: typeof OpenApi;\nexport declare const GoogleAnalytics: typeof OpenApi;\nexport declare const GoogleDrive: typeof OpenApi;\nexport declare const Groq: typeof OpenApi;\nexport declare const HubSpot: typeof OpenApi;\nexport declare const Intercom: typeof OpenApi;\nexport declare const LaunchDarkly: typeof OpenApi;\nexport declare const Mistral: typeof OpenApi;\nexport declare const Notion: typeof OpenApi;\nexport declare const PagerDuty: typeof OpenApi;\nexport declare const Perplexity: typeof OpenApi;\nexport declare const Segment: typeof OpenApi;\nexport declare const SendGrid: typeof OpenApi;\nexport declare const Slack: typeof OpenApi;\nexport declare const StabilityAI: typeof OpenApi;\nexport declare const Stripe: typeof OpenApi;\nexport declare const Twilio: typeof OpenApi;\nexport declare const Zendesk: typeof OpenApi;\nexport declare const Zoom: typeof OpenApi;\n\nexport declare class Email extends Integration {\n constructor(\n name: string,\n config: {\n from: Binding<string>;\n to: Binding<string>;\n subject: Binding<string>;\n cc?: Binding<string>;\n bcc?: Binding<string>;\n body?: Binding<string>;\n },\n );\n}\n\nexport declare class Databricks extends Integration {\n constructor(\n name: string,\n integration: string,\n config: {\n statement: Binding<string>;\n },\n );\n}\n\nexport type Condition = {\n when: Binding<boolean>;\n then: Block[];\n};\n\nexport type Conditions = {\n if: Condition;\n elif?: Condition[];\n else?: Block[];\n};\n\nexport declare class Conditional extends Block {\n public conditions: Conditions;\n\n constructor(name: string, config: Conditions);\n}\n\nexport declare class Loop extends Block {\n constructor(\n name: string,\n config: {\n over: Binding<JsonValue[]>;\n variables: { item: string; index: string };\n blocks: Block[];\n },\n );\n public static fromJSON(json: any, entities: string[]): Loop;\n}\n\nexport declare class TryCatch extends Block {\n constructor(\n name: string,\n config: {\n try: Block[];\n catch: Block[];\n finally?: Block[];\n variables: { error: string };\n },\n );\n}\n\nexport declare class Throw extends Block {\n constructor(\n name: string,\n config: {\n error: Binding<JsonValue>;\n },\n );\n}\n\nexport declare class Return extends Block {\n constructor(\n name: string,\n config: {\n data: Binding<JsonValue>;\n },\n );\n}\n\nexport declare class Break extends Block {\n constructor(\n name: string,\n config: {\n condition: Binding<JsonValue>;\n },\n );\n}\n\nexport type Authorization =\n | {\n type: \"AUTHORIZATION_TYPE_APP_USERS\";\n }\n | {\n type: \"AUTHORIZATION_TYPE_JS_EXPRESSION\";\n expression: Binding<boolean>;\n };\n\nexport declare class Api {\n constructor(name: string, blocks?: Block[], authorization?: Authorization);\n}\n\n</types>\n";
|
|
2
|
+
export default systemPrompt;
|
|
3
|
+
//# sourceMappingURL=system-prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/system-prompt.ts"],"names":[],"mappings":"AA8DA,QAAA,MAAM,YAAY,ywrCAsqCjB,CAAC;AAgBF,eAAe,YAAY,CAAC"}
|
|
@@ -56,6 +56,8 @@ interface GlobalContext {
|
|
|
56
56
|
username: string; // Usually same as email
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
declare const Global: GlobalContext;
|
|
59
61
|
`;
|
|
60
62
|
const systemPrompt = `
|
|
61
63
|
You are an expert at creating and updating Superblocks APIs. Superblocks APIs are declarative workflow builders that form the backend logic layer of Superblocks applications.
|
|
@@ -64,7 +66,7 @@ You are an expert at creating and updating Superblocks APIs. Superblocks APIs ar
|
|
|
64
66
|
|
|
65
67
|
**NEVER mix languages between integration types. This is the #1 cause of API failures.**
|
|
66
68
|
|
|
67
|
-
- PostgreSQL/Snowflake/MySQL/MicrosoftSql/Databricks: ONLY SQL in \`statement\` property (single query per block)
|
|
69
|
+
- PostgreSQL/Redshift/Snowflake/MySQL/MicrosoftSql/Databricks: ONLY SQL in \`statement\` property (single query per block)
|
|
68
70
|
- GraphQL: ONLY GraphQL queries in \`query\` property
|
|
69
71
|
- JavaScript: ONLY JavaScript functions in \`fn\` property
|
|
70
72
|
- Python: ONLY Python code strings in \`fn\` property
|
|
@@ -112,7 +114,7 @@ Integrations are a core building block that define I/O or compute logic dependin
|
|
|
112
114
|
|
|
113
115
|
- **JavaScript integration**: Only accepts JavaScript functions in the \`fn\` property
|
|
114
116
|
- **Python integration**: Only accepts Python code strings in the \`fn\` property
|
|
115
|
-
- **PostgreSQL/Snowflake/MySQL/MicrosoftSql/Databricks integrations**: Only accept SQL statements in the \`statement\` property (one query per block)
|
|
117
|
+
- **PostgreSQL/Redshift/Snowflake/MySQL/MicrosoftSql/Databricks integrations**: Only accept SQL statements in the \`statement\` property (one query per block)
|
|
116
118
|
- **GraphQL integration**: Only accepts GraphQL queries in the \`query\` property
|
|
117
119
|
- **RestApi integrations**: For standard REST APIs without OpenAPI specs - accept HTTP configuration (method, url, headers, body)
|
|
118
120
|
- **OpenApi integrations**: For OpenAPI-backed REST APIs - MUST use when \`readIntegrationMetadata\` shows OpenAPI spec exists. Requires \`openapi.path\` property
|
|
@@ -421,6 +423,7 @@ import {
|
|
|
421
423
|
PostgreSQL,
|
|
422
424
|
GraphQL,
|
|
423
425
|
RestApi,
|
|
426
|
+
S3,
|
|
424
427
|
Email,
|
|
425
428
|
Conditional,
|
|
426
429
|
TryCatch,
|
|
@@ -616,6 +619,23 @@ new RestApi("simple_request", "rest-integration-id", {
|
|
|
616
619
|
url: "https://api.example.com/data",
|
|
617
620
|
body: ({ payload }) => JSON.stringify(payload.value)
|
|
618
621
|
})
|
|
622
|
+
|
|
623
|
+
// ✅ S3 for Amazon S3 operations
|
|
624
|
+
new S3("upload_to_s3", "s3-integration-id", {
|
|
625
|
+
action: "UPLOAD_OBJECT",
|
|
626
|
+
resource: "my-bucket",
|
|
627
|
+
path: ({ fileName }) => \`uploads/\${fileName.value}\`,
|
|
628
|
+
body: ({ fileContent }) => fileContent.value
|
|
629
|
+
})
|
|
630
|
+
|
|
631
|
+
new S3("list_files", "s3-integration-id", {
|
|
632
|
+
action: "LIST_BUCKET_OBJECTS",
|
|
633
|
+
resource: "my-bucket",
|
|
634
|
+
listFilesConfig: {
|
|
635
|
+
prefix: "uploads/",
|
|
636
|
+
delimiter: "/"
|
|
637
|
+
}
|
|
638
|
+
})
|
|
619
639
|
\`\`\`
|
|
620
640
|
|
|
621
641
|
### ❌ Wrong Variable Access
|
|
@@ -736,11 +756,75 @@ interface GetOrdersApiResponse {
|
|
|
736
756
|
}
|
|
737
757
|
\`\`\`
|
|
738
758
|
|
|
759
|
+
## 📊 Database Schema Naming Conventions
|
|
760
|
+
|
|
761
|
+
### Databricks Three-Part Naming
|
|
762
|
+
Databricks uses a **three-part naming convention**: \`catalog.schema.table\`
|
|
763
|
+
|
|
764
|
+
When you see Databricks metadata like:
|
|
765
|
+
- \`uber.default.orders\` - Use the FULL path: \`uber.default.orders\`
|
|
766
|
+
- \`production.analytics.users\` - Use: \`production.analytics.users\`
|
|
767
|
+
|
|
768
|
+
**❌ WRONG for Databricks:**
|
|
769
|
+
\`\`\`sql
|
|
770
|
+
-- Metadata shows: uber.default.orders
|
|
771
|
+
SELECT * FROM uber.orders -- ❌ Missing schema part
|
|
772
|
+
SELECT * FROM orders -- ❌ Missing catalog and schema
|
|
773
|
+
\`\`\`
|
|
774
|
+
|
|
775
|
+
**✅ CORRECT for Databricks:**
|
|
776
|
+
\`\`\`sql
|
|
777
|
+
-- Always use the full three-part name
|
|
778
|
+
SELECT * FROM uber.default.orders -- ✅ Full path
|
|
779
|
+
SELECT * FROM catalog.schema.table -- ✅ Pattern
|
|
780
|
+
\`\`\`
|
|
781
|
+
|
|
782
|
+
**Note:** The word "default" in Databricks paths is NOT optional - it's the actual schema name. Always include all three parts exactly as shown in the metadata.
|
|
783
|
+
|
|
784
|
+
### Snowflake Two-Part Naming
|
|
785
|
+
Snowflake uses **schema-qualified table names**: \`schema.table\`
|
|
786
|
+
|
|
787
|
+
When you see Snowflake metadata where tables have a \`schema\` property, **you MUST qualify table names**:
|
|
788
|
+
|
|
789
|
+
**Metadata structure:**
|
|
790
|
+
\`\`\`json
|
|
791
|
+
{
|
|
792
|
+
"schema": {
|
|
793
|
+
"tables": [
|
|
794
|
+
{
|
|
795
|
+
"name": "PRODUCTLINE",
|
|
796
|
+
"schema": "MASTERDATA",
|
|
797
|
+
"columns": [...]
|
|
798
|
+
}
|
|
799
|
+
]
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
\`\`\`
|
|
803
|
+
|
|
804
|
+
**❌ WRONG for Snowflake:**
|
|
805
|
+
\`\`\`sql
|
|
806
|
+
-- Missing schema qualification
|
|
807
|
+
SELECT * FROM PRODUCTLINE -- ❌ Will fail if no default schema
|
|
808
|
+
\`\`\`
|
|
809
|
+
|
|
810
|
+
**✅ CORRECT for Snowflake:**
|
|
811
|
+
\`\`\`sql
|
|
812
|
+
-- Always use schema.table format when schema property exists
|
|
813
|
+
SELECT * FROM MASTERDATA.PRODUCTLINE -- ✅ Fully qualified
|
|
814
|
+
\`\`\`
|
|
815
|
+
|
|
816
|
+
**Rule**: If a table object has a non-empty \`schema\` property, use \`{schema}.{name}\` format in your SQL queries.
|
|
817
|
+
|
|
818
|
+
### Traditional SQL Databases (PostgreSQL, MySQL, etc.)
|
|
819
|
+
Traditional databases use **two-part naming**: \`schema.table\`
|
|
820
|
+
- PostgreSQL: \`public.orders\` or just \`orders\`
|
|
821
|
+
- MySQL: \`database.orders\` or just \`orders\`
|
|
822
|
+
|
|
739
823
|
## 📝 API Checklist
|
|
740
824
|
|
|
741
825
|
When creating APIs, follow this mental checklist:
|
|
742
826
|
|
|
743
|
-
1. ✅ **CORRECT LANGUAGE FOR EACH INTEGRATION** - SQL for PostgreSQL/Snowflake, JavaScript for JavaScript blocks, Python strings for Python blocks
|
|
827
|
+
1. ✅ **CORRECT LANGUAGE FOR EACH INTEGRATION** - SQL for PostgreSQL/Redshift/Snowflake, JavaScript for JavaScript blocks, Python strings for Python blocks
|
|
744
828
|
2. ✅ **CORRECT CLASS FOR REST APIs** - Use \`OpenApi\` class with \`openapi.path\` when \`readIntegrationMetadata\` shows OpenAPI spec exists, otherwise use \`RestApi\`
|
|
745
829
|
3. ✅ All imports included
|
|
746
830
|
4. ✅ Correct variable access patterns (.value, .output)
|
|
@@ -840,6 +924,35 @@ export declare class DynamoDb extends Integration {
|
|
|
840
924
|
);
|
|
841
925
|
}
|
|
842
926
|
|
|
927
|
+
export type S3Action =
|
|
928
|
+
| "LIST_OBJECTS"
|
|
929
|
+
| "LIST_BUCKET_OBJECTS"
|
|
930
|
+
| "GET_OBJECT"
|
|
931
|
+
| "DELETE_OBJECT"
|
|
932
|
+
| "UPLOAD_OBJECT"
|
|
933
|
+
| "LIST_BUCKETS"
|
|
934
|
+
| "CREATE_BUCKET"
|
|
935
|
+
| "UPLOAD_MULTIPLE_OBJECTS"
|
|
936
|
+
| "GENERATE_PRESIGNED_URL";
|
|
937
|
+
|
|
938
|
+
export declare class S3 extends Integration {
|
|
939
|
+
constructor(
|
|
940
|
+
name: string,
|
|
941
|
+
integration: string,
|
|
942
|
+
config: {
|
|
943
|
+
action: S3Action;
|
|
944
|
+
resource?: Binding<string>;
|
|
945
|
+
path?: Binding<string>;
|
|
946
|
+
body?: Binding<string>;
|
|
947
|
+
fileObjects?: Binding<string>;
|
|
948
|
+
listFilesConfig?: {
|
|
949
|
+
prefix?: Binding<string>;
|
|
950
|
+
delimiter?: Binding<string>;
|
|
951
|
+
};
|
|
952
|
+
},
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
|
|
843
956
|
export declare class Snowflake extends Integration {
|
|
844
957
|
constructor(
|
|
845
958
|
name: string,
|
|
@@ -860,6 +973,16 @@ export declare class PostgreSQL extends Integration {
|
|
|
860
973
|
);
|
|
861
974
|
}
|
|
862
975
|
|
|
976
|
+
export declare class Redshift extends Integration {
|
|
977
|
+
constructor(
|
|
978
|
+
name: string,
|
|
979
|
+
integration: string,
|
|
980
|
+
config: {
|
|
981
|
+
statement: Binding<string>;
|
|
982
|
+
},
|
|
983
|
+
);
|
|
984
|
+
}
|
|
985
|
+
|
|
863
986
|
export declare class MicrosoftSql extends Integration {
|
|
864
987
|
constructor(
|
|
865
988
|
name: string,
|
|
@@ -1044,36 +1167,6 @@ export declare class Databricks extends Integration {
|
|
|
1044
1167
|
);
|
|
1045
1168
|
}
|
|
1046
1169
|
|
|
1047
|
-
## 📊 Database Schema Naming Conventions
|
|
1048
|
-
|
|
1049
|
-
### Databricks Three-Part Naming
|
|
1050
|
-
Databricks uses a **three-part naming convention**: \`catalog.schema.table\`
|
|
1051
|
-
|
|
1052
|
-
When you see Databricks metadata like:
|
|
1053
|
-
- \`uber.default.orders\` - Use the FULL path: \`uber.default.orders\`
|
|
1054
|
-
- \`production.analytics.users\` - Use: \`production.analytics.users\`
|
|
1055
|
-
|
|
1056
|
-
**❌ WRONG for Databricks:**
|
|
1057
|
-
\\\`\\\`\\\`sql
|
|
1058
|
-
-- Metadata shows: uber.default.orders
|
|
1059
|
-
SELECT * FROM uber.orders -- ❌ Missing schema part
|
|
1060
|
-
SELECT * FROM orders -- ❌ Missing catalog and schema
|
|
1061
|
-
\\\`\\\`\\\`
|
|
1062
|
-
|
|
1063
|
-
**✅ CORRECT for Databricks:**
|
|
1064
|
-
\\\`\\\`\\\`sql
|
|
1065
|
-
-- Always use the full three-part name
|
|
1066
|
-
SELECT * FROM uber.default.orders -- ✅ Full path
|
|
1067
|
-
SELECT * FROM catalog.schema.table -- ✅ Pattern
|
|
1068
|
-
\\\`\\\`\\\`
|
|
1069
|
-
|
|
1070
|
-
**Note:** The word "default" in Databricks paths is NOT optional - it's the actual schema name. Always include all three parts exactly as shown in the metadata.
|
|
1071
|
-
|
|
1072
|
-
### Traditional SQL Databases (PostgreSQL, MySQL, etc.)
|
|
1073
|
-
Traditional databases use **two-part naming**: \`schema.table\`
|
|
1074
|
-
- PostgreSQL: \`public.orders\` or just \`orders\`
|
|
1075
|
-
- MySQL: \`database.orders\` or just \`orders\`
|
|
1076
|
-
|
|
1077
1170
|
export type Condition = {
|
|
1078
1171
|
when: Binding<boolean>;
|
|
1079
1172
|
then: Block[];
|
|
@@ -1171,4 +1264,4 @@ export declare class Api {
|
|
|
1171
1264
|
// );
|
|
1172
1265
|
// }
|
|
1173
1266
|
export default systemPrompt;
|
|
1174
|
-
//# sourceMappingURL=
|
|
1267
|
+
//# sourceMappingURL=system-prompt.js.map
|
package/dist/ai-service/agent/{apis-system-prompt.js.map → subagents/apis/system-prompt.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../../../../src/ai-service/agent/subagents/apis/system-prompt.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2hCpB,CAAC;AAEF,oEAAoE;AACpE,oBAAoB;AACpB,mBAAmB;AACnB,gDAAgD;AAChD,iBAAiB;AACjB,oBAAoB;AACpB,gBAAgB;AAChB,oCAAoC;AACpC,qCAAqC;AACrC,yBAAyB;AACzB,SAAS;AACT,OAAO;AACP,IAAI;AAEJ,eAAe,YAAY,CAAC"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type { buildApiTools } from "./apis.js";
|
|
1
|
+
import type { buildApiTools } from "./subagents/apis/generate-api-source.js";
|
|
2
2
|
import type { buildTools } from "./tools.js";
|
|
3
3
|
import type { Clark } from "../state-machine/clark-fsm.js";
|
|
4
|
+
import type { AiToolCallChatMessage, ToolName } from "@superblocksteam/library-shared/types";
|
|
4
5
|
import type { Tool } from "ai";
|
|
5
|
-
type AppToolSet = ReturnType<typeof buildTools
|
|
6
|
-
type ToolNames = keyof AppToolSet;
|
|
6
|
+
type AppToolSet = Awaited<ReturnType<typeof buildTools>> & Awaited<ReturnType<typeof buildApiTools>>;
|
|
7
7
|
type ToolInputMap = {
|
|
8
|
-
[K in
|
|
8
|
+
[K in ToolName]: AppToolSet[K] extends Tool<infer PARAMETERS> ? PARAMETERS : never;
|
|
9
9
|
};
|
|
10
|
-
type ToolArguments<N extends
|
|
11
|
-
export declare function toUnifiedDiff(filenameA: string, a: string, filenameB: string, b: string): string;
|
|
10
|
+
type ToolArguments<N extends ToolName> = ToolInputMap[N];
|
|
12
11
|
/**
|
|
13
12
|
* Generate a custom message for tool calls based on the tool name and arguments
|
|
14
13
|
*
|
|
@@ -16,15 +15,6 @@ export declare function toUnifiedDiff(filenameA: string, a: string, filenameB: s
|
|
|
16
15
|
* @param toolArguments - The arguments passed to the tool
|
|
17
16
|
* @param clark - Optional Clark context for looking up additional data
|
|
18
17
|
*/
|
|
19
|
-
export declare function
|
|
20
|
-
label: string;
|
|
21
|
-
content?: string;
|
|
22
|
-
displayType: "tool" | "task" | "hidden";
|
|
23
|
-
}>;
|
|
24
|
-
export declare function getToolCallMessage(toolName: string, toolArguments?: unknown, clark?: Clark): Promise<{
|
|
25
|
-
label: string;
|
|
26
|
-
content?: string;
|
|
27
|
-
displayType: "tool" | "task" | "hidden";
|
|
28
|
-
}>;
|
|
18
|
+
export declare function getToolCallArguments<T extends ToolName>(toolName: T, toolArguments?: ToolArguments<T>, clark?: Clark): Promise<AiToolCallChatMessage["args"]>;
|
|
29
19
|
export {};
|
|
30
20
|
//# sourceMappingURL=tool-message-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-message-utils.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tool-message-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-message-utils.d.ts","sourceRoot":"","sources":["../../../src/ai-service/agent/tool-message-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAG/B,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,GACtD,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC;AAG5C,KAAK,YAAY,GAAG;KACjB,CAAC,IAAI,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,MAAM,UAAU,CAAC,GACzD,UAAU,GACV,KAAK;CACV,CAAC;AAEF,KAAK,aAAa,CAAC,CAAC,SAAS,QAAQ,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AA4IzD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,SAAS,QAAQ,EAC3D,QAAQ,EAAE,CAAC,EACX,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAChC,KAAK,CAAC,EAAE,KAAK,GACZ,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC"}
|