@superblocksteam/vite-plugin-file-sync 2.0.115-next.0 → 2.0.115-next.1
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 +51 -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,20 +1,9 @@
|
|
|
1
|
-
import type { NodePath, Node } from "@babel/traverse";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import { type PromptClassification
|
|
4
|
-
import type {
|
|
2
|
+
import { type PromptClassification } from "@superblocksteam/library-shared/types";
|
|
3
|
+
import type { FileArtifact, SdkIntegration } from "../types.js";
|
|
5
4
|
export declare const PromptClassificationEnum: z.ZodEnum<[string, ...string[]]>;
|
|
6
|
-
export interface ComponentTarget {
|
|
7
|
-
bindName: string | undefined;
|
|
8
|
-
elementId: SbElement;
|
|
9
|
-
tagName: string;
|
|
10
|
-
filePath: string;
|
|
11
|
-
isCustomComponent: boolean;
|
|
12
|
-
nodePath: NodePath<Node>;
|
|
13
|
-
}
|
|
14
5
|
export interface PromptBuildOptions {
|
|
15
6
|
classification: PromptClassification;
|
|
16
|
-
artifactProcessor: ArtifactProcessor;
|
|
17
|
-
componentTargets?: ComponentTarget[];
|
|
18
7
|
workingDirectory?: string;
|
|
19
8
|
integrationPromptContent?: SdkIntegration[];
|
|
20
9
|
unresolvedIntegrations?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ai-service/prompt-builder-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/ai-service/prompt-builder-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,eAAO,MAAM,wBAAwB,kCAKpC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,oBAAoB,CAAC;IAErC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,wBAAwB,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5C,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ai-service/prompt-builder-service/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ai-service/prompt-builder-service/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,iCAAiC,GAElC,MAAM,uCAAuC,CAAC;AAI/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAC5C,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,MAAM;AACnD,wCAAwC;AACxC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,UAAU,CACH,CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_registry.generated.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/skills/system/_registry.generated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_registry.generated.d.ts","sourceRoot":"","sources":["../../../../src/ai-service/skills/system/_registry.generated.ts"],"names":[],"mappings":"AAcA;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWhD,CAAC"}
|
|
@@ -7,6 +7,9 @@ import { content as superblocks_api_references_sql_databases } from "./superbloc
|
|
|
7
7
|
import { content as superblocks_api_skill } from "./superblocks-api/skill.generated.js";
|
|
8
8
|
import { content as superblocks_frontend_references_embedding } from "./superblocks-frontend/references/embedding.generated.js";
|
|
9
9
|
import { content as superblocks_frontend_skill } from "./superblocks-frontend/skill.generated.js";
|
|
10
|
+
import { content as superblocks_migration_references_focused_debug } from "./superblocks-migration/references/focused-debug.generated.js";
|
|
11
|
+
import { content as superblocks_migration_references_yaml_block_mapping } from "./superblocks-migration/references/yaml-block-mapping.generated.js";
|
|
12
|
+
import { content as superblocks_migration_skill } from "./superblocks-migration/skill.generated.js";
|
|
10
13
|
/**
|
|
11
14
|
* Map of skill file paths to their content.
|
|
12
15
|
* Keys are relative paths from skills/system/ (e.g., "superblocks-frontend/SKILL.md")
|
|
@@ -19,5 +22,8 @@ export const SYSTEM_SKILLS = {
|
|
|
19
22
|
"superblocks-api/references/sql-databases.md": superblocks_api_references_sql_databases,
|
|
20
23
|
"superblocks-frontend/SKILL.md": superblocks_frontend_skill,
|
|
21
24
|
"superblocks-frontend/references/embedding.md": superblocks_frontend_references_embedding,
|
|
25
|
+
"superblocks-migration/SKILL.md": superblocks_migration_skill,
|
|
26
|
+
"superblocks-migration/references/focused-debug.md": superblocks_migration_references_focused_debug,
|
|
27
|
+
"superblocks-migration/references/yaml-block-mapping.md": superblocks_migration_references_yaml_block_mapping,
|
|
22
28
|
};
|
|
23
29
|
//# sourceMappingURL=_registry.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_registry.generated.js","sourceRoot":"","sources":["../../../../src/ai-service/skills/system/_registry.generated.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qDAAqD;AAErD,OAAO,EAAE,OAAO,IAAI,sCAAsC,EAAE,MAAM,uDAAuD,CAAC;AAC1H,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAClH,OAAO,EAAE,OAAO,IAAI,oCAAoC,EAAE,MAAM,qDAAqD,CAAC;AACtH,OAAO,EAAE,OAAO,IAAI,wCAAwC,EAAE,MAAM,yDAAyD,CAAC;AAC9H,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,yCAAyC,EAAE,MAAM,0DAA0D,CAAC;AAChI,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"_registry.generated.js","sourceRoot":"","sources":["../../../../src/ai-service/skills/system/_registry.generated.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,qDAAqD;AAErD,OAAO,EAAE,OAAO,IAAI,sCAAsC,EAAE,MAAM,uDAAuD,CAAC;AAC1H,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAClH,OAAO,EAAE,OAAO,IAAI,oCAAoC,EAAE,MAAM,qDAAqD,CAAC;AACtH,OAAO,EAAE,OAAO,IAAI,wCAAwC,EAAE,MAAM,yDAAyD,CAAC;AAC9H,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,yCAAyC,EAAE,MAAM,0DAA0D,CAAC;AAChI,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,OAAO,IAAI,8CAA8C,EAAE,MAAM,+DAA+D,CAAC;AAC1I,OAAO,EAAE,OAAO,IAAI,mDAAmD,EAAE,MAAM,oEAAoE,CAAC;AACpJ,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAEpG;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,0BAA0B,EAAE,qBAAqB;IACjD,2CAA2C,EAAE,sCAAsC;IACnF,uCAAuC,EAAE,kCAAkC;IAC3E,yCAAyC,EAAE,oCAAoC;IAC/E,6CAA6C,EAAE,wCAAwC;IACvF,+BAA+B,EAAE,0BAA0B;IAC3D,8CAA8C,EAAE,yCAAyC;IACzF,gCAAgC,EAAE,2BAA2B;IAC7D,mDAAmD,EAAE,8CAA8C;IACnG,wDAAwD,EAAE,mDAAmD;CAC9G,CAAC"}
|
package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "# Focused retry playbook\n\nReference for `superblocks-migration/SKILL.md`. Load this **only** when the runtime prompt tells you this is a focused-retry turn.\n\nThis is a _retry_ attempt. Earlier runs already tried \u2014 and failed \u2014 on the APIs currently `pending` in the migration checklist. Your job is to finish them. Before writing any code, stop and think about **why** the prior attempt failed for each one and pick a _different_ strategy. Do not repeat the same approach; if the same plan failed twice, it will fail a third time.\n\n## Step 1: pull the prior-failure context\n\nThe checklist stores each item's most recent `lastFailureReason`. Call `build_manageChecklist` with `action: \"get\"` and read the `lastFailureReason` for every `seed_api` item still `pending`. Treat each reason as primary context when choosing your approach for that API.\n\nOnly address the APIs surfaced by that query \u2014 the rest of the app is already migrated.\n\n## Step 2: debugging checklist (work through this before editing)\n\n- Did the prior attempt misread the integration kind? Re-check `node_modules/@superblocksteam/sdk-api/src/index.ts` for the correct factory export.\n- Was the YAML using a block construct you skipped (`conditional`, `parallel`, `tryCatch`, `loop`, `variables`, inline `javascript`)? Translate it explicitly instead of bailing.\n- Did parameterization fail because a value flows in from a prior block's `.output` rather than `params`? Bind the right `ctx.*` or a local `const`.\n- Was the item marked `failed` because a target file (`index.ts`, a stub path) was \"missing\"? Confirm on disk \u2014 create nothing you were not told to create, but do not bail if the file actually exists.\n- Was a SQL statement's parameter shape wrong (scalar vs array, pg type cast)? Use `= ANY($N::<type>[])` for lists.\n- Prefer the **narrowest** rewrite that compiles and preserves behavior. If a full rewrite failed, try converting block-by-block.\n- If a documented method compiles but repeatedly fails at runtime, do not keep retrying the same pattern. Run one reload/retest cycle (`build_reloadFile`, then `testApi`) and then move to the next API. If no other APIs remain, leave a concrete `failureReason` describing the runtime limitation.\n\n## Meta-rule override: when the blocker is _information_, call `askMultiChoice` \u2014 DO NOT mark `failed`\n\nThe prior run already hit the `ZERO judgment calls` rule and marked these items `failed`. Repeating that reasoning on every retry is a loop that burns the user's budget and never converges. The user is _right here, right now, watching this turn_. Ask them.\n\nWhen the missing piece is something a human can supply (the original SQL, which integration to use, the intended output shape, whether a stubbed block can be dropped, etc.), you **MUST** call the `askMultiChoice` tool. This is a **tool call** \u2014 not a message, not a paragraph, not a list you type into the assistant response. You are not asking in English. You are invoking the tool named `askMultiChoice` with a JSON payload of `{ question, choices }`.\n\n### Exact rule\n\n1. Before you ever call `build_manageChecklist` with `status: \"failed\"` on an item in this retry, you **MUST** have already called `askMultiChoice` about it at least once in this turn. No exceptions.\n2. If you find yourself typing a sentence like _\"What would you like me to do?\"_ or _\"Please provide the SQL\"_ or _\"I need more information\"_ directly into your response, **stop**. Delete that text. Call `askMultiChoice` instead. The tool is the channel. The assistant text is not.\n3. The user only sees tool calls \u2014 a free-text question from you will sit there unanswered forever and this turn will be wasted.\n\n### How to structure the `askMultiChoice` call\n\n- **One call per distinct blocker.** If two APIs share the same missing information (e.g. both need the original SQL that was stubbed out), put them in a single question.\n- `question`: a short markdown string. Name the APIs in the question so the user knows what they're deciding about. Reference the relevant `failureReason` so the user has context.\n- `choices`: 2 or 3 entries. The first 1\u20132 should be concrete, actionable suggestions based on the YAML/integration/prior failure (e.g. _\"Provide the SQL query for these APIs\"_, _\"Use integration <name> with a SELECT _ query\"\\*). The **last choice** must be the literal string `Mark these APIs as complete and continue` \u2014 this is the user's escape hatch for APIs they don't need.\n- `selectionType`: `\"single\"`.\n\n### After the user responds\n\n- If they pick `Mark these APIs as complete and continue`: for every API covered by that question, call `build_manageChecklist` with `action: \"update\"`, `itemId: \"api_<ApiName>\"`, `status: \"completed\"`. Do not mark them `failed`. Move to the next blocker or finish.\n- If they provide information (via a concrete choice or a free-text reply that gives you what you needed): use it to finish the translation, emit the TypeScript module, register it if there's an `index.ts`, then `build_manageChecklist` `status: \"completed\"`.\n- Only call `build_manageChecklist` `status: \"failed\"` if the user's response explicitly says they cannot help or chose an option equivalent to \"skip this one\".\n\n### Self-check before you respond\n\nAsk yourself: _did I actually call the `askMultiChoice` tool in this turn for any item I'm about to leave unresolved?_ If the answer is no, you have not followed the rule. Call the tool.\n\n## Then execute\n\nUse the per-API procedure in `SKILL.md` for the actual translation work, but treat the prior `failureReason` as primary context when choosing your approach.\n";
|
|
2
|
+
//# sourceMappingURL=focused-debug.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focused-debug.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,6lLAsDnB,CAAC"}
|
package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Auto-generated from src/ai-service/skills/system/superblocks-migration/references/focused-debug.md
|
|
2
|
+
// Do not edit directly - edit the .md file instead
|
|
3
|
+
export const content = `# Focused retry playbook
|
|
4
|
+
|
|
5
|
+
Reference for \`superblocks-migration/SKILL.md\`. Load this **only** when the runtime prompt tells you this is a focused-retry turn.
|
|
6
|
+
|
|
7
|
+
This is a _retry_ attempt. Earlier runs already tried — and failed — on the APIs currently \`pending\` in the migration checklist. Your job is to finish them. Before writing any code, stop and think about **why** the prior attempt failed for each one and pick a _different_ strategy. Do not repeat the same approach; if the same plan failed twice, it will fail a third time.
|
|
8
|
+
|
|
9
|
+
## Step 1: pull the prior-failure context
|
|
10
|
+
|
|
11
|
+
The checklist stores each item's most recent \`lastFailureReason\`. Call \`build_manageChecklist\` with \`action: "get"\` and read the \`lastFailureReason\` for every \`seed_api\` item still \`pending\`. Treat each reason as primary context when choosing your approach for that API.
|
|
12
|
+
|
|
13
|
+
Only address the APIs surfaced by that query — the rest of the app is already migrated.
|
|
14
|
+
|
|
15
|
+
## Step 2: debugging checklist (work through this before editing)
|
|
16
|
+
|
|
17
|
+
- Did the prior attempt misread the integration kind? Re-check \`node_modules/@superblocksteam/sdk-api/src/index.ts\` for the correct factory export.
|
|
18
|
+
- Was the YAML using a block construct you skipped (\`conditional\`, \`parallel\`, \`tryCatch\`, \`loop\`, \`variables\`, inline \`javascript\`)? Translate it explicitly instead of bailing.
|
|
19
|
+
- Did parameterization fail because a value flows in from a prior block's \`.output\` rather than \`params\`? Bind the right \`ctx.*\` or a local \`const\`.
|
|
20
|
+
- Was the item marked \`failed\` because a target file (\`index.ts\`, a stub path) was "missing"? Confirm on disk — create nothing you were not told to create, but do not bail if the file actually exists.
|
|
21
|
+
- Was a SQL statement's parameter shape wrong (scalar vs array, pg type cast)? Use \`= ANY($N::<type>[])\` for lists.
|
|
22
|
+
- Prefer the **narrowest** rewrite that compiles and preserves behavior. If a full rewrite failed, try converting block-by-block.
|
|
23
|
+
- If a documented method compiles but repeatedly fails at runtime, do not keep retrying the same pattern. Run one reload/retest cycle (\`build_reloadFile\`, then \`testApi\`) and then move to the next API. If no other APIs remain, leave a concrete \`failureReason\` describing the runtime limitation.
|
|
24
|
+
|
|
25
|
+
## Meta-rule override: when the blocker is _information_, call \`askMultiChoice\` — DO NOT mark \`failed\`
|
|
26
|
+
|
|
27
|
+
The prior run already hit the \`ZERO judgment calls\` rule and marked these items \`failed\`. Repeating that reasoning on every retry is a loop that burns the user's budget and never converges. The user is _right here, right now, watching this turn_. Ask them.
|
|
28
|
+
|
|
29
|
+
When the missing piece is something a human can supply (the original SQL, which integration to use, the intended output shape, whether a stubbed block can be dropped, etc.), you **MUST** call the \`askMultiChoice\` tool. This is a **tool call** — not a message, not a paragraph, not a list you type into the assistant response. You are not asking in English. You are invoking the tool named \`askMultiChoice\` with a JSON payload of \`{ question, choices }\`.
|
|
30
|
+
|
|
31
|
+
### Exact rule
|
|
32
|
+
|
|
33
|
+
1. Before you ever call \`build_manageChecklist\` with \`status: "failed"\` on an item in this retry, you **MUST** have already called \`askMultiChoice\` about it at least once in this turn. No exceptions.
|
|
34
|
+
2. If you find yourself typing a sentence like _"What would you like me to do?"_ or _"Please provide the SQL"_ or _"I need more information"_ directly into your response, **stop**. Delete that text. Call \`askMultiChoice\` instead. The tool is the channel. The assistant text is not.
|
|
35
|
+
3. The user only sees tool calls — a free-text question from you will sit there unanswered forever and this turn will be wasted.
|
|
36
|
+
|
|
37
|
+
### How to structure the \`askMultiChoice\` call
|
|
38
|
+
|
|
39
|
+
- **One call per distinct blocker.** If two APIs share the same missing information (e.g. both need the original SQL that was stubbed out), put them in a single question.
|
|
40
|
+
- \`question\`: a short markdown string. Name the APIs in the question so the user knows what they're deciding about. Reference the relevant \`failureReason\` so the user has context.
|
|
41
|
+
- \`choices\`: 2 or 3 entries. The first 1–2 should be concrete, actionable suggestions based on the YAML/integration/prior failure (e.g. _"Provide the SQL query for these APIs"_, _"Use integration <name> with a SELECT _ query"\\*). The **last choice** must be the literal string \`Mark these APIs as complete and continue\` — this is the user's escape hatch for APIs they don't need.
|
|
42
|
+
- \`selectionType\`: \`"single"\`.
|
|
43
|
+
|
|
44
|
+
### After the user responds
|
|
45
|
+
|
|
46
|
+
- If they pick \`Mark these APIs as complete and continue\`: for every API covered by that question, call \`build_manageChecklist\` with \`action: "update"\`, \`itemId: "api_<ApiName>"\`, \`status: "completed"\`. Do not mark them \`failed\`. Move to the next blocker or finish.
|
|
47
|
+
- If they provide information (via a concrete choice or a free-text reply that gives you what you needed): use it to finish the translation, emit the TypeScript module, register it if there's an \`index.ts\`, then \`build_manageChecklist\` \`status: "completed"\`.
|
|
48
|
+
- Only call \`build_manageChecklist\` \`status: "failed"\` if the user's response explicitly says they cannot help or chose an option equivalent to "skip this one".
|
|
49
|
+
|
|
50
|
+
### Self-check before you respond
|
|
51
|
+
|
|
52
|
+
Ask yourself: _did I actually call the \`askMultiChoice\` tool in this turn for any item I'm about to leave unresolved?_ If the answer is no, you have not followed the rule. Call the tool.
|
|
53
|
+
|
|
54
|
+
## Then execute
|
|
55
|
+
|
|
56
|
+
Use the per-API procedure in \`SKILL.md\` for the actual translation work, but treat the prior \`failureReason\` as primary context when choosing your approach.
|
|
57
|
+
`;
|
|
58
|
+
//# sourceMappingURL=focused-debug.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focused-debug.generated.js","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "# YAML block \u2192 TypeScript mapping\n\nReference for `superblocks-migration/SKILL.md`. Covers how each legacy block type in `api.yaml` maps to the new `@superblocksteam/sdk-api` TypeScript format.\n\n## Integration-backed blocks (SQL, REST, vendor plugins)\n\nShape in YAML:\n\n```yaml\nstep:\n name: <BlockName>\n integration: <uuid> # OR a plugin key like \"restapi\"\n <plugin>: # e.g. postgresql, snowflake, restapi, openApiAction\n body: | # SQL, request body, etc.\n ...\n parameters:\n - name: <n>\n value: <expr>\n```\n\n### SQL integrations (PostgreSQL, MySQL, Snowflake, Databricks, etc.)\n\n- Rows returned (`SELECT`, `SHOW`, `RETURNING *`) \u2192 `await ctx.integrations.<key>.query(sql, Schema, params)` with a Zod schema.\n- No rows actionable (`INSERT` w/o `RETURNING`, `UPDATE`, `DELETE`, DDL) \u2192 `await ctx.integrations.<key>.execute(sql, params)`.\n- **Parameterize everything.** Zero `${\u2026}` inside the SQL string. Dynamic lists use `= ANY($N::<type>[])`, never string-concatenated `IN (\u2026)`.\n\n### REST / OpenAPI / vendor plugin blocks\n\n- `openApiAction`, `restapi:`, and vendor plugin keys (e.g. `salesforce:`, `stripe:`, `openai:`) \u2192 the matching factory from the sdk-api barrel (`node_modules/@superblocksteam/sdk-api/src/index.ts`).\n- Never emit `openapi(...)`, `http(...)`, or `openApiAction(...)` \u2014 those are not sdk-api factories.\n- Client method names come from the integration README \u2014 never invent them. If the README only documents `apiRequest`, use `apiRequest`.\n\n## JavaScript blocks\n\n```yaml\nstep:\n name: <BlockName>\n integration: javascript\n javascript:\n body: |\n ...JS code...\n```\n\nThere is **no `javascript` integration** in sdk-api. Inline the body as plain TypeScript inside `run(ctx, input)`. Any references to prior blocks' `<PriorBlock>.output` are replaced by the local `const` bound to that block's result.\n\n## Control-flow blocks\n\n| YAML block | TS construct |\n| --------------------------------- | ------------------------------------------------------------------------ |\n| `conditional:` (if / else) | `if (...) { ... } else { ... }` around the nested block TS |\n| `loop:` with `type: TYPE_FOREACH` | `for (const x of xs) { ... }` with **sequential** `await` (default) |\n| `loop:` with `type: TYPE_WHILE` | `while (cond) { ... }` |\n| `parallel:` (explicit) | `await Promise.all(xs.map(async x => ...))` |\n| `variables:` | `const`s in the enclosing scope |\n| `throw:` | `throw new Error(...)` (or the sdk-api error class the README documents) |\n| `return:` | `return ...;` from `run` |\n| `tryCatch:` | `try { ... } catch (err) { ... }` |\n| `break:` | `break;` |\n\nOnly use `Promise.all` when the YAML explicitly uses a `parallel:` block. A plain `TYPE_FOREACH` is sequential by contract \u2014 do not silently parallelize it.\n\n## Per-block `.output` references\n\nLegacy blocks expose `<BlockName>.output` to downstream blocks. In the TS port each block's result is a local `const`:\n\n```ts\nconst users = await ctx.integrations.pg.query(USERS_SQL, UsersSchema, [orgId]);\n// downstream: reference `users`, not `GetUsers.output`\n```\n\n## Metadata mapping\n\n- `metadata.name` \u2192 the string passed to `api({ name: \"<metadata.name>\" })` and the file base name (kebab-case).\n- `metadata.description` \u2192 the `description` field on `api({ ... })` if the sdk-api contract supports it (check the README; do not invent fields).\n- `authorization.type: AUTHORIZATION_TYPE_APP_USERS` \u2192 server-enforced; use `ctx.user` in TS. Remove any `userId`/`email` inputs the YAML declared as API input if they are now derivable from `ctx.user`.\n\n## Inputs\n\nThe YAML's `apiInputs` (or equivalent) enumerates the externally-accepted parameters. In the TS port:\n\n- Declare them on the `input` shape passed to `run(ctx, input)`.\n- Drop any input that is now sourced from `ctx.user` or from `ctx.integrations.<key>` state.\n- Keep the **minimal** union of identifiers the YAML actually references downstream.\n\n## Integration UUIDs\n\nEvery distinct `step.integration` UUID in a YAML becomes a named `const` at the top of the TS file \u2014 one `const` per unique integration, reused by every `ctx.integrations.<key>` call. Do not inline UUIDs. Do not carry UUIDs across files.\n\n```ts\nconst PG_MAIN = \"550e8400-e29b-41d4-a716-446655440000\";\n\nconst db = ctx.integrations.pg(PG_MAIN);\nconst rows = await db.query(...);\n```\n\n(Exact binding form depends on the sdk-api contract \u2014 confirm against the README.)\n\n## What NOT to emit\n\n- `// TODO` or `// FIXME` comments that silently ship \u2014 unresolved items live only as `failed` checklist entries.\n- Narrative code comments (\"this step fetches users\"). Code should read directly.\n- Retry wrappers, caching layers, or extra logging beyond the single `ctx.log.info(\"<ApiName> start\", {...})` at the top of `run`.\n- Envelope wrappers around the response \u2014 the external output shape must mirror the legacy API exactly.\n";
|
|
2
|
+
//# sourceMappingURL=yaml-block-mapping.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml-block-mapping.generated.d.ts","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,y7KAuGnB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Auto-generated from src/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.md
|
|
2
|
+
// Do not edit directly - edit the .md file instead
|
|
3
|
+
export const content = `# YAML block → TypeScript mapping
|
|
4
|
+
|
|
5
|
+
Reference for \`superblocks-migration/SKILL.md\`. Covers how each legacy block type in \`api.yaml\` maps to the new \`@superblocksteam/sdk-api\` TypeScript format.
|
|
6
|
+
|
|
7
|
+
## Integration-backed blocks (SQL, REST, vendor plugins)
|
|
8
|
+
|
|
9
|
+
Shape in YAML:
|
|
10
|
+
|
|
11
|
+
\`\`\`yaml
|
|
12
|
+
step:
|
|
13
|
+
name: <BlockName>
|
|
14
|
+
integration: <uuid> # OR a plugin key like "restapi"
|
|
15
|
+
<plugin>: # e.g. postgresql, snowflake, restapi, openApiAction
|
|
16
|
+
body: | # SQL, request body, etc.
|
|
17
|
+
...
|
|
18
|
+
parameters:
|
|
19
|
+
- name: <n>
|
|
20
|
+
value: <expr>
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
### SQL integrations (PostgreSQL, MySQL, Snowflake, Databricks, etc.)
|
|
24
|
+
|
|
25
|
+
- Rows returned (\`SELECT\`, \`SHOW\`, \`RETURNING *\`) → \`await ctx.integrations.<key>.query(sql, Schema, params)\` with a Zod schema.
|
|
26
|
+
- No rows actionable (\`INSERT\` w/o \`RETURNING\`, \`UPDATE\`, \`DELETE\`, DDL) → \`await ctx.integrations.<key>.execute(sql, params)\`.
|
|
27
|
+
- **Parameterize everything.** Zero \`\${…}\` inside the SQL string. Dynamic lists use \`= ANY($N::<type>[])\`, never string-concatenated \`IN (…)\`.
|
|
28
|
+
|
|
29
|
+
### REST / OpenAPI / vendor plugin blocks
|
|
30
|
+
|
|
31
|
+
- \`openApiAction\`, \`restapi:\`, and vendor plugin keys (e.g. \`salesforce:\`, \`stripe:\`, \`openai:\`) → the matching factory from the sdk-api barrel (\`node_modules/@superblocksteam/sdk-api/src/index.ts\`).
|
|
32
|
+
- Never emit \`openapi(...)\`, \`http(...)\`, or \`openApiAction(...)\` — those are not sdk-api factories.
|
|
33
|
+
- Client method names come from the integration README — never invent them. If the README only documents \`apiRequest\`, use \`apiRequest\`.
|
|
34
|
+
|
|
35
|
+
## JavaScript blocks
|
|
36
|
+
|
|
37
|
+
\`\`\`yaml
|
|
38
|
+
step:
|
|
39
|
+
name: <BlockName>
|
|
40
|
+
integration: javascript
|
|
41
|
+
javascript:
|
|
42
|
+
body: |
|
|
43
|
+
...JS code...
|
|
44
|
+
\`\`\`
|
|
45
|
+
|
|
46
|
+
There is **no \`javascript\` integration** in sdk-api. Inline the body as plain TypeScript inside \`run(ctx, input)\`. Any references to prior blocks' \`<PriorBlock>.output\` are replaced by the local \`const\` bound to that block's result.
|
|
47
|
+
|
|
48
|
+
## Control-flow blocks
|
|
49
|
+
|
|
50
|
+
| YAML block | TS construct |
|
|
51
|
+
| --------------------------------- | ------------------------------------------------------------------------ |
|
|
52
|
+
| \`conditional:\` (if / else) | \`if (...) { ... } else { ... }\` around the nested block TS |
|
|
53
|
+
| \`loop:\` with \`type: TYPE_FOREACH\` | \`for (const x of xs) { ... }\` with **sequential** \`await\` (default) |
|
|
54
|
+
| \`loop:\` with \`type: TYPE_WHILE\` | \`while (cond) { ... }\` |
|
|
55
|
+
| \`parallel:\` (explicit) | \`await Promise.all(xs.map(async x => ...))\` |
|
|
56
|
+
| \`variables:\` | \`const\`s in the enclosing scope |
|
|
57
|
+
| \`throw:\` | \`throw new Error(...)\` (or the sdk-api error class the README documents) |
|
|
58
|
+
| \`return:\` | \`return ...;\` from \`run\` |
|
|
59
|
+
| \`tryCatch:\` | \`try { ... } catch (err) { ... }\` |
|
|
60
|
+
| \`break:\` | \`break;\` |
|
|
61
|
+
|
|
62
|
+
Only use \`Promise.all\` when the YAML explicitly uses a \`parallel:\` block. A plain \`TYPE_FOREACH\` is sequential by contract — do not silently parallelize it.
|
|
63
|
+
|
|
64
|
+
## Per-block \`.output\` references
|
|
65
|
+
|
|
66
|
+
Legacy blocks expose \`<BlockName>.output\` to downstream blocks. In the TS port each block's result is a local \`const\`:
|
|
67
|
+
|
|
68
|
+
\`\`\`ts
|
|
69
|
+
const users = await ctx.integrations.pg.query(USERS_SQL, UsersSchema, [orgId]);
|
|
70
|
+
// downstream: reference \`users\`, not \`GetUsers.output\`
|
|
71
|
+
\`\`\`
|
|
72
|
+
|
|
73
|
+
## Metadata mapping
|
|
74
|
+
|
|
75
|
+
- \`metadata.name\` → the string passed to \`api({ name: "<metadata.name>" })\` and the file base name (kebab-case).
|
|
76
|
+
- \`metadata.description\` → the \`description\` field on \`api({ ... })\` if the sdk-api contract supports it (check the README; do not invent fields).
|
|
77
|
+
- \`authorization.type: AUTHORIZATION_TYPE_APP_USERS\` → server-enforced; use \`ctx.user\` in TS. Remove any \`userId\`/\`email\` inputs the YAML declared as API input if they are now derivable from \`ctx.user\`.
|
|
78
|
+
|
|
79
|
+
## Inputs
|
|
80
|
+
|
|
81
|
+
The YAML's \`apiInputs\` (or equivalent) enumerates the externally-accepted parameters. In the TS port:
|
|
82
|
+
|
|
83
|
+
- Declare them on the \`input\` shape passed to \`run(ctx, input)\`.
|
|
84
|
+
- Drop any input that is now sourced from \`ctx.user\` or from \`ctx.integrations.<key>\` state.
|
|
85
|
+
- Keep the **minimal** union of identifiers the YAML actually references downstream.
|
|
86
|
+
|
|
87
|
+
## Integration UUIDs
|
|
88
|
+
|
|
89
|
+
Every distinct \`step.integration\` UUID in a YAML becomes a named \`const\` at the top of the TS file — one \`const\` per unique integration, reused by every \`ctx.integrations.<key>\` call. Do not inline UUIDs. Do not carry UUIDs across files.
|
|
90
|
+
|
|
91
|
+
\`\`\`ts
|
|
92
|
+
const PG_MAIN = "550e8400-e29b-41d4-a716-446655440000";
|
|
93
|
+
|
|
94
|
+
const db = ctx.integrations.pg(PG_MAIN);
|
|
95
|
+
const rows = await db.query(...);
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
(Exact binding form depends on the sdk-api contract — confirm against the README.)
|
|
99
|
+
|
|
100
|
+
## What NOT to emit
|
|
101
|
+
|
|
102
|
+
- \`// TODO\` or \`// FIXME\` comments that silently ship — unresolved items live only as \`failed\` checklist entries.
|
|
103
|
+
- Narrative code comments ("this step fetches users"). Code should read directly.
|
|
104
|
+
- Retry wrappers, caching layers, or extra logging beyond the single \`ctx.log.info("<ApiName> start", {...})\` at the top of \`run\`.
|
|
105
|
+
- Envelope wrappers around the response — the external output shape must mirror the legacy API exactly.
|
|
106
|
+
`;
|
|
107
|
+
//# sourceMappingURL=yaml-block-mapping.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml-block-mapping.generated.js","sourceRoot":"","sources":["../../../../../../src/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "---\nname: superblocks-migration\ndescription: |\n Convert legacy Superblocks 2.0 YAML APIs (\"block-chain\" format) to the new 3.0 sdk-api TypeScript format.\n Load when executing a v2\u2192v3 migration turn \u2014 the runtime prompt will tell you to.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# v2 \u2192 v3 API Translation\n\nYou are converting **legacy Superblocks \"block-chain\" YAML APIs** into the **new code-mode `@superblocksteam/sdk-api` TypeScript format**. Each YAML file under `scratch/v2-backup/apis/<ApiName>/api.yaml` must be emitted as a single TypeScript file at `server/apis/<ApiName>/api.ts` that compiles, typechecks, and preserves behavior exactly.\n\n## Meta-rule: ZERO judgment calls\n\nIf any situation below is not resolved deterministically by this document, **STOP** for that API. Do **not** pick a default. Do **not** guess a factory, a shape, or an import. Skip it, continue with other APIs, and mark the checklist item as `failed` via `build_manageChecklist` with a short `failureReason` describing the exact ambiguity (failing rule, block name if any, what would be needed to proceed). This rule overrides everything else.\n\nCorollary: do not add `// TODO` comments that silently ship. Unresolved items live only as `failed` checklist entries.\n\n## Inputs and outputs\n\n- **Source tree:** `scratch/v2-backup/apis/<ApiName>/api.yaml`. Discover the actual set by listing the directory \u2014 do not hardcode a count or list.\n- **Target tree:** `server/apis/<ApiName>/api.ts`. Do not create scaffolding trees that do not already exist (see \"Registry registration\" below).\n- **Checklist:** the migration checklist has already been seeded with one item per API (id `api_<ApiName>`, origin `seed_api`, status `pending`). Pull the live set by calling `build_manageChecklist` with `action: \"get\"` and filtering to `origin: \"seed_api\"` and `status: \"pending\"` \u2014 that is your authoritative API list and count for this turn.\n\n## Required reading (read these BEFORE writing any output)\n\nAuthoritative. If a rule here conflicts with your priors, these win.\n\n1. `node_modules/@superblocksteam/sdk-api/README.md` \u2014 whole thing (api() contract, execution model, `ctx.*`, exports, error classes, performance best practices, `useApi` frontend hook, integration method table).\n2. `node_modules/@superblocksteam/sdk-api/src/index.ts` (the **barrel**) \u2014 the authoritative list of exported factory names. Integration factory names are whatever this file exports, not whatever the directory name is. Never invent or case-fold a factory name without confirming it here.\n3. The README for **every integration** referenced by the YAMLs you convert:\n - `node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/README.md`\n - If a vendor-specific factory exists for the target service (e.g., a dedicated one for a given LLM provider), prefer it over a generic HTTP one.\n4. `skills/system/superblocks-migration/references/yaml-block-mapping.md` \u2014 full YAML \u2192 TS mapping for each legacy block type.\n\nThere is **no `javascript` integration** in sdk-api \u2014 inline JS/TS lives directly inside `run(ctx, input)`. Any block whose YAML key is `javascript:` becomes plain TypeScript in `run()`.\n\n## Preflight gate (MUST pass before any file edits)\n\nComplete this orientation sequence before writing or modifying any API file:\n\n1. Call `build_manageChecklist` with `action: \"get\"` and filter to `origin: \"seed_api\"` `status: \"pending\"` \u2014 this is your authoritative API list and count for this turn.\n2. Read `node_modules/@superblocksteam/sdk-api/src/index.ts` and treat it as the **only** source of truth for sdk-api export/factory names.\n3. Read `node_modules/@superblocksteam/sdk-api/README.md`.\n4. For each API, read only the integration README(s) needed for that API right before migrating it (just-in-time). Do **not** preload every integration README for the entire app.\n\nHard constraints:\n\n- Do **not** rely on prior conversation memory, \"knowledge\" summaries, or inferred export names.\n- Do **not** start editing API files until preflight steps 1\u20133 are complete.\n- If a required file cannot be read, mark that API's checklist item `failed` with a concrete `failureReason` that names the missing path.\n\n## File layout & exports\n\n- One API per file, default export: `export default api({ ... });`.\n- Use ESM-style relative `.js` specifiers in imports.\n- File path: `server/apis/<ApiName>/api.ts` where `<ApiName>` is the YAML `metadata.name` (for example, `GetFloors` \u2192 `server/apis/GetFloors/api.ts`).\n- The `api({ name })` string and the registry key must both equal the YAML `metadata.name` verbatim \u2014 frontends call `useApi(\"<metadata.name>\")`.\n\n### Registry registration (conditional)\n\n- If `server/apis/index.ts` exists in the target tree: add an import + entry for each new module. Do not reorder existing entries.\n- If it does **not** exist: do **not** create it, do not create scaffolding. Mark the checklist item `failed` with a `failureReason` noting the missing registry.\n\n## Critical rules\n\n1. **Integration IDs are opaque per-YAML.** Extract each distinct `step.integration` UUID to a named `const` at the top of the file. Never carry UUIDs across files.\n2. **SQL: parameterize always.** Zero `${\u2026}` interpolations may remain inside any SQL string. Dynamic lists use `= ANY($N::<type>[])` \u2014 never string-building `IN (\u2026)`.\n3. **`query` vs `execute`.** Rows returned \u2192 `query` with Zod schema. Nothing actionable \u2192 `execute`.\n4. **Output shape preservation.** Mirror the legacy API's externally-visible response exactly \u2014 shape, nullability, cardinality. Do not wrap in envelopes.\n5. **Default is sequential.** `TYPE_FOREACH` \u2192 `for ... of` with sequential `await`. `Promise.all` only when YAML explicitly used a `parallel:` block.\n6. **Determinism, no slop.** No retries, no caching, no extra logging beyond a single `ctx.log.info(\"<ApiName> start\", {...})` at the top of `run`. No narrative code comments.\n7. **Never invent client methods.** If the integration README only documents `apiRequest`, use `apiRequest`.\n\n## Security / user identity\n\n- `authorization.type: AUTHORIZATION_TYPE_APP_USERS` is enforced by the server; rely on `ctx.user` in TS.\n- If the YAML accepts `userId` / `email` / etc. as API input, remove that input and read from `ctx.user` instead.\n\n## Observability\n\n- One `ctx.log.info(\"<ApiName> start\", { <safe-ids> })` at the top of `run` is allowed. Never log secrets, tokens, or PII.\n\n## Verification before you hand off\n\nRuntime verification (required):\n\n1. `build_debug` passing is required but not sufficient. Do not treat compile/typecheck success as proof that runtime behavior is correct.\n2. Use risk-based runtime checks: run `testApi` for APIs with integrations (REST/vendor/SQL), multi-step control flow, transformed outputs, or any uncertainty. For obviously simple APIs, you may skip `testApi`.\n3. If `testApi` output appears stale or mismatched, run `build_reloadFile` once and re-test. If runtime still fails after documented-method verification + one reload/retest cycle, record a concrete `failureReason` and continue.\n\nFor each converted API, self-check:\n\n1. File default-exports exactly one `api({...})`; `name` matches `metadata.name`.\n2. Zero `${\u2026}` interpolations remain in any SQL string.\n3. No SQL `IN (\u2026)` built by concatenation; dynamic lists use `= ANY($N::<type>[])`.\n4. Every prior block's `.output` read is replaced by an actual result `const`.\n5. Input is the minimal union of identifiers the YAML references that are not produced by earlier blocks or `Variables`.\n6. Output shape exactly mirrors the legacy API's external response.\n7. If `server/apis/index.ts` exists, it registers the new module under `metadata.name`.\n\n## Parallelization policy\n\nCount pending APIs from the checklist (`build_manageChecklist` `action: \"get\"`, filter `origin: \"seed_api\"` `status: \"pending\"`).\n\n- **If the pending count is `< 8`:** migrate the APIs yourself, sequentially. Do NOT call `spawnCodingSubagents`. Work through each API using the per-API procedure below.\n- **If the pending count is `>= 8`:** you **MUST spawn sub-agents** to migrate these APIs in parallel. There are too many APIs to migrate sequentially yourself. Do NOT attempt to migrate APIs yourself in this run \u2014 use `spawnCodingSubagents`.\n - Split the APIs into batches of ~5 (aim for 4\u20136 per batch), with a hard cap of **5 sub-agents total**. If more than 25 APIs remain, give later batches larger shares rather than spawning more than 5 workers.\n - For each batch, craft an `instructions` string that:\n - Names the exact `<ApiName>` values that sub-agent owns, verbatim, as a bulleted list.\n - Restates the per-API procedure below so the sub-agent is self-contained.\n - Reminds the sub-agent to update the shared checklist (id `api_<ApiName>`) for every item it owns.\n - **Call `spawnCodingSubagents` as the ONLY tool call in that turn.** Do not emit any other tool calls alongside it \u2014 no reads, no writes, no checklist updates. The tool blocks until every sub-agent finishes; you cannot do migration work \"while waiting\" because there is no waiting from your perspective \u2014 your next turn only begins after the tool returns. If you emit other tool calls in the same turn, you and the sub-agents will race on the shared checklist and corrupt state.\n - **After `spawnCodingSubagents` returns** \u2014 only in a subsequent turn \u2014 read the checklist via `build_manageChecklist` with `action: \"get\"`. For any `failed` items, review the `failureReason`. Retry small numbers of recoverable failures yourself (sequentially, using the per-API procedure below). Leave deterministic failures as `failed`.\n\n## Per-API procedure\n\nFor APIs you migrate yourself, or that you embed in a sub-agent's `instructions`:\n\n1. Call `build_manageChecklist` with `action: \"update\"`, `itemId: \"api_<ApiName>\"`, `status: \"in_progress\"`.\n2. Read `scratch/v2-backup/apis/<ApiName>/api.yaml` and any sibling files the blocks reference.\n3. Produce the TypeScript module at `server/apis/<ApiName>/api.ts`, overwriting the stub. Use the YAML block \u2192 TS mapping in `skills/system/superblocks-migration/references/yaml-block-mapping.md`.\n4. If `server/apis/index.ts` exists, update it to register the new module.\n5. On success \u2192 `build_manageChecklist` with `status: \"completed\"`.\n6. On deterministic failure \u2192 `build_manageChecklist` with `status: \"failed\"` and a concrete `failureReason` (the rule that failed + what is needed to proceed). Continue with the next API.\n\n## Run-level rules\n\n- Do NOT emit a free-text UNRESOLVED report \u2014 every unresolved item must be a `failed` checklist entry with a `failureReason`.\n- Do NOT stop the run because one API failed. Only stop once every API is either `completed` or `failed`.\n";
|
|
2
|
+
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,i0VAqInB,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Auto-generated from src/ai-service/skills/system/superblocks-migration/SKILL.md
|
|
2
|
+
// Do not edit directly - edit the .md file instead
|
|
3
|
+
export const content = `---
|
|
4
|
+
name: superblocks-migration
|
|
5
|
+
description: |
|
|
6
|
+
Convert legacy Superblocks 2.0 YAML APIs ("block-chain" format) to the new 3.0 sdk-api TypeScript format.
|
|
7
|
+
Load when executing a v2→v3 migration turn — the runtime prompt will tell you to.
|
|
8
|
+
readOnly: true
|
|
9
|
+
metadata:
|
|
10
|
+
author: superblocks
|
|
11
|
+
version: "1.0"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v2 → v3 API Translation
|
|
15
|
+
|
|
16
|
+
You are converting **legacy Superblocks "block-chain" YAML APIs** into the **new code-mode \`@superblocksteam/sdk-api\` TypeScript format**. Each YAML file under \`scratch/v2-backup/apis/<ApiName>/api.yaml\` must be emitted as a single TypeScript file at \`server/apis/<ApiName>/api.ts\` that compiles, typechecks, and preserves behavior exactly.
|
|
17
|
+
|
|
18
|
+
## Meta-rule: ZERO judgment calls
|
|
19
|
+
|
|
20
|
+
If any situation below is not resolved deterministically by this document, **STOP** for that API. Do **not** pick a default. Do **not** guess a factory, a shape, or an import. Skip it, continue with other APIs, and mark the checklist item as \`failed\` via \`build_manageChecklist\` with a short \`failureReason\` describing the exact ambiguity (failing rule, block name if any, what would be needed to proceed). This rule overrides everything else.
|
|
21
|
+
|
|
22
|
+
Corollary: do not add \`// TODO\` comments that silently ship. Unresolved items live only as \`failed\` checklist entries.
|
|
23
|
+
|
|
24
|
+
## Inputs and outputs
|
|
25
|
+
|
|
26
|
+
- **Source tree:** \`scratch/v2-backup/apis/<ApiName>/api.yaml\`. Discover the actual set by listing the directory — do not hardcode a count or list.
|
|
27
|
+
- **Target tree:** \`server/apis/<ApiName>/api.ts\`. Do not create scaffolding trees that do not already exist (see "Registry registration" below).
|
|
28
|
+
- **Checklist:** the migration checklist has already been seeded with one item per API (id \`api_<ApiName>\`, origin \`seed_api\`, status \`pending\`). Pull the live set by calling \`build_manageChecklist\` with \`action: "get"\` and filtering to \`origin: "seed_api"\` and \`status: "pending"\` — that is your authoritative API list and count for this turn.
|
|
29
|
+
|
|
30
|
+
## Required reading (read these BEFORE writing any output)
|
|
31
|
+
|
|
32
|
+
Authoritative. If a rule here conflicts with your priors, these win.
|
|
33
|
+
|
|
34
|
+
1. \`node_modules/@superblocksteam/sdk-api/README.md\` — whole thing (api() contract, execution model, \`ctx.*\`, exports, error classes, performance best practices, \`useApi\` frontend hook, integration method table).
|
|
35
|
+
2. \`node_modules/@superblocksteam/sdk-api/src/index.ts\` (the **barrel**) — the authoritative list of exported factory names. Integration factory names are whatever this file exports, not whatever the directory name is. Never invent or case-fold a factory name without confirming it here.
|
|
36
|
+
3. The README for **every integration** referenced by the YAMLs you convert:
|
|
37
|
+
- \`node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/README.md\`
|
|
38
|
+
- If a vendor-specific factory exists for the target service (e.g., a dedicated one for a given LLM provider), prefer it over a generic HTTP one.
|
|
39
|
+
4. \`skills/system/superblocks-migration/references/yaml-block-mapping.md\` — full YAML → TS mapping for each legacy block type.
|
|
40
|
+
|
|
41
|
+
There is **no \`javascript\` integration** in sdk-api — inline JS/TS lives directly inside \`run(ctx, input)\`. Any block whose YAML key is \`javascript:\` becomes plain TypeScript in \`run()\`.
|
|
42
|
+
|
|
43
|
+
## Preflight gate (MUST pass before any file edits)
|
|
44
|
+
|
|
45
|
+
Complete this orientation sequence before writing or modifying any API file:
|
|
46
|
+
|
|
47
|
+
1. Call \`build_manageChecklist\` with \`action: "get"\` and filter to \`origin: "seed_api"\` \`status: "pending"\` — this is your authoritative API list and count for this turn.
|
|
48
|
+
2. Read \`node_modules/@superblocksteam/sdk-api/src/index.ts\` and treat it as the **only** source of truth for sdk-api export/factory names.
|
|
49
|
+
3. Read \`node_modules/@superblocksteam/sdk-api/README.md\`.
|
|
50
|
+
4. For each API, read only the integration README(s) needed for that API right before migrating it (just-in-time). Do **not** preload every integration README for the entire app.
|
|
51
|
+
|
|
52
|
+
Hard constraints:
|
|
53
|
+
|
|
54
|
+
- Do **not** rely on prior conversation memory, "knowledge" summaries, or inferred export names.
|
|
55
|
+
- Do **not** start editing API files until preflight steps 1–3 are complete.
|
|
56
|
+
- If a required file cannot be read, mark that API's checklist item \`failed\` with a concrete \`failureReason\` that names the missing path.
|
|
57
|
+
|
|
58
|
+
## File layout & exports
|
|
59
|
+
|
|
60
|
+
- One API per file, default export: \`export default api({ ... });\`.
|
|
61
|
+
- Use ESM-style relative \`.js\` specifiers in imports.
|
|
62
|
+
- File path: \`server/apis/<ApiName>/api.ts\` where \`<ApiName>\` is the YAML \`metadata.name\` (for example, \`GetFloors\` → \`server/apis/GetFloors/api.ts\`).
|
|
63
|
+
- The \`api({ name })\` string and the registry key must both equal the YAML \`metadata.name\` verbatim — frontends call \`useApi("<metadata.name>")\`.
|
|
64
|
+
|
|
65
|
+
### Registry registration (conditional)
|
|
66
|
+
|
|
67
|
+
- If \`server/apis/index.ts\` exists in the target tree: add an import + entry for each new module. Do not reorder existing entries.
|
|
68
|
+
- If it does **not** exist: do **not** create it, do not create scaffolding. Mark the checklist item \`failed\` with a \`failureReason\` noting the missing registry.
|
|
69
|
+
|
|
70
|
+
## Critical rules
|
|
71
|
+
|
|
72
|
+
1. **Integration IDs are opaque per-YAML.** Extract each distinct \`step.integration\` UUID to a named \`const\` at the top of the file. Never carry UUIDs across files.
|
|
73
|
+
2. **SQL: parameterize always.** Zero \`\${…}\` interpolations may remain inside any SQL string. Dynamic lists use \`= ANY($N::<type>[])\` — never string-building \`IN (…)\`.
|
|
74
|
+
3. **\`query\` vs \`execute\`.** Rows returned → \`query\` with Zod schema. Nothing actionable → \`execute\`.
|
|
75
|
+
4. **Output shape preservation.** Mirror the legacy API's externally-visible response exactly — shape, nullability, cardinality. Do not wrap in envelopes.
|
|
76
|
+
5. **Default is sequential.** \`TYPE_FOREACH\` → \`for ... of\` with sequential \`await\`. \`Promise.all\` only when YAML explicitly used a \`parallel:\` block.
|
|
77
|
+
6. **Determinism, no slop.** No retries, no caching, no extra logging beyond a single \`ctx.log.info("<ApiName> start", {...})\` at the top of \`run\`. No narrative code comments.
|
|
78
|
+
7. **Never invent client methods.** If the integration README only documents \`apiRequest\`, use \`apiRequest\`.
|
|
79
|
+
|
|
80
|
+
## Security / user identity
|
|
81
|
+
|
|
82
|
+
- \`authorization.type: AUTHORIZATION_TYPE_APP_USERS\` is enforced by the server; rely on \`ctx.user\` in TS.
|
|
83
|
+
- If the YAML accepts \`userId\` / \`email\` / etc. as API input, remove that input and read from \`ctx.user\` instead.
|
|
84
|
+
|
|
85
|
+
## Observability
|
|
86
|
+
|
|
87
|
+
- One \`ctx.log.info("<ApiName> start", { <safe-ids> })\` at the top of \`run\` is allowed. Never log secrets, tokens, or PII.
|
|
88
|
+
|
|
89
|
+
## Verification before you hand off
|
|
90
|
+
|
|
91
|
+
Runtime verification (required):
|
|
92
|
+
|
|
93
|
+
1. \`build_debug\` passing is required but not sufficient. Do not treat compile/typecheck success as proof that runtime behavior is correct.
|
|
94
|
+
2. Use risk-based runtime checks: run \`testApi\` for APIs with integrations (REST/vendor/SQL), multi-step control flow, transformed outputs, or any uncertainty. For obviously simple APIs, you may skip \`testApi\`.
|
|
95
|
+
3. If \`testApi\` output appears stale or mismatched, run \`build_reloadFile\` once and re-test. If runtime still fails after documented-method verification + one reload/retest cycle, record a concrete \`failureReason\` and continue.
|
|
96
|
+
|
|
97
|
+
For each converted API, self-check:
|
|
98
|
+
|
|
99
|
+
1. File default-exports exactly one \`api({...})\`; \`name\` matches \`metadata.name\`.
|
|
100
|
+
2. Zero \`\${…}\` interpolations remain in any SQL string.
|
|
101
|
+
3. No SQL \`IN (…)\` built by concatenation; dynamic lists use \`= ANY($N::<type>[])\`.
|
|
102
|
+
4. Every prior block's \`.output\` read is replaced by an actual result \`const\`.
|
|
103
|
+
5. Input is the minimal union of identifiers the YAML references that are not produced by earlier blocks or \`Variables\`.
|
|
104
|
+
6. Output shape exactly mirrors the legacy API's external response.
|
|
105
|
+
7. If \`server/apis/index.ts\` exists, it registers the new module under \`metadata.name\`.
|
|
106
|
+
|
|
107
|
+
## Parallelization policy
|
|
108
|
+
|
|
109
|
+
Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"\`, filter \`origin: "seed_api"\` \`status: "pending"\`).
|
|
110
|
+
|
|
111
|
+
- **If the pending count is \`< 8\`:** migrate the APIs yourself, sequentially. Do NOT call \`spawnCodingSubagents\`. Work through each API using the per-API procedure below.
|
|
112
|
+
- **If the pending count is \`>= 8\`:** you **MUST spawn sub-agents** to migrate these APIs in parallel. There are too many APIs to migrate sequentially yourself. Do NOT attempt to migrate APIs yourself in this run — use \`spawnCodingSubagents\`.
|
|
113
|
+
- Split the APIs into batches of ~5 (aim for 4–6 per batch), with a hard cap of **5 sub-agents total**. If more than 25 APIs remain, give later batches larger shares rather than spawning more than 5 workers.
|
|
114
|
+
- For each batch, craft an \`instructions\` string that:
|
|
115
|
+
- Names the exact \`<ApiName>\` values that sub-agent owns, verbatim, as a bulleted list.
|
|
116
|
+
- Restates the per-API procedure below so the sub-agent is self-contained.
|
|
117
|
+
- Reminds the sub-agent to update the shared checklist (id \`api_<ApiName>\`) for every item it owns.
|
|
118
|
+
- **Call \`spawnCodingSubagents\` as the ONLY tool call in that turn.** Do not emit any other tool calls alongside it — no reads, no writes, no checklist updates. The tool blocks until every sub-agent finishes; you cannot do migration work "while waiting" because there is no waiting from your perspective — your next turn only begins after the tool returns. If you emit other tool calls in the same turn, you and the sub-agents will race on the shared checklist and corrupt state.
|
|
119
|
+
- **After \`spawnCodingSubagents\` returns** — only in a subsequent turn — read the checklist via \`build_manageChecklist\` with \`action: "get"\`. For any \`failed\` items, review the \`failureReason\`. Retry small numbers of recoverable failures yourself (sequentially, using the per-API procedure below). Leave deterministic failures as \`failed\`.
|
|
120
|
+
|
|
121
|
+
## Per-API procedure
|
|
122
|
+
|
|
123
|
+
For APIs you migrate yourself, or that you embed in a sub-agent's \`instructions\`:
|
|
124
|
+
|
|
125
|
+
1. Call \`build_manageChecklist\` with \`action: "update"\`, \`itemId: "api_<ApiName>"\`, \`status: "in_progress"\`.
|
|
126
|
+
2. Read \`scratch/v2-backup/apis/<ApiName>/api.yaml\` and any sibling files the blocks reference.
|
|
127
|
+
3. Produce the TypeScript module at \`server/apis/<ApiName>/api.ts\`, overwriting the stub. Use the YAML block → TS mapping in \`skills/system/superblocks-migration/references/yaml-block-mapping.md\`.
|
|
128
|
+
4. If \`server/apis/index.ts\` exists, update it to register the new module.
|
|
129
|
+
5. On success → \`build_manageChecklist\` with \`status: "completed"\`.
|
|
130
|
+
6. On deterministic failure → \`build_manageChecklist\` with \`status: "failed"\` and a concrete \`failureReason\` (the rule that failed + what is needed to proceed). Continue with the next API.
|
|
131
|
+
|
|
132
|
+
## Run-level rules
|
|
133
|
+
|
|
134
|
+
- Do NOT emit a free-text UNRESOLVED report — every unresolved item must be a \`failed\` checklist entry with a \`failureReason\`.
|
|
135
|
+
- Do NOT stop the run because one API failed. Only stop once every API is either \`completed\` or \`failed\`.
|
|
136
|
+
`;
|
|
137
|
+
//# sourceMappingURL=skill.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqItB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LanguageModelV3 } from "@ai-sdk/provider";
|
|
2
2
|
import type { FinishReason } from "ai";
|
|
3
3
|
import type { ViteDevServer } from "vite";
|
|
4
|
-
import type { AiGenerateRequest, Attachment, LLMProviderConfig, PromptContextIntegration, PromptContext, PromptContextEntity, KnowledgePromotionCapabilities, RememberKnowledgeCandidate, RuntimeErrorData, AiMode, PlanContext,
|
|
4
|
+
import type { AiGenerateRequest, Attachment, LLMProviderConfig, PromptContextIntegration, PromptContext, PromptContextEntity, KnowledgePromotionCapabilities, RememberKnowledgeCandidate, RuntimeErrorData, AiMode, PlanContext, AiChatMessage, AiGenerationState, AiToolPermission, BrowserContext, ConsoleLogEntry, ApiRunRecord, KnowledgeSaveOutcome } from "@superblocksteam/library-shared/types";
|
|
5
5
|
import type { AiPromptCostUsageEntry, TracedEventEmitter } from "@superblocksteam/shared";
|
|
6
6
|
import type { OperationQueue } from "../../util/operation-queue.js";
|
|
7
7
|
import type { EntityPermissionStore } from "../agent/tools2/entity-permissions.js";
|
|
@@ -26,7 +26,7 @@ import type { ClarkProfiler } from "../profiler/clark-profiler.js";
|
|
|
26
26
|
import type { PromptInterpretTask } from "../prompt-builder-service/classifiers/prompt-interpret-task.js";
|
|
27
27
|
import type { RecordingManager } from "../recording/index.js";
|
|
28
28
|
import type { TemplateRenderer } from "../template-renderer.js";
|
|
29
|
-
import type { AiServiceConfig, AiServiceEvents,
|
|
29
|
+
import type { AiServiceConfig, AiServiceEvents, ChangeInfo, EditorClient, FileArtifact, UserChange } from "../types.js";
|
|
30
30
|
import type { FSMOnTransitionParams, FSMTransitionHandlerFactory } from "./fsm.js";
|
|
31
31
|
import { TracedFSM, type TracedFSMStateSpanOptions, type TracedFSMTagProviderFactory } from "./traced-fsm.js";
|
|
32
32
|
declare const $: {
|
|
@@ -72,8 +72,14 @@ export declare const V3_AGENT_FINISHED = "v3AgentFinished";
|
|
|
72
72
|
export type ClarkEvent = {
|
|
73
73
|
type: typeof USER_SENT_PROMPT;
|
|
74
74
|
request: AiGenerateRequest;
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
/**
|
|
76
|
+
* When true, the turn runs through the FSM normally but does NOT
|
|
77
|
+
* persist the user prompt to the chat session store or surface it
|
|
78
|
+
* in the UI chat pane. Used for system-initiated turns (e.g. the
|
|
79
|
+
* post-flip v2→v3 migration turn) where the "user" is the
|
|
80
|
+
* ai-service itself.
|
|
81
|
+
*/
|
|
82
|
+
internal?: boolean;
|
|
77
83
|
} | {
|
|
78
84
|
type: typeof USER_ACCEPTED_DRAFT;
|
|
79
85
|
silently?: boolean;
|
|
@@ -257,11 +263,8 @@ export declare class Clark extends TracedFSM<ClarkState, ClarkEvent, ClarkContex
|
|
|
257
263
|
* @param services - Active Clark session services (chat store, context manager)
|
|
258
264
|
* @param label - Short category tag, e.g. "Knowledge update"
|
|
259
265
|
* @param content - Human-readable description of what happened
|
|
260
|
-
* @param options - Controls how the event is attributed in LLM context
|
|
261
266
|
*/
|
|
262
|
-
recordSystemMessage(services: Pick<ClarkStateHandlerParams, "chatSessionStore" | "contextManagerV2" | "applicationId">, label: string, content: string
|
|
263
|
-
role?: "assistant" | "user";
|
|
264
|
-
}): Promise<void>;
|
|
267
|
+
recordSystemMessage(services: Pick<ClarkStateHandlerParams, "chatSessionStore" | "contextManagerV2" | "applicationId">, label: string, content: string): Promise<void>;
|
|
265
268
|
private pushContextUsed;
|
|
266
269
|
}
|
|
267
270
|
export type ClarkTransition = FSMOnTransitionParams<ClarkState, ClarkEvent>;
|
|
@@ -303,8 +306,19 @@ export interface ApiTestingState {
|
|
|
303
306
|
denied: Set<string>;
|
|
304
307
|
}
|
|
305
308
|
export type ClarkContext = {
|
|
306
|
-
|
|
307
|
-
|
|
309
|
+
/**
|
|
310
|
+
* The editor peer RPC client. This is a permanent `StablePeer` proxy
|
|
311
|
+
* installed at Clark construction time; its inner WebSocket client is
|
|
312
|
+
* swapped on reconnect via `StablePeer.setInner(...)`. The reference on
|
|
313
|
+
* the context itself NEVER changes — do not reassign it via
|
|
314
|
+
* `updateContext({ peer })`. Callers can cache this reference freely and
|
|
315
|
+
* trust that `peer.call.*` routes to the currently-live socket (or queues
|
|
316
|
+
* transparently during the reconnect window).
|
|
317
|
+
*
|
|
318
|
+
* The peer's identity token (`peerId`) lives on the proxy itself; read it
|
|
319
|
+
* via `stablePeer.peerId` rather than tracking a separate context field.
|
|
320
|
+
*/
|
|
321
|
+
peer: EditorClient;
|
|
308
322
|
hasSuggestions?: boolean;
|
|
309
323
|
summaryMessages?: {
|
|
310
324
|
role: "user" | "assistant";
|
|
@@ -345,7 +359,7 @@ export type ClarkContext = {
|
|
|
345
359
|
items: {
|
|
346
360
|
id: string;
|
|
347
361
|
content: string;
|
|
348
|
-
status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
362
|
+
status: "pending" | "in_progress" | "completed" | "cancelled" | "failed";
|
|
349
363
|
createdAt: string;
|
|
350
364
|
updatedAt?: string;
|
|
351
365
|
}[];
|
|
@@ -376,7 +390,7 @@ export type ClarkContext = {
|
|
|
376
390
|
};
|
|
377
391
|
activeInteractiveMessage?: {
|
|
378
392
|
id: string;
|
|
379
|
-
payload:
|
|
393
|
+
payload: AiChatMessage;
|
|
380
394
|
};
|
|
381
395
|
/** Tracks integration action prompt sent after opening setup so responses can be handled deterministically */
|
|
382
396
|
pendingIntegrationActionPrompt?: {
|
|
@@ -452,7 +466,6 @@ export type ClarkContext = {
|
|
|
452
466
|
};
|
|
453
467
|
export type ClarkStateHandlerParams = AiServiceConfig & {
|
|
454
468
|
templateRenderer: TemplateRenderer;
|
|
455
|
-
artifactProcessor: ArtifactProcessor;
|
|
456
469
|
appShell: AppShell;
|
|
457
470
|
signals: TracedEventEmitter<AiServiceEvents>;
|
|
458
471
|
fileSystemInterface: FileSystemInterface;
|