@superblocksteam/vite-plugin-file-sync 2.0.177 → 2.0.178-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-tool-executor/claude-drafts.d.ts +21 -0
- package/dist/agent-tool-executor/claude-drafts.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-drafts.js +35 -0
- package/dist/agent-tool-executor/claude-drafts.js.map +1 -0
- package/dist/agent-tool-executor/claude-file-tools.d.ts +133 -0
- package/dist/agent-tool-executor/claude-file-tools.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-file-tools.js +368 -0
- package/dist/agent-tool-executor/claude-file-tools.js.map +1 -0
- package/dist/agent-tool-executor/claude-protected-paths.d.ts +13 -0
- package/dist/agent-tool-executor/claude-protected-paths.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-protected-paths.js +100 -0
- package/dist/agent-tool-executor/claude-protected-paths.js.map +1 -0
- package/dist/agent-tool-executor/claude-sandbox-placeholders.d.ts +38 -0
- package/dist/agent-tool-executor/claude-sandbox-placeholders.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-sandbox-placeholders.js +132 -0
- package/dist/agent-tool-executor/claude-sandbox-placeholders.js.map +1 -0
- package/dist/agent-tool-executor/claude-sandbox.d.ts +59 -0
- package/dist/agent-tool-executor/claude-sandbox.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-sandbox.js +280 -0
- package/dist/agent-tool-executor/claude-sandbox.js.map +1 -0
- package/dist/agent-tool-executor/claude-shell.d.ts +139 -0
- package/dist/agent-tool-executor/claude-shell.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-shell.js +573 -0
- package/dist/agent-tool-executor/claude-shell.js.map +1 -0
- package/dist/agent-tool-executor/claude-tool-server.d.ts +27 -0
- package/dist/agent-tool-executor/claude-tool-server.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-tool-server.js +191 -0
- package/dist/agent-tool-executor/claude-tool-server.js.map +1 -0
- package/dist/agent-tool-executor/claude-tools.d.ts +29 -0
- package/dist/agent-tool-executor/claude-tools.d.ts.map +1 -0
- package/dist/agent-tool-executor/claude-tools.js +74 -0
- package/dist/agent-tool-executor/claude-tools.js.map +1 -0
- package/dist/agent-tool-executor/codex-drafts.d.ts +12 -0
- package/dist/agent-tool-executor/codex-drafts.d.ts.map +1 -0
- package/dist/agent-tool-executor/codex-drafts.js +48 -0
- package/dist/agent-tool-executor/codex-drafts.js.map +1 -0
- package/dist/agent-tool-executor/codex-exec-server.d.ts +42 -0
- package/dist/agent-tool-executor/codex-exec-server.d.ts.map +1 -0
- package/dist/agent-tool-executor/codex-exec-server.js +370 -0
- package/dist/agent-tool-executor/codex-exec-server.js.map +1 -0
- package/dist/agent-tool-executor/codex-execution-policy.d.ts +31 -0
- package/dist/agent-tool-executor/codex-execution-policy.d.ts.map +1 -0
- package/dist/agent-tool-executor/codex-execution-policy.js +230 -0
- package/dist/agent-tool-executor/codex-execution-policy.js.map +1 -0
- package/dist/agent-tool-executor/codex-instruction-files.d.ts +9 -0
- package/dist/agent-tool-executor/codex-instruction-files.d.ts.map +1 -0
- package/dist/agent-tool-executor/codex-instruction-files.js +37 -0
- package/dist/agent-tool-executor/codex-instruction-files.js.map +1 -0
- package/dist/agent-tool-executor/native-dotenv-watch-scope.d.ts +12 -0
- package/dist/agent-tool-executor/native-dotenv-watch-scope.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-dotenv-watch-scope.js +74 -0
- package/dist/agent-tool-executor/native-dotenv-watch-scope.js.map +1 -0
- package/dist/agent-tool-executor/native-draft-service.d.ts +20 -0
- package/dist/agent-tool-executor/native-draft-service.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-draft-service.js +2 -0
- package/dist/agent-tool-executor/native-draft-service.js.map +1 -0
- package/dist/agent-tool-executor/native-execution-sessions.d.ts +31 -0
- package/dist/agent-tool-executor/native-execution-sessions.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-execution-sessions.js +86 -0
- package/dist/agent-tool-executor/native-execution-sessions.js.map +1 -0
- package/dist/agent-tool-executor/native-file-access.d.ts +17 -0
- package/dist/agent-tool-executor/native-file-access.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-file-access.js +96 -0
- package/dist/agent-tool-executor/native-file-access.js.map +1 -0
- package/dist/agent-tool-executor/native-os-sandbox.d.ts +17 -0
- package/dist/agent-tool-executor/native-os-sandbox.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-os-sandbox.js +16 -0
- package/dist/agent-tool-executor/native-os-sandbox.js.map +1 -0
- package/dist/agent-tool-executor/native-tool-environment.d.ts +16 -0
- package/dist/agent-tool-executor/native-tool-environment.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-tool-environment.js +22 -0
- package/dist/agent-tool-executor/native-tool-environment.js.map +1 -0
- package/dist/agent-tool-executor/native-tool-servers.d.ts +42 -0
- package/dist/agent-tool-executor/native-tool-servers.d.ts.map +1 -0
- package/dist/agent-tool-executor/native-tool-servers.js +62 -0
- package/dist/agent-tool-executor/native-tool-servers.js.map +1 -0
- package/dist/ai-service/accepted-files-sync.d.ts +9 -0
- package/dist/ai-service/accepted-files-sync.d.ts.map +1 -0
- package/dist/ai-service/accepted-files-sync.js +10 -0
- package/dist/ai-service/accepted-files-sync.js.map +1 -0
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +3 -2
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +28 -11
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/security-scan-tools.d.ts +12 -0
- package/dist/ai-service/agent/security-scan-tools.d.ts.map +1 -0
- package/dist/ai-service/agent/security-scan-tools.js +44 -0
- package/dist/ai-service/agent/security-scan-tools.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js.map +1 -1
- package/dist/ai-service/agent/subagents/apis/examples.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -1
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +6 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-executor.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +3 -3
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/sample-json.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +87 -22
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +52 -50
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/write-api.d.ts +2 -2
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/branching/branch-tools.d.ts +211 -0
- package/dist/ai-service/agent/tools/branching/branch-tools.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/branching/branch-tools.js +333 -0
- package/dist/ai-service/agent/tools/branching/branch-tools.js.map +1 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +15 -7
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +13 -8
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -1
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-copy-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts +10 -10
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +3 -3
- package/dist/ai-service/agent/tools/build-finalize.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js +1 -1
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +11 -11
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-packages.d.ts +4 -2
- package/dist/ai-service/agent/tools/build-manage-packages.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-packages.js +9 -1
- package/dist/ai-service/agent/tools/build-manage-packages.js.map +1 -1
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts +7 -1
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-navigate-preview.js +5 -4
- package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.d.ts +1 -1
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-write-file.js +13 -5
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +42 -42
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +4 -3
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts +6 -6
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/get-logs.d.ts +13 -10
- package/dist/ai-service/agent/tools/get-logs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/get-logs.js +6 -3
- package/dist/ai-service/agent/tools/get-logs.js.map +1 -1
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts +2 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/get-runtime-errors.js +3 -2
- package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -1
- package/dist/ai-service/agent/tools/get-security-findings.d.ts +8 -8
- package/dist/ai-service/agent/tools/get-security-findings.js +1 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +5 -2
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +11 -18
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +61 -61
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +38 -23
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/integration-setup.js +55 -50
- package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts +6 -6
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
- package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts +1 -1
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js +1 -1
- package/dist/ai-service/agent/tools/rbac/effective-permissions.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/read-file-metrics.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +58 -58
- package/dist/ai-service/agent/tools/shared-helpers.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.d.ts +1 -5
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +44 -61
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -1
- package/dist/ai-service/agent/tools2/entity-permissions.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/registry.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +4 -4
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +5 -5
- package/dist/ai-service/agent/tools2/tools/bash.d.ts +6 -6
- package/dist/ai-service/agent/tools2/tools/check-task.d.ts +1 -1
- package/dist/ai-service/agent/tools2/tools/deploy-service.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts +1 -1
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts +4 -4
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +5 -5
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git-raw.d.ts +3 -3
- package/dist/ai-service/agent/tools2/tools/git.d.ts +11 -11
- package/dist/ai-service/agent/tools2/tools/git.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/git.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +8 -7
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js +4 -2
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +3 -3
- package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/grep.js +27 -5
- package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts +2 -2
- package/dist/ai-service/agent/tools2/tools/read.d.ts +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +2 -2
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +3 -3
- package/dist/ai-service/agent/tools2/tools/wait-for-task.d.ts +4 -4
- package/dist/ai-service/agent/tools2/tools/write.d.ts +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/app-interface/cancellable-exec.js.map +1 -1
- package/dist/ai-service/app-interface/constants.d.ts.map +1 -1
- package/dist/ai-service/app-interface/file-system-interface.d.ts +1 -1
- package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts +2 -1
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js +9 -2
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +1 -1
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.d.ts.map +1 -1
- package/dist/ai-service/app-interface/linter.d.ts.map +1 -1
- package/dist/ai-service/app-interface/npm-error-parser.js +1 -1
- package/dist/ai-service/app-interface/npm-error-parser.js.map +1 -1
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -1
- package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -1
- package/dist/ai-service/app-interface/npm-registry.d.ts +1 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -1
- package/dist/ai-service/app-interface/npm-registry.js +46 -7
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -1
- package/dist/ai-service/app-interface/shell.d.ts +6 -1
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +31 -9
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-skills/manager.d.ts.map +1 -1
- package/dist/ai-service/app-skills/manager.js.map +1 -1
- package/dist/ai-service/attachments/store.d.ts.map +1 -1
- package/dist/ai-service/attachments/text-upload-artifacts.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/builder-conversation.d.ts +89 -0
- package/dist/ai-service/builder-conversation.d.ts.map +1 -0
- package/dist/ai-service/builder-conversation.js +756 -0
- package/dist/ai-service/builder-conversation.js.map +1 -0
- package/dist/ai-service/builder-inference-auth.d.ts +21 -0
- package/dist/ai-service/builder-inference-auth.d.ts.map +1 -0
- package/dist/ai-service/builder-inference-auth.js +95 -0
- package/dist/ai-service/builder-inference-auth.js.map +1 -0
- package/dist/ai-service/builder-runtime.d.ts +342 -0
- package/dist/ai-service/builder-runtime.d.ts.map +1 -0
- package/dist/ai-service/builder-runtime.js +630 -0
- package/dist/ai-service/builder-runtime.js.map +1 -0
- package/dist/ai-service/builder-session-store.d.ts +26 -0
- package/dist/ai-service/builder-session-store.d.ts.map +1 -0
- package/dist/ai-service/builder-session-store.js +66 -0
- package/dist/ai-service/builder-session-store.js.map +1 -0
- package/dist/ai-service/builder-tool-callbacks.d.ts +29 -0
- package/dist/ai-service/builder-tool-callbacks.d.ts.map +1 -0
- package/dist/ai-service/builder-tool-callbacks.js +135 -0
- package/dist/ai-service/builder-tool-callbacks.js.map +1 -0
- package/dist/ai-service/builder-tools.d.ts +70 -0
- package/dist/ai-service/builder-tools.d.ts.map +1 -0
- package/dist/ai-service/builder-tools.js +380 -0
- package/dist/ai-service/builder-tools.js.map +1 -0
- package/dist/ai-service/builder-workspace.d.ts +158 -0
- package/dist/ai-service/builder-workspace.d.ts.map +1 -0
- package/dist/ai-service/builder-workspace.js +389 -0
- package/dist/ai-service/builder-workspace.js.map +1 -0
- package/dist/ai-service/chat/chat-push-metrics.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.d.ts +10 -1
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -1
- package/dist/ai-service/chat/chat-session-store.js +30 -1
- package/dist/ai-service/chat/chat-session-store.js.map +1 -1
- package/dist/ai-service/chat/switch-chat-seed.d.ts +8 -0
- package/dist/ai-service/chat/switch-chat-seed.d.ts.map +1 -0
- package/dist/ai-service/chat/switch-chat-seed.js +47 -0
- package/dist/ai-service/chat/switch-chat-seed.js.map +1 -0
- package/dist/ai-service/chat/transcript-budget.d.ts.map +1 -1
- package/dist/ai-service/chat/transcript-metrics.d.ts.map +1 -1
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +2 -2
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -1
- package/dist/ai-service/checklist/remediation-findings-client.d.ts +8 -8
- package/dist/ai-service/const.d.ts.map +1 -1
- package/dist/ai-service/context/app-context.d.ts.map +1 -1
- package/dist/ai-service/context/app-context.js.map +1 -1
- package/dist/ai-service/context-flush-scheduler.d.ts.map +1 -1
- package/dist/ai-service/dev-database-client.d.ts.map +1 -1
- package/dist/ai-service/dev-database-client.js.map +1 -1
- package/dist/ai-service/dev-database-file-sync.d.ts +3 -1
- package/dist/ai-service/dev-database-file-sync.d.ts.map +1 -1
- package/dist/ai-service/dev-database-file-sync.js.map +1 -1
- package/dist/ai-service/edit-after-clark.d.ts.map +1 -1
- package/dist/ai-service/edit-after-clark.js.map +1 -1
- package/dist/ai-service/features.d.ts +21 -8
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +21 -8
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/index.d.ts +96 -20
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +705 -740
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/gron.js.map +1 -1
- package/dist/ai-service/integrations/metadata-storage/local.d.ts.map +1 -1
- package/dist/ai-service/integrations/ripgrep-path.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts.map +1 -1
- package/dist/ai-service/judge/integration/playwright-bridge.js.map +1 -1
- package/dist/ai-service/judge/judge-executor.d.ts.map +1 -1
- package/dist/ai-service/judge/judge-executor.js.map +1 -1
- package/dist/ai-service/judge/judge-service.d.ts.map +1 -1
- package/dist/ai-service/judge/judge-service.js.map +1 -1
- package/dist/ai-service/judge/prompts/system-prompt.js.map +1 -1
- package/dist/ai-service/judge/storage/csv-storage.d.ts.map +1 -1
- package/dist/ai-service/judge/storage/csv-storage.js.map +1 -1
- package/dist/ai-service/judge/tools/playwright-action.d.ts +16 -16
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +6 -6
- package/dist/ai-service/knowledge/knowledge-manager.d.ts.map +1 -1
- package/dist/ai-service/knowledge/knowledge-metrics.d.ts.map +1 -1
- package/dist/ai-service/live-edit-events/forwarder.d.ts.map +1 -1
- package/dist/ai-service/live-edit-events/forwarder.js.map +1 -1
- package/dist/ai-service/llm/chaos-fetch.js.map +1 -1
- package/dist/ai-service/llm/clark-stream-telemetry-sink.js.map +1 -1
- package/dist/ai-service/llm/client.d.ts.map +1 -1
- package/dist/ai-service/llm/client.js.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/adapter.js.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context-metrics.js +2 -2
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context.js.map +1 -1
- package/dist/ai-service/llm/context-v2/file-read-ledger.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts +3 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.js +5 -0
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
- package/dist/ai-service/llm/context-v2/operation-queue.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +16 -16
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/local.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/local.js.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/storage/migration.js.map +1 -1
- package/dist/ai-service/llm/context-v2/truncation-fallback.js.map +1 -1
- package/dist/ai-service/llm/context-v2/types.d.ts +1 -1
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/types.js.map +1 -1
- package/dist/ai-service/llm/error.d.ts.map +1 -1
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts.map +1 -1
- package/dist/ai-service/llm/provider.d.ts.map +1 -1
- package/dist/ai-service/llm/provider.js +7 -24
- package/dist/ai-service/llm/provider.js.map +1 -1
- package/dist/ai-service/llm/request-settings.d.ts +6 -0
- package/dist/ai-service/llm/request-settings.d.ts.map +1 -0
- package/dist/ai-service/llm/request-settings.js +21 -0
- package/dist/ai-service/llm/request-settings.js.map +1 -0
- package/dist/ai-service/llm/stream/config.d.ts +1 -1
- package/dist/ai-service/llm/stream/config.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/config.js.map +1 -1
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/errors.d.ts +4 -1
- package/dist/ai-service/llm/stream/errors.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/errors.js +8 -2
- package/dist/ai-service/llm/stream/errors.js.map +1 -1
- package/dist/ai-service/llm/stream/event-bus.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/attempt-model.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/context.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/logging.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/retry-notification.js.map +1 -1
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/observers/step-token-usage.js.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/orchestrator.js +3 -6
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -1
- package/dist/ai-service/llm/stream/session.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts +1 -1
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts.map +1 -1
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js.map +1 -1
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts.map +1 -1
- package/dist/ai-service/llm/tool-context-integrity.js.map +1 -1
- package/dist/ai-service/llmobs/constants.d.ts.map +1 -1
- package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -1
- package/dist/ai-service/llmobs/helpers.js.map +1 -1
- package/dist/ai-service/llmobs/index.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.js +1 -1
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
- package/dist/ai-service/llmobs/tracer.js +4 -21
- package/dist/ai-service/llmobs/tracer.js.map +1 -1
- package/dist/ai-service/managed-native-db-availability.d.ts +1 -1
- package/dist/ai-service/managed-native-db-availability.d.ts.map +1 -1
- package/dist/ai-service/managed-native-db-availability.js +4 -2
- package/dist/ai-service/managed-native-db-availability.js.map +1 -1
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -1
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -1
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -1
- package/dist/ai-service/mcp/playwright-server.d.ts.map +1 -1
- package/dist/ai-service/native-callback-order.d.ts +7 -0
- package/dist/ai-service/native-callback-order.d.ts.map +1 -0
- package/dist/ai-service/native-callback-order.js +39 -0
- package/dist/ai-service/native-callback-order.js.map +1 -0
- package/dist/ai-service/native-secret-redactor.d.ts +4 -0
- package/dist/ai-service/native-secret-redactor.d.ts.map +1 -0
- package/dist/ai-service/native-secret-redactor.js +38 -0
- package/dist/ai-service/native-secret-redactor.js.map +1 -0
- package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -1
- package/dist/ai-service/policy-gate-remediation-usage.d.ts +2 -1
- package/dist/ai-service/policy-gate-remediation-usage.d.ts.map +1 -1
- package/dist/ai-service/policy-gate-remediation-usage.js +2 -1
- package/dist/ai-service/policy-gate-remediation-usage.js.map +1 -1
- package/dist/ai-service/policy-gate-review.d.ts +42 -0
- package/dist/ai-service/policy-gate-review.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-review.js +664 -0
- package/dist/ai-service/policy-gate-review.js.map +1 -0
- package/dist/ai-service/profiler/clark-profiler.d.ts.map +1 -1
- package/dist/ai-service/profiler/perfetto-profiler.d.ts.map +1 -1
- package/dist/ai-service/profiler/perfetto-profiler.js.map +1 -1
- package/dist/ai-service/profiler/tool-profiler.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -1
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -1
- package/dist/ai-service/recording/recorders/llm-recorder.js.map +1 -1
- package/dist/ai-service/recording/recording-manager.d.ts.map +1 -1
- package/dist/ai-service/recording/recording-manager.js.map +1 -1
- package/dist/ai-service/recording/snapshot-manager.d.ts.map +1 -1
- package/dist/ai-service/recording/snapshot-manager.js.map +1 -1
- package/dist/ai-service/recording/storage/session-recording-storage.d.ts.map +1 -1
- package/dist/ai-service/recording/storage/session-recording-storage.js.map +1 -1
- package/dist/ai-service/request-deduplicator.d.ts.map +1 -1
- package/dist/ai-service/request-deduplicator.js.map +1 -1
- package/dist/ai-service/security/secret-scanner-service.js.map +1 -1
- package/dist/ai-service/security/secret-scanner.d.ts.map +1 -1
- package/dist/ai-service/security/secret-scanner.js.map +1 -1
- package/dist/ai-service/security/vulnerability-triage.d.ts +5 -5
- package/dist/ai-service/skills/system/materialized.d.ts +3 -1
- package/dist/ai-service/skills/system/materialized.d.ts.map +1 -1
- package/dist/ai-service/skills/system/materialized.js +3 -3
- package/dist/ai-service/skills/system/materialized.js.map +1 -1
- package/dist/ai-service/skills/system/native.d.ts +15 -0
- package/dist/ai-service/skills/system/native.d.ts.map +1 -0
- package/dist/ai-service/skills/system/native.js +32 -0
- package/dist/ai-service/skills/system/native.js.map +1 -0
- package/dist/ai-service/skills/system/paths.d.ts +2 -0
- package/dist/ai-service/skills/system/paths.d.ts.map +1 -0
- package/dist/ai-service/skills/system/paths.js +3 -0
- package/dist/ai-service/skills/system/paths.js.map +1 -0
- package/dist/ai-service/skills/system/resolve.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +11 -9
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/types.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +10 -18
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/play-dead.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/classification.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/context-id.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/metadata.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- 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 +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-degradation-cause.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +16 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +65 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/transition.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-response-message.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-response-message.js +4 -2
- package/dist/ai-service/state-machine/helpers/user-response-message.js.map +1 -1
- package/dist/ai-service/state-machine/test-util.d.ts.map +1 -1
- package/dist/ai-service/state-machine/test-util.js.map +1 -1
- package/dist/ai-service/state-machine/traced-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/traced-fsm.js.map +1 -1
- package/dist/ai-service/tasks/task-store.d.ts.map +1 -1
- package/dist/ai-service/tasks/task-store.js.map +1 -1
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +3 -3
- package/dist/ai-service/template-renderer.js.map +1 -1
- package/dist/ai-service/test-utils/error-mocks.d.ts +2 -2
- package/dist/ai-service/test-utils/span-interceptor.d.ts.map +1 -1
- package/dist/ai-service/test-utils/span-interceptor.js +2 -2
- package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts.map +1 -1
- package/dist/ai-service/types.d.ts +18 -0
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js +1 -1
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/archive-extractors.d.ts.map +1 -1
- package/dist/ai-service/util/call-peer.d.ts.map +1 -1
- package/dist/ai-service/util/llm-config-utils.js.map +1 -1
- package/dist/ai-service/util/peer-liveness.d.ts.map +1 -1
- package/dist/ai-service/util/peer-liveness.js.map +1 -1
- package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -1
- package/dist/ai-service/util/rpc-timeout.js.map +1 -1
- package/dist/ai-service/util/stop-condition.d.ts +2 -0
- package/dist/ai-service/util/stop-condition.d.ts.map +1 -1
- package/dist/ai-service/util/stop-condition.js +3 -0
- package/dist/ai-service/util/stop-condition.js.map +1 -1
- package/dist/ai-service/workspace-edge-health.d.ts +11 -0
- package/dist/ai-service/workspace-edge-health.d.ts.map +1 -0
- package/dist/ai-service/workspace-edge-health.js +30 -0
- package/dist/ai-service/workspace-edge-health.js.map +1 -0
- package/dist/ai-service/workspace-endpoint-publisher.d.ts +27 -0
- package/dist/ai-service/workspace-endpoint-publisher.d.ts.map +1 -0
- package/dist/ai-service/workspace-endpoint-publisher.js +44 -0
- package/dist/ai-service/workspace-endpoint-publisher.js.map +1 -0
- package/dist/ai-service/workspace-metrics.d.ts +11 -0
- package/dist/ai-service/workspace-metrics.d.ts.map +1 -0
- package/dist/ai-service/workspace-metrics.js +53 -0
- package/dist/ai-service/workspace-metrics.js.map +1 -0
- package/dist/ai-service/workspace-mirror.d.ts +52 -0
- package/dist/ai-service/workspace-mirror.d.ts.map +1 -0
- package/dist/ai-service/workspace-mirror.js +100 -0
- package/dist/ai-service/workspace-mirror.js.map +1 -0
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-control-block-identifiers.js.map +1 -1
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-identifiers.js.map +1 -1
- package/dist/binding-extraction/js-identifiers.d.ts +2 -15
- package/dist/binding-extraction/js-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/js-identifiers.js +3 -6
- package/dist/binding-extraction/js-identifiers.js.map +1 -1
- package/dist/binding-extraction/python-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/python-identifiers.js.map +1 -1
- package/dist/build-errors.d.ts.map +1 -1
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/dev-server-ws-smoke-client.js.map +1 -1
- package/dist/errors/make-server-error.d.ts.map +1 -1
- package/dist/errors/make-server-error.js.map +1 -1
- package/dist/extract-api-integrations.d.ts +52 -91
- package/dist/extract-api-integrations.d.ts.map +1 -1
- package/dist/extract-api-integrations.js +512 -487
- package/dist/extract-api-integrations.js.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +124 -45
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +1 -34
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +9 -66
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +1 -1
- package/dist/file-system-manager.js.map +1 -1
- package/dist/git-service/app-layout-guard.js.map +1 -1
- package/dist/git-service/credential-scope.d.ts +16 -0
- package/dist/git-service/credential-scope.d.ts.map +1 -0
- package/dist/git-service/credential-scope.js +94 -0
- package/dist/git-service/credential-scope.js.map +1 -0
- package/dist/git-service/errors.d.ts.map +1 -1
- package/dist/git-service/errors.js.map +1 -1
- package/dist/git-service/index.d.ts +1 -0
- package/dist/git-service/index.d.ts.map +1 -1
- package/dist/git-service/index.js +6 -38
- package/dist/git-service/index.js.map +1 -1
- package/dist/git-service/managed-excludes.d.ts.map +1 -1
- package/dist/git-service/managed-excludes.js +2 -0
- package/dist/git-service/managed-excludes.js.map +1 -1
- package/dist/ids.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/inject-index-vite-plugin.d.ts.map +1 -1
- package/dist/injected-index.d.ts +1 -3
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +3 -8
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/activity-tracker.d.ts.map +1 -1
- package/dist/lock-service/index.d.ts +50 -5
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +143 -8
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/get-fullstack-template-dir.d.ts +2 -5
- package/dist/migration/get-fullstack-template-dir.d.ts.map +1 -1
- package/dist/migration/get-fullstack-template-dir.js +5 -8
- package/dist/migration/get-fullstack-template-dir.js.map +1 -1
- package/dist/migration/integration-write-policy.js.map +1 -1
- package/dist/migration/mark-api-testing-denied.js.map +1 -1
- package/dist/migration/migration-routes.js.map +1 -1
- package/dist/migration/migration-verification.d.ts +16 -16
- package/dist/migration/migration-verification.d.ts.map +1 -1
- package/dist/migration/recommended-user-deps.d.ts.map +1 -1
- package/dist/migration/unsupported-integrations.js.map +1 -1
- package/dist/migration-templates/app-fullstack/eslint.config.js +7 -1
- package/dist/migration-templates/app-fullstack/package.json +3 -3
- package/dist/migration-templates/app-fullstack/vite.config.ts +5 -3
- package/dist/native-system-skills.d.ts +2 -0
- package/dist/native-system-skills.d.ts.map +1 -0
- package/dist/native-system-skills.js +4 -0
- package/dist/native-system-skills.js.map +1 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.js.map +1 -1
- package/dist/operations/operation-processor.d.ts.map +1 -1
- package/dist/operations/operation-processor.js.map +1 -1
- package/dist/parsing/bindings.js.map +1 -1
- package/dist/parsing/jsx.d.ts +1 -1
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/parsing/util.js.map +1 -1
- package/dist/plugin-options.d.ts +106 -1
- package/dist/plugin-options.d.ts.map +1 -1
- package/dist/plugin-options.js.map +1 -1
- package/dist/policy-gate-run-registry.d.ts.map +1 -1
- package/dist/policy-gate-runner.d.ts +32 -7
- package/dist/policy-gate-runner.d.ts.map +1 -1
- package/dist/policy-gate-runner.js +23 -6
- package/dist/policy-gate-runner.js.map +1 -1
- package/dist/reconnect-guard-plugin.d.ts.map +1 -1
- package/dist/reconnect-guard-plugin.js +9 -5
- package/dist/reconnect-guard-plugin.js.map +1 -1
- package/dist/refactor/blocks.d.ts.map +1 -1
- package/dist/refactor/blocks.js +2 -2
- package/dist/refactor/blocks.js.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +8 -1
- package/dist/resolver.js.map +1 -1
- package/dist/review-runner.d.ts +25 -0
- package/dist/review-runner.d.ts.map +1 -0
- package/dist/review-runner.js +196 -0
- package/dist/review-runner.js.map +1 -0
- package/dist/router-parser.d.ts.map +1 -1
- package/dist/router-parser.js +16 -5
- package/dist/router-parser.js.map +1 -1
- package/dist/scan-scope-merge.d.ts +1 -1
- package/dist/server-rpc/index.d.ts.map +1 -1
- package/dist/server-rpc/index.js.map +1 -1
- package/dist/server-rpc/rpc-invalidate-metrics.d.ts.map +1 -1
- package/dist/socket-manager.d.ts +26 -3
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +245 -23
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/split-edit-after-clark.d.ts.map +1 -1
- package/dist/split-edit-after-clark.js.map +1 -1
- package/dist/sync-service/download.d.ts +2 -53
- package/dist/sync-service/download.d.ts.map +1 -1
- package/dist/sync-service/download.js +3 -469
- package/dist/sync-service/download.js.map +1 -1
- package/dist/sync-service/draft-helpers.d.ts +1 -103
- package/dist/sync-service/draft-helpers.d.ts.map +1 -1
- package/dist/sync-service/draft-helpers.js +2 -579
- package/dist/sync-service/draft-helpers.js.map +1 -1
- package/dist/sync-service/draft-mutation.d.ts +11 -0
- package/dist/sync-service/draft-mutation.d.ts.map +1 -0
- package/dist/sync-service/draft-mutation.js +121 -0
- package/dist/sync-service/draft-mutation.js.map +1 -0
- package/dist/sync-service/draft-state-report-metrics.d.ts +1 -4
- package/dist/sync-service/draft-state-report-metrics.d.ts.map +1 -1
- package/dist/sync-service/draft-state-report-metrics.js +2 -35
- package/dist/sync-service/draft-state-report-metrics.js.map +1 -1
- package/dist/sync-service/hash-cache.d.ts +1 -15
- package/dist/sync-service/hash-cache.d.ts.map +1 -1
- package/dist/sync-service/hash-cache.js +2 -61
- package/dist/sync-service/hash-cache.js.map +1 -1
- package/dist/sync-service/index.d.ts +25 -2
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +205 -9
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts +2 -28
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +3 -149
- package/dist/sync-service/list-dir.js.map +1 -1
- package/dist/sync-service/native-draft-session.d.ts +3 -0
- package/dist/sync-service/native-draft-session.d.ts.map +1 -0
- package/dist/sync-service/native-draft-session.js +4 -0
- package/dist/sync-service/native-draft-session.js.map +1 -0
- package/dist/sync-service/safe-directory-reader.d.ts +2 -0
- package/dist/sync-service/safe-directory-reader.d.ts.map +1 -0
- package/dist/sync-service/safe-directory-reader.js +3 -0
- package/dist/sync-service/safe-directory-reader.js.map +1 -0
- package/dist/sync-service/snapshot/take-snapshot.d.ts +2 -40
- package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.js +3 -243
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
- package/dist/sync-service/snapshot/types.d.ts +1 -24
- package/dist/sync-service/snapshot/types.d.ts.map +1 -1
- package/dist/sync-service/snapshot/types.js +2 -2
- package/dist/sync-service/snapshot/types.js.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.d.ts +1 -4
- package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.js +2 -82
- package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -1
- package/dist/util/generation-number-sequence.d.ts.map +1 -1
- package/dist/util/generation-number-sequence.js.map +1 -1
- package/dist/util/generation-wait-timeout-error.d.ts.map +1 -1
- package/dist/util/generation-wait-timeout-error.js.map +1 -1
- package/dist/util/log-sanitizer.d.ts +4 -0
- package/dist/util/log-sanitizer.d.ts.map +1 -1
- package/dist/util/log-sanitizer.js +28 -5
- package/dist/util/log-sanitizer.js.map +1 -1
- package/dist/util/logger.d.ts.map +1 -1
- package/dist/util/logger.js +4 -0
- package/dist/util/logger.js.map +1 -1
- package/dist/util/operation-queue.d.ts.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/vite-module-reload.d.ts.map +1 -1
- package/dist/vite-module-reload.js.map +1 -1
- package/dist/workspace-sync-methods.d.ts +37 -0
- package/dist/workspace-sync-methods.d.ts.map +1 -0
- package/dist/workspace-sync-methods.js +2 -0
- package/dist/workspace-sync-methods.js.map +1 -0
- package/package.json +75 -58
- package/dist/migration-templates/app-fullstack/.gitignore +0 -50
- package/dist/sync-service/hash-dir-tree.d.ts +0 -10
- package/dist/sync-service/hash-dir-tree.d.ts.map +0 -1
- package/dist/sync-service/hash-dir-tree.js +0 -53
- package/dist/sync-service/hash-dir-tree.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { posix as posixPath } from "node:path";
|
|
2
2
|
import { parse } from "@babel/parser";
|
|
3
|
+
import * as t from "@babel/types";
|
|
3
4
|
function isNode(value) {
|
|
4
5
|
return !!value && typeof value === "object";
|
|
5
6
|
}
|
|
@@ -76,164 +77,48 @@ function unwrapExpression(node) {
|
|
|
76
77
|
}
|
|
77
78
|
return node;
|
|
78
79
|
}
|
|
80
|
+
function specifiersOf(statement) {
|
|
81
|
+
return Array.isArray(statement.specifiers)
|
|
82
|
+
? statement.specifiers.filter(isNode)
|
|
83
|
+
: [];
|
|
84
|
+
}
|
|
79
85
|
function isTypeOnly(node) {
|
|
80
86
|
return (node.importKind === "type" ||
|
|
81
87
|
node.importKind === "typeof" ||
|
|
82
88
|
node.exportKind === "type");
|
|
83
89
|
}
|
|
84
90
|
function valueSpecifiersOf(statement) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return statement.specifiers.filter((specifier) => isNode(specifier) && !isTypeOnly(specifier));
|
|
91
|
+
return isTypeOnly(statement)
|
|
92
|
+
? []
|
|
93
|
+
: specifiersOf(statement).filter((specifier) => !isTypeOnly(specifier));
|
|
89
94
|
}
|
|
90
95
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* a `VariableDeclaration`) to its inner `VariableDeclaration` so exported
|
|
95
|
-
* declarations are visited the same as bare ones. A `declare` statement has
|
|
96
|
-
* no runtime value, so it is never visited.
|
|
96
|
+
* The declarators of a top-level `const`, `let`, or `var` statement,
|
|
97
|
+
* including an exported one, and none for a `declare` statement, which has
|
|
98
|
+
* no runtime value.
|
|
97
99
|
*/
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
: statement;
|
|
107
|
-
if (declarationNode.type !== "VariableDeclaration" ||
|
|
108
|
-
declarationNode.declare === true ||
|
|
109
|
-
(bindings === "const-only" && declarationNode.kind !== "const") ||
|
|
110
|
-
!Array.isArray(declarationNode.declarations)) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
for (const declaration of declarationNode.declarations) {
|
|
114
|
-
if (isNode(declaration)) {
|
|
115
|
-
visitor(declaration);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function buildVariableInitializerMap(programBody, bindings) {
|
|
121
|
-
const initializers = new Map();
|
|
122
|
-
visitVariableDeclarations(programBody, bindings, (declaration) => {
|
|
123
|
-
const identifier = declaration.id;
|
|
124
|
-
if (!isNode(identifier) ||
|
|
125
|
-
identifier.type !== "Identifier" ||
|
|
126
|
-
typeof identifier.name !== "string") {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
initializers.set(identifier.name, declaration.init);
|
|
130
|
-
});
|
|
131
|
-
return initializers;
|
|
132
|
-
}
|
|
133
|
-
function resolveApiConfigObject(expression, variableInitializers) {
|
|
134
|
-
const resolvedExpression = unwrapExpression(expression);
|
|
135
|
-
if (!resolvedExpression) {
|
|
136
|
-
return undefined;
|
|
137
|
-
}
|
|
138
|
-
if (resolvedExpression.type === "Identifier" &&
|
|
139
|
-
typeof resolvedExpression.name === "string") {
|
|
140
|
-
return resolveApiConfigObject(variableInitializers.get(resolvedExpression.name), variableInitializers);
|
|
141
|
-
}
|
|
142
|
-
if (resolvedExpression.type !== "CallExpression" ||
|
|
143
|
-
getCalleeName(resolvedExpression.callee) !== "api" ||
|
|
144
|
-
!Array.isArray(resolvedExpression.arguments)) {
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
const config = unwrapExpression(resolvedExpression.arguments[0]);
|
|
148
|
-
if (!config || config.type !== "ObjectExpression") {
|
|
149
|
-
return undefined;
|
|
150
|
-
}
|
|
151
|
-
return config;
|
|
152
|
-
}
|
|
153
|
-
function findExportedApiConfigObject(programBody, bindings, exportName) {
|
|
154
|
-
const variableInitializers = buildVariableInitializerMap(programBody, bindings);
|
|
155
|
-
for (const statement of programBody) {
|
|
156
|
-
if (!isNode(statement)) {
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (exportName === "default" &&
|
|
160
|
-
statement.type === "ExportDefaultDeclaration") {
|
|
161
|
-
return resolveApiConfigObject(statement.declaration, variableInitializers);
|
|
162
|
-
}
|
|
163
|
-
if (statement.type === "ExportNamedDeclaration" &&
|
|
164
|
-
!isNode(statement.source)) {
|
|
165
|
-
if (exportName !== "default" &&
|
|
166
|
-
isNode(statement.declaration) &&
|
|
167
|
-
statement.declaration.type === "VariableDeclaration" &&
|
|
168
|
-
statement.declaration.declare !== true &&
|
|
169
|
-
Array.isArray(statement.declaration.declarations) &&
|
|
170
|
-
statement.declaration.declarations.some((declaration) => isNode(declaration) &&
|
|
171
|
-
getPropertyName(declaration.id) === exportName)) {
|
|
172
|
-
return resolveApiConfigObject(variableInitializers.get(exportName), variableInitializers);
|
|
173
|
-
}
|
|
174
|
-
for (const specifier of valueSpecifiersOf(statement)) {
|
|
175
|
-
if (specifier.type !== "ExportSpecifier" ||
|
|
176
|
-
getPropertyName(specifier.exported) !== exportName) {
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
return resolveApiConfigObject(specifier.local, variableInitializers);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
100
|
+
function variableDeclaratorsOf(statement) {
|
|
101
|
+
const declaration = statement.type === "ExportNamedDeclaration" && isNode(statement.declaration)
|
|
102
|
+
? statement.declaration
|
|
103
|
+
: statement;
|
|
104
|
+
if (declaration.type !== "VariableDeclaration" ||
|
|
105
|
+
declaration.declare === true ||
|
|
106
|
+
!Array.isArray(declaration.declarations)) {
|
|
107
|
+
return [];
|
|
182
108
|
}
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const refs = new Map();
|
|
187
|
-
visitVariableDeclarations(programBody, bindings, (declaration) => {
|
|
188
|
-
const identifier = declaration.id;
|
|
189
|
-
const init = declaration.init;
|
|
190
|
-
if (!isNode(identifier) ||
|
|
191
|
-
identifier.type !== "Identifier" ||
|
|
192
|
-
typeof identifier.name !== "string") {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (!isNode(init) ||
|
|
196
|
-
init.type !== "CallExpression" ||
|
|
197
|
-
!Array.isArray(init.arguments)) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const pluginId = getCalleeName(init.callee);
|
|
201
|
-
const id = resolveStringArgument(init.arguments[0], stringLiterals);
|
|
202
|
-
if (!pluginId || !id) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
refs.set(identifier.name, { pluginId, id });
|
|
206
|
-
});
|
|
207
|
-
return refs;
|
|
109
|
+
return declaration.declarations
|
|
110
|
+
.filter(isNode)
|
|
111
|
+
.map((declarator) => ({ kind: declaration.kind, declarator }));
|
|
208
112
|
}
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
const identifier = declaration.id;
|
|
213
|
-
if (!isNode(identifier) ||
|
|
214
|
-
identifier.type !== "Identifier" ||
|
|
215
|
-
typeof identifier.name !== "string") {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const value = getLiteralString(declaration.init);
|
|
219
|
-
if (value !== undefined) {
|
|
220
|
-
literals.set(identifier.name, value);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
return literals;
|
|
224
|
-
}
|
|
225
|
-
function resolveStringArgument(node, stringLiterals) {
|
|
226
|
-
const literal = getLiteralString(node);
|
|
227
|
-
if (literal !== undefined) {
|
|
228
|
-
return literal;
|
|
229
|
-
}
|
|
230
|
-
if (isNode(node) &&
|
|
231
|
-
node.type === "Identifier" &&
|
|
232
|
-
typeof node.name === "string") {
|
|
233
|
-
return stringLiterals.get(node.name);
|
|
113
|
+
function declaredNames(declaration) {
|
|
114
|
+
if (!t.isNode(declaration)) {
|
|
115
|
+
return [];
|
|
234
116
|
}
|
|
235
|
-
|
|
117
|
+
const names = Object.keys(t.getOuterBindingIdentifiers(declaration));
|
|
118
|
+
const declaredName = "id" in declaration ? getPropertyName(declaration.id) : undefined;
|
|
119
|
+
return declaredName ? [...names, declaredName] : names;
|
|
236
120
|
}
|
|
121
|
+
const UNRESOLVED_EXPORT = { kind: "unresolved" };
|
|
237
122
|
/**
|
|
238
123
|
* The object literals an `api()` config declares its integrations in, and
|
|
239
124
|
* whether they are all it declares. A spread, a computed key, an
|
|
@@ -255,220 +140,97 @@ function readIntegrationsObjects(apiConfig) {
|
|
|
255
140
|
members.every((member) => getMemberKeyName(member) !== undefined),
|
|
256
141
|
};
|
|
257
142
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
// "../lib/constants.js"`) so a same-file declaration like
|
|
262
|
-
// `const sheets = restApiIntegration(SHEETS_ID)` can resolve them. Only
|
|
263
|
-
// fill in names the same-file scan didn't already find, so a same-file
|
|
264
|
-
// literal always wins over an imported one of the same name. In practice
|
|
265
|
-
// this `!stringLiterals.has(name)` check is defensive and unreachable for
|
|
266
|
-
// valid input: a same-file `const X` and an `import { X }` of the same
|
|
267
|
-
// name is a duplicate lexical binding, which is a parse/type error in
|
|
268
|
-
// real TS/ESM and can't occur in a file that actually compiles.
|
|
269
|
-
for (const [name, ref] of importedRefs) {
|
|
270
|
-
if (ref.kind === "id" && !stringLiterals.has(name)) {
|
|
271
|
-
stringLiterals.set(name, ref.id);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const variableRefs = buildVariableReferenceMap(programBody, stringLiterals, bindings);
|
|
275
|
-
const apiConfig = findExportedApiConfigObject(programBody, bindings, exportName);
|
|
276
|
-
if (!apiConfig) {
|
|
277
|
-
return { integrations: [], unresolvedKeys: [] };
|
|
278
|
-
}
|
|
279
|
-
const { objects, isDefinitive } = readIntegrationsObjects(apiConfig);
|
|
280
|
-
const integrations = [];
|
|
281
|
-
const unresolvedKeys = isDefinitive ? [] : ["*"];
|
|
282
|
-
for (const property of objects.flatMap(membersOf)) {
|
|
283
|
-
if (property.type !== "ObjectProperty") {
|
|
284
|
-
// Not a key/value property at all (e.g. a spread element or a method),
|
|
285
|
-
// so there is no key to report as unresolved.
|
|
286
|
-
unresolvedKeys.push("(dynamic)");
|
|
287
|
-
continue;
|
|
288
|
-
}
|
|
289
|
-
const key = getMemberKeyName(property);
|
|
290
|
-
if (!key) {
|
|
291
|
-
unresolvedKeys.push("(unknown)");
|
|
292
|
-
continue;
|
|
293
|
-
}
|
|
294
|
-
if (isNode(property.value) &&
|
|
295
|
-
property.value.type === "CallExpression" &&
|
|
296
|
-
Array.isArray(property.value.arguments)) {
|
|
297
|
-
const pluginId = getCalleeName(property.value.callee);
|
|
298
|
-
const arg = property.value.arguments[0];
|
|
299
|
-
let id = resolveStringArgument(arg, stringLiterals);
|
|
300
|
-
if (!id &&
|
|
301
|
-
isNode(arg) &&
|
|
302
|
-
arg.type === "Identifier" &&
|
|
303
|
-
typeof arg.name === "string") {
|
|
304
|
-
const imported = importedRefs.get(arg.name);
|
|
305
|
-
if (imported?.kind === "id") {
|
|
306
|
-
id = imported.id;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (pluginId && id) {
|
|
310
|
-
integrations.push({ key, pluginId, id });
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
unresolvedKeys.push(key);
|
|
314
|
-
}
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
if (isNode(property.value) &&
|
|
318
|
-
property.value.type === "Identifier" &&
|
|
319
|
-
typeof property.value.name === "string") {
|
|
320
|
-
const resolved = variableRefs.get(property.value.name);
|
|
321
|
-
if (resolved) {
|
|
322
|
-
integrations.push({ key, ...resolved });
|
|
323
|
-
continue;
|
|
324
|
-
}
|
|
325
|
-
const imported = importedRefs.get(property.value.name);
|
|
326
|
-
if (imported?.kind === "declaration") {
|
|
327
|
-
integrations.push({
|
|
328
|
-
key,
|
|
329
|
-
pluginId: imported.pluginId,
|
|
330
|
-
id: imported.id,
|
|
331
|
-
});
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
unresolvedKeys.push(key);
|
|
335
|
-
continue;
|
|
336
|
-
}
|
|
337
|
-
unresolvedKeys.push(key);
|
|
143
|
+
function unresolvedKeyOf(member) {
|
|
144
|
+
if (member.type !== "ObjectProperty") {
|
|
145
|
+
return "(dynamic)";
|
|
338
146
|
}
|
|
339
|
-
return
|
|
147
|
+
return getMemberKeyName(member) ?? "(unknown)";
|
|
340
148
|
}
|
|
341
149
|
/**
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
* Top-level variable references:
|
|
351
|
-
* `const DB = postgres("uuid"); integrations: { db: DB }`
|
|
352
|
-
*
|
|
353
|
-
* And string variable indirection:
|
|
354
|
-
* `const ID = "uuid"; integrations: { db: postgres(ID) }`
|
|
355
|
-
*
|
|
356
|
-
* Also resolves top-level `export const` declarations and `as const`
|
|
357
|
-
* literals in the same file (e.g. `export const ID = "uuid" as const;`) —
|
|
358
|
-
* a deliberate, additive improvement over the previous bare-declaration-only
|
|
359
|
-
* behavior. This is still single-file scope: only same-file declarations
|
|
360
|
-
* (exported or not) are considered, imports are never followed.
|
|
361
|
-
*
|
|
362
|
-
* Single-file only: does not follow imports, so an integration declared via
|
|
363
|
-
* an imported constant or an imported `integrations` object cannot be
|
|
364
|
-
* resolved here — it is silently dropped (its key is simply absent from the
|
|
365
|
-
* returned array, with no signal that it was seen but unresolved). Callers
|
|
366
|
-
* that need imported declarations resolved, or that need to know about
|
|
367
|
-
* unresolved keys instead of silently losing them, must use
|
|
368
|
-
* {@link extractApiIntegrations} instead.
|
|
150
|
+
* Extracts the integrations a file's default `api()` export declares from the
|
|
151
|
+
* file alone. A `let` or `var` reads as its initializer, since callers use
|
|
152
|
+
* the result to list every integration an API may touch, such as the
|
|
153
|
+
* migration write policy, which must not drop one. A declaration whose ID
|
|
154
|
+
* comes from an import is left out without a trace;
|
|
155
|
+
* {@link extractApiIntegrations} follows imports and reports the keys it
|
|
156
|
+
* cannot resolve.
|
|
369
157
|
*/
|
|
370
158
|
export function extractIntegrationsFromSource(source) {
|
|
371
|
-
let
|
|
159
|
+
let body;
|
|
372
160
|
try {
|
|
373
|
-
|
|
374
|
-
sourceType: "module",
|
|
375
|
-
plugins: ["typescript"],
|
|
376
|
-
});
|
|
161
|
+
body = parseProgramBody(source, "");
|
|
377
162
|
}
|
|
378
163
|
catch {
|
|
379
164
|
return [];
|
|
380
165
|
}
|
|
381
|
-
|
|
382
|
-
|
|
166
|
+
const module = new SourceModule("", body);
|
|
167
|
+
return new ApiModule(module, new ModuleScope(module, new Map(), "any")).integrationsOf("default").integrations;
|
|
383
168
|
}
|
|
384
|
-
/**
|
|
385
|
-
* Single-file only: does not follow imports, so an integration declared via
|
|
386
|
-
* an imported constant or an imported `integrations` object cannot be
|
|
387
|
-
* resolved here — it is silently dropped (its `id` is simply absent from the
|
|
388
|
-
* returned array, with no signal that it was seen but unresolved). Callers
|
|
389
|
-
* that need imported declarations resolved, or that need to know about
|
|
390
|
-
* unresolved keys instead of silently losing them, must use
|
|
391
|
-
* {@link extractApiIntegrations} instead.
|
|
392
|
-
*/
|
|
169
|
+
/** The IDs {@link extractIntegrationsFromSource} finds, in declaration order. */
|
|
393
170
|
export function extractIntegrationIdsFromSource(source) {
|
|
394
171
|
return extractIntegrationsFromSource(source).map((integration) => integration.id);
|
|
395
172
|
}
|
|
396
173
|
/**
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
* `{ key, pluginId, id }` triple.
|
|
401
|
-
*
|
|
402
|
-
* Import resolution supports one-hop relative imports (e.g., `../lib/integrations.js`).
|
|
403
|
-
* For each imported name, resolves it in the imported module via:
|
|
404
|
-
* 1. Imported string-literal constants: `export const SHEETS_ID = "sheets-uuid"`
|
|
405
|
-
* (including `as const`/type-assertion wrapping and re-exports via
|
|
406
|
-
* `export { name }` specifiers).
|
|
407
|
-
* 2. Imported integration declarations: `export const jira = restApiIntegration("jira-uuid")`
|
|
408
|
-
* including string-literal indirection within the imported module, and
|
|
409
|
-
* the same `export { name }` specifier form.
|
|
174
|
+
* Extracts the integrations an SDK API module's `api()` export declares,
|
|
175
|
+
* following relative imports, and reports the `integrations` keys it could
|
|
176
|
+
* not resolve.
|
|
410
177
|
*
|
|
411
|
-
*
|
|
412
|
-
* `
|
|
413
|
-
*
|
|
414
|
-
* file could satisfy are not followed.
|
|
178
|
+
* `exportName` selects the default export when omitted or `"default"`,
|
|
179
|
+
* otherwise a named one: `export const <name> = api({...})`,
|
|
180
|
+
* `export const <name> = someApi`, or `export { someApi as <name> }`.
|
|
415
181
|
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
* `
|
|
182
|
+
* A declaration resolves when its ID is a string literal, or a binding,
|
|
183
|
+
* alias, or integration declaration that leads to one, in the entry file or
|
|
184
|
+
* in a module it reaches within {@link MAX_IMPORT_HOPS} imports or
|
|
185
|
+
* re-exports. Package imports, type-only imports and exports, `declare`
|
|
186
|
+
* bindings, and imports that more than one candidate file could satisfy are
|
|
187
|
+
* not followed. `bindings` defaults to `"any"`; a caller that skips an
|
|
188
|
+
* approval based on the result passes `"const-only"`.
|
|
420
189
|
*
|
|
421
|
-
* `
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* `
|
|
426
|
-
*
|
|
427
|
-
* resolution entirely (see the guard at the top of
|
|
428
|
-
* `buildImportedIntegrationRefs`). Within that contract, resolved relative
|
|
429
|
-
* import candidates that would escape the app root (e.g. `../../../secrets.ts`)
|
|
430
|
-
* are skipped without reading them, but that `..`-prefix skip is only a
|
|
431
|
-
* best-effort guard against traversal *relative to entryPoint's own
|
|
432
|
-
* directory* — it is not a substitute for real containment enforcement.
|
|
433
|
-
* Authoritative containment against the actual filesystem root lives in the
|
|
434
|
-
* caller's `readSource` implementation (see `resolveContainedPath` in
|
|
435
|
-
* `collect-sdk-apis.mts`), which re-resolves every candidate against the app
|
|
436
|
-
* root before touching disk.
|
|
190
|
+
* `entryPoint` must be an app-root-relative posix path such as
|
|
191
|
+
* `server/apis/get-rows.ts`; imports of an absolute or backslashed one are
|
|
192
|
+
* not followed. Candidates above the app root are skipped without being
|
|
193
|
+
* read, but containment is enforced by `readSource`, as
|
|
194
|
+
* `createContainedSourceReader` does for testApi and
|
|
195
|
+
* `resolveContainedRealPath` does for the CLI build manifest.
|
|
437
196
|
*
|
|
438
197
|
* `unresolvedKeys` entries are one of:
|
|
439
|
-
* -
|
|
440
|
-
* - `"(unknown)"` for
|
|
441
|
-
*
|
|
442
|
-
* - `"
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
* failing to parse. `integrations` then lists only the declarations that
|
|
450
|
-
* could be read.
|
|
198
|
+
* - an `integrations` key whose declaration could not be resolved
|
|
199
|
+
* - `"(unknown)"` for a declaration whose key is not static
|
|
200
|
+
* - `"(dynamic)"` for a spread or method inside `integrations`
|
|
201
|
+
* - `"*"` when the export may declare integrations other than the ones read:
|
|
202
|
+
* the entry file has no local export by that name, which includes one it
|
|
203
|
+
* re-exports from another module, its value is not an `api({...})` call,
|
|
204
|
+
* its config has a spread, a computed key, an `integrations` accessor or
|
|
205
|
+
* method, a second or non-literal `integrations` property, or the entry
|
|
206
|
+
* file does not parse. `integrations` then lists only the declarations
|
|
207
|
+
* that could be read.
|
|
451
208
|
*/
|
|
452
209
|
export async function extractApiIntegrations(params) {
|
|
453
|
-
let
|
|
210
|
+
let body;
|
|
454
211
|
try {
|
|
455
|
-
|
|
456
|
-
sourceType: "module",
|
|
457
|
-
plugins: ["typescript"],
|
|
458
|
-
});
|
|
212
|
+
body = parseProgramBody(params.source, params.entryPoint);
|
|
459
213
|
}
|
|
460
214
|
catch {
|
|
461
|
-
// The entry file itself failed to parse (e.g. parser-config drift: a
|
|
462
|
-
// real build compiles syntax our @babel/parser config rejects, such as
|
|
463
|
-
// decorators or import attributes). Report the "*" sentinel instead of
|
|
464
|
-
// silently returning an empty result — this is maximal uncertainty
|
|
465
|
-
// about the whole integrations surface, exactly what "*" means below.
|
|
466
215
|
return { integrations: [], unresolvedKeys: ["*"] };
|
|
467
216
|
}
|
|
468
|
-
const
|
|
469
|
-
const
|
|
470
|
-
|
|
217
|
+
const exportName = params.exportName ?? "default";
|
|
218
|
+
const entry = new SourceModule(params.entryPoint, body);
|
|
219
|
+
const scope = await new ImportedIntegrationResolver(params.readSource, params.bindings ?? "any").entryScope(entry, (probe) => new ApiModule(entry, probe).integrationsOf(exportName));
|
|
220
|
+
return new ApiModule(entry, scope).integrationsOf(exportName);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Parses a module as TypeScript, and as JSX too when its path is a `.tsx` or
|
|
224
|
+
* `.jsx` file. A `.ts` file cannot also be read as JSX, since `<T>value` is a
|
|
225
|
+
* type assertion there.
|
|
226
|
+
*/
|
|
227
|
+
function parseProgramBody(source, path) {
|
|
228
|
+
const plugins = JSX_EXTENSIONS.includes(posixPath.extname(path))
|
|
229
|
+
? ["typescript", "jsx"]
|
|
230
|
+
: ["typescript"];
|
|
231
|
+
return parse(source, { sourceType: "module", plugins }).program.body;
|
|
471
232
|
}
|
|
233
|
+
const JSX_EXTENSIONS = [".tsx", ".jsx"];
|
|
472
234
|
const TS_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts"];
|
|
473
235
|
const SCRIPT_EXTENSIONS = [...TS_EXTENSIONS, ".js", ".jsx", ".mjs", ".cjs"];
|
|
474
236
|
const JS_TO_TS_EXTENSIONS = {
|
|
@@ -495,185 +257,448 @@ export function resolveRelativeImportPath(fromPath, importPath) {
|
|
|
495
257
|
}
|
|
496
258
|
return SCRIPT_EXTENSIONS.map((ext) => resolved + ext);
|
|
497
259
|
}
|
|
498
|
-
/**
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
260
|
+
/**
|
|
261
|
+
* One parsed module, addressed by its app-root-relative posix path, and the
|
|
262
|
+
* statements that matter for resolving integrations. Type-only and `declare`
|
|
263
|
+
* statements have no runtime value, so only `explicitExportNames` sees them.
|
|
264
|
+
*/
|
|
265
|
+
class SourceModule {
|
|
266
|
+
path;
|
|
267
|
+
body;
|
|
268
|
+
constructor(path, body) {
|
|
269
|
+
this.path = path;
|
|
270
|
+
this.body = body;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The app-root-relative paths an import or re-export source of this module
|
|
274
|
+
* may name, or none when it must not be followed: package imports, and any
|
|
275
|
+
* specifier containing a backslash, which `posixPath.join` would treat as
|
|
276
|
+
* a filename character so the `..`-prefix skip could not catch a traversal
|
|
277
|
+
* spelled with it. Candidates above the app root are dropped unread.
|
|
278
|
+
*/
|
|
279
|
+
candidatePathsFor(sourceNode) {
|
|
280
|
+
const specifier = isNode(sourceNode) ? sourceNode.value : undefined;
|
|
281
|
+
if (typeof specifier !== "string" ||
|
|
282
|
+
!specifier.startsWith(".") ||
|
|
283
|
+
specifier.includes("\\")) {
|
|
284
|
+
return [];
|
|
285
|
+
}
|
|
286
|
+
return resolveRelativeImportPath(this.path, specifier).filter((candidate) => !candidate.startsWith(".."));
|
|
287
|
+
}
|
|
288
|
+
variableDeclarators() {
|
|
289
|
+
return this.statements().flatMap(variableDeclaratorsOf);
|
|
290
|
+
}
|
|
291
|
+
/** `import { a, b as c } from "..."` statements. */
|
|
292
|
+
namedImports() {
|
|
293
|
+
return this.references("ImportDeclaration", "ImportSpecifier");
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The source and source-side name of an `export { a as name } from "..."`
|
|
297
|
+
* that exports `name`.
|
|
298
|
+
*/
|
|
299
|
+
namedReExportOf(name) {
|
|
300
|
+
for (const { source, specifiers } of this.references("ExportNamedDeclaration", "ExportSpecifier")) {
|
|
301
|
+
for (const specifier of specifiers) {
|
|
302
|
+
const localName = getPropertyName(specifier.local);
|
|
303
|
+
if (localName && getPropertyName(specifier.exported) === name) {
|
|
304
|
+
return { source, localName };
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
return undefined;
|
|
503
309
|
}
|
|
504
|
-
|
|
505
|
-
|
|
310
|
+
/** The sources of `export * from "..."` statements. */
|
|
311
|
+
starReExportSources() {
|
|
312
|
+
return this.statementsOfType("ExportAllDeclaration")
|
|
313
|
+
.filter((statement) => !isTypeOnly(statement))
|
|
314
|
+
.map((statement) => statement.source);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* The expression behind each value the module exports from its own scope:
|
|
318
|
+
* `export default <expr>`, the binding of `export const <name>`, and the
|
|
319
|
+
* local of `export { <local> as <name> }`.
|
|
320
|
+
*/
|
|
321
|
+
localExports() {
|
|
322
|
+
const exports = new Map();
|
|
323
|
+
for (const statement of this.statementsOfType("ExportDefaultDeclaration")) {
|
|
324
|
+
if (isNode(statement.declaration)) {
|
|
325
|
+
exports.set("default", statement.declaration);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
for (const statement of this.statementsOfType("ExportNamedDeclaration")) {
|
|
329
|
+
if (isNode(statement.source)) {
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
for (const { declarator } of variableDeclaratorsOf(statement)) {
|
|
333
|
+
const name = getPropertyName(declarator.id);
|
|
334
|
+
if (name && isNode(declarator.id)) {
|
|
335
|
+
exports.set(name, declarator.id);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
for (const specifier of valueSpecifiersOf(statement)) {
|
|
339
|
+
const exportedName = getPropertyName(specifier.exported);
|
|
340
|
+
if (exportedName && isNode(specifier.local)) {
|
|
341
|
+
exports.set(exportedName, specifier.local);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return exports;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Every name the module exports other than through `export *`, which ESM
|
|
349
|
+
* shadows with them and which never provides `default`. Type-only and
|
|
350
|
+
* `declare` exports count: TypeScript resolves the name to them while the
|
|
351
|
+
* runtime would take a star source's value, so the name stays unresolved.
|
|
352
|
+
*/
|
|
353
|
+
explicitExportNames() {
|
|
354
|
+
const names = new Set(["default"]);
|
|
355
|
+
for (const statement of this.statementsOfType("TSImportEqualsDeclaration")) {
|
|
356
|
+
const name = statement.isExport
|
|
357
|
+
? getPropertyName(statement.id)
|
|
358
|
+
: undefined;
|
|
359
|
+
if (name) {
|
|
360
|
+
names.add(name);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
for (const statement of this.statementsOfType("ExportNamedDeclaration")) {
|
|
364
|
+
for (const name of declaredNames(statement.declaration)) {
|
|
365
|
+
names.add(name);
|
|
366
|
+
}
|
|
367
|
+
for (const specifier of specifiersOf(statement)) {
|
|
368
|
+
const exportedName = getPropertyName(specifier.exported);
|
|
369
|
+
if (exportedName) {
|
|
370
|
+
names.add(exportedName);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return names;
|
|
506
375
|
}
|
|
507
|
-
|
|
508
|
-
return
|
|
376
|
+
references(statementType, specifierType) {
|
|
377
|
+
return this.statementsOfType(statementType)
|
|
378
|
+
.filter((statement) => isNode(statement.source))
|
|
379
|
+
.map((statement) => ({
|
|
380
|
+
source: statement.source,
|
|
381
|
+
specifiers: valueSpecifiersOf(statement).filter((specifier) => specifier.type === specifierType),
|
|
382
|
+
}))
|
|
383
|
+
.filter(({ specifiers }) => specifiers.length > 0);
|
|
509
384
|
}
|
|
510
|
-
|
|
511
|
-
return
|
|
512
|
-
exists: true,
|
|
513
|
-
body: parse(source, {
|
|
514
|
-
sourceType: "module",
|
|
515
|
-
plugins: ["typescript"],
|
|
516
|
-
}).program.body,
|
|
517
|
-
};
|
|
385
|
+
statementsOfType(type) {
|
|
386
|
+
return this.statements().filter((statement) => statement.type === type);
|
|
518
387
|
}
|
|
519
|
-
|
|
520
|
-
return
|
|
388
|
+
statements() {
|
|
389
|
+
return this.body.filter(isNode);
|
|
521
390
|
}
|
|
522
391
|
}
|
|
523
392
|
/**
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
393
|
+
* What the top-level bindings of one module and the names it imports refer
|
|
394
|
+
* to: string IDs, integration declarations, aliases of either, and `api()`
|
|
395
|
+
* configs.
|
|
527
396
|
*/
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
397
|
+
class ModuleScope {
|
|
398
|
+
importedRefs;
|
|
399
|
+
initializers = new Map();
|
|
400
|
+
constructor(module, importedRefs, bindings) {
|
|
401
|
+
this.importedRefs = importedRefs;
|
|
402
|
+
for (const { kind, declarator } of module.variableDeclarators()) {
|
|
403
|
+
const name = getPropertyName(declarator.id);
|
|
404
|
+
if (name && (bindings === "any" || kind === "const")) {
|
|
405
|
+
this.initializers.set(name, declarator.init);
|
|
406
|
+
}
|
|
538
407
|
}
|
|
539
408
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
function buildExportedIntegrationRefMap(programBody, bindings) {
|
|
543
|
-
const refs = new Map();
|
|
544
|
-
const stringLiterals = buildStringLiteralMap(programBody, bindings);
|
|
545
|
-
// Resolves specifier-based exports (`const jira = ...; export { jira };`)
|
|
546
|
-
// against the module's bare top-level variable declarations.
|
|
547
|
-
const variableRefs = buildVariableReferenceMap(programBody, stringLiterals, bindings);
|
|
548
|
-
// Resolve `export const x = ...` declarations directly. Filtering to only
|
|
549
|
-
// `ExportNamedDeclaration` statements before delegating to the shared
|
|
550
|
-
// walker means bare (non-exported) top-level consts are correctly excluded
|
|
551
|
-
// here, even though they're visible for same-file indirection above.
|
|
552
|
-
const exportedDeclarationStatements = programBody.filter((statement) => isNode(statement) && statement.type === "ExportNamedDeclaration");
|
|
553
|
-
visitVariableDeclarations(exportedDeclarationStatements, bindings, (declaration) => {
|
|
554
|
-
const identifier = declaration.id;
|
|
555
|
-
if (!isNode(identifier) ||
|
|
556
|
-
identifier.type !== "Identifier" ||
|
|
557
|
-
typeof identifier.name !== "string") {
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
const literal = getLiteralString(declaration.init);
|
|
409
|
+
resolveExpression(node, followedNames = new Set()) {
|
|
410
|
+
const literal = getLiteralString(node);
|
|
561
411
|
if (literal !== undefined) {
|
|
562
|
-
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
const init = declaration.init;
|
|
566
|
-
if (isNode(init) &&
|
|
567
|
-
init.type === "CallExpression" &&
|
|
568
|
-
Array.isArray(init.arguments)) {
|
|
569
|
-
const pluginId = getCalleeName(init.callee);
|
|
570
|
-
const id = resolveStringArgument(init.arguments[0], stringLiterals);
|
|
571
|
-
if (pluginId && id) {
|
|
572
|
-
refs.set(identifier.name, { kind: "declaration", pluginId, id });
|
|
573
|
-
}
|
|
412
|
+
return { kind: "id", id: literal };
|
|
574
413
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
414
|
+
const expression = unwrapExpression(node);
|
|
415
|
+
if (expression?.type === "Identifier" &&
|
|
416
|
+
typeof expression.name === "string") {
|
|
417
|
+
return this.resolveName(expression.name, followedNames);
|
|
418
|
+
}
|
|
419
|
+
if (expression?.type === "CallExpression" &&
|
|
420
|
+
Array.isArray(expression.arguments)) {
|
|
421
|
+
const pluginId = getCalleeName(expression.callee);
|
|
422
|
+
const argument = this.resolveExpression(expression.arguments[0], followedNames);
|
|
423
|
+
return pluginId && argument?.kind === "id"
|
|
424
|
+
? { kind: "declaration", pluginId, id: argument.id }
|
|
425
|
+
: undefined;
|
|
426
|
+
}
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
429
|
+
resolveDeclaration(node) {
|
|
430
|
+
const ref = this.resolveExpression(node);
|
|
431
|
+
return ref?.kind === "declaration"
|
|
432
|
+
? { pluginId: ref.pluginId, id: ref.id }
|
|
433
|
+
: undefined;
|
|
434
|
+
}
|
|
435
|
+
/** The config object of the `api({...})` call an expression evaluates to. */
|
|
436
|
+
resolveApiConfig(node, followedNames = new Set()) {
|
|
437
|
+
const expression = unwrapExpression(node);
|
|
438
|
+
if (expression?.type === "Identifier" &&
|
|
439
|
+
typeof expression.name === "string") {
|
|
440
|
+
const name = expression.name;
|
|
441
|
+
if (followedNames.has(name) || !this.initializers.has(name)) {
|
|
442
|
+
return undefined;
|
|
592
443
|
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
444
|
+
followedNames.add(name);
|
|
445
|
+
return this.resolveApiConfig(this.initializers.get(name), followedNames);
|
|
446
|
+
}
|
|
447
|
+
if (expression?.type !== "CallExpression" ||
|
|
448
|
+
getCalleeName(expression.callee) !== "api" ||
|
|
449
|
+
!Array.isArray(expression.arguments)) {
|
|
450
|
+
return undefined;
|
|
451
|
+
}
|
|
452
|
+
const config = unwrapExpression(expression.arguments[0]);
|
|
453
|
+
return config?.type === "ObjectExpression" ? config : undefined;
|
|
454
|
+
}
|
|
455
|
+
resolveName(name, followedNames) {
|
|
456
|
+
if (!this.initializers.has(name)) {
|
|
457
|
+
return this.importedRefs.get(name);
|
|
458
|
+
}
|
|
459
|
+
if (followedNames.has(name)) {
|
|
460
|
+
return undefined;
|
|
461
|
+
}
|
|
462
|
+
followedNames.add(name);
|
|
463
|
+
return this.resolveExpression(this.initializers.get(name), followedNames);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
/** An API module's `api()` export and the integrations its config declares. */
|
|
467
|
+
class ApiModule {
|
|
468
|
+
module;
|
|
469
|
+
scope;
|
|
470
|
+
constructor(module, scope) {
|
|
471
|
+
this.module = module;
|
|
472
|
+
this.scope = scope;
|
|
473
|
+
}
|
|
474
|
+
integrationsOf(exportName) {
|
|
475
|
+
const exported = this.module.localExports().get(exportName);
|
|
476
|
+
const apiConfig = exported && this.scope.resolveApiConfig(exported);
|
|
477
|
+
if (!apiConfig) {
|
|
478
|
+
return { integrations: [], unresolvedKeys: ["*"] };
|
|
479
|
+
}
|
|
480
|
+
return this.readDeclarations(apiConfig);
|
|
481
|
+
}
|
|
482
|
+
readDeclarations(apiConfig) {
|
|
483
|
+
const { objects, isDefinitive } = readIntegrationsObjects(apiConfig);
|
|
484
|
+
const integrations = [];
|
|
485
|
+
const unresolvedKeys = isDefinitive ? [] : ["*"];
|
|
486
|
+
for (const member of objects.flatMap(membersOf)) {
|
|
487
|
+
const key = member.type === "ObjectProperty" ? getMemberKeyName(member) : undefined;
|
|
488
|
+
const declaration = key === undefined
|
|
489
|
+
? undefined
|
|
490
|
+
: this.scope.resolveDeclaration(member.value);
|
|
491
|
+
if (key !== undefined && declaration) {
|
|
492
|
+
integrations.push({ key, ...declaration });
|
|
597
493
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
refs.set(exportedName, {
|
|
601
|
-
kind: "declaration",
|
|
602
|
-
pluginId: varRef.pluginId,
|
|
603
|
-
id: varRef.id,
|
|
604
|
-
});
|
|
494
|
+
else {
|
|
495
|
+
unresolvedKeys.push(unresolvedKeyOf(member));
|
|
605
496
|
}
|
|
606
497
|
}
|
|
498
|
+
return { integrations, unresolvedKeys };
|
|
607
499
|
}
|
|
608
|
-
return refs;
|
|
609
500
|
}
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
501
|
+
function isSameRef(left, right) {
|
|
502
|
+
const pluginIdOf = (ref) => ref.kind === "declaration" ? ref.pluginId : undefined;
|
|
503
|
+
return (left.kind === right.kind &&
|
|
504
|
+
left.id === right.id &&
|
|
505
|
+
pluginIdOf(left) === pluginIdOf(right));
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* The most modules an imported name is followed through, counting the module
|
|
509
|
+
* the entry point imports it from as the first.
|
|
510
|
+
*/
|
|
511
|
+
const MAX_IMPORT_HOPS = 5;
|
|
512
|
+
/**
|
|
513
|
+
* The most candidate files one call reads, so an app whose modules import
|
|
514
|
+
* widely cannot make one lookup read it whole. Every candidate of an import
|
|
515
|
+
* counts, whether or not it exists. An import that needs more is left
|
|
516
|
+
* unresolved.
|
|
517
|
+
*/
|
|
518
|
+
export const MAX_SOURCE_READS = 256;
|
|
519
|
+
/**
|
|
520
|
+
* Resolves the names an API entry point imports, following relative imports
|
|
521
|
+
* and re-exports through at most {@link MAX_IMPORT_HOPS} modules. It follows
|
|
522
|
+
* only the names a lookup reaches: one export of a module at a time, and of
|
|
523
|
+
* that export only the imports its value refers to. One instance serves one
|
|
524
|
+
* entry point: it reads and parses each file at most once, and cuts an
|
|
525
|
+
* import cycle where it closes, leaving the names that depend on the cycle
|
|
526
|
+
* unresolved.
|
|
527
|
+
*/
|
|
528
|
+
class ImportedIntegrationResolver {
|
|
529
|
+
readSource;
|
|
530
|
+
bindings;
|
|
531
|
+
files = new Map();
|
|
532
|
+
exportRefs = new Map();
|
|
533
|
+
exportsInProgress = new Set();
|
|
534
|
+
sourceReadsLeft = MAX_SOURCE_READS;
|
|
535
|
+
constructor(readSource, bindings) {
|
|
536
|
+
this.readSource = readSource;
|
|
537
|
+
this.bindings = bindings;
|
|
538
|
+
}
|
|
539
|
+
/** A scope of the entry point with the imports `use` looks up resolved. */
|
|
540
|
+
async entryScope(entry, use) {
|
|
541
|
+
// The `..`-prefix skip only guards against traversal relative to the
|
|
542
|
+
// entry point's own directory, so an absolute or backslashed entry point
|
|
543
|
+
// could still resolve candidates outside the app root.
|
|
544
|
+
if (entry.path.startsWith("/") || entry.path.includes("\\")) {
|
|
545
|
+
return new ModuleScope(entry, new Map(), this.bindings);
|
|
546
|
+
}
|
|
547
|
+
this.files.set(entry.path, { exists: true, module: entry });
|
|
548
|
+
return this.scopeFor(entry, 1, use);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Run `use` once with no imports to find which imported names it reads,
|
|
552
|
+
* then resolve only those. An imported name resolves to an ID or a
|
|
553
|
+
* declaration, never to another name, so the second run reads the same
|
|
554
|
+
* names.
|
|
555
|
+
*/
|
|
556
|
+
async scopeFor(module, hop, use) {
|
|
557
|
+
const lookedUp = new Set();
|
|
558
|
+
use(new ModuleScope(module, {
|
|
559
|
+
get: (name) => {
|
|
560
|
+
lookedUp.add(name);
|
|
561
|
+
return undefined;
|
|
562
|
+
},
|
|
563
|
+
}, this.bindings));
|
|
564
|
+
return new ModuleScope(module, await this.resolveImports(module, lookedUp, hop), this.bindings);
|
|
565
|
+
}
|
|
566
|
+
async resolveImports(importer, localNames, hop) {
|
|
567
|
+
const refs = new Map();
|
|
568
|
+
for (const { source, specifiers } of importer.namedImports()) {
|
|
569
|
+
for (const specifier of specifiers) {
|
|
570
|
+
const importedName = getPropertyName(specifier.imported);
|
|
571
|
+
const localName = getPropertyName(specifier.local);
|
|
572
|
+
if (!importedName || !localName || !localNames.has(localName)) {
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
const ref = await this.exportOfImport(importer, source, importedName, hop);
|
|
576
|
+
if (ref && ref.kind !== "unresolved") {
|
|
577
|
+
refs.set(localName, ref);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
622
581
|
return refs;
|
|
623
582
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
if (
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
// `..\\..\\..\\secret.js`). `posixPath.join` treats `\` as an ordinary
|
|
646
|
-
// filename character rather than a separator, so the `..`-prefix guard
|
|
647
|
-
// below cannot catch a traversal spelled with backslashes. Treat the
|
|
648
|
-
// specifier as unresolvable, the same as a bare package import, and
|
|
649
|
-
// never attempt to read it.
|
|
650
|
-
if (importPath.includes("\\")) {
|
|
651
|
-
continue;
|
|
652
|
-
}
|
|
653
|
-
// Skip candidates that resolve outside the app root (e.g.
|
|
654
|
-
// `../../../secrets.ts` escaping above the entry point's directory) —
|
|
655
|
-
// never read files outside the app being built.
|
|
656
|
-
const candidatePaths = resolveRelativeImportPath(entryPoint, importPath).filter((candidate) => !candidate.startsWith(".."));
|
|
657
|
-
if (candidatePaths.length === 0) {
|
|
658
|
-
continue;
|
|
659
|
-
}
|
|
660
|
-
const importedBody = await readUnambiguous(candidatePaths, readSource, candidateFiles);
|
|
661
|
-
if (!importedBody) {
|
|
662
|
-
continue;
|
|
663
|
-
}
|
|
664
|
-
const exportedRefs = buildExportedIntegrationRefMap(importedBody, bindings);
|
|
665
|
-
for (const specifier of specifiers) {
|
|
666
|
-
if (specifier.type !== "ImportSpecifier") {
|
|
667
|
-
continue;
|
|
583
|
+
async exportOfImport(importer, sourceNode, name, hop) {
|
|
584
|
+
if (hop > MAX_IMPORT_HOPS) {
|
|
585
|
+
return UNRESOLVED_EXPORT;
|
|
586
|
+
}
|
|
587
|
+
const imported = await this.readUnambiguous(importer.candidatePathsFor(sourceNode));
|
|
588
|
+
return imported ? this.exportOf(imported, name, hop) : UNRESOLVED_EXPORT;
|
|
589
|
+
}
|
|
590
|
+
async exportOf(module, name, hop) {
|
|
591
|
+
const exportKey = JSON.stringify([module.path, name]);
|
|
592
|
+
if (this.exportsInProgress.has(exportKey)) {
|
|
593
|
+
return UNRESOLVED_EXPORT;
|
|
594
|
+
}
|
|
595
|
+
const cacheKey = JSON.stringify([hop, module.path, name]);
|
|
596
|
+
if (this.exportRefs.has(cacheKey)) {
|
|
597
|
+
return this.exportRefs.get(cacheKey);
|
|
598
|
+
}
|
|
599
|
+
this.exportsInProgress.add(exportKey);
|
|
600
|
+
try {
|
|
601
|
+
const ref = await this.resolveExport(module, name, hop);
|
|
602
|
+
if (ref?.kind !== "unresolved") {
|
|
603
|
+
this.exportRefs.set(cacheKey, ref);
|
|
668
604
|
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
605
|
+
return ref;
|
|
606
|
+
}
|
|
607
|
+
finally {
|
|
608
|
+
this.exportsInProgress.delete(exportKey);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* What `module` exports as `name`. A name the module exports explicitly,
|
|
613
|
+
* even as a type, a `declare`, or a namespace, shadows `export *`.
|
|
614
|
+
*/
|
|
615
|
+
async resolveExport(module, name, hop) {
|
|
616
|
+
const local = module.localExports().get(name);
|
|
617
|
+
if (local) {
|
|
618
|
+
const scope = await this.scopeFor(module, hop + 1, (probe) => probe.resolveExpression(local));
|
|
619
|
+
return scope.resolveExpression(local) ?? UNRESOLVED_EXPORT;
|
|
620
|
+
}
|
|
621
|
+
const reExport = module.namedReExportOf(name);
|
|
622
|
+
if (reExport) {
|
|
623
|
+
return ((await this.exportOfImport(module, reExport.source, reExport.localName, hop + 1)) ?? UNRESOLVED_EXPORT);
|
|
624
|
+
}
|
|
625
|
+
return module.explicitExportNames().has(name)
|
|
626
|
+
? UNRESOLVED_EXPORT
|
|
627
|
+
: this.starExportOf(module, name, hop);
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* What the `export *` sources of `module` provide as `name`, when they
|
|
631
|
+
* agree. A name two sources disagree on is ambiguous in ESM.
|
|
632
|
+
*/
|
|
633
|
+
async starExportOf(module, name, hop) {
|
|
634
|
+
const refs = [];
|
|
635
|
+
for (const sourceNode of module.starReExportSources()) {
|
|
636
|
+
const ref = await this.exportOfImport(module, sourceNode, name, hop + 1);
|
|
637
|
+
if (ref?.kind === "unresolved") {
|
|
638
|
+
return UNRESOLVED_EXPORT;
|
|
639
|
+
}
|
|
640
|
+
if (ref) {
|
|
641
|
+
refs.push(ref);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const [first] = refs;
|
|
645
|
+
if (first && refs.some((ref) => !isSameRef(ref, first))) {
|
|
646
|
+
return UNRESOLVED_EXPORT;
|
|
647
|
+
}
|
|
648
|
+
return first;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* The module a specifier loads when exactly one of its candidate files
|
|
652
|
+
* exists. With more than one, which the bundler loads depends on its
|
|
653
|
+
* resolution order, so the import is left unresolved.
|
|
654
|
+
*/
|
|
655
|
+
async readUnambiguous(candidatePaths) {
|
|
656
|
+
const existing = [];
|
|
657
|
+
for (const path of candidatePaths) {
|
|
658
|
+
const file = await this.read(path);
|
|
659
|
+
if (file.exists) {
|
|
660
|
+
existing.push(file);
|
|
674
661
|
}
|
|
675
662
|
}
|
|
663
|
+
return existing.length === 1 ? existing[0]?.module : undefined;
|
|
664
|
+
}
|
|
665
|
+
async read(path) {
|
|
666
|
+
const cached = this.files.get(path);
|
|
667
|
+
if (cached) {
|
|
668
|
+
return cached;
|
|
669
|
+
}
|
|
670
|
+
const file = await this.readAndParse(path);
|
|
671
|
+
this.files.set(path, file);
|
|
672
|
+
return file;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* A file whose read throws counts as existing, since the bundler may load
|
|
676
|
+
* it, and so does one past {@link MAX_SOURCE_READS}, which is not read.
|
|
677
|
+
*/
|
|
678
|
+
async readAndParse(path) {
|
|
679
|
+
if (this.sourceReadsLeft === 0) {
|
|
680
|
+
return { exists: true };
|
|
681
|
+
}
|
|
682
|
+
this.sourceReadsLeft -= 1;
|
|
683
|
+
let source;
|
|
684
|
+
try {
|
|
685
|
+
source = await this.readSource(path);
|
|
686
|
+
}
|
|
687
|
+
catch {
|
|
688
|
+
return { exists: true };
|
|
689
|
+
}
|
|
690
|
+
if (source === undefined) {
|
|
691
|
+
return { exists: false };
|
|
692
|
+
}
|
|
693
|
+
try {
|
|
694
|
+
return {
|
|
695
|
+
exists: true,
|
|
696
|
+
module: new SourceModule(path, parseProgramBody(source, path)),
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
catch {
|
|
700
|
+
return { exists: true };
|
|
701
|
+
}
|
|
676
702
|
}
|
|
677
|
-
return refs;
|
|
678
703
|
}
|
|
679
704
|
//# sourceMappingURL=extract-api-integrations.js.map
|