@1mcp/agent 0.40.0-beta.0 → 0.40.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/build/admin/assets/{admin-OAuthServicesWorkspace-Bu74Bzt5.js → admin-OAuthServicesWorkspace-pgsV0qQs.js} +1 -1
- package/build/admin/assets/admin-console-lrFAX4EQ.js +3 -0
- package/build/admin/index.html +1 -1
- package/build/auth/oauthDiagnostics.d.ts +4 -0
- package/build/auth/oauthDiagnostics.d.ts.map +1 -1
- package/build/auth/oauthDiagnostics.js +4 -0
- package/build/auth/oauthDiagnostics.js.map +1 -1
- package/build/auth/oauthEndpointFetch.d.ts +2 -1
- package/build/auth/oauthEndpointFetch.d.ts.map +1 -1
- package/build/auth/oauthEndpointFetch.js +17 -6
- package/build/auth/oauthEndpointFetch.js.map +1 -1
- package/build/auth/sessionTypes.d.ts +1 -1
- package/build/cli.d.ts.map +1 -1
- package/build/cli.js +9 -1
- package/build/cli.js.map +1 -1
- package/build/commands/app/backups.d.ts.map +1 -1
- package/build/commands/app/backups.js +2 -1
- package/build/commands/app/backups.js.map +1 -1
- package/build/commands/app/consolidate.d.ts.map +1 -1
- package/build/commands/app/consolidate.js +5 -4
- package/build/commands/app/consolidate.js.map +1 -1
- package/build/commands/app/discover.d.ts.map +1 -1
- package/build/commands/app/discover.js +2 -1
- package/build/commands/app/discover.js.map +1 -1
- package/build/commands/app/index.d.ts.map +1 -1
- package/build/commands/app/index.js +30 -15
- package/build/commands/app/index.js.map +1 -1
- package/build/commands/app/restore.d.ts.map +1 -1
- package/build/commands/app/restore.js +6 -5
- package/build/commands/app/restore.js.map +1 -1
- package/build/commands/app/status.d.ts.map +1 -1
- package/build/commands/app/status.js +2 -1
- package/build/commands/app/status.js.map +1 -1
- package/build/commands/bootstrap/bootstrap.d.ts +2 -2
- package/build/commands/bootstrap/bootstrap.d.ts.map +1 -1
- package/build/commands/bootstrap/bootstrap.js +54 -31
- package/build/commands/bootstrap/bootstrap.js.map +1 -1
- package/build/commands/bootstrap/bootstrapOwnership.d.ts.map +1 -1
- package/build/commands/bootstrap/bootstrapOwnership.js +74 -42
- package/build/commands/bootstrap/bootstrapOwnership.js.map +1 -1
- package/build/commands/bootstrap/index.d.ts.map +1 -1
- package/build/commands/bootstrap/index.js +5 -2
- package/build/commands/bootstrap/index.js.map +1 -1
- package/build/commands/cliSetup/index.d.ts.map +1 -1
- package/build/commands/cliSetup/index.js +14 -11
- package/build/commands/cliSetup/index.js.map +1 -1
- package/build/commands/inspect/index.js +1 -1
- package/build/commands/inspect/index.js.map +1 -1
- package/build/commands/inspect/inspect.d.ts.map +1 -1
- package/build/commands/inspect/inspect.js +4 -1
- package/build/commands/inspect/inspect.js.map +1 -1
- package/build/commands/inspect/inspectUtils.d.ts +1 -0
- package/build/commands/inspect/inspectUtils.d.ts.map +1 -1
- package/build/commands/inspect/inspectUtils.js +10 -2
- package/build/commands/inspect/inspectUtils.js.map +1 -1
- package/build/commands/mcp/add.d.ts.map +1 -1
- package/build/commands/mcp/add.js +2 -1
- package/build/commands/mcp/add.js.map +1 -1
- package/build/commands/mcp/enable.d.ts.map +1 -1
- package/build/commands/mcp/enable.js +2 -1
- package/build/commands/mcp/enable.js.map +1 -1
- package/build/commands/mcp/index.d.ts.map +1 -1
- package/build/commands/mcp/index.js +85 -56
- package/build/commands/mcp/index.js.map +1 -1
- package/build/commands/mcp/install.d.ts.map +1 -1
- package/build/commands/mcp/install.js +6 -5
- package/build/commands/mcp/install.js.map +1 -1
- package/build/commands/mcp/list.d.ts.map +1 -1
- package/build/commands/mcp/list.js +2 -1
- package/build/commands/mcp/list.js.map +1 -1
- package/build/commands/mcp/remove.d.ts.map +1 -1
- package/build/commands/mcp/remove.js +2 -1
- package/build/commands/mcp/remove.js.map +1 -1
- package/build/commands/mcp/status.d.ts.map +1 -1
- package/build/commands/mcp/status.js +2 -1
- package/build/commands/mcp/status.js.map +1 -1
- package/build/commands/mcp/tokens.d.ts.map +1 -1
- package/build/commands/mcp/tokens.js +5 -4
- package/build/commands/mcp/tokens.js.map +1 -1
- package/build/commands/mcp/tools.d.ts.map +1 -1
- package/build/commands/mcp/tools.js +17 -8
- package/build/commands/mcp/tools.js.map +1 -1
- package/build/commands/preset/delete.d.ts.map +1 -1
- package/build/commands/preset/delete.js +2 -1
- package/build/commands/preset/delete.js.map +1 -1
- package/build/commands/preset/edit.d.ts.map +1 -1
- package/build/commands/preset/edit.js +3 -2
- package/build/commands/preset/edit.js.map +1 -1
- package/build/commands/preset/index.d.ts.map +1 -1
- package/build/commands/preset/index.js +34 -17
- package/build/commands/preset/index.js.map +1 -1
- package/build/commands/preset/interactive.d.ts.map +1 -1
- package/build/commands/preset/interactive.js +2 -1
- package/build/commands/preset/interactive.js.map +1 -1
- package/build/commands/preset/list.d.ts.map +1 -1
- package/build/commands/preset/list.js +2 -1
- package/build/commands/preset/list.js.map +1 -1
- package/build/commands/preset/show.d.ts.map +1 -1
- package/build/commands/preset/show.js +2 -1
- package/build/commands/preset/show.js.map +1 -1
- package/build/commands/preset/test.d.ts.map +1 -1
- package/build/commands/preset/test.js +2 -1
- package/build/commands/preset/test.js.map +1 -1
- package/build/commands/preset/url.d.ts.map +1 -1
- package/build/commands/preset/url.js +2 -1
- package/build/commands/preset/url.js.map +1 -1
- package/build/commands/proxy/proxy.d.ts.map +1 -1
- package/build/commands/proxy/proxy.js +4 -0
- package/build/commands/proxy/proxy.js.map +1 -1
- package/build/commands/registry/index.d.ts.map +1 -1
- package/build/commands/registry/index.js +21 -10
- package/build/commands/registry/index.js.map +1 -1
- package/build/commands/registry/search.d.ts.map +1 -1
- package/build/commands/registry/search.js +2 -1
- package/build/commands/registry/search.js.map +1 -1
- package/build/commands/registry/show.d.ts.map +1 -1
- package/build/commands/registry/show.js +2 -1
- package/build/commands/registry/show.js.map +1 -1
- package/build/commands/registry/status.d.ts.map +1 -1
- package/build/commands/registry/status.js +2 -1
- package/build/commands/registry/status.js.map +1 -1
- package/build/commands/registry/versions.d.ts.map +1 -1
- package/build/commands/registry/versions.js +2 -1
- package/build/commands/registry/versions.js.map +1 -1
- package/build/commands/run/index.d.ts.map +1 -1
- package/build/commands/run/index.js +9 -1
- package/build/commands/run/index.js.map +1 -1
- package/build/commands/run/run.d.ts +2 -0
- package/build/commands/run/run.d.ts.map +1 -1
- package/build/commands/run/run.js +23 -5
- package/build/commands/run/run.js.map +1 -1
- package/build/commands/run/stdoutBudget.d.ts +10 -0
- package/build/commands/run/stdoutBudget.d.ts.map +1 -0
- package/build/commands/run/stdoutBudget.js +102 -0
- package/build/commands/run/stdoutBudget.js.map +1 -0
- package/build/commands/serve/cooperativeRuntime.d.ts.map +1 -1
- package/build/commands/serve/cooperativeRuntime.js +7 -0
- package/build/commands/serve/cooperativeRuntime.js.map +1 -1
- package/build/commands/serve/index.d.ts.map +1 -1
- package/build/commands/serve/index.js +5 -0
- package/build/commands/serve/index.js.map +1 -1
- package/build/commands/serve/serveBackground.d.ts.map +1 -1
- package/build/commands/serve/serveBackground.js +12 -0
- package/build/commands/serve/serveBackground.js.map +1 -1
- package/build/commands/shared/commandRunner.d.ts +2 -1
- package/build/commands/shared/commandRunner.d.ts.map +1 -1
- package/build/commands/shared/commandRunner.js +15 -3
- package/build/commands/shared/commandRunner.js.map +1 -1
- package/build/commands/shared/inspectApiSchemas.d.ts +8 -8
- package/build/commands/shared/productCommandFamily.d.ts +4 -0
- package/build/commands/shared/productCommandFamily.d.ts.map +1 -0
- package/build/commands/shared/productCommandFamily.js +27 -0
- package/build/commands/shared/productCommandFamily.js.map +1 -0
- package/build/commands/shared/projectOwnerStore.d.ts +22 -5
- package/build/commands/shared/projectOwnerStore.d.ts.map +1 -1
- package/build/commands/shared/projectOwnerStore.js +125 -29
- package/build/commands/shared/projectOwnerStore.js.map +1 -1
- package/build/commands/telemetry/index.d.ts +3 -0
- package/build/commands/telemetry/index.d.ts.map +1 -0
- package/build/commands/telemetry/index.js +35 -0
- package/build/commands/telemetry/index.js.map +1 -0
- package/build/config/configManager.d.ts.map +1 -1
- package/build/config/configManager.js +10 -0
- package/build/config/configManager.js.map +1 -1
- package/build/config/productTelemetryBootstrap.d.ts +12 -0
- package/build/config/productTelemetryBootstrap.d.ts.map +1 -0
- package/build/config/productTelemetryBootstrap.js +40 -0
- package/build/config/productTelemetryBootstrap.js.map +1 -0
- package/build/constants/mcp.d.ts +1 -1
- package/build/constants/mcp.js +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts +2 -0
- package/build/core/capabilities/lazyLoadingOrchestrator.d.ts.map +1 -1
- package/build/core/capabilities/lazyLoadingOrchestrator.js +4 -0
- package/build/core/capabilities/lazyLoadingOrchestrator.js.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.d.ts.map +1 -1
- package/build/core/capabilities/runtimeCapabilityCatalog.js +10 -0
- package/build/core/capabilities/runtimeCapabilityCatalog.js.map +1 -1
- package/build/core/server/runtimeLaunchIpc.d.ts +19 -13
- package/build/core/server/runtimeLaunchIpc.d.ts.map +1 -1
- package/build/core/server/runtimeReplacementConfig.d.ts +19 -13
- package/build/core/server/runtimeReplacementConfig.d.ts.map +1 -1
- package/build/core/tools/handlers/serverManagementHandler.d.ts +23 -9
- package/build/core/tools/handlers/serverManagementHandler.d.ts.map +1 -1
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts +4 -2
- package/build/core/tools/internal/adapters/helpers/configTransformers.d.ts.map +1 -1
- package/build/core/tools/internal/schemas/discovery.d.ts +3 -3
- package/build/core/tools/internal/schemas/edit.d.ts +5 -6
- package/build/core/tools/internal/schemas/edit.d.ts.map +1 -1
- package/build/core/tools/internal/schemas/edit.js +2 -10
- package/build/core/tools/internal/schemas/edit.js.map +1 -1
- package/build/core/tools/internal/schemas/index.d.ts +18 -13
- package/build/core/tools/internal/schemas/index.d.ts.map +1 -1
- package/build/core/tools/internal/schemas/installation.d.ts +1 -1
- package/build/core/tools/internal/schemas/management.d.ts +9 -9
- package/build/core/types/transport.d.ts +36 -24
- package/build/core/types/transport.d.ts.map +1 -1
- package/build/core/types/transport.js +13 -0
- package/build/core/types/transport.js.map +1 -1
- package/build/domains/admin/adminConfiguredServerService.d.ts.map +1 -1
- package/build/domains/admin/adminConfiguredServerService.js +30 -14
- package/build/domains/admin/adminConfiguredServerService.js.map +1 -1
- package/build/domains/admin/adminOperationService.d.ts +1 -0
- package/build/domains/admin/adminOperationService.d.ts.map +1 -1
- package/build/domains/admin/adminOperationService.js +38 -0
- package/build/domains/admin/adminOperationService.js.map +1 -1
- package/build/domains/installation/serverInstallationSourceResolution.js +1 -0
- package/build/domains/installation/serverInstallationSourceResolution.js.map +1 -1
- package/build/domains/installation/serverInstallationTypes.d.ts +1 -0
- package/build/domains/installation/serverInstallationTypes.d.ts.map +1 -1
- package/build/domains/preset/services/presetErrorHandler.d.ts.map +1 -1
- package/build/domains/preset/services/presetErrorHandler.js +3 -2
- package/build/domains/preset/services/presetErrorHandler.js.map +1 -1
- package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.d.ts.map +1 -1
- package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js +2 -2
- package/build/gateway/adapters/legacy/legacyOutboundEraAdapter.js.map +1 -1
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js +2 -2
- package/build/gateway/adapters/modern/modernOutboundEraAdapter.js.map +1 -1
- package/build/gateway/contracts/gatewayFailure.d.ts.map +1 -1
- package/build/gateway/contracts/gatewayFailure.js +5 -0
- package/build/gateway/contracts/gatewayFailure.js.map +1 -1
- package/build/gateway/core/gatewayDispatcher.d.ts.map +1 -1
- package/build/gateway/core/gatewayDispatcher.js +2 -3
- package/build/gateway/core/gatewayDispatcher.js.map +1 -1
- package/build/globalOptions.d.ts +24 -11
- package/build/globalOptions.d.ts.map +1 -1
- package/build/globalOptions.js +60 -1
- package/build/globalOptions.js.map +1 -1
- package/build/productTelemetry/commandScope.d.ts +8 -0
- package/build/productTelemetry/commandScope.d.ts.map +1 -0
- package/build/productTelemetry/commandScope.js +50 -0
- package/build/productTelemetry/commandScope.js.map +1 -0
- package/build/productTelemetry/contract.d.ts +136 -0
- package/build/productTelemetry/contract.d.ts.map +1 -0
- package/build/productTelemetry/contract.js +103 -0
- package/build/productTelemetry/contract.js.map +1 -0
- package/build/productTelemetry/delivery.d.ts +8 -0
- package/build/productTelemetry/delivery.d.ts.map +1 -0
- package/build/productTelemetry/delivery.js +142 -0
- package/build/productTelemetry/delivery.js.map +1 -0
- package/build/productTelemetry/index.d.ts +15 -0
- package/build/productTelemetry/index.d.ts.map +1 -0
- package/build/productTelemetry/index.js +118 -0
- package/build/productTelemetry/index.js.map +1 -0
- package/build/productTelemetry/installationStore.d.ts +117 -0
- package/build/productTelemetry/installationStore.d.ts.map +1 -0
- package/build/productTelemetry/installationStore.js +400 -0
- package/build/productTelemetry/installationStore.js.map +1 -0
- package/build/productTelemetry/notice.d.ts +3 -0
- package/build/productTelemetry/notice.d.ts.map +1 -0
- package/build/productTelemetry/notice.js +13 -0
- package/build/productTelemetry/notice.js.map +1 -0
- package/build/productTelemetry/operation.d.ts +9 -0
- package/build/productTelemetry/operation.d.ts.map +1 -0
- package/build/productTelemetry/operation.js +51 -0
- package/build/productTelemetry/operation.js.map +1 -0
- package/build/productTelemetry/permissions.d.ts +8 -0
- package/build/productTelemetry/permissions.d.ts.map +1 -0
- package/build/productTelemetry/permissions.js +10 -0
- package/build/productTelemetry/permissions.js.map +1 -0
- package/build/productTelemetry/policy.d.ts +12 -0
- package/build/productTelemetry/policy.d.ts.map +1 -0
- package/build/productTelemetry/policy.js +31 -0
- package/build/productTelemetry/policy.js.map +1 -0
- package/build/productTelemetry/producer.d.ts +51 -0
- package/build/productTelemetry/producer.d.ts.map +1 -0
- package/build/productTelemetry/producer.js +214 -0
- package/build/productTelemetry/producer.js.map +1 -0
- package/build/sdk/contracts/jsonValue.d.ts +2 -0
- package/build/sdk/contracts/jsonValue.d.ts.map +1 -1
- package/build/sdk/contracts/jsonValue.js +5 -0
- package/build/sdk/contracts/jsonValue.js.map +1 -1
- package/build/sdk/contracts/protocol.d.ts +3 -1
- package/build/sdk/contracts/protocol.d.ts.map +1 -1
- package/build/sdk/contracts/protocol.js +9 -1
- package/build/sdk/contracts/protocol.js.map +1 -1
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts +2 -0
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.d.ts.map +1 -1
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.js +30 -8
- package/build/sdk/legacy/auth/sdkOAuthClientProvider.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.js +2 -2
- package/build/sdk/legacy/client/runtime/legacyGatewayClientAdapter.js.map +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js +3 -0
- package/build/sdk/legacy/client/runtime/legacySdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js +5 -3
- package/build/sdk/legacy/client/runtime/modernSdkClientAdapter.js.map +1 -1
- package/build/sdk/legacy/commands/serve.d.ts +1 -0
- package/build/sdk/legacy/commands/serve.d.ts.map +1 -1
- package/build/sdk/legacy/commands/serve.js +30 -1
- package/build/sdk/legacy/commands/serve.js.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.js +1 -1
- package/build/sdk/legacy/server/runtime/connectionManager.js.map +1 -1
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts +3 -1
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.d.ts.map +1 -1
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js +52 -2
- package/build/sdk/legacy/server/runtime/legacySdkServerAdapter.js.map +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.d.ts.map +1 -1
- package/build/sdk/legacy/shared/capabilityListCapture.js +5 -2
- package/build/sdk/legacy/shared/capabilityListCapture.js.map +1 -1
- package/build/sdk/legacy/shared/schemaProjection.d.ts.map +1 -1
- package/build/sdk/legacy/shared/schemaProjection.js +8 -4
- package/build/sdk/legacy/shared/schemaProjection.js.map +1 -1
- package/build/sdk/legacy/transport/http/server.d.ts +1 -1
- package/build/sdk/legacy/transport/http/server.d.ts.map +1 -1
- package/build/sdk/legacy/transport/http/server.js +5 -1
- package/build/sdk/legacy/transport/http/server.js.map +1 -1
- package/build/sdk/legacy/transport/transportFactory.d.ts.map +1 -1
- package/build/sdk/legacy/transport/transportFactory.js +2 -0
- package/build/sdk/legacy/transport/transportFactory.js.map +1 -1
- package/build/transport/http/routes/adminRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/adminRoutes.js +2 -0
- package/build/transport/http/routes/adminRoutes.js.map +1 -1
- package/build/transport/http/routes/inspectRoutes.d.ts +2 -0
- package/build/transport/http/routes/inspectRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/inspectRoutes.js +28 -4
- package/build/transport/http/routes/inspectRoutes.js.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/modernHttpRoutes.js +6 -5
- package/build/transport/http/routes/modernHttpRoutes.js.map +1 -1
- package/build/transport/http/routes/modernProductTelemetry.d.ts +4 -0
- package/build/transport/http/routes/modernProductTelemetry.d.ts.map +1 -0
- package/build/transport/http/routes/modernProductTelemetry.js +65 -0
- package/build/transport/http/routes/modernProductTelemetry.js.map +1 -0
- package/build/transport/http/routes/modernSubscriptions.d.ts.map +1 -1
- package/build/transport/http/routes/modernSubscriptions.js +28 -12
- package/build/transport/http/routes/modernSubscriptions.js.map +1 -1
- package/build/transport/http/routes/preparationRoutes.d.ts +2 -2
- package/build/transport/http/routes/projectRoutes.d.ts +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.d.ts.map +1 -1
- package/build/transport/http/routes/streamableHttpRoutes.js +6 -0
- package/build/transport/http/routes/streamableHttpRoutes.js.map +1 -1
- package/build/utils/core/errorHandling.js +2 -2
- package/build/utils/core/errorHandling.js.map +1 -1
- package/build/utils/security/privateFileSystem.d.ts +12 -0
- package/build/utils/security/privateFileSystem.d.ts.map +1 -0
- package/build/utils/security/privateFileSystem.js +114 -0
- package/build/utils/security/privateFileSystem.js.map +1 -0
- package/package.json +6 -4
- package/build/admin/assets/admin-console-DVuqABnE.js +0 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InstallationStore } from './installationStore.js';
|
|
2
|
+
import { type CommandCompletion, type CommandName, type FeatureName, type OperationName } from './producer.js';
|
|
3
|
+
export { PRODUCT_NOTICE } from './notice.js';
|
|
4
|
+
export declare function localInstallationStore(background?: boolean): InstallationStore;
|
|
5
|
+
export declare function beginProductCommand(name: CommandName): CommandCompletion;
|
|
6
|
+
export declare function beginProductFeature(name: FeatureName): CommandCompletion;
|
|
7
|
+
export declare function recordProductFeature(name: FeatureName, outcome: 'success' | 'failure'): void;
|
|
8
|
+
export declare function beginProductOperation(name: OperationName, transport: 'none' | 'stdio' | 'http' | 'sse', client: 'none' | 'claude' | 'codex' | 'cursor' | 'vscode' | 'other'): CommandCompletion;
|
|
9
|
+
export declare function recordProductOperation(name: OperationName, outcome: 'success' | 'failure', transport: 'none' | 'stdio' | 'http' | 'sse', client: 'none' | 'claude' | 'codex' | 'cursor' | 'vscode' | 'other'): void;
|
|
10
|
+
export declare function observeProductRuntimeConfiguration(name: 'servers' | 'tools', count: number): void;
|
|
11
|
+
/** Snapshot only: attaches finite buckets to the next genuine activity. */
|
|
12
|
+
export declare function observeProductConfiguration(name: 'servers' | 'tools', count: number): void;
|
|
13
|
+
/** One invocation owns readiness/failure/cancellation; shutdown creates no outcome. */
|
|
14
|
+
export declare function beginProductStartup(name: 'serve' | 'proxy' | 'runtime_start'): C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G;AAED,2EAA2E;AAC3E,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAE1F;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,eAAe,GAAG,iBAAiB,CAyBhG"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { getProductCollectionPolicy, initializeProductTelemetry, productCollectionEnabled, } from '../config/productTelemetryBootstrap.js';
|
|
3
|
+
import { MCP_SERVER_VERSION } from '../constants.js';
|
|
4
|
+
import { getGlobalConfigDir } from '../constants/paths.js';
|
|
5
|
+
import { abortProductDelivery, dispatchProductBatch, prepareProductDelivery } from './delivery.js';
|
|
6
|
+
import { InstallationStore } from './installationStore.js';
|
|
7
|
+
import { writeProductNotice } from './notice.js';
|
|
8
|
+
import { ProductUsageProducer, } from './producer.js';
|
|
9
|
+
let producer;
|
|
10
|
+
export { PRODUCT_NOTICE } from './notice.js';
|
|
11
|
+
export function localInstallationStore(background = false) {
|
|
12
|
+
return new InstallationStore(path.join(getGlobalConfigDir(), 'product-telemetry'), {
|
|
13
|
+
background,
|
|
14
|
+
notice: writeProductNotice,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function collection() {
|
|
18
|
+
if (!productCollectionEnabled())
|
|
19
|
+
return;
|
|
20
|
+
try {
|
|
21
|
+
return initializeProductTelemetry(() => {
|
|
22
|
+
const policy = getProductCollectionPolicy();
|
|
23
|
+
producer ??= new ProductUsageProducer({
|
|
24
|
+
store: localInstallationStore(true),
|
|
25
|
+
now: Date.now,
|
|
26
|
+
dispatch: dispatchProductBatch,
|
|
27
|
+
prepareDelivery: prepareProductDelivery,
|
|
28
|
+
abortDelivery: abortProductDelivery,
|
|
29
|
+
dimensions: {
|
|
30
|
+
version: MCP_SERVER_VERSION,
|
|
31
|
+
os: platform(),
|
|
32
|
+
arch: architecture(),
|
|
33
|
+
node_major: Number(process.versions.node.split('.')[0]),
|
|
34
|
+
ci: policy.ci,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
return producer;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function beginProductCommand(name) {
|
|
45
|
+
return collection()?.beginCommand(name) ?? { finish: () => { } };
|
|
46
|
+
}
|
|
47
|
+
export function beginProductFeature(name) {
|
|
48
|
+
return collection()?.beginFeature(name) ?? { finish: () => { } };
|
|
49
|
+
}
|
|
50
|
+
export function recordProductFeature(name, outcome) {
|
|
51
|
+
collection()?.recordFeature(name, outcome);
|
|
52
|
+
}
|
|
53
|
+
export function beginProductOperation(name, transport, client) {
|
|
54
|
+
return collection()?.beginOperation(name, transport, client) ?? { finish: () => { } };
|
|
55
|
+
}
|
|
56
|
+
export function recordProductOperation(name, outcome, transport, client) {
|
|
57
|
+
collection()?.recordOperation(name, outcome, transport, client);
|
|
58
|
+
}
|
|
59
|
+
export function observeProductRuntimeConfiguration(name, count) {
|
|
60
|
+
producer?.observeRuntimeConfiguration(name, count);
|
|
61
|
+
}
|
|
62
|
+
/** Snapshot only: attaches finite buckets to the next genuine activity. */
|
|
63
|
+
export function observeProductConfiguration(name, count) {
|
|
64
|
+
producer?.observeConfiguration(name, count);
|
|
65
|
+
}
|
|
66
|
+
/** One invocation owns readiness/failure/cancellation; shutdown creates no outcome. */
|
|
67
|
+
export function beginProductStartup(name) {
|
|
68
|
+
const runtime = collection();
|
|
69
|
+
if (!runtime)
|
|
70
|
+
return { finish: () => { } };
|
|
71
|
+
runtime.startRuntime();
|
|
72
|
+
const command = name === 'runtime_start' ? runtime.beginRuntimeStartup() : runtime.beginCommand(name);
|
|
73
|
+
let finished = false;
|
|
74
|
+
const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
|
|
75
|
+
const handlers = signals.map((signal) => {
|
|
76
|
+
const handler = () => {
|
|
77
|
+
completion.finish('failure');
|
|
78
|
+
// Preserve the default signal action when no lifecycle owner installed a handler yet.
|
|
79
|
+
if (process.listenerCount(signal) === 0)
|
|
80
|
+
process.kill(process.pid, signal);
|
|
81
|
+
};
|
|
82
|
+
process.prependOnceListener(signal, handler);
|
|
83
|
+
return handler;
|
|
84
|
+
});
|
|
85
|
+
const completion = {
|
|
86
|
+
finish(outcome) {
|
|
87
|
+
if (finished)
|
|
88
|
+
return;
|
|
89
|
+
finished = true;
|
|
90
|
+
signals.forEach((signal, index) => process.removeListener(signal, handlers[index]));
|
|
91
|
+
command.finish(outcome);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
return completion;
|
|
95
|
+
}
|
|
96
|
+
function platform() {
|
|
97
|
+
switch (process.platform) {
|
|
98
|
+
case 'linux':
|
|
99
|
+
case 'darwin':
|
|
100
|
+
case 'win32':
|
|
101
|
+
case 'freebsd':
|
|
102
|
+
return process.platform;
|
|
103
|
+
default:
|
|
104
|
+
return 'other';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function architecture() {
|
|
108
|
+
switch (process.arch) {
|
|
109
|
+
case 'x64':
|
|
110
|
+
case 'arm64':
|
|
111
|
+
case 'arm':
|
|
112
|
+
case 'ia32':
|
|
113
|
+
return process.arch;
|
|
114
|
+
default:
|
|
115
|
+
return 'other';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/productTelemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,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IACF,OAAO,UAAU,CAAC;AACpB,CAAC;AACD,SAAS,QAAQ;IACf,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,QAAQ,CAAC;QAC1B;YACE,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AACD,SAAS,YAAY;IACnB,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,MAAM;YACT,OAAO,OAAO,CAAC,IAAI,CAAC;QACtB;YACE,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Summary } from './contract.js';
|
|
3
|
+
declare const stateSchema: z.ZodObject<{
|
|
4
|
+
format: z.ZodLiteral<1>;
|
|
5
|
+
epoch: z.ZodUUID;
|
|
6
|
+
generation: z.ZodNumber;
|
|
7
|
+
preference: z.ZodEnum<{
|
|
8
|
+
default: "default";
|
|
9
|
+
disabled: "disabled";
|
|
10
|
+
enabled: "enabled";
|
|
11
|
+
}>;
|
|
12
|
+
installationId: z.ZodOptional<z.ZodUUID>;
|
|
13
|
+
noticed: z.ZodBoolean;
|
|
14
|
+
queue: z.ZodArray<z.ZodObject<{
|
|
15
|
+
installation_id: z.ZodUUID;
|
|
16
|
+
occurred_at: z.ZodISODateTime;
|
|
17
|
+
version: z.ZodString;
|
|
18
|
+
os: z.ZodEnum<{
|
|
19
|
+
darwin: "darwin";
|
|
20
|
+
freebsd: "freebsd";
|
|
21
|
+
linux: "linux";
|
|
22
|
+
win32: "win32";
|
|
23
|
+
other: "other";
|
|
24
|
+
}>;
|
|
25
|
+
arch: z.ZodEnum<{
|
|
26
|
+
other: "other";
|
|
27
|
+
x64: "x64";
|
|
28
|
+
arm64: "arm64";
|
|
29
|
+
arm: "arm";
|
|
30
|
+
ia32: "ia32";
|
|
31
|
+
}>;
|
|
32
|
+
node_major: z.ZodNumber;
|
|
33
|
+
ci: z.ZodBoolean;
|
|
34
|
+
counters: z.ZodArray<z.ZodObject<{
|
|
35
|
+
kind: z.ZodEnum<{
|
|
36
|
+
command: "command";
|
|
37
|
+
configuration: "configuration";
|
|
38
|
+
feature: "feature";
|
|
39
|
+
operation: "operation";
|
|
40
|
+
}>;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
outcome: z.ZodEnum<{
|
|
43
|
+
failure: "failure";
|
|
44
|
+
success: "success";
|
|
45
|
+
observation: "observation";
|
|
46
|
+
}>;
|
|
47
|
+
transport: z.ZodEnum<{
|
|
48
|
+
http: "http";
|
|
49
|
+
sse: "sse";
|
|
50
|
+
stdio: "stdio";
|
|
51
|
+
none: "none";
|
|
52
|
+
}>;
|
|
53
|
+
client: z.ZodEnum<{
|
|
54
|
+
other: "other";
|
|
55
|
+
none: "none";
|
|
56
|
+
claude: "claude";
|
|
57
|
+
codex: "codex";
|
|
58
|
+
cursor: "cursor";
|
|
59
|
+
vscode: "vscode";
|
|
60
|
+
}>;
|
|
61
|
+
bucket: z.ZodEnum<{
|
|
62
|
+
1: "1";
|
|
63
|
+
0: "0";
|
|
64
|
+
none: "none";
|
|
65
|
+
"2-5": "2-5";
|
|
66
|
+
"6-20": "6-20";
|
|
67
|
+
"21-100": "21-100";
|
|
68
|
+
"101+": "101+";
|
|
69
|
+
}>;
|
|
70
|
+
count: z.ZodNumber;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
type State = z.infer<typeof stateSchema>;
|
|
75
|
+
export interface PreparedDelivery {
|
|
76
|
+
dispatch(body: string): void;
|
|
77
|
+
cancel(): void;
|
|
78
|
+
isReady(): boolean;
|
|
79
|
+
}
|
|
80
|
+
export type PrepareDelivery = () => Promise<PreparedDelivery | undefined>;
|
|
81
|
+
export interface AdmissionTicket {
|
|
82
|
+
readonly epoch: string;
|
|
83
|
+
readonly generation: number;
|
|
84
|
+
readonly installationId: string;
|
|
85
|
+
}
|
|
86
|
+
export interface InstallationStatus {
|
|
87
|
+
preference: State['preference'];
|
|
88
|
+
identityPresent: boolean;
|
|
89
|
+
queuedSummaries: number;
|
|
90
|
+
coordination: 'available' | 'busy-or-ambiguous';
|
|
91
|
+
}
|
|
92
|
+
export declare class InstallationStore {
|
|
93
|
+
private readonly root;
|
|
94
|
+
private readonly options;
|
|
95
|
+
constructor(root: string, options: {
|
|
96
|
+
notice: () => void | Promise<void>;
|
|
97
|
+
now?: () => number;
|
|
98
|
+
background?: boolean;
|
|
99
|
+
});
|
|
100
|
+
status(): Promise<InstallationStatus>;
|
|
101
|
+
control(action: 'enable' | 'disable' | 'reset'): Promise<void>;
|
|
102
|
+
admit(): Promise<AdmissionTicket | undefined>;
|
|
103
|
+
/** Read-only live-control observation; never creates an identity or admits activity. */
|
|
104
|
+
isCurrent(ticket: AdmissionTicket): Promise<boolean>;
|
|
105
|
+
append(ticket: AdmissionTicket, facts: Omit<Summary, 'installation_id'>): Promise<boolean>;
|
|
106
|
+
/** A durable final claim precedes payload handoff, within the generation lock. Prepare outside that lock. */
|
|
107
|
+
attemptSend(ticket: AdmissionTicket, dispatch: (body: string) => void | Promise<void>, prepare?: PrepareDelivery): Promise<void>;
|
|
108
|
+
private now;
|
|
109
|
+
private checkRoot;
|
|
110
|
+
private read;
|
|
111
|
+
private commit;
|
|
112
|
+
private cleanOrphanedWrites;
|
|
113
|
+
/** All acquisitions and dead-owner reclamation honor the same guard. An abandoned guard fails closed. */
|
|
114
|
+
private transaction;
|
|
115
|
+
}
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=installationStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installationStore.d.ts","sour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,OAAO,CAAC,kBAAkB,CAAC;IAYrC,OAAO,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAc9D,KAAK,IAAI,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAcnD,wFAAwF;IAClF,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAyChG,6GAA6G;IACvG,WAAW,CACf,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAChD,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC;IAgDhB,OAAO,CAAC,GAAG;YAIG,SAAS;YAaT,IAAI;YAqBJ,MAAM;YA0BN,mBAAmB;IAWjC,yGAAyG;YAC3F,WAAW;CA6C1B"}
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { constants } from 'node:fs';
|
|
3
|
+
import { lstat, mkdir, open, readdir, readFile, rename, rm } from 'node:fs/promises';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { DAY, envelopeSchema, MAX_BODY, summarySchema } from './contract.js';
|
|
8
|
+
import { secureNewInstallationEntry, verifyInstallationPrivacy } from './permissions.js';
|
|
9
|
+
const MAX_QUEUE = 256 * 1024;
|
|
10
|
+
const stateSchema = z.strictObject({
|
|
11
|
+
format: z.literal(1),
|
|
12
|
+
epoch: z.uuid(),
|
|
13
|
+
generation: z.number().int().nonnegative().safe(),
|
|
14
|
+
preference: z.enum(['default', 'enabled', 'disabled']),
|
|
15
|
+
installationId: z.uuid().optional(),
|
|
16
|
+
noticed: z.boolean(),
|
|
17
|
+
queue: z.array(summarySchema),
|
|
18
|
+
});
|
|
19
|
+
const ownerSchema = z.strictObject({ pid: z.number().int().positive(), nonce: z.uuid() });
|
|
20
|
+
export class InstallationStore {
|
|
21
|
+
root;
|
|
22
|
+
options;
|
|
23
|
+
constructor(root, options) {
|
|
24
|
+
this.root = root;
|
|
25
|
+
this.options = options;
|
|
26
|
+
}
|
|
27
|
+
async status() {
|
|
28
|
+
await this.checkRoot(false);
|
|
29
|
+
const state = await this.read();
|
|
30
|
+
const busy = (await exists(path.join(this.root, 'guard'))) || (await exists(path.join(this.root, 'lock')));
|
|
31
|
+
return {
|
|
32
|
+
preference: state?.preference ?? 'default',
|
|
33
|
+
identityPresent: Boolean(state?.installationId),
|
|
34
|
+
queuedSummaries: state?.queue.length ?? 0,
|
|
35
|
+
coordination: busy ? 'busy-or-ambiguous' : 'available',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async control(action) {
|
|
39
|
+
await this.transaction(async () => {
|
|
40
|
+
const state = (await this.read()) ?? freshState();
|
|
41
|
+
if (action === 'enable')
|
|
42
|
+
state.preference = 'enabled';
|
|
43
|
+
if (action === 'disable')
|
|
44
|
+
state.preference = 'disabled';
|
|
45
|
+
if (action !== 'enable') {
|
|
46
|
+
state.generation++;
|
|
47
|
+
state.queue = [];
|
|
48
|
+
}
|
|
49
|
+
if (action === 'reset')
|
|
50
|
+
delete state.installationId;
|
|
51
|
+
await this.commit(state);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async admit() {
|
|
55
|
+
return this.transaction(async () => {
|
|
56
|
+
const state = (await this.read()) ?? freshState();
|
|
57
|
+
if (state.preference === 'disabled')
|
|
58
|
+
return undefined;
|
|
59
|
+
if (!state.noticed) {
|
|
60
|
+
await this.options.notice();
|
|
61
|
+
state.noticed = true;
|
|
62
|
+
}
|
|
63
|
+
state.installationId ??= randomUUID();
|
|
64
|
+
await this.commit(state);
|
|
65
|
+
return { epoch: state.epoch, generation: state.generation, installationId: state.installationId };
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Read-only live-control observation; never creates an identity or admits activity. */
|
|
69
|
+
async isCurrent(ticket) {
|
|
70
|
+
await this.checkRoot(false);
|
|
71
|
+
return matches(await this.read(), ticket);
|
|
72
|
+
}
|
|
73
|
+
async append(ticket, facts) {
|
|
74
|
+
const incoming = summarySchema.omit({ installation_id: true }).parse(facts);
|
|
75
|
+
return this.transaction(async () => {
|
|
76
|
+
const state = await this.read();
|
|
77
|
+
if (!matches(state, ticket))
|
|
78
|
+
return false;
|
|
79
|
+
const now = this.now();
|
|
80
|
+
const pruned = prune(state, now);
|
|
81
|
+
if (now - Date.parse(incoming.occurred_at) > 7 * DAY) {
|
|
82
|
+
if (pruned)
|
|
83
|
+
await this.commit(state);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (Date.parse(incoming.occurred_at) - now > 300_000) {
|
|
87
|
+
if (pruned)
|
|
88
|
+
await this.commit(state);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (const counter of incoming.counters) {
|
|
92
|
+
let remaining = counter.count;
|
|
93
|
+
while (remaining > 0) {
|
|
94
|
+
let summary = state.queue.find((s) => sameDimensions(s, incoming) && s.counters.some((c) => sameCounter(c, counter) && c.count < 1_000_000));
|
|
95
|
+
summary ??= state.queue.find((s) => sameDimensions(s, incoming) && s.counters.length < 16);
|
|
96
|
+
if (!summary) {
|
|
97
|
+
summary = { ...incoming, installation_id: ticket.installationId, counters: [] };
|
|
98
|
+
state.queue.push(summary);
|
|
99
|
+
}
|
|
100
|
+
const existing = summary.counters.find((c) => sameCounter(c, counter) && c.count < 1_000_000);
|
|
101
|
+
const increment = Math.min(remaining, 1_000_000 - (existing?.count ?? 0));
|
|
102
|
+
if (existing)
|
|
103
|
+
existing.count += increment;
|
|
104
|
+
else
|
|
105
|
+
summary.counters.push({ ...counter, count: increment });
|
|
106
|
+
if (incoming.occurred_at < summary.occurred_at)
|
|
107
|
+
summary.occurred_at = incoming.occurred_at;
|
|
108
|
+
remaining -= increment;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
prune(state, now);
|
|
112
|
+
await this.commit(state);
|
|
113
|
+
return true;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** A durable final claim precedes payload handoff, within the generation lock. Prepare outside that lock. */
|
|
117
|
+
async attemptSend(ticket, dispatch, prepare) {
|
|
118
|
+
let prepared;
|
|
119
|
+
let handedOff = false;
|
|
120
|
+
if (prepare) {
|
|
121
|
+
const hasQueuedData = await this.transaction(async () => {
|
|
122
|
+
const state = await this.read();
|
|
123
|
+
if (!matches(state, ticket))
|
|
124
|
+
return false;
|
|
125
|
+
if (prune(state, this.now()))
|
|
126
|
+
await this.commit(state);
|
|
127
|
+
return state.queue.length > 0;
|
|
128
|
+
});
|
|
129
|
+
if (!hasQueuedData)
|
|
130
|
+
return;
|
|
131
|
+
// DNS/TLS must not hold the generation lock or consume the durable queue.
|
|
132
|
+
prepared = await prepare();
|
|
133
|
+
if (!prepared)
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
await this.transaction(async () => {
|
|
138
|
+
const state = await this.read();
|
|
139
|
+
if (!matches(state, ticket))
|
|
140
|
+
return;
|
|
141
|
+
const pruned = prune(state, this.now());
|
|
142
|
+
const batch = { schema_version: 1, batch_id: randomUUID(), summaries: [] };
|
|
143
|
+
for (const summary of state.queue.slice(0, 100)) {
|
|
144
|
+
batch.summaries.push(summary);
|
|
145
|
+
if (Buffer.byteLength(JSON.stringify(batch), 'utf8') > MAX_BODY) {
|
|
146
|
+
batch.summaries.pop();
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!batch.summaries.length) {
|
|
151
|
+
if (pruned)
|
|
152
|
+
await this.commit(state);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (prepared && !prepared.isReady())
|
|
156
|
+
return;
|
|
157
|
+
const body = JSON.stringify(envelopeSchema.parse(batch));
|
|
158
|
+
state.queue.splice(0, batch.summaries.length);
|
|
159
|
+
await this.commit(state);
|
|
160
|
+
handedOff = true;
|
|
161
|
+
try {
|
|
162
|
+
void Promise.resolve((prepared?.dispatch ?? dispatch)(body)).catch(() => { });
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
/* Every attempt is final. */
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
if (!handedOff)
|
|
171
|
+
prepared?.cancel();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
now() {
|
|
175
|
+
return this.options.now?.() ?? Date.now();
|
|
176
|
+
}
|
|
177
|
+
async checkRoot(create) {
|
|
178
|
+
const created = create ? await mkdir(this.root, { recursive: true, mode: 0o700 }) : undefined;
|
|
179
|
+
try {
|
|
180
|
+
await verifyInstallationPrivacy(this.root, {
|
|
181
|
+
background: this.options.background,
|
|
182
|
+
created: created !== undefined,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (!create && isMissing(error))
|
|
187
|
+
return;
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async read() {
|
|
192
|
+
const file = path.join(this.root, 'state.json');
|
|
193
|
+
try {
|
|
194
|
+
await checkPrivate(file, false);
|
|
195
|
+
const handle = await open(file, process.platform === 'win32' ? constants.O_RDONLY : constants.O_RDONLY | constants.O_NOFOLLOW, 0o600);
|
|
196
|
+
try {
|
|
197
|
+
if ((await handle.stat()).size > MAX_QUEUE + 4096)
|
|
198
|
+
throw new Error('Oversized product state');
|
|
199
|
+
return stateSchema.parse(JSON.parse(await handle.readFile('utf8')));
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
await handle.close();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
if (isMissing(error))
|
|
207
|
+
return undefined;
|
|
208
|
+
throw new Error('Product telemetry state unavailable; retain state and use offline recovery');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async commit(state) {
|
|
212
|
+
stateSchema.parse(state);
|
|
213
|
+
const temporary = path.join(this.root, `state-${randomUUID()}.tmp`);
|
|
214
|
+
try {
|
|
215
|
+
const handle = await open(temporary, 'wx', 0o600);
|
|
216
|
+
try {
|
|
217
|
+
await secureNewInstallationEntry(temporary, false, this.options.background);
|
|
218
|
+
await handle.writeFile(JSON.stringify(state));
|
|
219
|
+
await handle.sync();
|
|
220
|
+
}
|
|
221
|
+
finally {
|
|
222
|
+
await handle.close();
|
|
223
|
+
}
|
|
224
|
+
await rename(temporary, path.join(this.root, 'state.json'));
|
|
225
|
+
if (process.platform !== 'win32') {
|
|
226
|
+
const directory = await open(this.root, 'r');
|
|
227
|
+
try {
|
|
228
|
+
await directory.sync();
|
|
229
|
+
}
|
|
230
|
+
finally {
|
|
231
|
+
await directory.close();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
await rm(temporary, { force: true });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async cleanOrphanedWrites() {
|
|
240
|
+
const entries = await readdir(this.root);
|
|
241
|
+
if (entries.length > 256)
|
|
242
|
+
throw new Error('Product telemetry temporary state requires offline recovery');
|
|
243
|
+
for (const entry of entries) {
|
|
244
|
+
if (!/^state-[0-9a-f-]{36}\.tmp$/.test(entry))
|
|
245
|
+
continue;
|
|
246
|
+
const file = path.join(this.root, entry);
|
|
247
|
+
await checkPrivate(file, false);
|
|
248
|
+
await rm(file);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/** All acquisitions and dead-owner reclamation honor the same guard. An abandoned guard fails closed. */
|
|
252
|
+
async transaction(work) {
|
|
253
|
+
await this.checkRoot(true);
|
|
254
|
+
const nonce = randomUUID();
|
|
255
|
+
const guard = path.join(this.root, 'guard');
|
|
256
|
+
const lock = path.join(this.root, 'lock');
|
|
257
|
+
const acquisitionDeadline = performance.now() + (process.platform === 'win32' ? 5000 : 1000);
|
|
258
|
+
while (performance.now() < acquisitionDeadline) {
|
|
259
|
+
let guarded = false;
|
|
260
|
+
let locked = false;
|
|
261
|
+
try {
|
|
262
|
+
try {
|
|
263
|
+
await mkdir(guard, { mode: 0o700 });
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
if (isExists(error)) {
|
|
267
|
+
await delay(10, undefined, { ref: !this.options.background });
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
throw error;
|
|
271
|
+
}
|
|
272
|
+
await secureNewInstallationEntry(guard, true, this.options.background);
|
|
273
|
+
await writeOwner(guard, nonce, this.options.background);
|
|
274
|
+
guarded = true;
|
|
275
|
+
if (await exists(lock)) {
|
|
276
|
+
const owner = ownerSchema.safeParse(await readOwner(lock));
|
|
277
|
+
if (!owner.success || !demonstrablyDead(owner.data.pid)) {
|
|
278
|
+
await delay(10, undefined, { ref: !this.options.background });
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
await rm(lock, { recursive: true });
|
|
282
|
+
}
|
|
283
|
+
await mkdir(lock, { mode: 0o700 });
|
|
284
|
+
await secureNewInstallationEntry(lock, true, this.options.background);
|
|
285
|
+
await writeOwner(lock, nonce, this.options.background);
|
|
286
|
+
locked = true;
|
|
287
|
+
await release(guard, nonce);
|
|
288
|
+
guarded = false;
|
|
289
|
+
await this.cleanOrphanedWrites();
|
|
290
|
+
return await work();
|
|
291
|
+
}
|
|
292
|
+
finally {
|
|
293
|
+
if (locked)
|
|
294
|
+
await release(lock, nonce);
|
|
295
|
+
if (guarded)
|
|
296
|
+
await release(guard, nonce);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
throw new Error('Product telemetry coordination busy or ambiguous; use offline recovery');
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function freshState() {
|
|
303
|
+
return { format: 1, epoch: randomUUID(), generation: 0, preference: 'default', noticed: false, queue: [] };
|
|
304
|
+
}
|
|
305
|
+
function isMissing(error) {
|
|
306
|
+
return hasCode(error, 'ENOENT');
|
|
307
|
+
}
|
|
308
|
+
function isExists(error) {
|
|
309
|
+
return hasCode(error, 'EEXIST');
|
|
310
|
+
}
|
|
311
|
+
function hasCode(error, code) {
|
|
312
|
+
return error instanceof Error && 'code' in error && error.code === code;
|
|
313
|
+
}
|
|
314
|
+
async function exists(file) {
|
|
315
|
+
try {
|
|
316
|
+
await lstat(file);
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
if (isMissing(error))
|
|
321
|
+
return false;
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
async function checkPrivate(file, directory) {
|
|
326
|
+
const info = await lstat(file);
|
|
327
|
+
if (info.isSymbolicLink() || (directory ? !info.isDirectory() : !info.isFile()))
|
|
328
|
+
throw new Error('Product telemetry path is not private');
|
|
329
|
+
if (process.platform === 'win32')
|
|
330
|
+
return;
|
|
331
|
+
if (info.uid !== process.getuid?.() || (info.mode & 0o077) !== 0)
|
|
332
|
+
throw new Error('Product telemetry path is not owner-only');
|
|
333
|
+
}
|
|
334
|
+
async function writeOwner(directory, nonce, background = false) {
|
|
335
|
+
const file = await open(path.join(directory, 'owner.json'), 'wx', 0o600);
|
|
336
|
+
try {
|
|
337
|
+
await secureNewInstallationEntry(path.join(directory, 'owner.json'), false, background);
|
|
338
|
+
await file.writeFile(JSON.stringify({ pid: process.pid, nonce }));
|
|
339
|
+
await file.sync();
|
|
340
|
+
}
|
|
341
|
+
finally {
|
|
342
|
+
await file.close();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
async function readOwner(directory) {
|
|
346
|
+
try {
|
|
347
|
+
await checkPrivate(directory, true);
|
|
348
|
+
await checkPrivate(path.join(directory, 'owner.json'), false);
|
|
349
|
+
return JSON.parse(await readFile(path.join(directory, 'owner.json'), 'utf8'));
|
|
350
|
+
}
|
|
351
|
+
catch {
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
async function release(directory, nonce) {
|
|
356
|
+
const owner = ownerSchema.safeParse(await readOwner(directory));
|
|
357
|
+
if (owner.success && owner.data.nonce === nonce && owner.data.pid === process.pid)
|
|
358
|
+
await rm(directory, { recursive: true });
|
|
359
|
+
}
|
|
360
|
+
function demonstrablyDead(pid) {
|
|
361
|
+
try {
|
|
362
|
+
process.kill(pid, 0);
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
catch (error) {
|
|
366
|
+
return hasCode(error, 'ESRCH');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function matches(state, ticket) {
|
|
370
|
+
if (!state || state.preference === 'disabled')
|
|
371
|
+
return false;
|
|
372
|
+
return (state.epoch === ticket.epoch &&
|
|
373
|
+
state.generation === ticket.generation &&
|
|
374
|
+
state.installationId === ticket.installationId);
|
|
375
|
+
}
|
|
376
|
+
function sameCounter(a, b) {
|
|
377
|
+
return (a.kind === b.kind &&
|
|
378
|
+
a.name === b.name &&
|
|
379
|
+
a.outcome === b.outcome &&
|
|
380
|
+
a.transport === b.transport &&
|
|
381
|
+
a.client === b.client &&
|
|
382
|
+
a.bucket === b.bucket);
|
|
383
|
+
}
|
|
384
|
+
function sameDimensions(a, b) {
|
|
385
|
+
return (a.occurred_at.slice(0, 10) === b.occurred_at.slice(0, 10) &&
|
|
386
|
+
a.version === b.version &&
|
|
387
|
+
a.os === b.os &&
|
|
388
|
+
a.arch === b.arch &&
|
|
389
|
+
a.node_major === b.node_major &&
|
|
390
|
+
a.ci === b.ci);
|
|
391
|
+
}
|
|
392
|
+
function prune(state, now) {
|
|
393
|
+
const previousLength = state.queue.length;
|
|
394
|
+
state.queue = state.queue.filter((s) => now - Date.parse(s.occurred_at) <= 7 * DAY);
|
|
395
|
+
state.queue.sort((a, b) => a.occurred_at.localeCompare(b.occurred_at));
|
|
396
|
+
while (Buffer.byteLength(JSON.stringify(state.queue), 'utf8') > MAX_QUEUE)
|
|
397
|
+
state.queue.shift();
|
|
398
|
+
return state.queue.length !== previousLength;
|
|
399
|
+
}
|
|
400
|
+
//# sourceMappingURL=installationStore.js.map
|