@superblocksteam/vite-plugin-file-sync 2.0.118-next.1 → 2.0.119-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +2 -5
- package/dist/ai-service/agent/middleware.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 +17 -11
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +17 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +219 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +27 -3
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +36 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js +369 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +4 -0
- 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 +16 -5
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +18 -13
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +138 -2
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js +51 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.js +52 -0
- package/dist/ai-service/agent/tools/build-copy-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts +57 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js +37 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js.map +1 -0
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +17 -5
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +42 -50
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +7 -5
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +54 -108
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts +103 -0
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database.js +117 -0
- package/dist/ai-service/agent/tools/databases/dev-database.js.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +4 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +4 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +18 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +99 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.js +30 -4
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +163 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.js +52 -0
- package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
- package/dist/ai-service/agent/tools.d.ts +2 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +74 -6
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/example.js +1 -1
- package/dist/ai-service/agent/tools2/example.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +7 -0
- 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 +11 -1
- 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 +7 -0
- 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 +3 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +4 -3
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +9 -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 +15 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -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 +8 -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 +21 -4
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +87 -11
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts +10 -2
- 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 +2 -0
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -1
- package/dist/ai-service/app-interface/npm-registry.d.ts +137 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.js +415 -0
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
- package/dist/ai-service/app-interface/shell.d.ts +38 -0
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +222 -1
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js +31 -21
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +105 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js +498 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
- package/dist/ai-service/context-download.d.ts +14 -1
- package/dist/ai-service/context-download.d.ts.map +1 -1
- package/dist/ai-service/context-download.js +80 -0
- package/dist/ai-service/context-download.js.map +1 -1
- package/dist/ai-service/dev-database-client.d.ts +90 -0
- package/dist/ai-service/dev-database-client.d.ts.map +1 -0
- package/dist/ai-service/dev-database-client.js +166 -0
- package/dist/ai-service/dev-database-client.js.map +1 -0
- package/dist/ai-service/features.d.ts +16 -0
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +10 -0
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +11 -1
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +81 -13
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +5 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +19 -2
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts +8 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.js +17 -1
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.js +3 -3
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
- package/dist/ai-service/llm/impl/clark.js +3 -3
- package/dist/ai-service/llm/impl/clark.js.map +1 -1
- package/dist/ai-service/llm/provider.d.ts.map +1 -1
- package/dist/ai-service/llm/provider.js +22 -7
- package/dist/ai-service/llm/provider.js.map +1 -1
- package/dist/ai-service/llm/types.d.ts +14 -1
- package/dist/ai-service/llm/types.d.ts.map +1 -1
- package/dist/ai-service/llmobs/context-registry.d.ts +62 -0
- package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -0
- package/dist/ai-service/llmobs/context-registry.js +115 -0
- package/dist/ai-service/llmobs/context-registry.js.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts +23 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.js +112 -10
- package/dist/ai-service/llmobs/otel-exporter.js.map +1 -1
- package/dist/ai-service/llmobs/tracer.d.ts +7 -0
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
- package/dist/ai-service/llmobs/tracer.js +38 -0
- package/dist/ai-service/llmobs/tracer.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 +2 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +3 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +29 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +112 -6
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +107 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +33 -3
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +21 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +79 -6
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +10 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +69 -41
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts +35 -7
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +81 -15
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/template-renderer.d.ts +14 -1
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +144 -41
- package/dist/ai-service/template-renderer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +2 -2
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +2 -2
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
- package/dist/draft-interface.d.ts +1 -1
- package/dist/draft-interface.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +34 -27
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +4 -0
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +13 -0
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/inject-index-vite-plugin.d.ts.map +1 -1
- package/dist/inject-index-vite-plugin.js +15 -1
- package/dist/inject-index-vite-plugin.js.map +1 -1
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +15 -1
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +8 -10
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/migration-checklist.d.ts +51 -2
- package/dist/migration/migration-checklist.d.ts.map +1 -1
- package/dist/migration/migration-checklist.js +79 -151
- package/dist/migration/migration-checklist.js.map +1 -1
- package/dist/migration/migration-routes.d.ts.map +1 -1
- package/dist/migration/migration-routes.js +290 -30
- package/dist/migration/migration-routes.js.map +1 -1
- package/dist/migration/migration-verification.d.ts +206 -0
- package/dist/migration/migration-verification.d.ts.map +1 -0
- package/dist/migration/migration-verification.js +1006 -0
- package/dist/migration/migration-verification.js.map +1 -0
- package/dist/migration/restructure.d.ts +9 -2
- package/dist/migration/restructure.d.ts.map +1 -1
- package/dist/migration/restructure.js +116 -5
- package/dist/migration/restructure.js.map +1 -1
- package/dist/migration/unsupported-integrations.d.ts.map +1 -1
- package/dist/migration/unsupported-integrations.js +9 -0
- package/dist/migration/unsupported-integrations.js.map +1 -1
- package/dist/migration/yaml-walk.d.ts +18 -0
- package/dist/migration/yaml-walk.d.ts.map +1 -0
- package/dist/migration/yaml-walk.js +45 -0
- package/dist/migration/yaml-walk.js.map +1 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +8 -0
- package/dist/socket-manager.js.map +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts.map +1 -1
- package/dist/sync-service/hash-dir-tree.js +3 -3
- package/dist/sync-service/hash-dir-tree.js.map +1 -1
- package/dist/sync-service/index.d.ts +0 -14
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +1 -44
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts +1 -1
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +36 -3
- package/dist/sync-service/list-dir.js.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.js +4 -8
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
- package/dist/util/log-sanitizer.d.ts +6 -5
- package/dist/util/log-sanitizer.d.ts.map +1 -1
- package/dist/util/log-sanitizer.js +21 -6
- package/dist/util/log-sanitizer.js.map +1 -1
- package/package.json +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-frontend/skill.generated.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmqBtB,CAAC"}
|
package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts
CHANGED
|
@@ -1,2 +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 `
|
|
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 `2.0-upgrade` item still `pending` (or legacy `seed_api` items in older runs). 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\nThe runtime also enforces a grouped unresolved guidance prompt when a migration pass ends with unresolved `seed_api` items. Treat that as a safety net, not a replacement for your own targeted `askMultiChoice` calls when you know exactly what information is missing.\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
2
|
//# sourceMappingURL=focused-debug.generated.d.ts.map
|
|
@@ -1 +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,
|
|
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,w5LAwDnB,CAAC"}
|
package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js
CHANGED
|
@@ -8,7 +8,7 @@ This is a _retry_ attempt. Earlier runs already tried — and failed — on the
|
|
|
8
8
|
|
|
9
9
|
## Step 1: pull the prior-failure context
|
|
10
10
|
|
|
11
|
-
The checklist stores each item's most recent \`lastFailureReason\`. Call \`build_manageChecklist\` with \`action: "get"\` and read the \`lastFailureReason\` for every \`
|
|
11
|
+
The checklist stores each item's most recent \`lastFailureReason\`. Call \`build_manageChecklist\` with \`action: "get"\` and read the \`lastFailureReason\` for every \`2.0-upgrade\` item still \`pending\` (or legacy \`seed_api\` items in older runs). Treat each reason as primary context when choosing your approach for that API.
|
|
12
12
|
|
|
13
13
|
Only address the APIs surfaced by that query — the rest of the app is already migrated.
|
|
14
14
|
|
|
@@ -26,6 +26,8 @@ Only address the APIs surfaced by that query — the rest of the app is already
|
|
|
26
26
|
|
|
27
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
28
|
|
|
29
|
+
The runtime also enforces a grouped unresolved guidance prompt when a migration pass ends with unresolved \`seed_api\` items. Treat that as a safety net, not a replacement for your own targeted \`askMultiChoice\` calls when you know exactly what information is missing.
|
|
30
|
+
|
|
29
31
|
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
32
|
|
|
31
33
|
### Exact rule
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDtB,CAAC"}
|
|
@@ -1,2 +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";
|
|
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## Python blocks\n\n```yaml\nstep:\n name: <BlockName>\n integration: python\n python:\n body: |\n ...Python code...\n```\n\nThere is **no `python` integration** in sdk-api. Re-write the body as equivalent TypeScript inside `run(ctx, input)` \u2014 the same placement as a `javascript:` block. Translate idioms 1:1 where possible:\n\n| Python | TypeScript |\n| ------------------------- | ------------------------------------------- |\n| `requests.get(url, ...)` | `await fetch(url, ...)` then `.json()` |\n| `requests.post(url, ...)` | `await fetch(url, { method: \"POST\", ... })` |\n| `[f(x) for x in xs]` | `xs.map(x => f(x))` |\n| `[x for x in xs if p(x)]` | `xs.filter(p)` |\n| `len(xs)` | `xs.length` |\n| `d[\"k\"]` / `d.get(\"k\")` | `d.k` / `d[\"k\"]` |\n| `os.environ[\"X\"]` | `process.env.X` |\n| `json.dumps(o)` | `JSON.stringify(o)` |\n| `json.loads(s)` | `JSON.parse(s)` |\n| `raise Exception(\"...\")` | `throw new Error(\"...\")` |\n| `try / except` | `try { ... } catch (err) { ... }` |\n\nReferences to prior blocks' `<PriorBlock>.output` become the local `const` bound to that block's result \u2014 same rule as JavaScript blocks. If the Python relied on a third-party PyPI package with no straightforward JS equivalent (e.g. numpy, pandas, scipy, a vendor SDK), do not fabricate a port \u2014 mark that API `failed` with a `failureReason` that names the package.\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
2
|
//# sourceMappingURL=yaml-block-mapping.generated.d.ts.map
|
|
@@ -1 +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,
|
|
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,soOAoInB,CAAC"}
|
|
@@ -45,6 +45,35 @@ step:
|
|
|
45
45
|
|
|
46
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
47
|
|
|
48
|
+
## Python blocks
|
|
49
|
+
|
|
50
|
+
\`\`\`yaml
|
|
51
|
+
step:
|
|
52
|
+
name: <BlockName>
|
|
53
|
+
integration: python
|
|
54
|
+
python:
|
|
55
|
+
body: |
|
|
56
|
+
...Python code...
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
There is **no \`python\` integration** in sdk-api. Re-write the body as equivalent TypeScript inside \`run(ctx, input)\` — the same placement as a \`javascript:\` block. Translate idioms 1:1 where possible:
|
|
60
|
+
|
|
61
|
+
| Python | TypeScript |
|
|
62
|
+
| ------------------------- | ------------------------------------------- |
|
|
63
|
+
| \`requests.get(url, ...)\` | \`await fetch(url, ...)\` then \`.json()\` |
|
|
64
|
+
| \`requests.post(url, ...)\` | \`await fetch(url, { method: "POST", ... })\` |
|
|
65
|
+
| \`[f(x) for x in xs]\` | \`xs.map(x => f(x))\` |
|
|
66
|
+
| \`[x for x in xs if p(x)]\` | \`xs.filter(p)\` |
|
|
67
|
+
| \`len(xs)\` | \`xs.length\` |
|
|
68
|
+
| \`d["k"]\` / \`d.get("k")\` | \`d.k\` / \`d["k"]\` |
|
|
69
|
+
| \`os.environ["X"]\` | \`process.env.X\` |
|
|
70
|
+
| \`json.dumps(o)\` | \`JSON.stringify(o)\` |
|
|
71
|
+
| \`json.loads(s)\` | \`JSON.parse(s)\` |
|
|
72
|
+
| \`raise Exception("...")\` | \`throw new Error("...")\` |
|
|
73
|
+
| \`try / except\` | \`try { ... } catch (err) { ... }\` |
|
|
74
|
+
|
|
75
|
+
References to prior blocks' \`<PriorBlock>.output\` become the local \`const\` bound to that block's result — same rule as JavaScript blocks. If the Python relied on a third-party PyPI package with no straightforward JS equivalent (e.g. numpy, pandas, scipy, a vendor SDK), do not fabricate a port — mark that API \`failed\` with a \`failureReason\` that names the package.
|
|
76
|
+
|
|
48
77
|
## Control-flow blocks
|
|
49
78
|
|
|
50
79
|
| YAML block | TS construct |
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoItB,CAAC"}
|
|
@@ -1,2 +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";
|
|
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 `2.0-upgrade`, status `pending`, `clearOnFinalize: false`). Legacy in-flight runs may still have `origin: \"seed_api\"` for these API items. Pull the live set by calling `build_manageChecklist` with `action: \"get\"` and filtering to `status: \"pending\"` plus API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \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()`. The same applies to **`python:` blocks**: there is no `python` integration in sdk-api, so port the body to inline TypeScript inside `run(ctx, input)` (see \"Substituting unsupported integrations\" below and the Python section in `yaml-block-mapping.md`).\n\n## Substituting unsupported integrations\n\nThe pre-migration UI warns the user when an app references integrations whose v2 plugin is not present in sdk-api. The migration is **not** aborted on those APIs \u2014 they are still in your `seed_api` checklist and you are expected to make a best-effort port rather than immediately marking them `failed`.\n\nSubstitution rules (apply in order; first match wins):\n\n1. **`python:` step \u2192 inline TypeScript.** Re-write the Python body as equivalent TypeScript inside `run(ctx, input)`, exactly the way `javascript:` blocks are inlined. Translate Python idioms to JS/TS (e.g. `requests.get(...)` \u2192 `fetch(...)`, list comprehensions \u2192 `array.map`/`filter`, `len(x)` \u2192 `x.length`, dict access \u2192 object property access, `os.environ[...]` \u2192 `process.env[...]`, raise/except \u2192 `throw`/`try\u2026catch`). If the Python relied on a third-party PyPI package with no obvious JS equivalent, mark that one API `failed` with a `failureReason` naming the package \u2014 do not ship a guess.\n2. **HTTP-shaped vendor plugin \u2192 REST.** If an unsupported integration was effectively making REST calls (e.g. a thin wrapper around an HTTP API) and you can read the request shape from the YAML, port it to the `restApi` factory from sdk-api (or the dedicated vendor factory if one exists in the barrel \u2014 check `node_modules/@superblocksteam/sdk-api/src/index.ts`).\n3. **Otherwise, mark `failed`.** Per the meta-rule, do not invent a factory or fabricate behavior. Use `build_manageChecklist` with `status: \"failed\"` and a concrete `failureReason` (e.g. `\"unsupported integration <pluginId> with no JS-equivalent path\"`).\n\nDo **not** silently skip a step or replace it with a `// TODO` \u2014 every API still needs a deterministic outcome (`completed` or `failed`) on the checklist.\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 `status: \"pending\"` and API-migration origins (`origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`) \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\nDependency parity verification (required once per migration run):\n\n1. Mark `migration_dependency_verification` as `in_progress` via `build_manageChecklist`.\n2. Read both `package.json` and `scratch/v2-backup/package.json`.\n3. Compare dependencies needed by migrated client code against declared dependencies in the current `package.json` (especially UI libraries imported from `client/**`).\n4. For any missing dependency, call `build_installPackages` and then re-run `build_debug`.\n5. After dependencies are reconciled, mark `migration_dependency_verification` as `completed`.\n\nPage route verification (required once per migration run):\n\n1. Enumerate checklist items whose IDs start with `migration_page_route_verification_` (one item is seeded per discovered route).\n2. Enumerate migrated routes deterministically from backup artifacts:\n - Primary source: `scratch/v2-backup/router.tsx`.\n - If that file is absent, derive candidate pages from `scratch/v2-backup/pages/**/index.tsx` and confirm against `client/router.tsx`.\n3. For each discovered route, set the matching `migration_page_route_verification_*` checklist item to `in_progress`, exercise the route in the migrated app, and check for load/runtime/import failures.\n4. Resolve route-specific failures (missing imports/dependencies, broken lazy imports, page-level runtime errors), then re-check until the route is clean.\n5. Mark each per-route checklist item `completed` only after its route passes.\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 `status: \"pending\"` and API-migration origins: `origin: \"2.0-upgrade\"` or legacy `origin: \"seed_api\"`).\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 - **Also pass `apiNames: [\"<ApiName1>\", \"<ApiName2>\", \u2026]` for every sub-agent**, listing the same names that appear in its `instructions`. The spawn tool stamps each `api_<ApiName>` checklist item with that sub-agent's `id` as `workerId` BEFORE fan-out, which lets the migration UI render one batch row per sub-agent in the chat sidebar. Forgetting `apiNames` is non-fatal (the sub-agents still run) but the sidebar checklist will fall back to one row per API instead of one per batch.\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. Call `build_debug`. If it fails, fix and repeat until it passes. Do not proceed to step 6 until `build_debug` succeeds.\n6. **Call `runMigrationVerification({ apiName: \"<ApiName>\", inputs: <inputs> })` and resolve every divergence in this same chat.** The tool's response includes `attempt` and `maxAttempts` so you don't need to track an attempt counter yourself \u2014 the server reads it from on-disk history per API.\n\n Your job is to make v3 produce the same response as v2 \u2014 not to \"try a few times and punt to the user\". The user already lived with this API working on v2 with their real data; if v3 doesn't match, that's a regression you introduced, and you fix it here. NEVER leave a `diverged` API for the user to \"Accept divergence\" or \"Try one more attempt\" via the API calls panel \u2014 those buttons exist as escape hatches for situations the policy gate requires (mutations, denied integrations), not as a way for you to skip work.\n\n Synthesize `inputs` the same way you would for `testApi`: inspect the v2 YAML from step 2 and the v3 TS from step 3, enumerate every binding the API references that isn't produced by an earlier block (component values like `Input1.value`/`Select1.selectedItem.id`, table selections like `Table1.selectedRow`, state variables, workflow `body`/`params`), and pick a realistic mock value for each matching the binding's expected type. Both v2 and v3 receive the same `inputs`, so this is what makes the diff meaningful \u2014 `{}` for an API with bindings produces a vacuous `both_failed` that tells you nothing.\n\n Outcomes and how to resolve them:\n - **`passed`**: call `build_manageChecklist` with `status: \"completed\"`. Done.\n\n - **`skipped_mutation`**: this is a policy gate, not a deterministic pass. Do **NOT** mark the checklist item `completed` yet. Leave it unresolved (keep `in_progress`), continue processing other APIs, and resolve all skipped items in one grouped decision at the end of the run (see \"Mutation policy follow-up\" below).\n\n - **`v2_unrunnable`**: the v2 backup itself couldn't execute, so there is no baseline to match. Call `build_manageChecklist` with `status: \"completed\"` and continue.\n\n - **`both_failed`**:\n - If you passed `inputs: {}` and the API references bindings: synthesize real `inputs` (per the bullet above) and retry. Do NOT mark completed here \u2014 empty inputs caused this, not a real failure.\n - If you passed real inputs and v2 still failed: read v2's error. If it is environmental (auth/credentials/integration-unavailable: \"no integration configured\", \"401\", \"ECONNREFUSED\", \"missing API key\"), v2 cannot run in this verification context regardless of what you do \u2014 call `build_manageChecklist` with `status: \"completed\"` and continue; the user will verify manually. If it's a v2 runtime error that v3 also reproduces, treat as `diverged` (your inputs are wrong, or the API expects state that isn't reproducible here \u2014 revise inputs and retry).\n\n - **`error`**: a system error in the verification flow itself (cannot read v3 source, etc.). Fix what you can; if it persists across one retry, mark the item `failed` with `failureReason: \"<error detail>\"` and continue.\n\n- **`diverged`**: the API ran on both sides and the outputs differ. **Iterate until v3 matches v2 byte-for-byte (modulo the normalizations api-comparator already applies: identical ISO timestamps, near-now ISO timestamps within \u00B160s of each other and \u00B15min of \"now\", UUIDs, monotonic integer IDs differing by \u22641 on fields whose leaf ends with \"id\", floats within 1e-9 relative tolerance, and per-request opaque identifiers at leaves named `requestId`/`traceId`/`spanId`/`correlationId`/`sessionId`/`nonce`/`csrfToken`/`_id` \u2014 note: a bare leaf named `token` is intentionally NOT normalized, since auth/access-token divergence is a security-relevant signal we want to surface).**\n\n There is one bounded judgment exception: if both v2 and v3 executions succeeded, the output shape/types are equivalent, and the remaining diffs are value-level fields you reasonably infer are inherently non-deterministic outputs for this API, treat the migration as semantically complete for this run. In that case, mark the checklist item `completed` and continue.\n\n Use this exception only when all of the following are true:\n - The divergence is not structural (no missing/extra fields, no type mismatch, no changed nesting/cardinality, no changed error/status behavior).\n - The differing fields are expected to vary per invocation and do not change control flow decisions.\n - The API's functional contract remains intact for downstream consumers.\n\n If any of those conditions are not met, the divergence is semantic and must be fixed \u2014 do NOT add code purely to mask values the comparator already tolerates.\n\n For each `summaryForAgent` entry \u2014 every entry names the JSON path that diverged and the v2/v3 values \u2014 find the block in `server/apis/<ApiName>/api.ts` that produces that path and fix the discrepancy. Common causes, in rough order of frequency:\n - wrong column projection or missing field in a SELECT\n - missing transform / output shape mismatch (array vs object wrapper, single vs list)\n - off-by-one or wrong placeholder in a SQL parameter\n - mistyped binding key (case, plural, dotted path)\n - type coercion (string vs number, null vs undefined, boolean vs \"true\")\n - missing default value when the binding is undefined\n - wrong join order or implicit ordering of rows\n - filter/where condition different from v2\n - missing `LIMIT`, `OFFSET`, or pagination handling\n\n If a divergence stems from the `inputs` you passed (e.g. v2 echoes the input one way and v3 a different way because they normalize it differently), revise the inputs alongside the source.\n\n Then call `build_debug` (fix any failures), then `runMigrationVerification` again with the revised source/inputs.\n\n **There is no fixed retry budget \u2014 iterate until `passed` or until you have firm structural evidence that no v3 source change can reconcile v2 and v3.** Acceptable evidence for stopping: v2 references a YAML construct with no v3 SDK equivalent and the divergence is in that construct; v2 derives a value from runtime state v3 cannot observe (e.g. an env var that differs by environment). When you stop on structural grounds, mark the item `failed` with `failureReason: \"verification_diverged_irreconcilable: <one-paragraph reason naming the specific summaryForAgent entry and the structural reason> | summary: <JSON.stringify(summaryForAgent)>\"`.\n\n Guardrail against infinite loops (NOT a retry budget): if you have iterated 8 times on the same API and the set of divergences has not materially changed across the last 3 attempts (i.e. you are flailing, not converging), stop and mark `failed` with the same `failureReason` shape. If you ARE converging \u2014 fewer divergences each attempt, or the remaining ones look smaller \u2014 keep going past 8.\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\n## Mutation policy follow-up (required once per run if any API returned `skipped_mutation`)\n\nAfter you've done everything deterministic (all non-skipped APIs settled), if one or more APIs ended with `skipped_mutation`, call **one** grouped `askMultiChoice` with exactly these options:\n\n- `Mark all untested APIs as complete`\n- `Test them, and you'll be prompted for permission`\n\nThen:\n\n1. If user picks **`Mark all untested APIs as complete`**:\n - For each skipped API checklist item, call `build_manageChecklist` update \u2192 `status: \"completed\"`.\n2. If user picks **`Test them, and you'll be prompted for permission`**:\n - Clear persisted write-policy first so `deny`/`ask` modal state does not keep forcing `skipped_mutation`:\n - read `scratch/migration-state.json`\n - remove the `integrationWritePolicy` field\n - write the file back\n - Then run `testApi` for each skipped API so the runtime can prompt the user for write approval in-context.\n - After user approvals and tests settle, update checklist status accordingly (`completed` on success, `failed` with concrete `failureReason` on deterministic blockers).\n\n## Post-batch re-verification\n\nAfter `spawnCodingSubagents` returns (or after all sequential APIs are settled), before updating the checklist overall status:\n\n1. Call `build_manageChecklist` with `action: \"get\"` and read all items.\n2. For any item where `verificationOutcome === \"auto_passed\"` and `lastVerificationAt` is older than any sibling item's `updatedAt` minus 60 seconds: this item may have drifted due to registry edits made by later sub-agents. Re-run `runMigrationVerification({ apiName, inputs: <inputs> })` for each such item \u2014 synthesize `inputs` the same way as in step 6 of the per-API procedure.\n3. If any re-verification produces `diverged`, apply the normal per-API diverge\u2192retry loop (no fixed retry budget; iterate until `passed` or firm structural-irreconcilability evidence, with the anti-flail guardrail at 8 iterations without convergence).\n4. Proceed to mark overall checklist completed/failed only after all re-verifications settle.\n";
|
|
2
2
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +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,
|
|
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,k2vBA+OnB,CAAC"}
|
|
@@ -25,7 +25,7 @@ Corollary: do not add \`// TODO\` comments that silently ship. Unresolved items
|
|
|
25
25
|
|
|
26
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
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 \`
|
|
28
|
+
- **Checklist:** the migration checklist has already been seeded with one item per API (id \`api_<ApiName>\`, origin \`2.0-upgrade\`, status \`pending\`, \`clearOnFinalize: false\`). Legacy in-flight runs may still have \`origin: "seed_api"\` for these API items. Pull the live set by calling \`build_manageChecklist\` with \`action: "get"\` and filtering to \`status: "pending"\` plus API-migration origins (\`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`) — that is your authoritative API list and count for this turn.
|
|
29
29
|
|
|
30
30
|
## Required reading (read these BEFORE writing any output)
|
|
31
31
|
|
|
@@ -38,13 +38,25 @@ Authoritative. If a rule here conflicts with your priors, these win.
|
|
|
38
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
39
|
4. \`skills/system/superblocks-migration/references/yaml-block-mapping.md\` — full YAML → TS mapping for each legacy block type.
|
|
40
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()\`.
|
|
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()\`. The same applies to **\`python:\` blocks**: there is no \`python\` integration in sdk-api, so port the body to inline TypeScript inside \`run(ctx, input)\` (see "Substituting unsupported integrations" below and the Python section in \`yaml-block-mapping.md\`).
|
|
42
|
+
|
|
43
|
+
## Substituting unsupported integrations
|
|
44
|
+
|
|
45
|
+
The pre-migration UI warns the user when an app references integrations whose v2 plugin is not present in sdk-api. The migration is **not** aborted on those APIs — they are still in your \`seed_api\` checklist and you are expected to make a best-effort port rather than immediately marking them \`failed\`.
|
|
46
|
+
|
|
47
|
+
Substitution rules (apply in order; first match wins):
|
|
48
|
+
|
|
49
|
+
1. **\`python:\` step → inline TypeScript.** Re-write the Python body as equivalent TypeScript inside \`run(ctx, input)\`, exactly the way \`javascript:\` blocks are inlined. Translate Python idioms to JS/TS (e.g. \`requests.get(...)\` → \`fetch(...)\`, list comprehensions → \`array.map\`/\`filter\`, \`len(x)\` → \`x.length\`, dict access → object property access, \`os.environ[...]\` → \`process.env[...]\`, raise/except → \`throw\`/\`try…catch\`). If the Python relied on a third-party PyPI package with no obvious JS equivalent, mark that one API \`failed\` with a \`failureReason\` naming the package — do not ship a guess.
|
|
50
|
+
2. **HTTP-shaped vendor plugin → REST.** If an unsupported integration was effectively making REST calls (e.g. a thin wrapper around an HTTP API) and you can read the request shape from the YAML, port it to the \`restApi\` factory from sdk-api (or the dedicated vendor factory if one exists in the barrel — check \`node_modules/@superblocksteam/sdk-api/src/index.ts\`).
|
|
51
|
+
3. **Otherwise, mark \`failed\`.** Per the meta-rule, do not invent a factory or fabricate behavior. Use \`build_manageChecklist\` with \`status: "failed"\` and a concrete \`failureReason\` (e.g. \`"unsupported integration <pluginId> with no JS-equivalent path"\`).
|
|
52
|
+
|
|
53
|
+
Do **not** silently skip a step or replace it with a \`// TODO\` — every API still needs a deterministic outcome (\`completed\` or \`failed\`) on the checklist.
|
|
42
54
|
|
|
43
55
|
## Preflight gate (MUST pass before any file edits)
|
|
44
56
|
|
|
45
57
|
Complete this orientation sequence before writing or modifying any API file:
|
|
46
58
|
|
|
47
|
-
1. Call \`build_manageChecklist\` with \`action: "get"\` and filter to \`origin: "
|
|
59
|
+
1. Call \`build_manageChecklist\` with \`action: "get"\` and filter to \`status: "pending"\` and API-migration origins (\`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`) — this is your authoritative API list and count for this turn.
|
|
48
60
|
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
61
|
3. Read \`node_modules/@superblocksteam/sdk-api/README.md\`.
|
|
50
62
|
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.
|
|
@@ -94,6 +106,24 @@ Runtime verification (required):
|
|
|
94
106
|
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
107
|
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
108
|
|
|
109
|
+
Dependency parity verification (required once per migration run):
|
|
110
|
+
|
|
111
|
+
1. Mark \`migration_dependency_verification\` as \`in_progress\` via \`build_manageChecklist\`.
|
|
112
|
+
2. Read both \`package.json\` and \`scratch/v2-backup/package.json\`.
|
|
113
|
+
3. Compare dependencies needed by migrated client code against declared dependencies in the current \`package.json\` (especially UI libraries imported from \`client/**\`).
|
|
114
|
+
4. For any missing dependency, call \`build_installPackages\` and then re-run \`build_debug\`.
|
|
115
|
+
5. After dependencies are reconciled, mark \`migration_dependency_verification\` as \`completed\`.
|
|
116
|
+
|
|
117
|
+
Page route verification (required once per migration run):
|
|
118
|
+
|
|
119
|
+
1. Enumerate checklist items whose IDs start with \`migration_page_route_verification_\` (one item is seeded per discovered route).
|
|
120
|
+
2. Enumerate migrated routes deterministically from backup artifacts:
|
|
121
|
+
- Primary source: \`scratch/v2-backup/router.tsx\`.
|
|
122
|
+
- If that file is absent, derive candidate pages from \`scratch/v2-backup/pages/**/index.tsx\` and confirm against \`client/router.tsx\`.
|
|
123
|
+
3. For each discovered route, set the matching \`migration_page_route_verification_*\` checklist item to \`in_progress\`, exercise the route in the migrated app, and check for load/runtime/import failures.
|
|
124
|
+
4. Resolve route-specific failures (missing imports/dependencies, broken lazy imports, page-level runtime errors), then re-check until the route is clean.
|
|
125
|
+
5. Mark each per-route checklist item \`completed\` only after its route passes.
|
|
126
|
+
|
|
97
127
|
For each converted API, self-check:
|
|
98
128
|
|
|
99
129
|
1. File default-exports exactly one \`api({...})\`; \`name\` matches \`metadata.name\`.
|
|
@@ -106,7 +136,7 @@ For each converted API, self-check:
|
|
|
106
136
|
|
|
107
137
|
## Parallelization policy
|
|
108
138
|
|
|
109
|
-
Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"\`, filter \`origin: "
|
|
139
|
+
Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"\`, filter \`status: "pending"\` and API-migration origins: \`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`).
|
|
110
140
|
|
|
111
141
|
- **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
142
|
- **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\`.
|
|
@@ -115,6 +145,7 @@ Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"
|
|
|
115
145
|
- Names the exact \`<ApiName>\` values that sub-agent owns, verbatim, as a bulleted list.
|
|
116
146
|
- Restates the per-API procedure below so the sub-agent is self-contained.
|
|
117
147
|
- Reminds the sub-agent to update the shared checklist (id \`api_<ApiName>\`) for every item it owns.
|
|
148
|
+
- **Also pass \`apiNames: ["<ApiName1>", "<ApiName2>", …]\` for every sub-agent**, listing the same names that appear in its \`instructions\`. The spawn tool stamps each \`api_<ApiName>\` checklist item with that sub-agent's \`id\` as \`workerId\` BEFORE fan-out, which lets the migration UI render one batch row per sub-agent in the chat sidebar. Forgetting \`apiNames\` is non-fatal (the sub-agents still run) but the sidebar checklist will fall back to one row per API instead of one per batch.
|
|
118
149
|
- **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
150
|
- **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
151
|
|
|
@@ -126,12 +157,87 @@ For APIs you migrate yourself, or that you embed in a sub-agent's \`instructions
|
|
|
126
157
|
2. Read \`scratch/v2-backup/apis/<ApiName>/api.yaml\` and any sibling files the blocks reference.
|
|
127
158
|
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
159
|
4. If \`server/apis/index.ts\` exists, update it to register the new module.
|
|
129
|
-
5.
|
|
130
|
-
6.
|
|
160
|
+
5. Call \`build_debug\`. If it fails, fix and repeat until it passes. Do not proceed to step 6 until \`build_debug\` succeeds.
|
|
161
|
+
6. **Call \`runMigrationVerification({ apiName: "<ApiName>", inputs: <inputs> })\` and resolve every divergence in this same chat.** The tool's response includes \`attempt\` and \`maxAttempts\` so you don't need to track an attempt counter yourself — the server reads it from on-disk history per API.
|
|
162
|
+
|
|
163
|
+
Your job is to make v3 produce the same response as v2 — not to "try a few times and punt to the user". The user already lived with this API working on v2 with their real data; if v3 doesn't match, that's a regression you introduced, and you fix it here. NEVER leave a \`diverged\` API for the user to "Accept divergence" or "Try one more attempt" via the API calls panel — those buttons exist as escape hatches for situations the policy gate requires (mutations, denied integrations), not as a way for you to skip work.
|
|
164
|
+
|
|
165
|
+
Synthesize \`inputs\` the same way you would for \`testApi\`: inspect the v2 YAML from step 2 and the v3 TS from step 3, enumerate every binding the API references that isn't produced by an earlier block (component values like \`Input1.value\`/\`Select1.selectedItem.id\`, table selections like \`Table1.selectedRow\`, state variables, workflow \`body\`/\`params\`), and pick a realistic mock value for each matching the binding's expected type. Both v2 and v3 receive the same \`inputs\`, so this is what makes the diff meaningful — \`{}\` for an API with bindings produces a vacuous \`both_failed\` that tells you nothing.
|
|
166
|
+
|
|
167
|
+
Outcomes and how to resolve them:
|
|
168
|
+
- **\`passed\`**: call \`build_manageChecklist\` with \`status: "completed"\`. Done.
|
|
169
|
+
|
|
170
|
+
- **\`skipped_mutation\`**: this is a policy gate, not a deterministic pass. Do **NOT** mark the checklist item \`completed\` yet. Leave it unresolved (keep \`in_progress\`), continue processing other APIs, and resolve all skipped items in one grouped decision at the end of the run (see "Mutation policy follow-up" below).
|
|
171
|
+
|
|
172
|
+
- **\`v2_unrunnable\`**: the v2 backup itself couldn't execute, so there is no baseline to match. Call \`build_manageChecklist\` with \`status: "completed"\` and continue.
|
|
173
|
+
|
|
174
|
+
- **\`both_failed\`**:
|
|
175
|
+
- If you passed \`inputs: {}\` and the API references bindings: synthesize real \`inputs\` (per the bullet above) and retry. Do NOT mark completed here — empty inputs caused this, not a real failure.
|
|
176
|
+
- If you passed real inputs and v2 still failed: read v2's error. If it is environmental (auth/credentials/integration-unavailable: "no integration configured", "401", "ECONNREFUSED", "missing API key"), v2 cannot run in this verification context regardless of what you do — call \`build_manageChecklist\` with \`status: "completed"\` and continue; the user will verify manually. If it's a v2 runtime error that v3 also reproduces, treat as \`diverged\` (your inputs are wrong, or the API expects state that isn't reproducible here — revise inputs and retry).
|
|
177
|
+
|
|
178
|
+
- **\`error\`**: a system error in the verification flow itself (cannot read v3 source, etc.). Fix what you can; if it persists across one retry, mark the item \`failed\` with \`failureReason: "<error detail>"\` and continue.
|
|
179
|
+
|
|
180
|
+
- **\`diverged\`**: the API ran on both sides and the outputs differ. **Iterate until v3 matches v2 byte-for-byte (modulo the normalizations api-comparator already applies: identical ISO timestamps, near-now ISO timestamps within ±60s of each other and ±5min of "now", UUIDs, monotonic integer IDs differing by ≤1 on fields whose leaf ends with "id", floats within 1e-9 relative tolerance, and per-request opaque identifiers at leaves named \`requestId\`/\`traceId\`/\`spanId\`/\`correlationId\`/\`sessionId\`/\`nonce\`/\`csrfToken\`/\`_id\` — note: a bare leaf named \`token\` is intentionally NOT normalized, since auth/access-token divergence is a security-relevant signal we want to surface).**
|
|
181
|
+
|
|
182
|
+
There is one bounded judgment exception: if both v2 and v3 executions succeeded, the output shape/types are equivalent, and the remaining diffs are value-level fields you reasonably infer are inherently non-deterministic outputs for this API, treat the migration as semantically complete for this run. In that case, mark the checklist item \`completed\` and continue.
|
|
183
|
+
|
|
184
|
+
Use this exception only when all of the following are true:
|
|
185
|
+
- The divergence is not structural (no missing/extra fields, no type mismatch, no changed nesting/cardinality, no changed error/status behavior).
|
|
186
|
+
- The differing fields are expected to vary per invocation and do not change control flow decisions.
|
|
187
|
+
- The API's functional contract remains intact for downstream consumers.
|
|
188
|
+
|
|
189
|
+
If any of those conditions are not met, the divergence is semantic and must be fixed — do NOT add code purely to mask values the comparator already tolerates.
|
|
190
|
+
|
|
191
|
+
For each \`summaryForAgent\` entry — every entry names the JSON path that diverged and the v2/v3 values — find the block in \`server/apis/<ApiName>/api.ts\` that produces that path and fix the discrepancy. Common causes, in rough order of frequency:
|
|
192
|
+
- wrong column projection or missing field in a SELECT
|
|
193
|
+
- missing transform / output shape mismatch (array vs object wrapper, single vs list)
|
|
194
|
+
- off-by-one or wrong placeholder in a SQL parameter
|
|
195
|
+
- mistyped binding key (case, plural, dotted path)
|
|
196
|
+
- type coercion (string vs number, null vs undefined, boolean vs "true")
|
|
197
|
+
- missing default value when the binding is undefined
|
|
198
|
+
- wrong join order or implicit ordering of rows
|
|
199
|
+
- filter/where condition different from v2
|
|
200
|
+
- missing \`LIMIT\`, \`OFFSET\`, or pagination handling
|
|
201
|
+
|
|
202
|
+
If a divergence stems from the \`inputs\` you passed (e.g. v2 echoes the input one way and v3 a different way because they normalize it differently), revise the inputs alongside the source.
|
|
203
|
+
|
|
204
|
+
Then call \`build_debug\` (fix any failures), then \`runMigrationVerification\` again with the revised source/inputs.
|
|
205
|
+
|
|
206
|
+
**There is no fixed retry budget — iterate until \`passed\` or until you have firm structural evidence that no v3 source change can reconcile v2 and v3.** Acceptable evidence for stopping: v2 references a YAML construct with no v3 SDK equivalent and the divergence is in that construct; v2 derives a value from runtime state v3 cannot observe (e.g. an env var that differs by environment). When you stop on structural grounds, mark the item \`failed\` with \`failureReason: "verification_diverged_irreconcilable: <one-paragraph reason naming the specific summaryForAgent entry and the structural reason> | summary: <JSON.stringify(summaryForAgent)>"\`.
|
|
207
|
+
|
|
208
|
+
Guardrail against infinite loops (NOT a retry budget): if you have iterated 8 times on the same API and the set of divergences has not materially changed across the last 3 attempts (i.e. you are flailing, not converging), stop and mark \`failed\` with the same \`failureReason\` shape. If you ARE converging — fewer divergences each attempt, or the remaining ones look smaller — keep going past 8.
|
|
131
209
|
|
|
132
210
|
## Run-level rules
|
|
133
211
|
|
|
134
212
|
- Do NOT emit a free-text UNRESOLVED report — every unresolved item must be a \`failed\` checklist entry with a \`failureReason\`.
|
|
135
213
|
- Do NOT stop the run because one API failed. Only stop once every API is either \`completed\` or \`failed\`.
|
|
214
|
+
|
|
215
|
+
## Mutation policy follow-up (required once per run if any API returned \`skipped_mutation\`)
|
|
216
|
+
|
|
217
|
+
After you've done everything deterministic (all non-skipped APIs settled), if one or more APIs ended with \`skipped_mutation\`, call **one** grouped \`askMultiChoice\` with exactly these options:
|
|
218
|
+
|
|
219
|
+
- \`Mark all untested APIs as complete\`
|
|
220
|
+
- \`Test them, and you'll be prompted for permission\`
|
|
221
|
+
|
|
222
|
+
Then:
|
|
223
|
+
|
|
224
|
+
1. If user picks **\`Mark all untested APIs as complete\`**:
|
|
225
|
+
- For each skipped API checklist item, call \`build_manageChecklist\` update → \`status: "completed"\`.
|
|
226
|
+
2. If user picks **\`Test them, and you'll be prompted for permission\`**:
|
|
227
|
+
- Clear persisted write-policy first so \`deny\`/\`ask\` modal state does not keep forcing \`skipped_mutation\`:
|
|
228
|
+
- read \`scratch/migration-state.json\`
|
|
229
|
+
- remove the \`integrationWritePolicy\` field
|
|
230
|
+
- write the file back
|
|
231
|
+
- Then run \`testApi\` for each skipped API so the runtime can prompt the user for write approval in-context.
|
|
232
|
+
- After user approvals and tests settle, update checklist status accordingly (\`completed\` on success, \`failed\` with concrete \`failureReason\` on deterministic blockers).
|
|
233
|
+
|
|
234
|
+
## Post-batch re-verification
|
|
235
|
+
|
|
236
|
+
After \`spawnCodingSubagents\` returns (or after all sequential APIs are settled), before updating the checklist overall status:
|
|
237
|
+
|
|
238
|
+
1. Call \`build_manageChecklist\` with \`action: "get"\` and read all items.
|
|
239
|
+
2. For any item where \`verificationOutcome === "auto_passed"\` and \`lastVerificationAt\` is older than any sibling item's \`updatedAt\` minus 60 seconds: this item may have drifted due to registry edits made by later sub-agents. Re-run \`runMigrationVerification({ apiName, inputs: <inputs> })\` for each such item — synthesize \`inputs\` the same way as in step 6 of the per-API procedure.
|
|
240
|
+
3. If any re-verification produces \`diverged\`, apply the normal per-API diverge→retry loop (no fixed retry budget; iterate until \`passed\` or firm structural-irreconcilability evidence, with the anti-flail guardrail at 8 iterations without convergence).
|
|
241
|
+
4. Proceed to mark overall checklist completed/failed only after all re-verifications settle.
|
|
136
242
|
`;
|
|
137
243
|
//# sourceMappingURL=skill.generated.js.map
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+OtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "# Claude Design-specific mapping\n\nThis is a per-platform reference loaded from `SKILL.md`. The framework \u2014 target layout, universal mapping, non-negotiables, workflow, code-emission rules \u2014 lives there. This file documents only what is specific to a Claude Design source.\n\n> Claude Design is a prototype-design tool from Anthropic. Its \"Download project as .zip\" output is a tiny, self-contained, **frontend-only** prototype: a single `<Name>.html` shell that loads React, ReactDOM, and Babel from a CDN and `<script type=\"text/babel\" src=\"...\">` files that compile in the browser at run time. There is **no backend, no `package.json`, no build step, and no module system** \u2014 every helper is hung off `window.*` or pulled from globals. Treat the export as design-quality intent (layout, typography, color, interactions, copy) that needs to be re-expressed inside the Superblocks fullstack template (Vite + React + react-router v7 + Tailwind v4 + shadcn/ui). The framework's \"Don't fabricate a backend\" rule applies \u2014 if the source is purely UI driven by inline mock data, the migrated app stays frontend-only unless the user explicitly asks for one.\n\n## Where the source lives\n\nDefinitive marker: a flat archive (no nested project folder) containing exactly one top-level `<Name>.html` file plus sibling JSX/JS files, with the HTML loading React, ReactDOM, and `@babel/standalone` from `unpkg.com` and using `<script type=\"text/babel\" src=\"...\">` for the JSX files. No `package.json`, no `node_modules`, no `vite.config.*`, no `tsconfig.json`.\n\nStrong supporting signals:\n\n- The HTML root tag is `<html lang=\"...\" data-theme=\"light\">` (or `\"dark\"`); theme switching happens by mutating `data-theme` on `<html>` and CSS variables defined under `:root[data-theme=\"light\"]` / `:root[data-theme=\"dark\"]`.\n- A `tweaks-panel.jsx` sibling that defines a draggable in-canvas controls panel and exposes `useTweaks`, `TweaksPanel`, `TweakSection`, `TweakSlider`, `TweakRadio`, `TweakColor`, `TweakToggle` as window globals. The host protocol is `__activate_edit_mode` / `__deactivate_edit_mode` postMessage handshakes plus `__edit_mode_available` / `__edit_mode_set_keys` / `__edit_mode_dismissed` responses.\n- An `app.jsx` whose top has `const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ ... }/*EDITMODE-END*/;` \u2014 the `EDITMODE-BEGIN` / `EDITMODE-END` markers are how the Claude Design canvas locates and rewrites the defaults block.\n- A `data.js` (or similarly named sibling) that hangs sample data off `window.*`: e.g. `window.ORDERS = [...]; window.KPIS = [...];`. Components consume the globals directly (`/* global React, ReactDOM, ORDERS, KPIS, useTweaks, ... */` at the top of `app.jsx`).\n- Mounting happens at the bottom of `app.jsx` via `ReactDOM.createRoot(document.getElementById(\"root\")).render(<App />);` against a single `<div id=\"root\"></div>` in the HTML body.\n- Inline `<style>` block in `<head>` defines the entire visual system: a light + dark token palette under `:root[data-theme=\"...\"]`, body typography (commonly DM Sans + JetBrains Mono via Google Fonts), all component styles by hand-rolled BEM-ish class names (`.topbar`, `.brand`, `.kpi`, `.orders-table`, etc.). No Tailwind, no shadcn primitives in the source.\n\nIf the user gave a path, use it. Otherwise look for the markers above in the working tree. If you see a flat archive with `EDITMODE-BEGIN` markers and a CDN-loaded React shell, it is a Claude Design export. If anything is ambiguous (e.g. someone hand-built a similar HTML+JSX shell), ask before assuming Claude Design conventions.\n\n## Typical shape (hints, not rules)\n\nUse these as starting points; re-verify against the actual source tree on every migration.\n\n- **Frontend**: One HTML shell + one or more `.jsx` files compiled in-browser by `@babel/standalone`. Components are plain functions (`function App()`, `function KpiCard({ k, theme })`) that consume `React.useState` / `useMemo` / `useEffect` from a `const { useState, useMemo, useEffect } = React;` destructure. No imports, no JSX modules, no TypeScript.\n- **Styling**: Inline `<style>` in `<head>` with hand-written CSS, custom properties, and media queries. CSS variables drive the theme: `--bg`, `--surface`, `--ink`, `--accent`, `--line`, `--muted`, `--shadow-{sm,md,lg}`, etc. Dark mode flips the variable values under `:root[data-theme=\"dark\"]`.\n- **Fonts**: Google Fonts loaded via `<link>` in `<head>`; commonly DM Sans (UI) + JetBrains Mono (mono).\n- **Tweaks**: `tweaks-panel.jsx` is a self-contained controls overlay used during prototyping. The `useTweaks(TWEAK_DEFAULTS)` hook returns `[t, setTweak]`; `<TweaksPanel>` renders the floating controls inside the canvas. Every tweak control posts `__edit_mode_set_keys` to the parent frame so the Claude Design host can persist values.\n- **Data**: `data.js` defines synthetic sample data on `window.*`. Treat as fixtures, not production data.\n- **Backend**: None. There are no API calls, no `fetch`, no auth, no DB access in a typical export.\n- **Routing**: None. Single-page prototype; no `react-router` or hashes.\n- **Assets**: Inlined SVGs in JSX or referenced from inline `<style>` background-images. No `public/`, no separate image files in the typical export.\n\n## Discovery checklist\n\nIn addition to the framework's discovery requirements, for a Claude Design source enumerate:\n\n- The HTML shell file (`<Name>.html`) and the `<title>` it sets \u2014 that is the prototype's name and should anchor your `<PageName>`.\n- Every sibling `.jsx` / `.js` file and its purpose: which one is the entry (`app.jsx`), which is the tweaks shell (`tweaks-panel.jsx`), which holds data fixtures (`data.js` or similar).\n- The full `TWEAK_DEFAULTS` object between `/*EDITMODE-BEGIN*/` and `/*EDITMODE-END*/` \u2014 every key here corresponds to a runtime control; preserve every one in the migrated app or call out which you are dropping and why.\n- The full set of CSS variables defined under `:root[data-theme=\"light\"]` and `:root[data-theme=\"dark\"]` \u2014 these are the theme tokens to port.\n- Every Google Fonts family loaded in `<head>` and which CSS rules consume them.\n- Every `window.*` global the JSX files read (look for the `/* global ... */` comment at the top of `app.jsx`) \u2014 these are the data fixtures to recreate.\n- Every top-level component function in `app.jsx` and its responsibility (KPI tile, table, modal, toast, etc.). The migrated app keeps the same component breakdown.\n- Every inline SVG and its role (icons, sparklines, chart paths) \u2014 these go straight into the migrated JSX unchanged.\n- Whether the tweaks panel is purely visual (color, density, font size) or carries semantic state (filters, modes). Visual tweaks usually drop after migration; semantic tweaks become real React state on the page.\n\nIf the discovery summary doesn't tell you which CSS variables drive the theme, what every tweak controls, and what each component renders, you haven't discovered enough.\n\n## Core mapping\n\n- **The HTML shell + `app.jsx` \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx` (commonly as the `index: true` route). The page name comes from the HTML `<title>` or the `<Name>.html` filename \u2014 pick one shape and stay consistent.\n- **Drop the CDN script tags entirely.** React, ReactDOM, and `@babel/standalone` from `unpkg` have no role in the migrated app \u2014 the Vite template ships React via `node_modules` and compiles JSX at build time. Likewise drop the `<script type=\"text/babel\" src=\"...\">` references.\n- **Drop the `<html>` / `<body>` shell.** The Superblocks template owns the document. Mounting via `ReactDOM.createRoot(...)` also drops; the platform handles render.\n- **Translate the inline `<style>` block into Tailwind v4 + `client/index.css`:**\n - The CSS variables under `:root[data-theme=\"light\"]` / `:root[data-theme=\"dark\"]` move into `client/index.css`'s `:root` and `.dark` blocks **as-is** (CSS Color Level 4 values stay as-is \u2014 do not convert to OKLCH; see the framework's \"Theme port\" rule). Wire them into Tailwind v4 via `@theme inline` so `bg-bg`, `text-ink`, `border-line` etc. resolve to the source tokens.\n - The Google Fonts `<link>` tags become `@import url('https://fonts.googleapis.com/...')` at the top of `client/index.css`, with `@theme { --font-sans: 'DM Sans', ...; --font-mono: 'JetBrains Mono', ...; }` so `font-sans` / `font-mono` keep working. (See v0.md's font-port checklist for the three-step pattern.)\n - Hand-rolled component CSS (`.topbar`, `.kpi`, `.orders-table`, etc.) translates into Tailwind utility classes on the corresponding JSX. Preserve spacing, sizing, color, shadow, and breakpoint behavior **exactly**. If a rule is too gnarly to express in utilities (complex animations, pseudo-element trickery), keep it in `client/index.css` under a scoped class \u2014 do not invent a new design.\n- **Theme switching.** The source toggles theme by mutating `<html data-theme=\"...\">`. Translate to a small custom provider that toggles `class=\"dark\"` on `document.documentElement` and persists to `localStorage` (mirroring the v0 `next-themes` translation). Preserve the source's CSS variable scheme (`:root` / `.dark` blocks) \u2014 only the JS toggle changes.\n- **Tweaks panel.** The Claude Design `tweaks-panel.jsx` is **canvas-only tooling** for the Claude Design host. It does not belong in the migrated app. Drop `tweaks-panel.jsx`, the `useTweaks` import, the `<TweaksPanel>` element, the `__activate_edit_mode` / `__deactivate_edit_mode` postMessage protocol, and the `EDITMODE-BEGIN` / `EDITMODE-END` markers entirely.\n - **But preserve what the tweaks controlled.** For each tweak in `TWEAK_DEFAULTS`:\n - **Visual-only tweaks** (theme, accent color, density, font size) \u2192 either drop and pin to the default value, or surface as a real settings UI if the user wants it. Ask before keeping; visual tweaks are usually prototype affordances, not product features.\n - **Semantic tweaks** (active tab, selected filter, sort order, \"show kpis\" toggles) \u2192 become real React state on the page (`useState` defaulted to the value from `TWEAK_DEFAULTS`). The user's interactions drive them; there is no edit-mode panel.\n - Surface the full list of tweaks and your decision per tweak in the discovery summary so the user can override.\n- **`data.js` / `window.*` globals.** These are mock fixtures, not real data. Two paths:\n - **Default: keep as inline mock data inside the migrated page** (e.g., a `const ORDERS = [...]` at module scope, or a small `client/data/<name>.ts` module). The migrated app stays frontend-only and behaves like the prototype.\n - **If the user wants a real backend**: surface the data shape in the discovery summary and ask before fabricating APIs. Per the framework's \"Don't fabricate a backend\" rule, do not invent server-side endpoints unless the user opts in. If they do, each `window.*` collection becomes one Superblocks API returning the same shape, and the page calls `useApiData(\"<ApiName>\")` instead of reading the global.\n- **Components.** Each top-level function in `app.jsx` (`KpiCard`, `OrdersTable`, `Checkbox`, `TrackingModal`, `BulkBar`, `Toast`, ...) becomes a sibling component file under `client/pages/<Name>/components/<Name>.tsx` (or stays inline if small). Function bodies, JSX structure, prop shapes, and event handlers transfer **unchanged** \u2014 only imports change (pull `useState` / `useMemo` / `useEffect` from `react` instead of destructuring from a `React` global, and add explicit `import React from \"react\"` only if JSX runtime requires it).\n- **Inline SVGs** (sparklines, icons, chart paths) move into the migrated JSX **verbatim**. Do not swap for `lucide-react` icons or other libraries unless the user asks; the source's SVGs are part of the design.\n- **Modals, toasts, and overlays.** Source uses raw `<div>` + CSS for these. Keep as-is in the migrated page \u2014 do not silently swap for shadcn `Dialog` / `Sonner` unless the user explicitly opts in. shadcn primitives change visual behavior (focus rings, animation, scrim color) and that is a design regression.\n- **Responsive breakpoints.** The source defines `@media (max-width: 900px)` rules in the inline `<style>`. Translate to Tailwind responsive prefixes (`sm:` / `md:` / `lg:`) on the corresponding utilities, matching the source's breakpoint values exactly.\n\n## Ask-before-guessing \u2014 Claude Design specifics\n\n- \"The export has no backend. I'll keep the data as inline mocks under `client/pages/<Name>/data.ts`. Want me to fabricate APIs for it instead, or leave it frontend-only?\"\n- \"The tweaks panel exposes `<list of tweaks>`. Visual tweaks (theme, accent, density) typically drop on migration; semantic tweaks become real page state. Confirm which to keep, drop, or surface as a settings UI.\"\n- \"The source uses Google Fonts `<list>` via CDN `<link>`. I'll re-load them via `@import` in `client/index.css` and bind via `@theme`. OK, or do you want self-hosted fonts?\"\n- \"The source switches themes by toggling `<html data-theme>`. I'll translate to a provider that toggles `class='dark'` on `document.documentElement`. Acceptable, or do you want a different theme-toggle shape?\"\n- \"The export ships hand-rolled UI components (modal, toast, table). I'll keep them as-is rather than swapping in shadcn primitives, since shadcn would change the visual behavior. Confirm, or override per-component?\"\n\n## Page port \u2014 what changes vs. what doesn't\n\nFor each Claude Design page, only these change:\n\n- **Module system**: `<script type=\"text/babel\">` + `window.*` globals \u2192 ESM imports between `client/pages/...` files; `data.js` becomes a `.ts` module (or inline `const`).\n- **React acquisition**: `const { useState, ... } = React;` \u2192 `import { useState, ... } from \"react\";`\n- **Mounting**: `ReactDOM.createRoot(...).render(<App />)` \u2192 page is mounted by `client/router.tsx` via the standard route binding.\n- **Styling pipeline**: inline `<style>` + hand-rolled CSS classes \u2192 CSS variables in `client/index.css` under `@theme inline` + Tailwind utilities on JSX.\n- **Theme toggle**: `<html data-theme>` mutation \u2192 `document.documentElement` class toggle.\n- **Tweaks**: `useTweaks` / `<TweaksPanel>` \u2192 real React state for semantic tweaks; visual tweaks drop or move to a settings UI.\n- **Edit-mode protocol**: `__activate_edit_mode` / `__deactivate_edit_mode` postMessage handshakes \u2192 drop entirely.\n\nEverything else \u2014 JSX structure, component breakdown, prop shapes, event handlers, copy, layout, spacing, color, shadow, animation, breakpoints \u2014 transfers **unchanged** from the source. If the diff between source and target page goes beyond the bullets above, you are over-editing \u2014 back out the cosmetic changes.\n\n## Done \u2014 Claude Design specifics\n\nIn the final report, additionally surface:\n\n- The full list of tweaks from `TWEAK_DEFAULTS` and what happened to each (kept as state, dropped, surfaced as settings).\n- Whether the data stayed as inline mocks or was promoted to APIs (and which integration backs each, if so).\n- Any hand-rolled UI primitives (modal, toast, popover) you preserved verbatim, so the user can choose whether to standardize on shadcn later.\n- The list of Google Fonts re-loaded and the `@theme` font tokens bound.\n";
|
|
2
|
+
//# sourceMappingURL=claude-design.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-design.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/claude-design.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,kqeAuGnB,CAAC"}
|