@superblocksteam/vite-plugin-file-sync 1.99.99-next.3 → 2.0.0-SNAPSHOT.2143e2e95d0107ab
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 +66 -0
- package/dist/ai-service/agent/middleware.d.ts.map +1 -0
- package/dist/ai-service/agent/middleware.js +423 -0
- package/dist/ai-service/agent/middleware.js.map +1 -0
- package/dist/ai-service/agent/prompts/api-prompts.d.ts +39 -0
- package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/api-prompts.js +806 -0
- package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +59 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +1133 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -0
- 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 +285 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts +24 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js +104 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts +38 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.js +1355 -0
- package/dist/ai-service/agent/subagents/apis/examples.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts +42 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js +103 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts +2 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js +779 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/types.d.ts +2 -0
- package/dist/ai-service/agent/subagents/apis/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/types.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts +16 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js +30 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts +30 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js +134 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/index.d.ts +3 -0
- package/dist/ai-service/agent/subagents/testing/index.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/index.js +2 -0
- package/dist/ai-service/agent/subagents/testing/index.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts +10 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js +177 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/types.d.ts +67 -0
- package/dist/ai-service/agent/subagents/testing/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/types.js +2 -0
- package/dist/ai-service/agent/subagents/testing/types.js.map +1 -0
- package/dist/ai-service/agent/subagents/types.d.ts +48 -0
- package/dist/ai-service/agent/subagents/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/types.js +49 -0
- package/dist/ai-service/agent/subagents/types.js.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts +26 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.js +356 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts +3 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js +23 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery.d.ts +50 -0
- package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery.js +434 -0
- package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -0
- package/dist/ai-service/agent/tool-result-metrics.d.ts +29 -0
- package/dist/ai-service/agent/tool-result-metrics.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-result-metrics.js +162 -0
- package/dist/ai-service/agent/tool-result-metrics.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/analysis.d.ts +30 -0
- package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/analysis.js +1305 -0
- package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -0
- 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 +366 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts +92 -0
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-executor.js +480 -0
- package/dist/ai-service/agent/tools/apis/api-executor.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts +43 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.js +259 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +71 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +562 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts +51 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js +378 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api.d.ts +15 -0
- package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api.js +82 -0
- package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +66 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.js +2242 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.d.ts +12 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.js +76 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +32 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +277 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/integration-types.d.ts +59 -0
- package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/integration-types.js +1677 -0
- package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/sample-json.d.ts +2 -0
- package/dist/ai-service/agent/tools/apis/sample-json.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/sample-json.js +16 -0
- package/dist/ai-service/agent/tools/apis/sample-json.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts +20 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.js +78 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +66 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/test-api.js +864 -0
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/write-api.d.ts +12 -0
- package/dist/ai-service/agent/tools/apis/write-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/write-api.js +47 -0
- package/dist/ai-service/agent/tools/apis/write-api.js.map +1 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts +29 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js +399 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js.map +1 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +59 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +483 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -0
- 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 +17 -0
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-debug.js +244 -0
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -0
- package/dist/ai-service/agent/tools/build-delete-file.d.ts +27 -0
- package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-delete-file.js +217 -0
- package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +23 -0
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-edit-file.js +509 -0
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts +19 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.js +234 -0
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -0
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +89 -0
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-install-packages.js +727 -0
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -0
- package/dist/ai-service/agent/tools/build-list-files.d.ts +5 -0
- package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-list-files.js +26 -0
- package/dist/ai-service/agent/tools/build-list-files.js.map +1 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts +29 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js +66 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js.map +1 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +89 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.js +276 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +20 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.js +209 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts +17 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js +71 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -0
- package/dist/ai-service/agent/tools/build-read-file.d.ts +21 -0
- package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-read-file.js +148 -0
- package/dist/ai-service/agent/tools/build-read-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-reload-file.d.ts +14 -0
- package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-reload-file.js +78 -0
- package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-rename-file.d.ts +13 -0
- package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-rename-file.js +72 -0
- package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-write-file.d.ts +13 -0
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-write-file.js +82 -0
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -0
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts +10 -0
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/clear-error-cache.js +38 -0
- package/dist/ai-service/agent/tools/clear-error-cache.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.d.ts +58 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.js +258 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +489 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +1172 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts +65 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.js +77 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.js.map +1 -0
- package/dist/ai-service/agent/tools/debug-cache.d.ts +175 -0
- package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/debug-cache.js +643 -0
- package/dist/ai-service/agent/tools/debug-cache.js.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts +74 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.js +357 -0
- package/dist/ai-service/agent/tools/get-logs.js.map +1 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts +13 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.js +63 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -0
- package/dist/ai-service/agent/tools/index.d.ts +36 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/index.js +36 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -0
- 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 +107 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/errors.d.ts +9 -0
- package/dist/ai-service/agent/tools/integrations/errors.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/errors.js +35 -0
- package/dist/ai-service/agent/tools/integrations/errors.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +471 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js +1179 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts +6 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js +6 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +98 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js +391 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts +15 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.js +95 -0
- package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts +16 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.js +31 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts +15 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js +94 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts +9 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js +41 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts +50 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.js +570 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.js.map +1 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts +31 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.js +94 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.js.map +1 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts +23 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js +94 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js.map +1 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts +2 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js +11 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +169 -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 +53 -0
- package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
- package/dist/ai-service/agent/tools/screenshot-selector.d.ts +23 -0
- package/dist/ai-service/agent/tools/screenshot-selector.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/screenshot-selector.js +158 -0
- package/dist/ai-service/agent/tools/screenshot-selector.js.map +1 -0
- package/dist/ai-service/agent/tools/shared-helpers.d.ts +6 -0
- package/dist/ai-service/agent/tools/shared-helpers.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/shared-helpers.js +26 -0
- package/dist/ai-service/agent/tools/shared-helpers.js.map +1 -0
- package/dist/ai-service/agent/tools.d.ts +65 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -0
- package/dist/ai-service/agent/tools.js +799 -0
- package/dist/ai-service/agent/tools.js.map +1 -0
- package/dist/ai-service/agent/tools2/access-control.d.ts +150 -0
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/access-control.js +310 -0
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -0
- package/dist/ai-service/agent/tools2/entity-permissions.d.ts +201 -0
- package/dist/ai-service/agent/tools2/entity-permissions.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/entity-permissions.js +163 -0
- package/dist/ai-service/agent/tools2/entity-permissions.js.map +1 -0
- package/dist/ai-service/agent/tools2/example.d.ts +13 -0
- package/dist/ai-service/agent/tools2/example.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/example.js +151 -0
- package/dist/ai-service/agent/tools2/example.js.map +1 -0
- package/dist/ai-service/agent/tools2/index.d.ts +18 -0
- package/dist/ai-service/agent/tools2/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/index.js +19 -0
- package/dist/ai-service/agent/tools2/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/registry.d.ts +231 -0
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/registry.js +602 -0
- package/dist/ai-service/agent/tools2/registry.js.map +1 -0
- package/dist/ai-service/agent/tools2/test-utils.d.ts +7 -0
- package/dist/ai-service/agent/tools2/test-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/test-utils.js +10 -0
- package/dist/ai-service/agent/tools2/test-utils.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +32 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +103 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +92 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts +34 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.js +97 -0
- package/dist/ai-service/agent/tools2/tools/bash.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.d.ts +20 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.js +39 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/check-task.d.ts +38 -0
- package/dist/ai-service/agent/tools2/tools/check-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/check-task.js +59 -0
- package/dist/ai-service/agent/tools2/tools/check-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts +16 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js +167 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +309 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts +17 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.js +67 -0
- package/dist/ai-service/agent/tools2/tools/edit.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts +31 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.js +112 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +58 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +802 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.d.ts +25 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.js +394 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git.d.ts +126 -0
- package/dist/ai-service/agent/tools2/tools/git.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git.js +898 -0
- package/dist/ai-service/agent/tools2/tools/git.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts +14 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.js +71 -0
- package/dist/ai-service/agent/tools2/tools/glob.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts +22 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +927 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +123 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js +534 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +26 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.js +249 -0
- package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts +24 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.js +28 -0
- package/dist/ai-service/agent/tools2/tools/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts +18 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +70 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.d.ts +21 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.js +35 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ls.d.ts +17 -0
- package/dist/ai-service/agent/tools2/tools/ls.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ls.js +141 -0
- package/dist/ai-service/agent/tools2/tools/ls.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts +12 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.js +60 -0
- package/dist/ai-service/agent/tools2/tools/read.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.d.ts +31 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.js +118 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +50 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +273 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts +24 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.js +409 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.d.ts +2 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.js +2 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +29 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js +112 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.d.ts +48 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.js +101 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.d.ts +30 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.js +285 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-search.d.ts +25 -0
- package/dist/ai-service/agent/tools2/tools/web-search.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-search.js +210 -0
- package/dist/ai-service/agent/tools2/tools/web-search.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts +14 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.js +33 -0
- package/dist/ai-service/agent/tools2/tools/write.js.map +1 -0
- package/dist/ai-service/agent/tools2/types.d.ts +396 -0
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/types.js +204 -0
- package/dist/ai-service/agent/tools2/types.js.map +1 -0
- package/dist/ai-service/agent/tools2/utils.d.ts +9 -0
- package/dist/ai-service/agent/tools2/utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/utils.js +14 -0
- package/dist/ai-service/agent/tools2/utils.js.map +1 -0
- package/dist/ai-service/agent/utils.d.ts +15 -0
- package/dist/ai-service/agent/utils.d.ts.map +1 -0
- package/dist/ai-service/agent/utils.js +612 -0
- package/dist/ai-service/agent/utils.js.map +1 -0
- package/dist/ai-service/app-interface/cancellable-exec.d.ts +34 -0
- package/dist/ai-service/app-interface/cancellable-exec.d.ts.map +1 -0
- package/dist/ai-service/app-interface/cancellable-exec.js +98 -0
- package/dist/ai-service/app-interface/cancellable-exec.js.map +1 -0
- package/dist/ai-service/app-interface/constants.d.ts +60 -0
- package/dist/ai-service/app-interface/constants.d.ts.map +1 -0
- package/dist/ai-service/app-interface/constants.js +124 -0
- package/dist/ai-service/app-interface/constants.js.map +1 -0
- package/dist/ai-service/app-interface/file-system-interface.d.ts +22 -0
- package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -0
- package/dist/ai-service/app-interface/file-system-interface.js +109 -0
- package/dist/ai-service/app-interface/file-system-interface.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +87 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.js +91 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts +36 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js +250 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts +95 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js +530 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/index.d.ts +12 -0
- package/dist/ai-service/app-interface/filesystem/index.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/index.js +10 -0
- package/dist/ai-service/app-interface/filesystem/index.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.d.ts +43 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.js +9 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.d.ts +50 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.js +70 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/validation.d.ts +88 -0
- package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/validation.js +197 -0
- package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +144 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +238 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts +126 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js +9 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.d.ts +49 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.js +67 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/linter.d.ts +11 -0
- package/dist/ai-service/app-interface/linter.d.ts.map +1 -0
- package/dist/ai-service/app-interface/linter.js +152 -0
- package/dist/ai-service/app-interface/linter.js.map +1 -0
- package/dist/ai-service/app-interface/npm-error-parser.d.ts +84 -0
- package/dist/ai-service/app-interface/npm-error-parser.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-error-parser.js +510 -0
- package/dist/ai-service/app-interface/npm-error-parser.js.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts +338 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js +1043 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts +913 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.js +2461 -0
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
- package/dist/ai-service/app-interface/shell.d.ts +575 -4
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +2596 -70
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-interface/vulnerability-gate.d.ts +83 -0
- package/dist/ai-service/app-interface/vulnerability-gate.d.ts.map +1 -0
- package/dist/ai-service/app-interface/vulnerability-gate.js +543 -0
- package/dist/ai-service/app-interface/vulnerability-gate.js.map +1 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.d.ts +3 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.d.ts.map +1 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.js +47 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.js.map +1 -0
- package/dist/ai-service/app-skills/helpers.d.ts +18 -0
- package/dist/ai-service/app-skills/helpers.d.ts.map +1 -0
- package/dist/ai-service/app-skills/helpers.js +441 -0
- package/dist/ai-service/app-skills/helpers.js.map +1 -0
- package/dist/ai-service/app-skills/manager.d.ts +68 -0
- package/dist/ai-service/app-skills/manager.d.ts.map +1 -0
- package/dist/ai-service/app-skills/manager.js +259 -0
- package/dist/ai-service/app-skills/manager.js.map +1 -0
- package/dist/ai-service/app-skills/parser.d.ts +53 -0
- package/dist/ai-service/app-skills/parser.d.ts.map +1 -0
- package/dist/ai-service/app-skills/parser.js +82 -0
- package/dist/ai-service/app-skills/parser.js.map +1 -0
- package/dist/ai-service/attachment-upload.d.ts +33 -0
- package/dist/ai-service/attachment-upload.d.ts.map +1 -0
- package/dist/ai-service/attachment-upload.js +98 -0
- package/dist/ai-service/attachment-upload.js.map +1 -0
- package/dist/ai-service/attachments/index.d.ts +2 -0
- package/dist/ai-service/attachments/index.d.ts.map +1 -0
- package/dist/ai-service/attachments/index.js +2 -0
- package/dist/ai-service/attachments/index.js.map +1 -0
- package/dist/ai-service/attachments/parse-data-url.d.ts +5 -0
- package/dist/ai-service/attachments/parse-data-url.d.ts.map +1 -0
- package/dist/ai-service/attachments/parse-data-url.js +14 -0
- package/dist/ai-service/attachments/parse-data-url.js.map +1 -0
- package/dist/ai-service/attachments/store.d.ts +96 -0
- package/dist/ai-service/attachments/store.d.ts.map +1 -0
- package/dist/ai-service/attachments/store.js +285 -0
- package/dist/ai-service/attachments/store.js.map +1 -0
- package/dist/ai-service/attachments/text-upload-artifacts.d.ts +37 -0
- package/dist/ai-service/attachments/text-upload-artifacts.d.ts.map +1 -0
- package/dist/ai-service/attachments/text-upload-artifacts.js +231 -0
- package/dist/ai-service/attachments/text-upload-artifacts.js.map +1 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +23 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -0
- package/dist/ai-service/attachments/uploaded-content-part.js +137 -0
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -0
- package/dist/ai-service/chat/chat-push-metrics.d.ts +13 -0
- package/dist/ai-service/chat/chat-push-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-push-metrics.js +68 -0
- package/dist/ai-service/chat/chat-push-metrics.js.map +1 -0
- package/dist/ai-service/chat/chat-session-store-metrics.d.ts +13 -0
- package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-session-store-metrics.js +72 -0
- package/dist/ai-service/chat/chat-session-store-metrics.js.map +1 -0
- package/dist/ai-service/chat/chat-session-store.d.ts +170 -0
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-session-store.js +862 -0
- package/dist/ai-service/chat/chat-session-store.js.map +1 -0
- package/dist/ai-service/chat/extract-history.d.ts +3 -0
- package/dist/ai-service/chat/extract-history.d.ts.map +1 -0
- package/dist/ai-service/chat/extract-history.js +21 -0
- package/dist/ai-service/chat/extract-history.js.map +1 -0
- package/dist/ai-service/chat/transcript-budget.d.ts +106 -0
- package/dist/ai-service/chat/transcript-budget.d.ts.map +1 -0
- package/dist/ai-service/chat/transcript-budget.js +175 -0
- package/dist/ai-service/chat/transcript-budget.js.map +1 -0
- package/dist/ai-service/chat/transcript-metrics.d.ts +33 -0
- package/dist/ai-service/chat/transcript-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/transcript-metrics.js +169 -0
- package/dist/ai-service/chat/transcript-metrics.js.map +1 -0
- package/dist/ai-service/chat/utils.d.ts +16 -0
- package/dist/ai-service/chat/utils.d.ts.map +1 -0
- package/dist/ai-service/chat/utils.js +98 -0
- package/dist/ai-service/chat/utils.js.map +1 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts +11 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js +45 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts +4 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.js +8 -0
- package/dist/ai-service/checklist/api-migration-origins.js.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +108 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js +511 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
- package/dist/ai-service/const.d.ts +86 -5
- package/dist/ai-service/const.d.ts.map +1 -1
- package/dist/ai-service/const.js +92 -5
- package/dist/ai-service/const.js.map +1 -1
- package/dist/ai-service/context/app-context.d.ts +78 -0
- package/dist/ai-service/context/app-context.d.ts.map +1 -0
- package/dist/ai-service/context/app-context.js +359 -0
- package/dist/ai-service/context/app-context.js.map +1 -0
- package/dist/ai-service/context-archive-paths.d.ts +11 -0
- package/dist/ai-service/context-archive-paths.d.ts.map +1 -0
- package/dist/ai-service/context-archive-paths.js +35 -0
- package/dist/ai-service/context-archive-paths.js.map +1 -0
- package/dist/ai-service/context-download.d.ts +56 -0
- package/dist/ai-service/context-download.d.ts.map +1 -0
- package/dist/ai-service/context-download.js +372 -0
- package/dist/ai-service/context-download.js.map +1 -0
- package/dist/ai-service/context-flush-scheduler.d.ts +76 -0
- package/dist/ai-service/context-flush-scheduler.d.ts.map +1 -0
- package/dist/ai-service/context-flush-scheduler.js +134 -0
- package/dist/ai-service/context-flush-scheduler.js.map +1 -0
- package/dist/ai-service/context-flush.d.ts +36 -0
- package/dist/ai-service/context-flush.d.ts.map +1 -0
- package/dist/ai-service/context-flush.js +90 -0
- package/dist/ai-service/context-flush.js.map +1 -0
- package/dist/ai-service/context-restore.d.ts +64 -0
- package/dist/ai-service/context-restore.d.ts.map +1 -0
- package/dist/ai-service/context-restore.js +136 -0
- package/dist/ai-service/context-restore.js.map +1 -0
- package/dist/ai-service/context-upload.d.ts +31 -0
- package/dist/ai-service/context-upload.d.ts.map +1 -0
- package/dist/ai-service/context-upload.js +180 -0
- package/dist/ai-service/context-upload.js.map +1 -0
- package/dist/ai-service/dev-database-client.d.ts +169 -0
- package/dist/ai-service/dev-database-client.d.ts.map +1 -0
- package/dist/ai-service/dev-database-client.js +180 -0
- package/dist/ai-service/dev-database-client.js.map +1 -0
- package/dist/ai-service/dev-database-file-sync.d.ts +41 -0
- package/dist/ai-service/dev-database-file-sync.d.ts.map +1 -0
- package/dist/ai-service/dev-database-file-sync.js +29 -0
- package/dist/ai-service/dev-database-file-sync.js.map +1 -0
- package/dist/ai-service/features.d.ts +237 -0
- package/dist/ai-service/features.d.ts.map +1 -0
- package/dist/ai-service/features.js +238 -0
- package/dist/ai-service/features.js.map +1 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts +6 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js +42 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -0
- package/dist/ai-service/helper-system-ai-attributes.d.ts +19 -0
- package/dist/ai-service/helper-system-ai-attributes.d.ts.map +1 -0
- package/dist/ai-service/helper-system-ai-attributes.js +17 -0
- package/dist/ai-service/helper-system-ai-attributes.js.map +1 -0
- package/dist/ai-service/index.d.ts +693 -12
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +5021 -79
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integration-validator.d.ts +4 -0
- package/dist/ai-service/integration-validator.d.ts.map +1 -0
- package/dist/ai-service/integration-validator.js +58 -0
- package/dist/ai-service/integration-validator.js.map +1 -0
- package/dist/ai-service/integrations/gron.d.ts +18 -0
- package/dist/ai-service/integrations/gron.d.ts.map +1 -0
- package/dist/ai-service/integrations/gron.js +321 -0
- package/dist/ai-service/integrations/gron.js.map +1 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts +12 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts.map +1 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js +18 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js.map +1 -0
- package/dist/ai-service/integrations/metadata-binaries.d.ts +28 -0
- package/dist/ai-service/integrations/metadata-binaries.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-binaries.js +48 -0
- package/dist/ai-service/integrations/metadata-binaries.js.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/index.d.ts +35 -0
- package/dist/ai-service/integrations/metadata-storage/index.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/index.js +2 -0
- package/dist/ai-service/integrations/metadata-storage/index.js.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/local.d.ts +56 -0
- package/dist/ai-service/integrations/metadata-storage/local.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/local.js +346 -0
- package/dist/ai-service/integrations/metadata-storage/local.js.map +1 -0
- package/dist/ai-service/integrations/ripgrep-path.d.ts +6 -0
- package/dist/ai-service/integrations/ripgrep-path.d.ts.map +1 -0
- package/dist/ai-service/integrations/ripgrep-path.js +56 -0
- package/dist/ai-service/integrations/ripgrep-path.js.map +1 -0
- package/dist/ai-service/integrations/store.d.ts +142 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -0
- package/dist/ai-service/integrations/store.js +574 -0
- package/dist/ai-service/integrations/store.js.map +1 -0
- package/dist/ai-service/judge/debug-browser.d.ts +8 -0
- package/dist/ai-service/judge/debug-browser.d.ts.map +1 -0
- package/dist/ai-service/judge/debug-browser.js +79 -0
- package/dist/ai-service/judge/debug-browser.js.map +1 -0
- package/dist/ai-service/judge/index.d.ts +12 -0
- package/dist/ai-service/judge/index.d.ts.map +1 -0
- package/dist/ai-service/judge/index.js +11 -0
- package/dist/ai-service/judge/index.js.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts +143 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js +209 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts +3 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.js +541 -0
- package/dist/ai-service/judge/judge-eval-http.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts +35 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js +129 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js.map +1 -0
- package/dist/ai-service/judge/judge-executor.d.ts +65 -0
- package/dist/ai-service/judge/judge-executor.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-executor.js +335 -0
- package/dist/ai-service/judge/judge-executor.js.map +1 -0
- package/dist/ai-service/judge/judge-service.d.ts +154 -0
- package/dist/ai-service/judge/judge-service.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-service.js +220 -0
- package/dist/ai-service/judge/judge-service.js.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts +37 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js +283 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts +30 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.js +212 -0
- package/dist/ai-service/judge/prompts/system-prompt.js.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts +99 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.js +274 -0
- package/dist/ai-service/judge/storage/csv-storage.js.map +1 -0
- package/dist/ai-service/judge/storage/index.d.ts +9 -0
- package/dist/ai-service/judge/storage/index.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/index.js +7 -0
- package/dist/ai-service/judge/storage/index.js.map +1 -0
- package/dist/ai-service/judge/storage/interface.d.ts +51 -0
- package/dist/ai-service/judge/storage/interface.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/interface.js +8 -0
- package/dist/ai-service/judge/storage/interface.js.map +1 -0
- package/dist/ai-service/judge/storage/types.d.ts +54 -0
- package/dist/ai-service/judge/storage/types.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/types.js +7 -0
- package/dist/ai-service/judge/storage/types.js.map +1 -0
- package/dist/ai-service/judge/tools/index.d.ts +20 -0
- package/dist/ai-service/judge/tools/index.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/index.js +27 -0
- package/dist/ai-service/judge/tools/index.js.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts +72 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.js +171 -0
- package/dist/ai-service/judge/tools/playwright-action.js.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +34 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.js +137 -0
- package/dist/ai-service/judge/tools/submit-feedback.js.map +1 -0
- package/dist/ai-service/judge/types.d.ts +169 -0
- package/dist/ai-service/judge/types.d.ts.map +1 -0
- package/dist/ai-service/judge/types.js +8 -0
- package/dist/ai-service/judge/types.js.map +1 -0
- package/dist/ai-service/knowledge/helpers.d.ts +17 -0
- package/dist/ai-service/knowledge/helpers.d.ts.map +1 -0
- package/dist/ai-service/knowledge/helpers.js +154 -0
- package/dist/ai-service/knowledge/helpers.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-manager.d.ts +85 -0
- package/dist/ai-service/knowledge/knowledge-manager.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-manager.js +299 -0
- package/dist/ai-service/knowledge/knowledge-manager.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.d.ts +20 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.js +77 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics.d.ts +44 -0
- package/dist/ai-service/knowledge/knowledge-metrics.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics.js +217 -0
- package/dist/ai-service/knowledge/knowledge-metrics.js.map +1 -0
- package/dist/ai-service/live-edit-events/bridge.d.ts +21 -0
- package/dist/ai-service/live-edit-events/bridge.d.ts.map +1 -0
- package/dist/ai-service/live-edit-events/bridge.js +52 -0
- package/dist/ai-service/live-edit-events/bridge.js.map +1 -0
- package/dist/ai-service/live-edit-events/forwarder.d.ts +158 -0
- package/dist/ai-service/live-edit-events/forwarder.d.ts.map +1 -0
- package/dist/ai-service/live-edit-events/forwarder.js +403 -0
- package/dist/ai-service/live-edit-events/forwarder.js.map +1 -0
- package/dist/ai-service/llm/chaos-fetch.d.ts +90 -0
- package/dist/ai-service/llm/chaos-fetch.d.ts.map +1 -0
- package/dist/ai-service/llm/chaos-fetch.js +200 -0
- package/dist/ai-service/llm/chaos-fetch.js.map +1 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.d.ts +4 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.d.ts.map +1 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.js +152 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.js.map +1 -0
- package/dist/ai-service/llm/client.d.ts +315 -0
- package/dist/ai-service/llm/client.d.ts.map +1 -0
- package/dist/ai-service/llm/client.js +992 -0
- package/dist/ai-service/llm/client.js.map +1 -0
- package/dist/ai-service/llm/context-v2/adapter.d.ts +33 -0
- package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/adapter.js +103 -0
- package/dist/ai-service/llm/context-v2/adapter.js.map +1 -0
- package/dist/ai-service/llm/context-v2/caching.d.ts +40 -0
- package/dist/ai-service/llm/context-v2/caching.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/caching.js +48 -0
- package/dist/ai-service/llm/context-v2/caching.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +100 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js +298 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +73 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js +9 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts +33 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js +137 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compactor.d.ts +34 -0
- package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compactor.js +243 -0
- package/dist/ai-service/llm/context-v2/compactor.js.map +1 -0
- package/dist/ai-service/llm/context-v2/config.d.ts +27 -0
- package/dist/ai-service/llm/context-v2/config.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/config.js +59 -0
- package/dist/ai-service/llm/context-v2/config.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts +215 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.js +207 -0
- package/dist/ai-service/llm/context-v2/context-management.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts +150 -0
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context-metrics.js +602 -0
- package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context.d.ts +391 -0
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context.js +1666 -0
- package/dist/ai-service/llm/context-v2/context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts +150 -0
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/conversation-context.js +10 -0
- package/dist/ai-service/llm/context-v2/conversation-context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/index.d.ts +13 -0
- package/dist/ai-service/llm/context-v2/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/index.js +13 -0
- package/dist/ai-service/llm/context-v2/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/manager.d.ts +188 -0
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/manager.js +629 -0
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/index.d.ts +7 -0
- package/dist/ai-service/llm/context-v2/migrations/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/index.js +7 -0
- package/dist/ai-service/llm/context-v2/migrations/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.d.ts +19 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.js +32 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.d.ts +3 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.js +61 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/types.d.ts +16 -0
- package/dist/ai-service/llm/context-v2/migrations/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/types.js +26 -0
- package/dist/ai-service/llm/context-v2/migrations/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts +25 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js +75 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js.map +1 -0
- package/dist/ai-service/llm/context-v2/operation-queue.d.ts +9 -0
- package/dist/ai-service/llm/context-v2/operation-queue.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/operation-queue.js +13 -0
- package/dist/ai-service/llm/context-v2/operation-queue.js.map +1 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts +20 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js +360 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js.map +1 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.d.ts +68 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js +377 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js.map +1 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +11 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.js +63 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.js.map +1 -0
- package/dist/ai-service/llm/context-v2/session-capture.d.ts +18 -0
- package/dist/ai-service/llm/context-v2/session-capture.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/session-capture.js +64 -0
- package/dist/ai-service/llm/context-v2/session-capture.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts +83 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js +10 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +59 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js +16 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/index.d.ts +14 -0
- package/dist/ai-service/llm/context-v2/storage/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/index.js +2 -0
- package/dist/ai-service/llm/context-v2/storage/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts +108 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js +267 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.d.ts +46 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.js +240 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/local.d.ts +25 -0
- package/dist/ai-service/llm/context-v2/storage/local.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/local.js +124 -0
- package/dist/ai-service/llm/context-v2/storage/local.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts +49 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js +126 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/types.d.ts +2 -0
- package/dist/ai-service/llm/context-v2/storage/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/types.js +2 -0
- package/dist/ai-service/llm/context-v2/storage/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts +88 -0
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/token-tracker.js +193 -0
- package/dist/ai-service/llm/context-v2/token-tracker.js.map +1 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts +10 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.js +124 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.js.map +1 -0
- package/dist/ai-service/llm/context-v2/turns.d.ts +24 -0
- package/dist/ai-service/llm/context-v2/turns.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/turns.js +85 -0
- package/dist/ai-service/llm/context-v2/turns.js.map +1 -0
- package/dist/ai-service/llm/context-v2/types-v1.d.ts +36 -0
- package/dist/ai-service/llm/context-v2/types-v1.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/types-v1.js +3 -0
- package/dist/ai-service/llm/context-v2/types-v1.js.map +1 -0
- package/dist/ai-service/llm/context-v2/types.d.ts +238 -0
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/types.js +609 -0
- package/dist/ai-service/llm/context-v2/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts +15 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js +194 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts +9 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.js +6 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/index.d.ts +2 -0
- package/dist/ai-service/llm/context-v2/utils/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/index.js +2 -0
- package/dist/ai-service/llm/context-v2/utils/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts +24 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js +73 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js.map +1 -0
- package/dist/ai-service/llm/error.d.ts +153 -0
- package/dist/ai-service/llm/error.d.ts.map +1 -0
- package/dist/ai-service/llm/error.js +539 -0
- package/dist/ai-service/llm/error.js.map +1 -0
- package/dist/ai-service/llm/impl/clark.d.ts +11 -0
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -0
- package/dist/ai-service/llm/impl/clark.js +22 -0
- package/dist/ai-service/llm/impl/clark.js.map +1 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts +67 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.js +190 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.js.map +1 -0
- package/dist/ai-service/llm/interaction/index.d.ts +4 -0
- package/dist/ai-service/llm/interaction/index.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/index.js +5 -0
- package/dist/ai-service/llm/interaction/index.js.map +1 -0
- package/dist/ai-service/llm/interaction/provider.d.ts +189 -0
- package/dist/ai-service/llm/interaction/provider.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/provider.js +15 -0
- package/dist/ai-service/llm/interaction/provider.js.map +1 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.d.ts +48 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.js +147 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.js.map +1 -0
- package/dist/ai-service/llm/provider.d.ts +10 -0
- package/dist/ai-service/llm/provider.d.ts.map +1 -0
- package/dist/ai-service/llm/provider.js +370 -0
- package/dist/ai-service/llm/provider.js.map +1 -0
- package/dist/ai-service/llm/stream/compaction-text-block.d.ts +15 -0
- package/dist/ai-service/llm/stream/compaction-text-block.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/compaction-text-block.js +29 -0
- package/dist/ai-service/llm/stream/compaction-text-block.js.map +1 -0
- package/dist/ai-service/llm/stream/config.d.ts +151 -0
- package/dist/ai-service/llm/stream/config.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/config.js +108 -0
- package/dist/ai-service/llm/stream/config.js.map +1 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts +48 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js +123 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js.map +1 -0
- package/dist/ai-service/llm/stream/errors.d.ts +62 -0
- package/dist/ai-service/llm/stream/errors.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/errors.js +139 -0
- package/dist/ai-service/llm/stream/errors.js.map +1 -0
- package/dist/ai-service/llm/stream/event-bus.d.ts +75 -0
- package/dist/ai-service/llm/stream/event-bus.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/event-bus.js +51 -0
- package/dist/ai-service/llm/stream/event-bus.js.map +1 -0
- package/dist/ai-service/llm/stream/idle-monitor.d.ts +167 -0
- package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/idle-monitor.js +423 -0
- package/dist/ai-service/llm/stream/idle-monitor.js.map +1 -0
- package/dist/ai-service/llm/stream/index.d.ts +51 -0
- package/dist/ai-service/llm/stream/index.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/index.js +48 -0
- package/dist/ai-service/llm/stream/index.js.map +1 -0
- package/dist/ai-service/llm/stream/managed-stream.d.ts +32 -0
- package/dist/ai-service/llm/stream/managed-stream.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/managed-stream.js +219 -0
- package/dist/ai-service/llm/stream/managed-stream.js.map +1 -0
- package/dist/ai-service/llm/stream/observer.d.ts +34 -0
- package/dist/ai-service/llm/stream/observer.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observer.js +2 -0
- package/dist/ai-service/llm/stream/observer.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/context.d.ts +63 -0
- package/dist/ai-service/llm/stream/observers/context.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/context.js +235 -0
- package/dist/ai-service/llm/stream/observers/context.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/index.d.ts +8 -0
- package/dist/ai-service/llm/stream/observers/index.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/index.js +8 -0
- package/dist/ai-service/llm/stream/observers/index.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts +94 -0
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/llmobs.js +796 -0
- package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/logging.d.ts +74 -0
- package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/logging.js +509 -0
- package/dist/ai-service/llm/stream/observers/logging.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts +21 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.js +71 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts +15 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.js +88 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts +19 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.js +112 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.js.map +1 -0
- package/dist/ai-service/llm/stream/orchestrator.d.ts +133 -0
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/orchestrator.js +1297 -0
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -0
- package/dist/ai-service/llm/stream/retry-engine.d.ts +89 -0
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/retry-engine.js +367 -0
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -0
- package/dist/ai-service/llm/stream/session.d.ts +94 -0
- package/dist/ai-service/llm/stream/session.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/session.js +173 -0
- package/dist/ai-service/llm/stream/session.js.map +1 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.d.ts +16 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.js +26 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.js.map +1 -0
- package/dist/ai-service/llm/stream/terminal-reason.d.ts +6 -0
- package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/terminal-reason.js +83 -0
- package/dist/ai-service/llm/stream/terminal-reason.js.map +1 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts +98 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js +521 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js.map +1 -0
- package/dist/ai-service/llm/stream/types.d.ts +16 -0
- package/dist/ai-service/llm/stream/types.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/types.js +2 -0
- package/dist/ai-service/llm/stream/types.js.map +1 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts +55 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.js +109 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.js.map +1 -0
- package/dist/ai-service/llm/tool-context-integrity.d.ts +25 -0
- package/dist/ai-service/llm/tool-context-integrity.d.ts.map +1 -0
- package/dist/ai-service/llm/tool-context-integrity.js +141 -0
- package/dist/ai-service/llm/tool-context-integrity.js.map +1 -0
- package/dist/ai-service/llm/types.d.ts +44 -0
- package/dist/ai-service/llm/types.d.ts.map +1 -0
- package/dist/ai-service/llm/types.js +2 -0
- package/dist/ai-service/llm/types.js.map +1 -0
- package/dist/ai-service/llm/workflow-metrics.d.ts +14 -0
- package/dist/ai-service/llm/workflow-metrics.d.ts.map +1 -0
- package/dist/ai-service/llm/workflow-metrics.js +19 -0
- package/dist/ai-service/llm/workflow-metrics.js.map +1 -0
- package/dist/ai-service/llmobs/constants.d.ts +5 -0
- package/dist/ai-service/llmobs/constants.d.ts.map +1 -0
- package/dist/ai-service/llmobs/constants.js +5 -0
- package/dist/ai-service/llmobs/constants.js.map +1 -0
- 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/helpers.d.ts +5 -0
- package/dist/ai-service/llmobs/helpers.d.ts.map +1 -0
- package/dist/ai-service/llmobs/helpers.js +31 -0
- package/dist/ai-service/llmobs/helpers.js.map +1 -0
- package/dist/ai-service/llmobs/index.d.ts +8 -0
- package/dist/ai-service/llmobs/index.d.ts.map +1 -0
- package/dist/ai-service/llmobs/index.js +7 -0
- package/dist/ai-service/llmobs/index.js.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts +178 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.js +660 -0
- package/dist/ai-service/llmobs/otel-exporter.js.map +1 -0
- package/dist/ai-service/llmobs/tracer.d.ts +130 -0
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -0
- package/dist/ai-service/llmobs/tracer.js +532 -0
- package/dist/ai-service/llmobs/tracer.js.map +1 -0
- package/dist/ai-service/llmobs/types.d.ts +71 -0
- package/dist/ai-service/llmobs/types.d.ts.map +1 -0
- package/dist/ai-service/llmobs/types.js +2 -0
- package/dist/ai-service/llmobs/types.js.map +1 -0
- package/dist/ai-service/llmobs/utils.d.ts +15 -0
- package/dist/ai-service/llmobs/utils.d.ts.map +1 -0
- package/dist/ai-service/llmobs/utils.js +82 -0
- package/dist/ai-service/llmobs/utils.js.map +1 -0
- package/dist/ai-service/managed-native-db-availability.d.ts +62 -0
- package/dist/ai-service/managed-native-db-availability.d.ts.map +1 -0
- package/dist/ai-service/managed-native-db-availability.js +37 -0
- package/dist/ai-service/managed-native-db-availability.js.map +1 -0
- package/dist/ai-service/mcp/adapter/index.d.ts +8 -0
- package/dist/ai-service/mcp/adapter/index.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/index.js +10 -0
- package/dist/ai-service/mcp/adapter/index.js.map +1 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.d.ts +44 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.js +231 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.js.map +1 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts +126 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js +365 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts +85 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +1626 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -0
- package/dist/ai-service/mcp/index.d.ts +11 -0
- package/dist/ai-service/mcp/index.d.ts.map +1 -0
- package/dist/ai-service/mcp/index.js +11 -0
- package/dist/ai-service/mcp/index.js.map +1 -0
- package/dist/ai-service/mcp/playwright-server.d.ts +153 -0
- package/dist/ai-service/mcp/playwright-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/playwright-server.js +174 -0
- package/dist/ai-service/mcp/playwright-server.js.map +1 -0
- package/dist/ai-service/mcp/types.d.ts +101 -0
- package/dist/ai-service/mcp/types.d.ts.map +1 -0
- package/dist/ai-service/mcp/types.js +7 -0
- package/dist/ai-service/mcp/types.js.map +1 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.d.ts +19 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.d.ts.map +1 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.js +17 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.js.map +1 -0
- package/dist/ai-service/migration-autodispatch-metrics.d.ts +3 -0
- package/dist/ai-service/migration-autodispatch-metrics.d.ts.map +1 -0
- package/dist/ai-service/migration-autodispatch-metrics.js +52 -0
- package/dist/ai-service/migration-autodispatch-metrics.js.map +1 -0
- package/dist/ai-service/migration-llm-config.d.ts +12 -0
- package/dist/ai-service/migration-llm-config.d.ts.map +1 -0
- package/dist/ai-service/migration-llm-config.js +132 -0
- package/dist/ai-service/migration-llm-config.js.map +1 -0
- package/dist/ai-service/migration-prompt-gating.d.ts +21 -0
- package/dist/ai-service/migration-prompt-gating.d.ts.map +1 -0
- package/dist/ai-service/migration-prompt-gating.js +27 -0
- package/dist/ai-service/migration-prompt-gating.js.map +1 -0
- package/dist/ai-service/migration-session-active.d.ts +14 -0
- package/dist/ai-service/migration-session-active.d.ts.map +1 -0
- package/dist/ai-service/migration-session-active.js +29 -0
- package/dist/ai-service/migration-session-active.js.map +1 -0
- package/dist/ai-service/migration-turns-log.d.ts +36 -0
- package/dist/ai-service/migration-turns-log.d.ts.map +1 -0
- package/dist/ai-service/migration-turns-log.js +88 -0
- package/dist/ai-service/migration-turns-log.js.map +1 -0
- package/dist/ai-service/policy-agent-metrics.d.ts +29 -0
- package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -0
- package/dist/ai-service/policy-agent-metrics.js +141 -0
- package/dist/ai-service/policy-agent-metrics.js.map +1 -0
- package/dist/ai-service/policy-gate-error.d.ts +3 -0
- package/dist/ai-service/policy-gate-error.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-error.js +33 -0
- package/dist/ai-service/policy-gate-error.js.map +1 -0
- package/dist/ai-service/policy-gate-step.d.ts +17 -0
- package/dist/ai-service/policy-gate-step.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-step.js +52 -0
- package/dist/ai-service/policy-gate-step.js.map +1 -0
- package/dist/ai-service/profiler/clark-profiler.d.ts +86 -0
- package/dist/ai-service/profiler/clark-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/clark-profiler.js +209 -0
- package/dist/ai-service/profiler/clark-profiler.js.map +1 -0
- package/dist/ai-service/profiler/index.d.ts +4 -0
- package/dist/ai-service/profiler/index.d.ts.map +1 -0
- package/dist/ai-service/profiler/index.js +4 -0
- package/dist/ai-service/profiler/index.js.map +1 -0
- package/dist/ai-service/profiler/perfetto-profiler.d.ts +116 -0
- package/dist/ai-service/profiler/perfetto-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/perfetto-profiler.js +240 -0
- package/dist/ai-service/profiler/perfetto-profiler.js.map +1 -0
- package/dist/ai-service/profiler/tool-profiler.d.ts +33 -0
- package/dist/ai-service/profiler/tool-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/tool-profiler.js +157 -0
- package/dist/ai-service/profiler/tool-profiler.js.map +1 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts +27 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +97 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -0
- package/dist/ai-service/prompt-builder-service/types.d.ts +3 -0
- package/dist/ai-service/prompt-builder-service/types.d.ts.map +1 -0
- package/dist/ai-service/prompt-builder-service/types.js +6 -0
- package/dist/ai-service/prompt-builder-service/types.js.map +1 -0
- package/dist/ai-service/prompts/summarize-api-usage.d.ts +18 -0
- package/dist/ai-service/prompts/summarize-api-usage.d.ts.map +1 -0
- package/dist/ai-service/prompts/summarize-api-usage.js +30 -0
- package/dist/ai-service/prompts/summarize-api-usage.js.map +1 -0
- package/dist/ai-service/quota-client.d.ts +31 -0
- package/dist/ai-service/quota-client.d.ts.map +1 -0
- package/dist/ai-service/quota-client.js +72 -0
- package/dist/ai-service/quota-client.js.map +1 -0
- package/dist/ai-service/recording/block-traversal.d.ts +15 -0
- package/dist/ai-service/recording/block-traversal.d.ts.map +1 -0
- package/dist/ai-service/recording/block-traversal.js +104 -0
- package/dist/ai-service/recording/block-traversal.js.map +1 -0
- package/dist/ai-service/recording/index.d.ts +26 -0
- package/dist/ai-service/recording/index.d.ts.map +1 -0
- package/dist/ai-service/recording/index.js +29 -0
- package/dist/ai-service/recording/index.js.map +1 -0
- package/dist/ai-service/recording/recorders/llm-recorder.d.ts +35 -0
- package/dist/ai-service/recording/recorders/llm-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/llm-recorder.js +221 -0
- package/dist/ai-service/recording/recorders/llm-recorder.js.map +1 -0
- package/dist/ai-service/recording/recorders/socket-recorder.d.ts +38 -0
- package/dist/ai-service/recording/recorders/socket-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/socket-recorder.js +44 -0
- package/dist/ai-service/recording/recorders/socket-recorder.js.map +1 -0
- package/dist/ai-service/recording/recorders/tool-recorder.d.ts +25 -0
- package/dist/ai-service/recording/recorders/tool-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/tool-recorder.js +58 -0
- package/dist/ai-service/recording/recorders/tool-recorder.js.map +1 -0
- package/dist/ai-service/recording/recording-manager.d.ts +105 -0
- package/dist/ai-service/recording/recording-manager.d.ts.map +1 -0
- package/dist/ai-service/recording/recording-manager.js +308 -0
- package/dist/ai-service/recording/recording-manager.js.map +1 -0
- package/dist/ai-service/recording/snapshot-manager.d.ts +195 -0
- package/dist/ai-service/recording/snapshot-manager.d.ts.map +1 -0
- package/dist/ai-service/recording/snapshot-manager.js +708 -0
- package/dist/ai-service/recording/snapshot-manager.js.map +1 -0
- package/dist/ai-service/recording/storage/session-recording-storage.d.ts +148 -0
- package/dist/ai-service/recording/storage/session-recording-storage.d.ts.map +1 -0
- package/dist/ai-service/recording/storage/session-recording-storage.js +399 -0
- package/dist/ai-service/recording/storage/session-recording-storage.js.map +1 -0
- package/dist/ai-service/recording/types.d.ts +140 -0
- package/dist/ai-service/recording/types.d.ts.map +1 -0
- package/dist/ai-service/recording/types.js +8 -0
- package/dist/ai-service/recording/types.js.map +1 -0
- package/dist/ai-service/request-deduplicator.d.ts +35 -0
- package/dist/ai-service/request-deduplicator.d.ts.map +1 -0
- package/dist/ai-service/request-deduplicator.js +53 -0
- package/dist/ai-service/request-deduplicator.js.map +1 -0
- package/dist/ai-service/resolve-generation-state-for-ui.d.ts +9 -0
- package/dist/ai-service/resolve-generation-state-for-ui.d.ts.map +1 -0
- package/dist/ai-service/resolve-generation-state-for-ui.js +25 -0
- package/dist/ai-service/resolve-generation-state-for-ui.js.map +1 -0
- package/dist/ai-service/sdk-api-templates.d.ts +2 -0
- package/dist/ai-service/sdk-api-templates.d.ts.map +1 -0
- package/dist/ai-service/sdk-api-templates.js +2 -0
- package/dist/ai-service/sdk-api-templates.js.map +1 -0
- package/dist/ai-service/security/index.d.ts +9 -0
- package/dist/ai-service/security/index.d.ts.map +1 -0
- package/dist/ai-service/security/index.js +9 -0
- package/dist/ai-service/security/index.js.map +1 -0
- package/dist/ai-service/security/safety-classifier.d.ts +83 -0
- package/dist/ai-service/security/safety-classifier.d.ts.map +1 -0
- package/dist/ai-service/security/safety-classifier.js +189 -0
- package/dist/ai-service/security/safety-classifier.js.map +1 -0
- package/dist/ai-service/security/secret-scanner-service.d.ts +43 -0
- package/dist/ai-service/security/secret-scanner-service.d.ts.map +1 -0
- package/dist/ai-service/security/secret-scanner-service.js +422 -0
- package/dist/ai-service/security/secret-scanner-service.js.map +1 -0
- package/dist/ai-service/security/secret-scanner.d.ts +161 -0
- package/dist/ai-service/security/secret-scanner.d.ts.map +1 -0
- package/dist/ai-service/security/secret-scanner.js +459 -0
- package/dist/ai-service/security/secret-scanner.js.map +1 -0
- package/dist/ai-service/security/vulnerability-triage.d.ts +90 -0
- package/dist/ai-service/security/vulnerability-triage.d.ts.map +1 -0
- package/dist/ai-service/security/vulnerability-triage.js +113 -0
- package/dist/ai-service/security/vulnerability-triage.js.map +1 -0
- package/dist/ai-service/skills/index.d.ts +38 -0
- package/dist/ai-service/skills/index.d.ts.map +1 -0
- package/dist/ai-service/skills/index.js +104 -0
- package/dist/ai-service/skills/index.js.map +1 -0
- package/dist/ai-service/skills/system/_registry.generated.d.ts +6 -0
- package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/_registry.generated.js +43 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.js +93 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/materialized.d.ts +7 -0
- package/dist/ai-service/skills/system/materialized.d.ts.map +1 -0
- package/dist/ai-service/skills/system/materialized.js +33 -0
- package/dist/ai-service/skills/system/materialized.js.map +1 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js +119 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.js +274 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.js +214 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.js +276 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js +412 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.js +891 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.js +155 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +756 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +60 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +136 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +312 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -0
- 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 +124 -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/lovable.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.js +79 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.js +65 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +171 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.js +118 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.js.map +1 -0
- package/dist/ai-service/skills/system/tool-paths.d.ts +3 -0
- package/dist/ai-service/skills/system/tool-paths.d.ts.map +1 -0
- package/dist/ai-service/skills/system/tool-paths.js +16 -0
- package/dist/ai-service/skills/system/tool-paths.js.map +1 -0
- package/dist/ai-service/skills/types.d.ts +69 -0
- package/dist/ai-service/skills/types.d.ts.map +1 -0
- package/dist/ai-service/skills/types.js +121 -0
- package/dist/ai-service/skills/types.js.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts +570 -22
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +408 -0
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/fsm.d.ts +17 -16
- package/dist/ai-service/state-machine/fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/fsm.js +2 -1
- package/dist/ai-service/state-machine/fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts +12 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +1088 -168
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +335 -13
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.d.ts +11 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.js +11 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/idle.d.ts +2 -2
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js +138 -8
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +37 -2
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +1225 -136
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/next-steps.d.ts +22 -0
- package/dist/ai-service/state-machine/handlers/next-steps.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/next-steps.js +85 -0
- package/dist/ai-service/state-machine/handlers/next-steps.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.d.ts +25 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.js +68 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts +2 -2
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/play-dead.js +18 -4
- package/dist/ai-service/state-machine/handlers/play-dead.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts +6 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.js +234 -43
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js +116 -6
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts +7 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js +47 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.d.ts +33 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.js +61 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/change-info.d.ts +8 -0
- package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/change-info.js +100 -0
- package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/classification.d.ts +5 -0
- package/dist/ai-service/state-machine/helpers/classification.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/classification.js +13 -0
- package/dist/ai-service/state-machine/helpers/classification.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/context-id.d.ts +4 -0
- package/dist/ai-service/state-machine/helpers/context-id.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/context-id.js +18 -0
- package/dist/ai-service/state-machine/helpers/context-id.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts +7 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js +38 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.d.ts +27 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.js +34 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/peer.d.ts +83 -3
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +342 -4
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +21 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +71 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts +38 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js +131 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts +26 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js +128 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +28 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +254 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts +59 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.js +168 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +229 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +675 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +271 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js +630 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/transition.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/transition.js +8 -3
- package/dist/ai-service/state-machine/helpers/transition.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts +8 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js +11 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js.map +1 -0
- package/dist/ai-service/state-machine/mocks.d.ts +3 -3
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js +125 -20
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/state-machine/traced-fsm.d.ts +89 -0
- package/dist/ai-service/state-machine/traced-fsm.d.ts.map +1 -0
- package/dist/ai-service/state-machine/traced-fsm.js +179 -0
- package/dist/ai-service/state-machine/traced-fsm.js.map +1 -0
- package/dist/ai-service/tasks/access.d.ts +23 -0
- package/dist/ai-service/tasks/access.d.ts.map +1 -0
- package/dist/ai-service/tasks/access.js +26 -0
- package/dist/ai-service/tasks/access.js.map +1 -0
- package/dist/ai-service/tasks/factory.d.ts +106 -0
- package/dist/ai-service/tasks/factory.d.ts.map +1 -0
- package/dist/ai-service/tasks/factory.js +71 -0
- package/dist/ai-service/tasks/factory.js.map +1 -0
- package/dist/ai-service/tasks/index.d.ts +6 -0
- package/dist/ai-service/tasks/index.d.ts.map +1 -0
- package/dist/ai-service/tasks/index.js +5 -0
- package/dist/ai-service/tasks/index.js.map +1 -0
- package/dist/ai-service/tasks/peer-push.d.ts +81 -0
- package/dist/ai-service/tasks/peer-push.d.ts.map +1 -0
- package/dist/ai-service/tasks/peer-push.js +84 -0
- package/dist/ai-service/tasks/peer-push.js.map +1 -0
- package/dist/ai-service/tasks/poll-loop.d.ts +56 -0
- package/dist/ai-service/tasks/poll-loop.d.ts.map +1 -0
- package/dist/ai-service/tasks/poll-loop.js +73 -0
- package/dist/ai-service/tasks/poll-loop.js.map +1 -0
- package/dist/ai-service/tasks/task-store.d.ts +116 -0
- package/dist/ai-service/tasks/task-store.d.ts.map +1 -0
- package/dist/ai-service/tasks/task-store.js +388 -0
- package/dist/ai-service/tasks/task-store.js.map +1 -0
- package/dist/ai-service/tasks/test-utils.d.ts +24 -0
- package/dist/ai-service/tasks/test-utils.d.ts.map +1 -0
- package/dist/ai-service/tasks/test-utils.js +53 -0
- package/dist/ai-service/tasks/test-utils.js.map +1 -0
- package/dist/ai-service/tasks/types.d.ts +143 -0
- package/dist/ai-service/tasks/types.d.ts.map +1 -0
- package/dist/ai-service/tasks/types.js +6 -0
- package/dist/ai-service/tasks/types.js.map +1 -0
- package/dist/ai-service/template-renderer.d.ts +45 -0
- package/dist/ai-service/template-renderer.d.ts.map +1 -0
- package/dist/ai-service/template-renderer.js +316 -0
- package/dist/ai-service/template-renderer.js.map +1 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.d.ts +25 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.d.ts.map +1 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.js +9 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.js.map +1 -0
- package/dist/ai-service/test-utils/error-mocks.d.ts +69 -0
- package/dist/ai-service/test-utils/error-mocks.d.ts.map +1 -0
- package/dist/ai-service/test-utils/error-mocks.js +334 -0
- package/dist/ai-service/test-utils/error-mocks.js.map +1 -0
- package/dist/ai-service/test-utils/metrics-harness.d.ts +38 -0
- package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -0
- package/dist/ai-service/test-utils/metrics-harness.js +67 -0
- package/dist/ai-service/test-utils/metrics-harness.js.map +1 -0
- package/dist/ai-service/test-utils/span-interceptor.d.ts +74 -0
- package/dist/ai-service/test-utils/span-interceptor.d.ts.map +1 -0
- package/dist/ai-service/test-utils/span-interceptor.js +272 -0
- package/dist/ai-service/test-utils/span-interceptor.js.map +1 -0
- package/dist/ai-service/test-utils/tracer-harness.d.ts +8 -0
- package/dist/ai-service/test-utils/tracer-harness.d.ts.map +1 -0
- package/dist/ai-service/test-utils/tracer-harness.js +26 -0
- package/dist/ai-service/test-utils/tracer-harness.js.map +1 -0
- package/dist/ai-service/transform/api-builder/shared.d.ts +10 -2
- package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.js +34 -10
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts +16 -2
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +181 -55
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts +6 -2
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +186 -49
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.d.ts +40 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.js +118 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.js.map +1 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts +1 -1
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js +88 -37
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js.map +1 -1
- package/dist/ai-service/transform/shared.d.ts +9 -2
- package/dist/ai-service/transform/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/shared.js +43 -13
- package/dist/ai-service/transform/shared.js.map +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js +77 -26
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js.map +1 -1
- package/dist/ai-service/types.d.ts +301 -27
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js +157 -0
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/archive-extractors.d.ts +52 -0
- package/dist/ai-service/util/archive-extractors.d.ts.map +1 -0
- package/dist/ai-service/util/archive-extractors.js +305 -0
- package/dist/ai-service/util/archive-extractors.js.map +1 -0
- package/dist/ai-service/util/call-peer.d.ts +11 -0
- package/dist/ai-service/util/call-peer.d.ts.map +1 -0
- package/dist/ai-service/util/call-peer.js +47 -0
- package/dist/ai-service/util/call-peer.js.map +1 -0
- package/dist/ai-service/util/inference-jwt.d.ts +15 -0
- package/dist/ai-service/util/inference-jwt.d.ts.map +1 -0
- package/dist/ai-service/util/inference-jwt.js +56 -0
- package/dist/ai-service/util/inference-jwt.js.map +1 -0
- package/dist/ai-service/util/llm-config-utils.d.ts +54 -0
- package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -0
- package/dist/ai-service/util/llm-config-utils.js +140 -0
- package/dist/ai-service/util/llm-config-utils.js.map +1 -0
- package/dist/ai-service/util/mode-message.d.ts +7 -0
- package/dist/ai-service/util/mode-message.d.ts.map +1 -0
- package/dist/ai-service/util/mode-message.js +15 -0
- package/dist/ai-service/util/mode-message.js.map +1 -0
- package/dist/ai-service/util/parse-jwt.d.ts +12 -0
- package/dist/ai-service/util/parse-jwt.d.ts.map +1 -0
- package/dist/ai-service/util/parse-jwt.js +30 -0
- package/dist/ai-service/util/parse-jwt.js.map +1 -0
- package/dist/ai-service/util/peer-liveness.d.ts +23 -0
- package/dist/ai-service/util/peer-liveness.d.ts.map +1 -0
- package/dist/ai-service/util/peer-liveness.js +42 -0
- package/dist/ai-service/util/peer-liveness.js.map +1 -0
- package/dist/ai-service/util/rpc-timeout.d.ts +89 -0
- package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -0
- package/dist/ai-service/util/rpc-timeout.js +112 -0
- package/dist/ai-service/util/rpc-timeout.js.map +1 -0
- package/dist/ai-service/util/scoped-token-utils.d.ts +15 -0
- package/dist/ai-service/util/scoped-token-utils.d.ts.map +1 -0
- package/dist/ai-service/util/scoped-token-utils.js +137 -0
- package/dist/ai-service/util/scoped-token-utils.js.map +1 -0
- package/dist/ai-service/util/stop-condition.d.ts +17 -0
- package/dist/ai-service/util/stop-condition.d.ts.map +1 -0
- package/dist/ai-service/util/stop-condition.js +33 -0
- package/dist/ai-service/util/stop-condition.js.map +1 -0
- package/dist/ai-service/util/strip-content.d.ts +2 -0
- package/dist/ai-service/util/strip-content.d.ts.map +1 -0
- package/dist/ai-service/util/strip-content.js +31 -0
- package/dist/ai-service/util/strip-content.js.map +1 -0
- package/dist/ai-service/util/tool-signature.d.ts +13 -0
- package/dist/ai-service/util/tool-signature.d.ts.map +1 -0
- package/dist/ai-service/util/tool-signature.js +38 -0
- package/dist/ai-service/util/tool-signature.js.map +1 -0
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts +1 -2
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-control-block-identifiers.js +16 -14
- package/dist/binding-extraction/extract-control-block-identifiers.js.map +1 -1
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts +2 -11
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-embedded-identifiers.js +9 -91
- package/dist/binding-extraction/extract-embedded-identifiers.js.map +1 -1
- package/dist/binding-extraction/extract-identifiers.d.ts +16 -3
- package/dist/binding-extraction/extract-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-identifiers.js +272 -64
- package/dist/binding-extraction/extract-identifiers.js.map +1 -1
- package/dist/binding-extraction/index.d.ts +2 -0
- package/dist/binding-extraction/index.d.ts.map +1 -0
- package/dist/binding-extraction/index.js +2 -0
- package/dist/binding-extraction/index.js.map +1 -0
- package/dist/binding-extraction/js-identifiers.d.ts +34 -0
- package/dist/binding-extraction/js-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/js-identifiers.js +409 -0
- package/dist/binding-extraction/js-identifiers.js.map +1 -0
- package/dist/binding-extraction/python-identifiers.d.ts +30 -0
- package/dist/binding-extraction/python-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/python-identifiers.js +657 -0
- package/dist/binding-extraction/python-identifiers.js.map +1 -0
- package/dist/binding-extraction/shared.d.ts +0 -203
- package/dist/binding-extraction/shared.d.ts.map +1 -1
- package/dist/binding-extraction/shared.js +1 -42
- package/dist/binding-extraction/shared.js.map +1 -1
- package/dist/binding-extraction/template-strings.d.ts +1 -2
- package/dist/binding-extraction/template-strings.d.ts.map +1 -1
- package/dist/build-errors.d.ts +10 -0
- package/dist/build-errors.d.ts.map +1 -0
- package/dist/build-errors.js +14 -0
- package/dist/build-errors.js.map +1 -0
- package/dist/clark-log-forwarder.d.ts +15 -0
- package/dist/clark-log-forwarder.d.ts.map +1 -0
- package/dist/clark-log-forwarder.js +32 -0
- package/dist/clark-log-forwarder.js.map +1 -0
- package/dist/client-error-overlay.d.ts +11 -0
- package/dist/client-error-overlay.d.ts.map +1 -0
- package/dist/client-error-overlay.js +90 -0
- package/dist/client-error-overlay.js.map +1 -0
- package/dist/codegen.d.ts +3 -25
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +64 -129
- package/dist/codegen.js.map +1 -1
- package/dist/components-manager.d.ts +12 -12
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/components-manager.js +116 -90
- package/dist/components-manager.js.map +1 -1
- package/dist/custom-components.d.ts +1 -1
- package/dist/custom-components.d.ts.map +1 -1
- package/dist/custom-components.js +1 -1
- package/dist/custom-components.js.map +1 -1
- package/dist/dev-server-ws-smoke-client.d.ts +40 -0
- package/dist/dev-server-ws-smoke-client.d.ts.map +1 -0
- package/dist/dev-server-ws-smoke-client.js +316 -0
- package/dist/dev-server-ws-smoke-client.js.map +1 -0
- package/dist/download-filename.d.ts +6 -0
- package/dist/download-filename.d.ts.map +1 -0
- package/dist/download-filename.js +40 -0
- package/dist/download-filename.js.map +1 -0
- package/dist/draft-interface.d.ts +8 -1
- package/dist/draft-interface.d.ts.map +1 -1
- package/dist/early-error-relay.d.ts +31 -0
- package/dist/early-error-relay.d.ts.map +1 -0
- package/dist/early-error-relay.js +88 -0
- package/dist/early-error-relay.js.map +1 -0
- package/dist/ensure-app-provider.d.ts +2 -0
- package/dist/ensure-app-provider.d.ts.map +1 -0
- package/dist/ensure-app-provider.js +209 -0
- package/dist/ensure-app-provider.js.map +1 -0
- package/dist/errors/error-handler.d.ts +3 -13
- package/dist/errors/error-handler.d.ts.map +1 -1
- package/dist/errors/error-handler.js +1 -1
- package/dist/errors/error-handler.js.map +1 -1
- package/dist/extract-api-integrations.d.ts +99 -0
- package/dist/extract-api-integrations.d.ts.map +1 -0
- package/dist/extract-api-integrations.js +597 -0
- package/dist/extract-api-integrations.js.map +1 -0
- package/dist/file-sync-vite-plugin.d.ts +64 -2
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +1398 -469
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +55 -3
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +118 -5
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/file-system-manager.d.ts +62 -69
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +695 -811
- package/dist/file-system-manager.js.map +1 -1
- package/dist/git-auth-state.d.ts +4 -0
- package/dist/git-auth-state.d.ts.map +1 -0
- package/dist/git-auth-state.js +25 -0
- package/dist/git-auth-state.js.map +1 -0
- package/dist/git-log.d.ts +11 -0
- package/dist/git-log.d.ts.map +1 -0
- package/dist/git-log.js +23 -0
- package/dist/git-log.js.map +1 -0
- package/dist/git-operation-lock.d.ts +22 -0
- package/dist/git-operation-lock.d.ts.map +1 -0
- package/dist/git-operation-lock.js +25 -0
- package/dist/git-operation-lock.js.map +1 -0
- package/dist/git-service/app-layout-guard.d.ts +25 -0
- package/dist/git-service/app-layout-guard.d.ts.map +1 -0
- package/dist/git-service/app-layout-guard.js +66 -0
- package/dist/git-service/app-layout-guard.js.map +1 -0
- package/dist/git-service/azure-devops-workflow.d.ts +6 -0
- package/dist/git-service/azure-devops-workflow.d.ts.map +1 -0
- package/dist/git-service/azure-devops-workflow.js +12 -0
- package/dist/git-service/azure-devops-workflow.js.map +1 -0
- package/dist/git-service/bitbucket-workflow.d.ts +5 -0
- package/dist/git-service/bitbucket-workflow.d.ts.map +1 -0
- package/dist/git-service/bitbucket-workflow.js +12 -0
- package/dist/git-service/bitbucket-workflow.js.map +1 -0
- package/dist/git-service/checkpoint-commit-metrics.d.ts +2 -0
- package/dist/git-service/checkpoint-commit-metrics.d.ts.map +1 -0
- package/dist/git-service/checkpoint-commit-metrics.js +15 -0
- package/dist/git-service/checkpoint-commit-metrics.js.map +1 -0
- package/dist/git-service/checkpoint-committer.d.ts +22 -0
- package/dist/git-service/checkpoint-committer.d.ts.map +1 -0
- package/dist/git-service/checkpoint-committer.js +91 -0
- package/dist/git-service/checkpoint-committer.js.map +1 -0
- package/dist/git-service/commit-live-branch.d.ts +17 -0
- package/dist/git-service/commit-live-branch.d.ts.map +1 -0
- package/dist/git-service/commit-live-branch.js +28 -0
- package/dist/git-service/commit-live-branch.js.map +1 -0
- package/dist/git-service/ensure-workflow-file.d.ts +20 -0
- package/dist/git-service/ensure-workflow-file.d.ts.map +1 -0
- package/dist/git-service/ensure-workflow-file.js +51 -0
- package/dist/git-service/ensure-workflow-file.js.map +1 -0
- package/dist/git-service/errors.d.ts +31 -0
- package/dist/git-service/errors.d.ts.map +1 -0
- package/dist/git-service/errors.js +49 -0
- package/dist/git-service/errors.js.map +1 -0
- package/dist/git-service/github-workflow.d.ts +6 -0
- package/dist/git-service/github-workflow.d.ts.map +1 -0
- package/dist/git-service/github-workflow.js +12 -0
- package/dist/git-service/github-workflow.js.map +1 -0
- package/dist/git-service/gitlab-workflow.d.ts +6 -0
- package/dist/git-service/gitlab-workflow.d.ts.map +1 -0
- package/dist/git-service/gitlab-workflow.js +12 -0
- package/dist/git-service/gitlab-workflow.js.map +1 -0
- package/dist/git-service/index.d.ts +30 -0
- package/dist/git-service/index.d.ts.map +1 -0
- package/dist/git-service/index.js +217 -0
- package/dist/git-service/index.js.map +1 -0
- package/dist/git-service/live-branch.d.ts +11 -0
- package/dist/git-service/live-branch.d.ts.map +1 -0
- package/dist/git-service/live-branch.js +171 -0
- package/dist/git-service/live-branch.js.map +1 -0
- package/dist/git-service/managed-excludes.d.ts +36 -0
- package/dist/git-service/managed-excludes.d.ts.map +1 -0
- package/dist/git-service/managed-excludes.js +124 -0
- package/dist/git-service/managed-excludes.js.map +1 -0
- package/dist/git-service/provider-workflow-files.d.ts +12 -0
- package/dist/git-service/provider-workflow-files.d.ts.map +1 -0
- package/dist/git-service/provider-workflow-files.js +36 -0
- package/dist/git-service/provider-workflow-files.js.map +1 -0
- package/dist/git-service/status-sync.d.ts +18 -0
- package/dist/git-service/status-sync.d.ts.map +1 -0
- package/dist/git-service/status-sync.js +32 -0
- package/dist/git-service/status-sync.js.map +1 -0
- package/dist/ids.d.ts +1 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +3 -0
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/inject-index-vite-plugin.d.ts +21 -0
- package/dist/inject-index-vite-plugin.d.ts.map +1 -0
- package/dist/inject-index-vite-plugin.js +130 -0
- package/dist/inject-index-vite-plugin.js.map +1 -0
- package/dist/injected-index.d.ts +9 -2
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +153 -9
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/activity-tracker.d.ts +46 -0
- package/dist/lock-service/activity-tracker.d.ts.map +1 -0
- package/dist/lock-service/activity-tracker.js +119 -0
- package/dist/lock-service/activity-tracker.js.map +1 -0
- package/dist/lock-service/index.d.ts +420 -24
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +1209 -131
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/get-fullstack-template-dir.d.ts +37 -0
- package/dist/migration/get-fullstack-template-dir.d.ts.map +1 -0
- package/dist/migration/get-fullstack-template-dir.js +99 -0
- package/dist/migration/get-fullstack-template-dir.js.map +1 -0
- package/dist/migration/inline-v2-backup-source-files.d.ts +7 -0
- package/dist/migration/inline-v2-backup-source-files.d.ts.map +1 -0
- package/dist/migration/inline-v2-backup-source-files.js +110 -0
- package/dist/migration/inline-v2-backup-source-files.js.map +1 -0
- package/dist/migration/integration-write-policy.d.ts +24 -0
- package/dist/migration/integration-write-policy.d.ts.map +1 -0
- package/dist/migration/integration-write-policy.js +125 -0
- package/dist/migration/integration-write-policy.js.map +1 -0
- package/dist/migration/mark-api-testing-denied.d.ts +27 -0
- package/dist/migration/mark-api-testing-denied.d.ts.map +1 -0
- package/dist/migration/mark-api-testing-denied.js +80 -0
- package/dist/migration/mark-api-testing-denied.js.map +1 -0
- package/dist/migration/migration-checklist.d.ts +80 -0
- package/dist/migration/migration-checklist.d.ts.map +1 -0
- package/dist/migration/migration-checklist.js +150 -0
- package/dist/migration/migration-checklist.js.map +1 -0
- package/dist/migration/migration-classifier.d.ts +4 -0
- package/dist/migration/migration-classifier.d.ts.map +1 -0
- package/dist/migration/migration-classifier.js +87 -0
- package/dist/migration/migration-classifier.js.map +1 -0
- package/dist/migration/migration-metrics.d.ts +74 -0
- package/dist/migration/migration-metrics.d.ts.map +1 -0
- package/dist/migration/migration-metrics.js +124 -0
- package/dist/migration/migration-metrics.js.map +1 -0
- package/dist/migration/migration-routes.d.ts +47 -0
- package/dist/migration/migration-routes.d.ts.map +1 -0
- package/dist/migration/migration-routes.js +1233 -0
- package/dist/migration/migration-routes.js.map +1 -0
- package/dist/migration/migration-session-reconcile.d.ts +24 -0
- package/dist/migration/migration-session-reconcile.d.ts.map +1 -0
- package/dist/migration/migration-session-reconcile.js +139 -0
- package/dist/migration/migration-session-reconcile.js.map +1 -0
- package/dist/migration/migration-verification.d.ts +288 -0
- package/dist/migration/migration-verification.d.ts.map +1 -0
- package/dist/migration/migration-verification.js +1246 -0
- package/dist/migration/migration-verification.js.map +1 -0
- package/dist/migration/recommended-user-deps.d.ts +40 -0
- package/dist/migration/recommended-user-deps.d.ts.map +1 -0
- package/dist/migration/recommended-user-deps.js +209 -0
- package/dist/migration/recommended-user-deps.js.map +1 -0
- package/dist/migration/resolve-v2-backup-path.d.ts +7 -0
- package/dist/migration/resolve-v2-backup-path.d.ts.map +1 -0
- package/dist/migration/resolve-v2-backup-path.js +35 -0
- package/dist/migration/resolve-v2-backup-path.js.map +1 -0
- package/dist/migration/restructure.d.ts +125 -0
- package/dist/migration/restructure.d.ts.map +1 -0
- package/dist/migration/restructure.js +645 -0
- package/dist/migration/restructure.js.map +1 -0
- package/dist/migration/scan-imports.d.ts +7 -0
- package/dist/migration/scan-imports.d.ts.map +1 -0
- package/dist/migration/scan-imports.js +178 -0
- package/dist/migration/scan-imports.js.map +1 -0
- package/dist/migration/translation-prompt.d.ts +23 -0
- package/dist/migration/translation-prompt.d.ts.map +1 -0
- package/dist/migration/translation-prompt.js +36 -0
- package/dist/migration/translation-prompt.js.map +1 -0
- package/dist/migration/unsupported-integrations.d.ts +11 -0
- package/dist/migration/unsupported-integrations.d.ts.map +1 -0
- package/dist/migration/unsupported-integrations.js +206 -0
- package/dist/migration/unsupported-integrations.js.map +1 -0
- 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/.gitignore +50 -0
- package/dist/migration-templates/app-fullstack/client/App.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/components/common/sonner.tsx +20 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +73 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +21 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +197 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +432 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +45 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +117 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +143 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +390 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +259 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +182 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +300 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +129 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +403 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +97 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +66 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +396 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +223 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +284 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +395 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +166 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +133 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +68 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +219 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +55 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +380 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +139 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +345 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +192 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +295 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +69 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +386 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +402 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +86 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +229 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +62 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +234 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +974 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/skeleton.tsx +13 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +198 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +95 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +145 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +87 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +148 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +225 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +150 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +175 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApi.ts +25 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApiData.ts +10 -0
- package/dist/migration-templates/app-fullstack/client/index.css +131 -0
- package/dist/migration-templates/app-fullstack/client/lib/executeApi.ts +9 -0
- package/dist/migration-templates/app-fullstack/client/lib/utils.ts +6 -0
- package/dist/migration-templates/app-fullstack/client/pages/Home/index.tsx +3 -0
- package/dist/migration-templates/app-fullstack/client/root.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/router.tsx +48 -0
- package/dist/migration-templates/app-fullstack/client/types/node.d.ts +9 -0
- package/dist/migration-templates/app-fullstack/components.json +21 -0
- package/dist/migration-templates/app-fullstack/css.d.ts +3 -0
- package/dist/migration-templates/app-fullstack/eslint.config.js +113 -0
- package/dist/migration-templates/app-fullstack/package.json +84 -0
- package/dist/migration-templates/app-fullstack/server/.gitkeep +0 -0
- package/dist/migration-templates/app-fullstack/server/apis/index.ts +22 -0
- package/dist/migration-templates/app-fullstack/server/index.ts +2 -0
- package/dist/migration-templates/app-fullstack/tsconfig.client.json +27 -0
- package/dist/migration-templates/app-fullstack/tsconfig.eslint.json +8 -0
- package/dist/migration-templates/app-fullstack/tsconfig.json +25 -0
- package/dist/migration-templates/app-fullstack/tsconfig.server.json +13 -0
- package/dist/migration-templates/app-fullstack/vite.config.ts +17 -0
- package/dist/npm/apply-package-json-substitutions.d.ts +19 -0
- package/dist/npm/apply-package-json-substitutions.d.ts.map +1 -0
- package/dist/npm/apply-package-json-substitutions.js +108 -0
- package/dist/npm/apply-package-json-substitutions.js.map +1 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.d.ts +15 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.d.ts.map +1 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.js +36 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.js.map +1 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.d.ts +8 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.d.ts.map +1 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.js +44 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.js.map +1 -0
- package/dist/npm/rewrite-platform-workspace-deps.d.ts +17 -0
- package/dist/npm/rewrite-platform-workspace-deps.d.ts.map +1 -0
- package/dist/npm/rewrite-platform-workspace-deps.js +37 -0
- package/dist/npm/rewrite-platform-workspace-deps.js.map +1 -0
- package/dist/operations/operation-processor.d.ts +24 -0
- package/dist/operations/operation-processor.d.ts.map +1 -0
- package/dist/operations/operation-processor.js +80 -0
- package/dist/operations/operation-processor.js.map +1 -0
- package/dist/operations/types.d.ts +8 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +2 -0
- package/dist/operations/types.js.map +1 -0
- package/dist/parsing/bindings.d.ts +1 -1
- package/dist/parsing/bindings.d.ts.map +1 -1
- package/dist/parsing/bindings.js +14 -5
- package/dist/parsing/bindings.js.map +1 -1
- package/dist/parsing/computed/index.d.ts +1 -1
- package/dist/parsing/computed/index.d.ts.map +1 -1
- package/dist/parsing/computed/index.js +1 -1
- package/dist/parsing/computed/index.js.map +1 -1
- package/dist/parsing/computed/to-code-computed.d.ts +2 -1
- package/dist/parsing/computed/to-code-computed.d.ts.map +1 -1
- package/dist/parsing/computed/to-code-computed.js +22 -11
- package/dist/parsing/computed/to-code-computed.js.map +1 -1
- package/dist/parsing/computed/to-value-computed.d.ts +1 -1
- package/dist/parsing/computed/to-value-computed.d.ts.map +1 -1
- package/dist/parsing/computed/to-value-computed.js +19 -7
- package/dist/parsing/computed/to-value-computed.js.map +1 -1
- package/dist/parsing/dim/index.d.ts +1 -1
- package/dist/parsing/dim/index.d.ts.map +1 -1
- package/dist/parsing/dim/index.js +1 -1
- package/dist/parsing/dim/index.js.map +1 -1
- package/dist/parsing/dim/to-value-dimensions.d.ts +2 -1
- package/dist/parsing/dim/to-value-dimensions.d.ts.map +1 -1
- package/dist/parsing/dim/to-value-dimensions.js +4 -3
- package/dist/parsing/dim/to-value-dimensions.js.map +1 -1
- package/dist/parsing/function/index.d.ts +4 -0
- package/dist/parsing/function/index.d.ts.map +1 -0
- package/dist/parsing/function/index.js +7 -0
- package/dist/parsing/function/index.js.map +1 -0
- package/dist/parsing/function/to-code-function.d.ts +2 -0
- package/dist/parsing/function/to-code-function.d.ts.map +1 -0
- package/dist/parsing/function/to-code-function.js +4 -0
- package/dist/parsing/function/to-code-function.js.map +1 -0
- package/dist/parsing/function/to-value-function.d.ts +4 -0
- package/dist/parsing/function/to-value-function.d.ts.map +1 -0
- package/dist/parsing/function/to-value-function.js +33 -0
- package/dist/parsing/function/to-value-function.js.map +1 -0
- package/dist/parsing/ids.d.ts +0 -2
- package/dist/parsing/ids.d.ts.map +1 -1
- package/dist/parsing/ids.js +18 -21
- package/dist/parsing/ids.js.map +1 -1
- package/dist/parsing/imports.d.ts +5 -5
- package/dist/parsing/imports.d.ts.map +1 -1
- package/dist/parsing/imports.js +40 -30
- package/dist/parsing/imports.js.map +1 -1
- package/dist/parsing/index.d.ts +3 -0
- package/dist/parsing/index.d.ts.map +1 -0
- package/dist/parsing/index.js +3 -0
- package/dist/parsing/index.js.map +1 -0
- package/dist/parsing/jsx-utils.d.ts +4 -3
- package/dist/parsing/jsx-utils.d.ts.map +1 -1
- package/dist/parsing/jsx-utils.js +37 -25
- package/dist/parsing/jsx-utils.js.map +1 -1
- package/dist/parsing/jsx.d.ts +25 -11
- package/dist/parsing/jsx.d.ts.map +1 -1
- package/dist/parsing/jsx.js +210 -176
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/parsing/page.d.ts +1 -2
- package/dist/parsing/page.d.ts.map +1 -1
- package/dist/parsing/page.js +297 -122
- package/dist/parsing/page.js.map +1 -1
- package/dist/parsing/parse-tsx-module.d.ts +4 -0
- package/dist/parsing/parse-tsx-module.d.ts.map +1 -0
- package/dist/parsing/parse-tsx-module.js +13 -0
- package/dist/parsing/parse-tsx-module.js.map +1 -0
- package/dist/parsing/properties.d.ts +2 -1
- package/dist/parsing/properties.d.ts.map +1 -1
- package/dist/parsing/properties.js +105 -28
- package/dist/parsing/properties.js.map +1 -1
- package/dist/parsing/sdk-registry.d.ts +17 -0
- package/dist/parsing/sdk-registry.d.ts.map +1 -0
- package/dist/parsing/sdk-registry.js +184 -0
- package/dist/parsing/sdk-registry.js.map +1 -0
- package/dist/parsing/template/index.d.ts +1 -1
- package/dist/parsing/template/index.d.ts.map +1 -1
- package/dist/parsing/template/index.js.map +1 -1
- package/dist/parsing/template/to-code-template.d.ts.map +1 -1
- package/dist/parsing/template/to-code-template.js +1 -2
- package/dist/parsing/template/to-code-template.js.map +1 -1
- package/dist/parsing/type-parsing-registry.d.ts +1 -1
- package/dist/parsing/type-parsing-registry.d.ts.map +1 -1
- package/dist/parsing/type-parsing-registry.js +2 -2
- package/dist/parsing/type-parsing-registry.js.map +1 -1
- package/dist/parsing/types.d.ts +3 -2
- package/dist/parsing/types.d.ts.map +1 -1
- package/dist/parsing/util.d.ts +7 -12
- package/dist/parsing/util.d.ts.map +1 -1
- package/dist/parsing/util.js +98 -81
- package/dist/parsing/util.js.map +1 -1
- package/dist/plugin-options.d.ts +67 -5
- package/dist/plugin-options.d.ts.map +1 -1
- package/dist/plugin-options.js +0 -3
- package/dist/plugin-options.js.map +1 -1
- package/dist/policy-gate-callback-mapper.d.ts +26 -0
- package/dist/policy-gate-callback-mapper.d.ts.map +1 -0
- package/dist/policy-gate-callback-mapper.js +58 -0
- package/dist/policy-gate-callback-mapper.js.map +1 -0
- package/dist/policy-gate-run-registry.d.ts +28 -0
- package/dist/policy-gate-run-registry.d.ts.map +1 -0
- package/dist/policy-gate-run-registry.js +40 -0
- package/dist/policy-gate-run-registry.js.map +1 -0
- package/dist/policy-gate-runner.d.ts +36 -0
- package/dist/policy-gate-runner.d.ts.map +1 -0
- package/dist/policy-gate-runner.js +250 -0
- package/dist/policy-gate-runner.js.map +1 -0
- package/dist/refactor/blocks.d.ts +1 -2
- package/dist/refactor/blocks.d.ts.map +1 -1
- package/dist/refactor/blocks.js +3 -70
- package/dist/refactor/blocks.js.map +1 -1
- package/dist/refactor/entities.d.ts +6 -0
- package/dist/refactor/entities.d.ts.map +1 -0
- package/dist/refactor/entities.js +65 -0
- package/dist/refactor/entities.js.map +1 -0
- package/dist/refactor/javascript.d.ts +1 -1
- package/dist/refactor/javascript.d.ts.map +1 -1
- package/dist/refactor/javascript.js +103 -2
- package/dist/refactor/javascript.js.map +1 -1
- package/dist/rename-manager.d.ts +3 -2
- package/dist/rename-manager.d.ts.map +1 -1
- package/dist/rename-manager.js +35 -14
- package/dist/rename-manager.js.map +1 -1
- package/dist/resolver.d.ts +4 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +27 -0
- package/dist/resolver.js.map +1 -0
- package/dist/router-parser-metrics.d.ts +2 -0
- package/dist/router-parser-metrics.d.ts.map +1 -0
- package/dist/router-parser-metrics.js +13 -0
- package/dist/router-parser-metrics.js.map +1 -0
- package/dist/router-parser.d.ts +41 -0
- package/dist/router-parser.d.ts.map +1 -0
- package/dist/router-parser.js +894 -0
- package/dist/router-parser.js.map +1 -0
- package/dist/scan-scope-merge.d.ts +16 -0
- package/dist/scan-scope-merge.d.ts.map +1 -0
- package/dist/scan-scope-merge.js +90 -0
- package/dist/scan-scope-merge.js.map +1 -0
- package/dist/server-rpc/client.d.ts +11 -0
- package/dist/server-rpc/client.d.ts.map +1 -0
- package/dist/server-rpc/client.js +42 -0
- package/dist/server-rpc/client.js.map +1 -0
- package/dist/server-rpc/handlers.d.ts +3 -0
- package/dist/server-rpc/handlers.d.ts.map +1 -0
- package/dist/server-rpc/handlers.js.map +1 -0
- package/dist/server-rpc/index.d.ts +77 -0
- package/dist/server-rpc/index.d.ts.map +1 -0
- package/dist/server-rpc/index.js +344 -0
- package/dist/server-rpc/index.js.map +1 -0
- package/dist/server-rpc/request-abort-context.d.ts +3 -0
- package/dist/server-rpc/request-abort-context.d.ts.map +1 -0
- package/dist/server-rpc/request-abort-context.js +23 -0
- package/dist/server-rpc/request-abort-context.js.map +1 -0
- package/dist/server-rpc/rpc-invalidate-metrics.d.ts +20 -0
- package/dist/server-rpc/rpc-invalidate-metrics.d.ts.map +1 -0
- package/dist/server-rpc/rpc-invalidate-metrics.js +86 -0
- package/dist/server-rpc/rpc-invalidate-metrics.js.map +1 -0
- package/dist/snapshot-routes.d.ts +18 -0
- package/dist/snapshot-routes.d.ts.map +1 -0
- package/dist/snapshot-routes.js +247 -0
- package/dist/snapshot-routes.js.map +1 -0
- package/dist/socket-manager.d.ts +145 -17
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +1730 -82
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts +23 -158
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +78 -877
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/checkpoint-result.d.ts +22 -0
- package/dist/sync-service/checkpoint-result.d.ts.map +1 -0
- package/dist/sync-service/checkpoint-result.js +22 -0
- package/dist/sync-service/checkpoint-result.js.map +1 -0
- package/dist/sync-service/download.d.ts +23 -6
- package/dist/sync-service/download.d.ts.map +1 -1
- package/dist/sync-service/download.js +234 -33
- package/dist/sync-service/download.js.map +1 -1
- package/dist/sync-service/draft-helpers.d.ts +17 -1
- package/dist/sync-service/draft-helpers.d.ts.map +1 -1
- package/dist/sync-service/draft-helpers.js +193 -114
- package/dist/sync-service/draft-helpers.js.map +1 -1
- package/dist/sync-service/draft-reconcile.d.ts +22 -0
- package/dist/sync-service/draft-reconcile.d.ts.map +1 -0
- package/dist/sync-service/draft-reconcile.js +24 -0
- package/dist/sync-service/draft-reconcile.js.map +1 -0
- package/dist/sync-service/draft-state-report-metrics.d.ts +2 -0
- package/dist/sync-service/draft-state-report-metrics.d.ts.map +1 -0
- package/dist/sync-service/draft-state-report-metrics.js +27 -0
- package/dist/sync-service/draft-state-report-metrics.js.map +1 -0
- package/dist/sync-service/hash-cache.d.ts +1 -0
- package/dist/sync-service/hash-cache.d.ts.map +1 -1
- package/dist/sync-service/hash-cache.js +4 -0
- package/dist/sync-service/hash-cache.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 +250 -20
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +868 -123
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts +2 -2
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +93 -29
- 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/sync-service/snapshot/upload-snapshot.d.ts +2 -2
- package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.js +21 -1
- package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +21 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/util/ignore-patterns.d.ts +9 -0
- package/dist/util/ignore-patterns.d.ts.map +1 -0
- package/dist/util/ignore-patterns.js +53 -0
- package/dist/util/ignore-patterns.js.map +1 -0
- package/dist/util/log-sanitizer.d.ts +44 -0
- package/dist/util/log-sanitizer.d.ts.map +1 -0
- package/dist/util/log-sanitizer.js +209 -0
- package/dist/util/log-sanitizer.js.map +1 -0
- package/dist/util/logger.d.ts +58 -17
- package/dist/util/logger.d.ts.map +1 -1
- package/dist/util/logger.js +617 -40
- package/dist/util/logger.js.map +1 -1
- package/dist/util/open-api.d.ts +9 -0
- package/dist/util/open-api.d.ts.map +1 -0
- package/dist/util/open-api.js +2 -0
- package/dist/util/open-api.js.map +1 -0
- package/dist/util/operation-queue.d.ts +7 -1
- package/dist/util/operation-queue.d.ts.map +1 -1
- package/dist/util/operation-queue.js +5 -0
- package/dist/util/operation-queue.js.map +1 -1
- package/dist/util/summarize-for-logging.d.ts +14 -0
- package/dist/util/summarize-for-logging.d.ts.map +1 -0
- package/dist/util/summarize-for-logging.js +94 -0
- package/dist/util/summarize-for-logging.js.map +1 -0
- package/dist/util.d.ts +17 -18
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +46 -112
- package/dist/util.js.map +1 -1
- package/dist/virtual-modules.d.ts +5 -0
- package/dist/virtual-modules.d.ts.map +1 -0
- package/dist/virtual-modules.js +5 -0
- package/dist/virtual-modules.js.map +1 -0
- package/dist/vite-plugin-yaml-types.d.ts +15 -0
- package/dist/vite-plugin-yaml-types.d.ts.map +1 -0
- package/dist/vite-plugin-yaml-types.js +187 -0
- package/dist/vite-plugin-yaml-types.js.map +1 -0
- package/package.json +131 -65
- package/dist/ai-service/artifacts/bolt.d.ts +0 -8
- package/dist/ai-service/artifacts/bolt.d.ts.map +0 -1
- package/dist/ai-service/artifacts/bolt.js +0 -34
- package/dist/ai-service/artifacts/bolt.js.map +0 -1
- package/dist/ai-service/eval/template-renderer.d.ts +0 -13
- package/dist/ai-service/eval/template-renderer.d.ts.map +0 -1
- package/dist/ai-service/eval/template-renderer.js +0 -67
- package/dist/ai-service/eval/template-renderer.js.map +0 -1
- package/dist/ai-service/integrations/const.d.ts +0 -41
- package/dist/ai-service/integrations/const.d.ts.map +0 -1
- package/dist/ai-service/integrations/const.js +0 -76
- package/dist/ai-service/integrations/const.js.map +0 -1
- package/dist/ai-service/integrations/from-prompt-context.d.ts +0 -4
- package/dist/ai-service/integrations/from-prompt-context.d.ts.map +0 -1
- package/dist/ai-service/integrations/from-prompt-context.js +0 -56
- package/dist/ai-service/integrations/from-prompt-context.js.map +0 -1
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts +0 -3
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts.map +0 -1
- package/dist/ai-service/integrations/to-sdk-prompt.js +0 -45
- package/dist/ai-service/integrations/to-sdk-prompt.js.map +0 -1
- package/dist/ai-service/integrations/types.d.ts +0 -31
- package/dist/ai-service/integrations/types.d.ts.map +0 -1
- package/dist/ai-service/integrations/types.js.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts +0 -2
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js +0 -386
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts +0 -2
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js +0 -219
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js.map +0 -1
- package/dist/ai-service/prompts/generated/index.d.ts +0 -4
- package/dist/ai-service/prompts/generated/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/index.js +0 -6
- package/dist/ai-service/prompts/generated/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/index.d.ts +0 -17
- package/dist/ai-service/prompts/generated/library-components/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/index.js +0 -19
- package/dist/ai-service/prompts/generated/library-components/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js +0 -6
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js +0 -6
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts +0 -3
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/index.js +0 -5
- package/dist/ai-service/prompts/generated/library-typedefs/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts +0 -11
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/index.js +0 -13
- package/dist/ai-service/prompts/generated/subprompts/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/system.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/system.js.map +0 -1
- package/dist/ai-service/prompts/markdown-loader.d.ts +0 -10
- package/dist/ai-service/prompts/markdown-loader.d.ts.map +0 -1
- package/dist/ai-service/prompts/markdown-loader.js +0 -71
- package/dist/ai-service/prompts/markdown-loader.js.map +0 -1
- package/dist/ai-service/prompts/system.d.ts +0 -2
- package/dist/ai-service/prompts/system.d.ts.map +0 -1
- package/dist/ai-service/prompts/system.js +0 -152
- package/dist/ai-service/prompts/system.js.map +0 -1
- package/dist/ai-service/result-buffer/bolt.d.ts +0 -15
- package/dist/ai-service/result-buffer/bolt.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/bolt.js +0 -73
- package/dist/ai-service/result-buffer/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/shared.d.ts +0 -13
- package/dist/ai-service/result-buffer/shared.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/shared.js +0 -7
- package/dist/ai-service/result-buffer/shared.js.map +0 -1
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts +0 -21
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts.map +0 -1
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js +0 -48
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js.map +0 -1
- package/dist/binding-extraction/extract-js-identifiers.d.ts +0 -19
- package/dist/binding-extraction/extract-js-identifiers.d.ts.map +0 -1
- package/dist/binding-extraction/extract-js-identifiers.js +0 -161
- package/dist/binding-extraction/extract-js-identifiers.js.map +0 -1
- package/dist/binding-extraction/extract-py-identifiers.d.ts +0 -4
- package/dist/binding-extraction/extract-py-identifiers.d.ts.map +0 -1
- package/dist/binding-extraction/extract-py-identifiers.js +0 -161
- package/dist/binding-extraction/extract-py-identifiers.js.map +0 -1
- package/dist/parsing/entity/index.d.ts +0 -7
- package/dist/parsing/entity/index.d.ts.map +0 -1
- package/dist/parsing/entity/index.js +0 -7
- package/dist/parsing/entity/index.js.map +0 -1
- package/dist/parsing/entity/to-code-entity.d.ts +0 -3
- package/dist/parsing/entity/to-code-entity.d.ts.map +0 -1
- package/dist/parsing/entity/to-code-entity.js +0 -41
- package/dist/parsing/entity/to-code-entity.js.map +0 -1
- package/dist/parsing/entity/to-value-entity.d.ts +0 -8
- package/dist/parsing/entity/to-value-entity.d.ts.map +0 -1
- package/dist/parsing/entity/to-value-entity.js +0 -120
- package/dist/parsing/entity/to-value-entity.js.map +0 -1
- package/dist/parsing/events/index.d.ts +0 -5
- package/dist/parsing/events/index.d.ts.map +0 -1
- package/dist/parsing/events/index.js +0 -7
- package/dist/parsing/events/index.js.map +0 -1
- package/dist/parsing/events/to-code-events.d.ts +0 -3
- package/dist/parsing/events/to-code-events.d.ts.map +0 -1
- package/dist/parsing/events/to-code-events.js +0 -114
- package/dist/parsing/events/to-code-events.js.map +0 -1
- package/dist/parsing/events/to-value-events.d.ts +0 -6
- package/dist/parsing/events/to-value-events.d.ts.map +0 -1
- package/dist/parsing/events/to-value-events.js +0 -221
- package/dist/parsing/events/to-value-events.js.map +0 -1
- package/dist/parsing/scope.d.ts +0 -90
- package/dist/parsing/scope.d.ts.map +0 -1
- package/dist/parsing/scope.js +0 -669
- package/dist/parsing/scope.js.map +0 -1
- package/dist/parsing/theme.d.ts +0 -3
- package/dist/parsing/theme.d.ts.map +0 -1
- package/dist/parsing/theme.js +0 -87
- package/dist/parsing/theme.js.map +0 -1
- package/dist/refactor-jsx.d.ts +0 -28
- package/dist/refactor-jsx.d.ts.map +0 -1
- package/dist/refactor-jsx.js +0 -77
- package/dist/refactor-jsx.js.map +0 -1
- package/dist/routing.d.ts +0 -6
- package/dist/routing.d.ts.map +0 -1
- package/dist/routing.js +0 -76
- package/dist/routing.js.map +0 -1
- package/dist/sb-scope-manager.d.ts +0 -102
- package/dist/sb-scope-manager.d.ts.map +0 -1
- package/dist/sb-scope-manager.js +0 -507
- package/dist/sb-scope-manager.js.map +0 -1
- package/dist/sync-service/server-rpc/client.d.ts +0 -13
- package/dist/sync-service/server-rpc/client.d.ts.map +0 -1
- package/dist/sync-service/server-rpc/client.js +0 -65
- package/dist/sync-service/server-rpc/client.js.map +0 -1
- package/dist/sync-service/server-rpc/handlers.d.ts +0 -3
- package/dist/sync-service/server-rpc/handlers.d.ts.map +0 -1
- package/dist/sync-service/server-rpc/handlers.js.map +0 -1
- package/dist/util/tracing.d.ts +0 -4
- package/dist/util/tracing.d.ts.map +0 -1
- package/dist/util/tracing.js +0 -56
- package/dist/util/tracing.js.map +0 -1
- /package/dist/ai-service/{integrations → agent/subagents/apis}/types.js +0 -0
- /package/dist/{sync-service/server-rpc → server-rpc}/handlers.js +0 -0
|
@@ -1,81 +1,2607 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { exec, execFile } from "node:child_process";
|
|
36
|
+
import { readFile as fsReadFile, mkdir, writeFile, access, rm, stat, readdir, } from "node:fs/promises";
|
|
3
37
|
import * as path from "node:path";
|
|
38
|
+
import { promisify } from "node:util";
|
|
39
|
+
import { metrics } from "@opentelemetry/api";
|
|
4
40
|
import { glob } from "glob";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
41
|
+
import JSON5 from "json5";
|
|
42
|
+
import { detect, resolveCommand } from "package-manager-detector";
|
|
43
|
+
import semver from "semver";
|
|
44
|
+
import { normalizePath } from "vite";
|
|
45
|
+
import { isProtectedCorePackage, isValidNpmPackageName, isValidNpmVersionSpec, } from "@superblocksteam/library-shared/types";
|
|
46
|
+
import { bucketNpmRegistryHost, recordNpmInstall, } from "@superblocksteam/telemetry";
|
|
47
|
+
import { applyPackageJsonSubstitutions, readDeclaredDependencies, } from "../../npm/apply-package-json-substitutions.js";
|
|
48
|
+
import { preparePackageJsonForCloudNpm } from "../../npm/prepare-package-json-for-cloud-npm.js";
|
|
49
|
+
import { parseTsxModule } from "../../parsing/parse-tsx-module.js";
|
|
50
|
+
import { getErrorMeta, getLogger } from "../../util/logger.js";
|
|
51
|
+
import { ToolExecutionError } from "../agent/tools2/types.js";
|
|
52
|
+
import llmobs from "../llmobs/index.js";
|
|
53
|
+
import { fixLucideDynamicTypeImports, isFixableLucidePath, } from "../transform/lucide-dynamic-type-imports/transformer.js";
|
|
54
|
+
import { NpmInstallBlocked, NpmInstallError, scrubSecrets, } from "../types.js";
|
|
55
|
+
import { execCancellable } from "./cancellable-exec.js";
|
|
56
|
+
import { CLARK_APP_BLACKLIST_PATTERNS, APPLICATION_FILE_PATTERNS, STANDARD_IGNORE_PATTERNS, } from "./constants.js";
|
|
57
|
+
import { DraftManager, validateFileOperation, } from "./filesystem/index.js";
|
|
58
|
+
import { Linter } from "./linter.js";
|
|
59
|
+
import { parseNpmJsonDiagnostic, parseNpmJsonError, parseNpmJsonSuccess, } from "./npm-error-parser.js";
|
|
60
|
+
import { prepareForPrivateRegistry, shouldIgnoreInstallScripts, } from "./npm-registry.js";
|
|
61
|
+
import { applyPackageSubstitutions, runVulnerabilityGate, } from "./vulnerability-gate.js";
|
|
62
|
+
const execPromise = promisify(exec);
|
|
63
|
+
const execFilePromise = promisify(execFile);
|
|
64
|
+
// `npm install --json` emits the full install summary on stdout. The default
|
|
65
|
+
// 1 MiB exec buffer can be exceeded for fat dependency trees, which would
|
|
66
|
+
// fail a successful install with ERR_CHILD_PROCESS_STDIO_MAXBUFFER and reach
|
|
67
|
+
// `classifyNpmExecError` with truncated stdout — defeating the `--json`
|
|
68
|
+
// error-envelope contract these entry points depend on. 4 MiB comfortably
|
|
69
|
+
// covers real-world npm summaries (per-package entries are tiny) while
|
|
70
|
+
// keeping the worst-case buffer + parsed-object peak bounded.
|
|
71
|
+
const NPM_JSON_MAX_BUFFER = 4 * 1024 * 1024;
|
|
72
|
+
/** Lowest version a declared range admits; skips `workspace:`/`file:`/`*`/git. */
|
|
73
|
+
function declaredRangeFloor(range) {
|
|
74
|
+
if (range == null || semver.validRange(range) == null)
|
|
75
|
+
return null;
|
|
76
|
+
const floor = semver.minVersion(range);
|
|
77
|
+
if (floor == null)
|
|
78
|
+
return null;
|
|
79
|
+
// `*` floors to 0.0.0; an exact `0.0.0` pin is real.
|
|
80
|
+
if (floor.version === "0.0.0" && semver.valid(range) == null)
|
|
81
|
+
return null;
|
|
82
|
+
return floor.version;
|
|
83
|
+
}
|
|
84
|
+
function emitIndexUnavailableMetric() {
|
|
85
|
+
metrics
|
|
86
|
+
.getMeter("superblocks.clark.pkg_security")
|
|
87
|
+
.createCounter("superblocks.clark.pkg_security.index_unavailable", {
|
|
88
|
+
description: "Vulnerability index unavailable during Clark package-install gate",
|
|
89
|
+
})
|
|
90
|
+
.add(1);
|
|
91
|
+
}
|
|
92
|
+
function emitWriteTsxParseRejectedMetric(extension) {
|
|
93
|
+
metrics
|
|
94
|
+
.getMeter("superblocks.clark.write")
|
|
95
|
+
.createCounter("superblocks.clark.write.tsx_parse_rejected", {
|
|
96
|
+
description: "Clark write rejected because TypeScript source failed Babel parse",
|
|
97
|
+
})
|
|
98
|
+
.add(1, { extension });
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* npm `--json` stdout can be prefixed with non-JSON status lines on some
|
|
102
|
+
* versions (`add foo 1.2.3\n{...}`). Slice from the first `{`.
|
|
103
|
+
*/
|
|
104
|
+
function parseNpmJsonStdout(stdout) {
|
|
105
|
+
if (typeof stdout !== "string" || stdout.length === 0) {
|
|
106
|
+
throw new Error("npm --json stdout contained no JSON object");
|
|
12
107
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
ignore: ["node_modules/**", "dist/**", "build/**", ".superblocks/**"],
|
|
17
|
-
nodir: true,
|
|
18
|
-
cwd: this.appRootDirPath,
|
|
19
|
-
...globOptions,
|
|
20
|
-
});
|
|
21
|
-
return await Promise.all(files.map(async (file) => ({
|
|
22
|
-
type: "file",
|
|
23
|
-
filePath: path.relative(this.appRootDirPath, file),
|
|
24
|
-
content: await readFile(file, "utf-8"),
|
|
25
|
-
})));
|
|
26
|
-
});
|
|
108
|
+
const start = stdout.indexOf("{");
|
|
109
|
+
if (start < 0) {
|
|
110
|
+
throw new Error("npm --json stdout contained no JSON object");
|
|
27
111
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
112
|
+
return JSON.parse(stdout.slice(start));
|
|
113
|
+
}
|
|
114
|
+
/** True for npm `--json` failure bodies (`{ "error": ... }`), not dry-run trees. */
|
|
115
|
+
function isNpmErrorEnvelope(parsed) {
|
|
116
|
+
if (parsed == null || typeof parsed !== "object")
|
|
117
|
+
return false;
|
|
118
|
+
if (!("error" in parsed))
|
|
119
|
+
return false;
|
|
120
|
+
return parsed.error != null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* True for an npm dry-run entry installed into the app's own `node_modules`
|
|
124
|
+
* (`<app>/node_modules/lodash`) rather than nested under a dependency
|
|
125
|
+
* (`<app>/node_modules/@scope/library/node_modules/lodash`). npm omits `path`
|
|
126
|
+
* on some shapes; treat those as top-level so a missing field cannot hide a
|
|
127
|
+
* package from the top-level CVE checks.
|
|
128
|
+
*/
|
|
129
|
+
function isRootNodeModulesPath(entryPath) {
|
|
130
|
+
if (typeof entryPath !== "string" || entryPath.length === 0)
|
|
131
|
+
return true;
|
|
132
|
+
return entryPath.replace(/\\/g, "/").split("/node_modules/").length <= 2;
|
|
133
|
+
}
|
|
134
|
+
function packageNameFromLockPath(lockPath) {
|
|
135
|
+
if (!lockPath)
|
|
136
|
+
return undefined;
|
|
137
|
+
const marker = "node_modules/";
|
|
138
|
+
const idx = lockPath.lastIndexOf(marker);
|
|
139
|
+
if (idx < 0)
|
|
140
|
+
return undefined;
|
|
141
|
+
const name = lockPath.slice(idx + marker.length);
|
|
142
|
+
return name.length > 0 ? name : undefined;
|
|
143
|
+
}
|
|
144
|
+
function isPackageLookupResult(value) {
|
|
145
|
+
if (value == null || typeof value !== "object")
|
|
146
|
+
return false;
|
|
147
|
+
const record = value;
|
|
148
|
+
return (typeof record.name === "string" &&
|
|
149
|
+
typeof record.version === "string" &&
|
|
150
|
+
typeof record.hasMalware === "boolean" &&
|
|
151
|
+
Array.isArray(record.advisories));
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Map an install failure to a value in the closed `npm.outcome` enum
|
|
155
|
+
* (APPS-4189). `NpmInstallBlocked` carries the structured reason from
|
|
156
|
+
* P1.2; anything else is bucketed as `other` at the metric boundary.
|
|
157
|
+
* `normalizeNpmOutcome` enforces the allowlist a second time downstream
|
|
158
|
+
* so a stray reason value cannot leak past the emit boundary.
|
|
159
|
+
*/
|
|
160
|
+
function outcomeFromInstallError(err) {
|
|
161
|
+
if (err instanceof NpmInstallBlocked)
|
|
162
|
+
return err.reason;
|
|
163
|
+
return "other";
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Pick the registry URL the install actually targeted from the most-recent
|
|
167
|
+
* `prepareForPrivateRegistry` / `maybeWriteNpmrcForDir` result. Returns
|
|
168
|
+
* `undefined` (→ `registry_host=unknown`) when no configured row was in
|
|
169
|
+
* effect, including the `unreachable` and `not-configured` cases — those
|
|
170
|
+
* are deliberately reported as `unknown` rather than guessed at public
|
|
171
|
+
* npm, so the dashboard signal "did private-registry routing actually
|
|
172
|
+
* fire?" stays honest.
|
|
173
|
+
*/
|
|
174
|
+
function registryUrlFromFetchResult(result) {
|
|
175
|
+
if (!result)
|
|
176
|
+
return undefined;
|
|
177
|
+
if (!result.config.configured)
|
|
178
|
+
return undefined;
|
|
179
|
+
return result.config.default?.url;
|
|
180
|
+
}
|
|
181
|
+
const DEFAULT_COPY_DIRECTORY_EXCLUDES = new Set([
|
|
182
|
+
".git",
|
|
183
|
+
".next",
|
|
184
|
+
"build",
|
|
185
|
+
"dist",
|
|
186
|
+
"node_modules",
|
|
187
|
+
]);
|
|
188
|
+
/**
|
|
189
|
+
* AppShell provides the primary interface for the AI agent to interact
|
|
190
|
+
* with the application environment.
|
|
191
|
+
*
|
|
192
|
+
* It encapsulates:
|
|
193
|
+
* - File system operations (read, write, delete, list, rename)
|
|
194
|
+
* - Virtual file abstraction (APIs appear as single .ts files)
|
|
195
|
+
* - Draft management for undo/redo capability
|
|
196
|
+
* - Code quality tools (linting, type checking)
|
|
197
|
+
* - Package management
|
|
198
|
+
*/
|
|
199
|
+
let AppShell = (() => {
|
|
200
|
+
let _instanceExtraInitializers = [];
|
|
201
|
+
let _readFiles_decorators;
|
|
202
|
+
let _runTypecheck_decorators;
|
|
203
|
+
let _runLinter_decorators;
|
|
204
|
+
let _warmLinterCache_decorators;
|
|
205
|
+
let _runNpmInstall_decorators;
|
|
206
|
+
let _runPackageManagerInstall_decorators;
|
|
207
|
+
let _installSpecificPackages_decorators;
|
|
208
|
+
let _uninstallPackages_decorators;
|
|
209
|
+
let _saveGeneratedArtifact_decorators;
|
|
210
|
+
let _readFile_decorators;
|
|
211
|
+
let _writeFile_decorators;
|
|
212
|
+
let _copyFile_decorators;
|
|
213
|
+
let _copyDirectory_decorators;
|
|
214
|
+
let _deleteFile_decorators;
|
|
215
|
+
let _listFiles_decorators;
|
|
216
|
+
let _listFilesInternal_decorators;
|
|
217
|
+
let _renameFile_decorators;
|
|
218
|
+
return class AppShell {
|
|
219
|
+
static {
|
|
220
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
221
|
+
_readFiles_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.readFiles" })];
|
|
222
|
+
_runTypecheck_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.runTypecheck" })];
|
|
223
|
+
_runLinter_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.runLinter" })];
|
|
224
|
+
_warmLinterCache_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.warmLinterCache" })];
|
|
225
|
+
_runNpmInstall_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.runNpmInstall" })];
|
|
226
|
+
_runPackageManagerInstall_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.runPackageManagerInstall" })];
|
|
227
|
+
_installSpecificPackages_decorators = [llmobs.decorate({
|
|
228
|
+
kind: "task",
|
|
229
|
+
name: "AppShell.installSpecificPackages",
|
|
230
|
+
})];
|
|
231
|
+
_uninstallPackages_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.uninstallPackages" })];
|
|
232
|
+
_saveGeneratedArtifact_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.saveGeneratedArtifact" })];
|
|
233
|
+
_readFile_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.readFile" })];
|
|
234
|
+
_writeFile_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.writeFile" })];
|
|
235
|
+
_copyFile_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.copyFile" })];
|
|
236
|
+
_copyDirectory_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.copyDirectory" })];
|
|
237
|
+
_deleteFile_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.deleteFile" })];
|
|
238
|
+
_listFiles_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.listFiles" })];
|
|
239
|
+
_listFilesInternal_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.listFilesInternal" })];
|
|
240
|
+
_renameFile_decorators = [llmobs.decorate({ kind: "task", name: "AppShell.renameFile" })];
|
|
241
|
+
__esDecorate(this, null, _readFiles_decorators, { kind: "method", name: "readFiles", static: false, private: false, access: { has: obj => "readFiles" in obj, get: obj => obj.readFiles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
242
|
+
__esDecorate(this, null, _runTypecheck_decorators, { kind: "method", name: "runTypecheck", static: false, private: false, access: { has: obj => "runTypecheck" in obj, get: obj => obj.runTypecheck }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
243
|
+
__esDecorate(this, null, _runLinter_decorators, { kind: "method", name: "runLinter", static: false, private: false, access: { has: obj => "runLinter" in obj, get: obj => obj.runLinter }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
244
|
+
__esDecorate(this, null, _warmLinterCache_decorators, { kind: "method", name: "warmLinterCache", static: false, private: false, access: { has: obj => "warmLinterCache" in obj, get: obj => obj.warmLinterCache }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
245
|
+
__esDecorate(this, null, _runNpmInstall_decorators, { kind: "method", name: "runNpmInstall", static: false, private: false, access: { has: obj => "runNpmInstall" in obj, get: obj => obj.runNpmInstall }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
246
|
+
__esDecorate(this, null, _runPackageManagerInstall_decorators, { kind: "method", name: "runPackageManagerInstall", static: false, private: false, access: { has: obj => "runPackageManagerInstall" in obj, get: obj => obj.runPackageManagerInstall }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
247
|
+
__esDecorate(this, null, _installSpecificPackages_decorators, { kind: "method", name: "installSpecificPackages", static: false, private: false, access: { has: obj => "installSpecificPackages" in obj, get: obj => obj.installSpecificPackages }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
248
|
+
__esDecorate(this, null, _uninstallPackages_decorators, { kind: "method", name: "uninstallPackages", static: false, private: false, access: { has: obj => "uninstallPackages" in obj, get: obj => obj.uninstallPackages }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
249
|
+
__esDecorate(this, null, _saveGeneratedArtifact_decorators, { kind: "method", name: "saveGeneratedArtifact", static: false, private: false, access: { has: obj => "saveGeneratedArtifact" in obj, get: obj => obj.saveGeneratedArtifact }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
250
|
+
__esDecorate(this, null, _readFile_decorators, { kind: "method", name: "readFile", static: false, private: false, access: { has: obj => "readFile" in obj, get: obj => obj.readFile }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
251
|
+
__esDecorate(this, null, _writeFile_decorators, { kind: "method", name: "writeFile", static: false, private: false, access: { has: obj => "writeFile" in obj, get: obj => obj.writeFile }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
252
|
+
__esDecorate(this, null, _copyFile_decorators, { kind: "method", name: "copyFile", static: false, private: false, access: { has: obj => "copyFile" in obj, get: obj => obj.copyFile }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
253
|
+
__esDecorate(this, null, _copyDirectory_decorators, { kind: "method", name: "copyDirectory", static: false, private: false, access: { has: obj => "copyDirectory" in obj, get: obj => obj.copyDirectory }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
254
|
+
__esDecorate(this, null, _deleteFile_decorators, { kind: "method", name: "deleteFile", static: false, private: false, access: { has: obj => "deleteFile" in obj, get: obj => obj.deleteFile }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
255
|
+
__esDecorate(this, null, _listFiles_decorators, { kind: "method", name: "listFiles", static: false, private: false, access: { has: obj => "listFiles" in obj, get: obj => obj.listFiles }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
256
|
+
__esDecorate(this, null, _listFilesInternal_decorators, { kind: "method", name: "listFilesInternal", static: false, private: false, access: { has: obj => "listFilesInternal" in obj, get: obj => obj.listFilesInternal }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
257
|
+
__esDecorate(this, null, _renameFile_decorators, { kind: "method", name: "renameFile", static: false, private: false, access: { has: obj => "renameFile" in obj, get: obj => obj.renameFile }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
258
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
259
|
+
}
|
|
260
|
+
appRootDirPath = __runInitializers(this, _instanceExtraInitializers);
|
|
261
|
+
fsOperationQueue;
|
|
262
|
+
linter;
|
|
263
|
+
messageSender;
|
|
264
|
+
draftManager;
|
|
265
|
+
templateRenderer;
|
|
266
|
+
virtualFs;
|
|
267
|
+
pathValidator;
|
|
268
|
+
enableDeletingLockfiles;
|
|
269
|
+
/**
|
|
270
|
+
* Resolves the per-org npm registry config at install time. The AiService
|
|
271
|
+
* always constructs one in production (SaaS, local dev, and ephemeral
|
|
272
|
+
* pods); the LD flag (`superblocks.npm-registry.enabled`) inside the
|
|
273
|
+
* client decides whether to short-circuit to "not-configured" without a
|
|
274
|
+
* server call. `undefined` here is the test-only path (or callers that
|
|
275
|
+
* deliberately opt out): every `.npmrc` helper becomes a no-op and the
|
|
276
|
+
* install runs against npm's default resolution.
|
|
277
|
+
*/
|
|
278
|
+
npmRegistryClient;
|
|
279
|
+
/**
|
|
280
|
+
* Optional sink for npm-install-blocked audit events (APPS-4191 / P6.3).
|
|
281
|
+
* The AiService injects a reporter bound to the org/app socket connection;
|
|
282
|
+
* `undefined` (tests, callers that opt out) makes the audit emit a no-op.
|
|
283
|
+
* The reporter is fire-and-forget — see `maybeReportBlockedInstall`.
|
|
284
|
+
*/
|
|
285
|
+
reportNpmInstallBlocked;
|
|
286
|
+
/**
|
|
287
|
+
* Optional sink for privacy-safe install-gate USER_EVENT reports. One call
|
|
288
|
+
* per gated AppShell install (`install_all` / `install_specific`) with
|
|
289
|
+
* outcome + runner only. Prefetch and uninstall never report.
|
|
290
|
+
*/
|
|
291
|
+
reportNpmInstallOutcome;
|
|
292
|
+
/**
|
|
293
|
+
* Optional deps for the install-time vulnerability index lookup.
|
|
294
|
+
* When absent the malware/CVE gate is skipped (test fixtures / deliberate
|
|
295
|
+
* opt-out). Production AiService always wires these.
|
|
296
|
+
*/
|
|
297
|
+
packageLookup;
|
|
298
|
+
/**
|
|
299
|
+
* Tracks files that must be read before they can be written.
|
|
300
|
+
* Used to enforce read-before-write pattern for AI safety.
|
|
301
|
+
*/
|
|
302
|
+
requiredReads = new Set();
|
|
303
|
+
constructor({ appRootDirPath, fsOperationQueue, messageSender, draftInterface, templateRenderer, virtualFileSystem, pathValidator, enableDeletingLockfiles, npmRegistryClient, reportNpmInstallBlocked, reportNpmInstallOutcome, packageLookup, }) {
|
|
304
|
+
// Normalize path to handle Windows drive letter case
|
|
305
|
+
this.appRootDirPath = normalizePath(appRootDirPath);
|
|
306
|
+
this.fsOperationQueue = fsOperationQueue;
|
|
307
|
+
this.linter = new Linter(this.appRootDirPath);
|
|
308
|
+
this.messageSender = messageSender;
|
|
309
|
+
this.draftManager = draftInterface
|
|
310
|
+
? new DraftManager(draftInterface)
|
|
311
|
+
: undefined;
|
|
312
|
+
this.templateRenderer = templateRenderer;
|
|
313
|
+
this.virtualFs = virtualFileSystem;
|
|
314
|
+
this.pathValidator = pathValidator;
|
|
315
|
+
this.enableDeletingLockfiles = enableDeletingLockfiles ?? false;
|
|
316
|
+
this.npmRegistryClient = npmRegistryClient;
|
|
317
|
+
this.reportNpmInstallBlocked = reportNpmInstallBlocked;
|
|
318
|
+
this.reportNpmInstallOutcome = reportNpmInstallOutcome;
|
|
319
|
+
this.packageLookup = packageLookup;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Toggle the API virtual-file projection. When disabled, reads to `apis/*`
|
|
323
|
+
* bypass the YAML→TS transformer and fall through to raw disk, which is what
|
|
324
|
+
* v2→v3 migration needs so Clark sees the original YAML sources.
|
|
325
|
+
*/
|
|
326
|
+
setApiHandlerEnabled(enabled) {
|
|
327
|
+
this.virtualFs.setHandlerEnabled("api", enabled);
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Enqueue a filesystem operation and annotate queue timing in llmobs.
|
|
331
|
+
* This helps separate queue contention from operation execution time.
|
|
332
|
+
*/
|
|
333
|
+
async enqueueFsOperation(operationName, operation, metadata) {
|
|
334
|
+
const enqueuedAt = performance.now();
|
|
335
|
+
return await this.fsOperationQueue.enqueue(async () => {
|
|
336
|
+
const startedAt = performance.now();
|
|
337
|
+
const queueWaitMs = Math.round(startedAt - enqueuedAt);
|
|
338
|
+
try {
|
|
339
|
+
return await operation();
|
|
340
|
+
}
|
|
341
|
+
finally {
|
|
342
|
+
const executeMs = Math.round(performance.now() - startedAt);
|
|
343
|
+
llmobs.annotate({
|
|
344
|
+
metadata: {
|
|
345
|
+
appShellQueueExecuteMs: executeMs,
|
|
346
|
+
appShellQueueOperation: operationName,
|
|
347
|
+
appShellQueueWaitMs: queueWaitMs,
|
|
348
|
+
...(metadata ?? {}),
|
|
349
|
+
},
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
async readFiles(patterns, globOptions, enableAppBlacklist = true) {
|
|
355
|
+
return await this.enqueueFsOperation("readFiles", async () => {
|
|
356
|
+
// Get file list with virtual path conversion (physical API paths → virtual paths)
|
|
357
|
+
const files = await this.listFilesInternal(patterns, globOptions);
|
|
358
|
+
// Compute blacklisted files (regular component files like Button, Input)
|
|
359
|
+
const blacklistedFiles = enableAppBlacklist
|
|
360
|
+
? new Set(await glob(Array.from(CLARK_APP_BLACKLIST_PATTERNS), {
|
|
361
|
+
nodir: true,
|
|
362
|
+
cwd: this.appRootDirPath,
|
|
363
|
+
ignore: [...STANDARD_IGNORE_PATTERNS],
|
|
364
|
+
}))
|
|
365
|
+
: new Set();
|
|
366
|
+
return await Promise.all(files.map(async (file) => {
|
|
367
|
+
const isBlacklisted = blacklistedFiles.has(file);
|
|
368
|
+
const content = isBlacklisted
|
|
369
|
+
? "<… file contents omitted …>" // TODO(mark): could we just return the exported lines?
|
|
370
|
+
: await this.readFileInternal(file);
|
|
371
|
+
return {
|
|
372
|
+
type: "file",
|
|
373
|
+
filePath: file,
|
|
374
|
+
content,
|
|
375
|
+
};
|
|
376
|
+
}));
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
async runTypecheck(abortSignal) {
|
|
380
|
+
const output = await this.runTypecheckRawOutput(abortSignal);
|
|
381
|
+
if (!output) {
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
const parsed = output.split("\n").reduce((acc, line) => {
|
|
385
|
+
const [filePath, _rest] = line.split("(");
|
|
386
|
+
if (filePath && filePath.trim() !== "") {
|
|
387
|
+
acc[filePath] = [...(acc[filePath] || []), line];
|
|
388
|
+
return acc;
|
|
389
|
+
}
|
|
55
390
|
return acc;
|
|
391
|
+
}, {});
|
|
392
|
+
return Object.keys(parsed).length > 0 ? parsed : null;
|
|
393
|
+
}
|
|
394
|
+
async runTypecheckRawOutput(abortSignal) {
|
|
395
|
+
const command = process.env.SUPERBLOCKS_SERVER_ENV === "local"
|
|
396
|
+
? "pnpm exec tsc"
|
|
397
|
+
: "npx tsc";
|
|
398
|
+
// Only apps whose root tsconfig declares project `references` need build
|
|
399
|
+
// mode. The fullstack (3.0) template uses a root "solution" tsconfig that
|
|
400
|
+
// includes only top-level *.ts files and delegates client/** and server/**
|
|
401
|
+
// to referenced composite projects. Plain `tsc --noEmit` never type-checks
|
|
402
|
+
// those referenced projects, so real build-breaking errors (e.g. a missing
|
|
403
|
+
// named export imported by client/root.tsx) slip through silently. `tsc -b`
|
|
404
|
+
// type-checks every referenced project in dependency order.
|
|
405
|
+
//
|
|
406
|
+
// We deliberately do NOT pass `--noEmit` with `-b`: the composite
|
|
407
|
+
// client/server projects use `emitDeclarationOnly` (the client consumes the
|
|
408
|
+
// server's emitted .d.ts), and build mode rejects `--noEmit` against a
|
|
409
|
+
// referenced project that emits with TS6310 ("Referenced project may not
|
|
410
|
+
// disable emit"). Build mode also rejects per-invocation flags such as
|
|
411
|
+
// --incremental, --noImplicitAny, and --tsBuildInfoFile (TS5094), so
|
|
412
|
+
// reference templates configure those in tsconfig instead.
|
|
413
|
+
//
|
|
414
|
+
// Because `tsc -b` must emit, we run it against generated "shadow" tsconfigs
|
|
415
|
+
// that extend the app's real configs but redirect every emit (outDir +
|
|
416
|
+
// tsBuildInfoFile) into the sync-excluded `.superblocks/tscheck/` scratch
|
|
417
|
+
// dir. This keeps build_debug honoring its read-only contract: nothing is
|
|
418
|
+
// written into the app workspace (client/, server/, a top-level dist/), only
|
|
419
|
+
// into `.superblocks/` — the same isolated area the non-build-mode command
|
|
420
|
+
// already uses for its `.tsbuildinfo` cache. tsc still reports diagnostics
|
|
421
|
+
// against the real source paths, and the persisted scratch buildinfo keeps
|
|
422
|
+
// builds incremental.
|
|
423
|
+
//
|
|
424
|
+
// If shadow-config generation fails for any reason (unparseable/missing
|
|
425
|
+
// referenced config, scratch-dir write failure, ...), we FAIL CLOSED to a
|
|
426
|
+
// non-emitting `tsc --noEmit` rather than a plain in-tree `tsc -b`: the
|
|
427
|
+
// latter would emit dist/** + *.tsbuildinfo into the app tree and break
|
|
428
|
+
// build_debug's read-only contract. `--noEmit` is guaranteed not to write
|
|
429
|
+
// (it overrides the composite projects' emit settings, and without `-b` it
|
|
430
|
+
// never builds referenced projects), and it still surfaces the underlying
|
|
431
|
+
// tsconfig problem as a diagnostic. We lose reference-following in this rare
|
|
432
|
+
// failure case, but never mutate the app workspace.
|
|
433
|
+
//
|
|
434
|
+
// Everything else (2.0 apps, flat shadcn-style apps, legacy apps) has no
|
|
435
|
+
// references, so the original command already type-checks every file. We
|
|
436
|
+
// keep it for those apps to preserve behavior build mode can't: `--noEmit`
|
|
437
|
+
// (no app-tree mutation), `--noImplicitAny false` (leniency for untyped
|
|
438
|
+
// AI-generated code, avoiding debug loops), and an isolated
|
|
439
|
+
// `--tsBuildInfoFile` cache.
|
|
440
|
+
let args;
|
|
441
|
+
if (await this.appUsesProjectReferences()) {
|
|
442
|
+
const shadowRootConfig = await this.prepareReferenceShadowConfigs();
|
|
443
|
+
args = shadowRootConfig
|
|
444
|
+
? ["-b", shadowRootConfig, "--pretty false"]
|
|
445
|
+
: ["--noEmit", "--pretty false"];
|
|
56
446
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
447
|
+
else {
|
|
448
|
+
args = [
|
|
449
|
+
"--noEmit",
|
|
450
|
+
// speed up marginal typecheck
|
|
451
|
+
"--incremental",
|
|
452
|
+
// expected format
|
|
453
|
+
"--pretty false",
|
|
454
|
+
// allow any
|
|
455
|
+
"--noImplicitAny false",
|
|
456
|
+
// cache in separate file to avoid conflicts with vite or user ide
|
|
457
|
+
"--tsBuildInfoFile .superblocks/app.tsbuildinfo",
|
|
458
|
+
];
|
|
459
|
+
}
|
|
460
|
+
// execCancellable, not exec: aborting an exec only signals the `/bin/sh`
|
|
461
|
+
// it spawned, leaving `npx` and the `tsc` compiler underneath it running
|
|
462
|
+
// and holding their heap. Cancelled checks therefore never freed memory,
|
|
463
|
+
// and overlapping compilers accumulated until the pod was OOMKilled.
|
|
464
|
+
const output = await execCancellable([command, ...args].join(" "), {
|
|
69
465
|
cwd: this.appRootDirPath,
|
|
70
|
-
timeout: 30_000,
|
|
71
466
|
signal: abortSignal,
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
467
|
+
});
|
|
468
|
+
if (!output) {
|
|
469
|
+
return null;
|
|
470
|
+
}
|
|
471
|
+
return output;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Returns true when the app's root tsconfig declares project `references`.
|
|
475
|
+
*
|
|
476
|
+
* Reference apps (the fullstack/3.0 template) must be type-checked with
|
|
477
|
+
* `tsc -b`, which follows references; non-reference apps use the original
|
|
478
|
+
* `tsc --noEmit ...` command. Parsed with JSON5 because tsconfig.json allows
|
|
479
|
+
* comments and trailing commas. On any read/parse failure we fall back to
|
|
480
|
+
* `false` (the proven non-build-mode command): the only templates that use
|
|
481
|
+
* references ship a well-formed tsconfig, and legacy/2.0 apps have none.
|
|
482
|
+
*/
|
|
483
|
+
async appUsesProjectReferences() {
|
|
484
|
+
const tsconfigPath = path.join(this.appRootDirPath, "tsconfig.json");
|
|
485
|
+
try {
|
|
486
|
+
const raw = await fsReadFile(tsconfigPath, "utf-8");
|
|
487
|
+
const parsed = JSON5.parse(raw);
|
|
488
|
+
return Array.isArray(parsed.references) && parsed.references.length > 0;
|
|
489
|
+
}
|
|
490
|
+
catch (error) {
|
|
491
|
+
getLogger().warn("[ai-service] could not determine tsconfig project references; defaulting to non-build-mode typecheck", getErrorMeta(error));
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Generate "shadow" tsconfigs under `.superblocks/tscheck/` that mirror the
|
|
497
|
+
* app's project-reference graph but redirect all emit into that scratch dir,
|
|
498
|
+
* and return the app-root-relative path of the shadow root config to pass to
|
|
499
|
+
* `tsc -b`. Returns `null` on any failure so the caller can fail closed to a
|
|
500
|
+
* non-emitting `tsc --noEmit` (never a plain in-tree `tsc -b`, which would
|
|
501
|
+
* emit into the app tree and break build_debug's read-only contract).
|
|
502
|
+
*
|
|
503
|
+
* Why this exists: `tsc -b` cannot run with `--noEmit` against composite
|
|
504
|
+
* projects that emit declarations (TS6310), and build mode rejects a CLI
|
|
505
|
+
* `--outDir`/`--tsBuildInfoFile` override (TS5094). The only way to relocate
|
|
506
|
+
* emit is per-project config. Each shadow:
|
|
507
|
+
* - `extends` the original config (inheriting include/exclude/paths/etc.,
|
|
508
|
+
* whose relative paths still resolve against the original's directory),
|
|
509
|
+
* - sets `rootDir` to the app root so composite projects don't treat the
|
|
510
|
+
* scratch dir as the source root (TS6059),
|
|
511
|
+
* - overrides `outDir` + `tsBuildInfoFile` into the scratch dir,
|
|
512
|
+
* - rewrites `references` to point at the corresponding shadow configs (so
|
|
513
|
+
* building a referenced project also emits into the scratch dir, never the
|
|
514
|
+
* app tree).
|
|
515
|
+
*
|
|
516
|
+
* `.superblocks/` is already excluded from dbfs sync, the vite watcher, and
|
|
517
|
+
* Clark's context, so confining emit there preserves the read-only contract.
|
|
518
|
+
*/
|
|
519
|
+
async prepareReferenceShadowConfigs() {
|
|
520
|
+
try {
|
|
521
|
+
const appRoot = this.appRootDirPath;
|
|
522
|
+
const scratchDir = path.join(appRoot, ".superblocks", "tscheck");
|
|
523
|
+
const rootConfigAbs = path.join(appRoot, "tsconfig.json");
|
|
524
|
+
// Walk the reference graph from the root config, collecting every
|
|
525
|
+
// transitively referenced tsconfig and its (resolved) reference targets.
|
|
526
|
+
const originals = [];
|
|
527
|
+
const seen = new Set();
|
|
528
|
+
const refsByConfig = new Map();
|
|
529
|
+
const queue = [rootConfigAbs];
|
|
530
|
+
while (queue.length > 0) {
|
|
531
|
+
const configAbs = queue.shift();
|
|
532
|
+
if (seen.has(configAbs)) {
|
|
533
|
+
continue;
|
|
534
|
+
}
|
|
535
|
+
seen.add(configAbs);
|
|
536
|
+
originals.push(configAbs);
|
|
537
|
+
const parsed = JSON5.parse(await fsReadFile(configAbs, "utf-8"));
|
|
538
|
+
const refs = Array.isArray(parsed.references) ? parsed.references : [];
|
|
539
|
+
const resolvedRefs = [];
|
|
540
|
+
for (const ref of refs) {
|
|
541
|
+
if (!ref?.path) {
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
// A reference path may point at a tsconfig file or at a directory
|
|
545
|
+
// (which implies `<dir>/tsconfig.json`), matching tsc's resolution.
|
|
546
|
+
const refResolved = path.resolve(path.dirname(configAbs), ref.path);
|
|
547
|
+
const refAbs = refResolved.endsWith(".json")
|
|
548
|
+
? refResolved
|
|
549
|
+
: path.join(refResolved, "tsconfig.json");
|
|
550
|
+
resolvedRefs.push(refAbs);
|
|
551
|
+
queue.push(refAbs);
|
|
552
|
+
}
|
|
553
|
+
refsByConfig.set(configAbs, resolvedRefs);
|
|
75
554
|
}
|
|
76
|
-
|
|
555
|
+
// Deterministic, collision-free shadow filename per original config,
|
|
556
|
+
// derived from its app-root-relative path (e.g. `tsconfig.client.json` ->
|
|
557
|
+
// `tsconfig.client.json.sbcheck.json`, nested dirs flattened with `__`).
|
|
558
|
+
const shadowNameOf = (configAbs) => `${path.relative(appRoot, configAbs).split(path.sep).join("__")}.sbcheck.json`;
|
|
559
|
+
const toPosix = (p) => p.split(path.sep).join("/");
|
|
560
|
+
const rootDirRel = toPosix(path.relative(scratchDir, appRoot)) || ".";
|
|
561
|
+
// Exclude the migration backup (`<appRoot>/scratch/**`) from every shadow
|
|
562
|
+
// project. During a 2.0 -> 3.0 migration the original v2 app files are
|
|
563
|
+
// parked under `scratch/v2-backup/` until finalize deletes them; they are
|
|
564
|
+
// stale and routinely do not type-check under the 3.0 config, and must not
|
|
565
|
+
// surface as dev-server typecheck errors (APPS-5107). A shadow that
|
|
566
|
+
// declares `exclude` overrides (rather than merges with) the inherited
|
|
567
|
+
// one, so we reconstruct the config's *effective* exclude — remapped so
|
|
568
|
+
// its relative globs resolve to the same absolute paths tsc used — then
|
|
569
|
+
// append the scratch dir. When no `exclude` is declared anywhere in the
|
|
570
|
+
// `extends` chain, tsc falls back to implicit defaults (node_modules etc.)
|
|
571
|
+
// plus the config's own `outDir`, so we replicate those instead — the
|
|
572
|
+
// outDir part keeps a broad `include` from re-reading stale build output.
|
|
573
|
+
const defaultTsExcludes = [
|
|
574
|
+
"node_modules",
|
|
575
|
+
"bower_components",
|
|
576
|
+
"jspm_packages",
|
|
577
|
+
];
|
|
578
|
+
const scratchExcludeRel = toPosix(path.relative(scratchDir, path.join(appRoot, "scratch")));
|
|
579
|
+
const remapExclude = (entry, baseDir) => path.isAbsolute(entry)
|
|
580
|
+
? entry
|
|
581
|
+
: toPosix(path.relative(scratchDir, path.resolve(baseDir, entry)));
|
|
582
|
+
// Resolve an `extends` target to an absolute path the way tsc does: only
|
|
583
|
+
// relative targets are followed (package/module extends are out of scope —
|
|
584
|
+
// the reference templates never use them), and a target may omit `.json`
|
|
585
|
+
// or point at a directory (implying `<dir>/tsconfig.json`).
|
|
586
|
+
const resolveExtendsTarget = async (fromDir, extendsValue) => {
|
|
587
|
+
if (!extendsValue.startsWith(".")) {
|
|
588
|
+
return null;
|
|
589
|
+
}
|
|
590
|
+
const resolved = path.resolve(fromDir, extendsValue);
|
|
591
|
+
const candidates = resolved.endsWith(".json")
|
|
592
|
+
? [resolved]
|
|
593
|
+
: [`${resolved}.json`, path.join(resolved, "tsconfig.json")];
|
|
594
|
+
for (const candidate of candidates) {
|
|
595
|
+
try {
|
|
596
|
+
await access(candidate);
|
|
597
|
+
return candidate;
|
|
598
|
+
}
|
|
599
|
+
catch (error) {
|
|
600
|
+
// A missing candidate is expected (the extensionless/dir probes),
|
|
601
|
+
// but a permission/IO error on a target that exists silently
|
|
602
|
+
// truncates the walk and narrows the reconstructed exclude, so make
|
|
603
|
+
// that case diagnosable.
|
|
604
|
+
if (error?.code !== "ENOENT") {
|
|
605
|
+
getLogger().debug(`[ai-service] extends target not accessible while resolving shadow tsconfig excludes: ${candidate}`, getErrorMeta(error));
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return null;
|
|
610
|
+
};
|
|
611
|
+
// Walk a config's `extends` chain to find its effective `exclude` and
|
|
612
|
+
// `outDir` (the nearest declaration wins, matching tsc's override
|
|
613
|
+
// semantics). Each is paired with the directory of the config that
|
|
614
|
+
// declared it, so its relative paths remap correctly. Only single-string
|
|
615
|
+
// `extends` is followed — array-form `extends` is not (the template guard
|
|
616
|
+
// test enforces that migration templates never use it).
|
|
617
|
+
const resolveEffectiveConfig = async (configAbs) => {
|
|
618
|
+
let current = configAbs;
|
|
619
|
+
const guard = new Set();
|
|
620
|
+
let exclude = null;
|
|
621
|
+
let outDir = null;
|
|
622
|
+
while (current && !guard.has(current)) {
|
|
623
|
+
guard.add(current);
|
|
624
|
+
let parsed;
|
|
625
|
+
try {
|
|
626
|
+
parsed = JSON5.parse(await fsReadFile(current, "utf-8"));
|
|
627
|
+
}
|
|
628
|
+
catch (error) {
|
|
629
|
+
// A base config in the chain that can't be read/parsed truncates
|
|
630
|
+
// the walk and narrows the reconstructed exclude; log so that
|
|
631
|
+
// divergence is diagnosable rather than silent.
|
|
632
|
+
getLogger().debug(`[ai-service] could not read/parse tsconfig while resolving shadow excludes: ${current}`, getErrorMeta(error));
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
const dir = path.dirname(current);
|
|
636
|
+
if (!exclude && Array.isArray(parsed.exclude)) {
|
|
637
|
+
exclude = { value: parsed.exclude, baseDir: dir };
|
|
638
|
+
}
|
|
639
|
+
if (!outDir && typeof parsed.compilerOptions?.outDir === "string") {
|
|
640
|
+
outDir = { value: parsed.compilerOptions.outDir, baseDir: dir };
|
|
641
|
+
}
|
|
642
|
+
if (exclude && outDir) {
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
current =
|
|
646
|
+
typeof parsed.extends === "string"
|
|
647
|
+
? await resolveExtendsTarget(dir, parsed.extends)
|
|
648
|
+
: null;
|
|
649
|
+
}
|
|
650
|
+
return { exclude, outDir };
|
|
651
|
+
};
|
|
652
|
+
await mkdir(scratchDir, { recursive: true });
|
|
653
|
+
await Promise.all(originals.map(async (configAbs) => {
|
|
654
|
+
const shadowName = shadowNameOf(configAbs);
|
|
655
|
+
const emitName = shadowName.replace(/\.json$/, "");
|
|
656
|
+
const effective = await resolveEffectiveConfig(configAbs);
|
|
657
|
+
// With an explicit `exclude` (declared anywhere in the extends chain),
|
|
658
|
+
// tsc does not auto-exclude `outDir`, so replicate exactly what it
|
|
659
|
+
// declared. Without one, tsc's implicit defaults include the config's
|
|
660
|
+
// own `outDir`, so add that back alongside node_modules et al.
|
|
661
|
+
let inheritedExcludes;
|
|
662
|
+
if (effective.exclude) {
|
|
663
|
+
const { value: entries, baseDir } = effective.exclude;
|
|
664
|
+
inheritedExcludes = entries.map((entry) => remapExclude(entry, baseDir));
|
|
665
|
+
}
|
|
666
|
+
else {
|
|
667
|
+
inheritedExcludes = [
|
|
668
|
+
...defaultTsExcludes.map((entry) => remapExclude(entry, path.dirname(configAbs))),
|
|
669
|
+
...(effective.outDir
|
|
670
|
+
? [
|
|
671
|
+
remapExclude(effective.outDir.value, effective.outDir.baseDir),
|
|
672
|
+
]
|
|
673
|
+
: []),
|
|
674
|
+
];
|
|
675
|
+
}
|
|
676
|
+
const shadow = {
|
|
677
|
+
extends: toPosix(path.relative(scratchDir, configAbs)),
|
|
678
|
+
compilerOptions: {
|
|
679
|
+
rootDir: rootDirRel,
|
|
680
|
+
outDir: `./emit/${emitName}`,
|
|
681
|
+
tsBuildInfoFile: `./${emitName}.tsbuildinfo`,
|
|
682
|
+
},
|
|
683
|
+
// Exclude the shadow's own emit dir. Declaring an explicit `exclude`
|
|
684
|
+
// defeats tsc's implicit auto-exclusion of `outDir`, so on a second+
|
|
685
|
+
// run a broad inherited `include` could in principle re-consume the
|
|
686
|
+
// previous run's emitted `.d.ts`. In practice tsc's wildcard include
|
|
687
|
+
// skips dot-directories and emit lives under `.superblocks/`, so this
|
|
688
|
+
// is defense-in-depth: it keeps correctness from resting on that
|
|
689
|
+
// implicit heuristic. All shadows emit under `./emit/`.
|
|
690
|
+
exclude: [...inheritedExcludes, scratchExcludeRel, "./emit"],
|
|
691
|
+
references: (refsByConfig.get(configAbs) ?? []).map((refAbs) => ({
|
|
692
|
+
path: `./${shadowNameOf(refAbs)}`,
|
|
693
|
+
})),
|
|
694
|
+
};
|
|
695
|
+
await writeFile(path.join(scratchDir, shadowName), JSON.stringify(shadow, null, 2), "utf-8");
|
|
696
|
+
}));
|
|
697
|
+
const rootShadowAbs = path.join(scratchDir, shadowNameOf(rootConfigAbs));
|
|
698
|
+
return toPosix(path.relative(appRoot, rootShadowAbs));
|
|
699
|
+
}
|
|
700
|
+
catch (error) {
|
|
701
|
+
getLogger().warn("[ai-service] could not prepare isolated tsc -b scratch configs; failing closed to non-emitting tsc --noEmit", getErrorMeta(error));
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
async runLinter(filePaths, abortSignal) {
|
|
706
|
+
const absoluteFilePaths = filePaths.map((filePath) => path.join(this.appRootDirPath, filePath));
|
|
707
|
+
return await this.enqueueFsOperation("runLinter", async () => {
|
|
708
|
+
const { errors, fixedFiles } = await this.linter.lint(absoluteFilePaths, abortSignal);
|
|
709
|
+
// Mark auto-fixed files as requiring read before further writes
|
|
710
|
+
for (const fixedFile of fixedFiles) {
|
|
711
|
+
this.requireRead(fixedFile);
|
|
712
|
+
}
|
|
713
|
+
if (Object.keys(errors).length > 0) {
|
|
714
|
+
return errors;
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
}, {
|
|
718
|
+
appShellQueueFileCount: filePaths.length,
|
|
77
719
|
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
}
|
|
720
|
+
}
|
|
721
|
+
warmLinterCache() {
|
|
722
|
+
void this.linter.warmCache(["**/*.{tsx}"]);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Emit one `superblocks.npm.install.*` observation (APPS-4189 / P6.2) and
|
|
726
|
+
* annotate the active llmobs span with the same dimensions. Shared by
|
|
727
|
+
* every `AppShell` install and uninstall method so metric and span streams join on
|
|
728
|
+
* (runner, registry_host, outcome) without drift. Every value flows
|
|
729
|
+
* through the P6.1 sanitization helpers inside `recordNpmInstall`, so a
|
|
730
|
+
* raw registry hostname or token cannot reach an exported attribute even
|
|
731
|
+
* if an upstream caller forgot to scrub.
|
|
732
|
+
*/
|
|
733
|
+
observeNpmInstall(runner, registryFetchResult, outcome, durationMs) {
|
|
734
|
+
const tags = recordNpmInstall({
|
|
735
|
+
runner,
|
|
736
|
+
registryHost: registryUrlFromFetchResult(registryFetchResult),
|
|
737
|
+
outcome,
|
|
738
|
+
configured: registryFetchResult?.config.configured ?? false,
|
|
739
|
+
durationMs,
|
|
740
|
+
});
|
|
741
|
+
// Record whether `--ignore-scripts` was added for this install on the span
|
|
742
|
+
// only, not as a metric label: the question is "did this one install skip
|
|
743
|
+
// scripts?", not a rate. It is read from the same `shouldIgnoreInstallScripts`
|
|
744
|
+
// the command builder uses, so the tag can never disagree with the flag we
|
|
745
|
+
// actually added. Turned into a string to match how the other tags are set.
|
|
746
|
+
llmobs.annotate({
|
|
747
|
+
tags: {
|
|
748
|
+
...tags,
|
|
749
|
+
"npm.ignore_scripts_appended": String(shouldIgnoreInstallScripts(registryFetchResult)),
|
|
750
|
+
},
|
|
751
|
+
});
|
|
752
|
+
this.maybeReportInstallOutcome(runner, tags["npm.outcome"]);
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Report a gated install outcome for Snowflake USER_EVENTs. Only
|
|
756
|
+
* `install_all` and `install_specific` run the vulnerability gate.
|
|
757
|
+
* Fire-and-forget: a reporting failure must never break the install.
|
|
758
|
+
*/
|
|
759
|
+
maybeReportInstallOutcome(runner, outcome) {
|
|
760
|
+
if (runner !== "install_all" && runner !== "install_specific")
|
|
761
|
+
return;
|
|
762
|
+
if (!this.reportNpmInstallOutcome)
|
|
763
|
+
return;
|
|
764
|
+
try {
|
|
765
|
+
this.reportNpmInstallOutcome({ outcome, runner });
|
|
766
|
+
}
|
|
767
|
+
catch {
|
|
768
|
+
// USER_EVENT reporting is best-effort and must not affect the install.
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Report a blocked controlled install to the server-side audit trail
|
|
773
|
+
* (APPS-4191 / P6.3). Only `NpmInstallBlocked` is auditable — any other
|
|
774
|
+
* failure (or success) is left to metrics (P6.2). The structured error
|
|
775
|
+
* already carries the audit-relevant fields (reason, packages, registry
|
|
776
|
+
* host, error code); the injected reporter adds org/app identity and the
|
|
777
|
+
* server throttles + sanitizes + persists. Fire-and-forget: a reporting
|
|
778
|
+
* failure must never surface to (or break) the install caller.
|
|
779
|
+
*/
|
|
780
|
+
safeAudit(report) {
|
|
781
|
+
if (!this.reportNpmInstallBlocked)
|
|
782
|
+
return;
|
|
783
|
+
try {
|
|
784
|
+
this.reportNpmInstallBlocked(report);
|
|
785
|
+
}
|
|
786
|
+
catch {
|
|
787
|
+
// Audit reporting is best-effort and must not affect the install.
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
maybeReportBlockedInstall(err, runner) {
|
|
791
|
+
if (!(err instanceof NpmInstallBlocked))
|
|
792
|
+
return;
|
|
793
|
+
// Audit only real CVE/malware findings — index/probe failures are fail-closed
|
|
794
|
+
// blocks, not malware hits, and must not pollute SIEM as vulnerabilities.
|
|
795
|
+
const isAuditableFinding = (finding) => finding.kind === "cve" || finding.kind === "malware";
|
|
796
|
+
const vulnerabilities = err.findings?.filter(isAuditableFinding).map((finding) => ({
|
|
797
|
+
advisoryId: finding.advisoryId,
|
|
798
|
+
kind: finding.kind,
|
|
799
|
+
package: finding.package,
|
|
800
|
+
...(finding.severity !== undefined
|
|
801
|
+
? { severity: finding.severity }
|
|
802
|
+
: {}),
|
|
803
|
+
...(finding.suggestedVersion !== undefined
|
|
804
|
+
? { suggestedVersion: finding.suggestedVersion }
|
|
805
|
+
: {}),
|
|
806
|
+
}));
|
|
807
|
+
// A block whose findings are all index/probe outages still carries
|
|
808
|
+
// `reason: vulnerable_package`, so auditing it would file an outage as a
|
|
809
|
+
// CVE hit. The `index_unavailable` metric already covers those.
|
|
810
|
+
if (err.findings?.length && !vulnerabilities?.length)
|
|
811
|
+
return;
|
|
812
|
+
this.safeAudit({
|
|
813
|
+
reason: err.reason,
|
|
814
|
+
registryHost: err.registryHost,
|
|
815
|
+
packages: err.packages,
|
|
816
|
+
httpStatus: err.httpStatus,
|
|
817
|
+
npmErrorCode: err.npmErrorCode,
|
|
818
|
+
runner,
|
|
819
|
+
occurredAt: Date.now(),
|
|
820
|
+
...(vulnerabilities?.length ? { vulnerabilities } : {}),
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
reportNpmTriageVerdict(verdict) {
|
|
824
|
+
this.safeAudit({
|
|
825
|
+
occurredAt: Date.now(),
|
|
826
|
+
packages: [verdict.package],
|
|
827
|
+
reason: "vulnerability_triaged",
|
|
828
|
+
runner: "install_specific",
|
|
829
|
+
triage: verdict,
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
reportNpmUserOverride(args) {
|
|
833
|
+
this.safeAudit({
|
|
834
|
+
occurredAt: Date.now(),
|
|
835
|
+
packages: args.packages,
|
|
836
|
+
reason: "vulnerability_user_override",
|
|
837
|
+
runner: "install_specific",
|
|
838
|
+
userOverride: {
|
|
839
|
+
packages: args.packages,
|
|
840
|
+
reason: args.reason,
|
|
841
|
+
},
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Report silent CVE/quarantine substitutions to the same audit sink as
|
|
846
|
+
* blocked installs. Best-effort; never fails the install.
|
|
847
|
+
*/
|
|
848
|
+
maybeReportSubstitutions(substitutions, runner) {
|
|
849
|
+
for (const entry of substitutions) {
|
|
850
|
+
this.safeAudit({
|
|
851
|
+
reason: "package_substituted",
|
|
852
|
+
packages: [`${entry.name}@${entry.fromVersion}`],
|
|
853
|
+
runner,
|
|
854
|
+
occurredAt: Date.now(),
|
|
855
|
+
substitution: {
|
|
856
|
+
fromVersion: entry.fromVersion,
|
|
857
|
+
toVersion: entry.toVersion,
|
|
858
|
+
reason: entry.reason,
|
|
859
|
+
},
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
/** Mode 2: write gate substitutions into package.json. Audit is the caller's job after install succeeds (same as Mode 1). */
|
|
864
|
+
async applyDeclaredDependencyUpgrades(remediation) {
|
|
865
|
+
if (remediation.substitutions.length === 0)
|
|
866
|
+
return [];
|
|
867
|
+
const rewritten = await this.enqueueFsOperation("applyPackageJsonSubstitutions", () => applyPackageJsonSubstitutions({
|
|
868
|
+
appRootDirPath: this.appRootDirPath,
|
|
869
|
+
logger: getLogger(),
|
|
870
|
+
substitutions: remediation.substitutions,
|
|
871
|
+
}));
|
|
872
|
+
if (rewritten.length === 0)
|
|
873
|
+
return [];
|
|
874
|
+
const applied = new Set(rewritten);
|
|
875
|
+
return remediation.substitutions.filter((entry) => applied.has(entry.name));
|
|
876
|
+
}
|
|
877
|
+
async remediateDeclaredDependencies(abortSignal) {
|
|
878
|
+
// Kill switch / unwired lookup: do not short-circuit registry or rewrite
|
|
879
|
+
// package.json — startup must behave as pre-gate.
|
|
880
|
+
if (!this.packageLookup) {
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
884
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, []);
|
|
885
|
+
// Cloud: strip workspace: before Mode 2 dry-run malware scan.
|
|
886
|
+
await this.maybePreparePackageJsonForCloudNpm();
|
|
887
|
+
await this.applyDeclaredDependencyUpgrades(await this.maybeRemediateVulnerabilities({
|
|
888
|
+
abortSignal,
|
|
889
|
+
mode: "all",
|
|
890
|
+
}));
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Env overlay for AppShell-spawned npm/pnpm installs in the live-edit
|
|
895
|
+
* pod. Routes npm's per-run debug log into `<app>/.superblocks/logs` via
|
|
896
|
+
* `NPM_CONFIG_LOGS_DIR` so a failed agent install leaves a collectable log
|
|
897
|
+
* in a predictable place — the same convention the CLI dev-server install
|
|
898
|
+
* uses (`buildInstallEnv` in the SDK). These execs otherwise inherit
|
|
899
|
+
* `process.env` implicitly, so we spread it before adding the override.
|
|
900
|
+
* pnpm has no equivalent logs-dir config and ignores the var (npm-only).
|
|
901
|
+
*/
|
|
902
|
+
installLogEnv() {
|
|
903
|
+
return {
|
|
904
|
+
...process.env,
|
|
905
|
+
NPM_CONFIG_LOGS_DIR: path.join(this.appRootDirPath, ".superblocks", "logs"),
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Cloud edit pods force npm for agent-driven installs. npm rejects pnpm's
|
|
910
|
+
* `workspace:` protocol, so rewrite platform deps and strip any remaining
|
|
911
|
+
* workspace entries before spawning npm (APPS-3752 bootstrap does this on
|
|
912
|
+
* pod start; migration restructure and agent installs need the same guard).
|
|
913
|
+
*/
|
|
914
|
+
async maybePreparePackageJsonForCloudNpm() {
|
|
915
|
+
if (process.env.SUPERBLOCKS_SERVER_ENV === "local") {
|
|
916
|
+
return;
|
|
917
|
+
}
|
|
918
|
+
await preparePackageJsonForCloudNpm({
|
|
919
|
+
appRootDirPath: this.appRootDirPath,
|
|
920
|
+
logger: getLogger(),
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
async runNpmInstall(abortSignal) {
|
|
924
|
+
const installStart = Date.now();
|
|
925
|
+
let outcome = "success";
|
|
926
|
+
let capturedFetchResult;
|
|
927
|
+
try {
|
|
928
|
+
// `withAuthFailedRetry` owns the `.npmrc` materialization (via
|
|
929
|
+
// `prepareForPrivateRegistry`) and the one-shot auth_failed retry —
|
|
930
|
+
// see its docstring. Telemetry is captured around it so a retry-then-
|
|
931
|
+
// succeed flow still records the right outcome.
|
|
932
|
+
await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
933
|
+
capturedFetchResult = registryFetchResult;
|
|
934
|
+
// APPS-4370: refuse to spawn npm when the registry server is
|
|
935
|
+
// unreachable AND we have prior evidence (disk marker) that this org
|
|
936
|
+
// was at some point configured with a private registry. See
|
|
937
|
+
// `maybeShortCircuitForUnreachable` for the full rationale.
|
|
938
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, []);
|
|
939
|
+
await this.maybePreparePackageJsonForCloudNpm();
|
|
940
|
+
const appliedSubstitutions = await this.applyDeclaredDependencyUpgrades(await this.maybeRemediateVulnerabilities({
|
|
941
|
+
abortSignal,
|
|
942
|
+
mode: "all",
|
|
943
|
+
}));
|
|
944
|
+
const ignoreScripts = shouldIgnoreInstallScripts(registryFetchResult);
|
|
945
|
+
const isNpm = process.env.SUPERBLOCKS_SERVER_ENV !== "local";
|
|
946
|
+
// prepare already ran above so Mode 2 cloud dry-run sees semver deps.
|
|
947
|
+
// In csb mock server (local dev) we use pnpm to avoid lockfile / store
|
|
948
|
+
// conflicts with the surrounding workspace; everywhere else we force npm
|
|
949
|
+
// so the `--json` error contract — and therefore the registry-blocked
|
|
950
|
+
// advice matrix — applies on this post-processing path too. When the
|
|
951
|
+
// org has opted out via `allow_install_scripts=false`, append
|
|
952
|
+
// `--ignore-scripts` (the flag is honored by both npm and pnpm).
|
|
953
|
+
const baseCommand = isNpm
|
|
954
|
+
? "npm install --fund=false --audit=false --json"
|
|
955
|
+
: "pnpm install --config.confirmModulesPurge=false";
|
|
956
|
+
const command = ignoreScripts
|
|
957
|
+
? `${baseCommand} --ignore-scripts`
|
|
958
|
+
: baseCommand;
|
|
959
|
+
await new Promise((resolve, reject) => {
|
|
960
|
+
exec(command, {
|
|
961
|
+
cwd: this.appRootDirPath,
|
|
962
|
+
env: this.installLogEnv(),
|
|
963
|
+
timeout: 30_000,
|
|
964
|
+
signal: abortSignal,
|
|
965
|
+
// See `NPM_JSON_MAX_BUFFER` — `--json` summary can outgrow the
|
|
966
|
+
// default 1 MiB exec buffer on fat dep trees.
|
|
967
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
968
|
+
}, (error, stdout, stderr) => {
|
|
969
|
+
if (error) {
|
|
970
|
+
// Route the npm path through the same classifier as the agent-tool
|
|
971
|
+
// install entry points so E404 / E401 / ENOTFOUND surface as a
|
|
972
|
+
// `NpmInstallBlocked` (with row-aware advice) instead of a raw
|
|
973
|
+
// `NpmInstallError(stderr)`. The pnpm path doesn't emit the
|
|
974
|
+
// `--json` envelope, so the classifier falls through to the
|
|
975
|
+
// legacy error for it — registry-blocked scenarios only matter
|
|
976
|
+
// in cloud-edit (which is the npm branch).
|
|
977
|
+
if (isNpm) {
|
|
978
|
+
return reject(this.classifyNpmExecError({ stdout, stderr, message: error.message }, undefined, registryFetchResult));
|
|
979
|
+
}
|
|
980
|
+
return reject(new NpmInstallError(stderr));
|
|
981
|
+
}
|
|
982
|
+
return resolve();
|
|
983
|
+
});
|
|
984
|
+
});
|
|
985
|
+
// Audit only after the install succeeds: a selected substitution is
|
|
986
|
+
// not an applied substitution if npm fails (same as Mode 1).
|
|
987
|
+
this.maybeReportSubstitutions(appliedSubstitutions, "install_all");
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
catch (err) {
|
|
991
|
+
outcome = outcomeFromInstallError(err);
|
|
992
|
+
this.maybeReportBlockedInstall(err, "install_all");
|
|
993
|
+
throw err;
|
|
994
|
+
}
|
|
995
|
+
finally {
|
|
996
|
+
this.observeNpmInstall("install_all", capturedFetchResult, outcome, Date.now() - installStart);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* APPS-4370. If the `prepareForPrivateRegistry` result tells us the
|
|
1001
|
+
* server is unreachable AND the per-org disk marker says this org has
|
|
1002
|
+
* at some prior point successfully resolved a configured registry,
|
|
1003
|
+
* throw `NpmInstallBlocked(registry_unreachable)` BEFORE spawning npm.
|
|
1004
|
+
*
|
|
1005
|
+
* Without this short-circuit the install spawns anyway and hits one of
|
|
1006
|
+
* two failure modes:
|
|
1007
|
+
* 1. A previous install left a managed `.npmrc` with rotated credentials
|
|
1008
|
+
* → npm 401s mid-deploy and `classifyNpmExecError` tags it
|
|
1009
|
+
* `registry_auth_failed`, pointing the user at the wrong remediation.
|
|
1010
|
+
* 2. No managed `.npmrc` exists → install silently resolves through
|
|
1011
|
+
* public npm, defeating the privacy posture during the outage.
|
|
1012
|
+
*
|
|
1013
|
+
* Bypassed when:
|
|
1014
|
+
* - The fetch result is anything other than `unreachable` (the
|
|
1015
|
+
* existing code paths handle `configured` / `stale` / `not-configured`).
|
|
1016
|
+
* - `everConfigured` is `undefined` (no store wired in — older call
|
|
1017
|
+
* sites, test fixtures) or `false` (greenfield org / first install).
|
|
1018
|
+
*
|
|
1019
|
+
* `packages` flows onto the structured error so the agent loop can
|
|
1020
|
+
* surface "we tried to install <these> and the registry was unreachable".
|
|
1021
|
+
*/
|
|
1022
|
+
maybeShortCircuitForUnreachable(registryFetchResult, packages) {
|
|
1023
|
+
if (!registryFetchResult || registryFetchResult.source !== "unreachable") {
|
|
1024
|
+
return;
|
|
1025
|
+
}
|
|
1026
|
+
if (registryFetchResult.everConfigured !== true) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
throw new NpmInstallBlocked({
|
|
1030
|
+
reason: "registry_unreachable",
|
|
1031
|
+
packages,
|
|
1032
|
+
hasAnyRegistryConfigured: true,
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* POST `/api/v1/security/package-lookup` for a batch of `{name,version}`
|
|
1037
|
+
* pairs. One request — the server cap is 5000. Throws on non-2xx / network
|
|
1038
|
+
* / malformed body so the caller can apply malware fail-closed.
|
|
1039
|
+
*/
|
|
1040
|
+
async lookupPackageVulnerabilities(packages) {
|
|
1041
|
+
const deps = this.packageLookup;
|
|
1042
|
+
if (!deps) {
|
|
1043
|
+
return [];
|
|
1044
|
+
}
|
|
1045
|
+
if (packages.length === 0) {
|
|
1046
|
+
return [];
|
|
1047
|
+
}
|
|
1048
|
+
const jwt = await deps.getJwt();
|
|
1049
|
+
const base = deps.baseUrl.replace(/\/$/, "");
|
|
1050
|
+
const url = `${base}/api/v1/security/package-lookup`;
|
|
1051
|
+
const fetchFn = deps.fetch ?? globalThis.fetch;
|
|
1052
|
+
const response = await fetchFn(url, {
|
|
1053
|
+
method: "POST",
|
|
1054
|
+
headers: {
|
|
1055
|
+
Authorization: `Bearer ${jwt}`,
|
|
1056
|
+
"Content-Type": "application/json",
|
|
1057
|
+
},
|
|
1058
|
+
body: JSON.stringify({ packages }),
|
|
1059
|
+
});
|
|
1060
|
+
if (!response.ok) {
|
|
1061
|
+
throw new Error(`package-lookup returned HTTP ${response.status}`);
|
|
1062
|
+
}
|
|
1063
|
+
const body = await response.json();
|
|
1064
|
+
if (body == null ||
|
|
1065
|
+
typeof body !== "object" ||
|
|
1066
|
+
!("data" in body) ||
|
|
1067
|
+
body.data == null ||
|
|
1068
|
+
typeof body.data !== "object" ||
|
|
1069
|
+
!("results" in body.data) ||
|
|
1070
|
+
!Array.isArray(body.data.results)) {
|
|
1071
|
+
throw new Error("package-lookup response missing data.results");
|
|
1072
|
+
}
|
|
1073
|
+
const results = [];
|
|
1074
|
+
for (const entry of body.data.results) {
|
|
1075
|
+
if (!isPackageLookupResult(entry)) {
|
|
1076
|
+
throw new Error("package-lookup response contained an off-shape result");
|
|
1077
|
+
}
|
|
1078
|
+
results.push(entry);
|
|
1079
|
+
}
|
|
1080
|
+
const checked = new Set(results.map((result) => `${result.name}@${result.version}`));
|
|
1081
|
+
for (const pkg of packages) {
|
|
1082
|
+
if (!checked.has(`${pkg.name}@${pkg.version}`)) {
|
|
1083
|
+
throw new Error(`package-lookup response missing result for ${pkg.name}@${pkg.version}`);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return results;
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Mode 1: npm dry-run + lockfile.
|
|
1090
|
+
* Mode 2: `topLevel` is always declared package.json floors (CVE remediations).
|
|
1091
|
+
* Cloud malware tree = floors ∪ package-lock ∪ dry-run (after workspace:
|
|
1092
|
+
* rewrite). Local stays floors-only — pnpm + lingering `workspace:*` mean
|
|
1093
|
+
* full-tree coverage is not available there.
|
|
1094
|
+
*/
|
|
1095
|
+
async resolveInstallTree(mode, packages, abortSignal) {
|
|
1096
|
+
if (mode === "all") {
|
|
1097
|
+
const topLevel = [];
|
|
1098
|
+
for (const pkg of packages ?? []) {
|
|
1099
|
+
const version = declaredRangeFloor(pkg.version);
|
|
1100
|
+
if (version != null)
|
|
1101
|
+
topLevel.push({ name: pkg.name, version });
|
|
1102
|
+
}
|
|
1103
|
+
// Local: floors only. Cloud: union lockfile + dry-run for malware.
|
|
1104
|
+
if (process.env.SUPERBLOCKS_SERVER_ENV === "local") {
|
|
1105
|
+
return { resolves: true, topLevel, tree: topLevel };
|
|
1106
|
+
}
|
|
1107
|
+
const fromLock = await this.readPackagesFromPackageLock();
|
|
1108
|
+
let dryTree = [];
|
|
1109
|
+
try {
|
|
1110
|
+
dryTree = (await this.resolveTreeViaNpmDryRun([], abortSignal)).tree;
|
|
1111
|
+
}
|
|
1112
|
+
catch (err) {
|
|
1113
|
+
// Do not continue remediation after cancel.
|
|
1114
|
+
if (abortSignal?.aborted ||
|
|
1115
|
+
(err instanceof Error && err.name === "AbortError")) {
|
|
1116
|
+
throw err;
|
|
1117
|
+
}
|
|
1118
|
+
// Unexpected probe failure (not ERESOLVE / error envelope) — still
|
|
1119
|
+
// malware-scan floors + lockfile instead of aborting the gate.
|
|
1120
|
+
}
|
|
1121
|
+
const byKey = new Map();
|
|
1122
|
+
for (const pkg of [...(fromLock?.tree ?? []), ...dryTree, ...topLevel]) {
|
|
1123
|
+
byKey.set(`${pkg.name}@${pkg.version}`, pkg);
|
|
1124
|
+
}
|
|
1125
|
+
// Keep resolves:true so a failed dry-run cannot skip floor CVE swaps;
|
|
1126
|
+
// malware still sees whatever floors/lock/dry contributed.
|
|
1127
|
+
return { resolves: true, topLevel, tree: [...byKey.values()] };
|
|
1128
|
+
}
|
|
1129
|
+
const specs = (packages ?? []).map((pkg) => pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name);
|
|
1130
|
+
const resolved = await this.resolveTreeViaNpmDryRun(specs, abortSignal);
|
|
1131
|
+
// Prefer dry-run concrete pins for top-level. Never inject the raw
|
|
1132
|
+
// requested range/`latest` string into the lookup tree — the index
|
|
1133
|
+
// keys on concrete versions, and a range would fail coverage checks.
|
|
1134
|
+
const topLevel = [];
|
|
1135
|
+
for (const pkg of packages ?? []) {
|
|
1136
|
+
// An exact pin is what npm puts at the root, so it needs no resolution —
|
|
1137
|
+
// and looking it up in the dry-run tree risks matching some other copy of
|
|
1138
|
+
// the same name. It stays checkable even when npm cannot resolve the full
|
|
1139
|
+
// tree; the lockfile union below preserves malware coverage for the tree
|
|
1140
|
+
// already on disk.
|
|
1141
|
+
if (pkg.version && semver.valid(pkg.version)) {
|
|
1142
|
+
topLevel.push({ name: pkg.name, version: pkg.version });
|
|
1143
|
+
continue;
|
|
1144
|
+
}
|
|
1145
|
+
const fromDry = resolved.topLevel.find((entry) => entry.name === pkg.name);
|
|
1146
|
+
if (fromDry)
|
|
1147
|
+
topLevel.push(fromDry);
|
|
1148
|
+
}
|
|
1149
|
+
// Lockfile entries come first so already-satisfied installs (empty
|
|
1150
|
+
// dry-run `add`) still malware-scan locked transitives; dry-run pins and
|
|
1151
|
+
// top-level overwrite on collision because they reflect what this
|
|
1152
|
+
// install actually changes.
|
|
1153
|
+
const fromLock = await this.readPackagesFromPackageLock();
|
|
1154
|
+
const byKey = new Map();
|
|
1155
|
+
for (const pkg of [
|
|
1156
|
+
...(fromLock?.tree ?? []),
|
|
1157
|
+
...resolved.tree,
|
|
1158
|
+
...topLevel,
|
|
1159
|
+
]) {
|
|
1160
|
+
byKey.set(`${pkg.name}@${pkg.version}`, pkg);
|
|
1161
|
+
}
|
|
1162
|
+
return {
|
|
1163
|
+
tree: [...byKey.values()],
|
|
1164
|
+
topLevel,
|
|
1165
|
+
resolves: resolved.resolves,
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
async resolveTreeViaNpmDryRun(specs, abortSignal) {
|
|
1169
|
+
const args = [
|
|
1170
|
+
"install",
|
|
1171
|
+
"--dry-run",
|
|
1172
|
+
"--json",
|
|
1173
|
+
"--fund=false",
|
|
1174
|
+
"--audit=false",
|
|
1175
|
+
// `--` so a spec that looks like an option (`--registry=…`,
|
|
1176
|
+
// `--userconfig=…`) is parsed as a package name instead of
|
|
1177
|
+
// reconfiguring the probe: the gate scans the tree this resolves, so a
|
|
1178
|
+
// redirected registry would vouch for packages the real install never
|
|
1179
|
+
// fetches. npm rejects the name and we fail closed.
|
|
1180
|
+
"--",
|
|
1181
|
+
...specs,
|
|
1182
|
+
];
|
|
1183
|
+
try {
|
|
1184
|
+
// execFile (no shell) so hostile package specs cannot inject shell
|
|
1185
|
+
// metacharacters into the dry-run probe.
|
|
1186
|
+
const { stdout } = await execFilePromise("npm", args, {
|
|
1187
|
+
cwd: this.appRootDirPath,
|
|
1188
|
+
env: this.installLogEnv(),
|
|
1189
|
+
signal: abortSignal,
|
|
1190
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1191
|
+
});
|
|
1192
|
+
const parsed = parseNpmJsonStdout(stdout);
|
|
1193
|
+
return this.treeFromNpmDryRunJson(parsed, specs);
|
|
1194
|
+
}
|
|
1195
|
+
catch (error) {
|
|
1196
|
+
const err = error;
|
|
1197
|
+
const combined = `${err.stdout ?? ""}\n${err.stderr ?? ""}\n${err.message ?? ""}`;
|
|
1198
|
+
if (/ERESOLVE|EPEERINVALID/i.test(combined)) {
|
|
1199
|
+
return { tree: [], topLevel: [], resolves: false };
|
|
1200
|
+
}
|
|
1201
|
+
// Non-zero exit can still carry a usable dry-run body — or an `{ error }`
|
|
1202
|
+
// envelope (EUNSUPPORTEDPROTOCOL / E404 / ETARGET). Treat the latter as
|
|
1203
|
+
// unresolved so the gate fails closed instead of scanning an empty tree.
|
|
1204
|
+
if (err.stdout && err.stdout.includes("{")) {
|
|
1205
|
+
try {
|
|
1206
|
+
const parsed = parseNpmJsonStdout(err.stdout);
|
|
1207
|
+
if (isNpmErrorEnvelope(parsed)) {
|
|
1208
|
+
return { tree: [], topLevel: [], resolves: false };
|
|
1209
|
+
}
|
|
1210
|
+
return this.treeFromNpmDryRunJson(parsed, specs);
|
|
1211
|
+
}
|
|
1212
|
+
catch {
|
|
1213
|
+
// fall through
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
throw error;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
treeFromNpmDryRunJson(parsed, specs) {
|
|
1220
|
+
if (parsed == null || typeof parsed !== "object") {
|
|
1221
|
+
return { tree: [], topLevel: [], resolves: true };
|
|
1222
|
+
}
|
|
1223
|
+
const record = parsed;
|
|
1224
|
+
const tree = [];
|
|
1225
|
+
const root = [];
|
|
1226
|
+
const seen = new Set();
|
|
1227
|
+
const push = (name, version, entryPath) => {
|
|
1228
|
+
if (typeof name !== "string" || typeof version !== "string")
|
|
1229
|
+
return;
|
|
1230
|
+
if (!name || !version)
|
|
1231
|
+
return;
|
|
1232
|
+
const key = `${name}@${version}`;
|
|
1233
|
+
if (!seen.has(key)) {
|
|
1234
|
+
seen.add(key);
|
|
1235
|
+
tree.push({ name, version });
|
|
1236
|
+
}
|
|
1237
|
+
if (isRootNodeModulesPath(entryPath))
|
|
1238
|
+
root.push({ name, version });
|
|
1239
|
+
};
|
|
1240
|
+
if (Array.isArray(record.add)) {
|
|
1241
|
+
for (const entry of record.add) {
|
|
1242
|
+
if (entry == null || typeof entry !== "object")
|
|
1243
|
+
continue;
|
|
1244
|
+
const pkg = entry;
|
|
1245
|
+
push(pkg.name, pkg.version, pkg.path);
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
if (Array.isArray(record.change)) {
|
|
1249
|
+
for (const entry of record.change) {
|
|
1250
|
+
if (entry == null || typeof entry !== "object")
|
|
1251
|
+
continue;
|
|
1252
|
+
const change = entry;
|
|
1253
|
+
if (change.to == null || typeof change.to !== "object")
|
|
1254
|
+
continue;
|
|
1255
|
+
const to = change.to;
|
|
1256
|
+
push(to.name, to.version, to.path);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
const topLevelNames = new Set(specs.map((spec) => {
|
|
1260
|
+
if (spec.startsWith("@")) {
|
|
1261
|
+
const at = spec.indexOf("@", 1);
|
|
1262
|
+
return at > 0 ? spec.slice(0, at) : spec;
|
|
1263
|
+
}
|
|
1264
|
+
return spec.split("@")[0] ?? spec;
|
|
1265
|
+
}));
|
|
1266
|
+
// Top-level is the copy npm puts at the app's own `node_modules/<name>`.
|
|
1267
|
+
// A dependency's nested copy shares the requested name but is a different
|
|
1268
|
+
// version, and vouching for it would let the requested one install
|
|
1269
|
+
// unchecked.
|
|
1270
|
+
const topLevel = root.filter((pkg) => topLevelNames.has(pkg.name));
|
|
1271
|
+
return { tree, topLevel, resolves: true };
|
|
1272
|
+
}
|
|
1273
|
+
async readPackagesFromPackageLock() {
|
|
1274
|
+
const lockPath = path.join(this.appRootDirPath, "package-lock.json");
|
|
1275
|
+
let raw;
|
|
1276
|
+
try {
|
|
1277
|
+
raw = await fsReadFile(lockPath, "utf8");
|
|
1278
|
+
}
|
|
1279
|
+
catch {
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
let parsed;
|
|
1283
|
+
try {
|
|
1284
|
+
parsed = JSON.parse(raw);
|
|
1285
|
+
}
|
|
1286
|
+
catch {
|
|
1287
|
+
return null;
|
|
1288
|
+
}
|
|
1289
|
+
if (parsed == null || typeof parsed !== "object") {
|
|
1290
|
+
return null;
|
|
1291
|
+
}
|
|
1292
|
+
const lock = parsed;
|
|
1293
|
+
const tree = [];
|
|
1294
|
+
const seen = new Set();
|
|
1295
|
+
const push = (name, version) => {
|
|
1296
|
+
const key = `${name}@${version}`;
|
|
1297
|
+
if (seen.has(key))
|
|
1298
|
+
return;
|
|
1299
|
+
seen.add(key);
|
|
1300
|
+
tree.push({ name, version });
|
|
1301
|
+
};
|
|
1302
|
+
if (lock.packages && typeof lock.packages === "object") {
|
|
1303
|
+
for (const [lockPathKey, meta] of Object.entries(lock.packages)) {
|
|
1304
|
+
if (!meta || typeof meta.version !== "string")
|
|
1305
|
+
continue;
|
|
1306
|
+
// Only `node_modules/**` entries are installed packages. `packages[""]`
|
|
1307
|
+
// (and any workspace root) is first-party code carrying a
|
|
1308
|
+
// builder-chosen name, so scanning it would block every install by an
|
|
1309
|
+
// app that happens to be named after a malicious package.
|
|
1310
|
+
const pathName = packageNameFromLockPath(lockPathKey);
|
|
1311
|
+
if (!pathName)
|
|
1312
|
+
continue;
|
|
1313
|
+
// An aliased install (`"node_modules/alias": { name: "real" }`) fetches
|
|
1314
|
+
// `meta.name` from the registry; that is the name to scan.
|
|
1315
|
+
push(typeof meta.name === "string" && meta.name.length > 0
|
|
1316
|
+
? meta.name
|
|
1317
|
+
: pathName, meta.version);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
else if (lock.dependencies && typeof lock.dependencies === "object") {
|
|
1321
|
+
// lockfileVersion 1: nested `dependencies` hold transitive pins.
|
|
1322
|
+
const walkV1 = (deps) => {
|
|
1323
|
+
if (deps == null || typeof deps !== "object")
|
|
1324
|
+
return;
|
|
1325
|
+
for (const [name, meta] of Object.entries(deps)) {
|
|
1326
|
+
if (meta == null || typeof meta !== "object")
|
|
1327
|
+
continue;
|
|
1328
|
+
if (!("version" in meta) || typeof meta.version !== "string") {
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
push(name, meta.version);
|
|
1332
|
+
if ("dependencies" in meta &&
|
|
1333
|
+
meta.dependencies != null &&
|
|
1334
|
+
typeof meta.dependencies === "object") {
|
|
1335
|
+
walkV1(meta.dependencies);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
walkV1(lock.dependencies);
|
|
1340
|
+
}
|
|
1341
|
+
return { tree, topLevel: tree, resolves: true };
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* Vulnerability gate. Mode 1 remediates/blocks top-level CVEs; Mode 2
|
|
1345
|
+
* silently rewrites declared deps (same major) and leaves the rest.
|
|
1346
|
+
* No-op when `packageLookup` is unwired. Index failures → malware fail-closed.
|
|
1347
|
+
*/
|
|
1348
|
+
async maybeRemediateVulnerabilities(args) {
|
|
1349
|
+
const { abortSignal, cveUserOverride, mode } = args;
|
|
1350
|
+
if (!this.packageLookup) {
|
|
1351
|
+
return { substitutions: [] };
|
|
1352
|
+
}
|
|
1353
|
+
const packages = mode === "all"
|
|
1354
|
+
? await readDeclaredDependencies(this.appRootDirPath)
|
|
1355
|
+
: args.packages;
|
|
1356
|
+
return await runVulnerabilityGate({
|
|
1357
|
+
abortSignal,
|
|
1358
|
+
capabilities: {
|
|
1359
|
+
lookupPackages: async (resolved) => await this.lookupPackageVulnerabilities(resolved),
|
|
1360
|
+
onIndexUnavailable: ({ error, message }) => {
|
|
1361
|
+
emitIndexUnavailableMetric();
|
|
1362
|
+
getLogger().warn(message, getErrorMeta(error));
|
|
1363
|
+
},
|
|
1364
|
+
pickQuarantineHoldback: this.packageLookup.pickQuarantineHoldback,
|
|
1365
|
+
resolveInstallTree: async (resolveArgs) => await this.resolveInstallTree(resolveArgs.mode, resolveArgs.packages, resolveArgs.abortSignal),
|
|
1366
|
+
resolvePackageSpecs: async (resolveArgs) => await this.resolveTreeViaNpmDryRun(resolveArgs.specs, resolveArgs.abortSignal),
|
|
1367
|
+
},
|
|
1368
|
+
cveUserOverride,
|
|
1369
|
+
mode,
|
|
1370
|
+
packages,
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Derive the `hasAnyRegistryConfigured` tri-state from the
|
|
1375
|
+
* `NpmRegistryFetchResult` that the immediately-preceding
|
|
1376
|
+
* `prepareForPrivateRegistry` call returned.
|
|
1377
|
+
*
|
|
1378
|
+
* - `true` — `configured` or `stale`. At least one row is known
|
|
1379
|
+
* to exist (fresh fetch or last-known-good cache).
|
|
1380
|
+
* - `false` — `not-configured`. The kill switch is off OR the
|
|
1381
|
+
* server returned an empty list. A deliberate "no rows"
|
|
1382
|
+
* observation.
|
|
1383
|
+
* - `undefined` — `prepareForPrivateRegistry` returned `undefined` (no
|
|
1384
|
+
* client wired in) OR the client resolved to `unreachable`
|
|
1385
|
+
* (server down with no usable cache). Both mean "we don't
|
|
1386
|
+
* know"; `buildBlockedMessage` falls back to the default
|
|
1387
|
+
* variant rather than asserting a row count.
|
|
1388
|
+
*
|
|
1389
|
+
* Kept narrow + private so the signal stays a single derivation site rather
|
|
1390
|
+
* than something every catch handler reimplements.
|
|
1391
|
+
*/
|
|
1392
|
+
static deriveHasAnyRegistryConfigured(result) {
|
|
1393
|
+
if (!result)
|
|
1394
|
+
return undefined;
|
|
1395
|
+
switch (result.source) {
|
|
1396
|
+
case "configured":
|
|
1397
|
+
case "stale":
|
|
1398
|
+
return true;
|
|
1399
|
+
case "not-configured":
|
|
1400
|
+
return false;
|
|
1401
|
+
case "unreachable":
|
|
1402
|
+
return undefined;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
1406
|
+
* Convert an exec failure from `npm --json` into a structured error.
|
|
1407
|
+
*
|
|
1408
|
+
* - When the stdout JSON matches a known registry-blocked condition (E404,
|
|
1409
|
+
* ENOTFOUND, E401, ...) we throw `NpmInstallBlocked` so the tool layer
|
|
1410
|
+
* can surface it to the agent as a structured result.
|
|
1411
|
+
* - Otherwise we fall back to the legacy `NpmInstallError(stderr)` so any
|
|
1412
|
+
* pre-existing handler (e.g. agent-planning's POST_PROCESSING_ERRORED
|
|
1413
|
+
* branch) behaves exactly as it did before.
|
|
1414
|
+
*
|
|
1415
|
+
* Only used on the npm code path; pnpm continues to throw `NpmInstallError`
|
|
1416
|
+
* directly because pnpm's `--json` error contract differs and the
|
|
1417
|
+
* registry-blocked scenarios only matter in cloud-edit (which forces npm).
|
|
1418
|
+
*
|
|
1419
|
+
* `registryFetchResult` carries the most recent
|
|
1420
|
+
* `prepareForPrivateRegistry` result so the structured error can encode
|
|
1421
|
+
* whether the org had any configured registry rows at the moment of
|
|
1422
|
+
* failure (used by `buildBlockedMessage` to choose between default and
|
|
1423
|
+
* row-aware advice variants). The active llmobs span is annotated with the
|
|
1424
|
+
* same data points so a downstream `npm.install_blocked.*` facet can
|
|
1425
|
+
* correlate reason, host, and row presence.
|
|
1426
|
+
*/
|
|
1427
|
+
classifyNpmExecError(error, requestedPackages, registryFetchResult) {
|
|
1428
|
+
const stdout = error.stdout ?? "";
|
|
1429
|
+
const hasAnyRegistryConfigured = AppShell.deriveHasAnyRegistryConfigured(registryFetchResult);
|
|
1430
|
+
const blocked = parseNpmJsonError(stdout, {
|
|
1431
|
+
requestedPackages,
|
|
1432
|
+
hasAnyRegistryConfigured,
|
|
1433
|
+
});
|
|
1434
|
+
if (blocked) {
|
|
1435
|
+
// Span tags for `superblocks.npm.install_blocked.*` faceting. Stringified
|
|
1436
|
+
// because llmobs tag values are strings; `unknown` is used in lieu of
|
|
1437
|
+
// `null`/`undefined` so the tag's cardinality stays bounded and a
|
|
1438
|
+
// "field absent" datapoint is still queryable.
|
|
1439
|
+
//
|
|
1440
|
+
// `npm.install_blocked.registry_host` is routed through the P6.1
|
|
1441
|
+
// `bucketNpmRegistryHost` sanitizer (same helper used by
|
|
1442
|
+
// `recordNpmInstall`) so the tag value is a bounded enum
|
|
1443
|
+
// (`public_npm` / `private` / `unknown`). `NpmInstallBlocked` only
|
|
1444
|
+
// scrubs credentials and control characters — without the bucketer the
|
|
1445
|
+
// raw customer registry hostname would land in llmobs tags, leaking
|
|
1446
|
+
// customer-internal hosts and giving the tag unbounded cardinality.
|
|
1447
|
+
llmobs.annotate({
|
|
1448
|
+
tags: {
|
|
1449
|
+
"npm.install_blocked.reason": blocked.reason,
|
|
1450
|
+
"npm.install_blocked.registry_host": bucketNpmRegistryHost(blocked.registryHost),
|
|
1451
|
+
"npm.install_blocked.npm_error_code": blocked.npmErrorCode ?? "unknown",
|
|
1452
|
+
"npm.install_blocked.has_any_registry_configured": hasAnyRegistryConfigured === undefined
|
|
1453
|
+
? "unknown"
|
|
1454
|
+
: String(hasAnyRegistryConfigured),
|
|
1455
|
+
},
|
|
1456
|
+
});
|
|
1457
|
+
return blocked;
|
|
1458
|
+
}
|
|
1459
|
+
// Non-registry-blocked failure (ERESOLVE, EPEERINVALID, ETARGET, …).
|
|
1460
|
+
// Prefer the JSON diagnostic from stdout because under `--json` stderr
|
|
1461
|
+
// is sparse — preserving the diagnostic keeps agent-planning's
|
|
1462
|
+
// POST_PROCESSING_ERRORED debug message useful instead of collapsing
|
|
1463
|
+
// it to a generic exec-failure string.
|
|
1464
|
+
const diagnostic = parseNpmJsonDiagnostic(stdout);
|
|
1465
|
+
if (stdout && !diagnostic) {
|
|
1466
|
+
// npm was invoked with `--json` but neither parser could extract
|
|
1467
|
+
// anything from stdout. This silently bypasses the row-aware advice
|
|
1468
|
+
// matrix, the structured warn log, and the llmobs span tags above —
|
|
1469
|
+
// converting the silent fallback into a queryable signal so operators
|
|
1470
|
+
// can find these (npm crash mid-output, stdout truncation, schema
|
|
1471
|
+
// drift across npm versions, an interactive prompt sneaking past
|
|
1472
|
+
// `--json`). Single line, debug-grade payload (truncated preview
|
|
1473
|
+
// only) to keep log volume bounded.
|
|
1474
|
+
//
|
|
1475
|
+
// Scrub BEFORE slicing: raw npm `--json` stdout can contain registry
|
|
1476
|
+
// URLs with userinfo or `_authToken=` lines from a leaked `.npmrc`,
|
|
1477
|
+
// and slicing first could split a credential across the 200-char
|
|
1478
|
+
// boundary so the regex no longer matches.
|
|
1479
|
+
getLogger().warn("[npm] failed to extract structured error from `npm --json` stdout; falling back to legacy NpmInstallError", { stdoutPreview: scrubSecrets(stdout).slice(0, 200) });
|
|
1480
|
+
}
|
|
1481
|
+
return new NpmInstallError(diagnostic || error.stderr || error.message || "");
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Wraps an install attempt so that a `registry_auth_failed` failure
|
|
1485
|
+
* triggers one cache-invalidation + re-fetch + retry cycle before
|
|
1486
|
+
* throwing. The helper owns the `.npmrc` materialisation so the retry
|
|
1487
|
+
* picks up a freshly-fetched token without duplicating the prep call
|
|
1488
|
+
* in every install method.
|
|
1489
|
+
*
|
|
1490
|
+
* Guard: only one retry per call — a second `registry_auth_failed`
|
|
1491
|
+
* propagates unchanged.
|
|
1492
|
+
*/
|
|
1493
|
+
async withAuthFailedRetry(attempt) {
|
|
1494
|
+
const registryFetchResult = await this.enqueueFsOperation("maybeWriteNpmrc", () => prepareForPrivateRegistry(this.appRootDirPath, this.npmRegistryClient));
|
|
1495
|
+
try {
|
|
1496
|
+
return await attempt(registryFetchResult);
|
|
1497
|
+
}
|
|
1498
|
+
catch (error) {
|
|
1499
|
+
if (error instanceof NpmInstallBlocked &&
|
|
1500
|
+
error.reason === "registry_auth_failed" &&
|
|
1501
|
+
this.npmRegistryClient) {
|
|
1502
|
+
this.npmRegistryClient.invalidateCache();
|
|
1503
|
+
getLogger().info("[npm-registry] invalidated cache after registry_auth_failed; retrying install once");
|
|
1504
|
+
llmobs.annotate({
|
|
1505
|
+
tags: {
|
|
1506
|
+
"npm.registry.cache_invalidated_on_auth_failed": "true",
|
|
1507
|
+
},
|
|
1508
|
+
});
|
|
1509
|
+
const retryFetchResult = await this.enqueueFsOperation("maybeWriteNpmrc", () => prepareForPrivateRegistry(this.appRootDirPath, this.npmRegistryClient));
|
|
1510
|
+
return await attempt(retryFetchResult);
|
|
1511
|
+
}
|
|
1512
|
+
throw error;
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
async runPackageManagerInstall(abortSignal) {
|
|
1516
|
+
const installStart = Date.now();
|
|
1517
|
+
let outcome = "success";
|
|
1518
|
+
let capturedFetchResult;
|
|
1519
|
+
try {
|
|
1520
|
+
return await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
1521
|
+
capturedFetchResult = registryFetchResult;
|
|
1522
|
+
// APPS-4370: short-circuit before any exec when server is unreachable
|
|
1523
|
+
// AND this org's marker says it was previously configured.
|
|
1524
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, []);
|
|
1525
|
+
// In cloud edit mode, always use npm because pnpm is not available in the container.
|
|
1526
|
+
// The user's project may have pnpm signals (pnpm-lock.yaml, packageManager field)
|
|
1527
|
+
// from local editing, but we must use npm in cloud mode.
|
|
1528
|
+
const isCloudMode = process.env.SUPERBLOCKS_SERVER_ENV !== "local";
|
|
1529
|
+
let packageManagerAgent;
|
|
1530
|
+
if (isCloudMode) {
|
|
1531
|
+
// Force npm in cloud mode; prepare before Mode 2 so dry-run malware
|
|
1532
|
+
// scan does not choke on workspace: protocol entries.
|
|
1533
|
+
packageManagerAgent = "npm";
|
|
1534
|
+
await this.maybePreparePackageJsonForCloudNpm();
|
|
1535
|
+
}
|
|
1536
|
+
else {
|
|
1537
|
+
// NOTE: this largely duplicates the logic in the CLI
|
|
1538
|
+
const packageManager = await detect({
|
|
1539
|
+
strategies: [
|
|
1540
|
+
"packageManager-field",
|
|
1541
|
+
"lockfile",
|
|
1542
|
+
"install-metadata",
|
|
1543
|
+
"devEngines-field",
|
|
1544
|
+
],
|
|
1545
|
+
cwd: this.appRootDirPath,
|
|
1546
|
+
});
|
|
1547
|
+
if (!packageManager) {
|
|
1548
|
+
throw new Error("Could not detect package manager");
|
|
1549
|
+
}
|
|
1550
|
+
packageManagerAgent = packageManager.agent;
|
|
1551
|
+
}
|
|
1552
|
+
const appliedSubstitutions = await this.applyDeclaredDependencyUpgrades(await this.maybeRemediateVulnerabilities({
|
|
1553
|
+
abortSignal,
|
|
1554
|
+
mode: "all",
|
|
1555
|
+
}));
|
|
1556
|
+
const ignoreScripts = shouldIgnoreInstallScripts(registryFetchResult);
|
|
1557
|
+
const isNpm = packageManagerAgent === "npm";
|
|
1558
|
+
const baseInstallArgs = isNpm
|
|
1559
|
+
? ["--fund=false", "--audit=false", "--json"]
|
|
1560
|
+
: [];
|
|
1561
|
+
const installArgs = ignoreScripts
|
|
1562
|
+
? [...baseInstallArgs, "--ignore-scripts"]
|
|
1563
|
+
: baseInstallArgs;
|
|
1564
|
+
const installCommand = resolveCommand(packageManagerAgent, "install", installArgs);
|
|
1565
|
+
if (!installCommand) {
|
|
1566
|
+
throw new Error(`Could not determine install command for ${packageManagerAgent}, skipping package installation`);
|
|
1567
|
+
}
|
|
1568
|
+
const { command, args } = installCommand;
|
|
1569
|
+
try {
|
|
1570
|
+
const { stdout } = await execPromise(`${command} ${args.join(" ")}`, {
|
|
1571
|
+
cwd: this.appRootDirPath,
|
|
1572
|
+
env: this.installLogEnv(),
|
|
1573
|
+
signal: abortSignal,
|
|
1574
|
+
// See `NPM_JSON_MAX_BUFFER` — `--json` summary can outgrow the
|
|
1575
|
+
// default 1 MiB exec buffer on fat dep trees.
|
|
1576
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1577
|
+
});
|
|
1578
|
+
// Audit only after the install succeeds (same as Mode 1).
|
|
1579
|
+
this.maybeReportSubstitutions(appliedSubstitutions, "install_all");
|
|
1580
|
+
// On the npm path stdout is a JSON blob; translate to a compact
|
|
1581
|
+
// human-readable summary for the agent, falling back to raw stdout
|
|
1582
|
+
// when the JSON shape drifts.
|
|
1583
|
+
if (isNpm) {
|
|
1584
|
+
return parseNpmJsonSuccess(stdout) ?? stdout;
|
|
1585
|
+
}
|
|
1586
|
+
return stdout;
|
|
1587
|
+
}
|
|
1588
|
+
catch (error) {
|
|
1589
|
+
if (isNpm)
|
|
1590
|
+
throw this.classifyNpmExecError(error, undefined, registryFetchResult);
|
|
1591
|
+
throw new NpmInstallError(error.stderr || error.message);
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
catch (err) {
|
|
1596
|
+
outcome = outcomeFromInstallError(err);
|
|
1597
|
+
this.maybeReportBlockedInstall(err, "install_all");
|
|
1598
|
+
throw err;
|
|
1599
|
+
}
|
|
1600
|
+
finally {
|
|
1601
|
+
this.observeNpmInstall("install_all", capturedFetchResult, outcome, Date.now() - installStart);
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
async installSpecificPackages(packages, abortSignal, options) {
|
|
1605
|
+
if (!packages || packages.length === 0) {
|
|
1606
|
+
throw new Error("No packages specified for installation");
|
|
1607
|
+
}
|
|
1608
|
+
// Specs are interpolated into a command string that `/bin/sh -c` parses,
|
|
1609
|
+
// so the name and version guards belong here rather than in each caller.
|
|
1610
|
+
const invalidRequested = packages
|
|
1611
|
+
.map((pkg) => pkg.name)
|
|
1612
|
+
.filter((name) => !isValidNpmPackageName(name));
|
|
1613
|
+
if (invalidRequested.length > 0) {
|
|
1614
|
+
throw new Error(`Invalid package name(s): ${invalidRequested.join(", ")}.`);
|
|
1615
|
+
}
|
|
1616
|
+
const invalidVersions = packages
|
|
1617
|
+
.filter((pkg) => pkg.version !== undefined && !isValidNpmVersionSpec(pkg.version))
|
|
1618
|
+
.map((pkg) => pkg.name);
|
|
1619
|
+
if (invalidVersions.length > 0) {
|
|
1620
|
+
throw new Error(`Invalid package version(s) for: ${invalidVersions.join(", ")}.`);
|
|
1621
|
+
}
|
|
1622
|
+
const installStart = Date.now();
|
|
1623
|
+
let outcome = "success";
|
|
1624
|
+
let capturedFetchResult;
|
|
1625
|
+
try {
|
|
1626
|
+
return await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
1627
|
+
capturedFetchResult = registryFetchResult;
|
|
1628
|
+
// APPS-4370: short-circuit before exec when unreachable + everConfigured.
|
|
1629
|
+
// Pass through the requested package specs so the structured error
|
|
1630
|
+
// surfaces them to the agent ("we tried to install lodash and the
|
|
1631
|
+
// private registry was unreachable").
|
|
1632
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, packages.map((pkg) => pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name));
|
|
1633
|
+
// In cloud edit mode, always use npm because pnpm is not available in the container.
|
|
1634
|
+
// The user's project may have pnpm signals (pnpm-lock.yaml, packageManager field)
|
|
1635
|
+
// from local editing, but we must use npm in cloud mode. Prepare before the
|
|
1636
|
+
// Mode 1 dry-run so leftover workspace: entries cannot break malware coverage.
|
|
1637
|
+
const isCloudMode = process.env.SUPERBLOCKS_SERVER_ENV !== "local";
|
|
1638
|
+
let packageManagerAgent;
|
|
1639
|
+
if (isCloudMode) {
|
|
1640
|
+
// Force npm in cloud mode
|
|
1641
|
+
packageManagerAgent = "npm";
|
|
1642
|
+
await this.maybePreparePackageJsonForCloudNpm();
|
|
1643
|
+
}
|
|
1644
|
+
else {
|
|
1645
|
+
const packageManager = await detect({
|
|
1646
|
+
strategies: [
|
|
1647
|
+
"packageManager-field",
|
|
1648
|
+
"lockfile",
|
|
1649
|
+
"install-metadata",
|
|
1650
|
+
"devEngines-field",
|
|
1651
|
+
],
|
|
1652
|
+
cwd: this.appRootDirPath,
|
|
1653
|
+
});
|
|
1654
|
+
if (!packageManager) {
|
|
1655
|
+
throw new Error("Could not detect package manager");
|
|
1656
|
+
}
|
|
1657
|
+
packageManagerAgent = packageManager.agent;
|
|
1658
|
+
}
|
|
1659
|
+
// Malware hard-block on the dry-run resolved tree (top-level +
|
|
1660
|
+
// transitive) before the real install runs. Mode 1 also returns
|
|
1661
|
+
// silent CVE substitutions applied to the install argv below.
|
|
1662
|
+
const remediation = await this.maybeRemediateVulnerabilities({
|
|
1663
|
+
abortSignal,
|
|
1664
|
+
cveUserOverride: options?.cveUserOverride,
|
|
1665
|
+
mode: "specific",
|
|
1666
|
+
packages,
|
|
1667
|
+
});
|
|
1668
|
+
const packagesToInstall = applyPackageSubstitutions(packages, remediation.substitutions);
|
|
1669
|
+
const ignoreScripts = shouldIgnoreInstallScripts(registryFetchResult);
|
|
1670
|
+
const isNpm = packageManagerAgent === "npm";
|
|
1671
|
+
// Separate regular and dev dependencies
|
|
1672
|
+
const regularPackages = packagesToInstall.filter((pkg) => !pkg.dev);
|
|
1673
|
+
const devPackages = packagesToInstall.filter((pkg) => pkg.dev);
|
|
1674
|
+
const outputs = [];
|
|
1675
|
+
// Install regular dependencies
|
|
1676
|
+
if (regularPackages.length > 0) {
|
|
1677
|
+
const packageSpecs = regularPackages.map((pkg) => pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name);
|
|
1678
|
+
const baseArgs = isNpm
|
|
1679
|
+
? ["--fund=false", "--audit=false", "--json", ...packageSpecs]
|
|
1680
|
+
: packageSpecs;
|
|
1681
|
+
const addCommand = resolveCommand(packageManagerAgent, "add", ignoreScripts ? ["--ignore-scripts", ...baseArgs] : baseArgs);
|
|
1682
|
+
if (!addCommand) {
|
|
1683
|
+
throw new Error(`Could not determine add command for ${packageManagerAgent}`);
|
|
1684
|
+
}
|
|
1685
|
+
const { command, args } = addCommand;
|
|
1686
|
+
try {
|
|
1687
|
+
const { stdout } = await execPromise(`${command} ${args.join(" ")}`, {
|
|
1688
|
+
cwd: this.appRootDirPath,
|
|
1689
|
+
env: this.installLogEnv(),
|
|
1690
|
+
signal: abortSignal,
|
|
1691
|
+
// See `NPM_JSON_MAX_BUFFER` — `--json` summary can outgrow the
|
|
1692
|
+
// default 1 MiB exec buffer on fat dep trees.
|
|
1693
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1694
|
+
});
|
|
1695
|
+
outputs.push(isNpm ? (parseNpmJsonSuccess(stdout) ?? stdout) : stdout);
|
|
1696
|
+
}
|
|
1697
|
+
catch (error) {
|
|
1698
|
+
if (isNpm)
|
|
1699
|
+
throw this.classifyNpmExecError(error, regularPackages, registryFetchResult);
|
|
1700
|
+
throw new NpmInstallError(error.stderr || error.message);
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
// Install dev dependencies
|
|
1704
|
+
if (devPackages.length > 0) {
|
|
1705
|
+
const packageSpecs = devPackages.map((pkg) => pkg.version ? `${pkg.name}@${pkg.version}` : pkg.name);
|
|
1706
|
+
const baseArgs = isNpm
|
|
1707
|
+
? [
|
|
1708
|
+
"--save-dev",
|
|
1709
|
+
"--fund=false",
|
|
1710
|
+
"--audit=false",
|
|
1711
|
+
"--json",
|
|
1712
|
+
...packageSpecs,
|
|
1713
|
+
]
|
|
1714
|
+
: ["-D", ...packageSpecs];
|
|
1715
|
+
const addCommand = resolveCommand(packageManagerAgent, "add", ignoreScripts ? ["--ignore-scripts", ...baseArgs] : baseArgs);
|
|
1716
|
+
if (!addCommand) {
|
|
1717
|
+
throw new Error(`Could not determine add command for ${packageManagerAgent}`);
|
|
1718
|
+
}
|
|
1719
|
+
const { command, args } = addCommand;
|
|
1720
|
+
try {
|
|
1721
|
+
const { stdout } = await execPromise(`${command} ${args.join(" ")}`, {
|
|
1722
|
+
cwd: this.appRootDirPath,
|
|
1723
|
+
env: this.installLogEnv(),
|
|
1724
|
+
signal: abortSignal,
|
|
1725
|
+
// See `NPM_JSON_MAX_BUFFER` — `--json` summary can outgrow the
|
|
1726
|
+
// default 1 MiB exec buffer on fat dep trees.
|
|
1727
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1728
|
+
});
|
|
1729
|
+
outputs.push(isNpm ? (parseNpmJsonSuccess(stdout) ?? stdout) : stdout);
|
|
1730
|
+
}
|
|
1731
|
+
catch (error) {
|
|
1732
|
+
if (isNpm)
|
|
1733
|
+
throw this.classifyNpmExecError(error, devPackages, registryFetchResult);
|
|
1734
|
+
throw new NpmInstallError(error.stderr || error.message);
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
// Audit only after every install group succeeds: a selected
|
|
1738
|
+
// substitution is not an applied substitution if npm fails.
|
|
1739
|
+
this.maybeReportSubstitutions(remediation.substitutions, "install_specific");
|
|
1740
|
+
// Audited here, not at the tool layer: the gate is what consumed the
|
|
1741
|
+
// override, and the install has now actually landed.
|
|
1742
|
+
if (options?.cveUserOverride &&
|
|
1743
|
+
remediation.userOverridePackages?.length) {
|
|
1744
|
+
this.reportNpmUserOverride({
|
|
1745
|
+
packages: remediation.userOverridePackages,
|
|
1746
|
+
reason: options.cveUserOverride.reason,
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
return outputs.join("\n");
|
|
1750
|
+
});
|
|
1751
|
+
}
|
|
1752
|
+
catch (err) {
|
|
1753
|
+
outcome = outcomeFromInstallError(err);
|
|
1754
|
+
this.maybeReportBlockedInstall(err, "install_specific");
|
|
1755
|
+
throw err;
|
|
1756
|
+
}
|
|
1757
|
+
finally {
|
|
1758
|
+
this.observeNpmInstall("install_specific", capturedFetchResult, outcome, Date.now() - installStart);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
async uninstallPackages(packages, options) {
|
|
1762
|
+
const invalidRequested = packages.filter((name) => !isValidNpmPackageName(name));
|
|
1763
|
+
if (invalidRequested.length > 0) {
|
|
1764
|
+
throw new Error(`Invalid package name(s): ${invalidRequested.join(", ")}.`);
|
|
1765
|
+
}
|
|
1766
|
+
// Core-package guard (APPS-4527): refuse to uninstall packages the
|
|
1767
|
+
// platform itself depends on (`@superblocksteam/*`, react, react-router,
|
|
1768
|
+
// vite, …). Removing one breaks the dev server, the bundle builder, or
|
|
1769
|
+
// the app runtime — no caller has a legitimate reason. Checked before
|
|
1770
|
+
// any registry work so the refusal is deterministic and offline.
|
|
1771
|
+
const protectedRequested = packages.filter((p) => isProtectedCorePackage(p));
|
|
1772
|
+
if (protectedRequested.length > 0) {
|
|
1773
|
+
throw new Error(`Refusing to uninstall protected core package(s): ${protectedRequested.join(", ")}. ` +
|
|
1774
|
+
"These are required by the Superblocks platform (dev server, build pipeline, or app runtime) and must remain in the app.");
|
|
1775
|
+
}
|
|
1776
|
+
const installStart = Date.now();
|
|
1777
|
+
let outcome = "success";
|
|
1778
|
+
let capturedFetchResult;
|
|
1779
|
+
// Uninstalls hit the same registry resolution rules as installs (the
|
|
1780
|
+
// dependency-tree solver re-reifies the remaining tree and can re-fetch
|
|
1781
|
+
// metadata), so they run through the SAME safety wrapper as every
|
|
1782
|
+
// install path rather than a bespoke one-shot exec:
|
|
1783
|
+
//
|
|
1784
|
+
// - `withAuthFailedRetry` owns the `.npmrc` materialization (via
|
|
1785
|
+
// `prepareForPrivateRegistry`, same serialization as `runNpmInstall`)
|
|
1786
|
+
// AND retries once on `registry_auth_failed` after invalidating the
|
|
1787
|
+
// registry cache, so an uninstall against a deployment whose
|
|
1788
|
+
// private-registry token was rotated mid-session recovers instead of
|
|
1789
|
+
// hard-failing on the stale `_authToken=` line.
|
|
1790
|
+
// - `maybeShortCircuitForUnreachable` (APPS-4370) refuses to spawn when
|
|
1791
|
+
// the config server is unreachable AND this org was previously
|
|
1792
|
+
// configured. Without it the uninstall escaped the fail-closed gate,
|
|
1793
|
+
// 401'd against the stale token, and surfaced `registry_auth_failed`
|
|
1794
|
+
// (rotate-credentials advice) instead of `registry_unreachable`
|
|
1795
|
+
// (registry-down advice) — the wrong remediation.
|
|
1796
|
+
// - The npm path runs with `--json` and routes failures through
|
|
1797
|
+
// `classifyNpmExecError`, identical to `installSpecificPackages`, so
|
|
1798
|
+
// E404 / E401 / ENOTFOUND surface as a structured `NpmInstallBlocked`
|
|
1799
|
+
// (and the auth-failed case feeds the retry above).
|
|
1800
|
+
//
|
|
1801
|
+
// `shouldIgnoreInstallScripts` honours the org's `allowInstallScripts`
|
|
1802
|
+
// policy on uninstall too — `preuninstall` / `postuninstall` lifecycle
|
|
1803
|
+
// scripts are just as dangerous as install-time ones.
|
|
1804
|
+
try {
|
|
1805
|
+
return await this.withAuthFailedRetry(async (registryFetchResult) => {
|
|
1806
|
+
capturedFetchResult = registryFetchResult;
|
|
1807
|
+
this.maybeShortCircuitForUnreachable(registryFetchResult, packages);
|
|
1808
|
+
const ignoreScripts = shouldIgnoreInstallScripts(registryFetchResult);
|
|
1809
|
+
// pnpm in local dev (avoids store/lockfile conflicts with the
|
|
1810
|
+
// surrounding workspace); npm everywhere else so the `--json` error
|
|
1811
|
+
// contract — and therefore the registry-blocked advice matrix —
|
|
1812
|
+
// applies. Mirrors `runNpmInstall` / `installSpecificPackages`.
|
|
1813
|
+
const isNpm = process.env.SUPERBLOCKS_SERVER_ENV !== "local";
|
|
1814
|
+
const packageManager = isNpm ? "npm" : "pnpm";
|
|
1815
|
+
const uninstallCmd = isNpm ? "uninstall" : "remove";
|
|
1816
|
+
const jsonFlag = isNpm ? " --json" : "";
|
|
1817
|
+
const baseCommand = `${packageManager} ${uninstallCmd} ${packages.join(" ")}${jsonFlag}`;
|
|
1818
|
+
const command = ignoreScripts
|
|
1819
|
+
? `${baseCommand} --ignore-scripts`
|
|
1820
|
+
: baseCommand;
|
|
1821
|
+
return await new Promise((resolve, reject) => {
|
|
1822
|
+
exec(command, {
|
|
1823
|
+
cwd: this.appRootDirPath,
|
|
1824
|
+
env: this.installLogEnv(),
|
|
1825
|
+
timeout: 30_000,
|
|
1826
|
+
signal: options?.abortSignal,
|
|
1827
|
+
// `--json` summary can outgrow the default 1 MiB exec buffer.
|
|
1828
|
+
maxBuffer: NPM_JSON_MAX_BUFFER,
|
|
1829
|
+
}, (error, stdout, stderr) => {
|
|
1830
|
+
if (error) {
|
|
1831
|
+
// Same classifier as the install paths: a registry block
|
|
1832
|
+
// (E404 / E401 / ENOTFOUND, ...) becomes a structured
|
|
1833
|
+
// `NpmInstallBlocked` (with row-aware advice + the
|
|
1834
|
+
// auth-failed retry signal consumed by `withAuthFailedRetry`);
|
|
1835
|
+
// anything else falls back to the legacy `NpmInstallError`.
|
|
1836
|
+
// pnpm doesn't emit the `--json` envelope, so it keeps the
|
|
1837
|
+
// raw-stderr error.
|
|
1838
|
+
if (isNpm) {
|
|
1839
|
+
return reject(this.classifyNpmExecError({ stdout, stderr, message: error.message }, undefined, registryFetchResult));
|
|
1840
|
+
}
|
|
1841
|
+
return reject(new NpmInstallError(stderr || error.message));
|
|
1842
|
+
}
|
|
1843
|
+
// On the npm path stdout is a `--json` blob; collapse it to a
|
|
1844
|
+
// compact human-readable summary (same as
|
|
1845
|
+
// `installSpecificPackages`), falling back to raw stdout on
|
|
1846
|
+
// shape drift.
|
|
1847
|
+
return resolve({
|
|
1848
|
+
stdout: isNpm
|
|
1849
|
+
? (parseNpmJsonSuccess(stdout) ?? stdout)
|
|
1850
|
+
: stdout,
|
|
1851
|
+
stderr,
|
|
1852
|
+
});
|
|
1853
|
+
});
|
|
1854
|
+
});
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
catch (err) {
|
|
1858
|
+
outcome = outcomeFromInstallError(err);
|
|
1859
|
+
this.maybeReportBlockedInstall(err, "uninstall");
|
|
1860
|
+
throw err;
|
|
1861
|
+
}
|
|
1862
|
+
finally {
|
|
1863
|
+
this.observeNpmInstall("uninstall", capturedFetchResult, outcome, Date.now() - installStart);
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
static MAX_GENERATION_RUNS = 10;
|
|
1867
|
+
async saveGeneratedArtifact(artifact, stepId, runTimestamp) {
|
|
1868
|
+
const stepPath = path.join(this.appRootDirPath, ".superblocks", "generations", runTimestamp, stepId, artifact.filePath);
|
|
1869
|
+
await mkdir(path.dirname(stepPath), { recursive: true });
|
|
1870
|
+
const relativeStepPath = path.relative(this.appRootDirPath, stepPath);
|
|
1871
|
+
getLogger().debug(`[ai-service] Saving step file: ${relativeStepPath}`);
|
|
1872
|
+
await writeFile(stepPath, artifact.content);
|
|
1873
|
+
void this.pruneGenerations().catch((error) => {
|
|
1874
|
+
getLogger().warn("[ai-service] Failed to prune generations", getErrorMeta(error));
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
async pruneGenerations(keepLast = AppShell.MAX_GENERATION_RUNS) {
|
|
1878
|
+
const generationsDir = path.join(this.appRootDirPath, ".superblocks", "generations");
|
|
1879
|
+
let entries;
|
|
1880
|
+
try {
|
|
1881
|
+
entries = await readdir(generationsDir);
|
|
1882
|
+
}
|
|
1883
|
+
catch (err) {
|
|
1884
|
+
if (err?.code === "ENOENT")
|
|
1885
|
+
return;
|
|
1886
|
+
throw err;
|
|
1887
|
+
}
|
|
1888
|
+
if (entries.length <= keepLast) {
|
|
1889
|
+
return;
|
|
1890
|
+
}
|
|
1891
|
+
entries.sort();
|
|
1892
|
+
const toDelete = entries.slice(0, entries.length - keepLast);
|
|
1893
|
+
await Promise.all(toDelete.map((entry) => rm(path.join(generationsDir, entry), {
|
|
1894
|
+
recursive: true,
|
|
1895
|
+
force: true,
|
|
1896
|
+
})));
|
|
1897
|
+
}
|
|
1898
|
+
async sendMessage(message) {
|
|
1899
|
+
if (this.messageSender) {
|
|
1900
|
+
await this.messageSender(message);
|
|
1901
|
+
}
|
|
1902
|
+
else {
|
|
1903
|
+
getLogger().warn(`[ai-service] No message sender configured, cannot send message: ${message.type}`);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
/** Check if a given path exists in the app dir. */
|
|
1907
|
+
async pathExists(relativePath) {
|
|
1908
|
+
const fullPath = path.join(this.appRootDirPath, relativePath);
|
|
1909
|
+
try {
|
|
1910
|
+
await access(fullPath); // F_OK is the default: "is it there?"
|
|
1911
|
+
return true;
|
|
1912
|
+
}
|
|
1913
|
+
catch (err) {
|
|
1914
|
+
if (err.code === "ENOENT")
|
|
1915
|
+
return false; // path missing
|
|
1916
|
+
throw err; // rethrow other errors (e.g., permissions)
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* Clears the scratch directory used for temporary API source files.
|
|
1921
|
+
* This is typically called when a draft is rejected to clean up temporary artifacts.
|
|
1922
|
+
*/
|
|
1923
|
+
async clearScratchDirectory() {
|
|
1924
|
+
const scratchDir = path.join(this.appRootDirPath, ".superblocks", "scratch");
|
|
1925
|
+
await this.enqueueFsOperation("clearScratchDirectory", async () => {
|
|
1926
|
+
try {
|
|
1927
|
+
await rm(scratchDir, { recursive: true });
|
|
1928
|
+
}
|
|
1929
|
+
catch {
|
|
1930
|
+
// Ignore errors if directory doesn't exist or can't be deleted
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
// ============================================================================
|
|
1935
|
+
// Filesystem Operations
|
|
1936
|
+
// ============================================================================
|
|
1937
|
+
/**
|
|
1938
|
+
* Reads a single file's content from the application.
|
|
1939
|
+
*
|
|
1940
|
+
* Handles virtual path translation for files managed by the VirtualFileSystem:
|
|
1941
|
+
* - Virtual paths are read via the appropriate handler
|
|
1942
|
+
* - Regular files are read directly from disk
|
|
1943
|
+
*
|
|
1944
|
+
* @param relativePath - The virtual path relative to app root
|
|
1945
|
+
* @param options - Optional read options
|
|
1946
|
+
* @param options.offset - Line number to start reading from (1-indexed)
|
|
1947
|
+
* @param options.limit - Number of lines to read
|
|
1948
|
+
* @returns The file content as a string
|
|
1949
|
+
* @throws Error if file does not exist or cannot be read
|
|
1950
|
+
*/
|
|
1951
|
+
async readFile(relativePath, options) {
|
|
1952
|
+
return await this.enqueueFsOperation("readFile", async () => {
|
|
1953
|
+
const content = await this.readFileInternal(relativePath, options);
|
|
1954
|
+
// Auto-track successful reads to allow subsequent writes
|
|
1955
|
+
this.markRead(relativePath);
|
|
1956
|
+
return content;
|
|
1957
|
+
}, {
|
|
1958
|
+
appShellQueueHasLimit: Boolean(options?.limit),
|
|
1959
|
+
appShellQueueHasOffset: Boolean(options?.offset),
|
|
1960
|
+
appShellQueuePath: relativePath,
|
|
1961
|
+
});
|
|
1962
|
+
}
|
|
1963
|
+
/**
|
|
1964
|
+
* Internal read implementation (no queue).
|
|
1965
|
+
* Use this from other methods that are already enqueued to avoid deadlock.
|
|
1966
|
+
*/
|
|
1967
|
+
async readFileInternal(relativePath, options) {
|
|
1968
|
+
const logger = getLogger();
|
|
1969
|
+
let content;
|
|
1970
|
+
const isVirtual = this.virtualFs.isVirtualPath(relativePath);
|
|
1971
|
+
logger.info(`[AppShell.readFileInternal] path="${relativePath}", isVirtual=${isVirtual}`);
|
|
1972
|
+
// Try virtual filesystem first
|
|
1973
|
+
if (isVirtual) {
|
|
1974
|
+
logger.info(`[AppShell.readFileInternal] Reading via VirtualFileSystem: ${relativePath}`);
|
|
1975
|
+
const virtualContent = await this.virtualFs.read(relativePath, {
|
|
1976
|
+
appRootDirPath: this.appRootDirPath,
|
|
1977
|
+
templateRenderer: this.templateRenderer,
|
|
1978
|
+
});
|
|
1979
|
+
if (virtualContent === undefined) {
|
|
1980
|
+
const info = this.virtualFs.parse(relativePath);
|
|
1981
|
+
const name = info?.params.apiName ?? relativePath;
|
|
1982
|
+
logger.warn(`[AppShell.readFileInternal] Virtual file not found: ${relativePath}`);
|
|
1983
|
+
throw new Error(`${name} not found. Use the appropriate tool to create it.`);
|
|
1984
|
+
}
|
|
1985
|
+
logger.info(`[AppShell.readFileInternal] Virtual file read success: ${relativePath} (${virtualContent.length} chars)`);
|
|
1986
|
+
content = virtualContent;
|
|
1987
|
+
}
|
|
1988
|
+
else if (this.virtualFs.isPhysicalPath(relativePath)) {
|
|
1989
|
+
// Block direct reads of physical API files
|
|
1990
|
+
throw new Error(this.virtualFs.getBlockedReadError(relativePath));
|
|
1991
|
+
}
|
|
1992
|
+
else {
|
|
1993
|
+
// Regular file read
|
|
1994
|
+
logger.info(`[AppShell.readFileInternal] Reading from disk: ${relativePath}`);
|
|
1995
|
+
const absolutePath = path.join(this.appRootDirPath, relativePath);
|
|
1996
|
+
content = await fsReadFile(absolutePath, "utf-8");
|
|
1997
|
+
}
|
|
1998
|
+
// Apply offset and limit if provided
|
|
1999
|
+
if (options?.offset || options?.limit) {
|
|
2000
|
+
const lines = content.split("\n");
|
|
2001
|
+
const startLine = options.offset ? options.offset - 1 : 0;
|
|
2002
|
+
const endLine = options.limit ? startLine + options.limit : lines.length;
|
|
2003
|
+
return lines.slice(startLine, endLine).join("\n");
|
|
2004
|
+
}
|
|
2005
|
+
return content;
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Writes content to a file as a draft.
|
|
2009
|
+
*
|
|
2010
|
+
* Handles virtual path translation for files managed by the VirtualFileSystem:
|
|
2011
|
+
* - Virtual paths are written via the appropriate handler
|
|
2012
|
+
* - Regular files are written via the draft interface
|
|
2013
|
+
*
|
|
2014
|
+
* @param relativePath - Virtual path relative to app root
|
|
2015
|
+
* @param content - File content to write
|
|
2016
|
+
* @param options - Optional write options
|
|
2017
|
+
* @param options.bypassRequireRead - Skip the read-before-write check (use for new files)
|
|
2018
|
+
* @throws Error if path is blacklisted, restricted, or draft manager not configured
|
|
2019
|
+
* @throws Error if file requires reading first (unless bypassed)
|
|
2020
|
+
*/
|
|
2021
|
+
async writeFile(relativePath, content, options) {
|
|
2022
|
+
if (!this.draftManager) {
|
|
2023
|
+
throw new Error("DraftInterface is required to write files. Configure AppShell with a draftInterface.");
|
|
2024
|
+
}
|
|
2025
|
+
// Enforce read-before-write unless explicitly bypassed
|
|
2026
|
+
if (!options?.bypassRequireRead && this.isReadRequired(relativePath)) {
|
|
2027
|
+
throw new Error(`Cannot write to ${relativePath} without reading it first. Please read the file before attempting to write to it.`);
|
|
2028
|
+
}
|
|
2029
|
+
const executeStart = performance.now();
|
|
2030
|
+
await this.writeFileInternal(relativePath, content);
|
|
2031
|
+
llmobs.annotate({
|
|
2032
|
+
metadata: {
|
|
2033
|
+
appShellQueueExecuteMs: Math.round(performance.now() - executeStart),
|
|
2034
|
+
appShellQueueOperation: "writeFile",
|
|
2035
|
+
appShellQueuePath: relativePath,
|
|
2036
|
+
},
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
/**
|
|
2040
|
+
* Internal write implementation.
|
|
2041
|
+
* Called directly by writeFile (no queue wrapper needed since draftInterface queues).
|
|
2042
|
+
*/
|
|
2043
|
+
async writeFileInternal(relativePath, rawContent) {
|
|
2044
|
+
// Deterministic safety net: rewrite value imports of `lucide-react/dynamic`
|
|
2045
|
+
// type-only exports (e.g. `IconName`) into type imports. A stray value
|
|
2046
|
+
// import compiles but crashes the app at runtime and blanks the preview,
|
|
2047
|
+
// which blocks UI verification (APPS-4518). Applied here — the shared sink
|
|
2048
|
+
// for every persist path (write, copy, copyDirectory, rename) — so files
|
|
2049
|
+
// brought in via copy are covered too. No-op for unaffected files; for
|
|
2050
|
+
// Buffer content we only decode-and-replace when a fix actually applies.
|
|
2051
|
+
let content = rawContent;
|
|
2052
|
+
if (isFixableLucidePath(relativePath)) {
|
|
2053
|
+
if (typeof content === "string") {
|
|
2054
|
+
content = fixLucideDynamicTypeImports(content);
|
|
2055
|
+
}
|
|
2056
|
+
else if (Buffer.isBuffer(content)) {
|
|
2057
|
+
const text = content.toString("utf8");
|
|
2058
|
+
const fixed = fixLucideDynamicTypeImports(text);
|
|
2059
|
+
if (fixed !== text) {
|
|
2060
|
+
content = fixed;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
const isVirtual = this.virtualFs.isVirtualPath(relativePath);
|
|
2065
|
+
if (Buffer.isBuffer(content) && isVirtual) {
|
|
2066
|
+
throw new Error(`Cannot write binary content to virtual file: ${relativePath}`);
|
|
2067
|
+
}
|
|
2068
|
+
if (!isVirtual) {
|
|
2069
|
+
validateFileOperation("write", relativePath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2070
|
+
if (relativePath.endsWith(".ts") || relativePath.endsWith(".tsx")) {
|
|
2071
|
+
try {
|
|
2072
|
+
parseTsxModule(typeof content === "string" ? content : content.toString("utf8"), relativePath);
|
|
2073
|
+
}
|
|
2074
|
+
catch (error) {
|
|
2075
|
+
getLogger().warn(`TSX parse validation rejected write: ${relativePath}`, getErrorMeta(error));
|
|
2076
|
+
emitWriteTsxParseRejectedMetric(relativePath.endsWith(".tsx") ? "tsx" : "ts");
|
|
2077
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2078
|
+
throw new ToolExecutionError(`${relativePath}: ${message}`);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
if (isVirtual) {
|
|
2083
|
+
await this.virtualFs.write(relativePath, content, {
|
|
2084
|
+
appRootDirPath: this.appRootDirPath,
|
|
2085
|
+
});
|
|
2086
|
+
await this.draftManager.createDraftMarker(relativePath);
|
|
2087
|
+
return;
|
|
2088
|
+
}
|
|
2089
|
+
const absolutePath = path.join(this.appRootDirPath, relativePath);
|
|
2090
|
+
await mkdir(path.dirname(absolutePath), { recursive: true });
|
|
2091
|
+
await this.draftManager.createDraft(relativePath, content);
|
|
2092
|
+
}
|
|
2093
|
+
resolveAppRelativePath(relativePath, direction) {
|
|
2094
|
+
if (path.isAbsolute(relativePath)) {
|
|
2095
|
+
throw new Error(`Cannot copy ${direction} outside the application root: ${relativePath}`);
|
|
2096
|
+
}
|
|
2097
|
+
const absolutePath = path.resolve(this.appRootDirPath, relativePath);
|
|
2098
|
+
const relativeToRoot = path.relative(this.appRootDirPath, absolutePath);
|
|
2099
|
+
if (relativeToRoot === ".." ||
|
|
2100
|
+
relativeToRoot.startsWith(`..${path.sep}`) ||
|
|
2101
|
+
path.isAbsolute(relativeToRoot)) {
|
|
2102
|
+
throw new Error(`Cannot copy ${direction} outside the application root: ${relativePath}`);
|
|
2103
|
+
}
|
|
2104
|
+
return absolutePath;
|
|
2105
|
+
}
|
|
2106
|
+
createEmptyCopyResult(verbose) {
|
|
2107
|
+
return {
|
|
2108
|
+
copied: verbose ? [] : undefined,
|
|
2109
|
+
copiedCount: 0,
|
|
2110
|
+
rejected: verbose ? [] : undefined,
|
|
2111
|
+
rejectedCount: 0,
|
|
2112
|
+
skipped: verbose ? [] : undefined,
|
|
2113
|
+
skippedCount: 0,
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
recordCopied(result, path) {
|
|
2117
|
+
result.copiedCount += 1;
|
|
2118
|
+
result.copied?.push(path);
|
|
2119
|
+
}
|
|
2120
|
+
recordSkipped(result, path, reason) {
|
|
2121
|
+
result.skippedCount += 1;
|
|
2122
|
+
result.skipped?.push({ path, reason });
|
|
2123
|
+
}
|
|
2124
|
+
recordRejected(result, path, reason) {
|
|
2125
|
+
result.rejectedCount += 1;
|
|
2126
|
+
result.rejected?.push({ path, reason });
|
|
2127
|
+
}
|
|
2128
|
+
finalizeCopyResult(result) {
|
|
2129
|
+
if (result.copied === undefined) {
|
|
2130
|
+
delete result.copied;
|
|
2131
|
+
}
|
|
2132
|
+
if (result.skipped === undefined) {
|
|
2133
|
+
delete result.skipped;
|
|
2134
|
+
}
|
|
2135
|
+
if (result.rejected === undefined) {
|
|
2136
|
+
delete result.rejected;
|
|
2137
|
+
}
|
|
2138
|
+
return result;
|
|
2139
|
+
}
|
|
2140
|
+
async copyFileInternal({ conflictStrategy = "fail", destinationPath, result, sourcePath, }) {
|
|
2141
|
+
const absoluteSourcePath = this.resolveAppRelativePath(sourcePath, "from");
|
|
2142
|
+
this.resolveAppRelativePath(destinationPath, "to");
|
|
2143
|
+
validateFileOperation("write", destinationPath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2144
|
+
const destinationExists = await this.pathExists(destinationPath);
|
|
2145
|
+
if (destinationExists) {
|
|
2146
|
+
if (conflictStrategy === "skip") {
|
|
2147
|
+
this.recordSkipped(result, destinationPath, "destination_exists");
|
|
2148
|
+
return;
|
|
2149
|
+
}
|
|
2150
|
+
if (conflictStrategy === "fail") {
|
|
2151
|
+
throw new Error(`Copy failed: ${destinationPath} already exists`);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
const stats = await stat(absoluteSourcePath);
|
|
2155
|
+
if (!stats.isFile()) {
|
|
2156
|
+
throw new Error(`Copy failed: ${sourcePath} is not a file`);
|
|
2157
|
+
}
|
|
2158
|
+
const content = await fsReadFile(absoluteSourcePath);
|
|
2159
|
+
await this.writeFileInternal(destinationPath, content);
|
|
2160
|
+
this.recordCopied(result, destinationPath);
|
|
2161
|
+
}
|
|
2162
|
+
async preflightCopyFile({ destinationPath, sourcePath, }) {
|
|
2163
|
+
const absoluteSourcePath = this.resolveAppRelativePath(sourcePath, "from");
|
|
2164
|
+
this.resolveAppRelativePath(destinationPath, "to");
|
|
2165
|
+
validateFileOperation("write", destinationPath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2166
|
+
if (await this.pathExists(destinationPath)) {
|
|
2167
|
+
throw new Error(`Copy failed: ${destinationPath} already exists`);
|
|
2168
|
+
}
|
|
2169
|
+
const stats = await stat(absoluteSourcePath);
|
|
2170
|
+
if (!stats.isFile()) {
|
|
2171
|
+
throw new Error(`Copy failed: ${sourcePath} is not a file`);
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
async copyFile(options) {
|
|
2175
|
+
if (!this.draftManager) {
|
|
2176
|
+
throw new Error("DraftInterface is required to copy files. Configure AppShell with a draftInterface.");
|
|
2177
|
+
}
|
|
2178
|
+
const executeStart = performance.now();
|
|
2179
|
+
const result = this.createEmptyCopyResult(Boolean(options.verbose));
|
|
2180
|
+
await this.copyFileInternal({
|
|
2181
|
+
conflictStrategy: options.conflictStrategy,
|
|
2182
|
+
destinationPath: options.destinationPath,
|
|
2183
|
+
result,
|
|
2184
|
+
sourcePath: options.sourcePath,
|
|
2185
|
+
});
|
|
2186
|
+
llmobs.annotate({
|
|
2187
|
+
metadata: {
|
|
2188
|
+
appShellQueueExecuteMs: Math.round(performance.now() - executeStart),
|
|
2189
|
+
appShellQueueOperation: "copyFile",
|
|
2190
|
+
appShellQueuePath: options.destinationPath,
|
|
2191
|
+
},
|
|
2192
|
+
});
|
|
2193
|
+
return this.finalizeCopyResult(result);
|
|
2194
|
+
}
|
|
2195
|
+
async collectDirectoryCopyEntries({ absoluteSourceDir, destinationDir, result, sourceDir, }) {
|
|
2196
|
+
const entries = [];
|
|
2197
|
+
const walk = async (currentAbsoluteDir, currentSourceDir, currentDestinationDir) => {
|
|
2198
|
+
const dirEntries = await readdir(currentAbsoluteDir, {
|
|
2199
|
+
withFileTypes: true,
|
|
2200
|
+
});
|
|
2201
|
+
for (const entry of dirEntries) {
|
|
2202
|
+
const sourcePath = path.join(currentSourceDir, entry.name);
|
|
2203
|
+
const destinationPath = path.join(currentDestinationDir, entry.name);
|
|
2204
|
+
if (entry.isSymbolicLink()) {
|
|
2205
|
+
this.recordRejected(result, destinationPath, "Cannot copy symbolic links");
|
|
2206
|
+
continue;
|
|
2207
|
+
}
|
|
2208
|
+
if (entry.isDirectory()) {
|
|
2209
|
+
if (DEFAULT_COPY_DIRECTORY_EXCLUDES.has(entry.name)) {
|
|
2210
|
+
this.recordSkipped(result, destinationPath, "default_excluded");
|
|
2211
|
+
continue;
|
|
2212
|
+
}
|
|
2213
|
+
await walk(path.join(currentAbsoluteDir, entry.name), sourcePath, destinationPath);
|
|
2214
|
+
continue;
|
|
2215
|
+
}
|
|
2216
|
+
if (entry.isFile()) {
|
|
2217
|
+
entries.push({ destinationPath, sourcePath });
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
};
|
|
2221
|
+
await walk(absoluteSourceDir, sourceDir, destinationDir);
|
|
2222
|
+
return entries;
|
|
2223
|
+
}
|
|
2224
|
+
async copyDirectory(options) {
|
|
2225
|
+
if (!this.draftManager) {
|
|
2226
|
+
throw new Error("DraftInterface is required to copy directories. Configure AppShell with a draftInterface.");
|
|
2227
|
+
}
|
|
2228
|
+
const executeStart = performance.now();
|
|
2229
|
+
const result = this.createEmptyCopyResult(Boolean(options.verbose));
|
|
2230
|
+
const absoluteSourceDir = this.resolveAppRelativePath(options.sourceDir, "from");
|
|
2231
|
+
this.resolveAppRelativePath(options.destinationDir, "to");
|
|
2232
|
+
const sourceStats = await stat(absoluteSourceDir);
|
|
2233
|
+
if (!sourceStats.isDirectory()) {
|
|
2234
|
+
throw new Error(`Copy failed: ${options.sourceDir} is not a directory`);
|
|
2235
|
+
}
|
|
2236
|
+
const entries = await this.collectDirectoryCopyEntries({
|
|
2237
|
+
absoluteSourceDir,
|
|
2238
|
+
destinationDir: options.destinationDir,
|
|
2239
|
+
result,
|
|
2240
|
+
sourceDir: options.sourceDir,
|
|
2241
|
+
});
|
|
2242
|
+
if ((options.conflictStrategy ?? "fail") === "fail") {
|
|
2243
|
+
for (const entry of entries) {
|
|
2244
|
+
await this.preflightCopyFile(entry);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
for (const entry of entries) {
|
|
2248
|
+
await this.copyFileInternal({
|
|
2249
|
+
// The "fail" strategy is preflighted above so we avoid copying part of
|
|
2250
|
+
// a directory before discovering an existing destination. This is not
|
|
2251
|
+
// fully atomic: a destination could still appear between preflight and
|
|
2252
|
+
// write. Closing that race properly needs a reentrant fs-operation lock
|
|
2253
|
+
// so the whole directory copy can hold the lock while nested draft
|
|
2254
|
+
// writes reuse the parent lock instead of deadlocking.
|
|
2255
|
+
conflictStrategy: (options.conflictStrategy ?? "fail") === "fail"
|
|
2256
|
+
? "replace"
|
|
2257
|
+
: options.conflictStrategy,
|
|
2258
|
+
destinationPath: entry.destinationPath,
|
|
2259
|
+
result,
|
|
2260
|
+
sourcePath: entry.sourcePath,
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
llmobs.annotate({
|
|
2264
|
+
metadata: {
|
|
2265
|
+
appShellQueueExecuteMs: Math.round(performance.now() - executeStart),
|
|
2266
|
+
appShellQueueOperation: "copyDirectory",
|
|
2267
|
+
appShellQueuePath: options.destinationDir,
|
|
2268
|
+
},
|
|
2269
|
+
});
|
|
2270
|
+
return this.finalizeCopyResult(result);
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Deletes a file or directory as a draft operation.
|
|
2274
|
+
*
|
|
2275
|
+
* Handles virtual path translation for files managed by the VirtualFileSystem:
|
|
2276
|
+
* - Virtual paths delete via the appropriate handler
|
|
2277
|
+
* - Regular files/directories are deleted via the draft interface
|
|
2278
|
+
*
|
|
2279
|
+
* @param relativePath - Virtual path relative to app root
|
|
2280
|
+
* @throws Error if path is protected or draft manager not configured
|
|
2281
|
+
*/
|
|
2282
|
+
async deleteFile(relativePath) {
|
|
2283
|
+
if (!this.draftManager) {
|
|
2284
|
+
throw new Error("DraftInterface is required to delete files. Configure AppShell with a draftInterface.");
|
|
2285
|
+
}
|
|
2286
|
+
await this.deleteFileInternal(relativePath);
|
|
2287
|
+
}
|
|
2288
|
+
/**
|
|
2289
|
+
* Internal delete implementation.
|
|
2290
|
+
* Called directly by deleteFile (no queue wrapper needed since draftInterface queues).
|
|
2291
|
+
*/
|
|
2292
|
+
async deleteFileInternal(relativePath) {
|
|
2293
|
+
// Handle virtual paths
|
|
2294
|
+
if (this.virtualFs.isVirtualPath(relativePath)) {
|
|
2295
|
+
await this.virtualFs.delete(relativePath, {
|
|
2296
|
+
appRootDirPath: this.appRootDirPath,
|
|
2297
|
+
createDraftDelete: this.draftManager.createDraftDelete.bind(this.draftManager),
|
|
2298
|
+
});
|
|
2299
|
+
return;
|
|
2300
|
+
}
|
|
2301
|
+
// Validate the operation for non-virtual files
|
|
2302
|
+
validateFileOperation("delete", relativePath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2303
|
+
const absolutePath = path.join(this.appRootDirPath, relativePath);
|
|
2304
|
+
// Check if path exists and what type it is
|
|
2305
|
+
let stats;
|
|
2306
|
+
try {
|
|
2307
|
+
stats = await stat(absolutePath);
|
|
2308
|
+
}
|
|
2309
|
+
catch {
|
|
2310
|
+
throw new Error(`File or directory ${relativePath} not found`);
|
|
2311
|
+
}
|
|
2312
|
+
if (stats.isDirectory()) {
|
|
2313
|
+
// Recursively delete directory contents
|
|
2314
|
+
await this.deleteDirectoryRecursive(absolutePath);
|
|
2315
|
+
// Remove the directory itself
|
|
2316
|
+
await rm(absolutePath, { recursive: true, force: true });
|
|
2317
|
+
}
|
|
2318
|
+
else {
|
|
2319
|
+
// Single file deletion
|
|
2320
|
+
await this.draftManager.createDraftDelete(relativePath);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
/**
|
|
2324
|
+
* Implementation of listFiles supporting both signatures.
|
|
2325
|
+
*/
|
|
2326
|
+
async listFiles(patterns, options) {
|
|
2327
|
+
return await this.enqueueFsOperation("listFiles", async () => {
|
|
2328
|
+
const { includeMetadata, ...restOptions } = options ?? {};
|
|
2329
|
+
// Get virtualized file paths
|
|
2330
|
+
const allPaths = await this.listFilesInternal(patterns, restOptions);
|
|
2331
|
+
// Return paths only if metadata not requested
|
|
2332
|
+
if (!includeMetadata) {
|
|
2333
|
+
return allPaths;
|
|
2334
|
+
}
|
|
2335
|
+
// Gather metadata for each path
|
|
2336
|
+
return await this.getFileMetadataList(allPaths);
|
|
2337
|
+
}, {
|
|
2338
|
+
appShellQueueIncludeMetadata: Boolean(options?.includeMetadata),
|
|
2339
|
+
appShellQueuePatternCount: patterns?.length ?? 0,
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
/**
|
|
2343
|
+
* Internal list implementation (no queue).
|
|
2344
|
+
* Use this from other methods that are already enqueued to avoid deadlock.
|
|
2345
|
+
*
|
|
2346
|
+
* @param patterns - Glob patterns to match
|
|
2347
|
+
* @param options - Glob options
|
|
2348
|
+
* @returns Array of virtualized file paths (physical API paths converted to virtual)
|
|
2349
|
+
*/
|
|
2350
|
+
async listFilesInternal(patterns, options) {
|
|
2351
|
+
const patternsToUse = patterns ?? [...APPLICATION_FILE_PATTERNS];
|
|
2352
|
+
const { includeDirs, ...globOptions } = options ?? {};
|
|
2353
|
+
const files = await glob(patternsToUse, {
|
|
2354
|
+
cwd: this.appRootDirPath,
|
|
2355
|
+
absolute: false,
|
|
2356
|
+
nodir: !includeDirs,
|
|
2357
|
+
ignore: [...STANDARD_IGNORE_PATTERNS],
|
|
2358
|
+
...globOptions,
|
|
2359
|
+
});
|
|
2360
|
+
// Convert physical paths to virtual paths using VFS
|
|
2361
|
+
const virtualPaths = this.virtualFs.toVirtualPaths(files);
|
|
2362
|
+
// Discover virtual files from scratch (newly created, not yet persisted)
|
|
2363
|
+
const scratchApiFiles = await glob(".superblocks/scratch/apis%2F*.ts", {
|
|
2364
|
+
cwd: this.appRootDirPath,
|
|
2365
|
+
absolute: false,
|
|
2366
|
+
nodir: true,
|
|
2367
|
+
});
|
|
2368
|
+
const scratchVirtualPaths = scratchApiFiles
|
|
2369
|
+
.map((f) => {
|
|
2370
|
+
const match = f.match(/apis%2F(.+)\.ts$/);
|
|
2371
|
+
return match ? `apis/${match[1]}.ts` : null;
|
|
2372
|
+
})
|
|
2373
|
+
.filter((f) => f !== null);
|
|
2374
|
+
// Combine and deduplicate
|
|
2375
|
+
return Array.from(new Set([...virtualPaths, ...scratchVirtualPaths]));
|
|
2376
|
+
}
|
|
2377
|
+
/**
|
|
2378
|
+
* Gets metadata for a list of file paths.
|
|
2379
|
+
*
|
|
2380
|
+
* @param paths - Array of virtual paths to get metadata for
|
|
2381
|
+
* @returns Array of FileMetadata objects (excludes paths that don't exist)
|
|
2382
|
+
*/
|
|
2383
|
+
async getFileMetadataList(paths) {
|
|
2384
|
+
const results = [];
|
|
2385
|
+
for (const virtualPath of paths) {
|
|
2386
|
+
const metadata = await this.getFileMetadata(virtualPath);
|
|
2387
|
+
if (metadata) {
|
|
2388
|
+
results.push(metadata);
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
return results;
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Gets metadata for a single file path.
|
|
2395
|
+
*
|
|
2396
|
+
* @param virtualPath - The virtual path to get metadata for
|
|
2397
|
+
* @returns FileMetadata or undefined if file doesn't exist
|
|
2398
|
+
*/
|
|
2399
|
+
async getFileMetadata(virtualPath) {
|
|
2400
|
+
// Check if virtual file - use handler's getMetadata if available
|
|
2401
|
+
if (this.virtualFs.isVirtualPath(virtualPath)) {
|
|
2402
|
+
const handler = this.virtualFs.getHandler(virtualPath);
|
|
2403
|
+
if (handler?.getMetadata) {
|
|
2404
|
+
return handler.getMetadata(virtualPath, {
|
|
2405
|
+
appRootDirPath: this.appRootDirPath,
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
// Fallback: derive metadata from scratch file for API files
|
|
2409
|
+
return this.getApiFileMetadata(virtualPath);
|
|
2410
|
+
}
|
|
2411
|
+
// Regular file - use fs.stat
|
|
2412
|
+
const absolutePath = path.join(this.appRootDirPath, virtualPath);
|
|
2413
|
+
try {
|
|
2414
|
+
const stats = await stat(absolutePath);
|
|
2415
|
+
return {
|
|
2416
|
+
path: virtualPath,
|
|
2417
|
+
size: stats.size,
|
|
2418
|
+
mtime: stats.mtime,
|
|
2419
|
+
isDirectory: stats.isDirectory(),
|
|
2420
|
+
isFile: stats.isFile(),
|
|
2421
|
+
};
|
|
2422
|
+
}
|
|
2423
|
+
catch {
|
|
2424
|
+
return undefined;
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Gets metadata for a virtual API file.
|
|
2429
|
+
* Checks scratch file first (for pending changes), then falls back to YAML.
|
|
2430
|
+
*
|
|
2431
|
+
* @param virtualPath - The virtual API path (e.g., "apis/MyAPI.ts")
|
|
2432
|
+
* @returns FileMetadata or undefined if not found
|
|
2433
|
+
*/
|
|
2434
|
+
async getApiFileMetadata(virtualPath) {
|
|
2435
|
+
// Check scratch file first (for pending changes)
|
|
2436
|
+
const scratchPath = `.superblocks/scratch/${encodeURIComponent(virtualPath)}`;
|
|
2437
|
+
const absoluteScratchPath = path.join(this.appRootDirPath, scratchPath);
|
|
2438
|
+
try {
|
|
2439
|
+
const stats = await stat(absoluteScratchPath);
|
|
2440
|
+
return {
|
|
2441
|
+
path: virtualPath,
|
|
2442
|
+
size: stats.size,
|
|
2443
|
+
mtime: stats.mtime,
|
|
2444
|
+
isDirectory: false,
|
|
2445
|
+
isFile: true,
|
|
2446
|
+
};
|
|
2447
|
+
}
|
|
2448
|
+
catch {
|
|
2449
|
+
// Fall back to YAML directory
|
|
2450
|
+
}
|
|
2451
|
+
// Try to find the API YAML file
|
|
2452
|
+
const info = this.virtualFs.parse(virtualPath);
|
|
2453
|
+
if (info?.params.apiName) {
|
|
2454
|
+
const yamlPath = `apis/${info.params.apiName}/api.yaml`;
|
|
2455
|
+
const absoluteYamlPath = path.join(this.appRootDirPath, yamlPath);
|
|
2456
|
+
try {
|
|
2457
|
+
const stats = await stat(absoluteYamlPath);
|
|
2458
|
+
return {
|
|
2459
|
+
path: virtualPath,
|
|
2460
|
+
size: stats.size,
|
|
2461
|
+
mtime: stats.mtime,
|
|
2462
|
+
isDirectory: false,
|
|
2463
|
+
isFile: true,
|
|
2464
|
+
};
|
|
2465
|
+
}
|
|
2466
|
+
catch {
|
|
2467
|
+
return undefined;
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
return undefined;
|
|
2471
|
+
}
|
|
2472
|
+
/**
|
|
2473
|
+
* Renames or moves a file.
|
|
2474
|
+
*
|
|
2475
|
+
* Implemented as read + write + delete to work with the draft system.
|
|
2476
|
+
*
|
|
2477
|
+
* @param oldPath - Current virtual path
|
|
2478
|
+
* @param newPath - New virtual path
|
|
2479
|
+
* @throws Error if old file doesn't exist or new path is invalid
|
|
2480
|
+
* @throws Error if old file requires reading first
|
|
2481
|
+
*/
|
|
2482
|
+
async renameFile(oldPath, newPath) {
|
|
2483
|
+
if (!this.draftManager) {
|
|
2484
|
+
throw new Error("DraftInterface is required to rename files. Configure AppShell with a draftInterface.");
|
|
2485
|
+
}
|
|
2486
|
+
// Validate both paths
|
|
2487
|
+
validateFileOperation("rename", oldPath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2488
|
+
validateFileOperation("write", newPath, this.appRootDirPath, undefined, this.pathValidator, this.getFileOperationBlacklistOptions());
|
|
2489
|
+
// Enforce read-before-write on the source file
|
|
2490
|
+
if (this.isReadRequired(oldPath)) {
|
|
2491
|
+
throw new Error(`Cannot rename ${oldPath} without reading it first. Please read the file before attempting to rename it.`);
|
|
2492
|
+
}
|
|
2493
|
+
// Read content first (this is just fs read, no queue needed)
|
|
2494
|
+
const content = await this.readFileInternal(oldPath);
|
|
2495
|
+
await this.writeFileInternal(newPath, content);
|
|
2496
|
+
await this.deleteFileInternal(oldPath);
|
|
2497
|
+
}
|
|
2498
|
+
// ============================================================================
|
|
2499
|
+
// Draft Management
|
|
2500
|
+
// ============================================================================
|
|
2501
|
+
/**
|
|
2502
|
+
* Checks if there are any pending draft changes.
|
|
2503
|
+
*
|
|
2504
|
+
* @returns true if there are uncommitted draft changes
|
|
2505
|
+
*/
|
|
2506
|
+
async hasDraftChanges() {
|
|
2507
|
+
if (!this.draftManager) {
|
|
2508
|
+
return false;
|
|
2509
|
+
}
|
|
2510
|
+
return await this.draftManager.hasDraftChanges();
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* Gets a unified diff of pending draft changes.
|
|
2514
|
+
*
|
|
2515
|
+
* @param paths - Optional specific paths to diff. If empty, diffs all changes.
|
|
2516
|
+
* @returns Unified diff string
|
|
2517
|
+
*/
|
|
2518
|
+
async getDraftDiff(paths) {
|
|
2519
|
+
if (!this.draftManager) {
|
|
2520
|
+
return "";
|
|
2521
|
+
}
|
|
2522
|
+
return await this.draftManager.getDraftDiff(paths);
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* Gets categorized draft changes.
|
|
2526
|
+
*
|
|
2527
|
+
* @returns Object containing arrays of edited, added, and deleted paths
|
|
2528
|
+
*/
|
|
2529
|
+
async getDraftChanges() {
|
|
2530
|
+
if (!this.draftManager) {
|
|
2531
|
+
return { edits: [], additions: [], deletions: [] };
|
|
2532
|
+
}
|
|
2533
|
+
return await this.draftManager.getDraftChanges();
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Gets the underlying draft interface for direct access.
|
|
2537
|
+
*
|
|
2538
|
+
* This should only be used for advanced operations that require
|
|
2539
|
+
* direct access to the draft interface. Prefer using the AppShell
|
|
2540
|
+
* methods when possible.
|
|
2541
|
+
*
|
|
2542
|
+
* @internal
|
|
2543
|
+
*/
|
|
2544
|
+
getDraftInterface() {
|
|
2545
|
+
return this.draftManager?.getInterface();
|
|
2546
|
+
}
|
|
2547
|
+
// ============================================================================
|
|
2548
|
+
// Read Tracking (Read-Before-Write Enforcement)
|
|
2549
|
+
// ============================================================================
|
|
2550
|
+
/**
|
|
2551
|
+
* Check if a file must be read before it can be written.
|
|
2552
|
+
*
|
|
2553
|
+
* @param relativePath - The path to check
|
|
2554
|
+
* @returns true if the file must be read before writing
|
|
2555
|
+
*/
|
|
2556
|
+
isReadRequired(relativePath) {
|
|
2557
|
+
return this.requiredReads.has(relativePath);
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Mark a file as requiring a read before write.
|
|
2561
|
+
*
|
|
2562
|
+
* Call this when a file has been modified externally (e.g., by lint/format)
|
|
2563
|
+
* to ensure the AI reads the updated content before making further changes.
|
|
2564
|
+
*
|
|
2565
|
+
* @param relativePath - The path to mark as requiring read
|
|
2566
|
+
*/
|
|
2567
|
+
requireRead(relativePath) {
|
|
2568
|
+
this.requiredReads.add(relativePath);
|
|
2569
|
+
}
|
|
2570
|
+
/**
|
|
2571
|
+
* Mark a file as having been read, allowing subsequent writes.
|
|
2572
|
+
* Called internally after successful read operations.
|
|
2573
|
+
*/
|
|
2574
|
+
markRead(relativePath) {
|
|
2575
|
+
this.requiredReads.delete(relativePath);
|
|
2576
|
+
}
|
|
2577
|
+
getFileOperationBlacklistOptions() {
|
|
2578
|
+
return {
|
|
2579
|
+
useLessProtectedPatterns: this.enableDeletingLockfiles,
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
// ============================================================================
|
|
2583
|
+
// Private Helpers
|
|
2584
|
+
// ============================================================================
|
|
2585
|
+
/**
|
|
2586
|
+
* Recursively deletes directory contents by creating draft deletes.
|
|
2587
|
+
*/
|
|
2588
|
+
async deleteDirectoryRecursive(dirPath) {
|
|
2589
|
+
if (!this.draftManager) {
|
|
2590
|
+
throw new Error("DraftInterface is required for directory deletion");
|
|
2591
|
+
}
|
|
2592
|
+
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
2593
|
+
for (const entry of entries) {
|
|
2594
|
+
const fullPath = path.join(dirPath, entry.name);
|
|
2595
|
+
const relativePath = path.relative(this.appRootDirPath, fullPath);
|
|
2596
|
+
if (entry.isDirectory()) {
|
|
2597
|
+
await this.deleteDirectoryRecursive(fullPath);
|
|
2598
|
+
}
|
|
2599
|
+
else {
|
|
2600
|
+
await this.draftManager.createDraftDelete(relativePath);
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
})();
|
|
2606
|
+
export { AppShell };
|
|
81
2607
|
//# sourceMappingURL=shell.js.map
|