@superblocksteam/vite-plugin-file-sync 2.0.115-next.0 → 2.0.115-next.2
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/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +19 -0
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/api-prompts.js +13 -17
- package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -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 +22 -3
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts +16 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js +30 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts +29 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js +108 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js.map +1 -0
- package/dist/ai-service/agent/subagents/types.d.ts +9 -1
- package/dist/ai-service/agent/subagents/types.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/types.js +8 -0
- package/dist/ai-service/agent/subagents/types.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +5 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +2 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +6 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +138 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +39 -15
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +6 -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 +116 -49
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +2 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +2 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +3 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js +330 -204
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +40 -2
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.js +15 -4
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts +3 -0
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js +50 -8
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +3 -2
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +2 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts +16 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js +135 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +308 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +8 -4
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts +57 -1
- package/dist/ai-service/agent/tools2/tools/git.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.js +275 -8
- package/dist/ai-service/agent/tools2/tools/git.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/index.d.ts +2 -1
- package/dist/ai-service/agent/tools2/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/index.js +2 -1
- package/dist/ai-service/agent/tools2/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts +4 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +20 -4
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +28 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +152 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -0
- package/dist/ai-service/agent/tools2/types.d.ts +1 -18
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/types.js.map +1 -1
- package/dist/ai-service/agent/utils.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.js +22 -5
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/app-interface/file-system-interface.d.ts +0 -4
- package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -1
- package/dist/ai-service/app-interface/file-system-interface.js +0 -21
- package/dist/ai-service/app-interface/file-system-interface.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +11 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +29 -7
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -1
- package/dist/ai-service/app-interface/shell.d.ts +6 -0
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +8 -0
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-skills/helpers.d.ts.map +1 -1
- package/dist/ai-service/app-skills/helpers.js +4 -2
- package/dist/ai-service/app-skills/helpers.js.map +1 -1
- package/dist/ai-service/attachments/store.d.ts +18 -2
- package/dist/ai-service/attachments/store.d.ts.map +1 -1
- package/dist/ai-service/attachments/store.js +102 -9
- package/dist/ai-service/attachments/store.js.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -2
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js +32 -0
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts +2 -2
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +45 -243
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/chat/utils.d.ts +6 -0
- package/dist/ai-service/chat/utils.d.ts.map +1 -1
- package/dist/ai-service/chat/utils.js +47 -0
- package/dist/ai-service/chat/utils.js.map +1 -1
- package/dist/ai-service/features.d.ts +4 -0
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +4 -0
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +36 -11
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +228 -68
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/judge/tools/playwright-action.d.ts +1 -1
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js +4 -2
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.js +4 -2
- package/dist/ai-service/llm/stream/observers/retry-notification.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +1 -16
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -1
- package/dist/ai-service/prompt-builder-service/types.d.ts +2 -13
- package/dist/ai-service/prompt-builder-service/types.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/types.js.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.js +6 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +58 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +107 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +137 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts +26 -13
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +12 -7
- 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 +76 -27
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +15 -6
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js +4 -2
- package/dist/ai-service/state-machine/handlers/idle.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 +48 -15
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.js +23 -151
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js +16 -8
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.js +2 -15
- package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts +3 -3
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +9 -23
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +52 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js +141 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -0
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js +0 -17
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/types.d.ts +2 -21
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/archive-extractors.d.ts +52 -0
- package/dist/ai-service/util/archive-extractors.d.ts.map +1 -0
- package/dist/ai-service/util/archive-extractors.js +278 -0
- package/dist/ai-service/util/archive-extractors.js.map +1 -0
- package/dist/codegen.d.ts +1 -22
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +1 -117
- package/dist/codegen.js.map +1 -1
- package/dist/components-manager.d.ts +0 -6
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/components-manager.js +0 -27
- package/dist/components-manager.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +47 -94
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-manager.d.ts +2 -15
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +16 -128
- package/dist/file-system-manager.js.map +1 -1
- package/dist/git-service/live-branch.d.ts.map +1 -1
- package/dist/git-service/live-branch.js +15 -1
- package/dist/git-service/live-branch.js.map +1 -1
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +8 -5
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/get-fullstack-template-dir.d.ts +37 -0
- package/dist/migration/get-fullstack-template-dir.d.ts.map +1 -0
- package/dist/migration/get-fullstack-template-dir.js +99 -0
- package/dist/migration/get-fullstack-template-dir.js.map +1 -0
- package/dist/migration/migration-checklist.d.ts +60 -0
- package/dist/migration/migration-checklist.d.ts.map +1 -0
- package/dist/migration/migration-checklist.js +230 -0
- package/dist/migration/migration-checklist.js.map +1 -0
- package/dist/migration/migration-routes.d.ts +23 -0
- package/dist/migration/migration-routes.d.ts.map +1 -0
- package/dist/migration/migration-routes.js +533 -0
- package/dist/migration/migration-routes.js.map +1 -0
- package/dist/migration/restructure.d.ts +76 -0
- package/dist/migration/restructure.d.ts.map +1 -0
- package/dist/migration/restructure.js +446 -0
- package/dist/migration/restructure.js.map +1 -0
- package/dist/migration/translation-prompt.d.ts +22 -0
- package/dist/migration/translation-prompt.d.ts.map +1 -0
- package/dist/migration/translation-prompt.js +27 -0
- package/dist/migration/translation-prompt.js.map +1 -0
- package/dist/migration-templates/app-fullstack/client/App.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/components/common/sonner.tsx +20 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +73 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +21 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +197 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +432 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +45 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +117 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +143 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +390 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +259 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +182 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +300 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +129 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +403 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chat.tsx +2303 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +97 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +66 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +396 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +223 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +284 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +395 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +166 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +133 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +68 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +219 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +55 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +380 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +139 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +345 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +192 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +295 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +69 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +386 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +402 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +86 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +229 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +62 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +234 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +974 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/skeleton.tsx +13 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +198 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +95 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +145 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +87 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +148 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +225 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +150 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +175 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApi.ts +25 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApiData.ts +10 -0
- package/dist/migration-templates/app-fullstack/client/index.css +131 -0
- package/dist/migration-templates/app-fullstack/client/lib/executeApi.ts +9 -0
- package/dist/migration-templates/app-fullstack/client/lib/utils.ts +6 -0
- package/dist/migration-templates/app-fullstack/client/pages/Page1/index.tsx +3 -0
- package/dist/migration-templates/app-fullstack/client/root.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/router.tsx +48 -0
- package/dist/migration-templates/app-fullstack/client/types/node.d.ts +9 -0
- package/dist/migration-templates/app-fullstack/components.json +21 -0
- package/dist/migration-templates/app-fullstack/eslint.config.js +108 -0
- package/dist/migration-templates/app-fullstack/package.json +89 -0
- package/dist/migration-templates/app-fullstack/server/.gitkeep +0 -0
- package/dist/migration-templates/app-fullstack/server/apis/index.ts +22 -0
- package/dist/migration-templates/app-fullstack/server/index.ts +2 -0
- package/dist/migration-templates/app-fullstack/tsconfig.client.json +27 -0
- package/dist/migration-templates/app-fullstack/tsconfig.eslint.json +8 -0
- package/dist/migration-templates/app-fullstack/tsconfig.json +25 -0
- package/dist/migration-templates/app-fullstack/tsconfig.server.json +13 -0
- package/dist/migration-templates/app-fullstack/vite.config.ts +17 -0
- package/dist/parsing/imports.d.ts +0 -16
- package/dist/parsing/imports.d.ts.map +1 -1
- package/dist/parsing/imports.js +0 -68
- package/dist/parsing/imports.js.map +1 -1
- package/dist/parsing/jsx.d.ts +0 -2
- package/dist/parsing/jsx.d.ts.map +1 -1
- package/dist/parsing/jsx.js +0 -62
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +109 -32
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts +7 -85
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +19 -695
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/index.d.ts +79 -2
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +139 -10
- package/dist/sync-service/index.js.map +1 -1
- package/package.json +11 -9
- package/dist/ai-service/artifacts/bolt.d.ts +0 -8
- package/dist/ai-service/artifacts/bolt.d.ts.map +0 -1
- package/dist/ai-service/artifacts/bolt.js +0 -92
- package/dist/ai-service/artifacts/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/bolt.d.ts +0 -18
- package/dist/ai-service/result-buffer/bolt.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/bolt.js +0 -100
- package/dist/ai-service/result-buffer/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/shared.d.ts +0 -17
- package/dist/ai-service/result-buffer/shared.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/shared.js +0 -7
- package/dist/ai-service/result-buffer/shared.js.map +0 -1
- package/dist/inject-no-select.d.ts +0 -15
- package/dist/inject-no-select.d.ts.map +0 -1
- package/dist/inject-no-select.js +0 -175
- package/dist/inject-no-select.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import { AiEntityType, AiPermissionType, } from "@superblocksteam/library-shared/types";
|
|
3
|
-
import { ActionResponseType, CosmosDbPlugin, DatabricksPlugin, DynamoDBPlugin, EditorLanguage, ExtendedIntegrationPluginId, GCSPlugin, GraphQLIntegrationPluginMergedFieldNames,
|
|
3
|
+
import { ActionResponseType, CosmosDbPlugin, DatabricksPlugin, DynamoDBPlugin, EditorLanguage, ExtendedIntegrationPluginId, GCSPlugin, GraphQLIntegrationPluginMergedFieldNames, MongoDBPlugin, RestApiBodyDataType, RestApiFields, S3ActionType, S3Plugin, SalesforcePlugin, } from "@superblocksteam/shared";
|
|
4
4
|
import { getLogger } from "../../../../util/logger.js";
|
|
5
5
|
import { createToolFactory, ToolCategory, PermissionLevel, ToolExecutionError, } from "../../tools2/types.js";
|
|
6
6
|
import { codeBlock } from "../../tools2/utils.js";
|
|
@@ -42,6 +42,219 @@ Focus on the domain names, the specific number of records if limited, and the ta
|
|
|
42
42
|
CRITICAL: Always specify which integration is being used with the format @IntegrationName[id=INTEGRATION_ID] where INTEGRATION_ID is the integrationId parameter and IntegrationName is the tagName of the integration.
|
|
43
43
|
DO NOT explain why or include context.
|
|
44
44
|
`;
|
|
45
|
+
// Hoisted out of the factory so `classifyPermissionType` and tests can derive
|
|
46
|
+
// their argument types directly from the schema via `z.infer`, instead of
|
|
47
|
+
// manually duplicating the discriminated union (which would silently drift
|
|
48
|
+
// when plugin types or fields are added).
|
|
49
|
+
const inputSchema = z.object({
|
|
50
|
+
integrationId: z.string().min(1).describe("The ID of the integration"),
|
|
51
|
+
operation: z
|
|
52
|
+
.enum(["read", "write"])
|
|
53
|
+
.describe("Declare whether this request only reads data (read) or creates/updates/deletes data (write). " +
|
|
54
|
+
"This is only consulted for ambiguous cases — REST POST requests and 'other' plugin types — " +
|
|
55
|
+
"where intent cannot be determined structurally. For SQL/Salesforce/GraphQL/S3/DynamoDB/GCS/" +
|
|
56
|
+
"CosmosDB/MongoDB, intent is derived from the query or schema and this field is effectively ignored. " +
|
|
57
|
+
"For REST PUT/PATCH/DELETE, it is always treated as a write regardless of this field. " +
|
|
58
|
+
"Still set it accurately: choose 'read' for queries, searches, lists, and fetches; 'write' for " +
|
|
59
|
+
"anything that modifies server state. Write operations require user approval."),
|
|
60
|
+
description: z.object({
|
|
61
|
+
request: z.string().min(1).describe(`
|
|
62
|
+
${DESCRIPTION_BASE_PROMPT}
|
|
63
|
+
Phrased as a request for permission.
|
|
64
|
+
Examples: "Ok if I read 20 orders from @DemoOrders[id=abc123]?", "Ok if I read 5 rows from the users table of @Postgres[id=xyz789]?", "Ok if I read 10 issues from @Linear[id=def456]?".
|
|
65
|
+
`),
|
|
66
|
+
present: z.string().min(1).describe(`
|
|
67
|
+
${DESCRIPTION_BASE_PROMPT}.
|
|
68
|
+
Phrased as a present tense statement.
|
|
69
|
+
Examples: "Reading 20 orders from @DemoOrders[id=abc123]", "Reading 5 rows from the users table of @Postgres[id=xyz789]", "Reading 10 issues from @Linear[id=def456]".
|
|
70
|
+
`),
|
|
71
|
+
past: z.string().min(1).describe(`
|
|
72
|
+
${DESCRIPTION_BASE_PROMPT}.
|
|
73
|
+
Phrased as a past tense statement.
|
|
74
|
+
Examples: "Read 20 orders from @DemoOrders[id=abc123]", "Read 5 rows from the users table of @Postgres[id=xyz789]", "Read 10 issues from @Linear[id=def456]".
|
|
75
|
+
`),
|
|
76
|
+
}),
|
|
77
|
+
params: z.discriminatedUnion("type", [
|
|
78
|
+
z.object({
|
|
79
|
+
type: z.literal("sql"),
|
|
80
|
+
query: z.string().min(1).describe("The SQL query string to execute"),
|
|
81
|
+
}),
|
|
82
|
+
z.object({
|
|
83
|
+
type: z.literal("graphql"),
|
|
84
|
+
graphQLQuery: z.object({
|
|
85
|
+
query: z
|
|
86
|
+
.string()
|
|
87
|
+
.min(1)
|
|
88
|
+
.describe("The GraphQL query string to execute"),
|
|
89
|
+
variables: z
|
|
90
|
+
.record(z.unknown())
|
|
91
|
+
.optional()
|
|
92
|
+
.describe("Optional variables for the GraphQL query"),
|
|
93
|
+
headers: z
|
|
94
|
+
.record(z.string())
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Optional HTTP headers to include in the request"),
|
|
97
|
+
}),
|
|
98
|
+
}),
|
|
99
|
+
z.object({
|
|
100
|
+
type: z.literal("rest"),
|
|
101
|
+
httpRequest: z.object({
|
|
102
|
+
httpMethod: z
|
|
103
|
+
.enum(["GET", "POST", "PUT", "PATCH", "DELETE"])
|
|
104
|
+
.describe("The HTTP method for the request"),
|
|
105
|
+
path: z
|
|
106
|
+
.string()
|
|
107
|
+
.min(1)
|
|
108
|
+
.describe("The URL path to the API endpoint, beginning with a '/'"),
|
|
109
|
+
headers: z
|
|
110
|
+
.record(z.string())
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("Optional HTTP headers to include in the request"),
|
|
113
|
+
queryParams: z
|
|
114
|
+
.record(z.string())
|
|
115
|
+
.optional()
|
|
116
|
+
.describe("Optional query parameters to include in the request"),
|
|
117
|
+
body: z
|
|
118
|
+
.string()
|
|
119
|
+
.optional()
|
|
120
|
+
.refine((val) => {
|
|
121
|
+
if (val === undefined)
|
|
122
|
+
return true;
|
|
123
|
+
try {
|
|
124
|
+
JSON.parse(val);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}, { message: "body must be a JSON-encoded string" })
|
|
131
|
+
.describe("Optional JSON-encoded request body (for POST, PUT, PATCH methods). " +
|
|
132
|
+
"Must be a string containing valid JSON — e.g. '{\"foo\": 1}'. " +
|
|
133
|
+
"Sent with Content-Type: application/json."),
|
|
134
|
+
}),
|
|
135
|
+
}),
|
|
136
|
+
z.object({
|
|
137
|
+
type: z.literal("s3"),
|
|
138
|
+
action: z.enum(S3_READ_ACTIONS).describe("The S3 action to perform"),
|
|
139
|
+
resource: z
|
|
140
|
+
.string()
|
|
141
|
+
.optional()
|
|
142
|
+
.describe("The S3 bucket name (required for all actions except LIST_BUCKETS)"),
|
|
143
|
+
path: z
|
|
144
|
+
.string()
|
|
145
|
+
.optional()
|
|
146
|
+
.describe("The object key/path (required for GET_OBJECT and GENERATE_PRESIGNED_URL)"),
|
|
147
|
+
listFilesConfig: z
|
|
148
|
+
.object({
|
|
149
|
+
prefix: z
|
|
150
|
+
.string()
|
|
151
|
+
.optional()
|
|
152
|
+
.describe("Prefix filter for listing objects"),
|
|
153
|
+
delimiter: z
|
|
154
|
+
.string()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe("Delimiter for hierarchical listing (e.g. '/' for folder-like grouping)"),
|
|
157
|
+
})
|
|
158
|
+
.optional()
|
|
159
|
+
.describe("Configuration for LIST_BUCKET_OBJECTS action"),
|
|
160
|
+
}),
|
|
161
|
+
z.object({
|
|
162
|
+
type: z.literal("cosmosdb"),
|
|
163
|
+
actionCategory: z
|
|
164
|
+
.enum(COSMOSDB_READ_CATEGORY_CASES)
|
|
165
|
+
.describe("The CosmosDB action category: 'sql' for SQL queries, 'pointOperation' for single object actions"),
|
|
166
|
+
actionCase: z
|
|
167
|
+
.enum(COSMOSDB_READ_ACTION_CASES)
|
|
168
|
+
.describe("The specific action: 'singleton' for SQL queries, 'read' for point reads"),
|
|
169
|
+
containerId: z.string().optional().describe("The CosmosDB container ID"),
|
|
170
|
+
query: z
|
|
171
|
+
.string()
|
|
172
|
+
.optional()
|
|
173
|
+
.describe("The SQL query string (required for sql/singleton action)"),
|
|
174
|
+
partitionKey: z
|
|
175
|
+
.string()
|
|
176
|
+
.optional()
|
|
177
|
+
.describe("The partition key for point operations"),
|
|
178
|
+
id: z
|
|
179
|
+
.string()
|
|
180
|
+
.optional()
|
|
181
|
+
.describe("The item ID (required for pointOperation/read action)"),
|
|
182
|
+
}),
|
|
183
|
+
z.object({
|
|
184
|
+
type: z.literal("dynamodb"),
|
|
185
|
+
action: z
|
|
186
|
+
.enum(DYNAMODB_READ_ACTIONS)
|
|
187
|
+
.describe("The DynamoDB action to perform (read-only)"),
|
|
188
|
+
body: z
|
|
189
|
+
.string()
|
|
190
|
+
.optional()
|
|
191
|
+
.describe("JSON string of DynamoDB request parameters (e.g. TableName, Key, FilterExpression)"),
|
|
192
|
+
}),
|
|
193
|
+
z.object({
|
|
194
|
+
type: z.literal("gcs"),
|
|
195
|
+
action: z
|
|
196
|
+
.enum(GCS_READ_ACTIONS)
|
|
197
|
+
.describe("The GCS action to perform (read-only)"),
|
|
198
|
+
resource: z
|
|
199
|
+
.string()
|
|
200
|
+
.optional()
|
|
201
|
+
.describe("The GCS bucket name (required for all actions except LIST_BUCKETS)"),
|
|
202
|
+
path: z
|
|
203
|
+
.string()
|
|
204
|
+
.optional()
|
|
205
|
+
.describe("The object key/path (required for GET_OBJECT and GENERATE_PRESIGNED_URL)"),
|
|
206
|
+
prefix: z
|
|
207
|
+
.string()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe("Prefix filter for listing objects or buckets"),
|
|
210
|
+
}),
|
|
211
|
+
z.object({
|
|
212
|
+
type: z.literal("mongodb"),
|
|
213
|
+
action: z
|
|
214
|
+
.enum(MONGODB_READ_ACTIONS)
|
|
215
|
+
.describe("The MongoDB operation to perform (read-only)"),
|
|
216
|
+
collection: z
|
|
217
|
+
.string()
|
|
218
|
+
.optional()
|
|
219
|
+
.describe("The collection name (required for all actions except listCollections)"),
|
|
220
|
+
query: z
|
|
221
|
+
.string()
|
|
222
|
+
.optional()
|
|
223
|
+
.describe("JSON query filter for count, distinct, find, findOne operations"),
|
|
224
|
+
pipeline: z
|
|
225
|
+
.string()
|
|
226
|
+
.optional()
|
|
227
|
+
.describe("JSON aggregation pipeline array for aggregate operation"),
|
|
228
|
+
projection: z
|
|
229
|
+
.string()
|
|
230
|
+
.optional()
|
|
231
|
+
.describe("JSON projection document for find/findOne operations"),
|
|
232
|
+
sortby: z
|
|
233
|
+
.string()
|
|
234
|
+
.optional()
|
|
235
|
+
.describe("JSON sort specification for find operation"),
|
|
236
|
+
limit: z
|
|
237
|
+
.string()
|
|
238
|
+
.optional()
|
|
239
|
+
.describe("Maximum number of documents to return for find operation"),
|
|
240
|
+
field: z
|
|
241
|
+
.string()
|
|
242
|
+
.optional()
|
|
243
|
+
.describe("Field name for distinct operation"),
|
|
244
|
+
}),
|
|
245
|
+
z.object({
|
|
246
|
+
type: z.literal("salesforce"),
|
|
247
|
+
query: z.string().min(1).describe("The SOQL query string to execute"),
|
|
248
|
+
}),
|
|
249
|
+
z.object({
|
|
250
|
+
type: z.literal("other"),
|
|
251
|
+
body: z
|
|
252
|
+
.string()
|
|
253
|
+
.min(1)
|
|
254
|
+
.describe("The body of the request to execute against the integration"),
|
|
255
|
+
}),
|
|
256
|
+
]),
|
|
257
|
+
});
|
|
45
258
|
export const executeRequestToIntegrationToolFactory = createToolFactory("executeRequestToIntegration", ({ clark, services, }) => {
|
|
46
259
|
return {
|
|
47
260
|
category: ToolCategory.DATA,
|
|
@@ -51,7 +264,7 @@ export const executeRequestToIntegrationToolFactory = createToolFactory("execute
|
|
|
51
264
|
|
|
52
265
|
You can use this tool to query data from databases, APIs, or other external services that the user has connected to their application.
|
|
53
266
|
|
|
54
|
-
|
|
267
|
+
Both read-only and write operations are supported. Write operations (creating, updating, or deleting data) will require user approval before execution.
|
|
55
268
|
|
|
56
269
|
IMPORTANT: SQL queries must include a row limit clause with a maximum of ${MAX_QUERY_LIMIT} rows.
|
|
57
270
|
Supported syntax: LIMIT N (MySQL/PostgreSQL), SELECT TOP N (SQL Server), or FETCH NEXT N ROWS ONLY (ANSI SQL).
|
|
@@ -64,7 +277,7 @@ export const executeRequestToIntegrationToolFactory = createToolFactory("execute
|
|
|
64
277
|
Plugin Types:
|
|
65
278
|
- "sql": For SQL database integrations, including Databricks. Provide a SQL query string.
|
|
66
279
|
- "graphql": For GraphQL integrations (${ExtendedIntegrationPluginId.GRAPHQL}). Provide query, variables, and headers.
|
|
67
|
-
- "rest": For REST API integrations (${ExtendedIntegrationPluginId.REST_API}). HTTP method
|
|
280
|
+
- "rest": For REST API integrations (${ExtendedIntegrationPluginId.REST_API}). Provide HTTP method (GET, POST, PUT, PATCH, DELETE), path, headers, query parameters, and optionally a JSON body.
|
|
68
281
|
- "s3": For Amazon S3 integrations (${S3Plugin.id}). Provide a structured action (LIST_BUCKETS, LIST_BUCKET_OBJECTS, GET_OBJECT, GENERATE_PRESIGNED_URL) with optional resource (bucket name), path, and listFilesConfig.
|
|
69
282
|
- "cosmosdb": For Azure Cosmos DB integrations (${CosmosDbPlugin.id}). Provide a structured action with actionCategory (sql or pointOperation) and actionCase (singleton for SQL queries, read for point reads).
|
|
70
283
|
- "dynamodb": For Amazon DynamoDB integrations (${DynamoDBPlugin.id}). Provide a structured action (getItem, query, scan, listTables, describeTable) with JSON params.
|
|
@@ -76,197 +289,7 @@ export const executeRequestToIntegrationToolFactory = createToolFactory("execute
|
|
|
76
289
|
Authentication is handled automatically based on the integration configuration.
|
|
77
290
|
Response data is returned as a JSON object.
|
|
78
291
|
`,
|
|
79
|
-
inputSchema
|
|
80
|
-
integrationId: z.string().min(1).describe("The ID of the integration"),
|
|
81
|
-
description: z.object({
|
|
82
|
-
request: z.string().min(1).describe(`
|
|
83
|
-
${DESCRIPTION_BASE_PROMPT}
|
|
84
|
-
Phrased as a request for permission.
|
|
85
|
-
Examples: "Ok if I read 20 orders from @DemoOrders[id=abc123]?", "Ok if I read 5 rows from the users table of @Postgres[id=xyz789]?", "Ok if I read 10 issues from @Linear[id=def456]?".
|
|
86
|
-
`),
|
|
87
|
-
present: z.string().min(1).describe(`
|
|
88
|
-
${DESCRIPTION_BASE_PROMPT}.
|
|
89
|
-
Phrased as a present tense statement.
|
|
90
|
-
Examples: "Reading 20 orders from @DemoOrders[id=abc123]", "Reading 5 rows from the users table of @Postgres[id=xyz789]", "Reading 10 issues from @Linear[id=def456]".
|
|
91
|
-
`),
|
|
92
|
-
past: z.string().min(1).describe(`
|
|
93
|
-
${DESCRIPTION_BASE_PROMPT}.
|
|
94
|
-
Phrased as a past tense statement.
|
|
95
|
-
Examples: "Read 20 orders from @DemoOrders[id=abc123]", "Read 5 rows from the users table of @Postgres[id=xyz789]", "Read 10 issues from @Linear[id=def456]".
|
|
96
|
-
`),
|
|
97
|
-
}),
|
|
98
|
-
params: z.discriminatedUnion("type", [
|
|
99
|
-
z.object({
|
|
100
|
-
type: z.literal("sql"),
|
|
101
|
-
query: z
|
|
102
|
-
.string()
|
|
103
|
-
.min(1)
|
|
104
|
-
.describe("The SQL query string to execute"),
|
|
105
|
-
}),
|
|
106
|
-
z.object({
|
|
107
|
-
type: z.literal("graphql"),
|
|
108
|
-
graphQLQuery: z.object({
|
|
109
|
-
query: z
|
|
110
|
-
.string()
|
|
111
|
-
.min(1)
|
|
112
|
-
.describe("The GraphQL query string to execute"),
|
|
113
|
-
variables: z
|
|
114
|
-
.record(z.unknown())
|
|
115
|
-
.optional()
|
|
116
|
-
.describe("Optional variables for the GraphQL query"),
|
|
117
|
-
headers: z
|
|
118
|
-
.record(z.string())
|
|
119
|
-
.optional()
|
|
120
|
-
.describe("Optional HTTP headers to include in the request"),
|
|
121
|
-
}),
|
|
122
|
-
}),
|
|
123
|
-
z.object({
|
|
124
|
-
type: z.literal("rest"),
|
|
125
|
-
httpRequest: z.object({
|
|
126
|
-
path: z
|
|
127
|
-
.string()
|
|
128
|
-
.min(1)
|
|
129
|
-
.describe("The URL path to the API endpoint, beginning with a '/'"),
|
|
130
|
-
headers: z
|
|
131
|
-
.record(z.string())
|
|
132
|
-
.optional()
|
|
133
|
-
.describe("Optional HTTP headers to include in the request"),
|
|
134
|
-
queryParams: z
|
|
135
|
-
.record(z.string())
|
|
136
|
-
.optional()
|
|
137
|
-
.describe("Optional query parameters to include in the request"),
|
|
138
|
-
}),
|
|
139
|
-
}),
|
|
140
|
-
z.object({
|
|
141
|
-
type: z.literal("s3"),
|
|
142
|
-
action: z
|
|
143
|
-
.enum(S3_READ_ACTIONS)
|
|
144
|
-
.describe("The S3 action to perform"),
|
|
145
|
-
resource: z
|
|
146
|
-
.string()
|
|
147
|
-
.optional()
|
|
148
|
-
.describe("The S3 bucket name (required for all actions except LIST_BUCKETS)"),
|
|
149
|
-
path: z
|
|
150
|
-
.string()
|
|
151
|
-
.optional()
|
|
152
|
-
.describe("The object key/path (required for GET_OBJECT and GENERATE_PRESIGNED_URL)"),
|
|
153
|
-
listFilesConfig: z
|
|
154
|
-
.object({
|
|
155
|
-
prefix: z
|
|
156
|
-
.string()
|
|
157
|
-
.optional()
|
|
158
|
-
.describe("Prefix filter for listing objects"),
|
|
159
|
-
delimiter: z
|
|
160
|
-
.string()
|
|
161
|
-
.optional()
|
|
162
|
-
.describe("Delimiter for hierarchical listing (e.g. '/' for folder-like grouping)"),
|
|
163
|
-
})
|
|
164
|
-
.optional()
|
|
165
|
-
.describe("Configuration for LIST_BUCKET_OBJECTS action"),
|
|
166
|
-
}),
|
|
167
|
-
z.object({
|
|
168
|
-
type: z.literal("cosmosdb"),
|
|
169
|
-
actionCategory: z
|
|
170
|
-
.enum(COSMOSDB_READ_CATEGORY_CASES)
|
|
171
|
-
.describe("The CosmosDB action category: 'sql' for SQL queries, 'pointOperation' for single object actions"),
|
|
172
|
-
actionCase: z
|
|
173
|
-
.enum(COSMOSDB_READ_ACTION_CASES)
|
|
174
|
-
.describe("The specific action: 'singleton' for SQL queries, 'read' for point reads"),
|
|
175
|
-
containerId: z
|
|
176
|
-
.string()
|
|
177
|
-
.optional()
|
|
178
|
-
.describe("The CosmosDB container ID"),
|
|
179
|
-
query: z
|
|
180
|
-
.string()
|
|
181
|
-
.optional()
|
|
182
|
-
.describe("The SQL query string (required for sql/singleton action)"),
|
|
183
|
-
partitionKey: z
|
|
184
|
-
.string()
|
|
185
|
-
.optional()
|
|
186
|
-
.describe("The partition key for point operations"),
|
|
187
|
-
id: z
|
|
188
|
-
.string()
|
|
189
|
-
.optional()
|
|
190
|
-
.describe("The item ID (required for pointOperation/read action)"),
|
|
191
|
-
}),
|
|
192
|
-
z.object({
|
|
193
|
-
type: z.literal("dynamodb"),
|
|
194
|
-
action: z
|
|
195
|
-
.enum(DYNAMODB_READ_ACTIONS)
|
|
196
|
-
.describe("The DynamoDB action to perform (read-only)"),
|
|
197
|
-
body: z
|
|
198
|
-
.string()
|
|
199
|
-
.optional()
|
|
200
|
-
.describe("JSON string of DynamoDB request parameters (e.g. TableName, Key, FilterExpression)"),
|
|
201
|
-
}),
|
|
202
|
-
z.object({
|
|
203
|
-
type: z.literal("gcs"),
|
|
204
|
-
action: z
|
|
205
|
-
.enum(GCS_READ_ACTIONS)
|
|
206
|
-
.describe("The GCS action to perform (read-only)"),
|
|
207
|
-
resource: z
|
|
208
|
-
.string()
|
|
209
|
-
.optional()
|
|
210
|
-
.describe("The GCS bucket name (required for all actions except LIST_BUCKETS)"),
|
|
211
|
-
path: z
|
|
212
|
-
.string()
|
|
213
|
-
.optional()
|
|
214
|
-
.describe("The object key/path (required for GET_OBJECT and GENERATE_PRESIGNED_URL)"),
|
|
215
|
-
prefix: z
|
|
216
|
-
.string()
|
|
217
|
-
.optional()
|
|
218
|
-
.describe("Prefix filter for listing objects or buckets"),
|
|
219
|
-
}),
|
|
220
|
-
z.object({
|
|
221
|
-
type: z.literal("mongodb"),
|
|
222
|
-
action: z
|
|
223
|
-
.enum(MONGODB_READ_ACTIONS)
|
|
224
|
-
.describe("The MongoDB operation to perform (read-only)"),
|
|
225
|
-
collection: z
|
|
226
|
-
.string()
|
|
227
|
-
.optional()
|
|
228
|
-
.describe("The collection name (required for all actions except listCollections)"),
|
|
229
|
-
query: z
|
|
230
|
-
.string()
|
|
231
|
-
.optional()
|
|
232
|
-
.describe("JSON query filter for count, distinct, find, findOne operations"),
|
|
233
|
-
pipeline: z
|
|
234
|
-
.string()
|
|
235
|
-
.optional()
|
|
236
|
-
.describe("JSON aggregation pipeline array for aggregate operation"),
|
|
237
|
-
projection: z
|
|
238
|
-
.string()
|
|
239
|
-
.optional()
|
|
240
|
-
.describe("JSON projection document for find/findOne operations"),
|
|
241
|
-
sortby: z
|
|
242
|
-
.string()
|
|
243
|
-
.optional()
|
|
244
|
-
.describe("JSON sort specification for find operation"),
|
|
245
|
-
limit: z
|
|
246
|
-
.string()
|
|
247
|
-
.optional()
|
|
248
|
-
.describe("Maximum number of documents to return for find operation"),
|
|
249
|
-
field: z
|
|
250
|
-
.string()
|
|
251
|
-
.optional()
|
|
252
|
-
.describe("Field name for distinct operation"),
|
|
253
|
-
}),
|
|
254
|
-
z.object({
|
|
255
|
-
type: z.literal("salesforce"),
|
|
256
|
-
query: z
|
|
257
|
-
.string()
|
|
258
|
-
.min(1)
|
|
259
|
-
.describe("The SOQL query string to execute"),
|
|
260
|
-
}),
|
|
261
|
-
z.object({
|
|
262
|
-
type: z.literal("other"),
|
|
263
|
-
body: z
|
|
264
|
-
.string()
|
|
265
|
-
.min(1)
|
|
266
|
-
.describe("The body of the request to execute against the integration"),
|
|
267
|
-
}),
|
|
268
|
-
]),
|
|
269
|
-
}),
|
|
292
|
+
inputSchema,
|
|
270
293
|
toModelOutput: ({ output }) => {
|
|
271
294
|
if (output.isPartial) {
|
|
272
295
|
return {
|
|
@@ -451,19 +474,34 @@ export const executeRequestToIntegrationToolFactory = createToolFactory("execute
|
|
|
451
474
|
}
|
|
452
475
|
},
|
|
453
476
|
getRequiredPermissions: (args) => {
|
|
477
|
+
const permissionType = classifyPermissionType(args);
|
|
454
478
|
return [
|
|
455
479
|
{
|
|
456
480
|
entityType: AiEntityType.INTEGRATION,
|
|
457
481
|
entityId: args.integrationId,
|
|
458
|
-
permissionType
|
|
482
|
+
permissionType,
|
|
459
483
|
},
|
|
460
484
|
];
|
|
461
485
|
},
|
|
462
|
-
getActionName: () =>
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
486
|
+
getActionName: (input) => {
|
|
487
|
+
// When the tool is about to perform a write (POST/PUT/PATCH/DELETE,
|
|
488
|
+
// GraphQL mutation, or an "other"/"write"-declared op), use an
|
|
489
|
+
// operation-neutral verb in the approval dialog so users aren't
|
|
490
|
+
// told they're "Querying" an integration right before an update
|
|
491
|
+
// or delete is executed.
|
|
492
|
+
if (input && classifyPermissionType(input) === AiPermissionType.WRITE) {
|
|
493
|
+
return {
|
|
494
|
+
future: "Execute",
|
|
495
|
+
present: "Executing",
|
|
496
|
+
past: "Executed",
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
future: "Query",
|
|
501
|
+
present: "Querying",
|
|
502
|
+
past: "Queried",
|
|
503
|
+
};
|
|
504
|
+
},
|
|
467
505
|
formatInput: (args) => {
|
|
468
506
|
const { params, integrationId, description } = args;
|
|
469
507
|
const integration = services.integrationStore.getEntityTag(integrationId) ??
|
|
@@ -489,15 +527,16 @@ export const executeRequestToIntegrationToolFactory = createToolFactory("execute
|
|
|
489
527
|
};
|
|
490
528
|
}
|
|
491
529
|
case "rest": {
|
|
492
|
-
const { path, queryParams } = params.httpRequest;
|
|
530
|
+
const { httpMethod, path, queryParams, body } = params.httpRequest;
|
|
493
531
|
const queryString = queryParams
|
|
494
532
|
? `?${Object.entries(queryParams)
|
|
495
|
-
.map((key, val) =>
|
|
533
|
+
.map(([key, val]) => `${key}=${val}`)
|
|
496
534
|
.join("&")}`
|
|
497
535
|
: "";
|
|
536
|
+
const bodySnippet = body ? `\n${body}` : "";
|
|
498
537
|
return {
|
|
499
538
|
targets: [integration],
|
|
500
|
-
details: codeBlock(
|
|
539
|
+
details: codeBlock(`${httpMethod} ${path}${queryString}${bodySnippet}`),
|
|
501
540
|
summary: cleanDescription,
|
|
502
541
|
};
|
|
503
542
|
}
|
|
@@ -704,7 +743,7 @@ function buildS3Request(params) {
|
|
|
704
743
|
}
|
|
705
744
|
function buildRestApiRequest(httpRequest) {
|
|
706
745
|
const request = {
|
|
707
|
-
[RestApiFields.HTTP_METHOD]:
|
|
746
|
+
[RestApiFields.HTTP_METHOD]: httpRequest.httpMethod,
|
|
708
747
|
[RestApiFields.URL_PATH]: httpRequest.path,
|
|
709
748
|
[RestApiFields.RESPONSE_TYPE]: ActionResponseType.JSON,
|
|
710
749
|
};
|
|
@@ -714,6 +753,10 @@ function buildRestApiRequest(httpRequest) {
|
|
|
714
753
|
if (httpRequest.queryParams) {
|
|
715
754
|
request[RestApiFields.PARAMS] = recordToProto(httpRequest.queryParams);
|
|
716
755
|
}
|
|
756
|
+
if (httpRequest.body) {
|
|
757
|
+
request[RestApiFields.BODY] = httpRequest.body;
|
|
758
|
+
request[RestApiFields.BODY_TYPE] = RestApiBodyDataType.JSON;
|
|
759
|
+
}
|
|
717
760
|
return request;
|
|
718
761
|
}
|
|
719
762
|
function buildDynamoDBRequest(params) {
|
|
@@ -793,4 +836,87 @@ function buildMongoDBRequest(params) {
|
|
|
793
836
|
}
|
|
794
837
|
return request;
|
|
795
838
|
}
|
|
839
|
+
/**
|
|
840
|
+
* Strips GraphQL comments and string literals from a query so that
|
|
841
|
+
* keyword matching only operates on structural tokens.
|
|
842
|
+
*/
|
|
843
|
+
function stripGraphQLNonCode(query) {
|
|
844
|
+
return query
|
|
845
|
+
.replace(/"""[\s\S]*?"""/g, "") // strip block strings
|
|
846
|
+
.replace(/"(?:[^"\\]|\\.)*"/g, "") // strip double-quoted strings
|
|
847
|
+
.replace(/#.*$/gm, ""); // strip # comments (after strings so # inside strings is safe)
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* Classifies a GraphQL query as READ or WRITE by regex-matching the top-level
|
|
851
|
+
* operation type keyword on a stripped copy of the document (comments and
|
|
852
|
+
* string literals removed). This is a structural check, not full AST parsing.
|
|
853
|
+
*
|
|
854
|
+
* Handles documents with fragments before operations and multiple operations.
|
|
855
|
+
* Falls back to WRITE on any error (fail-closed).
|
|
856
|
+
*/
|
|
857
|
+
function classifyGraphQLOperation(query) {
|
|
858
|
+
try {
|
|
859
|
+
const stripped = stripGraphQLNonCode(query);
|
|
860
|
+
// In valid GraphQL, the `mutation` keyword appears as an operation type at
|
|
861
|
+
// the top level — either at the start of the document or after a closing
|
|
862
|
+
// brace `}` (e.g. after a fragment definition).
|
|
863
|
+
if (/(?:^|})[\s]*mutation\b/i.test(stripped)) {
|
|
864
|
+
return AiPermissionType.WRITE;
|
|
865
|
+
}
|
|
866
|
+
return AiPermissionType.READ;
|
|
867
|
+
}
|
|
868
|
+
catch (err) {
|
|
869
|
+
// Fail-closed: treat as WRITE on error. Log so future regressions in the
|
|
870
|
+
// regex/stripping logic are debuggable instead of silently over-prompting.
|
|
871
|
+
getLogger().warn("classifyGraphQLOperation failed; falling back to WRITE", err);
|
|
872
|
+
return AiPermissionType.WRITE;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Classifies permission type using a hybrid approach:
|
|
877
|
+
* 1. Deterministic floor (free): GET→READ, DELETE/PUT/PATCH→WRITE,
|
|
878
|
+
* SQL/Salesforce→READ, GraphQL structural check,
|
|
879
|
+
* S3/DynamoDB/GCS/CosmosDB/MongoDB→READ.
|
|
880
|
+
* 2. Clark's declared `operation` for the remaining ambiguous cases:
|
|
881
|
+
* REST POST, and the "other" plugin type.
|
|
882
|
+
*
|
|
883
|
+
* Note on SQL/Salesforce: classification relies on the DML keyword check in
|
|
884
|
+
* `execute()` (search for `dmlKeywords`) to actually block writes. If that
|
|
885
|
+
* enforcement is ever relaxed to allow SQL writes, this function must be
|
|
886
|
+
* updated in lockstep — otherwise writes will silently bypass user approval.
|
|
887
|
+
*/
|
|
888
|
+
function classifyPermissionType(args) {
|
|
889
|
+
const { params, operation } = args;
|
|
890
|
+
// Deterministic floor: SQL/Salesforce always READ (DML keyword check in
|
|
891
|
+
// execute() — see comment above — blocks writes at request time).
|
|
892
|
+
if (params.type === "sql" || params.type === "salesforce") {
|
|
893
|
+
return AiPermissionType.READ;
|
|
894
|
+
}
|
|
895
|
+
if (params.type === "graphql") {
|
|
896
|
+
return classifyGraphQLOperation(params.graphQLQuery.query);
|
|
897
|
+
}
|
|
898
|
+
// Deterministic floor for REST: GET is always READ; DELETE/PUT/PATCH are
|
|
899
|
+
// semantically mutating and always WRITE. Only POST is truly ambiguous
|
|
900
|
+
// (e.g. search APIs, RPC-style reads) and falls through to Clark's
|
|
901
|
+
// declared operation below.
|
|
902
|
+
if (params.type === "rest") {
|
|
903
|
+
const method = params.httpRequest.httpMethod;
|
|
904
|
+
if (method === "GET") {
|
|
905
|
+
return AiPermissionType.READ;
|
|
906
|
+
}
|
|
907
|
+
if (method === "DELETE" || method === "PUT" || method === "PATCH") {
|
|
908
|
+
return AiPermissionType.WRITE;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
// Schema-constrained read-only types (enum limits to read actions)
|
|
912
|
+
if (params.type === "s3" ||
|
|
913
|
+
params.type === "dynamodb" ||
|
|
914
|
+
params.type === "gcs" ||
|
|
915
|
+
params.type === "cosmosdb" ||
|
|
916
|
+
params.type === "mongodb") {
|
|
917
|
+
return AiPermissionType.READ;
|
|
918
|
+
}
|
|
919
|
+
// For everything else (REST POST, "other"): trust Clark's declaration.
|
|
920
|
+
return operation === "write" ? AiPermissionType.WRITE : AiPermissionType.READ;
|
|
921
|
+
}
|
|
796
922
|
//# sourceMappingURL=execute-request.js.map
|