@superblocksteam/vite-plugin-file-sync 1.99.99-next.2 → 2.0.0-SNAPSHOT.2143e2e95d0107ab
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/middleware.d.ts +66 -0
- package/dist/ai-service/agent/middleware.d.ts.map +1 -0
- package/dist/ai-service/agent/middleware.js +423 -0
- package/dist/ai-service/agent/middleware.js.map +1 -0
- package/dist/ai-service/agent/prompts/api-prompts.d.ts +39 -0
- package/dist/ai-service/agent/prompts/api-prompts.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/api-prompts.js +806 -0
- package/dist/ai-service/agent/prompts/api-prompts.js.map +1 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts +59 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +1133 -0
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +17 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +285 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts +24 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js +104 -0
- package/dist/ai-service/agent/subagents/apis/example-selector.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts +38 -0
- package/dist/ai-service/agent/subagents/apis/examples.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/examples.js +1355 -0
- package/dist/ai-service/agent/subagents/apis/examples.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts +42 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js +103 -0
- package/dist/ai-service/agent/subagents/apis/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts +2 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js +779 -0
- package/dist/ai-service/agent/subagents/apis/static-analysis.js.map +1 -0
- package/dist/ai-service/agent/subagents/apis/types.d.ts +2 -0
- package/dist/ai-service/agent/subagents/apis/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/apis/types.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts +16 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js +30 -0
- package/dist/ai-service/agent/subagents/coding/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts +30 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js +134 -0
- package/dist/ai-service/agent/subagents/coding/run-coding-subagent.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/index.d.ts +3 -0
- package/dist/ai-service/agent/subagents/testing/index.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/index.js +2 -0
- package/dist/ai-service/agent/subagents/testing/index.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts +10 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js +177 -0
- package/dist/ai-service/agent/subagents/testing/prompt-builder.js.map +1 -0
- package/dist/ai-service/agent/subagents/testing/types.d.ts +67 -0
- package/dist/ai-service/agent/subagents/testing/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/testing/types.js +2 -0
- package/dist/ai-service/agent/subagents/testing/types.js.map +1 -0
- package/dist/ai-service/agent/subagents/types.d.ts +48 -0
- package/dist/ai-service/agent/subagents/types.d.ts.map +1 -0
- package/dist/ai-service/agent/subagents/types.js +49 -0
- package/dist/ai-service/agent/subagents/types.js.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts +26 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.js +356 -0
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts +3 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js +23 -0
- package/dist/ai-service/agent/tool-permission-delivery-metrics.js.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery.d.ts +50 -0
- package/dist/ai-service/agent/tool-permission-delivery.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-permission-delivery.js +434 -0
- package/dist/ai-service/agent/tool-permission-delivery.js.map +1 -0
- package/dist/ai-service/agent/tool-result-metrics.d.ts +29 -0
- package/dist/ai-service/agent/tool-result-metrics.d.ts.map +1 -0
- package/dist/ai-service/agent/tool-result-metrics.js +162 -0
- package/dist/ai-service/agent/tool-result-metrics.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/analysis.d.ts +30 -0
- package/dist/ai-service/agent/tools/apis/analysis.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/analysis.js +1305 -0
- package/dist/ai-service/agent/tools/apis/analysis.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +36 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js +366 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts +92 -0
- package/dist/ai-service/agent/tools/apis/api-executor.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-executor.js +480 -0
- package/dist/ai-service/agent/tools/apis/api-executor.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts +43 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.js +259 -0
- package/dist/ai-service/agent/tools/apis/api-testing-state.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +71 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +562 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts +51 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js +378 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api.d.ts +15 -0
- package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/build-api.js +82 -0
- package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +66 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.js +2242 -0
- package/dist/ai-service/agent/tools/apis/get-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.d.ts +12 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.js +76 -0
- package/dist/ai-service/agent/tools/apis/get-integration-types.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts +32 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +277 -0
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/integration-types.d.ts +59 -0
- package/dist/ai-service/agent/tools/apis/integration-types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/integration-types.js +1677 -0
- package/dist/ai-service/agent/tools/apis/integration-types.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/sample-json.d.ts +2 -0
- package/dist/ai-service/agent/tools/apis/sample-json.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/sample-json.js +16 -0
- package/dist/ai-service/agent/tools/apis/sample-json.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts +20 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.js +78 -0
- package/dist/ai-service/agent/tools/apis/sdk-registry.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts +66 -0
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/test-api.js +864 -0
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/write-api.d.ts +12 -0
- package/dist/ai-service/agent/tools/apis/write-api.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/write-api.js +47 -0
- package/dist/ai-service/agent/tools/apis/write-api.js.map +1 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts +29 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js +399 -0
- package/dist/ai-service/agent/tools/app-environment/update-app-environment.js.map +1 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts +59 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.js +483 -0
- package/dist/ai-service/agent/tools/build-capture-screenshot.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js +51 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.js +52 -0
- package/dist/ai-service/agent/tools/build-copy-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts +57 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js +37 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js.map +1 -0
- package/dist/ai-service/agent/tools/build-debug.d.ts +17 -0
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-debug.js +244 -0
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -0
- package/dist/ai-service/agent/tools/build-delete-file.d.ts +27 -0
- package/dist/ai-service/agent/tools/build-delete-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-delete-file.js +217 -0
- package/dist/ai-service/agent/tools/build-delete-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-edit-file.d.ts +23 -0
- package/dist/ai-service/agent/tools/build-edit-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-edit-file.js +509 -0
- package/dist/ai-service/agent/tools/build-edit-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts +19 -0
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-finalize.js +234 -0
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -0
- package/dist/ai-service/agent/tools/build-install-packages.d.ts +89 -0
- package/dist/ai-service/agent/tools/build-install-packages.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-install-packages.js +727 -0
- package/dist/ai-service/agent/tools/build-install-packages.js.map +1 -0
- package/dist/ai-service/agent/tools/build-list-files.d.ts +5 -0
- package/dist/ai-service/agent/tools/build-list-files.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-list-files.js +26 -0
- package/dist/ai-service/agent/tools/build-list-files.js.map +1 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts +29 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js +66 -0
- package/dist/ai-service/agent/tools/build-lookup-npm-package.js.map +1 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +89 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.js +276 -0
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts +20 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.js +209 -0
- package/dist/ai-service/agent/tools/build-multi-edit-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts +17 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js +71 -0
- package/dist/ai-service/agent/tools/build-navigate-preview.js.map +1 -0
- package/dist/ai-service/agent/tools/build-read-file.d.ts +21 -0
- package/dist/ai-service/agent/tools/build-read-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-read-file.js +148 -0
- package/dist/ai-service/agent/tools/build-read-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-reload-file.d.ts +14 -0
- package/dist/ai-service/agent/tools/build-reload-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-reload-file.js +78 -0
- package/dist/ai-service/agent/tools/build-reload-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-rename-file.d.ts +13 -0
- package/dist/ai-service/agent/tools/build-rename-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-rename-file.js +72 -0
- package/dist/ai-service/agent/tools/build-rename-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-write-file.d.ts +13 -0
- package/dist/ai-service/agent/tools/build-write-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-write-file.js +82 -0
- package/dist/ai-service/agent/tools/build-write-file.js.map +1 -0
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts +10 -0
- package/dist/ai-service/agent/tools/clear-error-cache.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/clear-error-cache.js +38 -0
- package/dist/ai-service/agent/tools/clear-error-cache.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.d.ts +58 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.js +258 -0
- package/dist/ai-service/agent/tools/databases/destructive-migration-prompt.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts +489 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js +1172 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tasks.js.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts +65 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.js +77 -0
- package/dist/ai-service/agent/tools/databases/dev-database-tools.js.map +1 -0
- package/dist/ai-service/agent/tools/debug-cache.d.ts +175 -0
- package/dist/ai-service/agent/tools/debug-cache.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/debug-cache.js +643 -0
- package/dist/ai-service/agent/tools/debug-cache.js.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts +74 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.js +357 -0
- package/dist/ai-service/agent/tools/get-logs.js.map +1 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts +13 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.js +63 -0
- package/dist/ai-service/agent/tools/get-runtime-errors.js.map +1 -0
- package/dist/ai-service/agent/tools/index.d.ts +36 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/index.js +36 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +18 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +107 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/errors.d.ts +9 -0
- package/dist/ai-service/agent/tools/integrations/errors.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/errors.js +35 -0
- package/dist/ai-service/agent/tools/integrations/errors.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +471 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js +1179 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts +6 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js +6 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts +98 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js +391 -0
- package/dist/ai-service/agent/tools/integrations/integration-setup.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts +15 -0
- package/dist/ai-service/agent/tools/integrations/internal.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/internal.js +95 -0
- package/dist/ai-service/agent/tools/integrations/internal.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts +16 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.js +31 -0
- package/dist/ai-service/agent/tools/integrations/managed-app-database.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts +15 -0
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js +94 -0
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts +9 -0
- package/dist/ai-service/agent/tools/integrations/run-code.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js +41 -0
- package/dist/ai-service/agent/tools/integrations/run-code.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts +50 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.js +570 -0
- package/dist/ai-service/agent/tools/integrations/sql-classification.js.map +1 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts +31 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.js +94 -0
- package/dist/ai-service/agent/tools/mark-api-manually-verified.js.map +1 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts +23 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js +94 -0
- package/dist/ai-service/agent/tools/migration/update-migration-write-policy.js.map +1 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts +2 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js +11 -0
- package/dist/ai-service/agent/tools/page-edit-guidance.js.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +169 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.js +53 -0
- package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
- package/dist/ai-service/agent/tools/screenshot-selector.d.ts +23 -0
- package/dist/ai-service/agent/tools/screenshot-selector.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/screenshot-selector.js +158 -0
- package/dist/ai-service/agent/tools/screenshot-selector.js.map +1 -0
- package/dist/ai-service/agent/tools/shared-helpers.d.ts +6 -0
- package/dist/ai-service/agent/tools/shared-helpers.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/shared-helpers.js +26 -0
- package/dist/ai-service/agent/tools/shared-helpers.js.map +1 -0
- package/dist/ai-service/agent/tools.d.ts +65 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -0
- package/dist/ai-service/agent/tools.js +799 -0
- package/dist/ai-service/agent/tools.js.map +1 -0
- package/dist/ai-service/agent/tools2/access-control.d.ts +150 -0
- package/dist/ai-service/agent/tools2/access-control.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/access-control.js +310 -0
- package/dist/ai-service/agent/tools2/access-control.js.map +1 -0
- package/dist/ai-service/agent/tools2/entity-permissions.d.ts +201 -0
- package/dist/ai-service/agent/tools2/entity-permissions.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/entity-permissions.js +163 -0
- package/dist/ai-service/agent/tools2/entity-permissions.js.map +1 -0
- package/dist/ai-service/agent/tools2/example.d.ts +13 -0
- package/dist/ai-service/agent/tools2/example.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/example.js +151 -0
- package/dist/ai-service/agent/tools2/example.js.map +1 -0
- package/dist/ai-service/agent/tools2/index.d.ts +18 -0
- package/dist/ai-service/agent/tools2/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/index.js +19 -0
- package/dist/ai-service/agent/tools2/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/registry.d.ts +231 -0
- package/dist/ai-service/agent/tools2/registry.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/registry.js +602 -0
- package/dist/ai-service/agent/tools2/registry.js.map +1 -0
- package/dist/ai-service/agent/tools2/test-utils.d.ts +7 -0
- package/dist/ai-service/agent/tools2/test-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/test-utils.js +10 -0
- package/dist/ai-service/agent/tools2/test-utils.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +32 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +103 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +92 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts +34 -0
- package/dist/ai-service/agent/tools2/tools/bash.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/bash.js +97 -0
- package/dist/ai-service/agent/tools2/tools/bash.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.d.ts +20 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.js +39 -0
- package/dist/ai-service/agent/tools2/tools/cancel-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/check-task.d.ts +38 -0
- package/dist/ai-service/agent/tools2/tools/check-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/check-task.js +59 -0
- package/dist/ai-service/agent/tools2/tools/check-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts +16 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js +167 -0
- package/dist/ai-service/agent/tools2/tools/deploy-service.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts +33 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +309 -0
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts +17 -0
- package/dist/ai-service/agent/tools2/tools/edit.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/edit.js +67 -0
- package/dist/ai-service/agent/tools2/tools/edit.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts +31 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.js +112 -0
- package/dist/ai-service/agent/tools2/tools/end-test-run.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +58 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +802 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.d.ts +25 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.js +394 -0
- package/dist/ai-service/agent/tools2/tools/git-raw.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git.d.ts +126 -0
- package/dist/ai-service/agent/tools2/tools/git.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/git.js +898 -0
- package/dist/ai-service/agent/tools2/tools/git.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts +14 -0
- package/dist/ai-service/agent/tools2/tools/glob.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/glob.js +71 -0
- package/dist/ai-service/agent/tools2/tools/glob.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts +22 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js +927 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata-ripgrep.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts +123 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js +534 -0
- package/dist/ai-service/agent/tools2/tools/grep-metadata.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts +26 -0
- package/dist/ai-service/agent/tools2/tools/grep.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/grep.js +249 -0
- package/dist/ai-service/agent/tools2/tools/grep.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts +24 -0
- package/dist/ai-service/agent/tools2/tools/index.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/index.js +28 -0
- package/dist/ai-service/agent/tools2/tools/index.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts +18 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +70 -0
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.d.ts +21 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.js +35 -0
- package/dist/ai-service/agent/tools2/tools/list-tasks.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ls.d.ts +17 -0
- package/dist/ai-service/agent/tools2/tools/ls.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/ls.js +141 -0
- package/dist/ai-service/agent/tools2/tools/ls.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts +12 -0
- package/dist/ai-service/agent/tools2/tools/read.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/read.js +60 -0
- package/dist/ai-service/agent/tools2/tools/read.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.d.ts +31 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.js +118 -0
- package/dist/ai-service/agent/tools2/tools/remember-knowledge.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +50 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +273 -0
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts +24 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.js +409 -0
- package/dist/ai-service/agent/tools2/tools/start-test-run.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.d.ts +2 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.js +2 -0
- package/dist/ai-service/agent/tools2/tools/tool-timeout.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts +29 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js +112 -0
- package/dist/ai-service/agent/tools2/tools/update-test-case-status.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.d.ts +48 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.js +101 -0
- package/dist/ai-service/agent/tools2/tools/wait-for-task.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.d.ts +30 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.js +285 -0
- package/dist/ai-service/agent/tools2/tools/web-fetch.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-search.d.ts +25 -0
- package/dist/ai-service/agent/tools2/tools/web-search.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/web-search.js +210 -0
- package/dist/ai-service/agent/tools2/tools/web-search.js.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts +14 -0
- package/dist/ai-service/agent/tools2/tools/write.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/tools/write.js +33 -0
- package/dist/ai-service/agent/tools2/tools/write.js.map +1 -0
- package/dist/ai-service/agent/tools2/types.d.ts +396 -0
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/types.js +204 -0
- package/dist/ai-service/agent/tools2/types.js.map +1 -0
- package/dist/ai-service/agent/tools2/utils.d.ts +9 -0
- package/dist/ai-service/agent/tools2/utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools2/utils.js +14 -0
- package/dist/ai-service/agent/tools2/utils.js.map +1 -0
- package/dist/ai-service/agent/utils.d.ts +15 -0
- package/dist/ai-service/agent/utils.d.ts.map +1 -0
- package/dist/ai-service/agent/utils.js +612 -0
- package/dist/ai-service/agent/utils.js.map +1 -0
- package/dist/ai-service/app-interface/cancellable-exec.d.ts +34 -0
- package/dist/ai-service/app-interface/cancellable-exec.d.ts.map +1 -0
- package/dist/ai-service/app-interface/cancellable-exec.js +98 -0
- package/dist/ai-service/app-interface/cancellable-exec.js.map +1 -0
- package/dist/ai-service/app-interface/constants.d.ts +60 -0
- package/dist/ai-service/app-interface/constants.d.ts.map +1 -0
- package/dist/ai-service/app-interface/constants.js +124 -0
- package/dist/ai-service/app-interface/constants.js.map +1 -0
- package/dist/ai-service/app-interface/file-system-interface.d.ts +22 -0
- package/dist/ai-service/app-interface/file-system-interface.d.ts.map +1 -0
- package/dist/ai-service/app-interface/file-system-interface.js +109 -0
- package/dist/ai-service/app-interface/file-system-interface.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +87 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.js +91 -0
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts +36 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js +250 -0
- package/dist/ai-service/app-interface/filesystem/handlers/api-handler.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts +95 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js +530 -0
- package/dist/ai-service/app-interface/filesystem/handlers/skill-handler.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/index.d.ts +12 -0
- package/dist/ai-service/app-interface/filesystem/index.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/index.js +10 -0
- package/dist/ai-service/app-interface/filesystem/index.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.d.ts +43 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.js +9 -0
- package/dist/ai-service/app-interface/filesystem/path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.d.ts +50 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.js +70 -0
- package/dist/ai-service/app-interface/filesystem/sdk-path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/validation.d.ts +88 -0
- package/dist/ai-service/app-interface/filesystem/validation.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/validation.js +197 -0
- package/dist/ai-service/app-interface/filesystem/validation.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts +144 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js +238 -0
- package/dist/ai-service/app-interface/filesystem/virtual-file-system.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts +126 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js +9 -0
- package/dist/ai-service/app-interface/filesystem/virtual-fs-types.js.map +1 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.d.ts +49 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.d.ts.map +1 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.js +67 -0
- package/dist/ai-service/app-interface/filesystem/yaml-path-validator.js.map +1 -0
- package/dist/ai-service/app-interface/linter.d.ts +11 -0
- package/dist/ai-service/app-interface/linter.d.ts.map +1 -0
- package/dist/ai-service/app-interface/linter.js +152 -0
- package/dist/ai-service/app-interface/linter.js.map +1 -0
- package/dist/ai-service/app-interface/npm-error-parser.d.ts +84 -0
- package/dist/ai-service/app-interface/npm-error-parser.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-error-parser.js +510 -0
- package/dist/ai-service/app-interface/npm-error-parser.js.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts +338 -0
- package/dist/ai-service/app-interface/npm-package-lookup.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js +1043 -0
- package/dist/ai-service/app-interface/npm-package-lookup.js.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts +913 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.js +2461 -0
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
- package/dist/ai-service/app-interface/shell.d.ts +575 -4
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +2596 -70
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/app-interface/vulnerability-gate.d.ts +83 -0
- package/dist/ai-service/app-interface/vulnerability-gate.d.ts.map +1 -0
- package/dist/ai-service/app-interface/vulnerability-gate.js +543 -0
- package/dist/ai-service/app-interface/vulnerability-gate.js.map +1 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.d.ts +3 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.d.ts.map +1 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.js +47 -0
- package/dist/ai-service/app-skills/build-knowledge-feedback-message.js.map +1 -0
- package/dist/ai-service/app-skills/helpers.d.ts +18 -0
- package/dist/ai-service/app-skills/helpers.d.ts.map +1 -0
- package/dist/ai-service/app-skills/helpers.js +441 -0
- package/dist/ai-service/app-skills/helpers.js.map +1 -0
- package/dist/ai-service/app-skills/manager.d.ts +68 -0
- package/dist/ai-service/app-skills/manager.d.ts.map +1 -0
- package/dist/ai-service/app-skills/manager.js +259 -0
- package/dist/ai-service/app-skills/manager.js.map +1 -0
- package/dist/ai-service/app-skills/parser.d.ts +53 -0
- package/dist/ai-service/app-skills/parser.d.ts.map +1 -0
- package/dist/ai-service/app-skills/parser.js +82 -0
- package/dist/ai-service/app-skills/parser.js.map +1 -0
- package/dist/ai-service/attachment-upload.d.ts +33 -0
- package/dist/ai-service/attachment-upload.d.ts.map +1 -0
- package/dist/ai-service/attachment-upload.js +98 -0
- package/dist/ai-service/attachment-upload.js.map +1 -0
- package/dist/ai-service/attachments/index.d.ts +2 -0
- package/dist/ai-service/attachments/index.d.ts.map +1 -0
- package/dist/ai-service/attachments/index.js +2 -0
- package/dist/ai-service/attachments/index.js.map +1 -0
- package/dist/ai-service/attachments/parse-data-url.d.ts +5 -0
- package/dist/ai-service/attachments/parse-data-url.d.ts.map +1 -0
- package/dist/ai-service/attachments/parse-data-url.js +14 -0
- package/dist/ai-service/attachments/parse-data-url.js.map +1 -0
- package/dist/ai-service/attachments/store.d.ts +96 -0
- package/dist/ai-service/attachments/store.d.ts.map +1 -0
- package/dist/ai-service/attachments/store.js +285 -0
- package/dist/ai-service/attachments/store.js.map +1 -0
- package/dist/ai-service/attachments/text-upload-artifacts.d.ts +37 -0
- package/dist/ai-service/attachments/text-upload-artifacts.d.ts.map +1 -0
- package/dist/ai-service/attachments/text-upload-artifacts.js +231 -0
- package/dist/ai-service/attachments/text-upload-artifacts.js.map +1 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +23 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -0
- package/dist/ai-service/attachments/uploaded-content-part.js +137 -0
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -0
- package/dist/ai-service/chat/chat-push-metrics.d.ts +13 -0
- package/dist/ai-service/chat/chat-push-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-push-metrics.js +68 -0
- package/dist/ai-service/chat/chat-push-metrics.js.map +1 -0
- package/dist/ai-service/chat/chat-session-store-metrics.d.ts +13 -0
- package/dist/ai-service/chat/chat-session-store-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-session-store-metrics.js +72 -0
- package/dist/ai-service/chat/chat-session-store-metrics.js.map +1 -0
- package/dist/ai-service/chat/chat-session-store.d.ts +170 -0
- package/dist/ai-service/chat/chat-session-store.d.ts.map +1 -0
- package/dist/ai-service/chat/chat-session-store.js +862 -0
- package/dist/ai-service/chat/chat-session-store.js.map +1 -0
- package/dist/ai-service/chat/extract-history.d.ts +3 -0
- package/dist/ai-service/chat/extract-history.d.ts.map +1 -0
- package/dist/ai-service/chat/extract-history.js +21 -0
- package/dist/ai-service/chat/extract-history.js.map +1 -0
- package/dist/ai-service/chat/transcript-budget.d.ts +106 -0
- package/dist/ai-service/chat/transcript-budget.d.ts.map +1 -0
- package/dist/ai-service/chat/transcript-budget.js +175 -0
- package/dist/ai-service/chat/transcript-budget.js.map +1 -0
- package/dist/ai-service/chat/transcript-metrics.d.ts +33 -0
- package/dist/ai-service/chat/transcript-metrics.d.ts.map +1 -0
- package/dist/ai-service/chat/transcript-metrics.js +169 -0
- package/dist/ai-service/chat/transcript-metrics.js.map +1 -0
- package/dist/ai-service/chat/utils.d.ts +16 -0
- package/dist/ai-service/chat/utils.d.ts.map +1 -0
- package/dist/ai-service/chat/utils.js +98 -0
- package/dist/ai-service/chat/utils.js.map +1 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts +11 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js +45 -0
- package/dist/ai-service/checklist/api-migration-checklist-gate.js.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts +4 -0
- package/dist/ai-service/checklist/api-migration-origins.d.ts.map +1 -0
- package/dist/ai-service/checklist/api-migration-origins.js +8 -0
- package/dist/ai-service/checklist/api-migration-origins.js.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +108 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js +511 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
- package/dist/ai-service/const.d.ts +86 -5
- package/dist/ai-service/const.d.ts.map +1 -1
- package/dist/ai-service/const.js +92 -5
- package/dist/ai-service/const.js.map +1 -1
- package/dist/ai-service/context/app-context.d.ts +78 -0
- package/dist/ai-service/context/app-context.d.ts.map +1 -0
- package/dist/ai-service/context/app-context.js +359 -0
- package/dist/ai-service/context/app-context.js.map +1 -0
- package/dist/ai-service/context-archive-paths.d.ts +11 -0
- package/dist/ai-service/context-archive-paths.d.ts.map +1 -0
- package/dist/ai-service/context-archive-paths.js +35 -0
- package/dist/ai-service/context-archive-paths.js.map +1 -0
- package/dist/ai-service/context-download.d.ts +56 -0
- package/dist/ai-service/context-download.d.ts.map +1 -0
- package/dist/ai-service/context-download.js +372 -0
- package/dist/ai-service/context-download.js.map +1 -0
- package/dist/ai-service/context-flush-scheduler.d.ts +76 -0
- package/dist/ai-service/context-flush-scheduler.d.ts.map +1 -0
- package/dist/ai-service/context-flush-scheduler.js +134 -0
- package/dist/ai-service/context-flush-scheduler.js.map +1 -0
- package/dist/ai-service/context-flush.d.ts +36 -0
- package/dist/ai-service/context-flush.d.ts.map +1 -0
- package/dist/ai-service/context-flush.js +90 -0
- package/dist/ai-service/context-flush.js.map +1 -0
- package/dist/ai-service/context-restore.d.ts +64 -0
- package/dist/ai-service/context-restore.d.ts.map +1 -0
- package/dist/ai-service/context-restore.js +136 -0
- package/dist/ai-service/context-restore.js.map +1 -0
- package/dist/ai-service/context-upload.d.ts +31 -0
- package/dist/ai-service/context-upload.d.ts.map +1 -0
- package/dist/ai-service/context-upload.js +180 -0
- package/dist/ai-service/context-upload.js.map +1 -0
- package/dist/ai-service/dev-database-client.d.ts +169 -0
- package/dist/ai-service/dev-database-client.d.ts.map +1 -0
- package/dist/ai-service/dev-database-client.js +180 -0
- package/dist/ai-service/dev-database-client.js.map +1 -0
- package/dist/ai-service/dev-database-file-sync.d.ts +41 -0
- package/dist/ai-service/dev-database-file-sync.d.ts.map +1 -0
- package/dist/ai-service/dev-database-file-sync.js +29 -0
- package/dist/ai-service/dev-database-file-sync.js.map +1 -0
- package/dist/ai-service/features.d.ts +237 -0
- package/dist/ai-service/features.d.ts.map +1 -0
- package/dist/ai-service/features.js +238 -0
- package/dist/ai-service/features.js.map +1 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts +6 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js +42 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -0
- package/dist/ai-service/helper-system-ai-attributes.d.ts +19 -0
- package/dist/ai-service/helper-system-ai-attributes.d.ts.map +1 -0
- package/dist/ai-service/helper-system-ai-attributes.js +17 -0
- package/dist/ai-service/helper-system-ai-attributes.js.map +1 -0
- package/dist/ai-service/index.d.ts +693 -12
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +5021 -79
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integration-validator.d.ts +4 -0
- package/dist/ai-service/integration-validator.d.ts.map +1 -0
- package/dist/ai-service/integration-validator.js +58 -0
- package/dist/ai-service/integration-validator.js.map +1 -0
- package/dist/ai-service/integrations/gron.d.ts +18 -0
- package/dist/ai-service/integrations/gron.d.ts.map +1 -0
- package/dist/ai-service/integrations/gron.js +321 -0
- package/dist/ai-service/integrations/gron.js.map +1 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts +12 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.d.ts.map +1 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js +18 -0
- package/dist/ai-service/integrations/mention-safe-tag-name.js.map +1 -0
- package/dist/ai-service/integrations/metadata-binaries.d.ts +28 -0
- package/dist/ai-service/integrations/metadata-binaries.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-binaries.js +48 -0
- package/dist/ai-service/integrations/metadata-binaries.js.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/index.d.ts +35 -0
- package/dist/ai-service/integrations/metadata-storage/index.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/index.js +2 -0
- package/dist/ai-service/integrations/metadata-storage/index.js.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/local.d.ts +56 -0
- package/dist/ai-service/integrations/metadata-storage/local.d.ts.map +1 -0
- package/dist/ai-service/integrations/metadata-storage/local.js +346 -0
- package/dist/ai-service/integrations/metadata-storage/local.js.map +1 -0
- package/dist/ai-service/integrations/ripgrep-path.d.ts +6 -0
- package/dist/ai-service/integrations/ripgrep-path.d.ts.map +1 -0
- package/dist/ai-service/integrations/ripgrep-path.js +56 -0
- package/dist/ai-service/integrations/ripgrep-path.js.map +1 -0
- package/dist/ai-service/integrations/store.d.ts +142 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -0
- package/dist/ai-service/integrations/store.js +574 -0
- package/dist/ai-service/integrations/store.js.map +1 -0
- package/dist/ai-service/judge/debug-browser.d.ts +8 -0
- package/dist/ai-service/judge/debug-browser.d.ts.map +1 -0
- package/dist/ai-service/judge/debug-browser.js +79 -0
- package/dist/ai-service/judge/debug-browser.js.map +1 -0
- package/dist/ai-service/judge/index.d.ts +12 -0
- package/dist/ai-service/judge/index.d.ts.map +1 -0
- package/dist/ai-service/judge/index.js +11 -0
- package/dist/ai-service/judge/index.js.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts +143 -0
- package/dist/ai-service/judge/integration/playwright-bridge.d.ts.map +1 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js +209 -0
- package/dist/ai-service/judge/integration/playwright-bridge.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts +3 -0
- package/dist/ai-service/judge/judge-eval-http.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-http.js +541 -0
- package/dist/ai-service/judge/judge-eval-http.js.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts +35 -0
- package/dist/ai-service/judge/judge-eval-service-runner.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js +129 -0
- package/dist/ai-service/judge/judge-eval-service-runner.js.map +1 -0
- package/dist/ai-service/judge/judge-executor.d.ts +65 -0
- package/dist/ai-service/judge/judge-executor.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-executor.js +335 -0
- package/dist/ai-service/judge/judge-executor.js.map +1 -0
- package/dist/ai-service/judge/judge-service.d.ts +154 -0
- package/dist/ai-service/judge/judge-service.d.ts.map +1 -0
- package/dist/ai-service/judge/judge-service.js +220 -0
- package/dist/ai-service/judge/judge-service.js.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts +37 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js +283 -0
- package/dist/ai-service/judge/prompts/evaluation-criteria.js.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts +30 -0
- package/dist/ai-service/judge/prompts/system-prompt.d.ts.map +1 -0
- package/dist/ai-service/judge/prompts/system-prompt.js +212 -0
- package/dist/ai-service/judge/prompts/system-prompt.js.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts +99 -0
- package/dist/ai-service/judge/storage/csv-storage.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/csv-storage.js +274 -0
- package/dist/ai-service/judge/storage/csv-storage.js.map +1 -0
- package/dist/ai-service/judge/storage/index.d.ts +9 -0
- package/dist/ai-service/judge/storage/index.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/index.js +7 -0
- package/dist/ai-service/judge/storage/index.js.map +1 -0
- package/dist/ai-service/judge/storage/interface.d.ts +51 -0
- package/dist/ai-service/judge/storage/interface.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/interface.js +8 -0
- package/dist/ai-service/judge/storage/interface.js.map +1 -0
- package/dist/ai-service/judge/storage/types.d.ts +54 -0
- package/dist/ai-service/judge/storage/types.d.ts.map +1 -0
- package/dist/ai-service/judge/storage/types.js +7 -0
- package/dist/ai-service/judge/storage/types.js.map +1 -0
- package/dist/ai-service/judge/tools/index.d.ts +20 -0
- package/dist/ai-service/judge/tools/index.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/index.js +27 -0
- package/dist/ai-service/judge/tools/index.js.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts +72 -0
- package/dist/ai-service/judge/tools/playwright-action.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/playwright-action.js +171 -0
- package/dist/ai-service/judge/tools/playwright-action.js.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +34 -0
- package/dist/ai-service/judge/tools/submit-feedback.d.ts.map +1 -0
- package/dist/ai-service/judge/tools/submit-feedback.js +137 -0
- package/dist/ai-service/judge/tools/submit-feedback.js.map +1 -0
- package/dist/ai-service/judge/types.d.ts +169 -0
- package/dist/ai-service/judge/types.d.ts.map +1 -0
- package/dist/ai-service/judge/types.js +8 -0
- package/dist/ai-service/judge/types.js.map +1 -0
- package/dist/ai-service/knowledge/helpers.d.ts +17 -0
- package/dist/ai-service/knowledge/helpers.d.ts.map +1 -0
- package/dist/ai-service/knowledge/helpers.js +154 -0
- package/dist/ai-service/knowledge/helpers.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-manager.d.ts +85 -0
- package/dist/ai-service/knowledge/knowledge-manager.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-manager.js +299 -0
- package/dist/ai-service/knowledge/knowledge-manager.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.d.ts +20 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.js +77 -0
- package/dist/ai-service/knowledge/knowledge-metrics-emitters.js.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics.d.ts +44 -0
- package/dist/ai-service/knowledge/knowledge-metrics.d.ts.map +1 -0
- package/dist/ai-service/knowledge/knowledge-metrics.js +217 -0
- package/dist/ai-service/knowledge/knowledge-metrics.js.map +1 -0
- package/dist/ai-service/live-edit-events/bridge.d.ts +21 -0
- package/dist/ai-service/live-edit-events/bridge.d.ts.map +1 -0
- package/dist/ai-service/live-edit-events/bridge.js +52 -0
- package/dist/ai-service/live-edit-events/bridge.js.map +1 -0
- package/dist/ai-service/live-edit-events/forwarder.d.ts +158 -0
- package/dist/ai-service/live-edit-events/forwarder.d.ts.map +1 -0
- package/dist/ai-service/live-edit-events/forwarder.js +403 -0
- package/dist/ai-service/live-edit-events/forwarder.js.map +1 -0
- package/dist/ai-service/llm/chaos-fetch.d.ts +90 -0
- package/dist/ai-service/llm/chaos-fetch.d.ts.map +1 -0
- package/dist/ai-service/llm/chaos-fetch.js +200 -0
- package/dist/ai-service/llm/chaos-fetch.js.map +1 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.d.ts +4 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.d.ts.map +1 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.js +152 -0
- package/dist/ai-service/llm/clark-stream-telemetry-sink.js.map +1 -0
- package/dist/ai-service/llm/client.d.ts +315 -0
- package/dist/ai-service/llm/client.d.ts.map +1 -0
- package/dist/ai-service/llm/client.js +992 -0
- package/dist/ai-service/llm/client.js.map +1 -0
- package/dist/ai-service/llm/context-v2/adapter.d.ts +33 -0
- package/dist/ai-service/llm/context-v2/adapter.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/adapter.js +103 -0
- package/dist/ai-service/llm/context-v2/adapter.js.map +1 -0
- package/dist/ai-service/llm/context-v2/caching.d.ts +40 -0
- package/dist/ai-service/llm/context-v2/caching.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/caching.js +48 -0
- package/dist/ai-service/llm/context-v2/caching.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts +100 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js +298 -0
- package/dist/ai-service/llm/context-v2/compaction/client-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts +73 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js +9 -0
- package/dist/ai-service/llm/context-v2/compaction/compaction-strategy.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts +33 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js +137 -0
- package/dist/ai-service/llm/context-v2/compaction/server-side.js.map +1 -0
- package/dist/ai-service/llm/context-v2/compactor.d.ts +34 -0
- package/dist/ai-service/llm/context-v2/compactor.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/compactor.js +243 -0
- package/dist/ai-service/llm/context-v2/compactor.js.map +1 -0
- package/dist/ai-service/llm/context-v2/config.d.ts +27 -0
- package/dist/ai-service/llm/context-v2/config.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/config.js +59 -0
- package/dist/ai-service/llm/context-v2/config.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts +215 -0
- package/dist/ai-service/llm/context-v2/context-management.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context-management.js +207 -0
- package/dist/ai-service/llm/context-v2/context-management.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts +150 -0
- package/dist/ai-service/llm/context-v2/context-metrics.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context-metrics.js +602 -0
- package/dist/ai-service/llm/context-v2/context-metrics.js.map +1 -0
- package/dist/ai-service/llm/context-v2/context.d.ts +391 -0
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/context.js +1666 -0
- package/dist/ai-service/llm/context-v2/context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts +150 -0
- package/dist/ai-service/llm/context-v2/conversation-context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/conversation-context.js +10 -0
- package/dist/ai-service/llm/context-v2/conversation-context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/index.d.ts +13 -0
- package/dist/ai-service/llm/context-v2/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/index.js +13 -0
- package/dist/ai-service/llm/context-v2/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/manager.d.ts +188 -0
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/manager.js +629 -0
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/index.d.ts +7 -0
- package/dist/ai-service/llm/context-v2/migrations/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/index.js +7 -0
- package/dist/ai-service/llm/context-v2/migrations/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.d.ts +19 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.js +32 -0
- package/dist/ai-service/llm/context-v2/migrations/registry.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.d.ts +3 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.js +61 -0
- package/dist/ai-service/llm/context-v2/migrations/runner.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/types.d.ts +16 -0
- package/dist/ai-service/llm/context-v2/migrations/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/types.js +26 -0
- package/dist/ai-service/llm/context-v2/migrations/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts +25 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js +75 -0
- package/dist/ai-service/llm/context-v2/migrations/v1-to-v2.js.map +1 -0
- package/dist/ai-service/llm/context-v2/operation-queue.d.ts +9 -0
- package/dist/ai-service/llm/context-v2/operation-queue.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/operation-queue.js +13 -0
- package/dist/ai-service/llm/context-v2/operation-queue.js.map +1 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts +20 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js +360 -0
- package/dist/ai-service/llm/context-v2/phase1-tool-summarizer.js.map +1 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.d.ts +68 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js +377 -0
- package/dist/ai-service/llm/context-v2/phase2-session-summarizer.js.map +1 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +11 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.js +63 -0
- package/dist/ai-service/llm/context-v2/prompts/compaction.js.map +1 -0
- package/dist/ai-service/llm/context-v2/session-capture.d.ts +18 -0
- package/dist/ai-service/llm/context-v2/session-capture.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/session-capture.js +64 -0
- package/dist/ai-service/llm/context-v2/session-capture.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts +83 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js +10 -0
- package/dist/ai-service/llm/context-v2/storage/event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts +59 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js +16 -0
- package/dist/ai-service/llm/context-v2/storage/event-types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/index.d.ts +14 -0
- package/dist/ai-service/llm/context-v2/storage/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/index.js +2 -0
- package/dist/ai-service/llm/context-v2/storage/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts +108 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js +267 -0
- package/dist/ai-service/llm/context-v2/storage/jsonl-event-store.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.d.ts +46 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.js +240 -0
- package/dist/ai-service/llm/context-v2/storage/legacy-context-adoption.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/local.d.ts +25 -0
- package/dist/ai-service/llm/context-v2/storage/local.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/local.js +124 -0
- package/dist/ai-service/llm/context-v2/storage/local.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts +49 -0
- package/dist/ai-service/llm/context-v2/storage/migration.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js +126 -0
- package/dist/ai-service/llm/context-v2/storage/migration.js.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/types.d.ts +2 -0
- package/dist/ai-service/llm/context-v2/storage/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/storage/types.js +2 -0
- package/dist/ai-service/llm/context-v2/storage/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts +88 -0
- package/dist/ai-service/llm/context-v2/token-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/token-tracker.js +193 -0
- package/dist/ai-service/llm/context-v2/token-tracker.js.map +1 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts +10 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.js +124 -0
- package/dist/ai-service/llm/context-v2/truncation-fallback.js.map +1 -0
- package/dist/ai-service/llm/context-v2/turns.d.ts +24 -0
- package/dist/ai-service/llm/context-v2/turns.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/turns.js +85 -0
- package/dist/ai-service/llm/context-v2/turns.js.map +1 -0
- package/dist/ai-service/llm/context-v2/types-v1.d.ts +36 -0
- package/dist/ai-service/llm/context-v2/types-v1.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/types-v1.js +3 -0
- package/dist/ai-service/llm/context-v2/types-v1.js.map +1 -0
- package/dist/ai-service/llm/context-v2/types.d.ts +238 -0
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/types.js +609 -0
- package/dist/ai-service/llm/context-v2/types.js.map +1 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts +15 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js +194 -0
- package/dist/ai-service/llm/context-v2/uniquify-filenames.js.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts +9 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.js +6 -0
- package/dist/ai-service/llm/context-v2/utils/get-loaded-context.js.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/index.d.ts +2 -0
- package/dist/ai-service/llm/context-v2/utils/index.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/utils/index.js +2 -0
- package/dist/ai-service/llm/context-v2/utils/index.js.map +1 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts +24 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.d.ts.map +1 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js +73 -0
- package/dist/ai-service/llm/context-v2/well-formed-text.js.map +1 -0
- package/dist/ai-service/llm/error.d.ts +153 -0
- package/dist/ai-service/llm/error.d.ts.map +1 -0
- package/dist/ai-service/llm/error.js +539 -0
- package/dist/ai-service/llm/error.js.map +1 -0
- package/dist/ai-service/llm/impl/clark.d.ts +11 -0
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -0
- package/dist/ai-service/llm/impl/clark.js +22 -0
- package/dist/ai-service/llm/impl/clark.js.map +1 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts +67 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.js +190 -0
- package/dist/ai-service/llm/interaction/adapters/vercel.js.map +1 -0
- package/dist/ai-service/llm/interaction/index.d.ts +4 -0
- package/dist/ai-service/llm/interaction/index.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/index.js +5 -0
- package/dist/ai-service/llm/interaction/index.js.map +1 -0
- package/dist/ai-service/llm/interaction/provider.d.ts +189 -0
- package/dist/ai-service/llm/interaction/provider.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/provider.js +15 -0
- package/dist/ai-service/llm/interaction/provider.js.map +1 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.d.ts +48 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.d.ts.map +1 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.js +147 -0
- package/dist/ai-service/llm/interaction/stream-lifecycle.js.map +1 -0
- package/dist/ai-service/llm/provider.d.ts +10 -0
- package/dist/ai-service/llm/provider.d.ts.map +1 -0
- package/dist/ai-service/llm/provider.js +370 -0
- package/dist/ai-service/llm/provider.js.map +1 -0
- package/dist/ai-service/llm/stream/compaction-text-block.d.ts +15 -0
- package/dist/ai-service/llm/stream/compaction-text-block.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/compaction-text-block.js +29 -0
- package/dist/ai-service/llm/stream/compaction-text-block.js.map +1 -0
- package/dist/ai-service/llm/stream/config.d.ts +151 -0
- package/dist/ai-service/llm/stream/config.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/config.js +108 -0
- package/dist/ai-service/llm/stream/config.js.map +1 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts +48 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js +123 -0
- package/dist/ai-service/llm/stream/empty-tool-call-tracker.js.map +1 -0
- package/dist/ai-service/llm/stream/errors.d.ts +62 -0
- package/dist/ai-service/llm/stream/errors.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/errors.js +139 -0
- package/dist/ai-service/llm/stream/errors.js.map +1 -0
- package/dist/ai-service/llm/stream/event-bus.d.ts +75 -0
- package/dist/ai-service/llm/stream/event-bus.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/event-bus.js +51 -0
- package/dist/ai-service/llm/stream/event-bus.js.map +1 -0
- package/dist/ai-service/llm/stream/idle-monitor.d.ts +167 -0
- package/dist/ai-service/llm/stream/idle-monitor.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/idle-monitor.js +423 -0
- package/dist/ai-service/llm/stream/idle-monitor.js.map +1 -0
- package/dist/ai-service/llm/stream/index.d.ts +51 -0
- package/dist/ai-service/llm/stream/index.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/index.js +48 -0
- package/dist/ai-service/llm/stream/index.js.map +1 -0
- package/dist/ai-service/llm/stream/managed-stream.d.ts +32 -0
- package/dist/ai-service/llm/stream/managed-stream.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/managed-stream.js +219 -0
- package/dist/ai-service/llm/stream/managed-stream.js.map +1 -0
- package/dist/ai-service/llm/stream/observer.d.ts +34 -0
- package/dist/ai-service/llm/stream/observer.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observer.js +2 -0
- package/dist/ai-service/llm/stream/observer.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/context.d.ts +63 -0
- package/dist/ai-service/llm/stream/observers/context.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/context.js +235 -0
- package/dist/ai-service/llm/stream/observers/context.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/index.d.ts +8 -0
- package/dist/ai-service/llm/stream/observers/index.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/index.js +8 -0
- package/dist/ai-service/llm/stream/observers/index.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts +94 -0
- package/dist/ai-service/llm/stream/observers/llmobs.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/llmobs.js +796 -0
- package/dist/ai-service/llm/stream/observers/llmobs.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/logging.d.ts +74 -0
- package/dist/ai-service/llm/stream/observers/logging.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/logging.js +509 -0
- package/dist/ai-service/llm/stream/observers/logging.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts +21 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.js +71 -0
- package/dist/ai-service/llm/stream/observers/retry-notification.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts +15 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.js +88 -0
- package/dist/ai-service/llm/stream/observers/step-token-usage.js.map +1 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts +19 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.js +112 -0
- package/dist/ai-service/llm/stream/observers/workflow-usage.js.map +1 -0
- package/dist/ai-service/llm/stream/orchestrator.d.ts +133 -0
- package/dist/ai-service/llm/stream/orchestrator.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/orchestrator.js +1297 -0
- package/dist/ai-service/llm/stream/orchestrator.js.map +1 -0
- package/dist/ai-service/llm/stream/retry-engine.d.ts +89 -0
- package/dist/ai-service/llm/stream/retry-engine.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/retry-engine.js +367 -0
- package/dist/ai-service/llm/stream/retry-engine.js.map +1 -0
- package/dist/ai-service/llm/stream/session.d.ts +94 -0
- package/dist/ai-service/llm/stream/session.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/session.js +173 -0
- package/dist/ai-service/llm/stream/session.js.map +1 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.d.ts +16 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.js +26 -0
- package/dist/ai-service/llm/stream/structured-output-chunk.js.map +1 -0
- package/dist/ai-service/llm/stream/terminal-reason.d.ts +6 -0
- package/dist/ai-service/llm/stream/terminal-reason.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/terminal-reason.js +83 -0
- package/dist/ai-service/llm/stream/terminal-reason.js.map +1 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts +98 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js +521 -0
- package/dist/ai-service/llm/stream/tests/helpers/mock-provider.js.map +1 -0
- package/dist/ai-service/llm/stream/types.d.ts +16 -0
- package/dist/ai-service/llm/stream/types.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/types.js +2 -0
- package/dist/ai-service/llm/stream/types.js.map +1 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts +55 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.d.ts.map +1 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.js +109 -0
- package/dist/ai-service/llm/stream/wait-state-tracker.js.map +1 -0
- package/dist/ai-service/llm/tool-context-integrity.d.ts +25 -0
- package/dist/ai-service/llm/tool-context-integrity.d.ts.map +1 -0
- package/dist/ai-service/llm/tool-context-integrity.js +141 -0
- package/dist/ai-service/llm/tool-context-integrity.js.map +1 -0
- package/dist/ai-service/llm/types.d.ts +44 -0
- package/dist/ai-service/llm/types.d.ts.map +1 -0
- package/dist/ai-service/llm/types.js +2 -0
- package/dist/ai-service/llm/types.js.map +1 -0
- package/dist/ai-service/llm/workflow-metrics.d.ts +14 -0
- package/dist/ai-service/llm/workflow-metrics.d.ts.map +1 -0
- package/dist/ai-service/llm/workflow-metrics.js +19 -0
- package/dist/ai-service/llm/workflow-metrics.js.map +1 -0
- package/dist/ai-service/llmobs/constants.d.ts +5 -0
- package/dist/ai-service/llmobs/constants.d.ts.map +1 -0
- package/dist/ai-service/llmobs/constants.js +5 -0
- package/dist/ai-service/llmobs/constants.js.map +1 -0
- package/dist/ai-service/llmobs/context-registry.d.ts +62 -0
- package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -0
- package/dist/ai-service/llmobs/context-registry.js +115 -0
- package/dist/ai-service/llmobs/context-registry.js.map +1 -0
- package/dist/ai-service/llmobs/helpers.d.ts +5 -0
- package/dist/ai-service/llmobs/helpers.d.ts.map +1 -0
- package/dist/ai-service/llmobs/helpers.js +31 -0
- package/dist/ai-service/llmobs/helpers.js.map +1 -0
- package/dist/ai-service/llmobs/index.d.ts +8 -0
- package/dist/ai-service/llmobs/index.d.ts.map +1 -0
- package/dist/ai-service/llmobs/index.js +7 -0
- package/dist/ai-service/llmobs/index.js.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts +178 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.js +660 -0
- package/dist/ai-service/llmobs/otel-exporter.js.map +1 -0
- package/dist/ai-service/llmobs/tracer.d.ts +130 -0
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -0
- package/dist/ai-service/llmobs/tracer.js +532 -0
- package/dist/ai-service/llmobs/tracer.js.map +1 -0
- package/dist/ai-service/llmobs/types.d.ts +71 -0
- package/dist/ai-service/llmobs/types.d.ts.map +1 -0
- package/dist/ai-service/llmobs/types.js +2 -0
- package/dist/ai-service/llmobs/types.js.map +1 -0
- package/dist/ai-service/llmobs/utils.d.ts +15 -0
- package/dist/ai-service/llmobs/utils.d.ts.map +1 -0
- package/dist/ai-service/llmobs/utils.js +82 -0
- package/dist/ai-service/llmobs/utils.js.map +1 -0
- package/dist/ai-service/managed-native-db-availability.d.ts +62 -0
- package/dist/ai-service/managed-native-db-availability.d.ts.map +1 -0
- package/dist/ai-service/managed-native-db-availability.js +37 -0
- package/dist/ai-service/managed-native-db-availability.js.map +1 -0
- package/dist/ai-service/mcp/adapter/index.d.ts +8 -0
- package/dist/ai-service/mcp/adapter/index.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/index.js +10 -0
- package/dist/ai-service/mcp/adapter/index.js.map +1 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.d.ts +44 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.js +231 -0
- package/dist/ai-service/mcp/adapter/json-schema-to-zod.js.map +1 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts +126 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.d.ts.map +1 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js +365 -0
- package/dist/ai-service/mcp/adapter/mcp-tool-adapter.js.map +1 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts +85 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js +1626 -0
- package/dist/ai-service/mcp/embedded-playwright-mcp-server.js.map +1 -0
- package/dist/ai-service/mcp/index.d.ts +11 -0
- package/dist/ai-service/mcp/index.d.ts.map +1 -0
- package/dist/ai-service/mcp/index.js +11 -0
- package/dist/ai-service/mcp/index.js.map +1 -0
- package/dist/ai-service/mcp/playwright-server.d.ts +153 -0
- package/dist/ai-service/mcp/playwright-server.d.ts.map +1 -0
- package/dist/ai-service/mcp/playwright-server.js +174 -0
- package/dist/ai-service/mcp/playwright-server.js.map +1 -0
- package/dist/ai-service/mcp/types.d.ts +101 -0
- package/dist/ai-service/mcp/types.d.ts.map +1 -0
- package/dist/ai-service/mcp/types.js +7 -0
- package/dist/ai-service/mcp/types.js.map +1 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.d.ts +19 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.d.ts.map +1 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.js +17 -0
- package/dist/ai-service/migration-auto-dispatch-readiness.js.map +1 -0
- package/dist/ai-service/migration-autodispatch-metrics.d.ts +3 -0
- package/dist/ai-service/migration-autodispatch-metrics.d.ts.map +1 -0
- package/dist/ai-service/migration-autodispatch-metrics.js +52 -0
- package/dist/ai-service/migration-autodispatch-metrics.js.map +1 -0
- package/dist/ai-service/migration-llm-config.d.ts +12 -0
- package/dist/ai-service/migration-llm-config.d.ts.map +1 -0
- package/dist/ai-service/migration-llm-config.js +132 -0
- package/dist/ai-service/migration-llm-config.js.map +1 -0
- package/dist/ai-service/migration-prompt-gating.d.ts +21 -0
- package/dist/ai-service/migration-prompt-gating.d.ts.map +1 -0
- package/dist/ai-service/migration-prompt-gating.js +27 -0
- package/dist/ai-service/migration-prompt-gating.js.map +1 -0
- package/dist/ai-service/migration-session-active.d.ts +14 -0
- package/dist/ai-service/migration-session-active.d.ts.map +1 -0
- package/dist/ai-service/migration-session-active.js +29 -0
- package/dist/ai-service/migration-session-active.js.map +1 -0
- package/dist/ai-service/migration-turns-log.d.ts +36 -0
- package/dist/ai-service/migration-turns-log.d.ts.map +1 -0
- package/dist/ai-service/migration-turns-log.js +88 -0
- package/dist/ai-service/migration-turns-log.js.map +1 -0
- package/dist/ai-service/policy-agent-metrics.d.ts +29 -0
- package/dist/ai-service/policy-agent-metrics.d.ts.map +1 -0
- package/dist/ai-service/policy-agent-metrics.js +141 -0
- package/dist/ai-service/policy-agent-metrics.js.map +1 -0
- package/dist/ai-service/policy-gate-error.d.ts +3 -0
- package/dist/ai-service/policy-gate-error.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-error.js +33 -0
- package/dist/ai-service/policy-gate-error.js.map +1 -0
- package/dist/ai-service/policy-gate-step.d.ts +17 -0
- package/dist/ai-service/policy-gate-step.d.ts.map +1 -0
- package/dist/ai-service/policy-gate-step.js +52 -0
- package/dist/ai-service/policy-gate-step.js.map +1 -0
- package/dist/ai-service/profiler/clark-profiler.d.ts +86 -0
- package/dist/ai-service/profiler/clark-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/clark-profiler.js +209 -0
- package/dist/ai-service/profiler/clark-profiler.js.map +1 -0
- package/dist/ai-service/profiler/index.d.ts +4 -0
- package/dist/ai-service/profiler/index.d.ts.map +1 -0
- package/dist/ai-service/profiler/index.js +4 -0
- package/dist/ai-service/profiler/index.js.map +1 -0
- package/dist/ai-service/profiler/perfetto-profiler.d.ts +116 -0
- package/dist/ai-service/profiler/perfetto-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/perfetto-profiler.js +240 -0
- package/dist/ai-service/profiler/perfetto-profiler.js.map +1 -0
- package/dist/ai-service/profiler/tool-profiler.d.ts +33 -0
- package/dist/ai-service/profiler/tool-profiler.d.ts.map +1 -0
- package/dist/ai-service/profiler/tool-profiler.js +157 -0
- package/dist/ai-service/profiler/tool-profiler.js.map +1 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts +27 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.d.ts.map +1 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js +97 -0
- package/dist/ai-service/prompt-builder-service/classifiers/prompt-interpret-task.js.map +1 -0
- package/dist/ai-service/prompt-builder-service/types.d.ts +3 -0
- package/dist/ai-service/prompt-builder-service/types.d.ts.map +1 -0
- package/dist/ai-service/prompt-builder-service/types.js +6 -0
- package/dist/ai-service/prompt-builder-service/types.js.map +1 -0
- package/dist/ai-service/prompts/summarize-api-usage.d.ts +18 -0
- package/dist/ai-service/prompts/summarize-api-usage.d.ts.map +1 -0
- package/dist/ai-service/prompts/summarize-api-usage.js +30 -0
- package/dist/ai-service/prompts/summarize-api-usage.js.map +1 -0
- package/dist/ai-service/quota-client.d.ts +31 -0
- package/dist/ai-service/quota-client.d.ts.map +1 -0
- package/dist/ai-service/quota-client.js +72 -0
- package/dist/ai-service/quota-client.js.map +1 -0
- package/dist/ai-service/recording/block-traversal.d.ts +15 -0
- package/dist/ai-service/recording/block-traversal.d.ts.map +1 -0
- package/dist/ai-service/recording/block-traversal.js +104 -0
- package/dist/ai-service/recording/block-traversal.js.map +1 -0
- package/dist/ai-service/recording/index.d.ts +26 -0
- package/dist/ai-service/recording/index.d.ts.map +1 -0
- package/dist/ai-service/recording/index.js +29 -0
- package/dist/ai-service/recording/index.js.map +1 -0
- package/dist/ai-service/recording/recorders/llm-recorder.d.ts +35 -0
- package/dist/ai-service/recording/recorders/llm-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/llm-recorder.js +221 -0
- package/dist/ai-service/recording/recorders/llm-recorder.js.map +1 -0
- package/dist/ai-service/recording/recorders/socket-recorder.d.ts +38 -0
- package/dist/ai-service/recording/recorders/socket-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/socket-recorder.js +44 -0
- package/dist/ai-service/recording/recorders/socket-recorder.js.map +1 -0
- package/dist/ai-service/recording/recorders/tool-recorder.d.ts +25 -0
- package/dist/ai-service/recording/recorders/tool-recorder.d.ts.map +1 -0
- package/dist/ai-service/recording/recorders/tool-recorder.js +58 -0
- package/dist/ai-service/recording/recorders/tool-recorder.js.map +1 -0
- package/dist/ai-service/recording/recording-manager.d.ts +105 -0
- package/dist/ai-service/recording/recording-manager.d.ts.map +1 -0
- package/dist/ai-service/recording/recording-manager.js +308 -0
- package/dist/ai-service/recording/recording-manager.js.map +1 -0
- package/dist/ai-service/recording/snapshot-manager.d.ts +195 -0
- package/dist/ai-service/recording/snapshot-manager.d.ts.map +1 -0
- package/dist/ai-service/recording/snapshot-manager.js +708 -0
- package/dist/ai-service/recording/snapshot-manager.js.map +1 -0
- package/dist/ai-service/recording/storage/session-recording-storage.d.ts +148 -0
- package/dist/ai-service/recording/storage/session-recording-storage.d.ts.map +1 -0
- package/dist/ai-service/recording/storage/session-recording-storage.js +399 -0
- package/dist/ai-service/recording/storage/session-recording-storage.js.map +1 -0
- package/dist/ai-service/recording/types.d.ts +140 -0
- package/dist/ai-service/recording/types.d.ts.map +1 -0
- package/dist/ai-service/recording/types.js +8 -0
- package/dist/ai-service/recording/types.js.map +1 -0
- package/dist/ai-service/request-deduplicator.d.ts +35 -0
- package/dist/ai-service/request-deduplicator.d.ts.map +1 -0
- package/dist/ai-service/request-deduplicator.js +53 -0
- package/dist/ai-service/request-deduplicator.js.map +1 -0
- package/dist/ai-service/resolve-generation-state-for-ui.d.ts +9 -0
- package/dist/ai-service/resolve-generation-state-for-ui.d.ts.map +1 -0
- package/dist/ai-service/resolve-generation-state-for-ui.js +25 -0
- package/dist/ai-service/resolve-generation-state-for-ui.js.map +1 -0
- package/dist/ai-service/sdk-api-templates.d.ts +2 -0
- package/dist/ai-service/sdk-api-templates.d.ts.map +1 -0
- package/dist/ai-service/sdk-api-templates.js +2 -0
- package/dist/ai-service/sdk-api-templates.js.map +1 -0
- package/dist/ai-service/security/index.d.ts +9 -0
- package/dist/ai-service/security/index.d.ts.map +1 -0
- package/dist/ai-service/security/index.js +9 -0
- package/dist/ai-service/security/index.js.map +1 -0
- package/dist/ai-service/security/safety-classifier.d.ts +83 -0
- package/dist/ai-service/security/safety-classifier.d.ts.map +1 -0
- package/dist/ai-service/security/safety-classifier.js +189 -0
- package/dist/ai-service/security/safety-classifier.js.map +1 -0
- package/dist/ai-service/security/secret-scanner-service.d.ts +43 -0
- package/dist/ai-service/security/secret-scanner-service.d.ts.map +1 -0
- package/dist/ai-service/security/secret-scanner-service.js +422 -0
- package/dist/ai-service/security/secret-scanner-service.js.map +1 -0
- package/dist/ai-service/security/secret-scanner.d.ts +161 -0
- package/dist/ai-service/security/secret-scanner.d.ts.map +1 -0
- package/dist/ai-service/security/secret-scanner.js +459 -0
- package/dist/ai-service/security/secret-scanner.js.map +1 -0
- package/dist/ai-service/security/vulnerability-triage.d.ts +90 -0
- package/dist/ai-service/security/vulnerability-triage.d.ts.map +1 -0
- package/dist/ai-service/security/vulnerability-triage.js +113 -0
- package/dist/ai-service/security/vulnerability-triage.js.map +1 -0
- package/dist/ai-service/skills/index.d.ts +38 -0
- package/dist/ai-service/skills/index.d.ts.map +1 -0
- package/dist/ai-service/skills/index.js +104 -0
- package/dist/ai-service/skills/index.js.map +1 -0
- package/dist/ai-service/skills/system/_registry.generated.d.ts +6 -0
- package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/_registry.generated.js +43 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.js +93 -0
- package/dist/ai-service/skills/system/common-import-issues/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/materialized.d.ts +7 -0
- package/dist/ai-service/skills/system/materialized.d.ts.map +1 -0
- package/dist/ai-service/skills/system/materialized.js +33 -0
- package/dist/ai-service/skills/system/materialized.js.map +1 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js +119 -0
- package/dist/ai-service/skills/system/migration-api-verification/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.js +274 -0
- package/dist/ai-service/skills/system/superblocks-api/references/code-blocks.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.js +214 -0
- package/dist/ai-service/skills/system/superblocks-api/references/graphql.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.js +276 -0
- package/dist/ai-service/skills/system/superblocks-api/references/rest-apis.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js +412 -0
- package/dist/ai-service/skills/system/superblocks-api/references/sql-databases.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.js +891 -0
- package/dist/ai-service/skills/system/superblocks-api/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.js +155 -0
- package/dist/ai-service/skills/system/superblocks-frontend/references/embedding.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +756 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +60 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +136 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +312 -0
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +124 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.js +79 -0
- package/dist/ai-service/skills/system/third-party-migration/lovable.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.js +65 -0
- package/dist/ai-service/skills/system/third-party-migration/replit.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +171 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.js +118 -0
- package/dist/ai-service/skills/system/third-party-migration/v0.generated.js.map +1 -0
- package/dist/ai-service/skills/system/tool-paths.d.ts +3 -0
- package/dist/ai-service/skills/system/tool-paths.d.ts.map +1 -0
- package/dist/ai-service/skills/system/tool-paths.js +16 -0
- package/dist/ai-service/skills/system/tool-paths.js.map +1 -0
- package/dist/ai-service/skills/types.d.ts +69 -0
- package/dist/ai-service/skills/types.d.ts.map +1 -0
- package/dist/ai-service/skills/types.js +121 -0
- package/dist/ai-service/skills/types.js.map +1 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts +570 -22
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js +408 -0
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/fsm.d.ts +17 -16
- package/dist/ai-service/state-machine/fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/fsm.js +2 -1
- package/dist/ai-service/state-machine/fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts +12 -0
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +1088 -168
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/awaiting-user.js +335 -13
- package/dist/ai-service/state-machine/handlers/awaiting-user.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.d.ts +11 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.js +11 -0
- package/dist/ai-service/state-machine/handlers/flush-pending-chat-pushes.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/idle.d.ts +2 -2
- package/dist/ai-service/state-machine/handlers/idle.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/idle.js +138 -8
- package/dist/ai-service/state-machine/handlers/idle.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +37 -2
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +1225 -136
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/next-steps.d.ts +22 -0
- package/dist/ai-service/state-machine/handlers/next-steps.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/next-steps.js +85 -0
- package/dist/ai-service/state-machine/handlers/next-steps.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.d.ts +25 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.d.ts.map +1 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.js +68 -0
- package/dist/ai-service/state-machine/handlers/persist-prompt-attachments.js.map +1 -0
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts +2 -2
- package/dist/ai-service/state-machine/handlers/play-dead.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/play-dead.js +18 -4
- package/dist/ai-service/state-machine/handlers/play-dead.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts +6 -1
- package/dist/ai-service/state-machine/handlers/post-processing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/post-processing.js +234 -43
- package/dist/ai-service/state-machine/handlers/post-processing.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js +116 -6
- package/dist/ai-service/state-machine/handlers/runtime-reviewing.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts +7 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js +47 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.d.ts +33 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.js +61 -0
- package/dist/ai-service/state-machine/helpers/background-chat-record.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/change-info.d.ts +8 -0
- package/dist/ai-service/state-machine/helpers/change-info.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/change-info.js +100 -0
- package/dist/ai-service/state-machine/helpers/change-info.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/classification.d.ts +5 -0
- package/dist/ai-service/state-machine/helpers/classification.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/classification.js +13 -0
- package/dist/ai-service/state-machine/helpers/classification.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/context-id.d.ts +4 -0
- package/dist/ai-service/state-machine/helpers/context-id.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/context-id.js +18 -0
- package/dist/ai-service/state-machine/helpers/context-id.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts +7 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js +38 -0
- package/dist/ai-service/state-machine/helpers/fetch-with-reconnect-retry.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.d.ts +27 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.js +34 -0
- package/dist/ai-service/state-machine/helpers/headless-turn-lifecycle.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/peer.d.ts +83 -3
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +342 -4
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts +21 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js +71 -0
- package/dist/ai-service/state-machine/helpers/policy-gate-usage-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts +38 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js +131 -0
- package/dist/ai-service/state-machine/helpers/pre-session-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts +26 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js +128 -0
- package/dist/ai-service/state-machine/helpers/prompt-billing-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts +28 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js +254 -0
- package/dist/ai-service/state-machine/helpers/prompt-degradation-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts +59 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.js +168 -0
- package/dist/ai-service/state-machine/helpers/prompt-failure.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts +229 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js +675 -0
- package/dist/ai-service/state-machine/helpers/prompt-request-metrics.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts +271 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js +630 -0
- package/dist/ai-service/state-machine/helpers/stable-peer.js.map +1 -0
- package/dist/ai-service/state-machine/helpers/transition.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/transition.js +8 -3
- package/dist/ai-service/state-machine/helpers/transition.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts +8 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.d.ts.map +1 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js +11 -0
- package/dist/ai-service/state-machine/helpers/user-preferences.js.map +1 -0
- package/dist/ai-service/state-machine/mocks.d.ts +3 -3
- package/dist/ai-service/state-machine/mocks.d.ts.map +1 -1
- package/dist/ai-service/state-machine/mocks.js +125 -20
- package/dist/ai-service/state-machine/mocks.js.map +1 -1
- package/dist/ai-service/state-machine/traced-fsm.d.ts +89 -0
- package/dist/ai-service/state-machine/traced-fsm.d.ts.map +1 -0
- package/dist/ai-service/state-machine/traced-fsm.js +179 -0
- package/dist/ai-service/state-machine/traced-fsm.js.map +1 -0
- package/dist/ai-service/tasks/access.d.ts +23 -0
- package/dist/ai-service/tasks/access.d.ts.map +1 -0
- package/dist/ai-service/tasks/access.js +26 -0
- package/dist/ai-service/tasks/access.js.map +1 -0
- package/dist/ai-service/tasks/factory.d.ts +106 -0
- package/dist/ai-service/tasks/factory.d.ts.map +1 -0
- package/dist/ai-service/tasks/factory.js +71 -0
- package/dist/ai-service/tasks/factory.js.map +1 -0
- package/dist/ai-service/tasks/index.d.ts +6 -0
- package/dist/ai-service/tasks/index.d.ts.map +1 -0
- package/dist/ai-service/tasks/index.js +5 -0
- package/dist/ai-service/tasks/index.js.map +1 -0
- package/dist/ai-service/tasks/peer-push.d.ts +81 -0
- package/dist/ai-service/tasks/peer-push.d.ts.map +1 -0
- package/dist/ai-service/tasks/peer-push.js +84 -0
- package/dist/ai-service/tasks/peer-push.js.map +1 -0
- package/dist/ai-service/tasks/poll-loop.d.ts +56 -0
- package/dist/ai-service/tasks/poll-loop.d.ts.map +1 -0
- package/dist/ai-service/tasks/poll-loop.js +73 -0
- package/dist/ai-service/tasks/poll-loop.js.map +1 -0
- package/dist/ai-service/tasks/task-store.d.ts +116 -0
- package/dist/ai-service/tasks/task-store.d.ts.map +1 -0
- package/dist/ai-service/tasks/task-store.js +388 -0
- package/dist/ai-service/tasks/task-store.js.map +1 -0
- package/dist/ai-service/tasks/test-utils.d.ts +24 -0
- package/dist/ai-service/tasks/test-utils.d.ts.map +1 -0
- package/dist/ai-service/tasks/test-utils.js +53 -0
- package/dist/ai-service/tasks/test-utils.js.map +1 -0
- package/dist/ai-service/tasks/types.d.ts +143 -0
- package/dist/ai-service/tasks/types.d.ts.map +1 -0
- package/dist/ai-service/tasks/types.js +6 -0
- package/dist/ai-service/tasks/types.js.map +1 -0
- package/dist/ai-service/template-renderer.d.ts +45 -0
- package/dist/ai-service/template-renderer.d.ts.map +1 -0
- package/dist/ai-service/template-renderer.js +316 -0
- package/dist/ai-service/template-renderer.js.map +1 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.d.ts +25 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.d.ts.map +1 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.js +9 -0
- package/dist/ai-service/test-utils/dd-trace-helpers.js.map +1 -0
- package/dist/ai-service/test-utils/error-mocks.d.ts +69 -0
- package/dist/ai-service/test-utils/error-mocks.d.ts.map +1 -0
- package/dist/ai-service/test-utils/error-mocks.js +334 -0
- package/dist/ai-service/test-utils/error-mocks.js.map +1 -0
- package/dist/ai-service/test-utils/metrics-harness.d.ts +38 -0
- package/dist/ai-service/test-utils/metrics-harness.d.ts.map +1 -0
- package/dist/ai-service/test-utils/metrics-harness.js +67 -0
- package/dist/ai-service/test-utils/metrics-harness.js.map +1 -0
- package/dist/ai-service/test-utils/span-interceptor.d.ts +74 -0
- package/dist/ai-service/test-utils/span-interceptor.d.ts.map +1 -0
- package/dist/ai-service/test-utils/span-interceptor.js +272 -0
- package/dist/ai-service/test-utils/span-interceptor.js.map +1 -0
- package/dist/ai-service/test-utils/tracer-harness.d.ts +8 -0
- package/dist/ai-service/test-utils/tracer-harness.d.ts.map +1 -0
- package/dist/ai-service/test-utils/tracer-harness.js +26 -0
- package/dist/ai-service/test-utils/tracer-harness.js.map +1 -0
- package/dist/ai-service/transform/api-builder/shared.d.ts +10 -2
- package/dist/ai-service/transform/api-builder/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/shared.js +34 -10
- package/dist/ai-service/transform/api-builder/shared.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts +16 -2
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +181 -55
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts +6 -2
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +186 -49
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.d.ts +40 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.d.ts.map +1 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.js +118 -0
- package/dist/ai-service/transform/lucide-dynamic-type-imports/transformer.js.map +1 -0
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts +1 -1
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js +88 -37
- package/dist/ai-service/transform/remove-api-builder-imports/transformer.js.map +1 -1
- package/dist/ai-service/transform/shared.d.ts +9 -2
- package/dist/ai-service/transform/shared.d.ts.map +1 -1
- package/dist/ai-service/transform/shared.js +43 -13
- package/dist/ai-service/transform/shared.js.map +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.d.ts.map +1 -1
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js +77 -26
- package/dist/ai-service/transform/workaround-missing-sbapi/transformer.js.map +1 -1
- package/dist/ai-service/types.d.ts +301 -27
- package/dist/ai-service/types.d.ts.map +1 -1
- package/dist/ai-service/types.js +157 -0
- package/dist/ai-service/types.js.map +1 -1
- package/dist/ai-service/util/archive-extractors.d.ts +52 -0
- package/dist/ai-service/util/archive-extractors.d.ts.map +1 -0
- package/dist/ai-service/util/archive-extractors.js +305 -0
- package/dist/ai-service/util/archive-extractors.js.map +1 -0
- package/dist/ai-service/util/call-peer.d.ts +11 -0
- package/dist/ai-service/util/call-peer.d.ts.map +1 -0
- package/dist/ai-service/util/call-peer.js +47 -0
- package/dist/ai-service/util/call-peer.js.map +1 -0
- package/dist/ai-service/util/inference-jwt.d.ts +15 -0
- package/dist/ai-service/util/inference-jwt.d.ts.map +1 -0
- package/dist/ai-service/util/inference-jwt.js +56 -0
- package/dist/ai-service/util/inference-jwt.js.map +1 -0
- package/dist/ai-service/util/llm-config-utils.d.ts +54 -0
- package/dist/ai-service/util/llm-config-utils.d.ts.map +1 -0
- package/dist/ai-service/util/llm-config-utils.js +140 -0
- package/dist/ai-service/util/llm-config-utils.js.map +1 -0
- package/dist/ai-service/util/mode-message.d.ts +7 -0
- package/dist/ai-service/util/mode-message.d.ts.map +1 -0
- package/dist/ai-service/util/mode-message.js +15 -0
- package/dist/ai-service/util/mode-message.js.map +1 -0
- package/dist/ai-service/util/parse-jwt.d.ts +12 -0
- package/dist/ai-service/util/parse-jwt.d.ts.map +1 -0
- package/dist/ai-service/util/parse-jwt.js +30 -0
- package/dist/ai-service/util/parse-jwt.js.map +1 -0
- package/dist/ai-service/util/peer-liveness.d.ts +23 -0
- package/dist/ai-service/util/peer-liveness.d.ts.map +1 -0
- package/dist/ai-service/util/peer-liveness.js +42 -0
- package/dist/ai-service/util/peer-liveness.js.map +1 -0
- package/dist/ai-service/util/rpc-timeout.d.ts +89 -0
- package/dist/ai-service/util/rpc-timeout.d.ts.map +1 -0
- package/dist/ai-service/util/rpc-timeout.js +112 -0
- package/dist/ai-service/util/rpc-timeout.js.map +1 -0
- package/dist/ai-service/util/scoped-token-utils.d.ts +15 -0
- package/dist/ai-service/util/scoped-token-utils.d.ts.map +1 -0
- package/dist/ai-service/util/scoped-token-utils.js +137 -0
- package/dist/ai-service/util/scoped-token-utils.js.map +1 -0
- package/dist/ai-service/util/stop-condition.d.ts +17 -0
- package/dist/ai-service/util/stop-condition.d.ts.map +1 -0
- package/dist/ai-service/util/stop-condition.js +33 -0
- package/dist/ai-service/util/stop-condition.js.map +1 -0
- package/dist/ai-service/util/strip-content.d.ts +2 -0
- package/dist/ai-service/util/strip-content.d.ts.map +1 -0
- package/dist/ai-service/util/strip-content.js +31 -0
- package/dist/ai-service/util/strip-content.js.map +1 -0
- package/dist/ai-service/util/tool-signature.d.ts +13 -0
- package/dist/ai-service/util/tool-signature.d.ts.map +1 -0
- package/dist/ai-service/util/tool-signature.js +38 -0
- package/dist/ai-service/util/tool-signature.js.map +1 -0
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts +1 -2
- package/dist/binding-extraction/extract-control-block-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-control-block-identifiers.js +16 -14
- package/dist/binding-extraction/extract-control-block-identifiers.js.map +1 -1
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts +2 -11
- package/dist/binding-extraction/extract-embedded-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-embedded-identifiers.js +9 -91
- package/dist/binding-extraction/extract-embedded-identifiers.js.map +1 -1
- package/dist/binding-extraction/extract-identifiers.d.ts +16 -3
- package/dist/binding-extraction/extract-identifiers.d.ts.map +1 -1
- package/dist/binding-extraction/extract-identifiers.js +272 -64
- package/dist/binding-extraction/extract-identifiers.js.map +1 -1
- package/dist/binding-extraction/index.d.ts +2 -0
- package/dist/binding-extraction/index.d.ts.map +1 -0
- package/dist/binding-extraction/index.js +2 -0
- package/dist/binding-extraction/index.js.map +1 -0
- package/dist/binding-extraction/js-identifiers.d.ts +34 -0
- package/dist/binding-extraction/js-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/js-identifiers.js +409 -0
- package/dist/binding-extraction/js-identifiers.js.map +1 -0
- package/dist/binding-extraction/python-identifiers.d.ts +30 -0
- package/dist/binding-extraction/python-identifiers.d.ts.map +1 -0
- package/dist/binding-extraction/python-identifiers.js +657 -0
- package/dist/binding-extraction/python-identifiers.js.map +1 -0
- package/dist/binding-extraction/shared.d.ts +0 -203
- package/dist/binding-extraction/shared.d.ts.map +1 -1
- package/dist/binding-extraction/shared.js +1 -42
- package/dist/binding-extraction/shared.js.map +1 -1
- package/dist/binding-extraction/template-strings.d.ts +1 -2
- package/dist/binding-extraction/template-strings.d.ts.map +1 -1
- package/dist/build-errors.d.ts +10 -0
- package/dist/build-errors.d.ts.map +1 -0
- package/dist/build-errors.js +14 -0
- package/dist/build-errors.js.map +1 -0
- package/dist/clark-log-forwarder.d.ts +15 -0
- package/dist/clark-log-forwarder.d.ts.map +1 -0
- package/dist/clark-log-forwarder.js +32 -0
- package/dist/clark-log-forwarder.js.map +1 -0
- package/dist/client-error-overlay.d.ts +11 -0
- package/dist/client-error-overlay.d.ts.map +1 -0
- package/dist/client-error-overlay.js +90 -0
- package/dist/client-error-overlay.js.map +1 -0
- package/dist/codegen.d.ts +3 -25
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +64 -129
- package/dist/codegen.js.map +1 -1
- package/dist/components-manager.d.ts +12 -12
- package/dist/components-manager.d.ts.map +1 -1
- package/dist/components-manager.js +116 -90
- package/dist/components-manager.js.map +1 -1
- package/dist/custom-components.d.ts +1 -1
- package/dist/custom-components.d.ts.map +1 -1
- package/dist/custom-components.js +1 -1
- package/dist/custom-components.js.map +1 -1
- package/dist/dev-server-ws-smoke-client.d.ts +40 -0
- package/dist/dev-server-ws-smoke-client.d.ts.map +1 -0
- package/dist/dev-server-ws-smoke-client.js +316 -0
- package/dist/dev-server-ws-smoke-client.js.map +1 -0
- package/dist/download-filename.d.ts +6 -0
- package/dist/download-filename.d.ts.map +1 -0
- package/dist/download-filename.js +40 -0
- package/dist/download-filename.js.map +1 -0
- package/dist/draft-interface.d.ts +8 -1
- package/dist/draft-interface.d.ts.map +1 -1
- package/dist/early-error-relay.d.ts +31 -0
- package/dist/early-error-relay.d.ts.map +1 -0
- package/dist/early-error-relay.js +88 -0
- package/dist/early-error-relay.js.map +1 -0
- package/dist/ensure-app-provider.d.ts +2 -0
- package/dist/ensure-app-provider.d.ts.map +1 -0
- package/dist/ensure-app-provider.js +209 -0
- package/dist/ensure-app-provider.js.map +1 -0
- package/dist/errors/error-handler.d.ts +3 -13
- package/dist/errors/error-handler.d.ts.map +1 -1
- package/dist/errors/error-handler.js +1 -1
- package/dist/errors/error-handler.js.map +1 -1
- package/dist/extract-api-integrations.d.ts +99 -0
- package/dist/extract-api-integrations.d.ts.map +1 -0
- package/dist/extract-api-integrations.js +597 -0
- package/dist/extract-api-integrations.js.map +1 -0
- package/dist/file-sync-vite-plugin.d.ts +64 -2
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +1398 -469
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +55 -3
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +118 -5
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/file-system-manager.d.ts +62 -69
- package/dist/file-system-manager.d.ts.map +1 -1
- package/dist/file-system-manager.js +695 -811
- package/dist/file-system-manager.js.map +1 -1
- package/dist/git-auth-state.d.ts +4 -0
- package/dist/git-auth-state.d.ts.map +1 -0
- package/dist/git-auth-state.js +25 -0
- package/dist/git-auth-state.js.map +1 -0
- package/dist/git-log.d.ts +11 -0
- package/dist/git-log.d.ts.map +1 -0
- package/dist/git-log.js +23 -0
- package/dist/git-log.js.map +1 -0
- package/dist/git-operation-lock.d.ts +22 -0
- package/dist/git-operation-lock.d.ts.map +1 -0
- package/dist/git-operation-lock.js +25 -0
- package/dist/git-operation-lock.js.map +1 -0
- package/dist/git-service/app-layout-guard.d.ts +25 -0
- package/dist/git-service/app-layout-guard.d.ts.map +1 -0
- package/dist/git-service/app-layout-guard.js +66 -0
- package/dist/git-service/app-layout-guard.js.map +1 -0
- package/dist/git-service/azure-devops-workflow.d.ts +6 -0
- package/dist/git-service/azure-devops-workflow.d.ts.map +1 -0
- package/dist/git-service/azure-devops-workflow.js +12 -0
- package/dist/git-service/azure-devops-workflow.js.map +1 -0
- package/dist/git-service/bitbucket-workflow.d.ts +5 -0
- package/dist/git-service/bitbucket-workflow.d.ts.map +1 -0
- package/dist/git-service/bitbucket-workflow.js +12 -0
- package/dist/git-service/bitbucket-workflow.js.map +1 -0
- package/dist/git-service/checkpoint-commit-metrics.d.ts +2 -0
- package/dist/git-service/checkpoint-commit-metrics.d.ts.map +1 -0
- package/dist/git-service/checkpoint-commit-metrics.js +15 -0
- package/dist/git-service/checkpoint-commit-metrics.js.map +1 -0
- package/dist/git-service/checkpoint-committer.d.ts +22 -0
- package/dist/git-service/checkpoint-committer.d.ts.map +1 -0
- package/dist/git-service/checkpoint-committer.js +91 -0
- package/dist/git-service/checkpoint-committer.js.map +1 -0
- package/dist/git-service/commit-live-branch.d.ts +17 -0
- package/dist/git-service/commit-live-branch.d.ts.map +1 -0
- package/dist/git-service/commit-live-branch.js +28 -0
- package/dist/git-service/commit-live-branch.js.map +1 -0
- package/dist/git-service/ensure-workflow-file.d.ts +20 -0
- package/dist/git-service/ensure-workflow-file.d.ts.map +1 -0
- package/dist/git-service/ensure-workflow-file.js +51 -0
- package/dist/git-service/ensure-workflow-file.js.map +1 -0
- package/dist/git-service/errors.d.ts +31 -0
- package/dist/git-service/errors.d.ts.map +1 -0
- package/dist/git-service/errors.js +49 -0
- package/dist/git-service/errors.js.map +1 -0
- package/dist/git-service/github-workflow.d.ts +6 -0
- package/dist/git-service/github-workflow.d.ts.map +1 -0
- package/dist/git-service/github-workflow.js +12 -0
- package/dist/git-service/github-workflow.js.map +1 -0
- package/dist/git-service/gitlab-workflow.d.ts +6 -0
- package/dist/git-service/gitlab-workflow.d.ts.map +1 -0
- package/dist/git-service/gitlab-workflow.js +12 -0
- package/dist/git-service/gitlab-workflow.js.map +1 -0
- package/dist/git-service/index.d.ts +30 -0
- package/dist/git-service/index.d.ts.map +1 -0
- package/dist/git-service/index.js +217 -0
- package/dist/git-service/index.js.map +1 -0
- package/dist/git-service/live-branch.d.ts +11 -0
- package/dist/git-service/live-branch.d.ts.map +1 -0
- package/dist/git-service/live-branch.js +171 -0
- package/dist/git-service/live-branch.js.map +1 -0
- package/dist/git-service/managed-excludes.d.ts +36 -0
- package/dist/git-service/managed-excludes.d.ts.map +1 -0
- package/dist/git-service/managed-excludes.js +124 -0
- package/dist/git-service/managed-excludes.js.map +1 -0
- package/dist/git-service/provider-workflow-files.d.ts +12 -0
- package/dist/git-service/provider-workflow-files.d.ts.map +1 -0
- package/dist/git-service/provider-workflow-files.js +36 -0
- package/dist/git-service/provider-workflow-files.js.map +1 -0
- package/dist/git-service/status-sync.d.ts +18 -0
- package/dist/git-service/status-sync.d.ts.map +1 -0
- package/dist/git-service/status-sync.js +32 -0
- package/dist/git-service/status-sync.js.map +1 -0
- package/dist/ids.d.ts +1 -0
- package/dist/ids.d.ts.map +1 -1
- package/dist/ids.js +3 -0
- package/dist/ids.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/inject-index-vite-plugin.d.ts +21 -0
- package/dist/inject-index-vite-plugin.d.ts.map +1 -0
- package/dist/inject-index-vite-plugin.js +130 -0
- package/dist/inject-index-vite-plugin.js.map +1 -0
- package/dist/injected-index.d.ts +9 -2
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +153 -9
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/activity-tracker.d.ts +46 -0
- package/dist/lock-service/activity-tracker.d.ts.map +1 -0
- package/dist/lock-service/activity-tracker.js +119 -0
- package/dist/lock-service/activity-tracker.js.map +1 -0
- package/dist/lock-service/index.d.ts +420 -24
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +1209 -131
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/get-fullstack-template-dir.d.ts +37 -0
- package/dist/migration/get-fullstack-template-dir.d.ts.map +1 -0
- package/dist/migration/get-fullstack-template-dir.js +99 -0
- package/dist/migration/get-fullstack-template-dir.js.map +1 -0
- package/dist/migration/inline-v2-backup-source-files.d.ts +7 -0
- package/dist/migration/inline-v2-backup-source-files.d.ts.map +1 -0
- package/dist/migration/inline-v2-backup-source-files.js +110 -0
- package/dist/migration/inline-v2-backup-source-files.js.map +1 -0
- package/dist/migration/integration-write-policy.d.ts +24 -0
- package/dist/migration/integration-write-policy.d.ts.map +1 -0
- package/dist/migration/integration-write-policy.js +125 -0
- package/dist/migration/integration-write-policy.js.map +1 -0
- package/dist/migration/mark-api-testing-denied.d.ts +27 -0
- package/dist/migration/mark-api-testing-denied.d.ts.map +1 -0
- package/dist/migration/mark-api-testing-denied.js +80 -0
- package/dist/migration/mark-api-testing-denied.js.map +1 -0
- package/dist/migration/migration-checklist.d.ts +80 -0
- package/dist/migration/migration-checklist.d.ts.map +1 -0
- package/dist/migration/migration-checklist.js +150 -0
- package/dist/migration/migration-checklist.js.map +1 -0
- package/dist/migration/migration-classifier.d.ts +4 -0
- package/dist/migration/migration-classifier.d.ts.map +1 -0
- package/dist/migration/migration-classifier.js +87 -0
- package/dist/migration/migration-classifier.js.map +1 -0
- package/dist/migration/migration-metrics.d.ts +74 -0
- package/dist/migration/migration-metrics.d.ts.map +1 -0
- package/dist/migration/migration-metrics.js +124 -0
- package/dist/migration/migration-metrics.js.map +1 -0
- package/dist/migration/migration-routes.d.ts +47 -0
- package/dist/migration/migration-routes.d.ts.map +1 -0
- package/dist/migration/migration-routes.js +1233 -0
- package/dist/migration/migration-routes.js.map +1 -0
- package/dist/migration/migration-session-reconcile.d.ts +24 -0
- package/dist/migration/migration-session-reconcile.d.ts.map +1 -0
- package/dist/migration/migration-session-reconcile.js +139 -0
- package/dist/migration/migration-session-reconcile.js.map +1 -0
- package/dist/migration/migration-verification.d.ts +288 -0
- package/dist/migration/migration-verification.d.ts.map +1 -0
- package/dist/migration/migration-verification.js +1246 -0
- package/dist/migration/migration-verification.js.map +1 -0
- package/dist/migration/recommended-user-deps.d.ts +40 -0
- package/dist/migration/recommended-user-deps.d.ts.map +1 -0
- package/dist/migration/recommended-user-deps.js +209 -0
- package/dist/migration/recommended-user-deps.js.map +1 -0
- package/dist/migration/resolve-v2-backup-path.d.ts +7 -0
- package/dist/migration/resolve-v2-backup-path.d.ts.map +1 -0
- package/dist/migration/resolve-v2-backup-path.js +35 -0
- package/dist/migration/resolve-v2-backup-path.js.map +1 -0
- package/dist/migration/restructure.d.ts +125 -0
- package/dist/migration/restructure.d.ts.map +1 -0
- package/dist/migration/restructure.js +645 -0
- package/dist/migration/restructure.js.map +1 -0
- package/dist/migration/scan-imports.d.ts +7 -0
- package/dist/migration/scan-imports.d.ts.map +1 -0
- package/dist/migration/scan-imports.js +178 -0
- package/dist/migration/scan-imports.js.map +1 -0
- package/dist/migration/translation-prompt.d.ts +23 -0
- package/dist/migration/translation-prompt.d.ts.map +1 -0
- package/dist/migration/translation-prompt.js +36 -0
- package/dist/migration/translation-prompt.js.map +1 -0
- package/dist/migration/unsupported-integrations.d.ts +11 -0
- package/dist/migration/unsupported-integrations.d.ts.map +1 -0
- package/dist/migration/unsupported-integrations.js +206 -0
- package/dist/migration/unsupported-integrations.js.map +1 -0
- package/dist/migration/yaml-walk.d.ts +18 -0
- package/dist/migration/yaml-walk.d.ts.map +1 -0
- package/dist/migration/yaml-walk.js +45 -0
- package/dist/migration/yaml-walk.js.map +1 -0
- package/dist/migration-templates/app-fullstack/.gitignore +50 -0
- package/dist/migration-templates/app-fullstack/client/App.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/components/common/sonner.tsx +20 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-active-page.ts +73 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +21 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +197 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/area-chart.tsx +432 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/aspect-ratio.tsx +45 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +117 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/badge.tsx +143 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/bar-chart.tsx +390 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +259 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +182 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +300 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/card.tsx +129 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +403 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/checkbox.tsx +97 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/code-block-content.tsx +66 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/date-range-picker.tsx +396 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dialog.tsx +223 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/dropdown-menu.tsx +284 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +395 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +166 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/icon.tsx +133 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +68 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +219 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +55 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/line-chart.tsx +380 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/link.tsx +139 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +345 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +192 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/pie-chart.tsx +295 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +162 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +69 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radar-chart.tsx +386 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/radial-chart.tsx +402 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/scroll-area.tsx +86 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +229 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/separator.tsx +62 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +234 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +974 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/skeleton.tsx +13 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +198 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +95 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +145 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +87 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/textarea.tsx +148 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +225 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +150 -0
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +175 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApi.ts +25 -0
- package/dist/migration-templates/app-fullstack/client/hooks/useApiData.ts +10 -0
- package/dist/migration-templates/app-fullstack/client/index.css +131 -0
- package/dist/migration-templates/app-fullstack/client/lib/executeApi.ts +9 -0
- package/dist/migration-templates/app-fullstack/client/lib/utils.ts +6 -0
- package/dist/migration-templates/app-fullstack/client/pages/Home/index.tsx +3 -0
- package/dist/migration-templates/app-fullstack/client/root.tsx +17 -0
- package/dist/migration-templates/app-fullstack/client/router.tsx +48 -0
- package/dist/migration-templates/app-fullstack/client/types/node.d.ts +9 -0
- package/dist/migration-templates/app-fullstack/components.json +21 -0
- package/dist/migration-templates/app-fullstack/css.d.ts +3 -0
- package/dist/migration-templates/app-fullstack/eslint.config.js +113 -0
- package/dist/migration-templates/app-fullstack/package.json +84 -0
- package/dist/migration-templates/app-fullstack/server/.gitkeep +0 -0
- package/dist/migration-templates/app-fullstack/server/apis/index.ts +22 -0
- package/dist/migration-templates/app-fullstack/server/index.ts +2 -0
- package/dist/migration-templates/app-fullstack/tsconfig.client.json +27 -0
- package/dist/migration-templates/app-fullstack/tsconfig.eslint.json +8 -0
- package/dist/migration-templates/app-fullstack/tsconfig.json +25 -0
- package/dist/migration-templates/app-fullstack/tsconfig.server.json +13 -0
- package/dist/migration-templates/app-fullstack/vite.config.ts +17 -0
- package/dist/npm/apply-package-json-substitutions.d.ts +19 -0
- package/dist/npm/apply-package-json-substitutions.d.ts.map +1 -0
- package/dist/npm/apply-package-json-substitutions.js +108 -0
- package/dist/npm/apply-package-json-substitutions.js.map +1 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.d.ts +15 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.d.ts.map +1 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.js +36 -0
- package/dist/npm/normalize-workspace-protocol-for-npm.js.map +1 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.d.ts +8 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.d.ts.map +1 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.js +44 -0
- package/dist/npm/prepare-package-json-for-cloud-npm.js.map +1 -0
- package/dist/npm/rewrite-platform-workspace-deps.d.ts +17 -0
- package/dist/npm/rewrite-platform-workspace-deps.d.ts.map +1 -0
- package/dist/npm/rewrite-platform-workspace-deps.js +37 -0
- package/dist/npm/rewrite-platform-workspace-deps.js.map +1 -0
- package/dist/operations/operation-processor.d.ts +24 -0
- package/dist/operations/operation-processor.d.ts.map +1 -0
- package/dist/operations/operation-processor.js +80 -0
- package/dist/operations/operation-processor.js.map +1 -0
- package/dist/operations/types.d.ts +8 -0
- package/dist/operations/types.d.ts.map +1 -0
- package/dist/operations/types.js +2 -0
- package/dist/operations/types.js.map +1 -0
- package/dist/parsing/bindings.d.ts +1 -1
- package/dist/parsing/bindings.d.ts.map +1 -1
- package/dist/parsing/bindings.js +14 -5
- package/dist/parsing/bindings.js.map +1 -1
- package/dist/parsing/computed/index.d.ts +1 -1
- package/dist/parsing/computed/index.d.ts.map +1 -1
- package/dist/parsing/computed/index.js +1 -1
- package/dist/parsing/computed/index.js.map +1 -1
- package/dist/parsing/computed/to-code-computed.d.ts +2 -1
- package/dist/parsing/computed/to-code-computed.d.ts.map +1 -1
- package/dist/parsing/computed/to-code-computed.js +22 -11
- package/dist/parsing/computed/to-code-computed.js.map +1 -1
- package/dist/parsing/computed/to-value-computed.d.ts +1 -1
- package/dist/parsing/computed/to-value-computed.d.ts.map +1 -1
- package/dist/parsing/computed/to-value-computed.js +19 -7
- package/dist/parsing/computed/to-value-computed.js.map +1 -1
- package/dist/parsing/dim/index.d.ts +1 -1
- package/dist/parsing/dim/index.d.ts.map +1 -1
- package/dist/parsing/dim/index.js +1 -1
- package/dist/parsing/dim/index.js.map +1 -1
- package/dist/parsing/dim/to-value-dimensions.d.ts +2 -1
- package/dist/parsing/dim/to-value-dimensions.d.ts.map +1 -1
- package/dist/parsing/dim/to-value-dimensions.js +4 -3
- package/dist/parsing/dim/to-value-dimensions.js.map +1 -1
- package/dist/parsing/function/index.d.ts +4 -0
- package/dist/parsing/function/index.d.ts.map +1 -0
- package/dist/parsing/function/index.js +7 -0
- package/dist/parsing/function/index.js.map +1 -0
- package/dist/parsing/function/to-code-function.d.ts +2 -0
- package/dist/parsing/function/to-code-function.d.ts.map +1 -0
- package/dist/parsing/function/to-code-function.js +4 -0
- package/dist/parsing/function/to-code-function.js.map +1 -0
- package/dist/parsing/function/to-value-function.d.ts +4 -0
- package/dist/parsing/function/to-value-function.d.ts.map +1 -0
- package/dist/parsing/function/to-value-function.js +33 -0
- package/dist/parsing/function/to-value-function.js.map +1 -0
- package/dist/parsing/ids.d.ts +0 -2
- package/dist/parsing/ids.d.ts.map +1 -1
- package/dist/parsing/ids.js +18 -21
- package/dist/parsing/ids.js.map +1 -1
- package/dist/parsing/imports.d.ts +5 -5
- package/dist/parsing/imports.d.ts.map +1 -1
- package/dist/parsing/imports.js +40 -30
- package/dist/parsing/imports.js.map +1 -1
- package/dist/parsing/index.d.ts +3 -0
- package/dist/parsing/index.d.ts.map +1 -0
- package/dist/parsing/index.js +3 -0
- package/dist/parsing/index.js.map +1 -0
- package/dist/parsing/jsx-utils.d.ts +4 -3
- package/dist/parsing/jsx-utils.d.ts.map +1 -1
- package/dist/parsing/jsx-utils.js +37 -25
- package/dist/parsing/jsx-utils.js.map +1 -1
- package/dist/parsing/jsx.d.ts +25 -11
- package/dist/parsing/jsx.d.ts.map +1 -1
- package/dist/parsing/jsx.js +210 -176
- package/dist/parsing/jsx.js.map +1 -1
- package/dist/parsing/page.d.ts +1 -2
- package/dist/parsing/page.d.ts.map +1 -1
- package/dist/parsing/page.js +297 -122
- package/dist/parsing/page.js.map +1 -1
- package/dist/parsing/parse-tsx-module.d.ts +4 -0
- package/dist/parsing/parse-tsx-module.d.ts.map +1 -0
- package/dist/parsing/parse-tsx-module.js +13 -0
- package/dist/parsing/parse-tsx-module.js.map +1 -0
- package/dist/parsing/properties.d.ts +2 -1
- package/dist/parsing/properties.d.ts.map +1 -1
- package/dist/parsing/properties.js +105 -28
- package/dist/parsing/properties.js.map +1 -1
- package/dist/parsing/sdk-registry.d.ts +17 -0
- package/dist/parsing/sdk-registry.d.ts.map +1 -0
- package/dist/parsing/sdk-registry.js +184 -0
- package/dist/parsing/sdk-registry.js.map +1 -0
- package/dist/parsing/template/index.d.ts +1 -1
- package/dist/parsing/template/index.d.ts.map +1 -1
- package/dist/parsing/template/index.js.map +1 -1
- package/dist/parsing/template/to-code-template.d.ts.map +1 -1
- package/dist/parsing/template/to-code-template.js +1 -2
- package/dist/parsing/template/to-code-template.js.map +1 -1
- package/dist/parsing/type-parsing-registry.d.ts +1 -1
- package/dist/parsing/type-parsing-registry.d.ts.map +1 -1
- package/dist/parsing/type-parsing-registry.js +2 -2
- package/dist/parsing/type-parsing-registry.js.map +1 -1
- package/dist/parsing/types.d.ts +3 -2
- package/dist/parsing/types.d.ts.map +1 -1
- package/dist/parsing/util.d.ts +7 -11
- package/dist/parsing/util.d.ts.map +1 -1
- package/dist/parsing/util.js +131 -81
- package/dist/parsing/util.js.map +1 -1
- package/dist/plugin-options.d.ts +67 -5
- package/dist/plugin-options.d.ts.map +1 -1
- package/dist/plugin-options.js +0 -3
- package/dist/plugin-options.js.map +1 -1
- package/dist/policy-gate-callback-mapper.d.ts +26 -0
- package/dist/policy-gate-callback-mapper.d.ts.map +1 -0
- package/dist/policy-gate-callback-mapper.js +58 -0
- package/dist/policy-gate-callback-mapper.js.map +1 -0
- package/dist/policy-gate-run-registry.d.ts +28 -0
- package/dist/policy-gate-run-registry.d.ts.map +1 -0
- package/dist/policy-gate-run-registry.js +40 -0
- package/dist/policy-gate-run-registry.js.map +1 -0
- package/dist/policy-gate-runner.d.ts +36 -0
- package/dist/policy-gate-runner.d.ts.map +1 -0
- package/dist/policy-gate-runner.js +250 -0
- package/dist/policy-gate-runner.js.map +1 -0
- package/dist/refactor/blocks.d.ts +1 -2
- package/dist/refactor/blocks.d.ts.map +1 -1
- package/dist/refactor/blocks.js +3 -70
- package/dist/refactor/blocks.js.map +1 -1
- package/dist/refactor/entities.d.ts +6 -0
- package/dist/refactor/entities.d.ts.map +1 -0
- package/dist/refactor/entities.js +65 -0
- package/dist/refactor/entities.js.map +1 -0
- package/dist/refactor/javascript.d.ts +1 -1
- package/dist/refactor/javascript.d.ts.map +1 -1
- package/dist/refactor/javascript.js +103 -2
- package/dist/refactor/javascript.js.map +1 -1
- package/dist/rename-manager.d.ts +3 -2
- package/dist/rename-manager.d.ts.map +1 -1
- package/dist/rename-manager.js +35 -14
- package/dist/rename-manager.js.map +1 -1
- package/dist/resolver.d.ts +4 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +27 -0
- package/dist/resolver.js.map +1 -0
- package/dist/router-parser-metrics.d.ts +2 -0
- package/dist/router-parser-metrics.d.ts.map +1 -0
- package/dist/router-parser-metrics.js +13 -0
- package/dist/router-parser-metrics.js.map +1 -0
- package/dist/router-parser.d.ts +41 -0
- package/dist/router-parser.d.ts.map +1 -0
- package/dist/router-parser.js +894 -0
- package/dist/router-parser.js.map +1 -0
- package/dist/scan-scope-merge.d.ts +16 -0
- package/dist/scan-scope-merge.d.ts.map +1 -0
- package/dist/scan-scope-merge.js +90 -0
- package/dist/scan-scope-merge.js.map +1 -0
- package/dist/server-rpc/client.d.ts +11 -0
- package/dist/server-rpc/client.d.ts.map +1 -0
- package/dist/server-rpc/client.js +42 -0
- package/dist/server-rpc/client.js.map +1 -0
- package/dist/server-rpc/handlers.d.ts +3 -0
- package/dist/server-rpc/handlers.d.ts.map +1 -0
- package/dist/server-rpc/handlers.js.map +1 -0
- package/dist/server-rpc/index.d.ts +77 -0
- package/dist/server-rpc/index.d.ts.map +1 -0
- package/dist/server-rpc/index.js +344 -0
- package/dist/server-rpc/index.js.map +1 -0
- package/dist/server-rpc/request-abort-context.d.ts +3 -0
- package/dist/server-rpc/request-abort-context.d.ts.map +1 -0
- package/dist/server-rpc/request-abort-context.js +23 -0
- package/dist/server-rpc/request-abort-context.js.map +1 -0
- package/dist/server-rpc/rpc-invalidate-metrics.d.ts +20 -0
- package/dist/server-rpc/rpc-invalidate-metrics.d.ts.map +1 -0
- package/dist/server-rpc/rpc-invalidate-metrics.js +86 -0
- package/dist/server-rpc/rpc-invalidate-metrics.js.map +1 -0
- package/dist/snapshot-routes.d.ts +18 -0
- package/dist/snapshot-routes.d.ts.map +1 -0
- package/dist/snapshot-routes.js +247 -0
- package/dist/snapshot-routes.js.map +1 -0
- package/dist/socket-manager.d.ts +145 -17
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +1730 -82
- package/dist/socket-manager.js.map +1 -1
- package/dist/source-tracker.d.ts +23 -158
- package/dist/source-tracker.d.ts.map +1 -1
- package/dist/source-tracker.js +78 -877
- package/dist/source-tracker.js.map +1 -1
- package/dist/sync-service/checkpoint-result.d.ts +22 -0
- package/dist/sync-service/checkpoint-result.d.ts.map +1 -0
- package/dist/sync-service/checkpoint-result.js +22 -0
- package/dist/sync-service/checkpoint-result.js.map +1 -0
- package/dist/sync-service/download.d.ts +23 -6
- package/dist/sync-service/download.d.ts.map +1 -1
- package/dist/sync-service/download.js +234 -33
- package/dist/sync-service/download.js.map +1 -1
- package/dist/sync-service/draft-helpers.d.ts +17 -1
- package/dist/sync-service/draft-helpers.d.ts.map +1 -1
- package/dist/sync-service/draft-helpers.js +193 -114
- package/dist/sync-service/draft-helpers.js.map +1 -1
- package/dist/sync-service/draft-reconcile.d.ts +22 -0
- package/dist/sync-service/draft-reconcile.d.ts.map +1 -0
- package/dist/sync-service/draft-reconcile.js +24 -0
- package/dist/sync-service/draft-reconcile.js.map +1 -0
- package/dist/sync-service/draft-state-report-metrics.d.ts +2 -0
- package/dist/sync-service/draft-state-report-metrics.d.ts.map +1 -0
- package/dist/sync-service/draft-state-report-metrics.js +27 -0
- package/dist/sync-service/draft-state-report-metrics.js.map +1 -0
- package/dist/sync-service/hash-cache.d.ts +1 -0
- package/dist/sync-service/hash-cache.d.ts.map +1 -1
- package/dist/sync-service/hash-cache.js +4 -0
- package/dist/sync-service/hash-cache.js.map +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts.map +1 -1
- package/dist/sync-service/hash-dir-tree.js +3 -3
- package/dist/sync-service/hash-dir-tree.js.map +1 -1
- package/dist/sync-service/index.d.ts +250 -20
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +868 -123
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts +2 -2
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +93 -29
- package/dist/sync-service/list-dir.js.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.js +4 -8
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.d.ts +2 -2
- package/dist/sync-service/snapshot/upload-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/upload-snapshot.js +21 -1
- package/dist/sync-service/snapshot/upload-snapshot.js.map +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +21 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/util/ignore-patterns.d.ts +9 -0
- package/dist/util/ignore-patterns.d.ts.map +1 -0
- package/dist/util/ignore-patterns.js +53 -0
- package/dist/util/ignore-patterns.js.map +1 -0
- package/dist/util/log-sanitizer.d.ts +44 -0
- package/dist/util/log-sanitizer.d.ts.map +1 -0
- package/dist/util/log-sanitizer.js +209 -0
- package/dist/util/log-sanitizer.js.map +1 -0
- package/dist/util/logger.d.ts +58 -17
- package/dist/util/logger.d.ts.map +1 -1
- package/dist/util/logger.js +617 -40
- package/dist/util/logger.js.map +1 -1
- package/dist/util/open-api.d.ts +9 -0
- package/dist/util/open-api.d.ts.map +1 -0
- package/dist/util/open-api.js +2 -0
- package/dist/util/open-api.js.map +1 -0
- package/dist/util/operation-queue.d.ts +7 -1
- package/dist/util/operation-queue.d.ts.map +1 -1
- package/dist/util/operation-queue.js +5 -0
- package/dist/util/operation-queue.js.map +1 -1
- package/dist/util/summarize-for-logging.d.ts +14 -0
- package/dist/util/summarize-for-logging.d.ts.map +1 -0
- package/dist/util/summarize-for-logging.js +94 -0
- package/dist/util/summarize-for-logging.js.map +1 -0
- package/dist/util.d.ts +17 -18
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +46 -112
- package/dist/util.js.map +1 -1
- package/dist/virtual-modules.d.ts +5 -0
- package/dist/virtual-modules.d.ts.map +1 -0
- package/dist/virtual-modules.js +5 -0
- package/dist/virtual-modules.js.map +1 -0
- package/dist/vite-plugin-yaml-types.d.ts +15 -0
- package/dist/vite-plugin-yaml-types.d.ts.map +1 -0
- package/dist/vite-plugin-yaml-types.js +187 -0
- package/dist/vite-plugin-yaml-types.js.map +1 -0
- package/package.json +131 -65
- package/dist/ai-service/artifacts/bolt.d.ts +0 -8
- package/dist/ai-service/artifacts/bolt.d.ts.map +0 -1
- package/dist/ai-service/artifacts/bolt.js +0 -34
- package/dist/ai-service/artifacts/bolt.js.map +0 -1
- package/dist/ai-service/eval/template-renderer.d.ts +0 -13
- package/dist/ai-service/eval/template-renderer.d.ts.map +0 -1
- package/dist/ai-service/eval/template-renderer.js +0 -67
- package/dist/ai-service/eval/template-renderer.js.map +0 -1
- package/dist/ai-service/integrations/const.d.ts +0 -41
- package/dist/ai-service/integrations/const.d.ts.map +0 -1
- package/dist/ai-service/integrations/const.js +0 -76
- package/dist/ai-service/integrations/const.js.map +0 -1
- package/dist/ai-service/integrations/from-prompt-context.d.ts +0 -4
- package/dist/ai-service/integrations/from-prompt-context.d.ts.map +0 -1
- package/dist/ai-service/integrations/from-prompt-context.js +0 -56
- package/dist/ai-service/integrations/from-prompt-context.js.map +0 -1
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts +0 -3
- package/dist/ai-service/integrations/to-sdk-prompt.d.ts.map +0 -1
- package/dist/ai-service/integrations/to-sdk-prompt.js +0 -45
- package/dist/ai-service/integrations/to-sdk-prompt.js.map +0 -1
- package/dist/ai-service/integrations/types.d.ts +0 -31
- package/dist/ai-service/integrations/types.d.ts.map +0 -1
- package/dist/ai-service/integrations/types.js.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts +0 -2
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.d.ts.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js +0 -386
- package/dist/ai-service/prompts/draft-subprompts/superblocks-api-draft.js.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts +0 -2
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.d.ts.map +0 -1
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js +0 -219
- package/dist/ai-service/prompts/draft-subprompts/superblocks-layouts-with-grid-examples.js.map +0 -1
- package/dist/ai-service/prompts/generated/index.d.ts +0 -4
- package/dist/ai-service/prompts/generated/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/index.js +0 -6
- package/dist/ai-service/prompts/generated/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbButtonPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbCheckboxPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbColumnPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbContainerPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbDatePickerPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbDropdownPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbIconPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbImagePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbInputPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbModalPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbPagePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSectionPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSlideoutPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbSwitchPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbTablePropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js +0 -6
- package/dist/ai-service/prompts/generated/library-components/SbTextPropsDocs.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/index.d.ts +0 -17
- package/dist/ai-service/prompts/generated/library-components/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-components/index.js +0 -19
- package/dist/ai-service/prompts/generated/library-components/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js +0 -6
- package/dist/ai-service/prompts/generated/library-typedefs/Dim.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts +0 -2
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js +0 -6
- package/dist/ai-service/prompts/generated/library-typedefs/SbEventFlow.js.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts +0 -3
- package/dist/ai-service/prompts/generated/library-typedefs/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/library-typedefs/index.js +0 -5
- package/dist/ai-service/prompts/generated/library-typedefs/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts +0 -11
- package/dist/ai-service/prompts/generated/subprompts/index.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/index.js +0 -13
- package/dist/ai-service/prompts/generated/subprompts/index.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-api.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-components-rules.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-custom-components.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-event-flow.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-layouts.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-page.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-routes.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-state.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/superblocks-theming.js.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts +0 -2
- package/dist/ai-service/prompts/generated/subprompts/system.d.ts.map +0 -1
- package/dist/ai-service/prompts/generated/subprompts/system.js +0 -6
- package/dist/ai-service/prompts/generated/subprompts/system.js.map +0 -1
- package/dist/ai-service/prompts/markdown-loader.d.ts +0 -10
- package/dist/ai-service/prompts/markdown-loader.d.ts.map +0 -1
- package/dist/ai-service/prompts/markdown-loader.js +0 -71
- package/dist/ai-service/prompts/markdown-loader.js.map +0 -1
- package/dist/ai-service/prompts/system.d.ts +0 -2
- package/dist/ai-service/prompts/system.d.ts.map +0 -1
- package/dist/ai-service/prompts/system.js +0 -152
- package/dist/ai-service/prompts/system.js.map +0 -1
- package/dist/ai-service/result-buffer/bolt.d.ts +0 -15
- package/dist/ai-service/result-buffer/bolt.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/bolt.js +0 -73
- package/dist/ai-service/result-buffer/bolt.js.map +0 -1
- package/dist/ai-service/result-buffer/shared.d.ts +0 -13
- package/dist/ai-service/result-buffer/shared.d.ts.map +0 -1
- package/dist/ai-service/result-buffer/shared.js +0 -7
- package/dist/ai-service/result-buffer/shared.js.map +0 -1
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts +0 -21
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.d.ts.map +0 -1
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js +0 -48
- package/dist/ai-service/transform/add-metadata-to-api-yaml/transformer.js.map +0 -1
- package/dist/binding-extraction/extract-js-identifiers.d.ts +0 -19
- package/dist/binding-extraction/extract-js-identifiers.d.ts.map +0 -1
- package/dist/binding-extraction/extract-js-identifiers.js +0 -161
- package/dist/binding-extraction/extract-js-identifiers.js.map +0 -1
- package/dist/binding-extraction/extract-py-identifiers.d.ts +0 -4
- package/dist/binding-extraction/extract-py-identifiers.d.ts.map +0 -1
- package/dist/binding-extraction/extract-py-identifiers.js +0 -161
- package/dist/binding-extraction/extract-py-identifiers.js.map +0 -1
- package/dist/parsing/entity/index.d.ts +0 -7
- package/dist/parsing/entity/index.d.ts.map +0 -1
- package/dist/parsing/entity/index.js +0 -7
- package/dist/parsing/entity/index.js.map +0 -1
- package/dist/parsing/entity/to-code-entity.d.ts +0 -3
- package/dist/parsing/entity/to-code-entity.d.ts.map +0 -1
- package/dist/parsing/entity/to-code-entity.js +0 -41
- package/dist/parsing/entity/to-code-entity.js.map +0 -1
- package/dist/parsing/entity/to-value-entity.d.ts +0 -8
- package/dist/parsing/entity/to-value-entity.d.ts.map +0 -1
- package/dist/parsing/entity/to-value-entity.js +0 -120
- package/dist/parsing/entity/to-value-entity.js.map +0 -1
- package/dist/parsing/events/index.d.ts +0 -5
- package/dist/parsing/events/index.d.ts.map +0 -1
- package/dist/parsing/events/index.js +0 -7
- package/dist/parsing/events/index.js.map +0 -1
- package/dist/parsing/events/to-code-events.d.ts +0 -3
- package/dist/parsing/events/to-code-events.d.ts.map +0 -1
- package/dist/parsing/events/to-code-events.js +0 -100
- package/dist/parsing/events/to-code-events.js.map +0 -1
- package/dist/parsing/events/to-value-events.d.ts +0 -6
- package/dist/parsing/events/to-value-events.d.ts.map +0 -1
- package/dist/parsing/events/to-value-events.js +0 -194
- package/dist/parsing/events/to-value-events.js.map +0 -1
- package/dist/parsing/scope.d.ts +0 -90
- package/dist/parsing/scope.d.ts.map +0 -1
- package/dist/parsing/scope.js +0 -669
- package/dist/parsing/scope.js.map +0 -1
- package/dist/parsing/theme.d.ts +0 -3
- package/dist/parsing/theme.d.ts.map +0 -1
- package/dist/parsing/theme.js +0 -87
- package/dist/parsing/theme.js.map +0 -1
- package/dist/refactor-jsx.d.ts +0 -28
- package/dist/refactor-jsx.d.ts.map +0 -1
- package/dist/refactor-jsx.js +0 -77
- package/dist/refactor-jsx.js.map +0 -1
- package/dist/routing.d.ts +0 -6
- package/dist/routing.d.ts.map +0 -1
- package/dist/routing.js +0 -76
- package/dist/routing.js.map +0 -1
- package/dist/sb-scope-manager.d.ts +0 -102
- package/dist/sb-scope-manager.d.ts.map +0 -1
- package/dist/sb-scope-manager.js +0 -507
- package/dist/sb-scope-manager.js.map +0 -1
- package/dist/sync-service/server-rpc/client.d.ts +0 -13
- package/dist/sync-service/server-rpc/client.d.ts.map +0 -1
- package/dist/sync-service/server-rpc/client.js +0 -65
- package/dist/sync-service/server-rpc/client.js.map +0 -1
- package/dist/sync-service/server-rpc/handlers.d.ts +0 -3
- package/dist/sync-service/server-rpc/handlers.d.ts.map +0 -1
- package/dist/sync-service/server-rpc/handlers.js.map +0 -1
- package/dist/util/tracing.d.ts +0 -4
- package/dist/util/tracing.d.ts.map +0 -1
- package/dist/util/tracing.js +0 -56
- package/dist/util/tracing.js.map +0 -1
- /package/dist/ai-service/{integrations → agent/subagents/apis}/types.js +0 -0
- /package/dist/{sync-service/server-rpc → server-rpc}/handlers.js +0 -0
|
@@ -0,0 +1,1666 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { performance } from "node:perf_hooks";
|
|
3
|
+
import { setImmediate } from "node:timers/promises";
|
|
4
|
+
import { getErrorMeta, getPrefixedLogger } from "../../../util/logger.js";
|
|
5
|
+
import { LLMObsTracer } from "../../llmobs/tracer.js";
|
|
6
|
+
import { findBreakpoints } from "./caching.js";
|
|
7
|
+
import { SERVER_COMPACTION_INTERRUPTED_SUMMARY, SERVER_COMPACTION_SUMMARY, ServerSideCompactionStrategy, } from "./compaction/server-side.js";
|
|
8
|
+
import { compactionThresholdTokens, DEFAULT_CACHING, resolveContextOptionsV2, } from "./config.js";
|
|
9
|
+
import { recordContextPersist, recordPreflightCompaction, recordServerCompaction, recordTurnsSinceLastCompaction, } from "./context-metrics.js";
|
|
10
|
+
import { OperationQueue } from "./operation-queue.js";
|
|
11
|
+
import { CLIENT_COMPACTION_MARKER } from "./storage/event-types.js";
|
|
12
|
+
import { estimateMessagesTokens, getTotalInputTokens, } from "./token-tracker.js";
|
|
13
|
+
import { toStoredMessage, toSdkMessages, CACHE_BREAKPOINT_PROVIDER_OPTIONS, normalizeToolMessage, stripUndefinedFromToolOutputs, repairBrokenToolCalls, repairOrphanedToolResults, enforceToolUsePairing, normalizeReasoningProviderOptions, stripUnsignedReasoning, stripTrailingAssistantPrefill, extractTokenUsage, } from "./types.js";
|
|
14
|
+
import { uniquifyFilePartFilenames } from "./uniquify-filenames.js";
|
|
15
|
+
import { makeJsonSafeValue } from "./well-formed-text.js";
|
|
16
|
+
const logger = getPrefixedLogger("[context-v2]");
|
|
17
|
+
/**
|
|
18
|
+
* Persists slower than this get a warning log with the message count.
|
|
19
|
+
* Diagnostic threshold for APPS-4690: large-history apps can cross it on
|
|
20
|
+
* every turn (each response rewrites the full context file), so treat it as
|
|
21
|
+
* a signal that the context is oversized, not as a per-occurrence alert.
|
|
22
|
+
* Raise or remove once per-turn full-file rewrites are addressed.
|
|
23
|
+
*/
|
|
24
|
+
const SLOW_PERSIST_WARN_MS = 500;
|
|
25
|
+
/**
|
|
26
|
+
* Deadline for the pre-flight oversize compaction pass.
|
|
27
|
+
*
|
|
28
|
+
* Sits just above the summarizer's own per-call budget
|
|
29
|
+
* (`DEFAULT_COMPACTION_SUMMARY_TIMEOUT_MS`, 240s) so the deadline stops firing
|
|
30
|
+
* before the work it is waiting on can even finish.
|
|
31
|
+
*
|
|
32
|
+
* Picked from production rather than from taste. Measured over the four weeks
|
|
33
|
+
* to 2026-09-01, client-side compaction
|
|
34
|
+
* (`superblocks.clark.context.server_compaction.duration_seconds`, filtered to
|
|
35
|
+
* `path:client`) ran 6,690 times with a mean of 36.8s, an hourly-worst-case p99
|
|
36
|
+
* of 238.7s, and a peak of 382.8s. The earlier 120s value sat under the p90 of
|
|
37
|
+
* the hourly maxima, so it abandoned passes that would have succeeded on
|
|
38
|
+
* exactly the largest histories, which are the ones this check exists to
|
|
39
|
+
* rescue. Even 250s does not cover the peak; a pass past it degrades to the
|
|
40
|
+
* provider rejecting the request, reported as `context_too_large`.
|
|
41
|
+
*
|
|
42
|
+
* A longer deadline is only affordable because of the latch. Without
|
|
43
|
+
* `oversizeCompactionExhausted` a doomed pass would be restarted on every
|
|
44
|
+
* prompt, so the wait would be paid per message rather than once per
|
|
45
|
+
* conversation.
|
|
46
|
+
*
|
|
47
|
+
* `compact()` accepts no abort signal, so a pass past its deadline is abandoned
|
|
48
|
+
* rather than cancelled and keeps running (and billing) in the background.
|
|
49
|
+
* `oversizeCompactionSettled` is what keeps a sibling pass out while that
|
|
50
|
+
* orphan is live; raising this value without real cancellation lengthens the
|
|
51
|
+
* orphan window it has to cover.
|
|
52
|
+
*/
|
|
53
|
+
export const PREFLIGHT_COMPACTION_TIMEOUT_MS = 250_000;
|
|
54
|
+
/** Thrown by `withDeadline` so a slow pass can be told apart from a broken one. */
|
|
55
|
+
class DeadlineExceededError extends Error {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolve `promise`, or reject once `timeoutMs` elapses.
|
|
59
|
+
*
|
|
60
|
+
* Deliberately local rather than reusing `withRpcTimeout`: that helper logs
|
|
61
|
+
* "RPC timed out", which would misdirect anyone triaging a summarizer stall.
|
|
62
|
+
*/
|
|
63
|
+
async function withDeadline(promise, timeoutMs) {
|
|
64
|
+
let timeoutId;
|
|
65
|
+
try {
|
|
66
|
+
return await Promise.race([
|
|
67
|
+
promise,
|
|
68
|
+
new Promise((_resolve, reject) => {
|
|
69
|
+
timeoutId = setTimeout(() => reject(new DeadlineExceededError(`compaction did not settle within ${timeoutMs}ms`)), timeoutMs);
|
|
70
|
+
}),
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
if (timeoutId !== undefined) {
|
|
75
|
+
clearTimeout(timeoutId);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Which family a compaction strategy belongs to.
|
|
81
|
+
*
|
|
82
|
+
* Read by instance rather than from a field on the interface: there are exactly
|
|
83
|
+
* two implementations, `ServerSideCompactionStrategy` is already imported here,
|
|
84
|
+
* and a `kind` member would have to be added to every strategy and every test
|
|
85
|
+
* mock to answer the same question.
|
|
86
|
+
*/
|
|
87
|
+
function compactionStrategyKind(strategy) {
|
|
88
|
+
return strategy instanceof ServerSideCompactionStrategy ? "server" : "client";
|
|
89
|
+
}
|
|
90
|
+
/** Messages replayed between explicit event-loop yields in initializeWith. */
|
|
91
|
+
const REPLAY_YIELD_INTERVAL = 100;
|
|
92
|
+
/**
|
|
93
|
+
* Usage attributed to messages replayed from history (no live usage data).
|
|
94
|
+
* Token accounting is intentionally zeroed for replayed messages — the first
|
|
95
|
+
* real response after replay restores accurate cumulative tracking via
|
|
96
|
+
* `getLastKnownInputTokens` monotonicity.
|
|
97
|
+
*/
|
|
98
|
+
const ZERO_USAGE = {
|
|
99
|
+
inputTokens: 0,
|
|
100
|
+
outputTokens: 0,
|
|
101
|
+
totalTokens: 0,
|
|
102
|
+
inputTokenDetails: {
|
|
103
|
+
noCacheTokens: 0,
|
|
104
|
+
cacheReadTokens: 0,
|
|
105
|
+
cacheWriteTokens: 0,
|
|
106
|
+
},
|
|
107
|
+
outputTokenDetails: {
|
|
108
|
+
textTokens: 0,
|
|
109
|
+
reasoningTokens: 0,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Whether an assistant message contains `tool-call` content parts whose
|
|
114
|
+
* matching `tool-result` messages have not been stored yet. Used by
|
|
115
|
+
* `runCompactionIfNeeded` to defer compaction past the assistant turn that
|
|
116
|
+
* produced the call until the tool result arrives (otherwise the assistant
|
|
117
|
+
* tool_use gets summarized away and the upcoming tool_result is orphaned).
|
|
118
|
+
*/
|
|
119
|
+
function hasPendingToolCalls(msg) {
|
|
120
|
+
if (msg.role !== "assistant" || !Array.isArray(msg.content)) {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
return msg.content.some((part) => typeof part === "object" &&
|
|
124
|
+
part !== null &&
|
|
125
|
+
"type" in part &&
|
|
126
|
+
part.type === "tool-call");
|
|
127
|
+
}
|
|
128
|
+
/** Check if a tool message contains an unstripped screenshot media result. */
|
|
129
|
+
function hasScreenshotMedia(msg) {
|
|
130
|
+
if (msg.role !== "tool" || !Array.isArray(msg.content)) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return msg.content.some((part) => typeof part === "object" &&
|
|
134
|
+
part !== null &&
|
|
135
|
+
"type" in part &&
|
|
136
|
+
part.type === "tool-result" &&
|
|
137
|
+
"toolName" in part &&
|
|
138
|
+
part.toolName === "build_captureScreenshot" &&
|
|
139
|
+
"output" in part &&
|
|
140
|
+
part.output?.type === "content");
|
|
141
|
+
}
|
|
142
|
+
function isUiOnlyToolChatRow(message) {
|
|
143
|
+
if (message.role !== "assistant" || typeof message.content !== "string") {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const row = message;
|
|
147
|
+
return (typeof row.toolCallId === "string" &&
|
|
148
|
+
(row.type === "tool" ||
|
|
149
|
+
row.type === "tool-result" ||
|
|
150
|
+
row.type === "tool-error"));
|
|
151
|
+
}
|
|
152
|
+
/** Strip base64 media from screenshot tool results, replacing with a text placeholder. */
|
|
153
|
+
function stripScreenshotMediaFromToolMessage(msg) {
|
|
154
|
+
if (msg.role !== "tool" || !Array.isArray(msg.content)) {
|
|
155
|
+
return msg;
|
|
156
|
+
}
|
|
157
|
+
let modified = false;
|
|
158
|
+
const strippedContent = msg.content.map((part) => {
|
|
159
|
+
if (typeof part === "object" &&
|
|
160
|
+
part !== null &&
|
|
161
|
+
"type" in part &&
|
|
162
|
+
part.type === "tool-result" &&
|
|
163
|
+
"toolName" in part &&
|
|
164
|
+
part.toolName === "build_captureScreenshot" &&
|
|
165
|
+
"output" in part) {
|
|
166
|
+
const output = part.output;
|
|
167
|
+
if (output &&
|
|
168
|
+
typeof output === "object" &&
|
|
169
|
+
"type" in output &&
|
|
170
|
+
output.type === "content") {
|
|
171
|
+
modified = true;
|
|
172
|
+
return {
|
|
173
|
+
...part,
|
|
174
|
+
output: {
|
|
175
|
+
type: "text",
|
|
176
|
+
value: "[screenshot captured]",
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return part;
|
|
182
|
+
});
|
|
183
|
+
if (!modified) {
|
|
184
|
+
return msg;
|
|
185
|
+
}
|
|
186
|
+
logger.info("Stripped screenshot media from tool message before storage");
|
|
187
|
+
return { ...msg, content: strippedContent };
|
|
188
|
+
}
|
|
189
|
+
export class ContextV2 {
|
|
190
|
+
systemPrompt;
|
|
191
|
+
messages = [];
|
|
192
|
+
attachments;
|
|
193
|
+
config;
|
|
194
|
+
caching;
|
|
195
|
+
queue = new OperationQueue();
|
|
196
|
+
onPersist;
|
|
197
|
+
tracer;
|
|
198
|
+
rootDir;
|
|
199
|
+
skillsNeedReload = false;
|
|
200
|
+
readSystemSkills = new Set();
|
|
201
|
+
getModeState;
|
|
202
|
+
/**
|
|
203
|
+
* Real provider usage captured when `runCompactionIfNeeded` defers past an
|
|
204
|
+
* assistant turn with pending tool calls. Consumed (one-shot) by the check
|
|
205
|
+
* that closes the deferral if that message arrives with zeroed placeholder
|
|
206
|
+
* usage — the tool-permission flow does exactly that (ENG-4792). In-memory
|
|
207
|
+
* only: if the context is recreated mid-deferral, the check degrades to the
|
|
208
|
+
* strategy's existing zero-usage skip.
|
|
209
|
+
*/
|
|
210
|
+
deferredCompactionUsage;
|
|
211
|
+
eventStore;
|
|
212
|
+
contextId;
|
|
213
|
+
metricIdentity;
|
|
214
|
+
compaction;
|
|
215
|
+
compactionCallbacks;
|
|
216
|
+
serverCompactionMessageId;
|
|
217
|
+
activeServerCompactionGeneration;
|
|
218
|
+
activeServerCompactionStartedAt;
|
|
219
|
+
endedServerCompactionGeneration;
|
|
220
|
+
serverCompactionGeneration = 0;
|
|
221
|
+
// Set when a compaction completion is synthesized before its text-start
|
|
222
|
+
// chunk arrives (reversed event ordering). The completion already rendered a
|
|
223
|
+
// full start+complete row, so the late start belongs to that same compaction
|
|
224
|
+
// and must be swallowed instead of opening a second, never-completed row.
|
|
225
|
+
// Scoped to the current turn; cleared when the next user message begins.
|
|
226
|
+
serverCompactionCompletedBeforeStart = false;
|
|
227
|
+
completedTurnCount = 0;
|
|
228
|
+
lastCompactionAtTurnIndex = 0;
|
|
229
|
+
// When disposed, this context may still be referenced by in-flight streams.
|
|
230
|
+
// Keep it inert so stale generations cannot persist cleared history.
|
|
231
|
+
isDisposed = false;
|
|
232
|
+
/** Shared by concurrent callers so only one oversize pass ever runs. */
|
|
233
|
+
oversizeCompactionInFlight;
|
|
234
|
+
/**
|
|
235
|
+
* Largest `extraInputTokens` any caller attached to the in-flight pass.
|
|
236
|
+
*
|
|
237
|
+
* Callers sharing a pass can have sized different tool surfaces, and the
|
|
238
|
+
* shared promise would otherwise silently decide on whichever one happened to
|
|
239
|
+
* start it. Max fails safe: under-counting skips a compaction the request
|
|
240
|
+
* needed, over-counting only runs one it could have skipped. Read when the
|
|
241
|
+
* queued callback actually runs, so anything attaching before then counts.
|
|
242
|
+
*
|
|
243
|
+
* Defensive rather than an observed bug: both callers have to be on the SAME
|
|
244
|
+
* ContextV2, and the nested one-shot path uses `context: { mode: "stateless" }`,
|
|
245
|
+
* so it never shares this instance.
|
|
246
|
+
*/
|
|
247
|
+
oversizeCompactionExtraTokens = 0;
|
|
248
|
+
/**
|
|
249
|
+
* The summarizer call itself, unbounded by the deadline the caller waits on.
|
|
250
|
+
* `compactIfOversized` holds the in-flight guard until this settles, so an
|
|
251
|
+
* abandoned `compact()` cannot run alongside a fresh pass.
|
|
252
|
+
*/
|
|
253
|
+
oversizeCompactionSettled;
|
|
254
|
+
/**
|
|
255
|
+
* Set once a pass has ended with the payload STILL over the threshold, for
|
|
256
|
+
* any reason: the strategy declined, the pass threw, the deadline rejected,
|
|
257
|
+
* or it ran and reclaimed too little. While set, `compactIfOversized` returns
|
|
258
|
+
* immediately and starts no new paid pass.
|
|
259
|
+
*
|
|
260
|
+
* The restore-time version of this check got the same protection for free,
|
|
261
|
+
* because `ContextManagerV2` only invoked it while a pending flag was set and
|
|
262
|
+
* a pass that tried and failed never re-flagged. Moving the check onto every
|
|
263
|
+
* `streamText` dropped that, so a summarizer that hangs would stall every
|
|
264
|
+
* later prompt for the full deadline and stack concurrent billable
|
|
265
|
+
* summarizations over the same history. The provider rejecting an oversized
|
|
266
|
+
* request takes ~130ms; this took two minutes per prompt. Worse than the
|
|
267
|
+
* wedge it exists to fix.
|
|
268
|
+
*
|
|
269
|
+
* Deliberately NOT cleared when a pass succeeds and the payload now fits, so
|
|
270
|
+
* later regrowth can still be rescued. Reset only in `setCompactionStrategy`:
|
|
271
|
+
* a different strategy is the one real change that could produce a different
|
|
272
|
+
* outcome, and New Chat resets it for free by constructing a fresh instance.
|
|
273
|
+
*/
|
|
274
|
+
oversizeCompactionExhausted = false;
|
|
275
|
+
// Persists currently mid-flight. A persist that has already passed the
|
|
276
|
+
// dispose guard is committed to writing the snapshot, so `dispose()` alone
|
|
277
|
+
// cannot stop it; `drainPersists()` lets a caller that is about to overwrite
|
|
278
|
+
// the snapshot (checkpoint restore) wait for those writes to land first.
|
|
279
|
+
inFlightPersists = new Set();
|
|
280
|
+
constructor(options) {
|
|
281
|
+
this.rootDir = options.rootDir;
|
|
282
|
+
this.config = resolveContextOptionsV2(options.config);
|
|
283
|
+
this.caching = { ...DEFAULT_CACHING, ...options.caching };
|
|
284
|
+
this.onPersist = options.onPersist;
|
|
285
|
+
this.tracer = options.tracer;
|
|
286
|
+
this.getModeState = options.getModeState;
|
|
287
|
+
this.eventStore = options.eventStore;
|
|
288
|
+
this.contextId = options.contextId;
|
|
289
|
+
this.metricIdentity = options.metricIdentity;
|
|
290
|
+
this.compaction = options.compaction ?? new ServerSideCompactionStrategy();
|
|
291
|
+
}
|
|
292
|
+
// Cached result of getMessages() normalization. Avoids recomputing
|
|
293
|
+
// 10+ repair/normalization passes when messages haven't changed.
|
|
294
|
+
// Invalidated by any operation that modifies this.messages or systemPrompt.
|
|
295
|
+
// NOTE: Returns a shallow copy of the cached array. Element references are
|
|
296
|
+
// shared — callers must treat returned message objects as read-only.
|
|
297
|
+
_cachedMessages = null;
|
|
298
|
+
/**
|
|
299
|
+
* Call this before AND after every operation that modifies `this.messages`
|
|
300
|
+
* or `this.systemPrompt`. Pre-enqueue call prevents fast-path cache hits
|
|
301
|
+
* while the mutation is queued; post-mutation call handles the scenario where
|
|
302
|
+
* a `getMessages()` queue op ran and cached a result between enqueue and
|
|
303
|
+
* execution.
|
|
304
|
+
*
|
|
305
|
+
* CHECKLIST for new mutation methods:
|
|
306
|
+
* - Synchronous mutations: call once after the mutation.
|
|
307
|
+
* - Async queue mutations: call once before enqueue, once after the mutation
|
|
308
|
+
* inside the queue op.
|
|
309
|
+
*/
|
|
310
|
+
invalidateMessageCache() {
|
|
311
|
+
this._cachedMessages = null;
|
|
312
|
+
}
|
|
313
|
+
updateConfig(config) {
|
|
314
|
+
this.config = resolveContextOptionsV2({ ...this.config, ...config });
|
|
315
|
+
this.invalidateMessageCache();
|
|
316
|
+
this.compaction.updateConfig(config);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Swap the active compaction strategy on a live context. Called from
|
|
320
|
+
* `ContextManagerV2.getOrCreateContext` on a cache hit when the
|
|
321
|
+
* incoming `contextManagement` selection (derived from the per-request
|
|
322
|
+
* LD flag) differs from whatever the cached context was first
|
|
323
|
+
* constructed with. Without this, the first caller's strategy locks
|
|
324
|
+
* in for the lifetime of the cache entry and the kill-switch flag
|
|
325
|
+
* silently no-ops.
|
|
326
|
+
*/
|
|
327
|
+
setCompactionStrategy(strategy) {
|
|
328
|
+
if (this.compaction === strategy)
|
|
329
|
+
return;
|
|
330
|
+
const previousKind = compactionStrategyKind(this.compaction);
|
|
331
|
+
this.compaction = strategy;
|
|
332
|
+
this.compaction.updateConfig(this.config);
|
|
333
|
+
this.compaction.setCallbacks(this.compactionCallbacks);
|
|
334
|
+
// Only a change of KIND clears the latch, not any swap.
|
|
335
|
+
//
|
|
336
|
+
// `buildCompactionStrategy` returns a fresh instance every time and the
|
|
337
|
+
// manager calls this on every managed turn, so the reference guard above
|
|
338
|
+
// never short-circuits in production. Clearing on any swap therefore
|
|
339
|
+
// cleared the latch on every single prompt, which made it do nothing and
|
|
340
|
+
// put the per-prompt stall straight back. Kind is the thing that actually
|
|
341
|
+
// changes the answer: the `ai.server-context-management.options` kill
|
|
342
|
+
// switch flipping a latched server-side context over to a client-side one
|
|
343
|
+
// is a genuine second chance, another client instance is not.
|
|
344
|
+
if (compactionStrategyKind(strategy) !== previousKind) {
|
|
345
|
+
this.oversizeCompactionExhausted = false;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
setMetricIdentity(identity) {
|
|
349
|
+
this.metricIdentity = identity;
|
|
350
|
+
}
|
|
351
|
+
dispose() {
|
|
352
|
+
this.isDisposed = true;
|
|
353
|
+
this.onPersist = undefined;
|
|
354
|
+
}
|
|
355
|
+
storeSummary(toolCallId, summary) {
|
|
356
|
+
this.compaction.storeSummary(toolCallId, summary);
|
|
357
|
+
}
|
|
358
|
+
setCompactionCallbacks(callbacks) {
|
|
359
|
+
this.compactionCallbacks = callbacks;
|
|
360
|
+
this.compaction.setCallbacks(callbacks);
|
|
361
|
+
}
|
|
362
|
+
onServerCompactionStarted() {
|
|
363
|
+
if (this.serverCompactionCompletedBeforeStart) {
|
|
364
|
+
this.serverCompactionCompletedBeforeStart = false;
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (!this.serverCompactionMessageId) {
|
|
368
|
+
this.activeServerCompactionStartedAt = performance.now();
|
|
369
|
+
}
|
|
370
|
+
this.ensureServerCompactionMessageStarted();
|
|
371
|
+
}
|
|
372
|
+
onServerCompactionCancelled() {
|
|
373
|
+
if (!this.serverCompactionMessageId) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
this.recordServerCompactionOutcome("cancelled");
|
|
377
|
+
this.endedServerCompactionGeneration =
|
|
378
|
+
this.activeServerCompactionGeneration;
|
|
379
|
+
this.compactionCallbacks?.onCompactionCancel?.("phase2", this.serverCompactionMessageId);
|
|
380
|
+
this.serverCompactionMessageId = undefined;
|
|
381
|
+
this.activeServerCompactionGeneration = undefined;
|
|
382
|
+
this.activeServerCompactionStartedAt = undefined;
|
|
383
|
+
}
|
|
384
|
+
onServerCompactionInterrupted() {
|
|
385
|
+
if (!this.serverCompactionMessageId) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.recordServerCompactionOutcome("interrupted");
|
|
389
|
+
const messageId = this.serverCompactionMessageId;
|
|
390
|
+
const generation = this.activeServerCompactionGeneration;
|
|
391
|
+
this.compactionCallbacks?.onCompactionComplete?.("phase2", messageId, SERVER_COMPACTION_INTERRUPTED_SUMMARY);
|
|
392
|
+
if (generation !== undefined) {
|
|
393
|
+
this.endedServerCompactionGeneration = generation;
|
|
394
|
+
}
|
|
395
|
+
this.serverCompactionMessageId = undefined;
|
|
396
|
+
this.activeServerCompactionGeneration = undefined;
|
|
397
|
+
this.activeServerCompactionStartedAt = undefined;
|
|
398
|
+
}
|
|
399
|
+
markSkillsNeedReload() {
|
|
400
|
+
this.skillsNeedReload = true;
|
|
401
|
+
this.readSystemSkills.clear();
|
|
402
|
+
}
|
|
403
|
+
checkAndClearSkillsNeedReload() {
|
|
404
|
+
if (this.skillsNeedReload) {
|
|
405
|
+
this.skillsNeedReload = false;
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
hasReadSystemSkill(path) {
|
|
411
|
+
return this.readSystemSkills.has(path);
|
|
412
|
+
}
|
|
413
|
+
markSystemSkillRead(path) {
|
|
414
|
+
this.readSystemSkills.add(path);
|
|
415
|
+
}
|
|
416
|
+
setAttachments(attachments) {
|
|
417
|
+
this.attachments = attachments;
|
|
418
|
+
void this.persist("attachments");
|
|
419
|
+
}
|
|
420
|
+
getAttachments() {
|
|
421
|
+
return this.attachments;
|
|
422
|
+
}
|
|
423
|
+
truncateAfterTimestamp(timestamp) {
|
|
424
|
+
this.invalidateMessageCache();
|
|
425
|
+
this.readSystemSkills.clear();
|
|
426
|
+
void this.queue.enqueue(async () => {
|
|
427
|
+
const initialCount = this.messages.length;
|
|
428
|
+
this.messages = this.messages.filter((msg) => !msg._superblocks?.timestamp ||
|
|
429
|
+
msg._superblocks.timestamp <= timestamp);
|
|
430
|
+
this.readSystemSkills.clear();
|
|
431
|
+
this.invalidateMessageCache();
|
|
432
|
+
const removed = initialCount - this.messages.length;
|
|
433
|
+
logger.info(`Truncated context after timestamp ${timestamp}. Removed ${removed} messages, ${this.messages.length} remaining.`);
|
|
434
|
+
await this.persist("truncate");
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
static fromRecord(record, options) {
|
|
438
|
+
const context = new ContextV2(options);
|
|
439
|
+
context.messages = record.messages;
|
|
440
|
+
context.attachments = record.attachments;
|
|
441
|
+
// Live sessions keep media on only the newest screenshot, but event-log
|
|
442
|
+
// entries are appended before that stripping happens, so a restored
|
|
443
|
+
// record can resurrect every screenshot's media. Re-stripping here keeps
|
|
444
|
+
// the restored request bytes identical to what the provider's prompt
|
|
445
|
+
// cache saw before the restart (APPS-4751) — and avoids re-sending
|
|
446
|
+
// megabytes of stale base64.
|
|
447
|
+
context.stripAllButLatestScreenshot();
|
|
448
|
+
return context;
|
|
449
|
+
}
|
|
450
|
+
toRecord() {
|
|
451
|
+
return {
|
|
452
|
+
version: 2,
|
|
453
|
+
messages: this.messages,
|
|
454
|
+
attachments: this.attachments,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
setSystemPrompt(prompt) {
|
|
458
|
+
this.systemPrompt = toStoredMessage(prompt);
|
|
459
|
+
this.invalidateMessageCache();
|
|
460
|
+
}
|
|
461
|
+
async addUserMessage(message) {
|
|
462
|
+
this.serverCompactionCompletedBeforeStart = false;
|
|
463
|
+
this.endedServerCompactionGeneration = undefined;
|
|
464
|
+
this.invalidateMessageCache();
|
|
465
|
+
return this.queue.enqueue(async () => {
|
|
466
|
+
const storedMessage = toStoredMessage(message);
|
|
467
|
+
this.messages.push(storedMessage);
|
|
468
|
+
this.invalidateMessageCache();
|
|
469
|
+
await this.appendEvent("prompt_sent", storedMessage);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Replay a full message history into an empty context (cold-pod session
|
|
474
|
+
* restore). Unlike per-turn `addUserMessage`/`addResponse`, this persists
|
|
475
|
+
* exactly once at the end: persisting per replayed message serializes the
|
|
476
|
+
* entire accumulated context each time — O(n²) work that blocks the event
|
|
477
|
+
* loop for minutes at large history sizes (APPS-4690).
|
|
478
|
+
*
|
|
479
|
+
* Must only be called on an empty context. Replaying on top of messages
|
|
480
|
+
* loaded from storage would silently duplicate the conversation (and, for
|
|
481
|
+
* persistent contexts, re-append every message to the event log).
|
|
482
|
+
*/
|
|
483
|
+
async initializeWith(messages) {
|
|
484
|
+
this.invalidateMessageCache();
|
|
485
|
+
const tracer = this.tracer ?? LLMObsTracer.instance;
|
|
486
|
+
return tracer.trace({ kind: "task", name: "context.replay" }, (span) => this.replayMessages(messages, tracer, span));
|
|
487
|
+
}
|
|
488
|
+
async replayMessages(messages, tracer, span) {
|
|
489
|
+
const enqueuedAt = performance.now();
|
|
490
|
+
let replayMs = 0;
|
|
491
|
+
await this.queue.enqueue(async () => {
|
|
492
|
+
const replayStartedAt = performance.now();
|
|
493
|
+
if (this.messages.length > 0) {
|
|
494
|
+
logger.warn(`initializeWith called on a non-empty context (${this.messages.length} existing messages); appending — this likely duplicates history`);
|
|
495
|
+
}
|
|
496
|
+
for (let i = 0; i < messages.length; i++) {
|
|
497
|
+
// Without an event store (ephemeral contexts) nothing below awaits
|
|
498
|
+
// real I/O, so the whole replay runs as one synchronous block; yield
|
|
499
|
+
// periodically so timers, sockets, and heartbeats can run.
|
|
500
|
+
if (i > 0 && i % REPLAY_YIELD_INTERVAL === 0) {
|
|
501
|
+
await setImmediate();
|
|
502
|
+
}
|
|
503
|
+
const message = messages[i];
|
|
504
|
+
if (!message) {
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
if (isUiOnlyToolChatRow(message)) {
|
|
508
|
+
logger.warn(`initializeWith: dropped UI-only tool chat row at index ${i}; type=${message.type}; toolCallId=${message.toolCallId}; tool=${message.tool ?? "unknown"}`);
|
|
509
|
+
continue;
|
|
510
|
+
}
|
|
511
|
+
if (message.role === "system") {
|
|
512
|
+
// Last system message wins; an explicit setSystemPrompt() after
|
|
513
|
+
// initializeWith() still takes precedence because it runs later.
|
|
514
|
+
this.systemPrompt = toStoredMessage(message);
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
if (message.role === "user") {
|
|
518
|
+
const storedMessage = toStoredMessage(message);
|
|
519
|
+
this.messages.push(storedMessage);
|
|
520
|
+
await this.appendEvent("prompt_sent", storedMessage);
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
const storedResponse = this.ingestResponse(message, ZERO_USAGE, {
|
|
524
|
+
stripOlderScreenshots: false,
|
|
525
|
+
});
|
|
526
|
+
const eventUsage = message.role === "assistant"
|
|
527
|
+
? extractTokenUsage(ZERO_USAGE)
|
|
528
|
+
: undefined;
|
|
529
|
+
await this.appendEvent("response_received", storedResponse, eventUsage);
|
|
530
|
+
}
|
|
531
|
+
this.stripAllButLatestScreenshot();
|
|
532
|
+
this.invalidateMessageCache();
|
|
533
|
+
await this.persist("replay");
|
|
534
|
+
replayMs = Math.round(performance.now() - replayStartedAt);
|
|
535
|
+
});
|
|
536
|
+
// queueWaitMs separates queue contention from replay work so a slow
|
|
537
|
+
// number here points at the right culprit (APPS-4690 diagnosis log).
|
|
538
|
+
const queueWaitMs = Math.round(performance.now() - enqueuedAt) - replayMs;
|
|
539
|
+
tracer.annotate(span, {
|
|
540
|
+
metadata: { messageCount: messages.length, queueWaitMs, replayMs },
|
|
541
|
+
});
|
|
542
|
+
logger.info(`initializeWith: replayed ${messages.length} messages in ${replayMs}ms (queueWaitMs=${queueWaitMs})`);
|
|
543
|
+
}
|
|
544
|
+
async addResponse(response, usage) {
|
|
545
|
+
this.invalidateMessageCache();
|
|
546
|
+
await this.queue.enqueue(async () => {
|
|
547
|
+
const storedResponse = this.ingestResponse(response, usage, {
|
|
548
|
+
stripOlderScreenshots: true,
|
|
549
|
+
});
|
|
550
|
+
this.invalidateMessageCache();
|
|
551
|
+
if (response.role === "assistant" || response.role === "tool") {
|
|
552
|
+
const eventUsage = response.role === "assistant" ? extractTokenUsage(usage) : undefined;
|
|
553
|
+
await this.appendEvent("response_received", storedResponse, eventUsage);
|
|
554
|
+
}
|
|
555
|
+
await this.persist("response");
|
|
556
|
+
});
|
|
557
|
+
// After the queued write completes, give the compaction strategy a chance
|
|
558
|
+
// to react. Server-side is a no-op; client-side may compact this.messages
|
|
559
|
+
// and flip skillsNeedReload. Must be `await` (not `return`) because the
|
|
560
|
+
// earlier `await ... .enqueue(...)` already settles before we reach here
|
|
561
|
+
// — a `return` over the previous line would have made this unreachable.
|
|
562
|
+
await this.runCompactionIfNeeded(response, usage);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Commit a whole step's responses into the conversation.
|
|
566
|
+
*
|
|
567
|
+
* The streaming path (`ContextObserver` → adapter `endStep`) used to call
|
|
568
|
+
* {@link addResponse} once per response message, and every call rewrote the
|
|
569
|
+
* entire context file (an O(history) synchronous `JSON.stringify`). On
|
|
570
|
+
* large-history apps that repeated full-record rewrite blocked the event
|
|
571
|
+
* loop for seconds *per message* mid-generation — the wedge in APPS-4690.
|
|
572
|
+
*
|
|
573
|
+
* This commits the step's messages without a full-record rewrite: each
|
|
574
|
+
* message is appended to the event log (an O(1) append that carries
|
|
575
|
+
* per-message durability), and the legacy full-record snapshot is deferred
|
|
576
|
+
* to {@link endTurn} so the whole generation costs one rewrite instead of
|
|
577
|
+
* one per message. Screenshot-media stripping is likewise deferred to a
|
|
578
|
+
* single backward pass (mirroring {@link initializeWith}) instead of an
|
|
579
|
+
* O(history) scan per message.
|
|
580
|
+
*/
|
|
581
|
+
async addResponses(responses, usage) {
|
|
582
|
+
if (responses.length === 0) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
this.invalidateMessageCache();
|
|
586
|
+
await this.queue.enqueue(async () => {
|
|
587
|
+
for (const response of responses) {
|
|
588
|
+
const storedResponse = this.ingestResponse(response, usage, {
|
|
589
|
+
stripOlderScreenshots: false,
|
|
590
|
+
});
|
|
591
|
+
if (response.role === "assistant" || response.role === "tool") {
|
|
592
|
+
const eventUsage = response.role === "assistant"
|
|
593
|
+
? extractTokenUsage(usage)
|
|
594
|
+
: undefined;
|
|
595
|
+
await this.appendEvent("response_received", storedResponse, eventUsage);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
this.stripAllButLatestScreenshot();
|
|
599
|
+
this.invalidateMessageCache();
|
|
600
|
+
});
|
|
601
|
+
// Compaction runs once after the step is committed. It inspects the whole
|
|
602
|
+
// message array and only acts when no tool calls are pending, so a single
|
|
603
|
+
// post-batch call preserves the per-message deferral behavior. When it does
|
|
604
|
+
// compact it persists the (smaller) compacted record itself.
|
|
605
|
+
const lastResponse = responses[responses.length - 1];
|
|
606
|
+
if (lastResponse) {
|
|
607
|
+
await this.runCompactionIfNeeded(lastResponse, usage);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Begin a user turn. Resets per-turn compaction state (the re-arm latch) so
|
|
612
|
+
* a fresh turn's first compaction is unguarded. Called by the
|
|
613
|
+
* adapter's startTurn, once per managed generation (see LLMClient.streamText).
|
|
614
|
+
*/
|
|
615
|
+
startTurn() {
|
|
616
|
+
this.compaction.onTurnStart();
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Persist the full record once, at the end of a generation.
|
|
620
|
+
*
|
|
621
|
+
* Per-step {@link addResponses} no longer rewrites the whole context file
|
|
622
|
+
* (APPS-4690); this single end-of-turn snapshot keeps the legacy `main.json`
|
|
623
|
+
* (attachments + the checkpoint/Bucketeer snapshot) reasonably fresh while
|
|
624
|
+
* per-message durability is carried by the event log. Enqueued so it
|
|
625
|
+
* serializes behind any in-flight step commit.
|
|
626
|
+
*/
|
|
627
|
+
async endTurn() {
|
|
628
|
+
await this.queue.enqueue(async () => {
|
|
629
|
+
this.completedTurnCount += 1;
|
|
630
|
+
await this.persist("turn_end");
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
recordInterCompactionTurnInterval() {
|
|
634
|
+
const turnsSince = this.completedTurnCount - this.lastCompactionAtTurnIndex;
|
|
635
|
+
if (turnsSince > 0) {
|
|
636
|
+
recordTurnsSinceLastCompaction(turnsSince);
|
|
637
|
+
}
|
|
638
|
+
this.lastCompactionAtTurnIndex = this.completedTurnCount;
|
|
639
|
+
}
|
|
640
|
+
/** Store a single assistant/tool/other response message and return it. */
|
|
641
|
+
ingestResponse(response, usage, options) {
|
|
642
|
+
switch (response.role) {
|
|
643
|
+
case "assistant": {
|
|
644
|
+
// Total input tokens = non-cached + cached (prompt caching splits these)
|
|
645
|
+
const reportedInputTokens = getTotalInputTokens(usage);
|
|
646
|
+
// Ensure cumulative tokens never decrease - on cache misses, the LLM may
|
|
647
|
+
// report artificially low input tokens (just new tokens, not the full context).
|
|
648
|
+
// Use the higher of reported tokens or last known to maintain monotonicity.
|
|
649
|
+
const lastKnownTokens = this.getLastKnownInputTokens();
|
|
650
|
+
const cumulativeInputTokens = Math.max(reportedInputTokens, lastKnownTokens);
|
|
651
|
+
normalizeReasoningProviderOptions(response);
|
|
652
|
+
const extraMeta = this.compaction.collectAssistantMetadata(response) ?? {};
|
|
653
|
+
const storedResponse = toStoredMessage(response, {
|
|
654
|
+
cumulativeInputTokens,
|
|
655
|
+
tokenCount: usage.outputTokens,
|
|
656
|
+
...extraMeta,
|
|
657
|
+
});
|
|
658
|
+
this.messages.push(storedResponse);
|
|
659
|
+
return storedResponse;
|
|
660
|
+
}
|
|
661
|
+
case "tool": {
|
|
662
|
+
const normalized = normalizeToolMessage(stripUndefinedFromToolOutputs(response));
|
|
663
|
+
// Strip media from older screenshots so at most one is kept in stored
|
|
664
|
+
// messages. Bulk replay defers this to a single pass at the end.
|
|
665
|
+
if (options.stripOlderScreenshots && hasScreenshotMedia(normalized)) {
|
|
666
|
+
let strippedCount = 0;
|
|
667
|
+
for (let i = 0; i < this.messages.length; i++) {
|
|
668
|
+
const msg = this.messages[i];
|
|
669
|
+
if (msg && hasScreenshotMedia(msg)) {
|
|
670
|
+
this.messages[i] = stripScreenshotMediaFromToolMessage(msg);
|
|
671
|
+
strippedCount++;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
if (strippedCount > 0) {
|
|
675
|
+
logger.info(`Stripped media from ${strippedCount} older screenshot(s)`);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
const extraMeta = this.compaction.collectToolMetadata(normalized) ?? {};
|
|
679
|
+
const storedResponse = toStoredMessage(normalized, extraMeta);
|
|
680
|
+
this.messages.push(storedResponse);
|
|
681
|
+
return storedResponse;
|
|
682
|
+
}
|
|
683
|
+
default: {
|
|
684
|
+
const storedResponse = toStoredMessage(response);
|
|
685
|
+
this.messages.push(storedResponse);
|
|
686
|
+
return storedResponse;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
/** Single backwards pass keeping media on only the newest screenshot. */
|
|
691
|
+
stripAllButLatestScreenshot() {
|
|
692
|
+
let latestKept = false;
|
|
693
|
+
let strippedCount = 0;
|
|
694
|
+
for (let i = this.messages.length - 1; i >= 0; i--) {
|
|
695
|
+
const msg = this.messages[i];
|
|
696
|
+
if (!msg || !hasScreenshotMedia(msg)) {
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
if (!latestKept) {
|
|
700
|
+
latestKept = true;
|
|
701
|
+
continue;
|
|
702
|
+
}
|
|
703
|
+
this.messages[i] = stripScreenshotMediaFromToolMessage(msg);
|
|
704
|
+
strippedCount++;
|
|
705
|
+
}
|
|
706
|
+
if (strippedCount > 0) {
|
|
707
|
+
logger.info(`Stripped media from ${strippedCount} older screenshot(s)`);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Runs the configured compaction strategy after the most recent response
|
|
712
|
+
* has been stored. For the server-side strategy this is a no-op; for the
|
|
713
|
+
* client-side strategy it may replace `this.messages` with a compacted set
|
|
714
|
+
* and flip `skillsNeedReload`.
|
|
715
|
+
*
|
|
716
|
+
* Defers when `this.messages` ends in an assistant turn whose `tool_use`
|
|
717
|
+
* blocks haven't been matched by a `tool_result` message yet. Running
|
|
718
|
+
* compaction at that point would summarize the assistant message away;
|
|
719
|
+
* when the matching tool result arrives in the next step it would
|
|
720
|
+
* reference a `toolCallId` that no longer exists, and
|
|
721
|
+
* `repairOrphanedToolResults` would strip it on the next `getMessages`.
|
|
722
|
+
* Waiting for the tool result to arrive first means both halves of the
|
|
723
|
+
* pair are summarized together — no orphan.
|
|
724
|
+
*
|
|
725
|
+
* Triggered from both assistant and tool responses (drop the original
|
|
726
|
+
* assistant-only gate) so the deferred run can fire on the tool_result
|
|
727
|
+
* that closes out a step's pending tool calls.
|
|
728
|
+
*/
|
|
729
|
+
async runCompactionIfNeeded(response, usage) {
|
|
730
|
+
if (this.isDisposed)
|
|
731
|
+
return;
|
|
732
|
+
if (response.role !== "assistant" && response.role !== "tool")
|
|
733
|
+
return;
|
|
734
|
+
return this.queue.enqueue(async () => {
|
|
735
|
+
const last = this.messages[this.messages.length - 1];
|
|
736
|
+
if (!last)
|
|
737
|
+
return;
|
|
738
|
+
if (last.role === "assistant" && hasPendingToolCalls(last)) {
|
|
739
|
+
// Preserve the real measurement we are deferring on: the message that
|
|
740
|
+
// closes the pending call may arrive through a placeholder-usage path
|
|
741
|
+
// (the tool-permission flow appends a synthetic assistant/tool_result
|
|
742
|
+
// pair with zeroed usage), and the deferred check must not go blind at
|
|
743
|
+
// exactly the safe point the deferral was aiming for (ENG-4792).
|
|
744
|
+
if (getTotalInputTokens(usage) > 0) {
|
|
745
|
+
this.deferredCompactionUsage = usage;
|
|
746
|
+
}
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
let effectiveUsage = usage;
|
|
750
|
+
if (getTotalInputTokens(usage) === 0 &&
|
|
751
|
+
this.deferredCompactionUsage !== undefined) {
|
|
752
|
+
effectiveUsage = this.deferredCompactionUsage;
|
|
753
|
+
logger.info("Compaction check reusing usage deferred past pending tool calls", { inputContextTokens: getTotalInputTokens(effectiveUsage) });
|
|
754
|
+
}
|
|
755
|
+
// One-shot: the measurement is only valid for the check that closes the
|
|
756
|
+
// deferral. Clear it regardless of which usage this check ran with, so
|
|
757
|
+
// a stale value can never leak into unrelated later turns.
|
|
758
|
+
this.deferredCompactionUsage = undefined;
|
|
759
|
+
const result = await this.compaction.afterResponse({
|
|
760
|
+
messages: this.messages,
|
|
761
|
+
usage: effectiveUsage,
|
|
762
|
+
});
|
|
763
|
+
if (result.messages) {
|
|
764
|
+
this.recordInterCompactionTurnInterval();
|
|
765
|
+
// Retained assistant messages still carry pre-compaction
|
|
766
|
+
// `cumulativeInputTokens`. Mark them so the post-compaction floor
|
|
767
|
+
// resets (see `markPreCompactionBaselines` / `getLastKnownInputTokens`).
|
|
768
|
+
this.messages = this.markPreCompactionBaselines(result.messages);
|
|
769
|
+
this.invalidateMessageCache();
|
|
770
|
+
}
|
|
771
|
+
if (result.skillsNeedReload) {
|
|
772
|
+
this.skillsNeedReload = true;
|
|
773
|
+
this.readSystemSkills.clear();
|
|
774
|
+
}
|
|
775
|
+
if (result.eventLogAnchor && result.messages) {
|
|
776
|
+
// Append the marked messages so the reset survives reload from the
|
|
777
|
+
// event log (loadMessages), not just the in-memory record.
|
|
778
|
+
//
|
|
779
|
+
// Only phase-2 sets `eventLogAnchor` (it produces a new summary window).
|
|
780
|
+
// Phase-1-only compaction summarizes tool outputs in place and writes
|
|
781
|
+
// nothing new here, so its baseline flags live only in the persisted
|
|
782
|
+
// record. That is intentional and safe: phase-1 creates no event-log
|
|
783
|
+
// anchor, so on reload `loadMessages` replays the FULL unsummarized
|
|
784
|
+
// history — the prompt is large again, making the retained
|
|
785
|
+
// `cumulativeInputTokens` accurate (not stale), and the next over-
|
|
786
|
+
// threshold turn re-runs `markPreCompactionBaselines` to reset the
|
|
787
|
+
// floor for the new epoch.
|
|
788
|
+
await this.appendCompactionWindow(this.messages);
|
|
789
|
+
}
|
|
790
|
+
if (result.messages) {
|
|
791
|
+
await this.persist("compaction");
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Compact this conversation when the request about to be sent is already too
|
|
797
|
+
* large for the model, BEFORE sending it.
|
|
798
|
+
*
|
|
799
|
+
* A long session can grow its persisted history past the model's input limit
|
|
800
|
+
* without any single live request crossing the compaction threshold: the
|
|
801
|
+
* per-request prompt stays small while storage keeps accumulating. When a
|
|
802
|
+
* dev-server restart or warm-pool recycle then restores that history in full,
|
|
803
|
+
* the first request is rejected by the provider before it reports any usage.
|
|
804
|
+
* Since `afterResponse` is the only compaction trigger and it needs
|
|
805
|
+
* provider-reported usage, compaction can never fire again, every retry
|
|
806
|
+
* replays the same oversized payload, and the app is wedged permanently
|
|
807
|
+
* (ENG-5282).
|
|
808
|
+
*
|
|
809
|
+
* Breaking that cycle needs a check that does not depend on the provider, so
|
|
810
|
+
* the size is estimated from the payload's own content. The estimate only
|
|
811
|
+
* gates the decision. The compaction pipeline, thresholds, and phase
|
|
812
|
+
* selection are the existing ones, so behavior below the threshold is
|
|
813
|
+
* unchanged.
|
|
814
|
+
*
|
|
815
|
+
* Call this from where the request is assembled, after the system prompt is
|
|
816
|
+
* set and the turn is appended: the estimate then covers the array that is
|
|
817
|
+
* actually going on the wire, the UI compaction callbacks are already
|
|
818
|
+
* attached so the user sees the summarization, and a concurrent eviction is
|
|
819
|
+
* handled by the same `isDisposed` guard as the per-response trigger.
|
|
820
|
+
*
|
|
821
|
+
* At most one pass runs at a time, and a pass that ends with the payload
|
|
822
|
+
* still over the threshold latches the context so no later turn starts
|
|
823
|
+
* another paid attempt. See `oversizeCompactionExhausted`.
|
|
824
|
+
*
|
|
825
|
+
* @param extraInputTokens tokens the request carries that are not in the
|
|
826
|
+
* message array, principally the tool-definition schemas. The caller sizes
|
|
827
|
+
* them because it is the layer that holds them; this class stays free of
|
|
828
|
+
* any dependency on the agent tool types. Measured against the five
|
|
829
|
+
* captured production sessions, the estimate reads 0.19x to 1.23x of
|
|
830
|
+
* provider-reported usage, and tool schemas are the largest identified
|
|
831
|
+
* part of that shortfall. Omitting this is exactly today's behavior.
|
|
832
|
+
* Accepts a thunk so the caller's sizing work (schema conversion and
|
|
833
|
+
* serialization of every tool) is skipped entirely when the kill switch is
|
|
834
|
+
* off or the context is latched; a plain number is evaluated by the caller
|
|
835
|
+
* regardless.
|
|
836
|
+
* @returns `true` only when a pass ran and the payload now fits. `false`
|
|
837
|
+
* when it already fit (the common case), when no strategy could act, when
|
|
838
|
+
* the pass failed or timed out, or when it ran and reclaimed too little.
|
|
839
|
+
*/
|
|
840
|
+
async compactIfOversized(extraInputTokens = 0) {
|
|
841
|
+
if (this.isDisposed ||
|
|
842
|
+
this.messages.length === 0 ||
|
|
843
|
+
!this.config.preflightCompactionEnabled) {
|
|
844
|
+
return false;
|
|
845
|
+
}
|
|
846
|
+
if (this.oversizeCompactionExhausted) {
|
|
847
|
+
// The metric is anonymous by design (identity is never a label), so this
|
|
848
|
+
// line is what lets oncall find WHICH session is stuck when the `latched`
|
|
849
|
+
// count rises. One line per prompt on a wedged session is the cost.
|
|
850
|
+
logger.warn("Skipping oversize compaction: an earlier pass on this context already ended over the threshold", this.metricIdentity);
|
|
851
|
+
recordPreflightCompaction({
|
|
852
|
+
outcome: "latched",
|
|
853
|
+
durationMs: 0,
|
|
854
|
+
identity: this.metricIdentity,
|
|
855
|
+
});
|
|
856
|
+
return false;
|
|
857
|
+
}
|
|
858
|
+
const extraTokens = typeof extraInputTokens === "function"
|
|
859
|
+
? extraInputTokens()
|
|
860
|
+
: extraInputTokens;
|
|
861
|
+
// One pass at a time, and concurrent callers share it rather than stacking
|
|
862
|
+
// paid summarizations over the same history. A later caller may have sized
|
|
863
|
+
// a larger tool surface, so the pass decides on the largest figure attached
|
|
864
|
+
// to it rather than whichever caller happened to start it.
|
|
865
|
+
if (this.oversizeCompactionInFlight) {
|
|
866
|
+
this.oversizeCompactionExtraTokens = Math.max(this.oversizeCompactionExtraTokens, extraTokens);
|
|
867
|
+
return this.oversizeCompactionInFlight;
|
|
868
|
+
}
|
|
869
|
+
// An abandoned summarizer from a timed-out pass is still running and still
|
|
870
|
+
// billing. Refuse to start a second one over the same history.
|
|
871
|
+
if (this.oversizeCompactionSettled) {
|
|
872
|
+
logger.warn("Skipping oversize compaction: a previous pass outlived its deadline and is still running", this.metricIdentity);
|
|
873
|
+
recordPreflightCompaction({
|
|
874
|
+
outcome: "skipped",
|
|
875
|
+
durationMs: 0,
|
|
876
|
+
identity: this.metricIdentity,
|
|
877
|
+
});
|
|
878
|
+
return false;
|
|
879
|
+
}
|
|
880
|
+
this.oversizeCompactionExtraTokens = extraTokens;
|
|
881
|
+
const pass = this.queue.enqueue(() => this.runOversizeCompaction(this.oversizeCompactionExtraTokens));
|
|
882
|
+
this.oversizeCompactionInFlight = pass;
|
|
883
|
+
void pass
|
|
884
|
+
.catch(() => undefined)
|
|
885
|
+
.finally(() => {
|
|
886
|
+
this.oversizeCompactionInFlight = undefined;
|
|
887
|
+
});
|
|
888
|
+
return pass;
|
|
889
|
+
}
|
|
890
|
+
async runOversizeCompaction(extraInputTokens) {
|
|
891
|
+
const startedAt = performance.now();
|
|
892
|
+
let outcome = "failed";
|
|
893
|
+
// Set once `this.messages` holds the compacted window. Anything that throws
|
|
894
|
+
// after that point (the event-log append, persist bookkeeping) happened to
|
|
895
|
+
// a pass that succeeded, so it must not latch the context.
|
|
896
|
+
let committed = false;
|
|
897
|
+
try {
|
|
898
|
+
// Estimated inside the queued callback, not before it. An earlier queued
|
|
899
|
+
// pass may already have shrunk the history, and pairing a stale
|
|
900
|
+
// pre-compaction estimate with the new messages would hand the strategy
|
|
901
|
+
// an inconsistent (messages, usage) pair and skew its phase selection.
|
|
902
|
+
//
|
|
903
|
+
// Sizes the wire payload rather than `this.messages`: `buildMessages`
|
|
904
|
+
// prepends the system prompt and strips `_superblocks`, so this is what
|
|
905
|
+
// the provider will actually receive. The estimate can throw on a
|
|
906
|
+
// malformed message (`JSON.stringify` rejects a BigInt), which the
|
|
907
|
+
// surrounding catch absorbs: this method promises never to be the reason
|
|
908
|
+
// a request fails.
|
|
909
|
+
const payload = await this.buildMessages();
|
|
910
|
+
// `extraInputTokens` is the rest of the request the provider charges for
|
|
911
|
+
// and the message array does not carry, principally the tool schemas.
|
|
912
|
+
// Folded in here rather than compared separately so the synthetic usage
|
|
913
|
+
// handed to `afterResponse` is the same total this gate decided on;
|
|
914
|
+
// passing a messages-only figure would make the strategy's own threshold
|
|
915
|
+
// check disagree with ours and decline the pass we just asked for.
|
|
916
|
+
const estimatedTokens = estimateMessagesTokens(payload) + extraInputTokens;
|
|
917
|
+
const threshold = compactionThresholdTokens(this.config);
|
|
918
|
+
if (estimatedTokens <= threshold) {
|
|
919
|
+
outcome = "fit";
|
|
920
|
+
return false;
|
|
921
|
+
}
|
|
922
|
+
logger.warn(`Request payload is oversized: ~${estimatedTokens} estimated tokens > ${threshold} threshold ` +
|
|
923
|
+
`(${this.messages.length} messages); compacting before sending`, this.metricIdentity);
|
|
924
|
+
// Input-only synthetic usage: `computeContextUsed` measures the input
|
|
925
|
+
// window, and a non-zero output count would inflate it.
|
|
926
|
+
//
|
|
927
|
+
// Bounded, because a summarizer that HANGS rather than throws would
|
|
928
|
+
// otherwise block this turn forever. `OperationQueue` is a bare promise
|
|
929
|
+
// chain with no cancellation, so it would also stall every later
|
|
930
|
+
// operation on this context. The deadline is generous: abandoning a
|
|
931
|
+
// compaction that would have worked puts us back at the wedge, so waiting
|
|
932
|
+
// is the cheaper mistake. An abandoned call may still settle in the
|
|
933
|
+
// background; it can no longer hold up the request.
|
|
934
|
+
//
|
|
935
|
+
// `buildMessages()` above primed `_cachedMessages` with the payload this
|
|
936
|
+
// pass is about to replace. `getMessages` serves that cache without
|
|
937
|
+
// joining the queue, so a reader that arrives while the summarizer runs
|
|
938
|
+
// would otherwise be handed the oversized pre-compaction snapshot. Drop
|
|
939
|
+
// it: the reader then queues behind this pass and gets the result. The
|
|
940
|
+
// common fit path returned above with the cache intact, so the request
|
|
941
|
+
// that follows still gets its cache hit.
|
|
942
|
+
this.invalidateMessageCache();
|
|
943
|
+
const settled = this.compaction.afterResponse({
|
|
944
|
+
messages: this.messages,
|
|
945
|
+
usage: {
|
|
946
|
+
inputTokens: estimatedTokens,
|
|
947
|
+
outputTokens: 0,
|
|
948
|
+
totalTokens: estimatedTokens,
|
|
949
|
+
},
|
|
950
|
+
usageIsEstimate: true,
|
|
951
|
+
});
|
|
952
|
+
// Tracked separately from the deadline the caller waits on. `compact()`
|
|
953
|
+
// takes no abort signal, so a pass past its deadline is abandoned rather
|
|
954
|
+
// than cancelled and keeps running and billing; this marker is what stops
|
|
955
|
+
// the queue admitting a sibling pass alongside that orphan. It clears
|
|
956
|
+
// when the SUMMARIZER settles, whether that is before or after the
|
|
957
|
+
// deadline, so the normal path releases it without the caller waiting.
|
|
958
|
+
//
|
|
959
|
+
// The exhausted latch stops a second pass after a timeout on its own, so
|
|
960
|
+
// this covers the one case that clears the latch mid-orphan, a
|
|
961
|
+
// `setCompactionStrategy` swap. It narrows the orphan window rather than
|
|
962
|
+
// closing it; closing it needs an `abortSignal` on `compact()`.
|
|
963
|
+
this.oversizeCompactionSettled = settled;
|
|
964
|
+
// An orphan's eventual outcome is otherwise invisible: the metric already
|
|
965
|
+
// recorded `timed_out` and the request went out without it. These lines
|
|
966
|
+
// are how oncall tells "settled two minutes late" from "still running an
|
|
967
|
+
// hour later".
|
|
968
|
+
let timedOut = false;
|
|
969
|
+
void settled
|
|
970
|
+
.then(() => {
|
|
971
|
+
if (timedOut) {
|
|
972
|
+
logger.warn(`Oversize compaction pass settled ${Math.round(performance.now() - startedAt)}ms after it started, past its deadline; its result was discarded`, this.metricIdentity);
|
|
973
|
+
}
|
|
974
|
+
}, (err) => {
|
|
975
|
+
if (timedOut) {
|
|
976
|
+
logger.warn(`Oversize compaction pass failed after outliving its deadline: ${err}`, this.metricIdentity);
|
|
977
|
+
}
|
|
978
|
+
})
|
|
979
|
+
.finally(() => {
|
|
980
|
+
if (this.oversizeCompactionSettled === settled) {
|
|
981
|
+
this.oversizeCompactionSettled = undefined;
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
let result;
|
|
985
|
+
try {
|
|
986
|
+
result = await withDeadline(settled, PREFLIGHT_COMPACTION_TIMEOUT_MS);
|
|
987
|
+
}
|
|
988
|
+
catch (err) {
|
|
989
|
+
if (err instanceof DeadlineExceededError) {
|
|
990
|
+
timedOut = true;
|
|
991
|
+
outcome = "timed_out";
|
|
992
|
+
}
|
|
993
|
+
throw err;
|
|
994
|
+
}
|
|
995
|
+
if (!result.messages) {
|
|
996
|
+
// No strategy could act, or the strategy declined. Either way the
|
|
997
|
+
// provider is left to reject the request, now labelled
|
|
998
|
+
// `context_too_large`.
|
|
999
|
+
this.oversizeCompactionExhausted = true;
|
|
1000
|
+
outcome = "discarded";
|
|
1001
|
+
logger.warn("Oversize compaction produced no changes; payload remains too large to send", this.metricIdentity);
|
|
1002
|
+
return false;
|
|
1003
|
+
}
|
|
1004
|
+
// Measured BEFORE anything is mutated or written, because a compaction is
|
|
1005
|
+
// irreversible once persisted and a pass can come back with the window
|
|
1006
|
+
// essentially unchanged (phase 1 finds nothing prunable and phase 2
|
|
1007
|
+
// declines).
|
|
1008
|
+
//
|
|
1009
|
+
// Three outcomes, not two. The trigger threshold is
|
|
1010
|
+
// `contextLimit - maxOutputTokens - contextBufferTokens`, so 120k on a
|
|
1011
|
+
// 188k model, and tool schemas are irreducible: compaction cannot shrink
|
|
1012
|
+
// them, so `messages_after + extraInputTokens` can sit above the trigger
|
|
1013
|
+
// threshold while being comfortably sendable. Discarding there would
|
|
1014
|
+
// throw away a real shrink and send the original oversized history
|
|
1015
|
+
// instead, which is strictly worse.
|
|
1016
|
+
//
|
|
1017
|
+
// Sendability is measured against `contextLimit - contextBufferTokens`
|
|
1018
|
+
// rather than bare `contextLimit`. `maxOutputTokens` is a generation
|
|
1019
|
+
// reservation, not input the provider charges against the payload, so it
|
|
1020
|
+
// does not belong in a can-this-be-sent bound. The buffer does stay:
|
|
1021
|
+
// against the five captured production sessions this estimator reads
|
|
1022
|
+
// 0.19x to 1.23x of provider-reported usage, so a margin below the hard
|
|
1023
|
+
// limit is doing real work.
|
|
1024
|
+
const candidate = this.markPreCompactionBaselines(result.messages);
|
|
1025
|
+
const remainingTokens = estimateMessagesTokens(await this.buildMessages(candidate)) +
|
|
1026
|
+
extraInputTokens;
|
|
1027
|
+
const sendableLimit = this.config.contextLimit - this.config.contextBufferTokens;
|
|
1028
|
+
if (remainingTokens > sendableLimit) {
|
|
1029
|
+
// Still unsendable. Keep the original history, which at least leaves
|
|
1030
|
+
// the conversation recoverable, and stop paying for the same answer.
|
|
1031
|
+
this.oversizeCompactionExhausted = true;
|
|
1032
|
+
outcome = "discarded";
|
|
1033
|
+
// `compact()` fires onCompactionStart and onCompactionComplete before
|
|
1034
|
+
// it returns, so the user has already been shown "Summarized past
|
|
1035
|
+
// conversation" for work we are about to throw away. Retract it, or the
|
|
1036
|
+
// UI claims a summarization happened while the request goes out with
|
|
1037
|
+
// the original history and gets rejected. Only phase 2 needs this:
|
|
1038
|
+
// `LLMClient.createContext` drops phase-1 callbacks before they render.
|
|
1039
|
+
if (result.phase2MessageId) {
|
|
1040
|
+
this.compactionCallbacks?.onCompactionCancel?.("phase2", result.phase2MessageId);
|
|
1041
|
+
}
|
|
1042
|
+
logger.warn(`Oversize compaction ran but the payload is still unsendable ` +
|
|
1043
|
+
`(~${remainingTokens} estimated tokens > ${sendableLimit} sendable limit, ` +
|
|
1044
|
+
`${estimatedTokens} before); discarding it and leaving the request to the provider`, this.metricIdentity);
|
|
1045
|
+
return false;
|
|
1046
|
+
}
|
|
1047
|
+
// Over the compaction threshold but under the limit, so it will send.
|
|
1048
|
+
// Persist it and do NOT latch: real progress was made, and the normal
|
|
1049
|
+
// usage-driven `afterResponse` can carry on from here with the provider's
|
|
1050
|
+
// own numbers instead of this estimate.
|
|
1051
|
+
const underThreshold = remainingTokens <= threshold;
|
|
1052
|
+
if (!underThreshold) {
|
|
1053
|
+
logger.info(`Oversize compaction reduced the payload to a sendable size but not under the ` +
|
|
1054
|
+
`compaction threshold (~${remainingTokens} estimated tokens, ${estimatedTokens} before, ` +
|
|
1055
|
+
`${threshold} threshold, ${sendableLimit} sendable limit)`, this.metricIdentity);
|
|
1056
|
+
}
|
|
1057
|
+
// Re-checked after an await that can last the full deadline. `dispose()`
|
|
1058
|
+
// marks the instance inert so stale generations cannot resurrect cleared
|
|
1059
|
+
// history, and the disk paths already honour it (`runPersist` and
|
|
1060
|
+
// `appendCompactionWindow` both bail on `isDisposed`), but assigning
|
|
1061
|
+
// `this.messages` here would put the pre-dispose conversation back in
|
|
1062
|
+
// memory on a context New Chat or a checkpoint restore just cleared.
|
|
1063
|
+
if (this.isDisposed) {
|
|
1064
|
+
outcome = "discarded";
|
|
1065
|
+
if (result.phase2MessageId) {
|
|
1066
|
+
this.compactionCallbacks?.onCompactionCancel?.("phase2", result.phase2MessageId);
|
|
1067
|
+
}
|
|
1068
|
+
logger.warn("Discarding an oversize compaction result: the context was disposed while it ran", this.metricIdentity);
|
|
1069
|
+
return false;
|
|
1070
|
+
}
|
|
1071
|
+
this.messages = candidate;
|
|
1072
|
+
committed = true;
|
|
1073
|
+
this.invalidateMessageCache();
|
|
1074
|
+
if (result.skillsNeedReload) {
|
|
1075
|
+
this.skillsNeedReload = true;
|
|
1076
|
+
this.readSystemSkills.clear();
|
|
1077
|
+
}
|
|
1078
|
+
if (result.eventLogAnchor) {
|
|
1079
|
+
await this.appendCompactionWindow(this.messages);
|
|
1080
|
+
}
|
|
1081
|
+
await this.persist("compaction");
|
|
1082
|
+
outcome = underThreshold ? "compacted" : "progressed";
|
|
1083
|
+
return underThreshold;
|
|
1084
|
+
}
|
|
1085
|
+
catch (err) {
|
|
1086
|
+
// Never rethrown, and latched so it is never retried: a summarizer that
|
|
1087
|
+
// threw or blew the deadline would stall every later request for the same
|
|
1088
|
+
// deadline and fail the same way, which is worse than the wedge. Degrade
|
|
1089
|
+
// to letting the provider reject the request, now labelled
|
|
1090
|
+
// `context_too_large`. The estimate itself can also throw here
|
|
1091
|
+
// (`JSON.stringify` rejects a BigInt), and latching that is right too:
|
|
1092
|
+
// a malformed message will still be malformed next turn.
|
|
1093
|
+
//
|
|
1094
|
+
// Not latched once the compacted window is in memory: the pass did its
|
|
1095
|
+
// job and the request goes out with the smaller history. Latching there
|
|
1096
|
+
// would block the next rescue over a bookkeeping failure.
|
|
1097
|
+
if (committed) {
|
|
1098
|
+
logger.error(`Oversize compaction applied but its bookkeeping failed: ${err}`, { ...getErrorMeta(err), ...this.metricIdentity });
|
|
1099
|
+
return false;
|
|
1100
|
+
}
|
|
1101
|
+
this.oversizeCompactionExhausted = true;
|
|
1102
|
+
logger.error(`Failed to compact oversized payload; leaving it to the provider: ${err}`, { ...getErrorMeta(err), ...this.metricIdentity });
|
|
1103
|
+
return false;
|
|
1104
|
+
}
|
|
1105
|
+
finally {
|
|
1106
|
+
// Telemetry only: `outcome` is assigned on every path and nothing here
|
|
1107
|
+
// touches control flow, so a metrics failure cannot change what the
|
|
1108
|
+
// request does.
|
|
1109
|
+
recordPreflightCompaction({
|
|
1110
|
+
outcome,
|
|
1111
|
+
durationMs: performance.now() - startedAt,
|
|
1112
|
+
identity: this.metricIdentity,
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
async getMessages() {
|
|
1117
|
+
// Fast path: return cached result when messages haven't changed.
|
|
1118
|
+
// This avoids re-running 10+ normalization/repair passes and avoids
|
|
1119
|
+
// queue contention on the second call within the same LLM step.
|
|
1120
|
+
if (this._cachedMessages) {
|
|
1121
|
+
logger.debug(`getMessages: cache hit (${this._cachedMessages.length} messages)`);
|
|
1122
|
+
return [...this._cachedMessages];
|
|
1123
|
+
}
|
|
1124
|
+
return this.queue.enqueue(() => this.buildMessages());
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Build the wire payload. Split out of `getMessages` so a pass already
|
|
1128
|
+
* running inside the operation queue can size the real payload without
|
|
1129
|
+
* re-entering the queue and deadlocking.
|
|
1130
|
+
*/
|
|
1131
|
+
async buildMessages(source) {
|
|
1132
|
+
// A `source` means "size this candidate window", not "this is the context
|
|
1133
|
+
// now": the cache is neither read nor written, so a candidate the caller
|
|
1134
|
+
// ends up discarding cannot leak into the next real request. Same function
|
|
1135
|
+
// either way on purpose, so the before and after measurements are the same
|
|
1136
|
+
// shape and a difference between them means a real difference in payload.
|
|
1137
|
+
const isCandidate = source !== undefined;
|
|
1138
|
+
{
|
|
1139
|
+
// Re-check in case another enqueued op just computed it.
|
|
1140
|
+
if (!isCandidate && this._cachedMessages) {
|
|
1141
|
+
return [...this._cachedMessages];
|
|
1142
|
+
}
|
|
1143
|
+
// Strip system-role messages from the conversation array before
|
|
1144
|
+
// building the wire payload. The `compaction_received` marker
|
|
1145
|
+
// (written by `onCompactionDetected`, surfaced by
|
|
1146
|
+
// `JsonlEventStore.loadMessages` as the anchor StoredMessage, and
|
|
1147
|
+
// inserted in memory by `ServerSideCompactionStrategy`) carries
|
|
1148
|
+
// `role: "system"` and is useful as an in-memory / on-disk
|
|
1149
|
+
// breadcrumb but is not a valid conversation turn — Anthropic
|
|
1150
|
+
// (and most other providers) only accept system messages at the
|
|
1151
|
+
// start of the request, routed through the dedicated `system`
|
|
1152
|
+
// parameter we set from `this.systemPrompt` below. Letting the
|
|
1153
|
+
// marker through would put a second system-role message in the
|
|
1154
|
+
// middle of the `messages` array and 400 the request on the
|
|
1155
|
+
// first post-compaction turn.
|
|
1156
|
+
const conversationMessages = (source ?? this.messages).filter((msg) => msg.role !== "system");
|
|
1157
|
+
const allMessages = this.systemPrompt
|
|
1158
|
+
? [this.systemPrompt, ...conversationMessages]
|
|
1159
|
+
: [...conversationMessages];
|
|
1160
|
+
// Convert to SDK format (removes _superblocks metadata)
|
|
1161
|
+
const sanitized = toSdkMessages(allMessages);
|
|
1162
|
+
// Normalize malformed tool outputs and repair broken tool calls.
|
|
1163
|
+
const normalized = sanitized.map((msg) => normalizeToolMessage(stripUndefinedFromToolOutputs(msg)));
|
|
1164
|
+
const repaired = normalized
|
|
1165
|
+
.map(repairBrokenToolCalls)
|
|
1166
|
+
.map(repairOrphanedToolResults)
|
|
1167
|
+
.filter((msg) => {
|
|
1168
|
+
// Remove messages left empty after repair (e.g., tool messages with all
|
|
1169
|
+
// results orphaned, or assistant messages with all tool-calls orphaned)
|
|
1170
|
+
if (msg.role !== "user" &&
|
|
1171
|
+
Array.isArray(msg.content) &&
|
|
1172
|
+
msg.content.length === 0) {
|
|
1173
|
+
logger.debug(`Filtered out empty ${msg.role} message after repair`);
|
|
1174
|
+
return false;
|
|
1175
|
+
}
|
|
1176
|
+
return true;
|
|
1177
|
+
});
|
|
1178
|
+
// Normalize reasoning signatures into both provider namespaces so that
|
|
1179
|
+
// conversations started on one provider (e.g. Vertex/anthropic) can be
|
|
1180
|
+
// replayed on another (e.g. Bedrock) without losing signatures.
|
|
1181
|
+
for (const msg of repaired) {
|
|
1182
|
+
if (msg.role === "assistant") {
|
|
1183
|
+
normalizeReasoningProviderOptions(msg);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
// Drop reasoning parts that still lack a valid signature after
|
|
1187
|
+
// normalization. These can never be replayed successfully.
|
|
1188
|
+
const signatureSafe = stripUnsignedReasoning(repaired);
|
|
1189
|
+
if (signatureSafe.length < repaired.length) {
|
|
1190
|
+
logger.debug(`Stripped ${repaired.length - signatureSafe.length} message(s) with unsigned reasoning`);
|
|
1191
|
+
}
|
|
1192
|
+
const prefillSafe = stripTrailingAssistantPrefill(signatureSafe);
|
|
1193
|
+
if (prefillSafe.length < signatureSafe.length) {
|
|
1194
|
+
logger.debug(`Stripped ${signatureSafe.length - prefillSafe.length} trailing assistant prefill message(s)`);
|
|
1195
|
+
}
|
|
1196
|
+
// Ensure file part filenames are globally unique across all messages.
|
|
1197
|
+
// Providers like Bedrock reject requests with duplicate document names.
|
|
1198
|
+
const deduped = uniquifyFilePartFilenames(prefillSafe);
|
|
1199
|
+
// Final defense-in-depth: strip any orphan tool_use that survived the
|
|
1200
|
+
// earlier per-message repairs. Anthropic/Bedrock require every tool_use
|
|
1201
|
+
// to be followed IMMEDIATELY by a matching tool_result, and earlier
|
|
1202
|
+
// repairs operate on intermediate arrays whose indices can shift.
|
|
1203
|
+
//
|
|
1204
|
+
// INVARIANT: enforceToolUsePairing must run AFTER repairOrphanedToolResults
|
|
1205
|
+
// (so no orphan tool_results survive into this pass — it only looks forward
|
|
1206
|
+
// and strips tool_use, never tool_result) and BEFORE any step that adds or
|
|
1207
|
+
// removes TOOL-CALL-BEARING messages (or orphans can be reintroduced by
|
|
1208
|
+
// adjacency shifts). stripUnsignedReasoning and stripTrailingAssistantPrefill
|
|
1209
|
+
// also run between the repair passes and this call; they are safe because they
|
|
1210
|
+
// only drop messages with no tool-call parts (pure reasoning / trailing
|
|
1211
|
+
// prefill), so they cannot orphan a tool_use. Cache-breakpoint application
|
|
1212
|
+
// below mutates providerOptions only and is safe.
|
|
1213
|
+
const enforced = enforceToolUsePairing(deduped);
|
|
1214
|
+
// Compaction can persist a lone UTF-16 surrogate (emoji split). Bedrock
|
|
1215
|
+
// then rejects the Converse body as invalid JSON. Repair on the wire
|
|
1216
|
+
// only so already-poisoned chats can send without rewriting history.
|
|
1217
|
+
const jsonSafe = makeJsonSafeValue(enforced);
|
|
1218
|
+
// Apply cache breakpoints (recompute indices after filtering since
|
|
1219
|
+
// the .filter() step may have removed messages, shifting positions)
|
|
1220
|
+
const repairedBreakpoints = findBreakpoints({
|
|
1221
|
+
messages: jsonSafe,
|
|
1222
|
+
hasSystemPrompt: this.systemPrompt !== undefined,
|
|
1223
|
+
config: this.caching,
|
|
1224
|
+
});
|
|
1225
|
+
for (const idx of repairedBreakpoints) {
|
|
1226
|
+
if (jsonSafe[idx]) {
|
|
1227
|
+
jsonSafe[idx].providerOptions = CACHE_BREAKPOINT_PROVIDER_OPTIONS;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
if (!isCandidate) {
|
|
1231
|
+
this._cachedMessages = jsonSafe;
|
|
1232
|
+
}
|
|
1233
|
+
return [...jsonSafe];
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
async onCompactionDetected() {
|
|
1237
|
+
const detectedGeneration = this.activeServerCompactionGeneration ??
|
|
1238
|
+
this.endedServerCompactionGeneration;
|
|
1239
|
+
this.invalidateMessageCache();
|
|
1240
|
+
// Serialize with `addUserMessage` / `addResponse` / `getMessages`: this
|
|
1241
|
+
// method is driven by the stream observer and can otherwise interleave
|
|
1242
|
+
// with a queued write, leading to lost mutations or torn state.
|
|
1243
|
+
await this.queue.enqueue(async () => {
|
|
1244
|
+
const messagesBefore = this.messages.length;
|
|
1245
|
+
const inputTokensBefore = this.getLastKnownInputTokens();
|
|
1246
|
+
const result = this.compaction.onCompactionDetected(this.messages);
|
|
1247
|
+
// Mark retained assistants once and reuse the flagged array for both the
|
|
1248
|
+
// in-memory state and the event-log write below. Capturing it in a local
|
|
1249
|
+
// (rather than re-reading `this.messages`) keeps the event log's
|
|
1250
|
+
// dependency on the marking explicit and refactor-safe — see
|
|
1251
|
+
// `markPreCompactionBaselines` / `getLastKnownInputTokens`.
|
|
1252
|
+
const marked = result.messages
|
|
1253
|
+
? this.markPreCompactionBaselines(result.messages)
|
|
1254
|
+
: null;
|
|
1255
|
+
if (marked) {
|
|
1256
|
+
this.messages = marked;
|
|
1257
|
+
this.invalidateMessageCache();
|
|
1258
|
+
}
|
|
1259
|
+
if (result.skillsNeedReload) {
|
|
1260
|
+
this.skillsNeedReload = true;
|
|
1261
|
+
this.readSystemSkills.clear();
|
|
1262
|
+
}
|
|
1263
|
+
const marker = result.messages?.[0];
|
|
1264
|
+
const summary = typeof marker?.content === "string"
|
|
1265
|
+
? marker.content
|
|
1266
|
+
: SERVER_COMPACTION_SUMMARY;
|
|
1267
|
+
const durationMs = this.getActiveServerCompactionDurationMs();
|
|
1268
|
+
const didComplete = this.completeServerCompactionMessage(summary, detectedGeneration);
|
|
1269
|
+
if (didComplete) {
|
|
1270
|
+
this.recordInterCompactionTurnInterval();
|
|
1271
|
+
recordServerCompaction({
|
|
1272
|
+
...this.getMetricIdentity(),
|
|
1273
|
+
durationMs,
|
|
1274
|
+
inputTokensBefore,
|
|
1275
|
+
messagesAfter: this.messages.length,
|
|
1276
|
+
messagesBefore,
|
|
1277
|
+
status: "completed",
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
if (this.isDisposed) {
|
|
1281
|
+
logger.warn(`Skipping server-compaction event append for context '${this.contextId?.name ?? "ephemeral"}': context was disposed (concurrent checkpoint restore or New Chat)`);
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (!this.eventStore || !this.contextId) {
|
|
1285
|
+
logger.info("Server-side compaction detected (no event store configured)", {
|
|
1286
|
+
...(durationMs !== undefined
|
|
1287
|
+
? { durationMs: Math.round(durationMs) }
|
|
1288
|
+
: {}),
|
|
1289
|
+
inputTokensBefore,
|
|
1290
|
+
messagesAfter: this.messages.length,
|
|
1291
|
+
messagesBefore,
|
|
1292
|
+
...this.getMetricIdentity(),
|
|
1293
|
+
});
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
// Replay the marked messages so the baseline reset survives reload from
|
|
1297
|
+
// the event log, not just the in-memory record. `marker` (above) is
|
|
1298
|
+
// `markedMessages[0]` — the summary marker is never an assistant, so
|
|
1299
|
+
// `markPreCompactionBaselines` leaves index 0 untouched.
|
|
1300
|
+
const markedMessages = marked ?? [];
|
|
1301
|
+
const entry = {
|
|
1302
|
+
type: "compaction_received",
|
|
1303
|
+
timestamp: marker?._superblocks?.timestamp ?? Date.now(),
|
|
1304
|
+
role: "system",
|
|
1305
|
+
content: summary,
|
|
1306
|
+
};
|
|
1307
|
+
const retainedMessages = markedMessages.slice(1);
|
|
1308
|
+
try {
|
|
1309
|
+
await this.eventStore.appendEvent(this.contextId, entry, {
|
|
1310
|
+
shouldAbort: () => this.isDisposed,
|
|
1311
|
+
});
|
|
1312
|
+
for (const message of retainedMessages) {
|
|
1313
|
+
// Re-check per iteration: the loop awaits between writes, so a
|
|
1314
|
+
// concurrent New Chat / checkpoint restore can dispose the shared
|
|
1315
|
+
// instance mid-replay. Stop rather than append the rest into the
|
|
1316
|
+
// (possibly just-cleared) shared log for every editor.
|
|
1317
|
+
if (this.isDisposed) {
|
|
1318
|
+
logger.warn(`Stopping server-compaction replay for context '${this.contextId?.name ?? "ephemeral"}': context disposed mid-write (concurrent checkpoint restore or New Chat)`);
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
await this.eventStore.appendEvent(this.contextId, this.toEventLogEntry(message), { shouldAbort: () => this.isDisposed });
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
catch (err) {
|
|
1325
|
+
logger.error(`Failed to append compaction_received event: ${err}`);
|
|
1326
|
+
}
|
|
1327
|
+
logger.info(`Server-side compaction detected, wrote compaction_received event and replayed ${retainedMessages.length} retained message(s)`, {
|
|
1328
|
+
...(durationMs !== undefined
|
|
1329
|
+
? { durationMs: Math.round(durationMs) }
|
|
1330
|
+
: {}),
|
|
1331
|
+
inputTokensBefore,
|
|
1332
|
+
messagesAfter: this.messages.length,
|
|
1333
|
+
messagesBefore,
|
|
1334
|
+
...this.getMetricIdentity(),
|
|
1335
|
+
});
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
ensureServerCompactionMessageStarted() {
|
|
1339
|
+
if (!this.serverCompactionMessageId) {
|
|
1340
|
+
this.serverCompactionMessageId = `server-compaction-${randomUUID()}`;
|
|
1341
|
+
this.serverCompactionGeneration++;
|
|
1342
|
+
this.activeServerCompactionGeneration = this.serverCompactionGeneration;
|
|
1343
|
+
this.endedServerCompactionGeneration = undefined;
|
|
1344
|
+
this.compactionCallbacks?.onCompactionStart?.("phase2", this.serverCompactionMessageId);
|
|
1345
|
+
}
|
|
1346
|
+
return this.serverCompactionMessageId;
|
|
1347
|
+
}
|
|
1348
|
+
completeServerCompactionMessage(summary, detectedGeneration) {
|
|
1349
|
+
if (detectedGeneration !== undefined &&
|
|
1350
|
+
(this.endedServerCompactionGeneration === detectedGeneration ||
|
|
1351
|
+
this.activeServerCompactionGeneration !== detectedGeneration)) {
|
|
1352
|
+
return false;
|
|
1353
|
+
}
|
|
1354
|
+
const startedBeforeCompletion = this.serverCompactionMessageId !== undefined;
|
|
1355
|
+
const messageId = this.ensureServerCompactionMessageStarted();
|
|
1356
|
+
this.compactionCallbacks?.onCompactionComplete?.("phase2", messageId, summary);
|
|
1357
|
+
this.serverCompactionMessageId = undefined;
|
|
1358
|
+
this.activeServerCompactionGeneration = undefined;
|
|
1359
|
+
this.activeServerCompactionStartedAt = undefined;
|
|
1360
|
+
if (!startedBeforeCompletion) {
|
|
1361
|
+
this.serverCompactionCompletedBeforeStart = true;
|
|
1362
|
+
}
|
|
1363
|
+
return true;
|
|
1364
|
+
}
|
|
1365
|
+
getMetricIdentity() {
|
|
1366
|
+
return {
|
|
1367
|
+
...(this.contextId?.appId ? { applicationId: this.contextId.appId } : {}),
|
|
1368
|
+
...(this.contextId?.organizationId
|
|
1369
|
+
? { organizationId: this.contextId.organizationId }
|
|
1370
|
+
: {}),
|
|
1371
|
+
...this.metricIdentity,
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
getActiveServerCompactionDurationMs() {
|
|
1375
|
+
return this.activeServerCompactionStartedAt === undefined
|
|
1376
|
+
? undefined
|
|
1377
|
+
: performance.now() - this.activeServerCompactionStartedAt;
|
|
1378
|
+
}
|
|
1379
|
+
recordServerCompactionOutcome(status) {
|
|
1380
|
+
recordServerCompaction({
|
|
1381
|
+
...this.getMetricIdentity(),
|
|
1382
|
+
durationMs: this.getActiveServerCompactionDurationMs(),
|
|
1383
|
+
status,
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Returns deduplicated tool names from messages marked as protected.
|
|
1388
|
+
* Delegates to the active compaction strategy.
|
|
1389
|
+
*/
|
|
1390
|
+
getProtectedToolNames() {
|
|
1391
|
+
return this.compaction.getProtectedToolNames(this.messages);
|
|
1392
|
+
}
|
|
1393
|
+
async appendEvent(type, message, usage) {
|
|
1394
|
+
if (this.isDisposed) {
|
|
1395
|
+
// The event log is the primary load source (manager.loadRecord replays
|
|
1396
|
+
// it before legacy/remote), so a late in-flight append from a disposed
|
|
1397
|
+
// shared instance would resurrect the just-cleared/restored conversation
|
|
1398
|
+
// for every editor. Skip — and log, since it was previously invisible.
|
|
1399
|
+
logger.warn(`Skipping '${type}' event append for context '${this.contextId?.name ?? "ephemeral"}': context was disposed (concurrent checkpoint restore or New Chat)`);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (!this.eventStore || !this.contextId) {
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
const raw = message;
|
|
1406
|
+
const providerMetadata = raw.providerMetadata;
|
|
1407
|
+
const entry = {
|
|
1408
|
+
type,
|
|
1409
|
+
timestamp: message._superblocks?.timestamp ?? Date.now(),
|
|
1410
|
+
role: message.role,
|
|
1411
|
+
content: message.content,
|
|
1412
|
+
...(message._superblocks != null
|
|
1413
|
+
? { _superblocks: message._superblocks }
|
|
1414
|
+
: {}),
|
|
1415
|
+
...(providerMetadata != null ? { providerMetadata } : {}),
|
|
1416
|
+
...(usage && { usage }),
|
|
1417
|
+
};
|
|
1418
|
+
try {
|
|
1419
|
+
await this.eventStore.appendEvent(this.contextId, entry, {
|
|
1420
|
+
shouldAbort: () => this.isDisposed,
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
catch (err) {
|
|
1424
|
+
logger.error(`Failed to append ${type} event: ${err}`);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
async appendCompactionWindow(messages) {
|
|
1428
|
+
if (this.isDisposed) {
|
|
1429
|
+
logger.warn(`Skipping compaction-window event append for context '${this.contextId?.name ?? "ephemeral"}': context was disposed (concurrent checkpoint restore or New Chat)`);
|
|
1430
|
+
return;
|
|
1431
|
+
}
|
|
1432
|
+
if (!this.eventStore || !this.contextId) {
|
|
1433
|
+
return;
|
|
1434
|
+
}
|
|
1435
|
+
// System-role messages are in-memory/on-disk breadcrumbs (e.g. a
|
|
1436
|
+
// restored compaction marker), not conversation turns; rewriting them
|
|
1437
|
+
// into the window would accumulate one marker per compact/restore cycle.
|
|
1438
|
+
const windowMessages = messages.filter((msg) => msg.role !== "system");
|
|
1439
|
+
// Never write an anchor for an empty window: the backward scan in
|
|
1440
|
+
// `loadMessages` would treat it as the replay point and restore an
|
|
1441
|
+
// empty conversation.
|
|
1442
|
+
if (windowMessages.length === 0) {
|
|
1443
|
+
logger.warn("Compaction window is empty after system-role filtering; skipping event log write");
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
// Phase-2 windows begin with an `isSummary` message that
|
|
1447
|
+
// `JsonlEventStore.loadMessages` recognizes as a replay anchor.
|
|
1448
|
+
// Phase-1-only windows carry no such message, so write an explicit
|
|
1449
|
+
// `compaction_received` marker first — without an anchor the next
|
|
1450
|
+
// load would replay the raw pre-compaction events, resurrecting the
|
|
1451
|
+
// uncompacted context and invalidating the provider prompt cache on
|
|
1452
|
+
// every page refresh (APPS-4751).
|
|
1453
|
+
const needsMarker = windowMessages[0]?._superblocks?.isSummary !== true;
|
|
1454
|
+
// The marker + window writes are not atomic: a crash mid-write leaves
|
|
1455
|
+
// a partial window behind the anchor and the next load replays an
|
|
1456
|
+
// incomplete window. That is still preferable to replaying the raw
|
|
1457
|
+
// pre-compaction history; phase-2/server-side windows share the same
|
|
1458
|
+
// exposure.
|
|
1459
|
+
try {
|
|
1460
|
+
if (needsMarker) {
|
|
1461
|
+
await this.eventStore.appendEvent(this.contextId, {
|
|
1462
|
+
type: "compaction_received",
|
|
1463
|
+
timestamp: Date.now(),
|
|
1464
|
+
role: "system",
|
|
1465
|
+
content: CLIENT_COMPACTION_MARKER,
|
|
1466
|
+
}, { shouldAbort: () => this.isDisposed });
|
|
1467
|
+
}
|
|
1468
|
+
for (const message of windowMessages) {
|
|
1469
|
+
// Re-check per iteration: see onCompactionDetected — a dispose during
|
|
1470
|
+
// the loop's awaits must stop the replay, not keep appending into a
|
|
1471
|
+
// shared log a concurrent New Chat / restore may have just cleared.
|
|
1472
|
+
if (this.isDisposed) {
|
|
1473
|
+
logger.warn(`Stopping compaction-window replay for context '${this.contextId?.name ?? "ephemeral"}': context disposed mid-write (concurrent checkpoint restore or New Chat)`);
|
|
1474
|
+
break;
|
|
1475
|
+
}
|
|
1476
|
+
await this.eventStore.appendEvent(this.contextId, this.toEventLogEntry(message), { shouldAbort: () => this.isDisposed });
|
|
1477
|
+
}
|
|
1478
|
+
logger.info(`Wrote ${windowMessages.length} client-side compaction message(s) to event log ` +
|
|
1479
|
+
`(anchor: ${needsMarker ? "phase-1 marker" : "isSummary message"})`);
|
|
1480
|
+
}
|
|
1481
|
+
catch (err) {
|
|
1482
|
+
logger.error(`Failed to append client-side compaction window: ${err}`);
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
toEventLogEntry(message) {
|
|
1486
|
+
const raw = message;
|
|
1487
|
+
const providerMetadata = raw.providerMetadata;
|
|
1488
|
+
return {
|
|
1489
|
+
type: message.role === "user" ? "prompt_sent" : "response_received",
|
|
1490
|
+
timestamp: message._superblocks?.timestamp ?? Date.now(),
|
|
1491
|
+
role: message.role,
|
|
1492
|
+
content: message.content,
|
|
1493
|
+
...(message._superblocks != null
|
|
1494
|
+
? { _superblocks: message._superblocks }
|
|
1495
|
+
: {}),
|
|
1496
|
+
...(providerMetadata != null ? { providerMetadata } : {}),
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* Returns the last known input token count from the most recent assistant
|
|
1501
|
+
* message in the current (post-compaction) prompt epoch.
|
|
1502
|
+
*
|
|
1503
|
+
* This feeds the monotonic floor in `addResponse` that guards against
|
|
1504
|
+
* providers under-reporting input tokens on cache misses. Messages flagged
|
|
1505
|
+
* `preCompactionInputTokenBaseline` are skipped: their `cumulativeInputTokens`
|
|
1506
|
+
* reflect a larger pre-compaction prompt, so using them as the floor would
|
|
1507
|
+
* pin the cumulative at the stale high-water mark forever (the value would
|
|
1508
|
+
* appear frozen after every compaction).
|
|
1509
|
+
*
|
|
1510
|
+
* NOTE: sessions that compacted before this flag shipped have retained
|
|
1511
|
+
* assistant messages with no `preCompactionInputTokenBaseline`, so they keep
|
|
1512
|
+
* returning the stale pre-compaction peak until their next compaction re-marks
|
|
1513
|
+
* them. No migration is applied — accepted for a telemetry-only fix.
|
|
1514
|
+
*/
|
|
1515
|
+
getLastKnownInputTokens() {
|
|
1516
|
+
for (let i = this.messages.length - 1; i >= 0; i--) {
|
|
1517
|
+
const meta = this.messages[i]?._superblocks;
|
|
1518
|
+
if (meta?.cumulativeInputTokens !== undefined &&
|
|
1519
|
+
meta.preCompactionInputTokenBaseline !== true) {
|
|
1520
|
+
return meta.cumulativeInputTokens;
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
return 0;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* After compaction shrinks the prompt, the retained assistant messages still
|
|
1527
|
+
* carry `cumulativeInputTokens` from the pre-compaction epoch. Flag each one
|
|
1528
|
+
* so `getLastKnownInputTokens` stops treating those values as the monotonic
|
|
1529
|
+
* floor — otherwise the high-water mark survives compaction and pins
|
|
1530
|
+
* `cumulativeInputTokens` at the pre-compaction peak forever.
|
|
1531
|
+
*
|
|
1532
|
+
* The values themselves are preserved for historical per-turn delta
|
|
1533
|
+
* accounting (see `turns.ts`). Marking is idempotent (already-flagged
|
|
1534
|
+
* messages are returned untouched), so repeated compactions in a single
|
|
1535
|
+
* session each reset the floor for the new epoch without churn.
|
|
1536
|
+
*
|
|
1537
|
+
* Phase-1-only client compaction returns the full message list, so every
|
|
1538
|
+
* assistant in history is flagged and the floor drops to the post-compaction
|
|
1539
|
+
* prompt size even though only tool outputs were pruned in place.
|
|
1540
|
+
*/
|
|
1541
|
+
markPreCompactionBaselines(messages) {
|
|
1542
|
+
return messages.map((msg) => {
|
|
1543
|
+
if (msg.role !== "assistant" ||
|
|
1544
|
+
msg._superblocks?.cumulativeInputTokens === undefined ||
|
|
1545
|
+
msg._superblocks.preCompactionInputTokenBaseline === true) {
|
|
1546
|
+
return msg;
|
|
1547
|
+
}
|
|
1548
|
+
return {
|
|
1549
|
+
...msg,
|
|
1550
|
+
_superblocks: {
|
|
1551
|
+
...msg._superblocks,
|
|
1552
|
+
preCompactionInputTokenBaseline: true,
|
|
1553
|
+
},
|
|
1554
|
+
};
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Await every persist that is currently mid-flight, then resolve.
|
|
1559
|
+
*
|
|
1560
|
+
* A persist that has already passed the {@link persist} dispose guard is
|
|
1561
|
+
* committed to writing the snapshot; `dispose()` cannot recall it. A caller
|
|
1562
|
+
* about to overwrite that snapshot with rolled-back state (checkpoint restore
|
|
1563
|
+
* heals the snapshot to match the truncated event log) must drain first, or
|
|
1564
|
+
* the late write lands after the heal and clobbers the rollback — and
|
|
1565
|
+
* re-emits `contextPersisted`, flushing the poisoned state remotely. Drains
|
|
1566
|
+
* until stable in case a persist enqueues while we await, though after
|
|
1567
|
+
* `dispose()` none should start.
|
|
1568
|
+
*/
|
|
1569
|
+
async drainPersists() {
|
|
1570
|
+
while (this.inFlightPersists.size > 0) {
|
|
1571
|
+
await Promise.allSettled([...this.inFlightPersists]);
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* Persist failures are swallowed (logged + recorded on the span) — a
|
|
1576
|
+
* storage error must never fail the conversation turn that triggered it.
|
|
1577
|
+
*
|
|
1578
|
+
* Tracks the returned promise in {@link inFlightPersists} so a concurrent
|
|
1579
|
+
* {@link drainPersists} can await a write that has already begun.
|
|
1580
|
+
*/
|
|
1581
|
+
persist(trigger) {
|
|
1582
|
+
const run = this.runPersist(trigger);
|
|
1583
|
+
this.inFlightPersists.add(run);
|
|
1584
|
+
// `runPersist` swallows the storage error itself (logs + records on the
|
|
1585
|
+
// span), so `run` only rejects for a failure OUTSIDE that try — the tracer
|
|
1586
|
+
// or persist-accounting path. Log it here rather than an empty catch: this
|
|
1587
|
+
// is the sole place a fire-and-forget persist's out-of-band failure is
|
|
1588
|
+
// observable, and `drainPersists` deliberately discards settled results.
|
|
1589
|
+
void run
|
|
1590
|
+
.catch((err) => logger.error(`Persist tracking failed for context '${this.contextId?.name ?? "ephemeral"}': ${err}`))
|
|
1591
|
+
.finally(() => this.inFlightPersists.delete(run));
|
|
1592
|
+
return run;
|
|
1593
|
+
}
|
|
1594
|
+
async runPersist(trigger) {
|
|
1595
|
+
if (this.isDisposed) {
|
|
1596
|
+
// A concurrent checkpoint restore or New Chat disposes the shared
|
|
1597
|
+
// ContextV2 instance (all editors of an app share one, keyed
|
|
1598
|
+
// appId::name). An in-flight turn can still reach here; persisting now
|
|
1599
|
+
// would silently clobber the just-restored/cleared context, so skip —
|
|
1600
|
+
// and log it, since the collision was previously invisible.
|
|
1601
|
+
logger.warn(`Skipping '${trigger}' persist for context '${this.contextId?.name ?? "ephemeral"}': context was disposed (concurrent checkpoint restore or New Chat)`);
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1604
|
+
if (!this.onPersist) {
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
const onPersist = this.onPersist;
|
|
1608
|
+
const tracer = this.tracer ?? LLMObsTracer.instance;
|
|
1609
|
+
await tracer.trace({ kind: "task", name: "context.persist" }, async (span) => {
|
|
1610
|
+
// Re-check after the tracer's async boundary: dispose() may have run
|
|
1611
|
+
// between the guard above and here. No await sits between this check
|
|
1612
|
+
// and the onPersist call below, so this closes the clobber window.
|
|
1613
|
+
if (this.isDisposed) {
|
|
1614
|
+
logger.warn(`Skipping '${trigger}' persist for context '${this.contextId?.name ?? "ephemeral"}': context disposed mid-persist (concurrent checkpoint restore or New Chat)`);
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
const startedAt = performance.now();
|
|
1618
|
+
// Capture CPU time and event-loop activity across the await so a slow
|
|
1619
|
+
// persist can be classified after the fact. The persist
|
|
1620
|
+
// body is a tiny mkdir + JSON.stringify + writeFile, yet wall-clock
|
|
1621
|
+
// occasionally runs to minutes uncorrelated with size, which means the
|
|
1622
|
+
// single dev-server event loop was frozen during the await, not the
|
|
1623
|
+
// file write. cpuMs near zero while wall-clock is large means the
|
|
1624
|
+
// process got no CPU (k8s CFS throttle / deschedule); cpuMs tracking
|
|
1625
|
+
// wall-clock means a synchronous CPU-bound block (or GC) held the
|
|
1626
|
+
// loop. loopUtilization gives corroborating context: low means the
|
|
1627
|
+
// loop was idle/waiting, high means it was spinning on callbacks.
|
|
1628
|
+
// gVisor-sandboxed pods export no cgroup CPU/throttle metrics, so this
|
|
1629
|
+
// in-process signal has to ride the log line below, which does export
|
|
1630
|
+
// from prod.
|
|
1631
|
+
const cpuStart = process.cpuUsage();
|
|
1632
|
+
const eluStart = performance.eventLoopUtilization();
|
|
1633
|
+
let persistError;
|
|
1634
|
+
try {
|
|
1635
|
+
await onPersist(this.toRecord());
|
|
1636
|
+
}
|
|
1637
|
+
catch (err) {
|
|
1638
|
+
persistError = err;
|
|
1639
|
+
logger.error(`Failed to persist context: ${err}`);
|
|
1640
|
+
}
|
|
1641
|
+
const elapsedMs = performance.now() - startedAt;
|
|
1642
|
+
const cpu = process.cpuUsage(cpuStart);
|
|
1643
|
+
const cpuMs = Math.round((cpu.user + cpu.system) / 1000);
|
|
1644
|
+
const loopUtilization = Math.round(performance.eventLoopUtilization(eluStart).utilization * 100) / 100;
|
|
1645
|
+
tracer.annotate(span, {
|
|
1646
|
+
tags: { trigger },
|
|
1647
|
+
metadata: {
|
|
1648
|
+
durationMs: Math.round(elapsedMs),
|
|
1649
|
+
messageCount: this.messages.length,
|
|
1650
|
+
cpuMs,
|
|
1651
|
+
loopUtilization,
|
|
1652
|
+
},
|
|
1653
|
+
...(persistError !== undefined ? { error: persistError } : {}),
|
|
1654
|
+
});
|
|
1655
|
+
recordContextPersist({
|
|
1656
|
+
trigger,
|
|
1657
|
+
durationMs: elapsedMs,
|
|
1658
|
+
identity: this.getMetricIdentity(),
|
|
1659
|
+
});
|
|
1660
|
+
if (elapsedMs > SLOW_PERSIST_WARN_MS) {
|
|
1661
|
+
logger.warn(`slow persist: ${Math.round(elapsedMs)}ms (messages=${this.messages.length}, cpuMs=${cpuMs}, loopUtilization=${loopUtilization})`);
|
|
1662
|
+
}
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
//# sourceMappingURL=context.js.map
|