@wildo-ai/saas-backend-lib 1.1.1 → 1.1.3
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/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js +19 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +4 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts +35 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js +111 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts +50 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +199 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts +111 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js +140 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +138 -24
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts +124 -13
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +207 -21
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts +60 -8
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +174 -26
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +48 -4
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +102 -30
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts +55 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js +114 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +96 -32
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +80 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +298 -23
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +85 -5
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +146 -4
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +4 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js +39 -5
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +181 -2
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +533 -43
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts +36 -3
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.js +70 -8
- package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts +28 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js +90 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts +44 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js +99 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts +91 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js +152 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +186 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +474 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +100 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +209 -6
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +200 -4
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +593 -64
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts +36 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js +83 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts +9 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js +11 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +54 -13
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +38 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +67 -2
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +30 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +43 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +11 -3
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +30 -16
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +104 -25
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +18 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +106 -2
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +52 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +74 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +104 -11
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +260 -26
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts +30 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.js +25 -0
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js +11 -4
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +263 -13
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +376 -58
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +264 -7
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +414 -5
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js +7 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +140 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +42 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +65 -6
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts +110 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js +192 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +45 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts +5 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js +6 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +146 -46
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.js +121 -12
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts +38 -15
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js +17 -2
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +0 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.js +68 -76
- package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.js +23 -1
- package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +43 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js +52 -3
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +25 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js +41 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts +27 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.js +29 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.js +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts +70 -7
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js +134 -8
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts +66 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.js +102 -25
- package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts +5 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js +25 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts +33 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js +40 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +72 -4
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +60 -19
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.js +7 -1
- package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts +4 -2
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +256 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +333 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js +211 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts +45 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js +216 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js +78 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +2 -2
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts +89 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js +164 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts +26 -27
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js +50 -64
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.js +3 -3
- package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.js +4 -4
- package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +306 -7
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +539 -45
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +25 -2
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts +24 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +83 -11
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +76 -13
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.d.ts +94 -9
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.js +197 -17
- package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +60 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.js +167 -8
- package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +214 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js +566 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +87 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +252 -19
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts +109 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js +123 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +16 -10
- package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +67 -8
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +101 -28
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.js +12 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts +86 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js +288 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts +15 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js +76 -5
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js +6 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts +60 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js +63 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts +74 -0
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +200 -44
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts +7 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js +53 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts +12 -7
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +0 -13
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +14 -22
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +8 -3
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +25 -15
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +13 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +88 -8
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +333 -31
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js +4 -2
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts +113 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js +62 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/actors-system.backend.service.js +0 -2
- package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +107 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +519 -56
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +5 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +79 -16
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +34 -5
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +154 -20
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.js +27 -23
- package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js +7 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts +90 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js +368 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +9 -5
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +12 -17
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +308 -143
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts +0 -207
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js +8 -243
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +9 -14
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +18 -89
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts +86 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js +155 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +10 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +55 -5
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
- package/dist/esm/index.d.ts +15 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +45 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +82 -10
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +20 -3
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +21 -3
- package/dist/esm/inject/models/service-types.js.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.js +32 -4
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +84 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.js +235 -11
- package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +152 -6
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +49 -4
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts +66 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js +199 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +149 -13
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +411 -19
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +11 -2
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +28 -9
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +30 -10
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.js +52 -11
- package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts +62 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js +78 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +309 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +385 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +21 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.js +38 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -80
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -25
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -49
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -141
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -37
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -121
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +66 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +105 -10
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -58
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -223
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +10 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +60 -4
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.js +145 -43
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +0 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +142 -21
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.js +283 -58
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +108 -13
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +432 -101
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +2 -2
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.js +5 -5
- package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +117 -5
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +164 -6
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts +0 -6
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +54 -7
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +18 -8
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +20 -18
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +16 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +18 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts +66 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js +257 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts +12 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js +47 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts +87 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts +31 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js +13 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +19 -25
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +33 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.js +1 -4
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.js +1 -4
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.js +1 -4
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts +8 -4
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.js +25 -17
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
- package/dist/esm/queue/queue.backend.service.d.ts +3 -3
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue.backend.service.js +26 -4
- package/dist/esm/queue/queue.backend.service.js.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +2 -2
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js +18 -3
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts +50 -25
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js +147 -39
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts +9 -0
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +88 -15
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +16 -2
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.js +2 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js +14 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +2 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.js +8 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +60 -5
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +91 -7
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +36 -3
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.js +32 -10
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.js +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +51 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +26 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.js +181 -1
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +47 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.js +343 -77
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts +15 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js +28 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +5 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +24 -4
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +29 -4
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts +114 -0
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js +354 -3
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts +1 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js +22 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +0 -2
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +23 -14
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +0 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +15 -12
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +113 -3
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +207 -30
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +95 -2
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +153 -9
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +190 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +377 -53
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +77 -2
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +41 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +202 -23
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +42 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +34 -4
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +29 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +77 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +41 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +87 -4
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +43 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +277 -97
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts +28 -5
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js +72 -12
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +3 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts +28 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +283 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts +35 -0
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js +111 -21
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts +14 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js +49 -8
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js +4 -0
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +6 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts +37 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js +51 -0
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts +41 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js +45 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +77 -3
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +93 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js +95 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +124 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +142 -5
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +175 -14
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +385 -49
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +6 -14
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +13 -22
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts +60 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js +79 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +161 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +512 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +59 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js +22 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts +44 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js +20 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +191 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +385 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts +41 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js +358 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts +160 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +266 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +111 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +107 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts +54 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +153 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +195 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +387 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts +45 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js +291 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +62 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js +29 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts +127 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js +277 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts +66 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js +75 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +41 -3
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +83 -20
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.js +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts +26 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js +43 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +8 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +49 -0
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.js +17 -5
- package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +67 -29
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +47 -25
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts +143 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js +258 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts +39 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js +159 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +17 -9
- package/dist/esm/.builder.pid +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-task.backend.service.js","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-task.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WA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AAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IAIrD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAChE,WAAA,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;;GAV3C,qBAAqB,CAkhBjC;;AAED;;;;;;;;;GASG;AACH,SAAS,SAAS,CAAC,IAAwB,EAAE,OAAgB;IAC3D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,OAA6B,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;QACpH,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACzC;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3C,CAAC;AACH,CAAC","sourcesContent":["/**\n * A2A TASK service — materialise, read and advance the persisted work record that\n * backs the protocol's `Task` object.\n *\n * ## Not every turn has a task\n *\n * A task is materialised ONLY when the turn cannot complete inline: the client set\n * `configuration.blocking: false`, or the turn reached an interrupted state\n * (approval pause → `input-required`). Both are live. A blocking turn that answers in one shot\n * returns an A2A `Message` and writes no row. The spec permits both shapes — its\n * `SendMessageResponse` result is typed `Task | Message` — so this is conformance, not a\n * shortcut, and it keeps a per-turn row off the hot path.\n *\n * ⚠️ This paragraph previously supported that claim with a QUOTATION that does not appear in the\n * specification. The conclusion was right and the citation was invented; since this block is\n * `@wildo_source`-anchored it shipped verbatim into the app-facing skill, so app builders were\n * given fabricated protocol text as authority. Cite the type, not a remembered sentence.\n *\n * ## Ownership follows the CONVERSATION owner, not the payer\n *\n * A task is owned by the same scope as the execution that produced it, resolved\n * from `ConversationalOwnerScope`. That is deliberately NOT the budget service's\n * rule: budgeting resolves who PAYS (a delegated turn bills the user's active org),\n * whereas a task must be readable by the principal that created it. Diverging the\n * two would let a user create a task they cannot then `tasks/get`.\n *\n * ## Authorization: isolation is by OWNER FILTER, not by inherited RBAC\n *\n * ⚠️ Read this carefully before changing `readTask` — an earlier version of this comment\n * claimed reads \"travel the normal authorized path so RBAC applies for free\". **That was\n * false.** `readAsSystem` is the ACL-BYPASSING primitive: it synthesises an\n * `APP_ADMIN_SUPER_ADMIN` context regardless of the calling user's roles. The declared\n * `API_CALL` READ variant and its `polymorphicRole` map are NEVER exercised by this path.\n *\n * Isolation is real but comes from ONE place: every read is filtered by\n * `{ ...ownerFields, taskId }`, where `ownerFields` is derived from the authenticated\n * principal's own scope. A caller cannot reach another tenant's task because the filter\n * cannot name one.\n *\n * The practical consequence: **tightening `polymorphicRole` on the resource does NOT\n * tighten `tasks/get`.** If this path must honour role gates, it has to move to the\n * request-scoped service tier — relaxing the owner filter here would open cross-tenant\n * reads immediately.\n *\n * Writes are `*AsSystem` too, governed by `systemAccessPolicy` rather than op RBAC.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { inject, injectable } from 'inversify';\n\nimport {\n CoreResourceType,\n FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n FlowsActors_Status,\n type FlowActorTask,\n} from '@wildo-ai/saas-models';\n\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ConversationalOwnerScope, ConversationalExecutionBackendService } from '~wildo-backend-lib/flows-actors/services/conversational-execution.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { A2ATaskCancellationBackendService } from './a2a-task-cancellation.backend.service';\nimport type { A2APushDispatcherBackendService } from './a2a-push-dispatcher.backend.service';\nimport {\n A2A_DEFAULT_INSTANCE_REF,\n A2A_TaskState,\n ADVANCEABLE_TASK_STATUSES,\n isLivenessGovernedA2ATaskStatus,\n isTerminalA2ATaskStatus,\n toA2ATaskState,\n type A2A_OutboundTask,\n} from '../models/a2a.backend.schemas';\nimport {\n parsePushNotificationConfigs,\n serializePushNotificationConfigs,\n type A2A_StoredPushNotificationConfig,\n} from '../models/a2a-push-notification.backend.schemas';\n\n/** An owner scope resolved to its persisted TASK variant + owner FK + `*AsSystem` scope map. */\ninterface ResolvedTaskOwner {\n resourceType: CoreResourceType;\n ownerFields: Record<string, string>;\n scopeContext: { userId?: string; organizationId?: string; applicationId?: string };\n}\n\n/**\n * The FOUR-AXIS identity filter that addresses exactly one task, for exactly one caller.\n *\n * Extracted rather than repeated at each reader, because it is an isolation invariant and every\n * copy of it is a place a future edit can drop an axis. That is not hypothetical here — an earlier\n * pass shipped this filter with the instance axis missing, so two agents of the same tenant could\n * read each other's tasks, and the defect was invisible at the call site because the filter it was\n * copied from looked complete.\n *\n * All four are required, and each keeps apart a different pair:\n * - OWNER scope keeps tenants apart;\n * - `taskId` selects the row;\n * - `resourceServerInstanceRef` keeps two AGENTS of one tenant apart;\n * - `machineCredentialId` keeps two machine CLIENTS of one scope apart — which matters most on\n * APPLICATION scope, whose `applicationId` is a deployment singleton, so without it every\n * app-scope client resolves to the identical owner filter.\n *\n * The defaults are not conveniences: a task written by a caller that presented no instance or no\n * machine credential carries the sentinel, so omitting them here would fail to match its own rows\n * rather than matching more of them.\n */\nfunction buildTaskIdentityFilter(\n resolved: ResolvedTaskOwner,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n): Record<string, string> {\n return {\n ...resolved.ownerFields,\n taskId,\n resourceServerInstanceRef: instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n machineCredentialId: machineCredentialId ?? FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n };\n}\n\n/**\n * What happened to a requested lifecycle transition.\n *\n * THREE states, not a boolean (review finding N-3): \"the compare-and-swap refused because the task\n * is already terminal\" and \"the write failed\" are different facts, and collapsing them made a\n * transient database error answer `TaskNotCancelable` — telling the client something about the\n * task's STATE that was not true.\n */\nexport enum A2A_TaskTransitionOutcome {\n /** The compare-and-swap matched and the task moved to the requested status. */\n ADVANCED = 'advanced',\n /**\n * The transition was DECLINED on the task's own terms — the compare-and-swap found the task\n * already terminal, so the requested move is not legal from where it is. This is a fact about\n * the TASK, and it is what may safely surface to a client as `TaskNotCancelable`.\n */\n REFUSED = 'refused',\n /**\n * The transition could not be carried out — the task could not be resolved, or the write threw.\n * This is a fact about the ATTEMPT, not the task, and must never be reported as a statement\n * about the task's state (review finding N-3).\n */\n FAILED = 'failed',\n}\n\n/** Inputs needed to open a task for a turn that cannot complete inline. */\nexport interface MaterialiseTaskParams {\n owner: ConversationalOwnerScope;\n /** A2A conversation thread the task belongs to. */\n contextId: string;\n /** Short human-readable name — the client sees this when listing tasks. */\n title: string;\n /**\n * The A2A agent this turn arrived through — `undefined` for the default (unnamed) agent.\n *\n * Normalised to {@link A2A_DEFAULT_INSTANCE_REF} on the way to storage, and part of the\n * read/cancel filter thereafter, so one agent's token cannot reach another agent's tasks.\n */\n instanceRef?: string;\n /**\n * The machine credential that opened this task — `undefined` for a user-delegated turn.\n *\n * Normalised to {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL} on the way to storage and part of the\n * read filter thereafter, so two separately-credentialed clients sharing one owner scope cannot\n * reach each other's tasks.\n */\n machineCredentialId?: string;\n /** Soft link to the conversational execution, when one exists. */\n flowActorExecutionId?: string;\n /**\n * Initial state. `PROCESSING` for a turn already running; `AWAITING_APPROVAL` for a pause.\n *\n * Two production callers pass it, both on the approval-pause arm: the blocking `message/send`\n * path and `message/stream`, each of which must hand back something addressable because a paused\n * turn has no reply to send. The `blocking: false` branch still takes the default.\n *\n * This parameter was carried unexercised for exactly that arm rather than being removed as dead\n * code — the judgement paid off, since wiring the pause needed no signature change here. Pinned\n * by `a2a.controller.approval-surfacing.test.ts`.\n */\n status?: FlowsActors_Status;\n}\n\n@injectable()\nexport class A2ATaskBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n // Appended LAST — see the A2A controller for why new injections are never inserted.\n @inject(SAAS_SERVICE_TYPES.A2ATaskCancellationService) private readonly cancellation: A2ATaskCancellationBackendService,\n // Appended LAST, same rule. The direction is transport → core: the A2A task plane is a VIEW of\n // a conversational execution, so it may ask the core for state. The reverse would be wrong —\n // the core must never learn that A2A exists.\n @inject(SAAS_SERVICE_TYPES.ConversationalExecutionBackendService) private readonly conversationalExecution: ConversationalExecutionBackendService,\n @inject(SAAS_SERVICE_TYPES.A2APushDispatcherService) private readonly pushDispatcher: A2APushDispatcherBackendService,\n ) {}\n\n /**\n * The status a task ACTUALLY has, which for an approval-paused task is its execution's.\n *\n * ## The hole this closes\n *\n * A turn that suspends for approval materialises a task at `input-required`. The decision then\n * arrives over a DIFFERENT transport — the app's WebSocket — whose resume path knows the\n * execution and nothing about tasks. So nothing ever advanced the task: it reported\n * `input-required` forever for work that had finished, and it stayed CANCELLABLE, because the\n * cancel path compare-and-swaps on the stored status and `AWAITING_APPROVAL` is advanceable.\n *\n * Derive-on-read is chosen over a durable write, consistent with the liveness derivation directly\n * below it. Two alternatives were rejected:\n *\n * - **Have the resume advance the task.** It would put A2A knowledge inside the transport-agnostic\n * conversational core, or require a new observer port built for exactly one consumer.\n * - **Repair the row during this read.** It needs UPDATE authority inside a READ operation, which\n * the liveness derivation already refuses for the same reason.\n *\n * The accepted cost is an honest one: the stored row stays stale. That is tolerable ONLY because\n * the readers are enumerable — `readTask` and the cancel CAS — and both consult this. A third\n * reader added later that does not is the way this regresses.\n */\n private async resolveEffectiveTaskStatus(\n task: FlowActorTask,\n owner: ConversationalOwnerScope,\n ): Promise<FlowsActors_Status> {\n if (task.status !== FlowsActors_Status.AWAITING_APPROVAL) return task.status;\n if (!task.contextId) return task.status;\n\n // `contextId` IS the execution id — minted once at the transport edge and handed to both\n // `materialiseTask` and the turn, precisely so the two planes can be correlated.\n const executionStatus = await this.conversationalExecution.readExecutionStatus({\n executionId: task.contextId,\n scopeContext: owner,\n // From the ROW, not from a caller argument. `advanceTask` has no instance parameter, and a\n // derivation that needed one would silently fall back to the default sentinel there — reading\n // the wrong execution for every named agent. The stored value is normalised to the SAME\n // sentinel the execution was written with (`A2A_DEFAULT_INSTANCE_REF` IS\n // `FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE`), so this is exact for both default and named agents.\n resourceServerInstanceRef: task.resourceServerInstanceRef,\n });\n\n // Fall back to the stored status when the execution cannot be read: a task that keeps reporting\n // `input-required` is the pre-existing behaviour, whereas inventing a terminal state would end a\n // turn that may still be waiting for its human.\n return executionStatus ?? task.status;\n }\n\n /**\n * Map a conversation owner scope to its persisted TASK variant.\n *\n * Mirrors `ConversationalExecutionBackendService.resolveOwnerVariant` field-for-field\n * but targets the task family, so a task and its execution always land on matching\n * owner scopes. Returns `undefined` rather than throwing: an unresolvable owner is a\n * fail-closed \"no task\", never a 500.\n */\n /**\n * Read a task's registered push-notification targets.\n *\n * Returns `undefined` when no task with that id is visible to this caller — the same collapsed\n * answer `readTask` gives, and for the same reason: distinguishing \"no such task\" from \"another\n * tenant's task\" would make this a probe for other tenants' task ids.\n *\n * Note the return is the STORED shape, without `taskId`. The wire object is assembled by\n * `toWireTaskPushNotificationConfig` at the controller, from the id the caller addressed.\n */\n public async readPushNotificationConfigs(\n owner: ConversationalOwnerScope,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<A2A_StoredPushNotificationConfig[] | undefined> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return undefined;\n\n const task = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n { scopeContext: resolved.scopeContext },\n );\n if (!task) return undefined;\n\n return parsePushNotificationConfigs(task.pushNotificationConfigs);\n }\n\n /**\n * Replace a task's registered push-notification targets, wholesale.\n *\n * REPLACE rather than merge, because the caller has already read-modified the list and a\n * server-side merge would silently resurrect a target the caller just deleted. The read and this\n * write are not atomic with respect to each other — two concurrent `set` calls on one task can\n * lose one another's addition. That is accepted for a v1 and stated rather than implied: the\n * blast radius is one task's delivery list, the client can re-`set`, and the alternative (a CAS on\n * the serialized blob) buys little while configurations are written by one client per task.\n *\n * Returns `false` when the write matched no row, which — because the caller reached here through\n * an authorized read — means the task was removed in between rather than that it was never\n * visible.\n */\n public async replacePushNotificationConfigs(\n owner: ConversationalOwnerScope,\n taskId: string,\n configs: A2A_StoredPushNotificationConfig[],\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<boolean> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return false;\n\n const updated = await this.systemAccess.updateAsSystem(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n // Serialized scalar, following the `pausedApproval` precedent — nested sub-structures do not\n // round-trip through the Zod→Mongoose conversion. `pushNotificationConfigs` is in\n // `FlowActorTaskUpdateInternalSchema`; without that entry this write SUCCEEDS and persists\n // nothing, which is exactly how `pausedApproval` shipped unwritable.\n { pushNotificationConfigs: serializePushNotificationConfigs(configs) },\n { scopeContext: resolved.scopeContext },\n );\n return Boolean(updated);\n }\n\n /**\n * List a caller's own tasks — A2A 1.0 `ListTasks`.\n *\n * spec-cite: A2A 1.0 §3.1.4 / proto `ListTasksRequest` — filterable by `context_id` and `status`,\n * with `page_size` *\"If unspecified, at most 50 tasks will be returned. The minimum value is 1.\n * The maximum value is 100.\"*\n *\n * ## Isolation is the OWNER filter, not the four-axis one — deliberately\n *\n * `readTask` addresses ONE task and filters on all four axes (owner, task, agent instance, machine\n * credential). A LIST is a different question: \"what work of mine exists?\". Filtering it by the\n * calling credential would mean a client that rotated its credential could no longer see the tasks\n * it had opened, and an owner with two agents would get two disjoint, silently-partial lists.\n *\n * The instance axis IS applied, because two agents of one tenant must not enumerate each other's\n * work — that is the same separation `readTask` enforces and the one an operator would notice.\n * The CREDENTIAL axis is deliberately omitted, and that is the one asymmetry here worth reviewing\n * if this is ever tightened.\n */\n public async listTasks(\n owner: ConversationalOwnerScope,\n instanceRef: string | undefined,\n filters: { contextId?: string; status?: FlowsActors_Status },\n pagination: { pageSize: number; page: number },\n ): Promise<{ tasks: A2A_OutboundTask[]; totalSize: number }> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return { tasks: [], totalSize: 0 };\n\n const filter: Record<string, unknown> = {\n ...resolved.ownerFields,\n resourceServerInstanceRef: instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n ...(filters.contextId ? { contextId: filters.contextId } : {}),\n ...(filters.status ? { status: filters.status } : {}),\n };\n\n const rows = await this.systemAccess.listAsSystem<FlowActorTask>(\n resolved.resourceType,\n filter,\n // The repository paginates by PAGE, not offset. A2A 1.0's `page_token` is an opaque string,\n // so the controller encodes the page number into it — the protocol does not constrain the\n // token's content, only that it round-trips.\n { limit: pagination.pageSize, page: pagination.page },\n { scopeContext: resolved.scopeContext },\n );\n const list = Array.isArray(rows) ? rows : ((rows as { data?: FlowActorTask[] })?.data ?? []);\n\n // NOTE the derive-on-read liveness and approval-release projections that `readTask` applies are\n // NOT run here. Doing so would mean one execution read per row on a list endpoint. The\n // consequence is stated rather than hidden: a listed task may report a stale non-terminal state\n // that `tasks/get` would correct. Callers reconciling state should read the task.\n return { tasks: list.map((task) => this.toOutboundTask(task)), totalSize: list.length };\n }\n\n private resolveTaskOwner(scope: ConversationalOwnerScope): ResolvedTaskOwner | undefined {\n const s = scope as { userId?: string; organizationId?: string; applicationId?: string };\n if (s.userId) {\n return { resourceType: CoreResourceType.USER_FLOW_ACTOR_TASKS, ownerFields: { userId: s.userId }, scopeContext: { userId: s.userId } };\n }\n if (s.organizationId) {\n return { resourceType: CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS, ownerFields: { organizationId: s.organizationId }, scopeContext: { organizationId: s.organizationId } };\n }\n if (s.applicationId) {\n return { resourceType: CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS, ownerFields: { applicationId: s.applicationId }, scopeContext: { applicationId: s.applicationId } };\n }\n return undefined;\n }\n\n /**\n * The concrete persisted variant an owner scope maps to, or `undefined` when the scope\n * resolves to none.\n *\n * Public so an AUDIT emitter can name the resource it is recording access to — the audit row's\n * `resourceType` must be the real variant (`organizationFlowActorTasks`), not the family name,\n * or a reviewer cannot correlate the row with the store it was read from.\n */\n public resolveTaskResourceType(owner: ConversationalOwnerScope): CoreResourceType | undefined {\n return this.resolveTaskOwner(owner)?.resourceType;\n }\n\n /**\n * Open a task for a turn that cannot complete inline.\n *\n * Returns `undefined` on any failure — a task is an ADDITIVE protocol affordance,\n * so failing to open one must never take down the turn that was otherwise going to\n * succeed. The caller degrades to returning a `Message`. The failure is logged at\n * ERROR (not warn) because a persistent inability to materialise tasks silently\n * disables `tasks/get`/`tasks/cancel` for every client.\n */\n public async materialiseTask(params: MaterialiseTaskParams): Promise<A2A_OutboundTask | undefined> {\n const owner = this.resolveTaskOwner(params.owner);\n if (!owner) return undefined;\n\n const taskId = randomUUID();\n // PROCESSING, deliberately — `SUBMITTED` is unreachable on this transport and that is CORRECT\n // (review finding A3-10, resolved as a decision rather than a defect).\n //\n // A2A `submitted` means \"acknowledged, not yet started\". This transport dispatches the turn in\n // the same tick it materialises the row, so there is no interval during which `submitted` would\n // be true; emitting it would describe a state the work was never in. `SUBMITTED` stays in the\n // projection because `FlowsActors_Status.READY`/`PENDING` map to it and a future queued path\n // (a turn admitted but waiting on a worker) would reach it honestly.\n const status = params.status ?? FlowsActors_Status.PROCESSING;\n\n try {\n await this.systemAccess.createAsSystem(\n owner.resourceType,\n {\n ...owner.ownerFields,\n taskId,\n title: params.title,\n status,\n contextId: params.contextId,\n resourceServerInstanceRef: params.instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n machineCredentialId: params.machineCredentialId ?? FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n ...(params.flowActorExecutionId ? { flowActorExecutionId: params.flowActorExecutionId } : {}),\n },\n { scopeContext: owner.scopeContext },\n );\n } catch (error) {\n this.logger.error('[A2ATask] Failed to materialise a task; the turn will answer with a Message instead', {\n contextId: params.contextId,\n ...projectCaughtErrorLogFields(error),\n });\n return undefined;\n }\n\n return {\n kind: 'task',\n id: taskId,\n contextId: params.contextId,\n status: { state: toA2ATaskState(status), timestamp: new Date().toISOString() },\n };\n }\n\n /**\n * Advance a task's lifecycle — a status transition, and the terminal timestamp when\n * the new state is terminal.\n *\n * Best-effort by the same reasoning as {@link materialiseTask}: the work itself has\n * already happened, so failing to record its outcome must not convert a successful\n * turn into an error the client sees.\n */\n public async advanceTask(\n owner: ConversationalOwnerScope,\n taskId: string,\n status: FlowsActors_Status,\n ): Promise<A2A_TaskTransitionOutcome> {\n // Returns whether the transition ACTUALLY happened (review finding G5-4). It used to return\n // `void`, which discarded the compare-and-swap's answer — so `tasks/cancel` could have its\n // write correctly refused by the CAS and still reply HTTP 200 with a `completed` task. That is\n // precisely the outcome H-4 removed: it makes \"I cancelled it\" and \"it had already finished\"\n // indistinguishable on the wire. The guard was applied at the controller's pre-check and not at\n // the response, which is the same one-of-two-sites shape this feature keeps reproducing.\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return A2A_TaskTransitionOutcome.FAILED;\n\n try {\n // `updateAsSystem`, NOT `updateManyAsSystem`.\n //\n // This is load-bearing, not stylistic: the resource declares UPDATE (and grants\n // `update` in `systemAccessPolicy`) but NOT `UPDATE_MANY`, so the many-variant is\n // REFUSED fail-closed by `assertSystemAccessAllowed` before it ever reaches a\n // repository. Because this call site catches and logs, that refusal was invisible —\n // every completed task silently kept its non-terminal status and then reported\n // FAILED to the client via derive-on-read. `taskId` is unique, so a single-target\n // update is also the honest shape.\n // ── COMPARE-AND-SWAP on the status, not a blind write (review finding A3-2) ────────────\n //\n // The filter carries `status: { $in: <liveness-governed> }` so a task that has ALREADY\n // reached a terminal state cannot be moved out of it. Without that predicate the only\n // terminal check lived in the controller, on a value read in a PRIOR `await` — textbook\n // check-then-act, and reachable in a single process, not just across replicas:\n //\n // • `tasks/cancel` reads WORKING → the turn completes and writes COMPLETED → cancel's\n // blind write lands CANCELLED over it, erasing a finished result.\n // • the sweep repairs a task to FAILED just after a late COMPLETED landed.\n // • with Redis down, cancel writes CANCELLED and the un-aborted turn writes COMPLETED\n // on top.\n //\n // Terminal states are the one thing a client is entitled to treat as final, so losing\n // that is worse than refusing a late transition. Same write-skew class as the\n // administrative-continuity floors: make the transactions collide on a value rather than\n // re-checking a stale read.\n // ── A released pause is REPAIRED before a cancel can overwrite it ────────────────────────\n //\n // `AWAITING_APPROVAL` is advanceable, and a paused task's true state lives on its EXECUTION —\n // so a blind CAS would happily record CANCELLED over a turn that had already finished, and the\n // stored row would stay wrong forever afterwards (the derivation only fires WHILE the stored\n // status is the pause).\n //\n // Repairing here rather than on the read path is what makes it legal: this is already a WRITE\n // operation, so it carries the UPDATE authority a read deliberately does not. Scoped to CANCEL\n // because the other transitions are the turn's OWN writes about itself, and paying a read on\n // every completion advance would tax the hot path to guard a verb that never hits it.\n //\n // ⚠️ This NARROWS the race, it does not eliminate it. A resume that lands between this read and\n // the CAS below is still recorded as cancelled. Elimination needs the two paths to collide on\n // one row — the resume advancing the task — and that inverts the layering (the\n // transport-agnostic core would have to know A2A exists). Same trade as\n // `resolveEffectiveTaskStatus`; revisit them together, never separately.\n if (status === FlowsActors_Status.CANCELLED) {\n const stored = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId },\n { scopeContext: resolved.scopeContext },\n );\n if (stored?.status === FlowsActors_Status.AWAITING_APPROVAL) {\n const effective = await this.resolveEffectiveTaskStatus(stored, owner);\n if (effective !== stored.status && isTerminalA2ATaskStatus(effective)) {\n await this.systemAccess.updateAsSystem(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId, status: { $in: ADVANCEABLE_TASK_STATUSES } },\n { status: effective, finishedAt: new Date() },\n { scopeContext: resolved.scopeContext },\n );\n this.logger.info('[A2A] Cancel refused: the paused turn had already been decided; the task was repaired to its real state', {\n taskId, repairedTo: effective,\n });\n return A2A_TaskTransitionOutcome.REFUSED;\n }\n }\n }\n\n const updated = await this.systemAccess.updateAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId, status: { $in: ADVANCEABLE_TASK_STATUSES } },\n {\n status,\n ...(isTerminalA2ATaskStatus(status) ? { finishedAt: new Date() } : {}),\n },\n { scopeContext: resolved.scopeContext },\n );\n // A null result is now AMBIGUOUS, and the two causes need opposite reactions — so it is\n // disambiguated rather than blanket-logged. Treating \"already terminal\" as an error would\n // spam the channel on every ordinary cancel-vs-complete race; treating \"no such row\" as\n // benign would re-hide the F-1 silent-inert class this log exists to catch.\n if (!updated) {\n const current = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId },\n { scopeContext: resolved.scopeContext },\n );\n if (current) {\n this.logger.info('[A2ATask] Task already reached a terminal state; the later transition was refused', {\n taskId, attemptedStatus: status, storedStatus: current.status,\n });\n return A2A_TaskTransitionOutcome.REFUSED;\n }\n {\n // WARN, not ERROR (review finding G4-9). A missing row has two causes and only one is a\n // defect: the owner may have DELETEd the task through its declared API operation, which\n // is ordinary and owner-initiated. Logging that at ERROR adds noise to precisely the\n // channel the F-1 silent-inert class depends on staying quiet, which is how a real\n // signal gets tuned out. The consequence is named so it is still actionable if it is\n // the other cause.\n this.logger.warn('[A2ATask] Task status update matched no row — the task was deleted, or the stored state is now stale', { taskId, status });\n }\n return A2A_TaskTransitionOutcome.FAILED;\n }\n // ── Push notifications: an OBSERVATION of the transition, never a gate on it ─────────────\n //\n // Fire-and-forget by construction. `dispatchTaskUpdate` never throws (it wraps its whole body),\n // and it is deliberately NOT awaited: a task that finished must be recorded as finished at the\n // speed of the write, even if every webhook in the world is unreachable. The `.catch` is belt\n // and braces for a rejection the dispatcher's own contract says cannot happen — if that\n // contract is ever broken, an unhandled rejection would take the process down rather than\n // losing one notification.\n //\n // Placed AFTER the successful CAS on purpose: a transition that was refused (already terminal,\n // or a repaired pause) is not a transition, and notifying on it would tell a client the task\n // changed state when it did not.\n void this.pushDispatcher\n .dispatchTaskUpdate(\n owner,\n this.toOutboundTask({ ...updated, status }),\n updated.pushNotificationConfigs,\n updated.resourceServerInstanceRef,\n updated.machineCredentialId,\n )\n .catch((error: unknown) => {\n this.logger.warn('[A2ATask] Push dispatch rejected despite its no-throw contract', {\n taskId, ...projectCaughtErrorLogFields(error),\n });\n });\n\n return A2A_TaskTransitionOutcome.ADVANCED;\n } catch (error) {\n this.logger.error('[A2ATask] Failed to advance a task status; the stored state is now stale', {\n taskId,\n status,\n ...projectCaughtErrorLogFields(error),\n });\n // 'failed', NOT 'refused' (review finding N-3). This `catch` previously fell through with no\n // return at all, so a thrown write resolved `undefined` — invisible to tsc under\n // `strict: false`, and read as falsy by the caller. `tasks/cancel` then answered \"the task\n // reached a terminal state before the cancellation was recorded\": a FALSE claim about state,\n // on a destructive verb, for what was actually a transient database error. A refusal and a\n // failure are different facts and must not share a representation.\n return A2A_TaskTransitionOutcome.FAILED;\n }\n }\n\n /**\n * Read one task as the protocol object — backs `tasks/get`.\n *\n * Returns `undefined` when no task with that id is visible to this owner. That\n * covers both \"does not exist\" and \"belongs to another tenant\", and collapsing the\n * two is deliberate: distinguishing them would let a caller probe for the existence\n * of other tenants' task ids.\n */\n public async readTask(\n owner: ConversationalOwnerScope,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<A2A_OutboundTask | undefined> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return undefined;\n\n const task = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n // NO `suppressSystemAudit`. That option's contract reserves it for SELF-REFERENTIAL\n // framework plumbing whose auditing would only amplify (or recurse into) the trail —\n // \"genuine privileged reads leave this unset so they still audit\". This read is\n // externally triggered by an agent client, is tenant-actionable, and cannot recurse\n // into the audit pipeline, so suppressing it was a silent hole in the trail.\n { scopeContext: resolved.scopeContext },\n );\n if (!task) return undefined;\n\n // DERIVE-ON-READ liveness (never a write on a read path).\n //\n // A non-terminal task whose liveness lease is gone was abandoned by a pod that died\n // mid-turn: nothing will ever advance it, so reporting the stored `working` would be\n // a lie that never self-corrects. It is reported as FAILED here, and the durable\n // repair belongs to the sweep — deliberately NOT to this read, which would need\n // UPDATE authority inside a READ operation.\n // `isLivenessGovernedA2ATaskStatus`, NOT `!isTerminalA2ATaskStatus` (review finding A3-3):\n // a task INTERRUPTED for a human approval is non-terminal yet holds no lease by design, so\n // the terminal-only test reported every paused task as failed on the next poll.\n if (isLivenessGovernedA2ATaskStatus(task.status) && !(await this.cancellation.isTurnAlive(taskId))) {\n return { ...this.toOutboundTask(task), status: { state: A2A_TaskState.FAILED, timestamp: new Date().toISOString() } };\n }\n\n // DERIVE-ON-READ approval release (reader 1 of 2 — the other is the cancel CAS in `advanceTask`).\n //\n // A paused task's true state lives on its execution, because the decision that releases it\n // arrives over a transport that cannot reach this row. Without this the client polls\n // `input-required` forever on a turn that already finished.\n const effectiveStatus = await this.resolveEffectiveTaskStatus(task, owner);\n if (effectiveStatus !== task.status) {\n return { ...this.toOutboundTask({ ...task, status: effectiveStatus }) };\n }\n\n return this.toOutboundTask(task);\n }\n\n /** Project a persisted task row onto the protocol object. */\n public toOutboundTask(task: FlowActorTask): A2A_OutboundTask {\n const state = toA2ATaskState(task.status);\n const timestamp = (task.finishedAt ?? task.updatedAt ?? task.createdAt ?? new Date()) as Date;\n\n return {\n kind: 'task',\n id: task.taskId,\n contextId: task.contextId ?? '',\n status: {\n state,\n timestamp: timestamp instanceof Date ? timestamp.toISOString() : String(timestamp),\n },\n ...(task.artifacts?.length\n ? {\n artifacts: task.artifacts.map((artifact, index) => {\n // `ref` is the artifact's own stable identity. An earlier version read `_id`,\n // which `ArtifactInstance_BaseSchema` does not declare — so every artifactId\n // fell back to the POSITIONAL `artifact-${index}` and changed whenever the\n // array reordered, breaking the one thing an id is for.\n const a = artifact as { ref?: string; name?: string; type?: string; content?: unknown };\n return {\n artifactId: a.ref ?? `artifact-${index}`,\n name: a.name,\n // A2A part kinds are `text` / `file` / `data`. Wildo's `FlowsActors_IO_PartKind`\n // adds RAW_DATA / STRUCTURED / IMAGE, which have no A2A equivalent — they are\n // mapped onto `data` rather than emitted verbatim, because a kind the client\n // does not know is worse than the nearest one it does.\n parts: [toA2APart(a.type, a.content)],\n };\n }),\n }\n : {}),\n };\n }\n\n}\n\n/**\n * Map a Wildo IO part kind onto an A2A part.\n *\n * spec-cite: A2A v0.2.5 §6.5 (Part union: TextPart / FilePart / DataPart)\n *\n * A2A defines `text`, `file` and `data`. Wildo's vocabulary is wider, so anything without\n * a direct counterpart becomes a `data` part rather than leaking an unknown kind onto the\n * wire. The payload key follows A2A's shape per kind (`text` / `file` / `data`), not\n * Wildo's internal `content`.\n */\nfunction toA2APart(type: string | undefined, content: unknown): { kind: string; [k: string]: unknown } {\n switch (type) {\n case 'text':\n return { kind: 'text', text: typeof content === 'string' ? content : (content as { text?: string })?.text ?? '' };\n case 'file':\n return { kind: 'file', file: content };\n default:\n return { kind: 'data', data: content };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"a2a-task.backend.service.js","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-task.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,C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AE,CAAC;IAC3C,CAAC;AACH,CAAC","sourcesContent":["/**\n * A2A TASK service — materialise, read and advance the persisted work record that\n * backs the protocol's `Task` object.\n *\n * ## Not every turn has a task\n *\n * A task is materialised ONLY when the turn cannot complete inline: the client set\n * `configuration.blocking: false`, or the turn reached an interrupted state\n * (approval pause → `input-required`). Both are live. A blocking turn that answers in one shot\n * returns an A2A `Message` and writes no row. The spec permits both shapes — its\n * `SendMessageResponse` result is typed `Task | Message` — so this is conformance, not a\n * shortcut, and it keeps a per-turn row off the hot path.\n *\n * ⚠️ This paragraph previously supported that claim with a QUOTATION that does not appear in the\n * specification. The conclusion was right and the citation was invented; since this block is\n * `@wildo_source`-anchored it shipped verbatim into the app-facing skill, so app builders were\n * given fabricated protocol text as authority. Cite the type, not a remembered sentence.\n *\n * ## Ownership follows the CONVERSATION owner, not the payer\n *\n * A task is owned by the same scope as the execution that produced it, resolved\n * from `ConversationalOwnerScope`. That is deliberately NOT the budget service's\n * rule: budgeting resolves who PAYS (a delegated turn bills the user's active org),\n * whereas a task must be readable by the principal that created it. Diverging the\n * two would let a user create a task they cannot then `tasks/get`.\n *\n * ## Authorization: isolation is by OWNER FILTER, not by inherited RBAC\n *\n * ⚠️ Read this carefully before changing `readTask` — an earlier version of this comment\n * claimed reads \"travel the normal authorized path so RBAC applies for free\". **That was\n * false.** `readAsSystem` is the ACL-BYPASSING primitive: it synthesises an\n * `APP_ADMIN_SUPER_ADMIN` context regardless of the calling user's roles. The declared\n * `API_CALL` READ variant and its `polymorphicRole` map are NEVER exercised by this path.\n *\n * Isolation is real but comes from ONE place: every read is filtered by\n * `{ ...ownerFields, taskId }`, where `ownerFields` is derived from the authenticated\n * principal's own scope. A caller cannot reach another tenant's task because the filter\n * cannot name one.\n *\n * The practical consequence: **tightening `polymorphicRole` on the resource does NOT\n * tighten `tasks/get`.** If this path must honour role gates, it has to move to the\n * request-scoped service tier — relaxing the owner filter here would open cross-tenant\n * reads immediately.\n *\n * Writes are `*AsSystem` too, governed by `systemAccessPolicy` rather than op RBAC.\n */\n\nimport { randomUUID } from 'node:crypto';\nimport { inject, injectable } from 'inversify';\n\nimport {\n CoreResourceType,\n FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n FlowsActors_Status,\n type FlowActorTask,\n} from '@wildo-ai/saas-models';\n\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ConversationalOwnerScope, ConversationalExecutionBackendService } from '~wildo-backend-lib/flows-actors/services/conversational-execution.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { A2ATaskCancellationBackendService } from './a2a-task-cancellation.backend.service';\nimport type { A2APushDispatcherBackendService } from './a2a-push-dispatcher.backend.service';\nimport {\n A2A_DEFAULT_INSTANCE_REF,\n A2A_TaskState,\n ADVANCEABLE_TASK_STATUSES,\n isLivenessGovernedA2ATaskStatus,\n isTerminalA2ATaskStatus,\n toA2ATaskState,\n type A2A_OutboundTask,\n} from '../models/a2a.backend.schemas';\nimport {\n parsePushNotificationConfigs,\n serializePushNotificationConfigs,\n type A2A_StoredPushNotificationConfig,\n} from '../models/a2a-push-notification.backend.schemas';\n\n/** An owner scope resolved to its persisted TASK variant + owner FK + `*AsSystem` scope map. */\ninterface ResolvedTaskOwner {\n resourceType: CoreResourceType;\n ownerFields: Record<string, string>;\n scopeContext: { userId?: string; organizationId?: string; applicationId?: string };\n}\n\n/**\n * The FOUR-AXIS identity filter that addresses exactly one task, for exactly one caller.\n *\n * Extracted rather than repeated at each reader, because it is an isolation invariant and every\n * copy of it is a place a future edit can drop an axis. That is not hypothetical here — an earlier\n * pass shipped this filter with the instance axis missing, so two agents of the same tenant could\n * read each other's tasks, and the defect was invisible at the call site because the filter it was\n * copied from looked complete.\n *\n * All four are required, and each keeps apart a different pair:\n * - OWNER scope keeps tenants apart;\n * - `taskId` selects the row;\n * - `resourceServerInstanceRef` keeps two AGENTS of one tenant apart;\n * - `machineCredentialId` keeps two machine CLIENTS of one scope apart — which matters most on\n * APPLICATION scope, whose `applicationId` is a deployment singleton, so without it every\n * app-scope client resolves to the identical owner filter.\n *\n * The defaults are not conveniences: a task written by a caller that presented no instance or no\n * machine credential carries the sentinel, so omitting them here would fail to match its own rows\n * rather than matching more of them.\n */\nfunction buildTaskIdentityFilter(\n resolved: ResolvedTaskOwner,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n): Record<string, string> {\n return {\n ...resolved.ownerFields,\n taskId,\n resourceServerInstanceRef: instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n machineCredentialId: machineCredentialId ?? FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n };\n}\n\n/**\n * What happened to a requested lifecycle transition.\n *\n * THREE states, not a boolean (review finding N-3): \"the compare-and-swap refused because the task\n * is already terminal\" and \"the write failed\" are different facts, and collapsing them made a\n * transient database error answer `TaskNotCancelable` — telling the client something about the\n * task's STATE that was not true.\n */\nexport enum A2A_TaskTransitionOutcome {\n /** The compare-and-swap matched and the task moved to the requested status. */\n ADVANCED = 'advanced',\n /**\n * The transition was DECLINED on the task's own terms — the compare-and-swap found the task\n * already terminal, so the requested move is not legal from where it is. This is a fact about\n * the TASK, and it is what may safely surface to a client as `TaskNotCancelable`.\n */\n REFUSED = 'refused',\n /**\n * The transition could not be carried out — the task could not be resolved, or the write threw.\n * This is a fact about the ATTEMPT, not the task, and must never be reported as a statement\n * about the task's state (review finding N-3).\n */\n FAILED = 'failed',\n}\n\n/** Inputs needed to open a task for a turn that cannot complete inline. */\nexport interface MaterialiseTaskParams {\n owner: ConversationalOwnerScope;\n /** A2A conversation thread the task belongs to. */\n contextId: string;\n /** Short human-readable name — the client sees this when listing tasks. */\n title: string;\n /**\n * The A2A agent this turn arrived through — `undefined` for the default (unnamed) agent.\n *\n * Normalised to {@link A2A_DEFAULT_INSTANCE_REF} on the way to storage, and part of the\n * read/cancel filter thereafter, so one agent's token cannot reach another agent's tasks.\n */\n instanceRef?: string;\n /**\n * The machine credential that opened this task — `undefined` for a user-delegated turn.\n *\n * Normalised to {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL} on the way to storage and part of the\n * read filter thereafter, so two separately-credentialed clients sharing one owner scope cannot\n * reach each other's tasks.\n */\n machineCredentialId?: string;\n /** Soft link to the conversational execution, when one exists. */\n flowActorExecutionId?: string;\n /**\n * Initial state. `PROCESSING` for a turn already running; `AWAITING_APPROVAL` for a pause.\n *\n * Two production callers pass it, both on the approval-pause arm: the blocking `message/send`\n * path and `message/stream`, each of which must hand back something addressable because a paused\n * turn has no reply to send. The `blocking: false` branch still takes the default.\n *\n * This parameter was carried unexercised for exactly that arm rather than being removed as dead\n * code — the judgement paid off, since wiring the pause needed no signature change here. Pinned\n * by `a2a.controller.approval-surfacing.test.ts`.\n */\n status?: FlowsActors_Status;\n}\n\n@injectable()\nexport class A2ATaskBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n // Appended LAST — see the A2A controller for why new injections are never inserted.\n @inject(SAAS_SERVICE_TYPES.A2ATaskCancellationService) private readonly cancellation: A2ATaskCancellationBackendService,\n // Appended LAST, same rule. The direction is transport → core: the A2A task plane is a VIEW of\n // a conversational execution, so it may ask the core for state. The reverse would be wrong —\n // the core must never learn that A2A exists.\n @inject(SAAS_SERVICE_TYPES.ConversationalExecutionBackendService) private readonly conversationalExecution: ConversationalExecutionBackendService,\n @inject(SAAS_SERVICE_TYPES.A2APushDispatcherService) private readonly pushDispatcher: A2APushDispatcherBackendService,\n ) {}\n\n /**\n * The status a task ACTUALLY has, which for an approval-paused task is its execution's.\n *\n * ## The hole this closes\n *\n * A turn that suspends for approval materialises a task at `input-required`. The decision then\n * arrives over a DIFFERENT transport — the app's WebSocket — whose resume path knows the\n * execution and nothing about tasks. So nothing ever advanced the task: it reported\n * `input-required` forever for work that had finished, and it stayed CANCELLABLE, because the\n * cancel path compare-and-swaps on the stored status and `AWAITING_APPROVAL` is advanceable.\n *\n * Derive-on-read is chosen over a durable write, consistent with the liveness derivation directly\n * below it. Two alternatives were rejected:\n *\n * - **Have the resume advance the task.** It would put A2A knowledge inside the transport-agnostic\n * conversational core, or require a new observer port built for exactly one consumer.\n * - **Repair the row during this read.** It needs UPDATE authority inside a READ operation, which\n * the liveness derivation already refuses for the same reason.\n *\n * The accepted cost is an honest one: the stored row stays stale. That is tolerable ONLY because\n * the readers are enumerable — `readTask` and the cancel CAS — and both consult this. A third\n * reader added later that does not is the way this regresses.\n */\n private async resolveEffectiveTaskStatus(\n task: FlowActorTask,\n owner: ConversationalOwnerScope,\n ): Promise<FlowsActors_Status> {\n if (task.status !== FlowsActors_Status.AWAITING_APPROVAL) return task.status;\n if (!task.contextId) return task.status;\n\n // `contextId` IS the execution id — minted once at the transport edge and handed to both\n // `materialiseTask` and the turn, precisely so the two planes can be correlated.\n const executionStatus = await this.conversationalExecution.readExecutionStatus({\n executionId: task.contextId,\n scopeContext: owner,\n // From the ROW, not from a caller argument. `advanceTask` has no instance parameter, and a\n // derivation that needed one would silently fall back to the default sentinel there — reading\n // the wrong execution for every named agent. The stored value is normalised to the SAME\n // sentinel the execution was written with (`A2A_DEFAULT_INSTANCE_REF` IS\n // `FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE`), so this is exact for both default and named agents.\n resourceServerInstanceRef: task.resourceServerInstanceRef,\n });\n\n // Fall back to the stored status when the execution cannot be read: a task that keeps reporting\n // `input-required` is the pre-existing behaviour, whereas inventing a terminal state would end a\n // turn that may still be waiting for its human.\n return executionStatus ?? task.status;\n }\n\n /**\n * Map a conversation owner scope to its persisted TASK variant.\n *\n * Mirrors `ConversationalExecutionBackendService.resolveOwnerVariant` field-for-field\n * but targets the task family, so a task and its execution always land on matching\n * owner scopes. Returns `undefined` rather than throwing: an unresolvable owner is a\n * fail-closed \"no task\", never a 500.\n */\n /**\n * Read a task's registered push-notification targets.\n *\n * Returns `undefined` when no task with that id is visible to this caller — the same collapsed\n * answer `readTask` gives, and for the same reason: distinguishing \"no such task\" from \"another\n * tenant's task\" would make this a probe for other tenants' task ids.\n *\n * Note the return is the STORED shape, without `taskId`. The wire object is assembled by\n * `toWireTaskPushNotificationConfig` at the controller, from the id the caller addressed.\n */\n public async readPushNotificationConfigs(\n owner: ConversationalOwnerScope,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<A2A_StoredPushNotificationConfig[] | undefined> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return undefined;\n\n const task = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n { scopeContext: resolved.scopeContext },\n );\n if (!task) return undefined;\n\n return parsePushNotificationConfigs(task.pushNotificationConfigs);\n }\n\n /**\n * Replace a task's registered push-notification targets, wholesale.\n *\n * REPLACE rather than merge, because the caller has already read-modified the list and a\n * server-side merge would silently resurrect a target the caller just deleted. The read and this\n * write are not atomic with respect to each other — two concurrent `set` calls on one task can\n * lose one another's addition. That is accepted for a v1 and stated rather than implied: the\n * blast radius is one task's delivery list, the client can re-`set`, and the alternative (a CAS on\n * the serialized blob) buys little while configurations are written by one client per task.\n *\n * Returns `false` when the write matched no row, which — because the caller reached here through\n * an authorized read — means the task was removed in between rather than that it was never\n * visible.\n */\n public async replacePushNotificationConfigs(\n owner: ConversationalOwnerScope,\n taskId: string,\n configs: A2A_StoredPushNotificationConfig[],\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<boolean> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return false;\n\n const updated = await this.systemAccess.updateAsSystem(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n // Serialized scalar, following the `pausedApproval` precedent — nested sub-structures do not\n // round-trip through the Zod→Mongoose conversion. `pushNotificationConfigs` is in\n // `FlowActorTaskUpdateInternalSchema`; without that entry this write SUCCEEDS and persists\n // nothing, which is exactly how `pausedApproval` shipped unwritable.\n { pushNotificationConfigs: serializePushNotificationConfigs(configs) },\n { scopeContext: resolved.scopeContext },\n );\n return Boolean(updated);\n }\n\n /**\n * List a caller's own tasks — A2A 1.0 `ListTasks`.\n *\n * spec-cite: A2A 1.0 §3.1.4 / proto `ListTasksRequest` — filterable by `context_id` and `status`,\n * with `page_size` *\"If unspecified, at most 50 tasks will be returned. The minimum value is 1.\n * The maximum value is 100.\"*\n *\n * ## Isolation is the OWNER filter, not the four-axis one — deliberately\n *\n * `readTask` addresses ONE task and filters on all four axes (owner, task, agent instance, machine\n * credential). A LIST is a different question: \"what work of mine exists?\". Filtering it by the\n * calling credential would mean a client that rotated its credential could no longer see the tasks\n * it had opened, and an owner with two agents would get two disjoint, silently-partial lists.\n *\n * The instance axis IS applied, because two agents of one tenant must not enumerate each other's\n * work — that is the same separation `readTask` enforces and the one an operator would notice.\n * The CREDENTIAL axis is deliberately omitted, and that is the one asymmetry here worth reviewing\n * if this is ever tightened.\n */\n public async listTasks(\n owner: ConversationalOwnerScope,\n instanceRef: string | undefined,\n filters: { contextId?: string; status?: FlowsActors_Status },\n pagination: { pageSize: number; page: number },\n ): Promise<{ tasks: A2A_OutboundTask[]; totalSize: number }> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return { tasks: [], totalSize: 0 };\n\n const filter: Record<string, unknown> = {\n ...resolved.ownerFields,\n resourceServerInstanceRef: instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n ...(filters.contextId ? { contextId: filters.contextId } : {}),\n ...(filters.status ? { status: filters.status } : {}),\n };\n\n const rows = await this.systemAccess.listAsSystem<FlowActorTask>(\n resolved.resourceType,\n filter,\n // The repository paginates by PAGE, not offset. A2A 1.0's `page_token` is an opaque string,\n // so the controller encodes the page number into it — the protocol does not constrain the\n // token's content, only that it round-trips.\n { limit: pagination.pageSize, page: pagination.page },\n { scopeContext: resolved.scopeContext },\n );\n const list = Array.isArray(rows) ? rows : ((rows as { data?: FlowActorTask[] })?.data ?? []);\n\n // NOTE the derive-on-read liveness and approval-release projections that `readTask` applies are\n // NOT run here. Doing so would mean one execution read per row on a list endpoint. The\n // consequence is stated rather than hidden: a listed task may report a stale non-terminal state\n // that `tasks/get` would correct. Callers reconciling state should read the task.\n return { tasks: list.map((task) => this.toOutboundTask(task)), totalSize: list.length };\n }\n\n private resolveTaskOwner(scope: ConversationalOwnerScope): ResolvedTaskOwner | undefined {\n const s = scope as { userId?: string; organizationId?: string; applicationId?: string };\n if (s.userId) {\n return { resourceType: CoreResourceType.USER_FLOW_ACTOR_TASKS, ownerFields: { userId: s.userId }, scopeContext: { userId: s.userId } };\n }\n if (s.organizationId) {\n return { resourceType: CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS, ownerFields: { organizationId: s.organizationId }, scopeContext: { organizationId: s.organizationId } };\n }\n if (s.applicationId) {\n return { resourceType: CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS, ownerFields: { applicationId: s.applicationId }, scopeContext: { applicationId: s.applicationId } };\n }\n return undefined;\n }\n\n /**\n * The concrete persisted variant an owner scope maps to, or `undefined` when the scope\n * resolves to none.\n *\n * Public so an AUDIT emitter can name the resource it is recording access to — the audit row's\n * `resourceType` must be the real variant (`organizationFlowActorTasks`), not the family name,\n * or a reviewer cannot correlate the row with the store it was read from.\n */\n public resolveTaskResourceType(owner: ConversationalOwnerScope): CoreResourceType | undefined {\n return this.resolveTaskOwner(owner)?.resourceType;\n }\n\n /**\n * Open a task for a turn that cannot complete inline.\n *\n * Returns `undefined` on any failure — a task is an ADDITIVE protocol affordance,\n * so failing to open one must never take down the turn that was otherwise going to\n * succeed. The caller degrades to returning a `Message`. The failure is logged at\n * ERROR (not warn) because a persistent inability to materialise tasks silently\n * disables `tasks/get`/`tasks/cancel` for every client.\n */\n public async materialiseTask(params: MaterialiseTaskParams): Promise<A2A_OutboundTask | undefined> {\n const owner = this.resolveTaskOwner(params.owner);\n if (!owner) return undefined;\n\n const taskId = randomUUID();\n // PROCESSING, deliberately — `SUBMITTED` is unreachable on this transport and that is CORRECT\n // (review finding A3-10, resolved as a decision rather than a defect).\n //\n // A2A `submitted` means \"acknowledged, not yet started\". This transport dispatches the turn in\n // the same tick it materialises the row, so there is no interval during which `submitted` would\n // be true; emitting it would describe a state the work was never in. `SUBMITTED` stays in the\n // projection because `FlowsActors_Status.READY`/`PENDING` map to it and a future queued path\n // (a turn admitted but waiting on a worker) would reach it honestly.\n const status = params.status ?? FlowsActors_Status.PROCESSING;\n\n try {\n await this.systemAccess.createAsSystem(\n owner.resourceType,\n {\n ...owner.ownerFields,\n taskId,\n title: params.title,\n status,\n contextId: params.contextId,\n resourceServerInstanceRef: params.instanceRef ?? A2A_DEFAULT_INSTANCE_REF,\n machineCredentialId: params.machineCredentialId ?? FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n ...(params.flowActorExecutionId ? { flowActorExecutionId: params.flowActorExecutionId } : {}),\n },\n { scopeContext: owner.scopeContext },\n );\n } catch (error) {\n this.logger.error('[A2ATask] Failed to materialise a task; the turn will answer with a Message instead', {\n contextId: params.contextId,\n ...projectCaughtErrorLogFields(error),\n });\n return undefined;\n }\n\n return {\n kind: 'task',\n id: taskId,\n contextId: params.contextId,\n status: { state: toA2ATaskState(status), timestamp: new Date().toISOString() },\n };\n }\n\n /**\n * Advance a task's lifecycle — a status transition, and the terminal timestamp when\n * the new state is terminal.\n *\n * Best-effort by the same reasoning as {@link materialiseTask}: the work itself has\n * already happened, so failing to record its outcome must not convert a successful\n * turn into an error the client sees.\n *\n * `reclaimAbandonedVerdict` is the ONE case in which a terminal status may be moved — see the\n * block that uses it. It is opt-in per call site rather than a widened compare-and-swap set\n * precisely so `tasks/cancel` can never reach it.\n */\n public async advanceTask(\n owner: ConversationalOwnerScope,\n taskId: string,\n status: FlowsActors_Status,\n options?: { reclaimAbandonedVerdict?: boolean },\n ): Promise<A2A_TaskTransitionOutcome> {\n // Returns whether the transition ACTUALLY happened (review finding G5-4). It used to return\n // `void`, which discarded the compare-and-swap's answer — so `tasks/cancel` could have its\n // write correctly refused by the CAS and still reply HTTP 200 with a `completed` task. That is\n // precisely the outcome H-4 removed: it makes \"I cancelled it\" and \"it had already finished\"\n // indistinguishable on the wire. The guard was applied at the controller's pre-check and not at\n // the response, which is the same one-of-two-sites shape this feature keeps reproducing.\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return A2A_TaskTransitionOutcome.FAILED;\n\n try {\n // `updateAsSystem`, NOT `updateManyAsSystem`.\n //\n // This is load-bearing, not stylistic: the resource declares UPDATE (and grants\n // `update` in `systemAccessPolicy`) but NOT `UPDATE_MANY`, so the many-variant is\n // REFUSED fail-closed by `assertSystemAccessAllowed` before it ever reaches a\n // repository. Because this call site catches and logs, that refusal was invisible —\n // every completed task silently kept its non-terminal status and then reported\n // FAILED to the client via derive-on-read. `taskId` is unique, so a single-target\n // update is also the honest shape.\n // ── COMPARE-AND-SWAP on the status, not a blind write (review finding A3-2) ────────────\n //\n // The filter carries `status: { $in: <liveness-governed> }` so a task that has ALREADY\n // reached a terminal state cannot be moved out of it. Without that predicate the only\n // terminal check lived in the controller, on a value read in a PRIOR `await` — textbook\n // check-then-act, and reachable in a single process, not just across replicas:\n //\n // • `tasks/cancel` reads WORKING → the turn completes and writes COMPLETED → cancel's\n // blind write lands CANCELLED over it, erasing a finished result.\n // • the sweep repairs a task to FAILED just after a late COMPLETED landed.\n // • with Redis down, cancel writes CANCELLED and the un-aborted turn writes COMPLETED\n // on top.\n //\n // Terminal states are the one thing a client is entitled to treat as final, so losing\n // that is worse than refusing a late transition. Same write-skew class as the\n // administrative-continuity floors: make the transactions collide on a value rather than\n // re-checking a stale read.\n // ── A released pause is REPAIRED before a cancel can overwrite it ────────────────────────\n //\n // `AWAITING_APPROVAL` is advanceable, and a paused task's true state lives on its EXECUTION —\n // so a blind CAS would happily record CANCELLED over a turn that had already finished, and the\n // stored row would stay wrong forever afterwards (the derivation only fires WHILE the stored\n // status is the pause).\n //\n // Repairing here rather than on the read path is what makes it legal: this is already a WRITE\n // operation, so it carries the UPDATE authority a read deliberately does not. Scoped to CANCEL\n // because the other transitions are the turn's OWN writes about itself, and paying a read on\n // every completion advance would tax the hot path to guard a verb that never hits it.\n //\n // ⚠️ This NARROWS the race, it does not eliminate it. A resume that lands between this read and\n // the CAS below is still recorded as cancelled. Elimination needs the two paths to collide on\n // one row — the resume advancing the task — and that inverts the layering (the\n // transport-agnostic core would have to know A2A exists). Same trade as\n // `resolveEffectiveTaskStatus`; revisit them together, never separately.\n if (status === FlowsActors_Status.CANCELLED) {\n const stored = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId },\n { scopeContext: resolved.scopeContext },\n );\n if (stored?.status === FlowsActors_Status.AWAITING_APPROVAL) {\n const effective = await this.resolveEffectiveTaskStatus(stored, owner);\n if (effective !== stored.status && isTerminalA2ATaskStatus(effective)) {\n await this.systemAccess.updateAsSystem(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId, status: { $in: ADVANCEABLE_TASK_STATUSES } },\n { status: effective, finishedAt: new Date() },\n { scopeContext: resolved.scopeContext },\n );\n this.logger.info('[A2A] Cancel refused: the paused turn had already been decided; the task was repaired to its real state', {\n taskId, repairedTo: effective,\n });\n return A2A_TaskTransitionOutcome.REFUSED;\n }\n }\n }\n\n const updated = await this.systemAccess.updateAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId, status: { $in: ADVANCEABLE_TASK_STATUSES } },\n {\n status,\n ...(isTerminalA2ATaskStatus(status) ? { finishedAt: new Date() } : {}),\n },\n { scopeContext: resolved.scopeContext },\n );\n // A null result is now AMBIGUOUS, and the two causes need opposite reactions — so it is\n // disambiguated rather than blanket-logged. Treating \"already terminal\" as an error would\n // spam the channel on every ordinary cancel-vs-complete race; treating \"no such row\" as\n // benign would re-hide the F-1 silent-inert class this log exists to catch.\n if (!updated) {\n const current = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n { ...resolved.ownerFields, taskId },\n { scopeContext: resolved.scopeContext },\n );\n if (current) {\n // ── RECLAIMING a task the abandoned-task sweep killed underneath a live turn ─────────\n //\n // Until this existed there was NO way back from a wrong sweep verdict. The sweep can\n // only ever conclude \"abandoned\" from the ABSENCE of a liveness lease, and a pod whose\n // Redis writes are failing produces exactly that absence while running the turn\n // perfectly — so the sweep records FAILED, the client is told FAILED, and when the turn\n // then finishes for real its own outcome write is refused by the compare-and-swap and\n // the answer is discarded. A derived verdict outranking an observed fact is backwards.\n //\n // The turn is the AUTHORITATIVE party here: it ran the work. So its own outcome write —\n // and only that one — may move the task off a FAILED it did not write.\n //\n // Why that is safe, enumerated rather than assumed. Exactly THREE sites write FAILED to\n // a task row: this service's two callers in `runTurnAndAdvanceTask` (the `turn.kind ===\n // 'error'` arm and its `catch`, which are mutually exclusive and run at most once per\n // turn) and the sweep's `updateAsSystem`. So a turn whose own outcome write finds FAILED\n // stored did not put it there — the sweep did. Everything else is untouched:\n // • CANCELLED is NOT in the reclaim filter, so a human's stop can never be overwritten\n // — that is the one terminal state whose whole point is that it is a decision.\n // • COMPLETED is not either, so a finished result stays final.\n // • `tasks/cancel` never passes the flag, so no client-facing verb can reach this.\n // If a fourth writer of FAILED ever appears, it belongs in this list or the reasoning\n // above stops holding.\n if (options?.reclaimAbandonedVerdict && current.status === FlowsActors_Status.FAILED && status !== FlowsActors_Status.FAILED) {\n const reclaimed = await this.systemAccess.updateAsSystem<FlowActorTask>(\n resolved.resourceType,\n // Filtered on FAILED, not merely attempted: that is what makes the log below a\n // statement of fact rather than an inference, and it keeps this a compare-and-swap\n // so a genuine CANCELLED landing in between still wins.\n { ...resolved.ownerFields, taskId, status: FlowsActors_Status.FAILED },\n { status, ...(isTerminalA2ATaskStatus(status) ? { finishedAt: new Date() } : {}) },\n { scopeContext: resolved.scopeContext },\n );\n if (reclaimed) {\n // WARN, and loudly: a reclaim means the sweep declared a LIVE turn dead. The row is\n // now right, but the fleet has a pod that cannot write its liveness leases, and this\n // is the only place that fact surfaces where an operator will see it — the owning\n // pod's own error lands on the pod nobody is watching.\n this.logger.warn('[A2ATask] Reclaimed a task the abandoned-task sweep had failed; the turn was alive after all', {\n taskId, reclaimedTo: status,\n consequence: 'the sweep acted on a missing liveness lease for a running turn — check that every pod can write Redis',\n });\n void this.pushDispatcher\n .dispatchTaskUpdate(\n owner,\n this.toOutboundTask({ ...reclaimed, status }),\n reclaimed.pushNotificationConfigs,\n reclaimed.resourceServerInstanceRef,\n reclaimed.machineCredentialId,\n )\n .catch((error: unknown) => {\n this.logger.warn('[A2ATask] Push dispatch rejected despite its no-throw contract', {\n taskId, ...projectCaughtErrorLogFields(error),\n });\n });\n return A2A_TaskTransitionOutcome.ADVANCED;\n }\n }\n this.logger.info('[A2ATask] Task already reached a terminal state; the later transition was refused', {\n taskId, attemptedStatus: status, storedStatus: current.status,\n });\n return A2A_TaskTransitionOutcome.REFUSED;\n }\n {\n // WARN, not ERROR (review finding G4-9). A missing row has two causes and only one is a\n // defect: the owner may have DELETEd the task through its declared API operation, which\n // is ordinary and owner-initiated. Logging that at ERROR adds noise to precisely the\n // channel the F-1 silent-inert class depends on staying quiet, which is how a real\n // signal gets tuned out. The consequence is named so it is still actionable if it is\n // the other cause.\n this.logger.warn('[A2ATask] Task status update matched no row — the task was deleted, or the stored state is now stale', { taskId, status });\n }\n return A2A_TaskTransitionOutcome.FAILED;\n }\n // ── Push notifications: an OBSERVATION of the transition, never a gate on it ─────────────\n //\n // Fire-and-forget by construction. `dispatchTaskUpdate` never throws (it wraps its whole body),\n // and it is deliberately NOT awaited: a task that finished must be recorded as finished at the\n // speed of the write, even if every webhook in the world is unreachable. The `.catch` is belt\n // and braces for a rejection the dispatcher's own contract says cannot happen — if that\n // contract is ever broken, an unhandled rejection would take the process down rather than\n // losing one notification.\n //\n // Placed AFTER the successful CAS on purpose: a transition that was refused (already terminal,\n // or a repaired pause) is not a transition, and notifying on it would tell a client the task\n // changed state when it did not.\n void this.pushDispatcher\n .dispatchTaskUpdate(\n owner,\n this.toOutboundTask({ ...updated, status }),\n updated.pushNotificationConfigs,\n updated.resourceServerInstanceRef,\n updated.machineCredentialId,\n )\n .catch((error: unknown) => {\n this.logger.warn('[A2ATask] Push dispatch rejected despite its no-throw contract', {\n taskId, ...projectCaughtErrorLogFields(error),\n });\n });\n\n return A2A_TaskTransitionOutcome.ADVANCED;\n } catch (error) {\n this.logger.error('[A2ATask] Failed to advance a task status; the stored state is now stale', {\n taskId,\n status,\n ...projectCaughtErrorLogFields(error),\n });\n // 'failed', NOT 'refused' (review finding N-3). This `catch` previously fell through with no\n // return at all, so a thrown write resolved `undefined` — invisible to tsc under\n // `strict: false`, and read as falsy by the caller. `tasks/cancel` then answered \"the task\n // reached a terminal state before the cancellation was recorded\": a FALSE claim about state,\n // on a destructive verb, for what was actually a transient database error. A refusal and a\n // failure are different facts and must not share a representation.\n return A2A_TaskTransitionOutcome.FAILED;\n }\n }\n\n /**\n * Read one task as the protocol object — backs `tasks/get`.\n *\n * Returns `undefined` when no task with that id is visible to this owner. That\n * covers both \"does not exist\" and \"belongs to another tenant\", and collapsing the\n * two is deliberate: distinguishing them would let a caller probe for the existence\n * of other tenants' task ids.\n */\n public async readTask(\n owner: ConversationalOwnerScope,\n taskId: string,\n instanceRef?: string,\n machineCredentialId?: string,\n ): Promise<A2A_OutboundTask | undefined> {\n const resolved = this.resolveTaskOwner(owner);\n if (!resolved) return undefined;\n\n const task = await this.systemAccess.readAsSystem<FlowActorTask>(\n resolved.resourceType,\n buildTaskIdentityFilter(resolved, taskId, instanceRef, machineCredentialId),\n // NO `suppressSystemAudit`. That option's contract reserves it for SELF-REFERENTIAL\n // framework plumbing whose auditing would only amplify (or recurse into) the trail —\n // \"genuine privileged reads leave this unset so they still audit\". This read is\n // externally triggered by an agent client, is tenant-actionable, and cannot recurse\n // into the audit pipeline, so suppressing it was a silent hole in the trail.\n { scopeContext: resolved.scopeContext },\n );\n if (!task) return undefined;\n\n // DERIVE-ON-READ liveness (never a write on a read path).\n //\n // A non-terminal task whose liveness lease is gone was abandoned by a pod that died\n // mid-turn: nothing will ever advance it, so reporting the stored `working` would be\n // a lie that never self-corrects. It is reported as FAILED here, and the durable\n // repair belongs to the sweep — deliberately NOT to this read, which would need\n // UPDATE authority inside a READ operation.\n // `isLivenessGovernedA2ATaskStatus`, NOT `!isTerminalA2ATaskStatus` (review finding A3-3):\n // a task INTERRUPTED for a human approval is non-terminal yet holds no lease by design, so\n // the terminal-only test reported every paused task as failed on the next poll.\n if (isLivenessGovernedA2ATaskStatus(task.status) && !(await this.cancellation.isTurnAlive(taskId))) {\n return { ...this.toOutboundTask(task), status: { state: A2A_TaskState.FAILED, timestamp: new Date().toISOString() } };\n }\n\n // DERIVE-ON-READ approval release (reader 1 of 2 — the other is the cancel CAS in `advanceTask`).\n //\n // A paused task's true state lives on its execution, because the decision that releases it\n // arrives over a transport that cannot reach this row. Without this the client polls\n // `input-required` forever on a turn that already finished.\n const effectiveStatus = await this.resolveEffectiveTaskStatus(task, owner);\n if (effectiveStatus !== task.status) {\n return { ...this.toOutboundTask({ ...task, status: effectiveStatus }) };\n }\n\n return this.toOutboundTask(task);\n }\n\n /** Project a persisted task row onto the protocol object. */\n public toOutboundTask(task: FlowActorTask): A2A_OutboundTask {\n const state = toA2ATaskState(task.status);\n const timestamp = (task.finishedAt ?? task.updatedAt ?? task.createdAt ?? new Date()) as Date;\n\n return {\n kind: 'task',\n id: task.taskId,\n contextId: task.contextId ?? '',\n status: {\n state,\n timestamp: timestamp instanceof Date ? timestamp.toISOString() : String(timestamp),\n },\n ...(task.artifacts?.length\n ? {\n artifacts: task.artifacts.map((artifact, index) => {\n // `ref` is the artifact's own stable identity. An earlier version read `_id`,\n // which `ArtifactInstance_BaseSchema` does not declare — so every artifactId\n // fell back to the POSITIONAL `artifact-${index}` and changed whenever the\n // array reordered, breaking the one thing an id is for.\n const a = artifact as { ref?: string; name?: string; type?: string; content?: unknown };\n return {\n artifactId: a.ref ?? `artifact-${index}`,\n name: a.name,\n // A2A part kinds are `text` / `file` / `data`. Wildo's `FlowsActors_IO_PartKind`\n // adds RAW_DATA / STRUCTURED / IMAGE, which have no A2A equivalent — they are\n // mapped onto `data` rather than emitted verbatim, because a kind the client\n // does not know is worse than the nearest one it does.\n parts: [toA2APart(a.type, a.content)],\n };\n }),\n }\n : {}),\n };\n }\n\n}\n\n/**\n * Map a Wildo IO part kind onto an A2A part.\n *\n * spec-cite: A2A v0.2.5 §6.5 (Part union: TextPart / FilePart / DataPart)\n *\n * A2A defines `text`, `file` and `data`. Wildo's vocabulary is wider, so anything without\n * a direct counterpart becomes a `data` part rather than leaking an unknown kind onto the\n * wire. The payload key follows A2A's shape per kind (`text` / `file` / `data`), not\n * Wildo's internal `content`.\n */\nfunction toA2APart(type: string | undefined, content: unknown): { kind: string; [k: string]: unknown } {\n switch (type) {\n case 'text':\n return { kind: 'text', text: typeof content === 'string' ? content : (content as { text?: string })?.text ?? '' };\n case 'file':\n return { kind: 'file', file: content };\n default:\n return { kind: 'data', data: content };\n }\n}\n"]}
|
|
@@ -26,6 +26,22 @@ export type A2ATokenBudgetDecision = {
|
|
|
26
26
|
consumedTokens?: number;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
+
* @wildo_source:part:start saas.backend.a2a.token-budget facet:layer:backend facet:audience:app-developer
|
|
30
|
+
*
|
|
31
|
+
* Capping what external agent callers may SPEND on a tenant's behalf.
|
|
32
|
+
*
|
|
33
|
+
* An application declares the allowance as a numeric LIMIT on a billing product, and nothing else:
|
|
34
|
+
* the transport resolves it live from the plan, so an upgrade or downgrade takes effect immediately
|
|
35
|
+
* with no copy to keep in sync. The burst throttle beside it needs no declaration at all.
|
|
36
|
+
*
|
|
37
|
+
* ⚠️ **Declare it with `CEILING` semantics.** This is a consumption cap, and under the default
|
|
38
|
+
* `FLOOR` an unlimited default absorbs every finite plan grant — so the cap silently never engages.
|
|
39
|
+
* That is the same trap the limit builders record, and this is the surface where it costs money.
|
|
40
|
+
*
|
|
41
|
+
* Two scopes, and they are not the same one: the BUDGET is per TENANT, the burst throttle is per
|
|
42
|
+
* PRINCIPAL. An organization holding several machine credentials therefore gets that many throttle
|
|
43
|
+
* windows against one shared budget.
|
|
44
|
+
*
|
|
29
45
|
* Per-tenant LLM **token budget** for the inbound A2A transport — the sustained cost control
|
|
30
46
|
* that complements the per-principal BURST throttle (`external-turn-rate-limit`). The burst
|
|
31
47
|
* throttle caps turns-per-minute; this caps tokens **per budget period** against the allowance the
|
|
@@ -75,6 +91,8 @@ export type A2ATokenBudgetDecision = {
|
|
|
75
91
|
* the same stale reading. The real bound is therefore the concurrency the burst throttle permits ×
|
|
76
92
|
* the size of those turns. That is acceptable for a spend cap (it is bounded and self-correcting on
|
|
77
93
|
* the next turn) but it must not be described as a single-turn guarantee.
|
|
94
|
+
*
|
|
95
|
+
* @wildo_source:part:end saas.backend.a2a.token-budget
|
|
78
96
|
*/
|
|
79
97
|
export declare class A2ATokenBudgetBackendService {
|
|
80
98
|
private readonly logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-token-budget.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-token-budget.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAE7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAC7H,OAAO,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AAChK,OAAO,EAAE,+BAA+B,EAAE,MAAM,yEAAyE,CAAC;AAE1H,yFAAyF;AACzF,oBAAY,0BAA0B;IACpC,yDAAyD;IACzD,mBAAmB,wBAAwB;IAC3C,2GAA2G;IAC3G,wBAAwB,6BAA6B;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,0BAA0B,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAcN
|
|
1
|
+
{"version":3,"file":"a2a-token-budget.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-token-budget.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAW1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAE7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAC7H,OAAO,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AAChK,OAAO,EAAE,+BAA+B,EAAE,MAAM,yEAAyE,CAAC;AAE1H,yFAAyF;AACzF,oBAAY,0BAA0B;IACpC,yDAAyD;IACzD,mBAAmB,wBAAwB;IAC3C,2GAA2G;IAC3G,wBAAwB,6BAA6B;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,0BAA0B,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAcN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,qBACa,4BAA4B;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM;IACV,OAAO,CAAC,QAAQ,CAAC,YAAY;IACd,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAC/C,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAHnC,MAAM,EAAE,aAAa,EACR,YAAY,EAAE,0BAA0B,EACzB,oBAAoB,EAAE,yCAAyC,EACzE,iBAAiB,EAAE,+BAA+B;IAG1H;;;OAGG;IACU,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAwC5F;;;;OAIG;IACU,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzF;;;;;;;;;;;;;;;;;;OAkBG;YACW,UAAU;IAiExB,4FAA4F;YAC9E,kBAAkB;YAMlB,SAAS;IAgBvB;;;;OAIG;YACW,sBAAsB;IAKpC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmDG;IACH,OAAO,CAAC,mBAAmB;CAgD5B"}
|
|
@@ -28,6 +28,22 @@ export var A2ATokenBudgetDenialReason;
|
|
|
28
28
|
A2ATokenBudgetDenialReason["CONSUMPTION_UNVERIFIABLE"] = "consumption_unverifiable";
|
|
29
29
|
})(A2ATokenBudgetDenialReason || (A2ATokenBudgetDenialReason = {}));
|
|
30
30
|
/**
|
|
31
|
+
* @wildo_source:part:start saas.backend.a2a.token-budget facet:layer:backend facet:audience:app-developer
|
|
32
|
+
*
|
|
33
|
+
* Capping what external agent callers may SPEND on a tenant's behalf.
|
|
34
|
+
*
|
|
35
|
+
* An application declares the allowance as a numeric LIMIT on a billing product, and nothing else:
|
|
36
|
+
* the transport resolves it live from the plan, so an upgrade or downgrade takes effect immediately
|
|
37
|
+
* with no copy to keep in sync. The burst throttle beside it needs no declaration at all.
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ **Declare it with `CEILING` semantics.** This is a consumption cap, and under the default
|
|
40
|
+
* `FLOOR` an unlimited default absorbs every finite plan grant — so the cap silently never engages.
|
|
41
|
+
* That is the same trap the limit builders record, and this is the surface where it costs money.
|
|
42
|
+
*
|
|
43
|
+
* Two scopes, and they are not the same one: the BUDGET is per TENANT, the burst throttle is per
|
|
44
|
+
* PRINCIPAL. An organization holding several machine credentials therefore gets that many throttle
|
|
45
|
+
* windows against one shared budget.
|
|
46
|
+
*
|
|
31
47
|
* Per-tenant LLM **token budget** for the inbound A2A transport — the sustained cost control
|
|
32
48
|
* that complements the per-principal BURST throttle (`external-turn-rate-limit`). The burst
|
|
33
49
|
* throttle caps turns-per-minute; this caps tokens **per budget period** against the allowance the
|
|
@@ -77,6 +93,8 @@ export var A2ATokenBudgetDenialReason;
|
|
|
77
93
|
* the same stale reading. The real bound is therefore the concurrency the burst throttle permits ×
|
|
78
94
|
* the size of those turns. That is acceptable for a spend cap (it is bounded and self-correcting on
|
|
79
95
|
* the next turn) but it must not be described as a single-turn guarantee.
|
|
96
|
+
*
|
|
97
|
+
* @wildo_source:part:end saas.backend.a2a.token-budget
|
|
80
98
|
*/
|
|
81
99
|
let A2ATokenBudgetBackendService = class A2ATokenBudgetBackendService {
|
|
82
100
|
logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-token-budget.backend.service.js","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-token-budget.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAA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;IACnB,CAAC;CACF,CAAA;AA/SY,4BAA4B;IADxC,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;qCAHQ,aAAa;QACM,0BAA0B;QACH,yCAAyC;QACtD,+BAA+B;GAL/G,4BAA4B,CA+SxC","sourcesContent":["import 'reflect-metadata';\nimport { inject, injectable } from 'inversify';\n\nimport {\n A2A_TOKEN_BUDGET_FEATURE_ID,\n CoreResourceType,\n ExecutionContext_ExecutionType,\n FEATURES_UNLIMITED,\n ResourcePrimaryScope,\n type A2ATokenBudgetState,\n} from '@wildo-ai/saas-models';\nimport type { SocketAuthResult } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { FeatureResolutionBackendService } from '~wildo-backend-lib/features/services/feature-resolution.backend.service';\n\n/** Why a turn was denied by the budget gate. Closed vocabulary — never a bare string. */\nexport enum A2ATokenBudgetDenialReason {\n /** The tenant has consumed its full period allowance. */\n ALLOWANCE_EXHAUSTED = 'allowance_exhausted',\n /** A budget IS configured but consumption could not be read → fail closed (cannot prove within-budget). */\n CONSUMPTION_UNVERIFIABLE = 'consumption_unverifiable',\n}\n\n/**\n * Outcome of the pre-dispatch budget check. STRING discriminant (`kind`) because this package\n * compiles with `strictNullChecks` off, under which boolean-literal discriminated unions do not\n * narrow reliably (same rationale as the A2A transport result types).\n */\nexport type A2ATokenBudgetDecision =\n | { kind: 'ok' }\n | {\n kind: 'over_budget';\n reason: A2ATokenBudgetDenialReason;\n allowanceTokens: number;\n /** Omitted when consumption itself was unreadable. */\n consumedTokens?: number;\n };\n\n/** The resolved persistence target for one tenant's budget singleton. */\ninterface BudgetTarget {\n resourceType: CoreResourceType;\n /** The single injected owner FK, as a filter/create fragment (e.g. `{ organizationId }`). */\n ownerFields: Record<string, string>;\n /** `*AsSystem` scope context — seeds the contextual filter so reads/writes stay owner-scoped. */\n scopeContext: { userId?: string; organizationId?: string; applicationId?: string };\n /** The primary scope + entity id the billing plan's allowance is resolved against. */\n scopeType: ResourcePrimaryScope;\n entityId: string;\n}\n\n/**\n * Per-tenant LLM **token budget** for the inbound A2A transport — the sustained cost control\n * that complements the per-principal BURST throttle (`external-turn-rate-limit`). The burst\n * throttle caps turns-per-minute; this caps tokens **per budget period** against the allowance the\n * tenant's plan grants, and DENIES further turns once exhausted. The period is a UTC calendar\n * month in v1 (see {@link A2ATokenBudgetBackendService.currentPeriodKey}) — deliberately NOT the\n * tenant's billing window, which would cost a billing-account lookup on every turn.\n *\n * ## Two halves, deliberately separated\n *\n * - **Allowance** (the cap) is NOT stored here — it is resolved live from the billing plan via\n * `FeatureResolution.resolveForScope(...).limits[{@link A2A_TOKEN_BUDGET_FEATURE_ID}]`, so a plan\n * upgrade/downgrade takes effect immediately with no copy to keep in sync.\n * - **Consumption** is accumulated in the `a2aTokenBudgetState` polymorphic SINGLETON (exactly one\n * row per tenant; the period lives inside the row and is rolled in place). One row per tenant\n * makes double-counting structurally impossible.\n *\n * ## Error policy (two distinct axes — do not conflate)\n *\n * The BUDGET SEMANTIC is fail-closed: exhausted allowance ⇒ hard deny (HTTP 402 at the transport),\n * never a soft warning. The ERROR policy is split by what we can actually prove:\n *\n * - **Allowance resolution fails** → ALLOW. A2A budgeting is OPT-IN: the vast majority of\n * applications never declare the limit feature, so denying on a features-subsystem blip would\n * break A2A for tenants that never had a budget at all. The burst throttle still applies.\n *\n * ⚠️ Note WHERE that failure surfaces. A THROWN resolution error is caught here and logged as an\n * error. But the more likely path never throws: `getScopeFeatureDocument` degrades a failed read\n * to `null`, so resolution returns definition DEFAULTS — and for this CEILING limit the default\n * is `FEATURES_UNLIMITED`, i.e. the cap silently disappears rather than erroring. That branch is\n * therefore made loud at its own source (an ERROR log in feature resolution) rather than here,\n * because this service cannot distinguish it from \"the tenant genuinely has no budget\".\n * - **A budget IS configured but consumption is unreadable** → DENY\n * ({@link A2ATokenBudgetDenialReason.CONSUMPTION_UNVERIFIABLE}). Here a cap demonstrably exists and\n * we cannot prove the tenant is under it — the coherent choice for a spend boundary. This is safe\n * to fail closed precisely because the counter lives in the application's primary datastore: if\n * that is unreachable the application is down anyway, so this can never be the *sole* cause of an\n * outage (unlike a Redis blip, which is why the burst throttle fails OPEN instead).\n *\n * ## Overage tolerance\n *\n * Token usage is only known AFTER a turn completes, so the gate compares ALREADY-ACCUMULATED\n * consumption against the allowance — chosen over pre-charging an estimate, which would need a\n * refund/reconcile path on every turn.\n *\n * The overage this admits is NOT \"one turn\": recording is fire-and-forget and the response returns\n * before it lands, so every turn already in flight when the allowance is reached passes the gate on\n * the same stale reading. The real bound is therefore the concurrency the burst throttle permits ×\n * the size of those turns. That is acceptable for a spend cap (it is bounded and self-correcting on\n * the next turn) but it must not be described as a single-turn guarantee.\n */\n@injectable()\nexport class A2ATokenBudgetBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.FeatureResolutionService) private readonly featureResolution: FeatureResolutionBackendService,\n ) {}\n\n /**\n * Pre-dispatch gate: may this owner run another A2A agent turn? Called AFTER authentication and\n * the burst throttle, BEFORE the LLM runs. See the class JSDoc for the error policy.\n */\n public async assertTurnWithinBudget(auth: SocketAuthResult): Promise<A2ATokenBudgetDecision> {\n const target = this.resolveBudgetTarget(auth);\n // Defensive: authentication already fails closed on an owner-less principal.\n if (!target) return { kind: 'ok' };\n\n let allowanceTokens: number | undefined;\n try {\n allowanceTokens = await this.resolveAllowanceTokens(target);\n } catch (error) {\n // Opt-in feature: never break A2A for the majority that declared no budget. Loud, not silent.\n this.logger.error('[A2ATokenBudget] Allowance resolution failed — allowing the turn (budget is opt-in)', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n return { kind: 'ok' };\n }\n\n // No limit declared, or explicitly unlimited → this tenant has no A2A token cap.\n if (allowanceTokens === undefined || allowanceTokens === FEATURES_UNLIMITED) return { kind: 'ok' };\n\n let consumedTokens: number;\n try {\n consumedTokens = await this.readConsumedTokens(target);\n } catch (error) {\n // A cap exists and we cannot verify consumption → fail CLOSED (spend boundary).\n this.logger.error('[A2ATokenBudget] Consumption read failed under a configured budget — denying the turn', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n return { kind: 'over_budget', reason: A2ATokenBudgetDenialReason.CONSUMPTION_UNVERIFIABLE, allowanceTokens };\n }\n\n if (consumedTokens >= allowanceTokens) {\n return { kind: 'over_budget', reason: A2ATokenBudgetDenialReason.ALLOWANCE_EXHAUSTED, allowanceTokens, consumedTokens };\n }\n return { kind: 'ok' };\n }\n\n /**\n * Record one completed turn's token consumption against the owner's current period. Never\n * throws: a metering failure must not fail a turn the caller already served — it is logged, and\n * the gate's fail-closed side keeps the cap honest on subsequent turns.\n */\n public async recordTurnTokens(auth: SocketAuthResult, totalTokens: number): Promise<void> {\n if (!(totalTokens > 0)) return;\n const target = this.resolveBudgetTarget(auth);\n if (!target) return;\n\n try {\n await this.accumulate(target, totalTokens);\n } catch (error) {\n this.logger.error('[A2ATokenBudget] Failed to record turn token consumption', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n totalTokens,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n // ── Internals ──────────────────────────────────────────────────────────────\n\n /**\n * Accumulate tokens into the tenant's singleton, rolling the period in place when it has changed.\n *\n * ADAPTER-NEUTRAL by construction: every write goes through\n * `RepositoriesRegistryHandlerBackendService.atomicIncrementField`, which dispatches to a\n * per-adapter implementation (MongoDB `findOneAndUpdate`, PostgreSQL `UPDATE … RETURNING`). It\n * deliberately does NOT use a raw-MongoDB update expression, which\n * THROWS on any other adapter — a budget built on that would have every write fail on PostgreSQL,\n * and because metering failures are swallowed (accounting must never break a served turn) the\n * counter would silently sit at zero and the cap would never fire.\n *\n * Race-safe WITHOUT `$ne`: every filter is an EQUALITY match. `$ne` is portable through the filter\n * translator (PostgreSQL emits `IS DISTINCT FROM` for Mongo parity), but equality keeps the\n * compare-and-set semantics obvious at each step rather than resting on that parity.\n *\n * Sequence: increment the CURRENT period → if no row matched, either none exists (create) or it\n * holds a PRIOR period (roll it, filtered on the old key so exactly one racer wins) → a racer that\n * loses simply increments the row the winner just advanced.\n */\n private async accumulate(target: BudgetTarget, tokens: number): Promise<void> {\n const periodKey = this.currentPeriodKey();\n const currentPeriodFilter = { ...target.ownerFields, periodKey };\n const bump = (): Promise<A2ATokenBudgetState | null> =>\n this.repositoriesRegistry.atomicIncrementField<A2ATokenBudgetState>(\n target.resourceType,\n currentPeriodFilter,\n 'consumedTokens',\n tokens,\n { lastTurnAt: new Date() },\n );\n\n if (await bump()) return;\n\n const existing = await this.readState(target);\n\n if (!existing) {\n try {\n await this.systemAccess.createAsSystem(\n target.resourceType,\n { ...target.ownerFields, periodKey, consumedTokens: tokens, lastTurnAt: new Date() },\n { scopeContext: target.scopeContext },\n );\n return;\n } catch (error) {\n // Expected case: lost a create race (the owner FK is unique) — the winner's row now exists,\n // so increment it. But a create can also fail for real reasons, and a silently swallowed\n // failure here means consumption is never recorded (the counter reads 0 ⇒ the cap never\n // fires). Log it so a persistent failure is visible rather than inferred from an\n // implausibly idle budget; the increment below still repairs the benign race.\n this.logger.warn('[A2ATokenBudget] Budget-state create failed; falling back to increment (expected on a create race)', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n await bump();\n return;\n }\n }\n\n // ⚠️ GUARD, NOT AN OPTIMISATION: only roll when the row genuinely holds a PRIOR period.\n // Between the missed `$inc` above and this read, a concurrent caller may have created the row\n // (first-ever turn) or already rolled it — in which case `existing` is CURRENT-period and the\n // `$set` below would OVERWRITE its accumulated `consumedTokens` with just this turn's tokens.\n // At a period boundary that silently destroys the whole period's consumption and re-opens the\n // budget — i.e. under-counting that over-allows spend, the exact failure this feature exists to\n // prevent. Falling through to the `$inc` is always the correct action for a current-period row.\n if (existing.periodKey !== periodKey) {\n // Filtering on the OLD key means exactly one concurrent caller performs the reset; the rest\n // fall through and increment the freshly-rolled row.\n // `delta: 0` degrades the primitive to a GUARDED SET — a period reset must OVERWRITE the\n // counter with this turn's tokens, not add to whatever the expired period held.\n const rolled = await this.repositoriesRegistry.atomicIncrementField<A2ATokenBudgetState>(\n target.resourceType,\n { ...target.ownerFields, periodKey: existing.periodKey },\n 'consumedTokens',\n 0,\n { periodKey, consumedTokens: tokens, lastTurnAt: new Date() },\n );\n if (rolled) return;\n }\n\n await bump();\n }\n\n /** Tokens consumed in the CURRENT period (a row stamped with a prior period reads as 0). */\n private async readConsumedTokens(target: BudgetTarget): Promise<number> {\n const state = await this.readState(target);\n if (!state || state.periodKey !== this.currentPeriodKey()) return 0;\n return state.consumedTokens ?? 0;\n }\n\n private async readState(target: BudgetTarget): Promise<A2ATokenBudgetState | null> {\n return this.systemAccess.readAsSystem<A2ATokenBudgetState>(\n target.resourceType,\n target.ownerFields,\n {\n scopeContext: target.scopeContext,\n // This read is framework PLUMBING on the hot path — it runs on every budgeted turn purely\n // to compare the tenant's own counter against its own allowance, and it surfaces nothing to\n // anyone. Auditing it would add one privileged-access row per A2A turn, burying genuine\n // privileged reads in self-referential noise. The same rationale as the audit pipeline's\n // own membership/config lookups, which is exactly what this flag exists for.\n suppressSystemAudit: true,\n },\n );\n }\n\n /**\n * The tenant's plan-granted token allowance, or `undefined` when the application declared no\n * A2A budget for this scope. Resolved live (never cached into the counter row) so plan changes\n * apply immediately.\n */\n private async resolveAllowanceTokens(target: BudgetTarget): Promise<number | undefined> {\n const resolved = await this.featureResolution.resolveForScope(target.scopeType, target.entityId);\n return resolved?.limits?.[A2A_TOKEN_BUDGET_FEATURE_ID];\n }\n\n /**\n * The current budget period key (`YYYY-MM`). A calendar month is deliberate for v1: it needs no\n * per-turn billing-account lookup on the hot path and is deterministic. Anchoring the window to\n * the tenant's actual subscription period is the documented follow-on — it is isolated to THIS\n * one function precisely so that swap stays a single-site change.\n */\n private currentPeriodKey(now: Date = new Date()): string {\n return `${now.getUTCFullYear()}-${String(now.getUTCMonth() + 1).padStart(2, '0')}`;\n }\n\n /**\n * Map the authenticated principal to the TENANT whose budget this turn spends — its counter\n * singleton plus the scope its plan allowance resolves against.\n *\n * ## Budget tenancy ≠ conversation ownership (the distinction this method exists for)\n *\n * The conversation ROW is owned by the delegating user (`{userId}`) — that is correct and\n * deliberate: the chat history is theirs. But the plan that PAYS for the turn belongs to the\n * organization they are acting within. Billing the user scope for a delegated turn is what let an\n * org under a capped plan bypass its cap entirely: `resolveForScope` does not walk the scope\n * chain, so an ORGANIZATIONS-scope grant is simply invisible at USER_SELF, and every member's\n * delegated A2A traffic would be uncapped. Hence this reads the PRINCIPAL, not the owner scope.\n *\n * Resolution is driven by `executionType` rather than by field-presence priority, because a\n * delegated user's `initiatorIds` legitimately carries `applicationId` alongside `userId`: a\n * naive org → app → user precedence would bill the WHOLE APPLICATION for one user's turns\n * whenever they have no active org.\n *\n * - `USER_REQUEST` → the user's active ORGANIZATION when there is one, else the user's own scope.\n * - `ORGANIZATION_MACHINE` / `APPLICATION_MACHINE` → that machine's own org / app.\n *\n * ## Multi-org delegated members — CLOSED for org-scoped clients (2026-07-31)\n *\n * This method used to carry a known bypass: `resolveSocketActiveOrganizationId` inferred an active\n * org only for a user with EXACTLY ONE membership, so a multi-org member arrived with no\n * `organizationId`, fell through to `USER_SELF`, found no user-scope grant, and resolved to the\n * definition default — which under CEILING means NO CAP.\n *\n * The root cause was upstream and NOT specific to billing: `authenticateExternalToken` passed a\n * hardcoded `undefined` organization for every external token. It now derives the active org from\n * the delegating OAuth client's own tenant (`azp` → org-scoped client → `organizationId`). Every\n * delegated client in the exercised substrate is org-scoped, so multi-org members are now billed to\n * the organization whose client they are acting through. The same fix simultaneously restored MCP\n * org-scoped tool access for those users, which the missing org had been denying.\n *\n * ## ⚠️ Why the fail-closed posture below is STILL load-bearing — do not remove it\n *\n * Tenant binding does not make an unattributed turn impossible; three paths still reach `USER_SELF`\n * and therefore the unlimited default:\n *\n * 1. **APPLICATION-scoped delegated clients** have no tenant to pin. None exist in the substrate\n * today, and binding an org for them is deferred (an `organization` parameter at the authorize\n * endpoint, Auth0-style) — but nothing prevents one being registered before that lands.\n * 2. **A user with ZERO org memberships** always resolves to `USER_SELF`, regardless of any\n * upstream binding.\n * 3. **A `CLIENT_PINNED` org the user is not a member of** deliberately DECLINES to self scope\n * rather than substituting a different tenant (see `ActiveOrganizationSelectionSource`) — a\n * legitimate state, since the consent gate admits non-members by design.\n *\n * So an org-scope grant is the primary control and this method's own guard is the backstop. They\n * are independent layers; the upstream binding is not a licence to weaken the one here.\n */\n private resolveBudgetTarget(auth: SocketAuthResult): BudgetTarget | undefined {\n const ids = auth?.initiatorIds;\n if (!ids) return undefined;\n\n const orgTarget = (organizationId: string): BudgetTarget => ({\n resourceType: CoreResourceType.ORGANIZATION_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { organizationId },\n scopeContext: { organizationId },\n scopeType: ResourcePrimaryScope.ORGANIZATIONS,\n entityId: organizationId,\n });\n\n if (auth.executionType === ExecutionContext_ExecutionType.USER_REQUEST) {\n // The org the user is acting within PAYS; only a user with no active org bills their own scope.\n if (ids.organizationId) return orgTarget(ids.organizationId);\n if (ids.userId) {\n return {\n resourceType: CoreResourceType.USER_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { userId: ids.userId },\n scopeContext: { userId: ids.userId },\n scopeType: ResourcePrimaryScope.USER_SELF,\n entityId: ids.userId,\n };\n }\n return undefined;\n }\n\n if (auth.executionType === ExecutionContext_ExecutionType.ORGANIZATION_MACHINE && ids.organizationId) {\n return orgTarget(ids.organizationId);\n }\n\n // ⚠️ An APPLICATION-scope allowance cannot come from a billing plan: billing has no application\n // variant (`BILLING_SCOPE_TO_VARIANTS` = organization + user), so `billing-feature-sync` never\n // writes `APPLICATION_FEATURES.limits`. An app-machine cap must therefore be set through a\n // features profile or a manual `limitOverrides`; absent one, app-machine turns resolve to the\n // unlimited default and are bounded only by the per-principal burst throttle.\n if (auth.executionType === ExecutionContext_ExecutionType.APPLICATION_MACHINE && ids.applicationId) {\n return {\n resourceType: CoreResourceType.APPLICATION_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { applicationId: ids.applicationId },\n scopeContext: { applicationId: ids.applicationId },\n scopeType: ResourcePrimaryScope.APPLICATION,\n entityId: ids.applicationId,\n };\n }\n\n return undefined;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"a2a-token-budget.backend.service.js","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a-token-budget.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,8BAA8B,EAC9B,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,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CAAC;CACF,CAAA;AA/SY,4BAA4B;IADxC,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;qCAHQ,aAAa;QACM,0BAA0B;QACH,yCAAyC;QACtD,+BAA+B;GAL/G,4BAA4B,CA+SxC","sourcesContent":["import 'reflect-metadata';\nimport { inject, injectable } from 'inversify';\n\nimport {\n A2A_TOKEN_BUDGET_FEATURE_ID,\n CoreResourceType,\n ExecutionContext_ExecutionType,\n FEATURES_UNLIMITED,\n ResourcePrimaryScope,\n type A2ATokenBudgetState,\n} from '@wildo-ai/saas-models';\nimport type { SocketAuthResult } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { FeatureResolutionBackendService } from '~wildo-backend-lib/features/services/feature-resolution.backend.service';\n\n/** Why a turn was denied by the budget gate. Closed vocabulary — never a bare string. */\nexport enum A2ATokenBudgetDenialReason {\n /** The tenant has consumed its full period allowance. */\n ALLOWANCE_EXHAUSTED = 'allowance_exhausted',\n /** A budget IS configured but consumption could not be read → fail closed (cannot prove within-budget). */\n CONSUMPTION_UNVERIFIABLE = 'consumption_unverifiable',\n}\n\n/**\n * Outcome of the pre-dispatch budget check. STRING discriminant (`kind`) because this package\n * compiles with `strictNullChecks` off, under which boolean-literal discriminated unions do not\n * narrow reliably (same rationale as the A2A transport result types).\n */\nexport type A2ATokenBudgetDecision =\n | { kind: 'ok' }\n | {\n kind: 'over_budget';\n reason: A2ATokenBudgetDenialReason;\n allowanceTokens: number;\n /** Omitted when consumption itself was unreadable. */\n consumedTokens?: number;\n };\n\n/** The resolved persistence target for one tenant's budget singleton. */\ninterface BudgetTarget {\n resourceType: CoreResourceType;\n /** The single injected owner FK, as a filter/create fragment (e.g. `{ organizationId }`). */\n ownerFields: Record<string, string>;\n /** `*AsSystem` scope context — seeds the contextual filter so reads/writes stay owner-scoped. */\n scopeContext: { userId?: string; organizationId?: string; applicationId?: string };\n /** The primary scope + entity id the billing plan's allowance is resolved against. */\n scopeType: ResourcePrimaryScope;\n entityId: string;\n}\n\n/**\n * @wildo_source:part:start saas.backend.a2a.token-budget facet:layer:backend facet:audience:app-developer\n *\n * Capping what external agent callers may SPEND on a tenant's behalf.\n *\n * An application declares the allowance as a numeric LIMIT on a billing product, and nothing else:\n * the transport resolves it live from the plan, so an upgrade or downgrade takes effect immediately\n * with no copy to keep in sync. The burst throttle beside it needs no declaration at all.\n *\n * ⚠️ **Declare it with `CEILING` semantics.** This is a consumption cap, and under the default\n * `FLOOR` an unlimited default absorbs every finite plan grant — so the cap silently never engages.\n * That is the same trap the limit builders record, and this is the surface where it costs money.\n *\n * Two scopes, and they are not the same one: the BUDGET is per TENANT, the burst throttle is per\n * PRINCIPAL. An organization holding several machine credentials therefore gets that many throttle\n * windows against one shared budget.\n *\n * Per-tenant LLM **token budget** for the inbound A2A transport — the sustained cost control\n * that complements the per-principal BURST throttle (`external-turn-rate-limit`). The burst\n * throttle caps turns-per-minute; this caps tokens **per budget period** against the allowance the\n * tenant's plan grants, and DENIES further turns once exhausted. The period is a UTC calendar\n * month in v1 (see {@link A2ATokenBudgetBackendService.currentPeriodKey}) — deliberately NOT the\n * tenant's billing window, which would cost a billing-account lookup on every turn.\n *\n * ## Two halves, deliberately separated\n *\n * - **Allowance** (the cap) is NOT stored here — it is resolved live from the billing plan via\n * `FeatureResolution.resolveForScope(...).limits[{@link A2A_TOKEN_BUDGET_FEATURE_ID}]`, so a plan\n * upgrade/downgrade takes effect immediately with no copy to keep in sync.\n * - **Consumption** is accumulated in the `a2aTokenBudgetState` polymorphic SINGLETON (exactly one\n * row per tenant; the period lives inside the row and is rolled in place). One row per tenant\n * makes double-counting structurally impossible.\n *\n * ## Error policy (two distinct axes — do not conflate)\n *\n * The BUDGET SEMANTIC is fail-closed: exhausted allowance ⇒ hard deny (HTTP 402 at the transport),\n * never a soft warning. The ERROR policy is split by what we can actually prove:\n *\n * - **Allowance resolution fails** → ALLOW. A2A budgeting is OPT-IN: the vast majority of\n * applications never declare the limit feature, so denying on a features-subsystem blip would\n * break A2A for tenants that never had a budget at all. The burst throttle still applies.\n *\n * ⚠️ Note WHERE that failure surfaces. A THROWN resolution error is caught here and logged as an\n * error. But the more likely path never throws: `getScopeFeatureDocument` degrades a failed read\n * to `null`, so resolution returns definition DEFAULTS — and for this CEILING limit the default\n * is `FEATURES_UNLIMITED`, i.e. the cap silently disappears rather than erroring. That branch is\n * therefore made loud at its own source (an ERROR log in feature resolution) rather than here,\n * because this service cannot distinguish it from \"the tenant genuinely has no budget\".\n * - **A budget IS configured but consumption is unreadable** → DENY\n * ({@link A2ATokenBudgetDenialReason.CONSUMPTION_UNVERIFIABLE}). Here a cap demonstrably exists and\n * we cannot prove the tenant is under it — the coherent choice for a spend boundary. This is safe\n * to fail closed precisely because the counter lives in the application's primary datastore: if\n * that is unreachable the application is down anyway, so this can never be the *sole* cause of an\n * outage (unlike a Redis blip, which is why the burst throttle fails OPEN instead).\n *\n * ## Overage tolerance\n *\n * Token usage is only known AFTER a turn completes, so the gate compares ALREADY-ACCUMULATED\n * consumption against the allowance — chosen over pre-charging an estimate, which would need a\n * refund/reconcile path on every turn.\n *\n * The overage this admits is NOT \"one turn\": recording is fire-and-forget and the response returns\n * before it lands, so every turn already in flight when the allowance is reached passes the gate on\n * the same stale reading. The real bound is therefore the concurrency the burst throttle permits ×\n * the size of those turns. That is acceptable for a spend cap (it is bounded and self-correcting on\n * the next turn) but it must not be described as a single-turn guarantee.\n *\n * @wildo_source:part:end saas.backend.a2a.token-budget\n */\n@injectable()\nexport class A2ATokenBudgetBackendService {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.FeatureResolutionService) private readonly featureResolution: FeatureResolutionBackendService,\n ) {}\n\n /**\n * Pre-dispatch gate: may this owner run another A2A agent turn? Called AFTER authentication and\n * the burst throttle, BEFORE the LLM runs. See the class JSDoc for the error policy.\n */\n public async assertTurnWithinBudget(auth: SocketAuthResult): Promise<A2ATokenBudgetDecision> {\n const target = this.resolveBudgetTarget(auth);\n // Defensive: authentication already fails closed on an owner-less principal.\n if (!target) return { kind: 'ok' };\n\n let allowanceTokens: number | undefined;\n try {\n allowanceTokens = await this.resolveAllowanceTokens(target);\n } catch (error) {\n // Opt-in feature: never break A2A for the majority that declared no budget. Loud, not silent.\n this.logger.error('[A2ATokenBudget] Allowance resolution failed — allowing the turn (budget is opt-in)', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n return { kind: 'ok' };\n }\n\n // No limit declared, or explicitly unlimited → this tenant has no A2A token cap.\n if (allowanceTokens === undefined || allowanceTokens === FEATURES_UNLIMITED) return { kind: 'ok' };\n\n let consumedTokens: number;\n try {\n consumedTokens = await this.readConsumedTokens(target);\n } catch (error) {\n // A cap exists and we cannot verify consumption → fail CLOSED (spend boundary).\n this.logger.error('[A2ATokenBudget] Consumption read failed under a configured budget — denying the turn', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n return { kind: 'over_budget', reason: A2ATokenBudgetDenialReason.CONSUMPTION_UNVERIFIABLE, allowanceTokens };\n }\n\n if (consumedTokens >= allowanceTokens) {\n return { kind: 'over_budget', reason: A2ATokenBudgetDenialReason.ALLOWANCE_EXHAUSTED, allowanceTokens, consumedTokens };\n }\n return { kind: 'ok' };\n }\n\n /**\n * Record one completed turn's token consumption against the owner's current period. Never\n * throws: a metering failure must not fail a turn the caller already served — it is logged, and\n * the gate's fail-closed side keeps the cap honest on subsequent turns.\n */\n public async recordTurnTokens(auth: SocketAuthResult, totalTokens: number): Promise<void> {\n if (!(totalTokens > 0)) return;\n const target = this.resolveBudgetTarget(auth);\n if (!target) return;\n\n try {\n await this.accumulate(target, totalTokens);\n } catch (error) {\n this.logger.error('[A2ATokenBudget] Failed to record turn token consumption', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n totalTokens,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n // ── Internals ──────────────────────────────────────────────────────────────\n\n /**\n * Accumulate tokens into the tenant's singleton, rolling the period in place when it has changed.\n *\n * ADAPTER-NEUTRAL by construction: every write goes through\n * `RepositoriesRegistryHandlerBackendService.atomicIncrementField`, which dispatches to a\n * per-adapter implementation (MongoDB `findOneAndUpdate`, PostgreSQL `UPDATE … RETURNING`). It\n * deliberately does NOT use a raw-MongoDB update expression, which\n * THROWS on any other adapter — a budget built on that would have every write fail on PostgreSQL,\n * and because metering failures are swallowed (accounting must never break a served turn) the\n * counter would silently sit at zero and the cap would never fire.\n *\n * Race-safe WITHOUT `$ne`: every filter is an EQUALITY match. `$ne` is portable through the filter\n * translator (PostgreSQL emits `IS DISTINCT FROM` for Mongo parity), but equality keeps the\n * compare-and-set semantics obvious at each step rather than resting on that parity.\n *\n * Sequence: increment the CURRENT period → if no row matched, either none exists (create) or it\n * holds a PRIOR period (roll it, filtered on the old key so exactly one racer wins) → a racer that\n * loses simply increments the row the winner just advanced.\n */\n private async accumulate(target: BudgetTarget, tokens: number): Promise<void> {\n const periodKey = this.currentPeriodKey();\n const currentPeriodFilter = { ...target.ownerFields, periodKey };\n const bump = (): Promise<A2ATokenBudgetState | null> =>\n this.repositoriesRegistry.atomicIncrementField<A2ATokenBudgetState>(\n target.resourceType,\n currentPeriodFilter,\n 'consumedTokens',\n tokens,\n { lastTurnAt: new Date() },\n );\n\n if (await bump()) return;\n\n const existing = await this.readState(target);\n\n if (!existing) {\n try {\n await this.systemAccess.createAsSystem(\n target.resourceType,\n { ...target.ownerFields, periodKey, consumedTokens: tokens, lastTurnAt: new Date() },\n { scopeContext: target.scopeContext },\n );\n return;\n } catch (error) {\n // Expected case: lost a create race (the owner FK is unique) — the winner's row now exists,\n // so increment it. But a create can also fail for real reasons, and a silently swallowed\n // failure here means consumption is never recorded (the counter reads 0 ⇒ the cap never\n // fires). Log it so a persistent failure is visible rather than inferred from an\n // implausibly idle budget; the increment below still repairs the benign race.\n this.logger.warn('[A2ATokenBudget] Budget-state create failed; falling back to increment (expected on a create race)', {\n scopeType: target.scopeType,\n entityId: target.entityId,\n ...projectCaughtErrorLogFields(error),\n });\n await bump();\n return;\n }\n }\n\n // ⚠️ GUARD, NOT AN OPTIMISATION: only roll when the row genuinely holds a PRIOR period.\n // Between the missed `$inc` above and this read, a concurrent caller may have created the row\n // (first-ever turn) or already rolled it — in which case `existing` is CURRENT-period and the\n // `$set` below would OVERWRITE its accumulated `consumedTokens` with just this turn's tokens.\n // At a period boundary that silently destroys the whole period's consumption and re-opens the\n // budget — i.e. under-counting that over-allows spend, the exact failure this feature exists to\n // prevent. Falling through to the `$inc` is always the correct action for a current-period row.\n if (existing.periodKey !== periodKey) {\n // Filtering on the OLD key means exactly one concurrent caller performs the reset; the rest\n // fall through and increment the freshly-rolled row.\n // `delta: 0` degrades the primitive to a GUARDED SET — a period reset must OVERWRITE the\n // counter with this turn's tokens, not add to whatever the expired period held.\n const rolled = await this.repositoriesRegistry.atomicIncrementField<A2ATokenBudgetState>(\n target.resourceType,\n { ...target.ownerFields, periodKey: existing.periodKey },\n 'consumedTokens',\n 0,\n { periodKey, consumedTokens: tokens, lastTurnAt: new Date() },\n );\n if (rolled) return;\n }\n\n await bump();\n }\n\n /** Tokens consumed in the CURRENT period (a row stamped with a prior period reads as 0). */\n private async readConsumedTokens(target: BudgetTarget): Promise<number> {\n const state = await this.readState(target);\n if (!state || state.periodKey !== this.currentPeriodKey()) return 0;\n return state.consumedTokens ?? 0;\n }\n\n private async readState(target: BudgetTarget): Promise<A2ATokenBudgetState | null> {\n return this.systemAccess.readAsSystem<A2ATokenBudgetState>(\n target.resourceType,\n target.ownerFields,\n {\n scopeContext: target.scopeContext,\n // This read is framework PLUMBING on the hot path — it runs on every budgeted turn purely\n // to compare the tenant's own counter against its own allowance, and it surfaces nothing to\n // anyone. Auditing it would add one privileged-access row per A2A turn, burying genuine\n // privileged reads in self-referential noise. The same rationale as the audit pipeline's\n // own membership/config lookups, which is exactly what this flag exists for.\n suppressSystemAudit: true,\n },\n );\n }\n\n /**\n * The tenant's plan-granted token allowance, or `undefined` when the application declared no\n * A2A budget for this scope. Resolved live (never cached into the counter row) so plan changes\n * apply immediately.\n */\n private async resolveAllowanceTokens(target: BudgetTarget): Promise<number | undefined> {\n const resolved = await this.featureResolution.resolveForScope(target.scopeType, target.entityId);\n return resolved?.limits?.[A2A_TOKEN_BUDGET_FEATURE_ID];\n }\n\n /**\n * The current budget period key (`YYYY-MM`). A calendar month is deliberate for v1: it needs no\n * per-turn billing-account lookup on the hot path and is deterministic. Anchoring the window to\n * the tenant's actual subscription period is the documented follow-on — it is isolated to THIS\n * one function precisely so that swap stays a single-site change.\n */\n private currentPeriodKey(now: Date = new Date()): string {\n return `${now.getUTCFullYear()}-${String(now.getUTCMonth() + 1).padStart(2, '0')}`;\n }\n\n /**\n * Map the authenticated principal to the TENANT whose budget this turn spends — its counter\n * singleton plus the scope its plan allowance resolves against.\n *\n * ## Budget tenancy ≠ conversation ownership (the distinction this method exists for)\n *\n * The conversation ROW is owned by the delegating user (`{userId}`) — that is correct and\n * deliberate: the chat history is theirs. But the plan that PAYS for the turn belongs to the\n * organization they are acting within. Billing the user scope for a delegated turn is what let an\n * org under a capped plan bypass its cap entirely: `resolveForScope` does not walk the scope\n * chain, so an ORGANIZATIONS-scope grant is simply invisible at USER_SELF, and every member's\n * delegated A2A traffic would be uncapped. Hence this reads the PRINCIPAL, not the owner scope.\n *\n * Resolution is driven by `executionType` rather than by field-presence priority, because a\n * delegated user's `initiatorIds` legitimately carries `applicationId` alongside `userId`: a\n * naive org → app → user precedence would bill the WHOLE APPLICATION for one user's turns\n * whenever they have no active org.\n *\n * - `USER_REQUEST` → the user's active ORGANIZATION when there is one, else the user's own scope.\n * - `ORGANIZATION_MACHINE` / `APPLICATION_MACHINE` → that machine's own org / app.\n *\n * ## Multi-org delegated members — CLOSED for org-scoped clients (2026-07-31)\n *\n * This method used to carry a known bypass: `resolveSocketActiveOrganizationId` inferred an active\n * org only for a user with EXACTLY ONE membership, so a multi-org member arrived with no\n * `organizationId`, fell through to `USER_SELF`, found no user-scope grant, and resolved to the\n * definition default — which under CEILING means NO CAP.\n *\n * The root cause was upstream and NOT specific to billing: `authenticateExternalToken` passed a\n * hardcoded `undefined` organization for every external token. It now derives the active org from\n * the delegating OAuth client's own tenant (`azp` → org-scoped client → `organizationId`). Every\n * delegated client in the exercised substrate is org-scoped, so multi-org members are now billed to\n * the organization whose client they are acting through. The same fix simultaneously restored MCP\n * org-scoped tool access for those users, which the missing org had been denying.\n *\n * ## ⚠️ Why the fail-closed posture below is STILL load-bearing — do not remove it\n *\n * Tenant binding does not make an unattributed turn impossible; three paths still reach `USER_SELF`\n * and therefore the unlimited default:\n *\n * 1. **APPLICATION-scoped delegated clients** have no tenant to pin. None exist in the substrate\n * today, and binding an org for them is deferred (an `organization` parameter at the authorize\n * endpoint, Auth0-style) — but nothing prevents one being registered before that lands.\n * 2. **A user with ZERO org memberships** always resolves to `USER_SELF`, regardless of any\n * upstream binding.\n * 3. **A `CLIENT_PINNED` org the user is not a member of** deliberately DECLINES to self scope\n * rather than substituting a different tenant (see `ActiveOrganizationSelectionSource`) — a\n * legitimate state, since the consent gate admits non-members by design.\n *\n * So an org-scope grant is the primary control and this method's own guard is the backstop. They\n * are independent layers; the upstream binding is not a licence to weaken the one here.\n */\n private resolveBudgetTarget(auth: SocketAuthResult): BudgetTarget | undefined {\n const ids = auth?.initiatorIds;\n if (!ids) return undefined;\n\n const orgTarget = (organizationId: string): BudgetTarget => ({\n resourceType: CoreResourceType.ORGANIZATION_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { organizationId },\n scopeContext: { organizationId },\n scopeType: ResourcePrimaryScope.ORGANIZATIONS,\n entityId: organizationId,\n });\n\n if (auth.executionType === ExecutionContext_ExecutionType.USER_REQUEST) {\n // The org the user is acting within PAYS; only a user with no active org bills their own scope.\n if (ids.organizationId) return orgTarget(ids.organizationId);\n if (ids.userId) {\n return {\n resourceType: CoreResourceType.USER_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { userId: ids.userId },\n scopeContext: { userId: ids.userId },\n scopeType: ResourcePrimaryScope.USER_SELF,\n entityId: ids.userId,\n };\n }\n return undefined;\n }\n\n if (auth.executionType === ExecutionContext_ExecutionType.ORGANIZATION_MACHINE && ids.organizationId) {\n return orgTarget(ids.organizationId);\n }\n\n // ⚠️ An APPLICATION-scope allowance cannot come from a billing plan: billing has no application\n // variant (`BILLING_SCOPE_TO_VARIANTS` = organization + user), so `billing-feature-sync` never\n // writes `APPLICATION_FEATURES.limits`. An app-machine cap must therefore be set through a\n // features profile or a manual `limitOverrides`; absent one, app-machine turns resolve to the\n // unlimited default and are bounded only by the per-principal burst throttle.\n if (auth.executionType === ExecutionContext_ExecutionType.APPLICATION_MACHINE && ids.applicationId) {\n return {\n resourceType: CoreResourceType.APPLICATION_A2A_TOKEN_BUDGET_STATE,\n ownerFields: { applicationId: ids.applicationId },\n scopeContext: { applicationId: ids.applicationId },\n scopeType: ResourcePrimaryScope.APPLICATION,\n entityId: ids.applicationId,\n };\n }\n\n return undefined;\n }\n}\n"]}
|
|
@@ -137,14 +137,19 @@ declare const A2A_MACHINE_ACCESS_OPERATION_BY_METHOD: {
|
|
|
137
137
|
* ## The version note, because the names below are v0.2.5's and the shapes are 1.0's
|
|
138
138
|
*
|
|
139
139
|
* A2A 1.0 renames every method (`SendMessage`, `GetTask`, `CancelTask`, `SubscribeToTask`,
|
|
140
|
-
* `CreateTaskPushNotificationConfig`, …).
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
140
|
+
* `CreateTaskPushNotificationConfig`, …). The transport answers BOTH vocabularies: the method name
|
|
141
|
+
* is the dialect signal, `resolveA2AMethod` classifies it, and the request is then NORMALISED to the
|
|
142
|
+
* v0.2.5 spelling before any routing happens (see `a2a-dialect.backend.schemas.ts`). So this union
|
|
143
|
+
* is the NORMALISED spelling that the audit map and every handler key off, not a statement that a
|
|
144
|
+
* client may only send the older names. The one exception is `ListTasks`, which v0.2.5 never
|
|
145
|
+
* defined, so it appears here under its 1.0 name.
|
|
145
146
|
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
147
|
+
* The DATA shapes follow 1.0 (see `a2a-push-notification.backend.schemas.ts`), because that is where
|
|
148
|
+
* v0.2.5 is actually deficient: it never defined the webhook payload.
|
|
149
|
+
*
|
|
150
|
+
* Renaming the members below to the 1.0 vocabulary would be a separate, larger unit even now that
|
|
151
|
+
* both dialects are served: it touches the audit map, every routing branch and every handler
|
|
152
|
+
* signature, and it buys nothing on the wire, because the wire already accepts either spelling.
|
|
148
153
|
*
|
|
149
154
|
* spec-cite: A2A 1.0 §5.3 (binding method table — the 1.0 JSON-RPC names) and the legacy anchors it
|
|
150
155
|
* carries for the v0.2.5 names (e.g. `75-taskspushnotificationconfigset` on §3.1.7), which is what
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a.backend.service.d.ts","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AE,MAAM,CAAA;CAAE,GAC/C;IACA,qFAAqF;IACrF,IAAI,EAAE,mBAAmB,CAAC;IAC1B,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,GACC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,sCAAsC;;;;;;;;;;;CAYc,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"a2a.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/flows-actors/a2a/services/a2a.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAM1B,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,wEAAwE,CAAC;AACpH,OAAO,EACL,qCAAqC,EACrC,KAAK,wBAAwB,EAC9B,MAAM,mFAAmF,CAAC;AAC3F,OAAO,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAC;AACtI,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,6CAA6C,EAAE,MAAM,oFAAoF,CAAC;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