@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
|
@@ -0,0 +1,756 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AiGenerationState, AiMode, promptCostTokensFrom, } from "@superblocksteam/library-shared/types";
|
|
4
|
+
import { getAiQuotaPaywallReasonFromMessage, } from "@superblocksteam/shared";
|
|
5
|
+
import { getToolErrorMessage } from "./agent/tool-message-utils.js";
|
|
6
|
+
import { BuilderRuntimeError, } from "./builder-runtime.js";
|
|
7
|
+
import { BuilderSessionStore } from "./builder-session-store.js";
|
|
8
|
+
import { AnotherQuestionPendingError, } from "./builder-tools.js";
|
|
9
|
+
import { NativeCallbackOrder } from "./native-callback-order.js";
|
|
10
|
+
import { RequestDeduplicator } from "./request-deduplicator.js";
|
|
11
|
+
import { paywallStopAdvice } from "./state-machine/helpers/prompt-failure.js";
|
|
12
|
+
const toolErrorOutputSchema = z.union([
|
|
13
|
+
z.string(),
|
|
14
|
+
z.object({ message: z.string(), fileName: z.string().optional() }),
|
|
15
|
+
z.object({ error: z.string(), fileName: z.string().optional() }),
|
|
16
|
+
]);
|
|
17
|
+
export class BuilderConversation {
|
|
18
|
+
deps;
|
|
19
|
+
requests = new RequestDeduplicator();
|
|
20
|
+
sessions;
|
|
21
|
+
turn;
|
|
22
|
+
completion = Promise.resolve();
|
|
23
|
+
snapshot = {
|
|
24
|
+
state: AiGenerationState.IDLE,
|
|
25
|
+
};
|
|
26
|
+
pendingPermission;
|
|
27
|
+
pendingQuestion;
|
|
28
|
+
constructor(deps) {
|
|
29
|
+
this.deps = deps;
|
|
30
|
+
this.sessions = deps.sessionStore ?? new BuilderSessionStore();
|
|
31
|
+
}
|
|
32
|
+
get isBusy() {
|
|
33
|
+
return this.turn !== undefined;
|
|
34
|
+
}
|
|
35
|
+
get generationId() {
|
|
36
|
+
return this.snapshot.generationId;
|
|
37
|
+
}
|
|
38
|
+
get state() {
|
|
39
|
+
return this.snapshot;
|
|
40
|
+
}
|
|
41
|
+
get activeInteractiveMessage() {
|
|
42
|
+
return this.pendingQuestion?.message;
|
|
43
|
+
}
|
|
44
|
+
hasRequest(requestId) {
|
|
45
|
+
return requestId !== undefined && this.requests.has(requestId);
|
|
46
|
+
}
|
|
47
|
+
get isAwaitingUser() {
|
|
48
|
+
return (this.snapshot.state === AiGenerationState.AWAITING_USER_INPUT ||
|
|
49
|
+
this.snapshot.state === AiGenerationState.COMPLETED);
|
|
50
|
+
}
|
|
51
|
+
async start(request) {
|
|
52
|
+
if (request.requestId && this.requests.has(request.requestId))
|
|
53
|
+
return this.generationId;
|
|
54
|
+
const pendingQuestion = this.pendingQuestion;
|
|
55
|
+
if (request.responseMetadata?.type === "multi_choice_response" &&
|
|
56
|
+
pendingQuestion?.message.id !==
|
|
57
|
+
request.responseMetadata.responseToMessageId) {
|
|
58
|
+
// The question's turn ended (for example the runtime restarted) while
|
|
59
|
+
// the editor still shows it. Typed text is a new request; a bare choice
|
|
60
|
+
// means nothing without the question.
|
|
61
|
+
if (!request.prompt.trim())
|
|
62
|
+
throw new Error("No matching pending native question");
|
|
63
|
+
request = { ...request, responseMetadata: undefined };
|
|
64
|
+
}
|
|
65
|
+
if (request.responseMetadata?.type === "multi_choice_response") {
|
|
66
|
+
const pending = pendingQuestion;
|
|
67
|
+
const answers = request.responseMetadata.selectedChoiceIndices.map((index) => {
|
|
68
|
+
const choice = pending.message.choices[index];
|
|
69
|
+
if (choice === undefined)
|
|
70
|
+
throw new Error("Invalid native question answer");
|
|
71
|
+
return typeof choice === "string" ? choice : choice.text;
|
|
72
|
+
});
|
|
73
|
+
if (request.prompt.trim())
|
|
74
|
+
answers.push(request.prompt.trim());
|
|
75
|
+
if (!answers.length)
|
|
76
|
+
throw new Error("An answer is required");
|
|
77
|
+
const turn = this.turn;
|
|
78
|
+
if (!turn || turn.controller.signal.aborted)
|
|
79
|
+
throw new DOMException("Builder turn ended", "AbortError");
|
|
80
|
+
if (pending.responding)
|
|
81
|
+
throw new Error("Question response is already being applied");
|
|
82
|
+
pending.responding = true;
|
|
83
|
+
if (request.requestId)
|
|
84
|
+
this.requests.markIfNew(request.requestId);
|
|
85
|
+
await this.publish({
|
|
86
|
+
role: "user",
|
|
87
|
+
type: "multi_choice_response",
|
|
88
|
+
content: request.prompt,
|
|
89
|
+
responseToMessageId: pending.message.id,
|
|
90
|
+
selectedChoiceIndices: request.responseMetadata.selectedChoiceIndices,
|
|
91
|
+
});
|
|
92
|
+
turn.controller.signal.throwIfAborted();
|
|
93
|
+
await this.publishState(AiGenerationState.GENERATING, turn.id);
|
|
94
|
+
turn.controller.signal.throwIfAborted();
|
|
95
|
+
this.pendingQuestion = undefined;
|
|
96
|
+
pending.resolve(answers);
|
|
97
|
+
return this.generationId;
|
|
98
|
+
}
|
|
99
|
+
if (request.responseMetadata?.type === "tool_permission_response") {
|
|
100
|
+
await this.respondToPermission({
|
|
101
|
+
messageId: request.responseMetadata.responseToMessageId,
|
|
102
|
+
approved: request.responseMetadata.approved === true,
|
|
103
|
+
requestId: request.requestId,
|
|
104
|
+
});
|
|
105
|
+
return this.generationId;
|
|
106
|
+
}
|
|
107
|
+
if (this.turn)
|
|
108
|
+
throw new Error("Service is busy");
|
|
109
|
+
if (request.promptContext?.attachments?.length)
|
|
110
|
+
throw new Error("Native builder does not yet support image or file attachments");
|
|
111
|
+
if (request.requestId)
|
|
112
|
+
this.requests.markIfNew(request.requestId);
|
|
113
|
+
const turn = {
|
|
114
|
+
id: randomUUID(),
|
|
115
|
+
controller: new AbortController(),
|
|
116
|
+
completion: Promise.resolve(),
|
|
117
|
+
events: Promise.resolve(),
|
|
118
|
+
calls: new Set(),
|
|
119
|
+
results: new Set(),
|
|
120
|
+
plans: new Set(),
|
|
121
|
+
subagents: new Map(),
|
|
122
|
+
startedAt: new Date().toISOString(),
|
|
123
|
+
model: this.deps.runtime.model,
|
|
124
|
+
callbacks: new NativeCallbackOrder(),
|
|
125
|
+
};
|
|
126
|
+
this.turn = turn;
|
|
127
|
+
this.snapshot = {
|
|
128
|
+
state: AiGenerationState.GENERATING,
|
|
129
|
+
generationId: turn.id,
|
|
130
|
+
};
|
|
131
|
+
let userPublished = false;
|
|
132
|
+
try {
|
|
133
|
+
const prepared = await this.deps.prepare(request, turn.controller.signal, turn.id);
|
|
134
|
+
turn.controller.signal.throwIfAborted();
|
|
135
|
+
const provider = this.deps.runtime.providerFor(this.deps.runtime.model);
|
|
136
|
+
const scope = `${prepared.scope}:${provider}:${this.deps.runtime.model}`;
|
|
137
|
+
let session = prepared.conversationId
|
|
138
|
+
? {
|
|
139
|
+
conversationId: prepared.conversationId,
|
|
140
|
+
sessionId: prepared.nativeSessionId,
|
|
141
|
+
}
|
|
142
|
+
: await this.sessions.get(scope);
|
|
143
|
+
if (!session) {
|
|
144
|
+
session = {
|
|
145
|
+
conversationId: prepared.conversationId ?? BuilderSessionStore.identity(scope),
|
|
146
|
+
};
|
|
147
|
+
await this.sessions.set(scope, session);
|
|
148
|
+
}
|
|
149
|
+
await this.publishUser(request);
|
|
150
|
+
userPublished = true;
|
|
151
|
+
await this.publishState(AiGenerationState.GENERATING, turn.id);
|
|
152
|
+
const { context, ...tools } = await this.deps.tools.prepare({
|
|
153
|
+
conversationId: session.conversationId,
|
|
154
|
+
provider,
|
|
155
|
+
request,
|
|
156
|
+
abortSignal: turn.controller.signal,
|
|
157
|
+
peer: this.deps.peer,
|
|
158
|
+
requestPermission: (permission) => this.requestPermission(permission),
|
|
159
|
+
askUser: (message, signal) => this.askUser(turn, message, signal),
|
|
160
|
+
});
|
|
161
|
+
turn.controller.signal.throwIfAborted();
|
|
162
|
+
turn.completion = this.run(turn, {
|
|
163
|
+
...tools,
|
|
164
|
+
callbackTools: this.callbackTools(turn, request),
|
|
165
|
+
mode: request.mode === AiMode.PLAN ? "plan" : "build",
|
|
166
|
+
runId: request.requestId
|
|
167
|
+
? BuilderSessionStore.identity(`${session.conversationId}:${request.requestId}`)
|
|
168
|
+
: turn.id,
|
|
169
|
+
conversationId: session.conversationId,
|
|
170
|
+
workspaceSessionKey: prepared.workspaceSessionKey,
|
|
171
|
+
...(prepared.workspaceLocal && { workspaceLocal: true }),
|
|
172
|
+
actorId: prepared.actorId,
|
|
173
|
+
inference: prepared.inference,
|
|
174
|
+
...(prepared.refreshInference && {
|
|
175
|
+
refreshInference: prepared.refreshInference,
|
|
176
|
+
}),
|
|
177
|
+
...(prepared.traceContext && { traceContext: prepared.traceContext }),
|
|
178
|
+
sessionId: session.sessionId,
|
|
179
|
+
model: this.deps.runtime.model,
|
|
180
|
+
prompt: [context, request.prompt].filter(Boolean).join("\n\n"),
|
|
181
|
+
signal: turn.controller.signal,
|
|
182
|
+
onEvent: (event) => {
|
|
183
|
+
if (this.turn !== turn || turn.controller.signal.aborted)
|
|
184
|
+
return;
|
|
185
|
+
turn.events = turn.events
|
|
186
|
+
.then(async () => {
|
|
187
|
+
if (turn.controller.signal.aborted)
|
|
188
|
+
return;
|
|
189
|
+
if (event.type === "session") {
|
|
190
|
+
if (prepared.saveSession)
|
|
191
|
+
await this.persistSession(turn, prepared.saveSession(event.sessionId));
|
|
192
|
+
session.sessionId = event.sessionId;
|
|
193
|
+
await this.sessions.set(scope, session);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// A workspace turn's finish counts even without workspace
|
|
197
|
+
// state: the missing hash means its turn-end commit failed.
|
|
198
|
+
if (event.type === "finish" &&
|
|
199
|
+
(event.workspace || prepared.workspaceLocal))
|
|
200
|
+
await prepared.onWorkspaceFinish?.(event.workspace ?? {});
|
|
201
|
+
await this.event(turn, event);
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
.catch((error) => {
|
|
205
|
+
turn.controller.abort(error);
|
|
206
|
+
this.deps.onError?.(error);
|
|
207
|
+
});
|
|
208
|
+
return turn.events;
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
this.completion = turn.completion;
|
|
212
|
+
return turn.id;
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
const paywallReason = error instanceof Error
|
|
216
|
+
? getAiQuotaPaywallReasonFromMessage(error.message)
|
|
217
|
+
: undefined;
|
|
218
|
+
if (paywallReason && !turn.controller.signal.aborted) {
|
|
219
|
+
if (!userPublished)
|
|
220
|
+
await this.publishUser(request);
|
|
221
|
+
await this.publish({
|
|
222
|
+
role: "assistant",
|
|
223
|
+
type: "text",
|
|
224
|
+
content: paywallStopAdvice(paywallReason),
|
|
225
|
+
});
|
|
226
|
+
await this.settle(turn, error, paywallReason);
|
|
227
|
+
return turn.id;
|
|
228
|
+
}
|
|
229
|
+
if (request.requestId)
|
|
230
|
+
this.requests.forget(request.requestId);
|
|
231
|
+
await this.settle(turn, error);
|
|
232
|
+
throw error;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async persistSession(turn, saved) {
|
|
236
|
+
const signal = turn.controller.signal;
|
|
237
|
+
signal.throwIfAborted();
|
|
238
|
+
let onAbort = () => { };
|
|
239
|
+
let timeout;
|
|
240
|
+
const interrupted = new Promise((_, reject) => {
|
|
241
|
+
onAbort = () => reject(signal.reason);
|
|
242
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
243
|
+
timeout = setTimeout(() => reject(new Error("Native session persistence timed out")), 30_000);
|
|
244
|
+
timeout.unref();
|
|
245
|
+
});
|
|
246
|
+
try {
|
|
247
|
+
await Promise.race([saved, interrupted]);
|
|
248
|
+
}
|
|
249
|
+
finally {
|
|
250
|
+
signal.removeEventListener("abort", onAbort);
|
|
251
|
+
clearTimeout(timeout);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async run(turn, invocation) {
|
|
255
|
+
let failure;
|
|
256
|
+
try {
|
|
257
|
+
await this.deps.runtime.invoke(invocation);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
failure = error;
|
|
261
|
+
if (!turn.controller.signal.aborted) {
|
|
262
|
+
this.deps.onError?.(error);
|
|
263
|
+
await this.publish({
|
|
264
|
+
role: "assistant",
|
|
265
|
+
type: "error",
|
|
266
|
+
content: error instanceof BuilderRuntimeError
|
|
267
|
+
? error.message
|
|
268
|
+
: "The native builder stopped before completing this request. Its outcome may be incomplete; inspect the app before sending another prompt.",
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
try {
|
|
274
|
+
await this.deps.afterRun?.({ events: () => turn.events });
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
failure ??= error;
|
|
278
|
+
this.deps.onError?.(error);
|
|
279
|
+
}
|
|
280
|
+
try {
|
|
281
|
+
await turn.events;
|
|
282
|
+
await this.flushText(turn);
|
|
283
|
+
await this.deps.chat.flushPendingPushes();
|
|
284
|
+
}
|
|
285
|
+
catch (error) {
|
|
286
|
+
failure ??= error;
|
|
287
|
+
this.deps.onError?.(error);
|
|
288
|
+
}
|
|
289
|
+
this.clearPermission(new DOMException("Builder turn ended", "AbortError"));
|
|
290
|
+
await this.settle(turn, failure);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async cancel() {
|
|
294
|
+
const turn = this.turn;
|
|
295
|
+
if (!turn)
|
|
296
|
+
return;
|
|
297
|
+
turn.controller.abort(new DOMException("Builder turn cancelled", "AbortError"));
|
|
298
|
+
this.clearPermission(turn.controller.signal.reason);
|
|
299
|
+
await turn.completion;
|
|
300
|
+
await this.settle(turn, turn.controller.signal.reason);
|
|
301
|
+
}
|
|
302
|
+
async trackSubagent(turn, callId, payload) {
|
|
303
|
+
const fields = isRecord(payload) ? payload : {};
|
|
304
|
+
const previous = turn.subagents.get(callId);
|
|
305
|
+
const label = typeof fields.task === "string"
|
|
306
|
+
? fields.task
|
|
307
|
+
: (previous?.label ?? "Sub-agent");
|
|
308
|
+
const status = fields.status === "completed" || fields.status === "failed"
|
|
309
|
+
? fields.status
|
|
310
|
+
: "running";
|
|
311
|
+
const startedAt = previous?.startedAt ?? Date.now();
|
|
312
|
+
turn.subagents.set(callId, { startedAt, label, status });
|
|
313
|
+
await this.pushSubagent(callId, label, status, startedAt);
|
|
314
|
+
}
|
|
315
|
+
pushSubagent(taskId, label, status, startedAt) {
|
|
316
|
+
return this.push(() => this.deps.peer.call.aiPushTaskStatus({
|
|
317
|
+
taskId,
|
|
318
|
+
taskType: "subagent",
|
|
319
|
+
label: `Sub-agent: ${label}`,
|
|
320
|
+
state: status,
|
|
321
|
+
ageMs: Date.now() - startedAt,
|
|
322
|
+
...(status !== "running" && { completedAt: new Date().toISOString() }),
|
|
323
|
+
...(status === "failed" && {
|
|
324
|
+
error: "The sub-agent stopped before finishing.",
|
|
325
|
+
}),
|
|
326
|
+
}));
|
|
327
|
+
}
|
|
328
|
+
async settle(turn, failure, paywallReason) {
|
|
329
|
+
if (turn.settled)
|
|
330
|
+
return;
|
|
331
|
+
turn.settled = true;
|
|
332
|
+
// A worker's own end can arrive after the root turn closes the stream; never leave its row running.
|
|
333
|
+
for (const [id, worker] of turn.subagents)
|
|
334
|
+
if (worker.status === "running")
|
|
335
|
+
await this.pushSubagent(id, worker.label, "failed", worker.startedAt);
|
|
336
|
+
if (this.turn === turn) {
|
|
337
|
+
this.turn = undefined;
|
|
338
|
+
await this.publishState(failure || turn.controller.signal.aborted
|
|
339
|
+
? AiGenerationState.CANCELLED
|
|
340
|
+
: AiGenerationState.COMPLETED, turn.id, !!failure && !turn.controller.signal.aborted && !paywallReason, paywallReason);
|
|
341
|
+
}
|
|
342
|
+
this.deps.onSettled(turn.id, failure ?? turn.controller.signal.reason);
|
|
343
|
+
}
|
|
344
|
+
waitForCompletion() {
|
|
345
|
+
return this.completion;
|
|
346
|
+
}
|
|
347
|
+
async reset() {
|
|
348
|
+
await this.cancel();
|
|
349
|
+
await this.deps.chat.newChat();
|
|
350
|
+
await this.sessions.clear();
|
|
351
|
+
this.snapshot = { state: AiGenerationState.IDLE, chatSessionReset: true };
|
|
352
|
+
await this.push(() => this.deps.peer.call.aiSetGenerationState(this.snapshot));
|
|
353
|
+
}
|
|
354
|
+
async requestPermission(request) {
|
|
355
|
+
const turn = this.turn;
|
|
356
|
+
if (!turn || turn.controller.signal.aborted)
|
|
357
|
+
throw new DOMException("Builder turn ended", "AbortError");
|
|
358
|
+
if (this.pendingPermission)
|
|
359
|
+
throw new Error("A tool permission request is already pending");
|
|
360
|
+
const result = new Promise((resolve, reject) => {
|
|
361
|
+
this.pendingPermission = { request, resolve, reject };
|
|
362
|
+
});
|
|
363
|
+
void result.catch(() => { });
|
|
364
|
+
await this.flushText(turn);
|
|
365
|
+
await this.publishState(AiGenerationState.AWAITING_USER_INPUT, turn.id);
|
|
366
|
+
await this.deliverPermission(request);
|
|
367
|
+
return result;
|
|
368
|
+
}
|
|
369
|
+
async respondToPermission(response) {
|
|
370
|
+
if (response.requestId && this.requests.has(response.requestId))
|
|
371
|
+
return;
|
|
372
|
+
const pending = this.pendingPermission;
|
|
373
|
+
if (!pending || pending.request.toolCallId !== response.messageId)
|
|
374
|
+
throw new Error("No matching pending tool permission");
|
|
375
|
+
if (!this.turn || this.turn.controller.signal.aborted)
|
|
376
|
+
throw new Error("Builder turn ended");
|
|
377
|
+
const turn = this.turn;
|
|
378
|
+
if (pending.responding)
|
|
379
|
+
throw new Error("Permission response is already being applied");
|
|
380
|
+
pending.responding = true;
|
|
381
|
+
if (response.requestId)
|
|
382
|
+
this.requests.markIfNew(response.requestId);
|
|
383
|
+
await this.push(() => this.deps.peer.call.aiClearToolPermission());
|
|
384
|
+
turn.controller.signal.throwIfAborted();
|
|
385
|
+
await this.publishState(AiGenerationState.GENERATING, turn.id);
|
|
386
|
+
turn.controller.signal.throwIfAborted();
|
|
387
|
+
this.pendingPermission = undefined;
|
|
388
|
+
pending.resolve(response.approved);
|
|
389
|
+
}
|
|
390
|
+
async replay() {
|
|
391
|
+
await this.push(() => this.deps.peer.call.aiSetGenerationState(this.snapshot));
|
|
392
|
+
if (this.pendingPermission)
|
|
393
|
+
await this.deliverPermission(this.pendingPermission.request);
|
|
394
|
+
else
|
|
395
|
+
await this.push(() => this.deps.peer.call.aiClearToolPermission());
|
|
396
|
+
if (this.pendingQuestion)
|
|
397
|
+
await this.push(() => this.deps.peer.call.aiPushMessage(this.pendingQuestion.message));
|
|
398
|
+
const text = this.turn?.text;
|
|
399
|
+
if (text)
|
|
400
|
+
await this.push(() => this.deps.peer.call.aiPushMessage({
|
|
401
|
+
id: text.id,
|
|
402
|
+
role: "assistant",
|
|
403
|
+
type: "text",
|
|
404
|
+
textBlockId: text.id,
|
|
405
|
+
content: text.value,
|
|
406
|
+
}));
|
|
407
|
+
}
|
|
408
|
+
async askUser(turn, message, signal) {
|
|
409
|
+
// The check and the pendingQuestion assignment below are separated by
|
|
410
|
+
// awaits. That is safe only because every tool that can ask (the
|
|
411
|
+
// integration setup banner tools and __runtime_user_input) runs through
|
|
412
|
+
// the turn's serial ToolRun queue; marking one concurrent would let two
|
|
413
|
+
// questions race here.
|
|
414
|
+
if (this.pendingQuestion)
|
|
415
|
+
throw new AnotherQuestionPendingError();
|
|
416
|
+
await turn.events;
|
|
417
|
+
signal.throwIfAborted();
|
|
418
|
+
await this.flushText(turn);
|
|
419
|
+
signal.throwIfAborted();
|
|
420
|
+
const result = new Promise((resolve, reject) => {
|
|
421
|
+
this.pendingQuestion = { message, resolve, reject };
|
|
422
|
+
});
|
|
423
|
+
void result.catch(() => { });
|
|
424
|
+
await this.publishState(AiGenerationState.AWAITING_USER_INPUT, turn.id);
|
|
425
|
+
signal.throwIfAborted();
|
|
426
|
+
await this.publish(message);
|
|
427
|
+
return result;
|
|
428
|
+
}
|
|
429
|
+
async event(turn, event) {
|
|
430
|
+
switch (event.type) {
|
|
431
|
+
case "callback-ready":
|
|
432
|
+
await this.flushText(turn);
|
|
433
|
+
turn.callbacks.arrive(event.id);
|
|
434
|
+
break;
|
|
435
|
+
case "text-delta": {
|
|
436
|
+
turn.text ??= { id: randomUUID(), value: "" };
|
|
437
|
+
turn.text.value += event.text;
|
|
438
|
+
await this.push(() => this.deps.peer.call.aiPushMessage({
|
|
439
|
+
id: randomUUID(),
|
|
440
|
+
role: "assistant",
|
|
441
|
+
type: "text-delta",
|
|
442
|
+
textBlockId: turn.text.id,
|
|
443
|
+
content: event.text,
|
|
444
|
+
}));
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
case "plan":
|
|
448
|
+
if (turn.plans.has(event.id))
|
|
449
|
+
return;
|
|
450
|
+
turn.plans.add(event.id);
|
|
451
|
+
await this.flushText(turn);
|
|
452
|
+
await this.publish({
|
|
453
|
+
role: "assistant",
|
|
454
|
+
type: "plan",
|
|
455
|
+
content: event.text,
|
|
456
|
+
title: "Plan",
|
|
457
|
+
streaming: false,
|
|
458
|
+
});
|
|
459
|
+
break;
|
|
460
|
+
case "tool-call":
|
|
461
|
+
if (turn.calls.has(event.toolCallId)) {
|
|
462
|
+
// A worker's label can arrive after its row was opened.
|
|
463
|
+
if (event.toolName === "spawn_agent" &&
|
|
464
|
+
turn.subagents.get(event.toolCallId)?.status === "running")
|
|
465
|
+
await this.trackSubagent(turn, event.toolCallId, event.input);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
turn.calls.add(event.toolCallId);
|
|
469
|
+
await this.flushText(turn);
|
|
470
|
+
if (event.toolName === "spawn_agent")
|
|
471
|
+
await this.trackSubagent(turn, event.toolCallId, event.input);
|
|
472
|
+
await this.publish({
|
|
473
|
+
role: "assistant",
|
|
474
|
+
type: "tool",
|
|
475
|
+
tool: event.toolName,
|
|
476
|
+
args: event.input,
|
|
477
|
+
toolCallId: event.toolCallId,
|
|
478
|
+
content: "",
|
|
479
|
+
id: event.toolCallId,
|
|
480
|
+
});
|
|
481
|
+
break;
|
|
482
|
+
case "tool-result":
|
|
483
|
+
if (turn.results.has(event.toolCallId))
|
|
484
|
+
return;
|
|
485
|
+
turn.results.add(event.toolCallId);
|
|
486
|
+
await this.flushText(turn);
|
|
487
|
+
if (event.toolName === "spawn_agent")
|
|
488
|
+
await this.trackSubagent(turn, event.toolCallId, event.output);
|
|
489
|
+
await this.publish(event.isError
|
|
490
|
+
? {
|
|
491
|
+
role: "assistant",
|
|
492
|
+
type: "tool-error",
|
|
493
|
+
toolCallId: event.toolCallId,
|
|
494
|
+
toolName: event.toolName,
|
|
495
|
+
error: this.toolError(event.output),
|
|
496
|
+
content: "",
|
|
497
|
+
}
|
|
498
|
+
: {
|
|
499
|
+
role: "assistant",
|
|
500
|
+
type: "tool-result",
|
|
501
|
+
toolCallId: event.toolCallId,
|
|
502
|
+
toolName: event.toolName,
|
|
503
|
+
output: event.output,
|
|
504
|
+
content: "",
|
|
505
|
+
});
|
|
506
|
+
break;
|
|
507
|
+
case "finish":
|
|
508
|
+
if (turn.usageRecorded)
|
|
509
|
+
return;
|
|
510
|
+
turn.usageRecorded = true;
|
|
511
|
+
await this.push(() => this.deps.peer.call.aiPushTokenUsage({
|
|
512
|
+
requestId: turn.id,
|
|
513
|
+
inputTokens: event.usage.inputTokens,
|
|
514
|
+
outputTokens: event.usage.outputTokens,
|
|
515
|
+
totalTokens: event.usage.inputTokens + event.usage.outputTokens,
|
|
516
|
+
cachedInputTokens: event.usage.cacheReadTokens,
|
|
517
|
+
model: turn.model,
|
|
518
|
+
startTime: turn.startedAt,
|
|
519
|
+
endTime: new Date().toISOString(),
|
|
520
|
+
}));
|
|
521
|
+
try {
|
|
522
|
+
await this.deps.onUsage?.(turn.id, {
|
|
523
|
+
model: turn.model,
|
|
524
|
+
provider: this.deps.runtime.providerFor(turn.model),
|
|
525
|
+
...promptCostTokensFrom({
|
|
526
|
+
inputTokens: event.usage.inputTokens,
|
|
527
|
+
outputTokens: event.usage.outputTokens,
|
|
528
|
+
inputTokenDetails: {
|
|
529
|
+
cacheReadTokens: event.usage.cacheReadTokens,
|
|
530
|
+
cacheWriteTokens: event.usage.cacheWriteTokens,
|
|
531
|
+
},
|
|
532
|
+
}),
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
catch (error) {
|
|
536
|
+
this.deps.onError?.(error);
|
|
537
|
+
}
|
|
538
|
+
break;
|
|
539
|
+
case "session":
|
|
540
|
+
case "error":
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
async flushText(turn) {
|
|
545
|
+
const text = turn.text;
|
|
546
|
+
if (!text)
|
|
547
|
+
return;
|
|
548
|
+
turn.text = undefined;
|
|
549
|
+
await this.deps.chat.recordAssistant({
|
|
550
|
+
id: text.id,
|
|
551
|
+
role: "assistant",
|
|
552
|
+
type: "text",
|
|
553
|
+
textBlockId: text.id,
|
|
554
|
+
content: text.value,
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
toolError(output) {
|
|
558
|
+
const parsed = toolErrorOutputSchema.safeParse(output);
|
|
559
|
+
if (!parsed.success)
|
|
560
|
+
return "Tool execution failed";
|
|
561
|
+
const value = parsed.data;
|
|
562
|
+
const message = typeof value === "string"
|
|
563
|
+
? value
|
|
564
|
+
: "message" in value
|
|
565
|
+
? value.message
|
|
566
|
+
: value.error;
|
|
567
|
+
const fileName = typeof value === "string" ? undefined : value.fileName;
|
|
568
|
+
const suffix = fileName ? ` (${fileName.slice(0, 256)})` : "";
|
|
569
|
+
return (getToolErrorMessage(message).slice(0, 4_000 - suffix.length) + suffix).toWellFormed();
|
|
570
|
+
}
|
|
571
|
+
async publish(message) {
|
|
572
|
+
const payload = {
|
|
573
|
+
...message,
|
|
574
|
+
id: message.id ?? randomUUID(),
|
|
575
|
+
timestamp: message.timestamp ?? Date.now(),
|
|
576
|
+
};
|
|
577
|
+
await this.deps.chat.recordAssistant(payload);
|
|
578
|
+
await this.push(() => this.deps.peer.call.aiPushMessage(payload));
|
|
579
|
+
}
|
|
580
|
+
async publishUser(request) {
|
|
581
|
+
const response = request.responseMetadata;
|
|
582
|
+
const message = {
|
|
583
|
+
id: request.requestId ?? randomUUID(),
|
|
584
|
+
role: "user",
|
|
585
|
+
content: request.prompt,
|
|
586
|
+
mode: request.mode,
|
|
587
|
+
timestamp: Date.now(),
|
|
588
|
+
...(response?.type === "plan_response"
|
|
589
|
+
? {
|
|
590
|
+
type: response.type,
|
|
591
|
+
responseToMessageId: response.responseToMessageId,
|
|
592
|
+
approved: response.approved ?? true,
|
|
593
|
+
enableTesting: response.enableTesting,
|
|
594
|
+
}
|
|
595
|
+
: { type: "text" }),
|
|
596
|
+
};
|
|
597
|
+
if (response?.type === "plan_response") {
|
|
598
|
+
await this.deps.chat.recordUserResponse(request.prompt, response.type, {
|
|
599
|
+
mode: request.mode,
|
|
600
|
+
messageId: message.id,
|
|
601
|
+
responseToMessageId: response.responseToMessageId,
|
|
602
|
+
approved: response.approved ?? true,
|
|
603
|
+
enableTesting: response.enableTesting,
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
await this.deps.chat.recordUser(request.prompt, {
|
|
608
|
+
mode: request.mode,
|
|
609
|
+
messageId: message.id,
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
await this.push(() => this.deps.peer.call.aiPushMessage(message));
|
|
613
|
+
}
|
|
614
|
+
async publishState(state, generationId, hasError = false, paywallReason) {
|
|
615
|
+
this.snapshot = {
|
|
616
|
+
state,
|
|
617
|
+
generationId,
|
|
618
|
+
...(hasError ? { hasError: true } : {}),
|
|
619
|
+
...(paywallReason ? { paywallReason } : {}),
|
|
620
|
+
};
|
|
621
|
+
await this.push(() => this.deps.peer.call.aiSetGenerationState(this.snapshot));
|
|
622
|
+
}
|
|
623
|
+
deliverPermission(request) {
|
|
624
|
+
return this.push(() => this.deps.peer.call.aiRequestToolPermission({
|
|
625
|
+
messageId: request.toolCallId,
|
|
626
|
+
toolName: request.toolName,
|
|
627
|
+
actionName: request.actionName,
|
|
628
|
+
formattedInput: request.formattedInput,
|
|
629
|
+
rawInput: request.input,
|
|
630
|
+
permissions: request.permissions,
|
|
631
|
+
}));
|
|
632
|
+
}
|
|
633
|
+
clearPermission(error) {
|
|
634
|
+
const pending = this.pendingPermission;
|
|
635
|
+
this.pendingPermission = undefined;
|
|
636
|
+
pending?.reject(error);
|
|
637
|
+
this.pendingQuestion?.reject(error);
|
|
638
|
+
this.pendingQuestion = undefined;
|
|
639
|
+
if (pending)
|
|
640
|
+
void this.push(() => this.deps.peer.call.aiClearToolPermission());
|
|
641
|
+
}
|
|
642
|
+
callbackTools(turn, request) {
|
|
643
|
+
return {
|
|
644
|
+
__runtime_approval: {
|
|
645
|
+
inputSchema: z.object({
|
|
646
|
+
method: z.enum([
|
|
647
|
+
"item/commandExecution/requestApproval",
|
|
648
|
+
"item/fileChange/requestApproval",
|
|
649
|
+
]),
|
|
650
|
+
params: z.record(z.unknown()),
|
|
651
|
+
}),
|
|
652
|
+
execute: async ({ method, params }, options) => {
|
|
653
|
+
if (request.mode === AiMode.PLAN)
|
|
654
|
+
return { decision: "decline" };
|
|
655
|
+
const approved = await this.requestPermission({
|
|
656
|
+
toolCallId: options.toolCallId,
|
|
657
|
+
toolName: method === "item/fileChange/requestApproval"
|
|
658
|
+
? "apply_patch"
|
|
659
|
+
: typeof params.toolName === "string"
|
|
660
|
+
? params.toolName
|
|
661
|
+
: "exec_command",
|
|
662
|
+
input: params,
|
|
663
|
+
formattedInput: {
|
|
664
|
+
targets: [
|
|
665
|
+
typeof params.command === "string"
|
|
666
|
+
? params.command
|
|
667
|
+
: "Native builder action",
|
|
668
|
+
],
|
|
669
|
+
},
|
|
670
|
+
permissions: [],
|
|
671
|
+
});
|
|
672
|
+
return { decision: approved ? "accept" : "decline" };
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
__runtime_user_input: {
|
|
676
|
+
inputSchema: z.object({
|
|
677
|
+
method: z.enum(["item/tool/requestUserInput"]),
|
|
678
|
+
afterEventId: z.string().uuid().optional(),
|
|
679
|
+
params: z
|
|
680
|
+
.object({
|
|
681
|
+
questions: z
|
|
682
|
+
.array(z.object({
|
|
683
|
+
id: z.string().optional(),
|
|
684
|
+
question: z.string(),
|
|
685
|
+
header: z.string().optional(),
|
|
686
|
+
multiSelect: z.boolean().optional(),
|
|
687
|
+
options: z
|
|
688
|
+
.array(z.object({
|
|
689
|
+
label: z.string(),
|
|
690
|
+
description: z.string().optional(),
|
|
691
|
+
}))
|
|
692
|
+
.optional(),
|
|
693
|
+
}))
|
|
694
|
+
.min(1),
|
|
695
|
+
})
|
|
696
|
+
.passthrough(),
|
|
697
|
+
}),
|
|
698
|
+
execute: async ({ params, afterEventId }, options) => {
|
|
699
|
+
const signal = options.abortSignal ?? turn.controller.signal;
|
|
700
|
+
if (afterEventId) {
|
|
701
|
+
if (afterEventId !== options.toolCallId)
|
|
702
|
+
throw new Error("Native callback does not match its event");
|
|
703
|
+
await turn.callbacks.wait(afterEventId, signal);
|
|
704
|
+
}
|
|
705
|
+
const answers = {};
|
|
706
|
+
for (const [index, question] of params.questions.entries()) {
|
|
707
|
+
const message = {
|
|
708
|
+
role: "assistant",
|
|
709
|
+
type: "multi_choice",
|
|
710
|
+
content: question.question,
|
|
711
|
+
subtitle: question.header,
|
|
712
|
+
id: `${options.toolCallId}:${index}`,
|
|
713
|
+
choices: question.options?.map((option) => ({
|
|
714
|
+
text: option.label,
|
|
715
|
+
subText: option.description,
|
|
716
|
+
})) ?? [],
|
|
717
|
+
selectionType: question.multiSelect ? "multiple" : "single",
|
|
718
|
+
};
|
|
719
|
+
const values = await this.askUser(turn, message, signal);
|
|
720
|
+
answers[question.id ?? String(index)] = { answers: values };
|
|
721
|
+
}
|
|
722
|
+
return { answers };
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
async push(send) {
|
|
728
|
+
const signal = this.turn?.controller.signal;
|
|
729
|
+
const sent = Promise.resolve()
|
|
730
|
+
.then(send)
|
|
731
|
+
.catch((error) => this.deps.onError?.(error));
|
|
732
|
+
if (!signal || signal.aborted) {
|
|
733
|
+
void sent;
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
let onAbort;
|
|
737
|
+
let timeout;
|
|
738
|
+
const interrupted = new Promise((resolve) => {
|
|
739
|
+
onAbort = resolve;
|
|
740
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
741
|
+
timeout = setTimeout(resolve, 5_000);
|
|
742
|
+
timeout.unref();
|
|
743
|
+
});
|
|
744
|
+
try {
|
|
745
|
+
await Promise.race([sent, interrupted]);
|
|
746
|
+
}
|
|
747
|
+
finally {
|
|
748
|
+
signal.removeEventListener("abort", onAbort);
|
|
749
|
+
clearTimeout(timeout);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function isRecord(value) {
|
|
754
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
755
|
+
}
|
|
756
|
+
//# sourceMappingURL=builder-conversation.js.map
|