@superblocksteam/vite-plugin-file-sync 2.0.119-next.0 → 2.0.119-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +5 -2
- 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 +11 -17
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +3 -27
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +0 -4
- 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 +5 -16
- 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 +13 -18
- 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 +2 -138
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +5 -17
- 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 +50 -42
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +5 -7
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +108 -54
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/get-logs.d.ts +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +0 -4
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +0 -4
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts +0 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js +0 -1
- 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 +4 -30
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
- package/dist/ai-service/agent/tools.d.ts +0 -2
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +6 -74
- 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 +0 -7
- 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 +1 -11
- 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 +0 -7
- 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 +1 -3
- 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 +3 -4
- 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 +0 -9
- 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 +1 -15
- 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 +4 -8
- 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 +4 -21
- 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 +11 -87
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts +2 -10
- 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 +0 -2
- 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/shell.d.ts +0 -38
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +1 -222
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +0 -5
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js +21 -31
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/context-download.d.ts +1 -14
- package/dist/ai-service/context-download.d.ts.map +1 -1
- package/dist/ai-service/context-download.js +0 -80
- package/dist/ai-service/context-download.js.map +1 -1
- package/dist/ai-service/features.d.ts +0 -16
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +0 -10
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +1 -11
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +13 -81
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +0 -5
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +2 -19
- 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 +1 -8
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.js +1 -17
- 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 +7 -22
- package/dist/ai-service/llm/provider.js.map +1 -1
- package/dist/ai-service/llm/types.d.ts +1 -14
- package/dist/ai-service/llm/types.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.d.ts +0 -23
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.js +10 -112
- package/dist/ai-service/llmobs/otel-exporter.js.map +1 -1
- package/dist/ai-service/llmobs/tracer.d.ts +0 -7
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
- package/dist/ai-service/llmobs/tracer.js +0 -38
- 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 +0 -2
- 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 +0 -2
- 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 +1 -3
- 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 +0 -29
- 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 +6 -112
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
- 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 +3 -33
- 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 +0 -21
- 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 +6 -79
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +0 -10
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +41 -69
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts +7 -35
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +15 -81
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/template-renderer.d.ts +1 -14
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +41 -144
- 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 +27 -34
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +0 -4
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +0 -13
- 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 +1 -15
- package/dist/inject-index-vite-plugin.js.map +1 -1
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +1 -15
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +10 -8
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/migration-checklist.d.ts +2 -51
- package/dist/migration/migration-checklist.d.ts.map +1 -1
- package/dist/migration/migration-checklist.js +151 -79
- 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 +30 -290
- package/dist/migration/migration-routes.js.map +1 -1
- package/dist/migration/restructure.d.ts +2 -9
- package/dist/migration/restructure.d.ts.map +1 -1
- package/dist/migration/restructure.js +5 -116
- package/dist/migration/restructure.js.map +1 -1
- package/dist/migration/unsupported-integrations.d.ts.map +1 -1
- package/dist/migration/unsupported-integrations.js +0 -9
- package/dist/migration/unsupported-integrations.js.map +1 -1
- 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 +0 -8
- 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 +14 -0
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +44 -1
- 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 +3 -36
- 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 +8 -4
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
- package/dist/util/log-sanitizer.d.ts +5 -6
- package/dist/util/log-sanitizer.d.ts.map +1 -1
- package/dist/util/log-sanitizer.js +6 -21
- package/dist/util/log-sanitizer.js.map +1 -1
- package/package.json +8 -9
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +0 -17
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +0 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +0 -219
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +0 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +0 -36
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.js +0 -369
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +0 -12
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-directory.js +0 -51
- package/dist/ai-service/agent/tools/build-copy-directory.js.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-file.d.ts +0 -12
- package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-file.js +0 -52
- package/dist/ai-service/agent/tools/build-copy-file.js.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts +0 -57
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/build-copy-utils.js +0 -37
- package/dist/ai-service/agent/tools/build-copy-utils.js.map +0 -1
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts +0 -103
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/databases/dev-database.js +0 -117
- package/dist/ai-service/agent/tools/databases/dev-database.js.map +0 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +0 -18
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +0 -99
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +0 -1
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +0 -163
- package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +0 -1
- package/dist/ai-service/agent/tools/report-security-findings.js +0 -52
- package/dist/ai-service/agent/tools/report-security-findings.js.map +0 -1
- package/dist/ai-service/app-interface/npm-registry.d.ts +0 -137
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +0 -1
- package/dist/ai-service/app-interface/npm-registry.js +0 -415
- package/dist/ai-service/app-interface/npm-registry.js.map +0 -1
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +0 -105
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +0 -1
- package/dist/ai-service/checklist/persisted-checklist-store.js +0 -498
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +0 -1
- package/dist/ai-service/dev-database-client.d.ts +0 -90
- package/dist/ai-service/dev-database-client.d.ts.map +0 -1
- package/dist/ai-service/dev-database-client.js +0 -166
- package/dist/ai-service/dev-database-client.js.map +0 -1
- package/dist/ai-service/llmobs/context-registry.d.ts +0 -62
- package/dist/ai-service/llmobs/context-registry.d.ts.map +0 -1
- package/dist/ai-service/llmobs/context-registry.js +0 -115
- package/dist/ai-service/llmobs/context-registry.js.map +0 -1
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +0 -2
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +0 -1
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +0 -107
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +0 -1
- package/dist/migration/migration-verification.d.ts +0 -206
- package/dist/migration/migration-verification.d.ts.map +0 -1
- package/dist/migration/migration-verification.js +0 -1006
- package/dist/migration/migration-verification.js.map +0 -1
- package/dist/migration/yaml-walk.d.ts +0 -18
- package/dist/migration/yaml-walk.d.ts.map +0 -1
- package/dist/migration/yaml-walk.js +0 -45
- package/dist/migration/yaml-walk.js.map +0 -1
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { DatabaseRequirement, EnvironmentProfile, LifecycleErrorCode, LifecycleState } from "@superblocksteam/shared";
|
|
2
|
-
type MigrationState = "pending" | "migrated" | "failed";
|
|
3
|
-
type CreateDevDatabaseInput = {
|
|
4
|
-
applicationId: string;
|
|
5
|
-
environmentName: string;
|
|
6
|
-
requirement: DatabaseRequirement;
|
|
7
|
-
};
|
|
8
|
-
type ProgressLookup = {
|
|
9
|
-
bindingKey?: string;
|
|
10
|
-
requestId?: string;
|
|
11
|
-
};
|
|
12
|
-
type DispatchPayload = {
|
|
13
|
-
agentId: string;
|
|
14
|
-
backend: EnvironmentProfile["backend"];
|
|
15
|
-
bindingKey: string;
|
|
16
|
-
desiredSpecHash: string;
|
|
17
|
-
operation: "ensure_dev_database";
|
|
18
|
-
profileId: string;
|
|
19
|
-
requestId: string;
|
|
20
|
-
};
|
|
21
|
-
export type CreateDevDatabaseResponse = {
|
|
22
|
-
bindingKey: string;
|
|
23
|
-
connectionMetadata?: Record<string, string | number | boolean>;
|
|
24
|
-
dispatchPayload?: DispatchPayload;
|
|
25
|
-
integrationId?: string;
|
|
26
|
-
lifecycleState: LifecycleState;
|
|
27
|
-
migrationState: MigrationState;
|
|
28
|
-
requestId: string;
|
|
29
|
-
};
|
|
30
|
-
type ErrorResponse = {
|
|
31
|
-
error: {
|
|
32
|
-
code: LifecycleErrorCode;
|
|
33
|
-
message: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
type ErrorEnvelopeResponse = {
|
|
37
|
-
responseMeta: {
|
|
38
|
-
error: {
|
|
39
|
-
code: LifecycleErrorCode;
|
|
40
|
-
message: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
type ResponseDto<T> = {
|
|
45
|
-
data: T;
|
|
46
|
-
};
|
|
47
|
-
export type DevDatabaseTransportRequest = {
|
|
48
|
-
body: CreateDevDatabaseInput;
|
|
49
|
-
method: "POST";
|
|
50
|
-
path: "/api/v1/database-lifecycle/dev";
|
|
51
|
-
} | {
|
|
52
|
-
method: "GET";
|
|
53
|
-
path: "/api/v1/database-lifecycle/dev/progress";
|
|
54
|
-
query: ProgressLookup;
|
|
55
|
-
};
|
|
56
|
-
type DevDatabaseTransportResponse = CreateDevDatabaseResponse | ErrorResponse | ErrorEnvelopeResponse | ResponseDto<CreateDevDatabaseResponse>;
|
|
57
|
-
type DevDatabaseFetchResponse = {
|
|
58
|
-
ok: boolean;
|
|
59
|
-
status: number;
|
|
60
|
-
statusText: string;
|
|
61
|
-
text: () => Promise<string>;
|
|
62
|
-
};
|
|
63
|
-
type DevDatabaseFetch = (input: string, init?: {
|
|
64
|
-
body?: string;
|
|
65
|
-
headers: Record<string, string>;
|
|
66
|
-
method: "GET" | "POST";
|
|
67
|
-
}) => Promise<DevDatabaseFetchResponse>;
|
|
68
|
-
type DevDatabaseClientOptions = {
|
|
69
|
-
transport: (request: DevDatabaseTransportRequest) => Promise<DevDatabaseTransportResponse>;
|
|
70
|
-
};
|
|
71
|
-
type DevDatabaseHttpTransportOptions = {
|
|
72
|
-
fetch?: DevDatabaseFetch;
|
|
73
|
-
jwt: string;
|
|
74
|
-
superblocksBaseUrl: string;
|
|
75
|
-
};
|
|
76
|
-
export declare class DevDatabaseClientError extends Error {
|
|
77
|
-
readonly code: LifecycleErrorCode;
|
|
78
|
-
name: string;
|
|
79
|
-
constructor(code: LifecycleErrorCode, message: string);
|
|
80
|
-
}
|
|
81
|
-
export declare class DevDatabaseClient {
|
|
82
|
-
private readonly options;
|
|
83
|
-
constructor(options: DevDatabaseClientOptions);
|
|
84
|
-
createDevDb(input: CreateDevDatabaseInput): Promise<CreateDevDatabaseResponse>;
|
|
85
|
-
pollProgress(lookup: ProgressLookup): Promise<CreateDevDatabaseResponse>;
|
|
86
|
-
private unwrapResponse;
|
|
87
|
-
}
|
|
88
|
-
export declare function createDevDatabaseHttpTransport({ fetch, jwt, superblocksBaseUrl, }: DevDatabaseHttpTransportOptions): DevDatabaseClientOptions["transport"];
|
|
89
|
-
export {};
|
|
90
|
-
//# sourceMappingURL=dev-database-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-database-client.d.ts","sourceRoot":"","sources":["../../src/ai-service/dev-database-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC,KAAK,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAExD,KAAK,sBAAsB,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,qBAAqB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/D,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,aAAa,CAAC,E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O,CAAC,wBAAwB,CAAC,CAAC;AAEvC,KAAK,wBAAwB,GAAG;IAC9B,SAAS,EAAE,CACT,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC,4BAA4B,CAAC,CAAC;CAC5C,CAAC;AAEF,KAAK,+BAA+B,GAAG;IACrC,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,KAAK;aAI7B,IAAI,EAAE,kBAAkB;IAHjC,IAAI,SAA4B;gBAGvB,IAAI,EAAE,kBAAkB,EACxC,OAAO,EAAE,MAAM;CAIlB;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,wBAAwB;IAExD,WAAW,CACf,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,yBAAyB,CAAC;IAU/B,YAAY,CAChB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,yBAAyB,CAAC;IAUrC,OAAO,CAAC,cAAc;CAcvB;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,KAA4C,EAC5C,GAAG,EACH,kBAAkB,GACnB,EAAE,+BAA+B,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAkDzE"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { containsCredentialMaterial } from "@superblocksteam/shared";
|
|
2
|
-
export class DevDatabaseClientError extends Error {
|
|
3
|
-
code;
|
|
4
|
-
name = "DevDatabaseClientError";
|
|
5
|
-
constructor(code, message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.code = code;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export class DevDatabaseClient {
|
|
11
|
-
options;
|
|
12
|
-
constructor(options) {
|
|
13
|
-
this.options = options;
|
|
14
|
-
}
|
|
15
|
-
async createDevDb(input) {
|
|
16
|
-
return this.unwrapResponse(await this.options.transport({
|
|
17
|
-
body: input,
|
|
18
|
-
method: "POST",
|
|
19
|
-
path: "/api/v1/database-lifecycle/dev",
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
async pollProgress(lookup) {
|
|
23
|
-
return this.unwrapResponse(await this.options.transport({
|
|
24
|
-
method: "GET",
|
|
25
|
-
path: "/api/v1/database-lifecycle/dev/progress",
|
|
26
|
-
query: lookup,
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
unwrapResponse(response) {
|
|
30
|
-
const error = getErrorResponse(response);
|
|
31
|
-
if (error) {
|
|
32
|
-
throw new DevDatabaseClientError(error.code, error.message);
|
|
33
|
-
}
|
|
34
|
-
const payload = "data" in response ? response.data : response;
|
|
35
|
-
if (!isCreateDevDatabaseResponse(payload)) {
|
|
36
|
-
throw new Error("Dev database response did not include lifecycle state");
|
|
37
|
-
}
|
|
38
|
-
assertNoRawCredentialMaterial(payload);
|
|
39
|
-
return payload;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export function createDevDatabaseHttpTransport({ fetch = globalThis.fetch, jwt, superblocksBaseUrl, }) {
|
|
43
|
-
return async (request) => {
|
|
44
|
-
const url = new URL(request.path, superblocksBaseUrl.endsWith("/")
|
|
45
|
-
? superblocksBaseUrl
|
|
46
|
-
: `${superblocksBaseUrl}/`);
|
|
47
|
-
if (request.method === "GET") {
|
|
48
|
-
for (const [key, value] of Object.entries(request.query)) {
|
|
49
|
-
if (value) {
|
|
50
|
-
url.searchParams.set(key, value);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const response = await fetch(url.toString(), {
|
|
55
|
-
...(request.method === "POST"
|
|
56
|
-
? {
|
|
57
|
-
body: JSON.stringify(request.body),
|
|
58
|
-
}
|
|
59
|
-
: {}),
|
|
60
|
-
headers: request.method === "POST"
|
|
61
|
-
? {
|
|
62
|
-
Authorization: `Bearer ${jwt}`,
|
|
63
|
-
"Content-Type": "application/json",
|
|
64
|
-
}
|
|
65
|
-
: {
|
|
66
|
-
Authorization: `Bearer ${jwt}`,
|
|
67
|
-
},
|
|
68
|
-
method: request.method,
|
|
69
|
-
});
|
|
70
|
-
const { bodyText, parsed } = await parseResponse(response);
|
|
71
|
-
const error = getErrorResponse(parsed);
|
|
72
|
-
if (!response.ok && error) {
|
|
73
|
-
return { error };
|
|
74
|
-
}
|
|
75
|
-
if (!response.ok) {
|
|
76
|
-
throw new Error(`Dev database request failed: ${response.status} ${response.statusText} - ${bodyText}`);
|
|
77
|
-
}
|
|
78
|
-
if (!parsed || typeof parsed !== "object") {
|
|
79
|
-
throw new Error(`Dev database request returned an invalid response: ${response.status} ${response.statusText} - ${bodyText}`);
|
|
80
|
-
}
|
|
81
|
-
return parsed;
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
async function parseResponse(response) {
|
|
85
|
-
const bodyText = await response.text();
|
|
86
|
-
try {
|
|
87
|
-
return { bodyText, parsed: JSON.parse(bodyText) };
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
return { bodyText, parsed: undefined };
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function getErrorResponse(value) {
|
|
94
|
-
if (!value || typeof value !== "object") {
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
if ("error" in value &&
|
|
98
|
-
!!value.error?.code &&
|
|
99
|
-
!!value.error?.message) {
|
|
100
|
-
return value.error;
|
|
101
|
-
}
|
|
102
|
-
const envelope = value;
|
|
103
|
-
if (envelope.responseMeta?.error?.code &&
|
|
104
|
-
envelope.responseMeta.error.message) {
|
|
105
|
-
return envelope.responseMeta.error;
|
|
106
|
-
}
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
function isCreateDevDatabaseResponse(value) {
|
|
110
|
-
return (!!value &&
|
|
111
|
-
typeof value === "object" &&
|
|
112
|
-
typeof value.bindingKey === "string" &&
|
|
113
|
-
typeof value.lifecycleState === "string" &&
|
|
114
|
-
typeof value.migrationState === "string" &&
|
|
115
|
-
typeof value.requestId === "string");
|
|
116
|
-
}
|
|
117
|
-
function assertNoRawCredentialMaterial(value) {
|
|
118
|
-
if (Array.isArray(value)) {
|
|
119
|
-
for (const entry of value) {
|
|
120
|
-
assertNoRawCredentialMaterial(entry);
|
|
121
|
-
}
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (typeof value === "string") {
|
|
125
|
-
if (containsCredentialMaterial(value)) {
|
|
126
|
-
throw new Error("raw credential material is not allowed in createDevDb responses");
|
|
127
|
-
}
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
if (!value || typeof value !== "object") {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
for (const [key, entryValue] of Object.entries(value)) {
|
|
134
|
-
if (/credential[_-]?refs?/i.test(key)) {
|
|
135
|
-
assertCredentialRefsDoNotContainRawMaterial(entryValue);
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (/password|secret|token|private[_-]?key|dsn/i.test(key)) {
|
|
139
|
-
throw new Error("raw credential material is not allowed in createDevDb responses");
|
|
140
|
-
}
|
|
141
|
-
assertNoRawCredentialMaterial(entryValue);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function assertCredentialRefsDoNotContainRawMaterial(value) {
|
|
145
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
146
|
-
throw new Error("raw credential material is not allowed in createDevDb responses");
|
|
147
|
-
}
|
|
148
|
-
for (const credentialRef of Object.values(value)) {
|
|
149
|
-
assertCredentialRefDoesNotContainRawMaterial(credentialRef);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function assertCredentialRefDoesNotContainRawMaterial(value) {
|
|
153
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
154
|
-
throw new Error("raw credential material is not allowed in createDevDb responses");
|
|
155
|
-
}
|
|
156
|
-
for (const [key, entryValue] of Object.entries(value)) {
|
|
157
|
-
if (key === "field") {
|
|
158
|
-
continue;
|
|
159
|
-
}
|
|
160
|
-
if (/password|secret|token|private[_-]?key|dsn/i.test(key)) {
|
|
161
|
-
throw new Error("raw credential material is not allowed in createDevDb responses");
|
|
162
|
-
}
|
|
163
|
-
assertNoRawCredentialMaterial(entryValue);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
//# sourceMappingURL=dev-database-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-database-client.js","sourceRoot":"","sources":["../../src/ai-service/dev-database-client.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAqGrE,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAI7B;IAHT,IAAI,GAAG,wBAAwB,CAAC;IAEzC,YACkB,IAAwB,EACxC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAoB;IAI1C,CAAC;CACF;AAED,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;IAAG,CAAC;IAElE,KAAK,CAAC,WAAW,CACf,KAA6B;QAE7B,OAAO,IAAI,CAAC,cAAc,CACxB,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YAC3B,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,gCAAgC;SACvC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,MAAsB;QAEtB,OAAO,IAAI,CAAC,cAAc,CACxB,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YAC3B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,yCAAyC;YAC/C,KAAK,EAAE,MAAM;SACd,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,cAAc,CACpB,QAAsC;QAEtC,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;Q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AC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YACpB,SAAS;QACX,CAAC;QACD,IAAI,4CAA4C,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;QACJ,CAAC;QACD,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Context } from "@opentelemetry/api";
|
|
2
|
-
/**
|
|
3
|
-
* Bridges the OTEL context active at LLMObs span-creation time to the
|
|
4
|
-
* async flush callback where OTEL spans are actually emitted.
|
|
5
|
-
*
|
|
6
|
-
* Two maps:
|
|
7
|
-
* - `captured`: OTEL context snapshotted when each LLMObs ROOT span starts.
|
|
8
|
-
* Only root spans are stored here; child spans get their parent context
|
|
9
|
-
* from `crossBatch` or `perFlushCtx` in processBatch. Consumed once.
|
|
10
|
-
* - `crossBatch`: OTEL context of already-emitted gen_ai OTEL spans,
|
|
11
|
-
* so children that flush in a later batch can still find their parent.
|
|
12
|
-
* TTL-evicted after 10 minutes.
|
|
13
|
-
*
|
|
14
|
-
* Memory safety:
|
|
15
|
-
* - Both maps are capped at MAX_CAPTURED / MAX_CROSS_BATCH entries;
|
|
16
|
-
* oldest entry is evicted when the cap is hit.
|
|
17
|
-
* - A background reaper (startReaper) evicts stale entries every 30 s,
|
|
18
|
-
* independently of flush cycles so cleanup runs even if flush stalls.
|
|
19
|
-
*/
|
|
20
|
-
export declare class OtelContextRegistry {
|
|
21
|
-
private captured;
|
|
22
|
-
private crossBatch;
|
|
23
|
-
private _reaper;
|
|
24
|
-
/**
|
|
25
|
-
* Start the background reaper that evicts stale entries independently
|
|
26
|
-
* of flush cycles. Safe to call multiple times — subsequent calls are no-ops.
|
|
27
|
-
* The timer is unref'd so it does not prevent Node.js from exiting.
|
|
28
|
-
*/
|
|
29
|
-
startReaper(intervalMs?: number): void;
|
|
30
|
-
/** Stop the background reaper. Call in tests to prevent timer leaks. */
|
|
31
|
-
stopReaper(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Store the active OTEL context at the moment a LLMObs ROOT span starts.
|
|
34
|
-
* Must only be called for root spans (no LLMObs parent); child spans are
|
|
35
|
-
* handled via crossBatch / perFlushCtx and do not need an entry here.
|
|
36
|
-
*/
|
|
37
|
-
captureAtSpanStart(spanId: string, ctx: Context): void;
|
|
38
|
-
/**
|
|
39
|
-
* Retrieve and remove the captured context for a span.
|
|
40
|
-
* Used for root spans: the context holds the ambient OTEL context at
|
|
41
|
-
* span-start time, which becomes the OTEL trace root.
|
|
42
|
-
*/
|
|
43
|
-
consumeCaptured(spanId: string): Context | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Store the OTEL context of an already-emitted gen_ai span so children
|
|
46
|
-
* flushed in a later batch can find it via getCreated().
|
|
47
|
-
*/
|
|
48
|
-
setCreated(spanId: string, ctx: Context): void;
|
|
49
|
-
/** Look up the OTEL context of a previously emitted gen_ai span. */
|
|
50
|
-
getCreated(spanId: string): Context | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* Evict entries older than TTL_MS from both maps.
|
|
53
|
-
* Called by the background reaper and at the start of each flush batch.
|
|
54
|
-
*/
|
|
55
|
-
cleanup(): void;
|
|
56
|
-
/** Exposed for testing only. */
|
|
57
|
-
get _capturedSize(): number;
|
|
58
|
-
/** Exposed for testing only. */
|
|
59
|
-
get _crossBatchSize(): number;
|
|
60
|
-
}
|
|
61
|
-
export declare const otelContextRegistry: OtelContextRegistry;
|
|
62
|
-
//# sourceMappingURL=context-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-registry.d.ts","sourceRoot":"","sources":["../../../src/ai-service/llmobs/context-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAYlD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,OAAO,CAA6C;IAE5D;;;;OAIG;IACH,WAAW,CAAC,UAAU,SAAsB,GAAG,IAAI;IAKnD,wEAAwE;IACxE,UAAU,IAAI,IAAI;IAOlB;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAWtD;;;;OAIG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAOpD;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI;IAY9C,oEAAoE;IACpE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI/C;;;OAGG;IACH,OAAO,IAAI,IAAI;IAUf,gCAAgC;IAChC,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,gCAAgC;IAChC,IAAI,eAAe,IAAI,MAAM,CAE5B;CACF;AAED,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
const TTL_MS = 10 * 60 * 1000; // 10 minutes
|
|
2
|
-
const CLEANUP_INTERVAL_MS = 30 * 1000; // 30 seconds — independent of flush cadence
|
|
3
|
-
const MAX_CAPTURED = 500; // root spans only; safety net against runaway sessions
|
|
4
|
-
const MAX_CROSS_BATCH = 2000; // one entry per emitted gen_ai span
|
|
5
|
-
/**
|
|
6
|
-
* Bridges the OTEL context active at LLMObs span-creation time to the
|
|
7
|
-
* async flush callback where OTEL spans are actually emitted.
|
|
8
|
-
*
|
|
9
|
-
* Two maps:
|
|
10
|
-
* - `captured`: OTEL context snapshotted when each LLMObs ROOT span starts.
|
|
11
|
-
* Only root spans are stored here; child spans get their parent context
|
|
12
|
-
* from `crossBatch` or `perFlushCtx` in processBatch. Consumed once.
|
|
13
|
-
* - `crossBatch`: OTEL context of already-emitted gen_ai OTEL spans,
|
|
14
|
-
* so children that flush in a later batch can still find their parent.
|
|
15
|
-
* TTL-evicted after 10 minutes.
|
|
16
|
-
*
|
|
17
|
-
* Memory safety:
|
|
18
|
-
* - Both maps are capped at MAX_CAPTURED / MAX_CROSS_BATCH entries;
|
|
19
|
-
* oldest entry is evicted when the cap is hit.
|
|
20
|
-
* - A background reaper (startReaper) evicts stale entries every 30 s,
|
|
21
|
-
* independently of flush cycles so cleanup runs even if flush stalls.
|
|
22
|
-
*/
|
|
23
|
-
export class OtelContextRegistry {
|
|
24
|
-
captured = new Map();
|
|
25
|
-
crossBatch = new Map();
|
|
26
|
-
_reaper;
|
|
27
|
-
/**
|
|
28
|
-
* Start the background reaper that evicts stale entries independently
|
|
29
|
-
* of flush cycles. Safe to call multiple times — subsequent calls are no-ops.
|
|
30
|
-
* The timer is unref'd so it does not prevent Node.js from exiting.
|
|
31
|
-
*/
|
|
32
|
-
startReaper(intervalMs = CLEANUP_INTERVAL_MS) {
|
|
33
|
-
if (this._reaper !== undefined)
|
|
34
|
-
return;
|
|
35
|
-
this._reaper = setInterval(() => this.cleanup(), intervalMs).unref();
|
|
36
|
-
}
|
|
37
|
-
/** Stop the background reaper. Call in tests to prevent timer leaks. */
|
|
38
|
-
stopReaper() {
|
|
39
|
-
if (this._reaper !== undefined) {
|
|
40
|
-
clearInterval(this._reaper);
|
|
41
|
-
this._reaper = undefined;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Store the active OTEL context at the moment a LLMObs ROOT span starts.
|
|
46
|
-
* Must only be called for root spans (no LLMObs parent); child spans are
|
|
47
|
-
* handled via crossBatch / perFlushCtx and do not need an entry here.
|
|
48
|
-
*/
|
|
49
|
-
captureAtSpanStart(spanId, ctx) {
|
|
50
|
-
if (this.captured.size >= MAX_CAPTURED && !this.captured.has(spanId)) {
|
|
51
|
-
// Evict the oldest entry (Maps preserve insertion order in V8).
|
|
52
|
-
// Skip eviction when overwriting an existing key — Map.set() on an
|
|
53
|
-
// existing key does not increase size, so no room needs to be made.
|
|
54
|
-
const oldest = this.captured.keys().next().value;
|
|
55
|
-
if (oldest !== undefined)
|
|
56
|
-
this.captured.delete(oldest);
|
|
57
|
-
}
|
|
58
|
-
this.captured.set(spanId, { ctx, createdAt: Date.now() });
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Retrieve and remove the captured context for a span.
|
|
62
|
-
* Used for root spans: the context holds the ambient OTEL context at
|
|
63
|
-
* span-start time, which becomes the OTEL trace root.
|
|
64
|
-
*/
|
|
65
|
-
consumeCaptured(spanId) {
|
|
66
|
-
const entry = this.captured.get(spanId);
|
|
67
|
-
if (!entry)
|
|
68
|
-
return undefined;
|
|
69
|
-
this.captured.delete(spanId);
|
|
70
|
-
return entry.ctx;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Store the OTEL context of an already-emitted gen_ai span so children
|
|
74
|
-
* flushed in a later batch can find it via getCreated().
|
|
75
|
-
*/
|
|
76
|
-
setCreated(spanId, ctx) {
|
|
77
|
-
if (this.crossBatch.size >= MAX_CROSS_BATCH &&
|
|
78
|
-
!this.crossBatch.has(spanId)) {
|
|
79
|
-
// Same rationale as captureAtSpanStart: skip eviction on overwrite.
|
|
80
|
-
const oldest = this.crossBatch.keys().next().value;
|
|
81
|
-
if (oldest !== undefined)
|
|
82
|
-
this.crossBatch.delete(oldest);
|
|
83
|
-
}
|
|
84
|
-
this.crossBatch.set(spanId, { ctx, createdAt: Date.now() });
|
|
85
|
-
}
|
|
86
|
-
/** Look up the OTEL context of a previously emitted gen_ai span. */
|
|
87
|
-
getCreated(spanId) {
|
|
88
|
-
return this.crossBatch.get(spanId)?.ctx;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Evict entries older than TTL_MS from both maps.
|
|
92
|
-
* Called by the background reaper and at the start of each flush batch.
|
|
93
|
-
*/
|
|
94
|
-
cleanup() {
|
|
95
|
-
const cutoff = Date.now() - TTL_MS;
|
|
96
|
-
for (const [id, entry] of this.captured) {
|
|
97
|
-
if (entry.createdAt < cutoff)
|
|
98
|
-
this.captured.delete(id);
|
|
99
|
-
}
|
|
100
|
-
for (const [id, entry] of this.crossBatch) {
|
|
101
|
-
if (entry.createdAt < cutoff)
|
|
102
|
-
this.crossBatch.delete(id);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/** Exposed for testing only. */
|
|
106
|
-
get _capturedSize() {
|
|
107
|
-
return this.captured.size;
|
|
108
|
-
}
|
|
109
|
-
/** Exposed for testing only. */
|
|
110
|
-
get _crossBatchSize() {
|
|
111
|
-
return this.crossBatch.size;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export const otelContextRegistry = new OtelContextRegistry();
|
|
115
|
-
//# sourceMappingURL=context-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context-registry.js","sourceRoot":"","sources":["../../../src/ai-service/llmobs/context-registry.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAC5C,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,4CAA4C;AACnF,MAAM,YAAY,GAAG,GAAG,CAAC,CAAC,uDAAuD;AACjF,MAAM,eAAe,GAAG,IAAI,CAAC,CAAC,oCAAoC;AAOlE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAmB;IACtB,QAAQ,GAAG,IAAI,GAAG,EAAiB,CAAC;IACpC,UAAU,GAAG,IAAI,GAAG,EAAiB,CAAC;IACtC,OAAO,CAA6C;IAE5D;;;;OAIG;IACH,WAAW,CAAC,UAAU,GAAG,mBAAmB;QAC1C,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO;QACvC,IAAI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AI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
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
|
package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Auto-generated from src/ai-service/skills/system/third-party-migration/claude-design.md
|
|
2
|
-
// Do not edit directly - edit the .md file instead
|
|
3
|
-
export const content = `# Claude Design-specific mapping
|
|
4
|
-
|
|
5
|
-
This is a per-platform reference loaded from \`SKILL.md\`. The framework — target layout, universal mapping, non-negotiables, workflow, code-emission rules — lives there. This file documents only what is specific to a Claude Design source.
|
|
6
|
-
|
|
7
|
-
> 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** — 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 — if the source is purely UI driven by inline mock data, the migrated app stays frontend-only unless the user explicitly asks for one.
|
|
8
|
-
|
|
9
|
-
## Where the source lives
|
|
10
|
-
|
|
11
|
-
Definitive 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\`.
|
|
12
|
-
|
|
13
|
-
Strong supporting signals:
|
|
14
|
-
|
|
15
|
-
- 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"]\`.
|
|
16
|
-
- 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.
|
|
17
|
-
- An \`app.jsx\` whose top has \`const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ ... }/*EDITMODE-END*/;\` — the \`EDITMODE-BEGIN\` / \`EDITMODE-END\` markers are how the Claude Design canvas locates and rewrites the defaults block.
|
|
18
|
-
- 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\`).
|
|
19
|
-
- 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.
|
|
20
|
-
- 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.
|
|
21
|
-
|
|
22
|
-
If 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.
|
|
23
|
-
|
|
24
|
-
## Typical shape (hints, not rules)
|
|
25
|
-
|
|
26
|
-
Use these as starting points; re-verify against the actual source tree on every migration.
|
|
27
|
-
|
|
28
|
-
- **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.
|
|
29
|
-
- **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"]\`.
|
|
30
|
-
- **Fonts**: Google Fonts loaded via \`<link>\` in \`<head>\`; commonly DM Sans (UI) + JetBrains Mono (mono).
|
|
31
|
-
- **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.
|
|
32
|
-
- **Data**: \`data.js\` defines synthetic sample data on \`window.*\`. Treat as fixtures, not production data.
|
|
33
|
-
- **Backend**: None. There are no API calls, no \`fetch\`, no auth, no DB access in a typical export.
|
|
34
|
-
- **Routing**: None. Single-page prototype; no \`react-router\` or hashes.
|
|
35
|
-
- **Assets**: Inlined SVGs in JSX or referenced from inline \`<style>\` background-images. No \`public/\`, no separate image files in the typical export.
|
|
36
|
-
|
|
37
|
-
## Discovery checklist
|
|
38
|
-
|
|
39
|
-
In addition to the framework's discovery requirements, for a Claude Design source enumerate:
|
|
40
|
-
|
|
41
|
-
- The HTML shell file (\`<Name>.html\`) and the \`<title>\` it sets — that is the prototype's name and should anchor your \`<PageName>\`.
|
|
42
|
-
- 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).
|
|
43
|
-
- The full \`TWEAK_DEFAULTS\` object between \`/*EDITMODE-BEGIN*/\` and \`/*EDITMODE-END*/\` — every key here corresponds to a runtime control; preserve every one in the migrated app or call out which you are dropping and why.
|
|
44
|
-
- The full set of CSS variables defined under \`:root[data-theme="light"]\` and \`:root[data-theme="dark"]\` — these are the theme tokens to port.
|
|
45
|
-
- Every Google Fonts family loaded in \`<head>\` and which CSS rules consume them.
|
|
46
|
-
- Every \`window.*\` global the JSX files read (look for the \`/* global ... */\` comment at the top of \`app.jsx\`) — these are the data fixtures to recreate.
|
|
47
|
-
- 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.
|
|
48
|
-
- Every inline SVG and its role (icons, sparklines, chart paths) — these go straight into the migrated JSX unchanged.
|
|
49
|
-
- 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.
|
|
50
|
-
|
|
51
|
-
If 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.
|
|
52
|
-
|
|
53
|
-
## Core mapping
|
|
54
|
-
|
|
55
|
-
- **The HTML shell + \`app.jsx\` → 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 — pick one shape and stay consistent.
|
|
56
|
-
- **Drop the CDN script tags entirely.** React, ReactDOM, and \`@babel/standalone\` from \`unpkg\` have no role in the migrated app — the Vite template ships React via \`node_modules\` and compiles JSX at build time. Likewise drop the \`<script type="text/babel" src="...">\` references.
|
|
57
|
-
- **Drop the \`<html>\` / \`<body>\` shell.** The Superblocks template owns the document. Mounting via \`ReactDOM.createRoot(...)\` also drops; the platform handles render.
|
|
58
|
-
- **Translate the inline \`<style>\` block into Tailwind v4 + \`client/index.css\`:**
|
|
59
|
-
- 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 — 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.
|
|
60
|
-
- 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.)
|
|
61
|
-
- 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 — do not invent a new design.
|
|
62
|
-
- **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) — only the JS toggle changes.
|
|
63
|
-
- **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.
|
|
64
|
-
- **But preserve what the tweaks controlled.** For each tweak in \`TWEAK_DEFAULTS\`:
|
|
65
|
-
- **Visual-only tweaks** (theme, accent color, density, font size) → 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.
|
|
66
|
-
- **Semantic tweaks** (active tab, selected filter, sort order, "show kpis" toggles) → 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.
|
|
67
|
-
- Surface the full list of tweaks and your decision per tweak in the discovery summary so the user can override.
|
|
68
|
-
- **\`data.js\` / \`window.*\` globals.** These are mock fixtures, not real data. Two paths:
|
|
69
|
-
- **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.
|
|
70
|
-
- **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.
|
|
71
|
-
- **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** — 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).
|
|
72
|
-
- **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.
|
|
73
|
-
- **Modals, toasts, and overlays.** Source uses raw \`<div>\` + CSS for these. Keep as-is in the migrated page — 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.
|
|
74
|
-
- **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.
|
|
75
|
-
|
|
76
|
-
## Ask-before-guessing — Claude Design specifics
|
|
77
|
-
|
|
78
|
-
- "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?"
|
|
79
|
-
- "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."
|
|
80
|
-
- "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?"
|
|
81
|
-
- "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?"
|
|
82
|
-
- "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?"
|
|
83
|
-
|
|
84
|
-
## Page port — what changes vs. what doesn't
|
|
85
|
-
|
|
86
|
-
For each Claude Design page, only these change:
|
|
87
|
-
|
|
88
|
-
- **Module system**: \`<script type="text/babel">\` + \`window.*\` globals → ESM imports between \`client/pages/...\` files; \`data.js\` becomes a \`.ts\` module (or inline \`const\`).
|
|
89
|
-
- **React acquisition**: \`const { useState, ... } = React;\` → \`import { useState, ... } from "react";\`
|
|
90
|
-
- **Mounting**: \`ReactDOM.createRoot(...).render(<App />)\` → page is mounted by \`client/router.tsx\` via the standard route binding.
|
|
91
|
-
- **Styling pipeline**: inline \`<style>\` + hand-rolled CSS classes → CSS variables in \`client/index.css\` under \`@theme inline\` + Tailwind utilities on JSX.
|
|
92
|
-
- **Theme toggle**: \`<html data-theme>\` mutation → \`document.documentElement\` class toggle.
|
|
93
|
-
- **Tweaks**: \`useTweaks\` / \`<TweaksPanel>\` → real React state for semantic tweaks; visual tweaks drop or move to a settings UI.
|
|
94
|
-
- **Edit-mode protocol**: \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage handshakes → drop entirely.
|
|
95
|
-
|
|
96
|
-
Everything else — JSX structure, component breakdown, prop shapes, event handlers, copy, layout, spacing, color, shadow, animation, breakpoints — transfers **unchanged** from the source. If the diff between source and target page goes beyond the bullets above, you are over-editing — back out the cosmetic changes.
|
|
97
|
-
|
|
98
|
-
## Done — Claude Design specifics
|
|
99
|
-
|
|
100
|
-
In the final report, additionally surface:
|
|
101
|
-
|
|
102
|
-
- The full list of tweaks from \`TWEAK_DEFAULTS\` and what happened to each (kept as state, dropped, surfaced as settings).
|
|
103
|
-
- Whether the data stayed as inline mocks or was promoted to APIs (and which integration backs each, if so).
|
|
104
|
-
- Any hand-rolled UI primitives (modal, toast, popover) you preserved verbatim, so the user can choose whether to standardize on shadcn later.
|
|
105
|
-
- The list of Google Fonts re-loaded and the \`@theme\` font tokens bound.
|
|
106
|
-
`;
|
|
107
|
-
//# sourceMappingURL=claude-design.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-design.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/claude-design.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGtB,CAAC"}
|