@wildo-ai/saas-backend-lib 1.1.3 → 1.1.4
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/__tests__/fixture-deep-partial.d.ts.map +1 -1
- package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +1 -1
- package/dist/esm/__tests__/setup.d.ts.map +1 -1
- package/dist/esm/__tests__/test-container.d.ts.map +1 -1
- package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -1
- package/dist/esm/applications/seeds/application-metadata-defaults.seeds.d.ts.map +1 -1
- 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.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.map +1 -1
- package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -1
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +1 -1
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +12 -1
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/base-classes/services/batches/resource-retention-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- package/dist/esm/base-classes/services/controllers/utils/audit-access-fields.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/utils/operation-response-serializer.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-filter-translation.backend.d.ts.map +1 -1
- 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 +13 -4
- 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-query.backend.d.ts.map +1 -1
- 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 +17 -0
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-row-projection.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-subject-erasure-effect.backend.d.ts.map +1 -1
- 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.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/odoo-jsonrpc-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/rest-json-query-compiler.backend.d.ts.map +1 -1
- 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.map +1 -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-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +57 -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 +95 -2
- 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.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-guarded-mutation.backend.types.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +5 -2
- 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 +14 -3
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-version-metadata.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/resource-write-integrity.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts +72 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js +88 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/unique-constraint-conflict-reference.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/__tests__/mock-system-access.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/read-only-field-change.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-audit-emission.backend.utils.d.ts.map +1 -1
- 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-custom-implementation-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
- 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-server-injected-fields.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.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.map +1 -1
- 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.map +1 -1
- 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 +44 -6
- 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.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
- package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -1
- package/dist/esm/base-classes/utils/single-subject-addressing.backend.utils.d.ts.map +1 -1
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -1
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -1
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -1
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -1
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +1 -1
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +5 -4
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js +11 -1
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/billing-subject-erasure-effect.backend.d.ts.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/billing/services/billing.utils.d.ts.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.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +32 -0
- 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 +32 -1
- 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.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/credit-pool.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.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +9 -6
- 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 +9 -6
- 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.map +1 -1
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -1
- 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 +50 -3
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
- package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -1
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts +80 -7
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/charts/services/chart-registry.backend.service.js +115 -8
- package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +107 -4
- 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 +176 -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.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -1
- 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 +21 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-class-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-dictionary.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-ocsf-projection.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-projection-contract.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/utils/audit-actor.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/index.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-hide-predicate.backend.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/services/subject-erasure-external-effects.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/services/subject-session-revocation.backend.service.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
- package/dist/esm/config/bootstrap/minion-initialization-projection.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js +3 -0
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -4
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
- package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts +36 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.js +36 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.js.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -1
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -1
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -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 +3 -0
- 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.map +1 -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.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +12 -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 +28 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
- package/dist/esm/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.contracts.d.ts.map +1 -1
- package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.controller.d.ts.map +1 -1
- package/dist/esm/data-seeding/data-seeding-models.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/business-key-resolver.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-execution-context.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-migrator-runner.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-reconciler.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-run.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-run.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-trigger-mode-matrix.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-scope-resolver-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/additive-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/lazy-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/manual-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/sync-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/upgrade-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-business-key.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-error.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-run-counters.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-run-ledger.backend.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-anchor.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-resolution.backend.d.ts.map +1 -1
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/resolve-persistence-adapter.backend.utils.d.ts.map +1 -1
- package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.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-query.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/db-utils.d.ts.map +1 -1
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-development-provisioning.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-ddl.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-migration-sql.backend.d.ts.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.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-lockfile.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/resource-persistence-unit-of-work.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/schema-planning-standalone.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -1
- package/dist/esm/databases/utils/postgresql-identifier.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -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.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
- package/dist/esm/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-extraction-source.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-models.exports.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -1
- 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 +102 -52
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +117 -71
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -1
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js +26 -7
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -1
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +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.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts +81 -34
- 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 +179 -98
- 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.map +1 -1
- package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +121 -0
- 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 +151 -0
- 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 +15 -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 +60 -4
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
- package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -1
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -1
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -1
- package/dist/esm/features/services/application-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/organization-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/scope-feature-ledger-relationship.backend.utils.d.ts.map +1 -1
- package/dist/esm/features/services/scope-features-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -1
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +37 -0
- 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 +221 -21
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -1
- package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -1
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -1
- package/dist/esm/files/scanning/yara-scanner.backend.service.js +20 -2
- package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.js +5 -0
- 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.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.js +8 -5
- 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.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +3 -1
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/services/rag-source-field-detection.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -1
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +36 -1
- 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/file-storage-router.backend.service.d.ts +21 -3
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-router.backend.service.js +38 -5
- package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -1
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts +87 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js +340 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js.map +1 -0
- 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.map +1 -1
- package/dist/esm/files/storage/storage-credential-provider.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-platform-sts-credential-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js +10 -3
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.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.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.map +1 -1
- package/dist/esm/files/utils/file-upload.utils.d.ts.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.map +1 -1
- package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/image-derivation.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/image-thumbnail.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -1
- package/dist/esm/files/utils/rag-source-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/storage-application-identity.backend.utils.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service.d.ts.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.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a-dialect.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a-push-notification-delivery.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a-push-notification.backend.schemas.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-push-delivery-log.repository.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-push-dispatcher.backend.service.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- 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.map +1 -1
- 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/controllers/flows-actors.controller.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -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 +107 -16
- 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 +118 -18
- 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.map +1 -1
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/flows-actors/services/agent-call-trace-sink.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +104 -5
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +263 -31
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +46 -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 +193 -6
- 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.map +1 -1
- 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.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.map +1 -1
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js +3 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts +99 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js +155 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/meta-workflow-evaluation-treatment-compiler.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-standard-action-contracts.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-standard-evaluation-contracts.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-structured-artifact-action-compiler.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- 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 +9 -0
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/bounded-subprocess.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -1
- 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.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/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts +77 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js +164 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts +48 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js +101 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-scope-id.backend.utils.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -1
- package/dist/esm/guidance/services/scoped-state-read-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
- package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts +10 -0
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +49 -1
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +3 -0
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +3 -0
- 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 +50 -3
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-protocol.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -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.map +1 -1
- 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.map +1 -1
- package/dist/esm/mcp/services/resource-server-instances-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/utils/zod-to-mcp-json-schema.backend.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflow-runtime.exports.d.ts.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.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.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 +3 -3
- 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.map +1 -1
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -1
- package/dist/esm/monitoring/logger/utils/log-value-normalization.backend.utils.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +10 -6
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +10 -6
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -1
- 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/otel-preload.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/otel-sdk-global-handle.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
- package/dist/esm/monitoring/observability/services/observability.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -1
- package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -1
- package/dist/esm/notifications/email/models/email-transport.backend.definitions.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -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.map +1 -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.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +47 -6
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.js +86 -36
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -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/email/utils/interpolate-email-label.utils.d.ts.map +1 -1
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts +32 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js +32 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +64 -10
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.js +277 -82
- 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.map +1 -1
- 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.map +1 -1
- 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.map +1 -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.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.repository.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-public-key.custom-impl.backend.service.d.ts.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.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/organizations/batches/organization-member-invitation-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/authority-change-audit.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/invitation-acceptance.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.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.map +1 -1
- package/dist/esm/organizations/services/organization-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-onboarding-operation.backend.utils.d.ts.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-member-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -1
- package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +1 -1
- package/dist/esm/pdf-templates/models/pdf-template-binding.d.ts.map +1 -1
- package/dist/esm/pdf-templates/models/pdf-template-definition.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-generated-file-writer.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-generation-orchestrator.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-renderer.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-template-binding.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -1
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -1
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
- package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
- package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -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.map +1 -1
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue.backend.service.js.map +1 -1
- package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
- package/dist/esm/rag/batches/rag-embedding-drain.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/batches/rag-reconciliation-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/models/rag-chunk-store.backend.types.d.ts.map +1 -1
- package/dist/esm/rag/models/rag-retrieval.backend.types.d.ts.map +1 -1
- package/dist/esm/rag/services/mongodb-rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/postgresql-rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-collection.mongodb-ddl.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-retrieval.mongodb-query.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-retrieval.postgresql-query.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-table.postgresql-ddl.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-ingestion.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-retrieval.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-fusion.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-removal.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-row-shaping.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
- package/dist/esm/rag/utils/rag-ingestion-trigger.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-retrieval-scope.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-source-field-value.backend.utils.d.ts.map +1 -1
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -1
- package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -1
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -1
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -1
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +49 -1
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/backend-resource-registry.exports.d.ts.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 +2 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/models/index.d.ts.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.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.map +1 -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.map +1 -1
- package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -1
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -1
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-population.backend.service.d.ts +17 -2
- package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-population.backend.service.js +74 -18
- package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +23 -0
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +31 -0
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-retention.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
- package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/models/request-context.als.backend.d.ts.map +1 -1
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.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.map +1 -1
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.js +10 -0
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -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 +26 -12
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/utils/oauth-body-cap.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -1
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -1
- package/dist/esm/runtime/utils/application-startup-config-access.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/feature-gated-core-resource-exclusions.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/request-client-ip.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-key-generation.backend.utils.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +22 -0
- 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 +84 -0
- 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.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/authorization-client.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts +37 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js +37 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js.map +1 -0
- package/dist/esm/security/authentications/models/identity-persistence-boundaries.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.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/models/saml-authentication.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/user-authorization-version.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/seeds/enterprise-config-defaults.seeds.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +2 -1
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +9 -2
- 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 +9 -2
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -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.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-password-reset.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +97 -0
- 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 +218 -26
- 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 +14 -0
- 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 +36 -0
- 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/saml-assertion-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -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.map +1 -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.map +1 -1
- 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.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.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +57 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +11 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/email-verification-initiator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/machine-token-issuer.backend.service.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- package/dist/esm/security/authentications/services/oidc-user-claims.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/resolve-active-member-orgs.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.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.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.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.map +1 -1
- package/dist/esm/security/authentications/services/utils/concurrent-session-eviction.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/ensure-user-profile.backend.utils.d.ts.map +1 -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.map +1 -1
- package/dist/esm/security/authentications/services/utils/machine-auth-rate-limit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/pkce.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/application-auth-policy-audit.backend.utils.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authentications/utils/one-off-session-lifetime.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/social-oauth2-purpose.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts +59 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js +111 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js.map +1 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts +57 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js +133 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js.map +1 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts +41 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js +157 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts +84 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.js +99 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.js.map +1 -0
- package/dist/esm/security/authorizations/authorization-denial-audit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/junction-scope-resolution.backend.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/authorizations/organization-unit-narrowing-enforcement.backend.d.ts.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 +20 -181
- 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.map +1 -1
- package/dist/esm/security/authorizations/relationship-foreign-key-filter.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +40 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js +43 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +27 -17
- 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 +27 -17
- 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 +72 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +153 -10
- 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.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -1
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +139 -1
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +474 -33
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +40 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -1
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +19 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +38 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +17 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +14 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +16 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +1 -1
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +19 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +45 -2
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +37 -1
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -1
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts +34 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js +39 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -1
- 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.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts +13 -0
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js +14 -0
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js.map +1 -1
- package/dist/esm/security/jwt/utils/jwt-verification-error-classification.backend.utils.d.ts.map +1 -1
- 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.map +1 -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.map +1 -1
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts +39 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js +60 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js.map +1 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts +66 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js +75 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js.map +1 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
- package/dist/esm/security/scim/utils/scim-attribute-path-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -1
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -1
- package/dist/esm/security/session-invalidation-fence.backend.utils.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -1
- package/dist/esm/security/token-invalidation-fence.backend.utils.d.ts.map +1 -1
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/users/services/inbound-contact-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts +0 -45
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts.map +0 -1
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.js +0 -22
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.backend.service.js","sourceRoot":"","sources":["../../../../../src/flows-actors/services/agents.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,uCAAuC,EAAqC,MAAM,4FAA4F,CAAC;AACxL,OAA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C,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAEnE,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC;YAC7C,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,GAAG,CAAC;IACpH,CAAC;;AA5tHU,oBAAoB;IADhC,UAAU,EAAE;IASR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IACrD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAA;IAC3D,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;qCAPH,aAAa;QACM,0BAA0B;QACZ,0BAA0B;QACd,uCAAuC;QACpC,qCAAqC;QAC9D,4BAA4B;GAbtG,oBAAoB,CA6tHhC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject, optional } from 'inversify';\nimport { createHmac } from 'crypto';\nimport { z } from 'zod';\nimport { ApplicationBackendBootstrapEnvKeys } from '@wildo-ai/platform-config-lib';\nimport { ExecutionContext_ExecutionType } from '@wildo-ai/saas-models';\nimport Bottleneck from 'bottleneck';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { FlowsActorsRegistryService } from './flows-actors-registry.service';\nimport { ExternalProvidersRegistryBackendService, RuntimeAgentClientProtocolProfile } from '~wildo-backend-lib/external-providers/services/external-providers-registry.backend.service';\nimport { BackendProviderRegistryBackendService } from '~wildo-backend-lib/external-providers/services/backend-provider-registry.backend.service';\nimport { PromptCompilerBackendService } from './prompt-compiler.backend.service';\nimport {\n FlowsActors_Agent,\n FlowsActors_Agent_Status,\n FlowsActors_Agent_Invocation,\n type FlowsActors_Agent_LLMConfiguration,\n type FlowsActors_Agent_ImageConfiguration,\n isImageAgentConfiguration,\n isCodingAgentConfiguration,\n PromptIR_ContextItem,\n PromptIR_TrustLevel,\n PromptIR_ContextSourceKind,\n ErrorType,\n ErrorCustomMessageReference,\n isWildoBackendError,\n AgentCallOutcome,\n AgentTraceabilityLevel,\n type AgentCallTrace,\n type AgentCallTraceError,\n type AgentTraceabilityPolicy,\n type AgentTraceContext,\n type AgentCallTraceSink,\n StructuredGenerationExecutionMode,\n} from '@wildo-ai/saas-models';\nimport { MetaWorkflowStructuredGenerationPlanKind } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n APPLICATION_ENVIRONMENT,\n LLMProvider_ExecutionArtifactMetadata,\n LLMProvider_ExecutionTransportMetadata,\n LLMProvider_ExecutionTransportKind,\n LLMProvider_ExecutionTransportMetadataSchema,\n LLMProvider_UsageSchema,\n LLMProvider_StructuredGenerationFailureKind,\n LLMProvider_StructuredGenerationFailureSchema,\n type LLMProvider_StructuredGenerationFailure,\n ExternalProvider_ExchangeProtocol_Kind,\n ExternalProvider_RateLimitConfigurationSchema,\n LLMProvider_Configuration,\n LLMProvider_OperationKey,\n LLMProvider_MessageRole,\n type LLMProvider_ImageContent,\n type ImageProvider_OperationKey,\n type CodingAgent_OperationKey,\n AgentClientProtocol_AuthMode,\n AgentClientProtocol_PermissionCeiling,\n AgentClientProtocol_WorkingDirectoryPolicy,\n agentClientProtocolPermissionCeilingRank,\n AgentClientProtocol_PermissionEscalationBehaviour,\n agentClientProtocolInFlightGuardsCanFire,\n type AgentClientProtocol_ExecutionProfile,\n type CodingAgent_RunTaskOutput,\n AgentClientProtocol_HostConfigurationInheritance,\n CodingAgent_UsageSchema,\n AgentClientProtocol_ExecutionTransportMetadataSchema,\n type AgentClientProtocol_ExecutionTransportMetadata,\n type ImageProvider_GenerateImageOutput,\n CodingAgent_EndOfTurnClassification,\n CodingAgent_StopReason,\n type CodingAgent_ContinuationRecord,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n ProviderProtocolRuntimeKind,\n} from '@wildo-ai/external-connectors-models';\nimport { generateText, streamText, generateObject, generateImage, NoObjectGeneratedError, tool, stepCountIs } from 'ai';\nimport {\n startACPAgentSession,\n type ACPAgentSession,\n} from '~wildo-backend-lib/flows-actors/utils/acp-session-runner.backend.utils';\nimport { executeBoundedSubprocess, resolveTrustedWorkingDirectory } from '~wildo-backend-lib/flows-actors/utils/bounded-subprocess.backend.utils';\nimport type { FunctionTool, FunctionToolExecutionContext } from '~wildo-backend-lib/flows-actors/models/function-tools.backend.definitions';\nimport { userInputToContextItem } from '~wildo-backend-lib/flows-actors/utils/prompt-ir-adapters.backend.utils';\nimport {\n DEFAULT_MAX_STRUCTURED_DATA_FIELD_ALLOWED,\n planStructuredGenerationShape,\n} from '~wildo-backend-lib/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils';\n\n\n\ninterface executeOperationParams {\n providerClient: any;\n providerRef: string;\n config: FlowsActors_Agent['config'];\n operationKey: LLMProvider_OperationKey;\n systemPrompt: string;\n instructions: string;\n input: any;\n llmProviderConfig?: LLMProvider_Configuration;\n}\n\ninterface CompiledExecutionPrompts {\n systemPrompt: string;\n instructions: string;\n}\n\n/**\n * What a single operation helper (`executeGenerateText`, `executeGenerateStructured`, …)\n * hands back to {@link AgentsBackendService.executeOperation}.\n *\n * Named rather than written inline at each helper because it grew a THIRD member:\n * a structured generation can legitimately complete with no object, and the reason it\n * did has to survive the four hops between the helper that learns it and the caller\n * that reports it. An inline `{ output; usage? }` at every signature silently drops any\n * fourth field at the first hop that re-declares the shape — which is exactly how the\n * approval suspension was lost once already (see the warning in\n * {@link AgentsBackendService.finalizeInvocationSuccess}).\n */\ninterface AgentOperationExecutionResult {\n output: unknown;\n usage?: any;\n /**\n * Present ONLY when a structured generation returned `{ object: undefined }`. Every\n * other outcome — success, or a provider fault that throws — leaves it absent.\n */\n structuredGenerationFailure?: LLMProvider_StructuredGenerationFailure;\n}\n\ninterface AgentExecutionResult extends AgentOperationExecutionResult {\n output: unknown;\n usage?: unknown;\n /**\n * How the call was physically executed.\n *\n * A UNION, because a coding run is not an LLM call with a different wire\n * format and its metadata is owned by the coding-agent family. Before this was\n * widened, the ACP executor returned through a double cast and finalization\n * parsed the result with the LLM schemas — which would have thrown on the\n * first real dispatch, in a path no test and no live probe had exercised.\n */\n transport?: LLMProvider_ExecutionTransportMetadata | AgentClientProtocol_ExecutionTransportMetadata;\n /**\n * Present when the turn SUSPENDED at a human-in-the-loop approval boundary rather than\n * completing. A caller that ignores it treats a paused turn as a finished one — which would\n * record a terminal status for work that has not happened.\n */\n approvalSuspension?: AgentApprovalSuspension;\n}\n\n/**\n * Backend-only authority supplied by the installed host for an Agent call.\n *\n * A spawned agent operates in a real filesystem workspace, but that workspace is\n * neither provider configuration nor task data: profiles are portable and task\n * callers must never choose process working directories. The host that owns\n * the installed application resolves the physical root and passes it here only\n * for the invocation that needs it. API-backed Agents intentionally require no\n * host context.\n */\nexport interface AgentInvocationHostContext {\n workspaceRootPath?: string;\n /**\n * Narrows what a CODING agent may touch, beyond the profile's permission\n * ceiling. Supplied by the host that owns the task's mutation scope; returning\n * false denies, whatever the ceiling permits. Host authority, not authored\n * configuration — a portable profile cannot know a task's scope.\n */\n isPermittedCodingLocation?: (absolutePath: string) => boolean;\n /**\n * Live progress from a coding session. Best-effort by contract: the runner\n * swallows anything this throws, because a progress sink must never be able\n * to fail the run it observes.\n */\n onCodingSessionEvent?: (event: { readonly kind: string; readonly payload: unknown }) => void;\n /** Operator-initiated cancellation of a coding session. Cooperative first, kill second. */\n codingSessionAbortSignal?: AbortSignal;\n /**\n * Judge what a coding agent's END-OF-TURN message actually meant, so the turn\n * ladder can auto-continue a self-imposed pause and park a genuine question.\n *\n * The JUDGMENT is host authority, not engine mechanism: it is an auxiliary LLM\n * call, and the host (the companion) owns model resolution and the deliberation\n * infrastructure. The engine owns the LADDER — when to call this, how many\n * continuations to allow, how to record the result — and it FAILS OPEN: if this\n * is absent, throws, or times out, the turn is treated as complete. An\n * autonomous coding lane must never hang, or discard a mutated workspace, on an\n * auxiliary call. Absence therefore reproduces the pre-ladder single-turn\n * behaviour exactly, which is why every non-coding caller can ignore it.\n */\n classifyCodingTurnEnd?: (input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }) => Promise<CodingAgent_EndOfTurnClassification>;\n /**\n * Live phase transitions for a coding session — distinct from\n * {@link onCodingSessionEvent}, which relays the agent's own frames. This fires\n * when the LADDER changes state: a new turn starting, or the session parking on\n * a question. Best-effort, like the event sink: never allowed to fail the run.\n */\n onCodingSessionStateChange?: (state: CodingSessionLadderState) => void;\n}\n\n/** The ladder phases a live coding session transitions through. */\nexport enum CodingSessionLadderPhase {\n /** A turn is executing. */\n RUNNING = 'running',\n /** The session parked on a question and is waiting for an operator answer. */\n AWAITING_INPUT = 'awaiting_input',\n}\n\n/** A phase transition in the turn ladder, surfaced to the host for live relay. */\nexport interface CodingSessionLadderState {\n readonly phase: CodingSessionLadderPhase;\n /** 1-based index of the turn this state refers to. */\n readonly turnIndex: number;\n /** The agent's question, present only when `phase` is `AWAITING_INPUT`. */\n readonly question?: string;\n}\n\n/** True when an execution result carries a CODING transport rather than an LLM one. */\nfunction isAgentClientProtocolTransport(\n transport: LLMProvider_ExecutionTransportMetadata | AgentClientProtocol_ExecutionTransportMetadata | undefined,\n): transport is AgentClientProtocol_ExecutionTransportMetadata {\n return transport?.protocolKind === ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL;\n}\n\ntype ResolvedAgentExecution =\n | {\n transport: 'api';\n providerRef: string;\n operationKey: LLMProvider_OperationKey;\n llmProviderConfig?: LLMProvider_Configuration;\n }\n | {\n transport: 'acp';\n providerRef: string;\n operationKey: CodingAgent_OperationKey;\n executionProfileRef: string;\n acpProfile: RuntimeAgentClientProtocolProfile;\n acpExecutionProfile: AgentClientProtocol_ExecutionProfile;\n };\n\n/**\n * The provider's declaration of whether its agent escalates before mutating.\n *\n * Structurally identical to the `permissionEscalation` member of the ACP runtime\n * contract, and declared locally rather than imported because that contract type\n * lives in the provider-module package, which this engine package does not\n * depend on. The narrowing below is by the enum member, so a contract that grew\n * a fourth behaviour would fail this file's exhaustiveness rather than fall into\n * a silent default.\n */\ntype AgentClientProtocolPermissionEscalationDeclaration =\n | { behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.RAISES_BEFORE_MUTATION }\n | {\n behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION;\n configurationEnvironmentVariableName: string;\n }\n | { behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.NEVER_RAISES };\n\nconst SUBPROCESS_BASE_INHERITED_ENV_KEYS = [\n 'PATH',\n 'HOME',\n 'USER',\n 'LOGNAME',\n 'SHELL',\n 'TMPDIR',\n 'TMP',\n 'TEMP',\n 'LANG',\n 'LC_ALL',\n 'LC_CTYPE',\n 'TERM',\n 'COLORTERM',\n 'NO_COLOR',\n 'FORCE_COLOR',\n 'CI',\n 'XDG_CONFIG_HOME',\n 'XDG_CACHE_HOME',\n 'XDG_STATE_HOME',\n 'XDG_RUNTIME_DIR',\n 'SSL_CERT_FILE',\n 'SSL_CERT_DIR',\n 'HTTP_PROXY',\n 'HTTPS_PROXY',\n 'NO_PROXY',\n] as const;\n\n/**\n * Thrown by {@link AgentsBackendService.invokeAgentStreaming} when honest token\n * streaming is not available for the requested agent:\n * - `'transport'` — the agent uses the CLI transport (v1 streams over the API\n * transport only; the session-oriented CLI runtime is a future workstream);\n * - `'operation'` — the operation is non-text (structured / multimodal / image),\n * which has no token-delta stream.\n * Callers may catch this to fall back to the buffered {@link AgentsBackendService.invokeAgent}.\n */\nexport class AgentStreamingUnsupportedError extends Error {\n constructor(public readonly reason: 'transport' | 'operation', message: string) {\n super(message);\n this.name = 'AgentStreamingUnsupportedError';\n }\n}\n\n/** Max agent↔tool round-trips per streaming turn (bounds tool-call loops). */\nconst MAX_TOOL_STEPS = 6;\n\n/**\n * Strip assistant `reasoning` content parts that carry NO text, for the multi-step\n * tool-loop continuation.\n *\n * WHY: extended-thinking models (e.g. Sonnet-5) emit an assistant `reasoning` part whose `text` is\n * EMPTY — the thinking itself lives in the provider-encrypted `providerOptions.anthropic.signature`.\n * When the AI-SDK v7 tool loop re-feeds that assistant message to the model for the NEXT step, the\n * provider prompt validation rejects the empty-text part\n * (`AI_TypeValidationError: … expected 'reasoning' | 'reasoning-file' | 'tool-call'`) — so the second\n * step never runs: a read→create chain dies after the first tool and the reply comes back empty.\n *\n * WHAT: drop ONLY the text-less reasoning parts. Reasoning parts that DO carry text round-trip fine\n * and are preserved, as are text / tool-call / tool-result parts — so nothing user-visible and no\n * tool causality is lost. An assistant message left with no parts at all is dropped entirely (an\n * empty content array is itself invalid).\n *\n * Pure + total: returns a NEW array only when something changed, never mutates the caller's\n * messages, and passes through any non-array content untouched.\n */\nexport function stripEmptyReasoningParts(messages: readonly any[] | undefined): any[] {\n if (!Array.isArray(messages)) return [];\n const isTextlessReasoning = (part: any): boolean =>\n !!part && typeof part === 'object' && part.type === 'reasoning'\n && (typeof part.text !== 'string' || part.text.length === 0);\n\n const result: any[] = [];\n for (const message of messages) {\n if (!message || message.role !== 'assistant' || !Array.isArray(message.content)) {\n result.push(message);\n continue;\n }\n if (!message.content.some(isTextlessReasoning)) {\n result.push(message);\n continue;\n }\n const content = message.content.filter((part: any) => !isTextlessReasoning(part));\n // An assistant message whose parts were ALL text-less reasoning has nothing left to send.\n if (content.length === 0) continue;\n result.push({ ...message, content });\n }\n return result;\n}\n\n/** A tool-call lifecycle event surfaced to the streaming caller for progress UI. */\nexport interface FunctionToolStreamEvent {\n phase: 'call' | 'result' | 'error';\n toolName: string;\n input?: unknown;\n}\n\n/** Callbacks a streaming invocation forwards to the caller. */\nexport interface AgentStreamHandlers {\n onDelta: (delta: string) => void;\n onToolEvent?: (event: FunctionToolStreamEvent) => void;\n /**\n * Cooperative cancellation for the model call.\n *\n * Carried HERE rather than as a new parameter because `handlers` is already threaded\n * unchanged through every hop of the streaming path\n * (`invokeAgentStreaming` → `executeAgentViaApiStreaming` → `streamOperation` →\n * `streamTextToDeltas` → `streamText`). Adding a positional argument at four levels\n * is exactly the arity hazard that has already produced one silent `undefined` in this\n * codebase; riding the object that is passed anyway changes no call signature.\n *\n * Semantically it belongs: this interface is the stream's control surface, and\n * \"stop streaming\" is part of controlling a stream.\n *\n * When absent the model call is simply uncancellable — the previous behaviour.\n */\n abortSignal?: AbortSignal;\n}\n\ninterface streamOperationParams {\n providerClient: any;\n config: FlowsActors_Agent['config'];\n operationKey: LLMProvider_OperationKey;\n systemPrompt: string;\n instructions: string;\n input: any;\n handlers: AgentStreamHandlers;\n tools?: Record<string, any>;\n /**\n * Call-level tool-approval configuration (human-in-the-loop), keyed by identifier-safe tool name.\n *\n * Rides the params OBJECT rather than a positional argument, for the reason already recorded on\n * `abortSignal` above: this value crosses four levels, and adding a positional parameter at four\n * levels is the arity hazard that has already produced one silent `undefined` here.\n */\n toolApproval?: Record<string, ToolApprovalDecision>;\n /**\n * Secret used to HMAC-sign approval requests and verify them on replay.\n *\n * REQUIRED whenever `toolApproval` is present — without it a client can forge an approval for\n * exactly the tools someone marked dangerous enough to gate. The caller fails closed rather than\n * passing `toolApproval` with no secret.\n */\n toolApprovalSecret?: string;\n}\n\n/**\n * A turn that SUSPENDED at a human-in-the-loop approval boundary instead of completing.\n *\n * Not an error and not a terminal failure: the tool loop stopped, the model is waiting, and the run\n * state below is everything needed to resume once a human decides. `sdkModelMessages` is the SDK's\n * own resume payload — opaque to us by design.\n */\nexport interface AgentApprovalSuspension {\n approvalId: string;\n toolCallId: string;\n toolName: string;\n toolArgs?: Record<string, unknown>;\n sdkModelMessages: Record<string, unknown>[];\n}\n\n/**\n * Domain-separation label for the tool-approval signing key.\n *\n * The key is derived from the application's primary secret; this label is what makes the derived\n * key specific to approval signing, so it can never be confused with — or substituted for — any\n * other key derived from the same secret. Versioned (`:v1`) so a future change to the derivation\n * is a NEW key rather than a silent reinterpretation of the existing one.\n *\n * semantic-literal-boundary: this string is cryptographic key material, not a semantic vocabulary\n * member. Changing it invalidates every approval signed under the old label — that is the point of\n * versioning it, and the reason it must never be \"tidied\".\n */\nconst TOOL_APPROVAL_SIGNING_KEY_LABEL = 'wildo:tool-approval-signing:v1';\n\n/**\n * The per-tool approval decision handed to the model SDK.\n *\n * semantic-literal-boundary: `'user-approval'` and `'denied'` are the model SDK's own\n * `ToolApprovalStatus` vocabulary, not Wildo's. This type is the thin adapter where they are\n * produced; they must not spread past {@link AgentsBackendService.buildToolApprovalConfiguration}.\n */\ntype ToolApprovalDecision = 'user-approval' | { type: 'denied'; reason: string };\n\n/**\n * The principals that can actually ANSWER an approval request.\n *\n * Deliberately an ALLOW-LIST of one, not a deny-list of machines. The decision that motivated this\n * (D-HITL-3) was written as \"machine turns auto-deny\", but the execution vocabulary has eight\n * members and only one of them denotes a present, accountable human with a session to answer on:\n *\n * - `ORGANIZATION_MACHINE` / `APPLICATION_MACHINE` — no human on the socket at all.\n * - `INTERNALLY_INITIATED_REQUEST`, `WEBHOOK_CALLBACK` — system-initiated; nobody is watching.\n * - `PUBLIC_EXECUTION`, `ANONYMOUS_SESSION` — a human may be present but carries no accountable\n * identity, and an approval whose approver cannot be named is not an audit record.\n * - `CONSUMABLE_TOKEN` — a one-off credential; whether it sustains the response channel is not\n * established, so it stays out until something proves it does.\n *\n * Written as an allow-list because the failure modes are not symmetric. A deny-list means the NEXT\n * execution type added to the enum silently inherits \"suspend\", and a principal that cannot answer\n * suspending is not a refusal — it is a turn that hangs in `AWAITING_APPROVAL` forever, holding no\n * lease and exempt from the abandoned-task sweep by design. An allow-list makes the same omission\n * fail closed and visible instead.\n */\nconst PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL: ReadonlySet<ExecutionContext_ExecutionType> = new Set([\n ExecutionContext_ExecutionType.USER_REQUEST,\n]);\n\n/**\n * Project only structural validation metadata from nested SDK/Zod errors.\n * Provider validation errors retain the rejected value in their message, so\n * logging `cause.message` would copy private model output into ordinary logs.\n */\n/**\n * The TOP-LEVEL key names of a structured generation, for `unrecognized_keys` diagnosis only.\n *\n * Returns names, never values, and never recurses: a nested key could be a map keyed by user content,\n * whereas the root of a schema-driven generation is schema shape. Any parse failure yields nothing rather\n * than leaking a fragment of the raw text through an error message.\n */\nfunction projectStructuredRootKeyNames(text: unknown): readonly string[] | undefined {\n if (typeof text !== 'string' || text.length === 0) return undefined;\n try {\n const parsed: unknown = JSON.parse(text);\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return undefined;\n return Object.keys(parsed).slice(0, 64);\n } catch {\n return undefined;\n }\n}\n\nfunction projectStructuredValidationIssues(\n error: unknown,\n): ReadonlyArray<{ readonly code: string; readonly path: readonly (string | number)[]; readonly keys?: readonly string[] }> {\n let current = error;\n for (let depth = 0; depth < 4 && typeof current === 'object' && current !== null; depth += 1) {\n const record = current as { cause?: unknown; issues?: unknown };\n if (Array.isArray(record.issues)) {\n return record.issues.flatMap((issue) => {\n if (typeof issue !== 'object' || issue === null) return [];\n const candidate = issue as { code?: unknown; path?: unknown };\n if (typeof candidate.code !== 'string' || !Array.isArray(candidate.path)) return [];\n const path = candidate.path.filter((segment): segment is string | number => typeof segment === 'string' || typeof segment === 'number');\n // `unrecognized_keys` additionally carries the offending KEY NAMES, and those are projected. A key\n // a model invented against a strict object is schema shape, not model content -- the boundary this\n // function exists to hold is about VALUES, which are never included. Without the names the issue is\n // undiagnosable: it reports only that some unknown key exists at the root, which cost several live\n // runs on 2026-08-21 before the key could be identified any other way.\n const rawKeys = (issue as { keys?: unknown }).keys;\n const keys = Array.isArray(rawKeys)\n ? rawKeys.filter((key): key is string => typeof key === 'string')\n : undefined;\n return [{ code: candidate.code, path, ...(keys && keys.length > 0 ? { keys } : {}) }];\n });\n }\n current = record.cause;\n }\n return [];\n}\n\n@injectable()\nexport class AgentsBackendService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n // Bottleneck instances per provider for rate limiting LLM calls\n private readonly bottleneckInstances: Map<string, Bottleneck> = new Map();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.FlowsActorsRegistryService) private readonly flowsActorsRegistry: FlowsActorsRegistryService,\n @inject(SAAS_SERVICE_TYPES.ExternalProvidersRegistryService) private readonly externalProvidersRegistry: ExternalProvidersRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.BackendProviderRegistryService) private readonly backendProviderRegistryService: BackendProviderRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.PromptCompilerService) private readonly promptCompiler: PromptCompilerBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentCallTraceSink) @optional() private readonly agentTraceSink?: AgentCallTraceSink,\n @inject(SAAS_SERVICE_TYPES.AgentTraceabilityPolicy) @optional() private readonly agentTracePolicy?: AgentTraceabilityPolicy,\n ) {\n this.logDebug = this.logger.debugByType('AgentsBackend');\n this.logger.setDebugTypeLogging('AgentsBackend', false);\n\n this.logDebug('Agents backend service created');\n }\n\n // ================================\n // Structured Data Chunking Utilities\n // ================================\n\n\n private mergeChunkedObjects<T extends Record<string, unknown>>(chunks: T[]): T {\n if (chunks.length === 0) {\n return {} as T;\n }\n if (chunks.length === 1) {\n return chunks[0];\n }\n\n // Deep merge nested objects instead of shallow merge\n const result = { ...chunks[0] } as any;\n\n for (let i = 1; i < chunks.length; i++) {\n const chunk = chunks[i];\n for (const key in chunk) {\n if (chunk.hasOwnProperty(key)) {\n const chunkValue = chunk[key];\n const resultValue = result[key];\n\n // If both values are plain objects, deep merge them\n if (\n chunkValue !== null &&\n typeof chunkValue === 'object' &&\n !Array.isArray(chunkValue) &&\n resultValue !== null &&\n typeof resultValue === 'object' &&\n !Array.isArray(resultValue) &&\n resultValue.constructor === Object &&\n chunkValue.constructor === Object\n ) {\n result[key] = this.mergeChunkedObjects([resultValue, chunkValue]);\n } else {\n // Otherwise, use the chunk value (last one wins for conflicts)\n result[key] = chunkValue;\n }\n }\n }\n }\n\n return result as T;\n }\n\n // ================================\n // Bottleneck Rate Limiting\n // ================================\n\n\n private getBottleneckForProvider(\n providerRef: string,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind = ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n ): Bottleneck {\n const limiterKey = `${providerRef}:${protocolKind}`;\n if (this.bottleneckInstances.has(limiterKey)) {\n const existingLimiter = this.bottleneckInstances.get(limiterKey)!;\n this.logDebug('Returning existing bottleneck instance for provider', { providerRef, protocolKind });\n return existingLimiter;\n }\n\n this.logDebug('Creating new bottleneck instance for provider', { providerRef, protocolKind });\n const config = this.externalProvidersRegistry.getProviderConfiguration(providerRef, protocolKind);\n\n const rateLimitConfig = config && 'rateLimitConfig' in config && config.rateLimitConfig\n ? ExternalProvider_RateLimitConfigurationSchema.parse(config.rateLimitConfig)\n : ExternalProvider_RateLimitConfigurationSchema.parse({});\n\n // Create bottleneck options\n const bottleneckOptions: Record<string, number | undefined> = {\n maxConcurrent: rateLimitConfig.maxConcurrent ?? 10,\n minTime: rateLimitConfig.minTime,\n reservoir: rateLimitConfig.reservoir,\n reservoirRefreshInterval: rateLimitConfig.reservoirRefreshInterval,\n reservoirRefreshAmount: rateLimitConfig.reservoirRefreshAmount,\n };\n\n // Remove undefined values\n Object.keys(bottleneckOptions).forEach(key => {\n if (bottleneckOptions[key] === undefined) {\n delete bottleneckOptions[key];\n }\n });\n\n // Create and store bottleneck instance\n const limiter = new Bottleneck(bottleneckOptions);\n\n // Add event listeners for rate limiting visibility\n this.setupBottleneckEventListeners(limiter, limiterKey);\n\n this.bottleneckInstances.set(limiterKey, limiter);\n\n this.logDebug('Bottleneck instance created for provider', {\n providerRef,\n protocolKind,\n maxConcurrent: bottleneckOptions.maxConcurrent,\n minTime: bottleneckOptions.minTime,\n reservoir: bottleneckOptions.reservoir\n });\n\n return limiter;\n }\n\n /**\n * Setup event listeners on bottleneck instance to track rate limiting behavior\n */\n private setupBottleneckEventListeners(limiter: Bottleneck, providerRef: string): void {\n // Track when jobs are queued (delayed due to rate limiting)\n limiter.on('queued', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call queued (rate limited - will be delayed)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs start running (immediate or after queuing)\n limiter.on('executing', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call executing (running now)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs complete\n limiter.on('done', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call completed through rate limiter', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs are dropped (queue full or other reasons)\n limiter.on('dropped', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logger.warn('API call dropped by rate limiter (queue full or limit exceeded)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n });\n });\n\n // Track when reservoir is depleted\n limiter.on('depleted', () => {\n this.logDebug('Rate limiter reservoir depleted (waiting for refresh)', {\n providerRef,\n queued: limiter.queued(),\n running: limiter.running(),\n });\n });\n\n // Track errors in the limiter\n limiter.on('error', (error: any) => {\n this.logger.error('Rate limiter error', {\n providerRef,\n ...projectCaughtErrorLogFields(error),\n stack: error instanceof Error ? error.stack : undefined,\n });\n });\n }\n\n // ================================\n // Agent Invocation\n // ================================\n\n /**\n * @wildo_source:part:start saas.backend.flows-actors.invoke-agent facet:layer:backend facet:family:flows-actors\n *\n * Run ONE agent, once, and await its complete answer. This is the seam an\n * application calls to use its `AI_LLM` capability from its own backend code\n * (a service, a custom resource operation, a batch job).\n *\n * Inject it by DI symbol:\n * `@inject(SAAS_SERVICE_TYPES.AgentsBackendService) private readonly agentsService: AgentsBackendService`\n * — import both from `@wildo-ai/saas-backend-lib`.\n *\n * The engine owns everything around the call: it resolves the agent by\n * `request.agentRef` (unknown ref → throws), refuses a non-`ACTIVE` agent,\n * compiles `promptSpec` into a provider-shaped system prompt, resolves the\n * provider client + API key (fail-closed if unconfigured), schedules the call\n * through that provider's rate limiter, normalizes the output to the\n * operation's wrapped shape, and emits the usage/latency trace. You supply an\n * invocation and read `result.output`.\n *\n * **Function tools do NOT run on this path.** An agent's declared\n * `capabilities.tools.functionRefs` are resolved and executed only by the\n * STREAMING/conversational path ({@link invokeAgentStreaming}). A one-shot\n * agent must therefore receive everything it needs in `request.input` — fetch\n * the data yourself first. Declaring tools here is silently inert, not an error.\n *\n * @param request the invocation envelope (`agentRef` + `input` + empty `output` seed).\n * @param traceContext optional correlation for the agent-call trace sink.\n * @param hostContext backend-owned physical execution context, required only\n * once the selected declared transport is CLI.\n * @returns the same envelope with `output` normalized and `executionContext` enriched.\n * @throws a typed backend error — unknown/inactive agent, missing provider key,\n * missing `input.schema` on a structured call, or a provider failure.\n */\n public async invokeAgent(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n traceContext?: AgentTraceContext,\n hostContext?: AgentInvocationHostContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n /** @wildo_source:part:end saas.backend.flows-actors.invoke-agent */\n const startTime = Date.now();\n const callTimestamp = new Date(startTime).toISOString();\n\n this.logDebug('Invoking agent', { agentRef: request.agentRef,hasInput: !!request.input,hasExecutionContext: !!request.executionContext });\n\n const agent = this.flowsActorsRegistry.getAgentOrThrow(request.agentRef);\n\n this.validateAgentStatus(agent);\n\n try {\n const result = await this.executeAgent(agent, request, hostContext);\n this.logDebug('Agent invocation completed', {agentRef: request.agentRef,executionTime: Date.now() - startTime,hasOutput: !!result.output });\n return await this.finalizeInvocationSuccess(request, agent, result, startTime, callTimestamp, traceContext);\n } catch (error) {\n await this.traceInvocationFailure(request, agent, error, startTime, callTimestamp, traceContext);\n throw error;\n }\n }\n\n /**\n * Streaming counterpart of {@link invokeAgent}: runs the agent over the API\n * transport and forwards each token delta through `streamHandlers.onDelta` as\n * it arrives (honest token streaming — no buffer-collapse). The returned\n * invocation carries the fully-assembled, normalized output + enriched\n * `executionContext`, identical in shape to `invokeAgent`, so persistence and\n * tracing are unchanged.\n *\n * Only text-producing operations over the API transport stream. CLI-transport\n * agents and non-text operations (structured / multimodal / image) throw\n * {@link AgentStreamingUnsupportedError}; callers may catch it to fall back to\n * the buffered `invokeAgent`.\n */\n public async invokeAgentStreaming(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n streamHandlers: AgentStreamHandlers,\n toolContext?: FunctionToolExecutionContext,\n traceContext?: AgentTraceContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n const startTime = Date.now();\n const callTimestamp = new Date(startTime).toISOString();\n\n this.logDebug('Invoking agent (streaming)', { agentRef: request.agentRef, hasToolContext: !!toolContext });\n\n const agent = this.flowsActorsRegistry.getAgentOrThrow(request.agentRef);\n this.validateAgentStatus(agent);\n\n try {\n const result = await this.executeAgentStreaming(agent, request, streamHandlers, toolContext);\n this.logDebug('Agent streaming invocation completed', { agentRef: request.agentRef, executionTime: Date.now() - startTime });\n return await this.finalizeInvocationSuccess(request, agent, result, startTime, callTimestamp, traceContext);\n } catch (error) {\n await this.traceInvocationFailure(request, agent, error, startTime, callTimestamp, traceContext);\n throw error;\n }\n }\n\n /**\n * Shared success finalizer for buffered + streaming invocations: enrich the\n * execution context (timing / usage / transport), normalize the output for the\n * agent's operation, and emit the best-effort policy-gated success trace. Every\n * caller of invokeAgent* — companion, backend flows, minions, workers — gets\n * the trace for free; the sink decides where it lands. See\n * `agent-call-trace-sink.backend.ts`.\n */\n private async finalizeInvocationSuccess(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n agent: FlowsActors_Agent,\n result: AgentExecutionResult,\n startTime: number,\n callTimestamp: string,\n traceContext?: AgentTraceContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n const executionTime = Date.now() - startTime;\n const finishedAt = new Date().toISOString();\n const executionContext = {\n ...request.executionContext,\n callDuration: executionTime,\n executionTime,\n finishedAt,\n // Parsed by the envelope actually received. A coding run reports context\n // and cost the LLM usage schema does not model, and an ACP transport\n // record is not a member of the LLM transport union — running either\n // through the LLM schemas throws, and it throws AFTER the workspace has\n // been mutated.\n ...(result.usage\n ? {\n usage: isAgentClientProtocolTransport(result.transport)\n ? CodingAgent_UsageSchema.parse(result.usage)\n : LLMProvider_UsageSchema.parse(result.usage),\n }\n : {}),\n ...(result.transport\n ? {\n transport: isAgentClientProtocolTransport(result.transport)\n ? AgentClientProtocol_ExecutionTransportMetadataSchema.parse(result.transport)\n : LLMProvider_ExecutionTransportMetadataSchema.parse(result.transport),\n }\n : {}),\n // A structured generation that produced no object carries the reason it did not.\n // It rides on `executionContext` beside `usage` because that is the envelope the\n // whole invocation contract already publishes for provider-learned facts — and\n // because the trace sink receives this same object as its `context`, so the reason\n // reaches traceability without a second wiring. Parsed rather than spread so a\n // malformed reason cannot silently enter the published contract.\n ...(result.structuredGenerationFailure\n ? { structuredGenerationFailure: LLMProvider_StructuredGenerationFailureSchema.parse(result.structuredGenerationFailure) }\n : {}),\n };\n const output = this.normalizeOperationOutput(agent.config.operationKey, result.output);\n await this.emitAgentCallTrace(\n {\n agentRef: request.agentRef,\n provider: agent.config.providerRef,\n model: agent.config.model,\n callTimestamp,\n outcome: AgentCallOutcome.SUCCESS,\n input: request.input,\n output,\n context: executionContext,\n },\n traceContext,\n );\n // Carry the approval suspension onto the returned invocation.\n //\n // ⚠️ This method REBUILDS the result rather than spreading it, so anything the execution layer\n // learned that is not `output`/`executionContext` is dropped here by construction. That is what\n // happened to the suspension: it was threaded correctly through the stream reader, the operation\n // and the transport, and then silently lost at this fifth hop — the turn reported COMPLETED with\n // empty text while the tool sat unapproved, which is exactly the outcome the whole feature\n // exists to prevent. The unit pins could not see it because they stub `invokeAgentStreaming` and\n // never reach this method; only the live lane did.\n //\n // Deliberately kept as an explicit field rather than switching to `...result`: this rebuild is\n // intentional (the invocation is the caller's request plus its answer, not the internal\n // execution record), and spreading would leak transport internals onto a public shape.\n return { ...request, output, executionContext, ...(result.approvalSuspension ? { approvalSuspension: result.approvalSuspension } : {}) };\n }\n\n /** Shared failure tracer for buffered + streaming invocations. */\n private async traceInvocationFailure(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n agent: FlowsActors_Agent,\n error: unknown,\n startTime: number,\n callTimestamp: string,\n traceContext?: AgentTraceContext,\n ): Promise<void> {\n await this.emitAgentCallTrace(\n {\n agentRef: request.agentRef,\n provider: agent.config.providerRef,\n model: agent.config.model,\n callTimestamp,\n outcome: AgentCallOutcome.FAILURE,\n input: request.input,\n context: { ...request.executionContext, executionTime: Date.now() - startTime },\n error: this.buildAgentCallTraceError(error),\n },\n traceContext,\n );\n }\n\n /**\n * Emit one agent-call trace to the configured sink — best-effort and gated by\n * the resolved policy level (per-call `levelOverride` wins; default `NONE` →\n * skip, so output is byte-identical when traceability is off). A sink failure\n * is swallowed (debug-logged): tracing must never turn a successful agent call\n * into a failed one.\n */\n private async emitAgentCallTrace(\n trace: AgentCallTrace,\n traceContext?: AgentTraceContext,\n ): Promise<void> {\n const sink = this.agentTraceSink;\n if (!sink) {\n return;\n }\n const level = traceContext?.levelOverride ?? this.agentTracePolicy?.level ?? AgentTraceabilityLevel.NONE;\n if (level === AgentTraceabilityLevel.NONE) {\n return;\n }\n try {\n await sink.recordAgentCall({ trace, level, context: traceContext });\n } catch (err) {\n this.logDebug('Agent-call trace sink failed (non-fatal)', {\n agentRef: trace.agentRef,\n ...projectCaughtErrorLogFields(err),\n });\n }\n }\n\n /** Build the JSON-serializable trace error shape from a thrown value. */\n private buildAgentCallTraceError(error: unknown): AgentCallTraceError {\n if (error instanceof Error) {\n const code = (error as Error & { code?: string }).code;\n return {\n name: error.name,\n message: error.message,\n ...(code ? { code } : {}),\n };\n }\n // A non-Error, non-string throw still carries information — a JSON-RPC error object, a refusal\n // shape. Serialize it (bounded) rather than replacing it with a sentence that says nothing.\n if (typeof error === 'string') return { message: error };\n try {\n const serialized = JSON.stringify(error);\n if (serialized && serialized !== '{}') return { message: `Non-Error thrown: ${serialized.slice(0, 500)}` };\n } catch { /* circular or hostile — fall through to the sentinel */ }\n return { message: 'Unknown agent invocation error' };\n }\n\n /**\n * Normalize executor outputs to the shared transport-neutral LLM contract.\n *\n * The current execution helpers naturally produce provider/raw payloads such as\n * plain strings or plain objects. Downstream consumers, however, already rely on\n * the wrapped shared schemas (`{ text }`, `{ object }`, `{ message }`, etc.).\n * Centralizing the normalization here fixes the runtime boundary once instead of\n * forcing every caller to guess the provider-shaped payload.\n */\n private normalizeOperationOutput(\n operationKey: LLMProvider_OperationKey | ImageProvider_OperationKey | CodingAgent_OperationKey,\n output: unknown,\n ): unknown {\n // Image outputs (`{ images }`) are already shaped by executeImageAgent, and\n // coding outputs (`{ finalMessage, stopReason, … }`) by the ACP executor —\n // both are produced in their published shape rather than as a raw provider\n // payload, so both fall through the `default` arm unchanged. Only the LLM\n // arms need wrapping, because only they receive a bare string or object.\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT:\n if (this.isRecord(output) && typeof output.text === 'string') {\n return output;\n }\n return { text: typeof output === 'string' ? output : JSON.stringify(output ?? '') };\n\n case LLMProvider_OperationKey.CHAT_COMPLETION:\n case LLMProvider_OperationKey.CHAT_MULTIMODAL:\n if (this.isRecord(output) && this.isRecord(output.message)) {\n return output;\n }\n return {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: typeof output === 'string' ? output : JSON.stringify(output ?? ''),\n },\n };\n\n case LLMProvider_OperationKey.GENERATE_STRUCTURED:\n if (this.isRecord(output) && 'object' in output) {\n return output;\n }\n return { object: output };\n\n case LLMProvider_OperationKey.STREAM_TEXT:\n if (this.isRecord(output) && typeof output.textDelta === 'string') {\n return output;\n }\n return { textDelta: typeof output === 'string' ? output : JSON.stringify(output ?? '') };\n\n case LLMProvider_OperationKey.STREAM_STRUCTURED:\n if (this.isRecord(output) && ('object' in output || 'partialObject' in output)) {\n return output;\n }\n return { object: output };\n\n default:\n return output;\n }\n }\n\n private isRecord(value: unknown): value is Record<string, any> {\n return typeof value === 'object' && value !== null;\n }\n\n /**\n * Execute agent with LLM provider using @ai-sdk\n */\n private async executeAgent(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n hostContext?: AgentInvocationHostContext,\n ): Promise<AgentExecutionResult> {\n this.logDebug('Executing agent', {\n agentRef: agent.ref,\n operationKey: agent.config.operationKey,\n providerRef: agent.config.providerRef,\n model: agent.config.model,\n executionProfileRef: agent.config.executionProfileRef,\n });\n\n // Modality dispatch: an image agent routes to the IMAGE_PROVIDER path.\n // AUDIO/VIDEO modalities are reserved — their configs have no arm yet, so\n // they cannot reach here; if one ever does, `executeImageAgent`'s provider\n // resolution fail-closes. The LLM/text + CLI path below is unchanged.\n if (isImageAgentConfiguration(agent.config)) {\n return this.executeImageAgent(agent, request);\n }\n\n // A coding agent routes to the ACP session transport. It produces no\n // artifact modality — its product is a changed workspace — so it is\n // dispatched by its own arm rather than by an artifact-modality branch.\n if (isCodingAgentConfiguration(agent.config)) {\n return this.executeAgentViaACP(agent, request, hostContext);\n }\n\n const execution = this.resolveAgentExecution(agent);\n const prompts = await this.buildExecutionPrompts(agent, request);\n\n if (execution.transport === 'acp') {\n // Unreachable in practice: a coding agent is dispatched by its arm above,\n // before prompts are compiled. Kept so the transport union is handled\n // exhaustively here rather than falling into the API branch, which is\n // what an unhandled member would silently do.\n return this.executeAgentViaACP(agent, request, hostContext);\n }\n\n return this.executeAgentViaApi(agent, request, execution, prompts);\n }\n\n /**\n * Execute an IMAGE-modality agent via an `IMAGE_PROVIDER` transport.\n *\n * Mirrors the LLM API path (provider-enabled check → apiKey → SDK client →\n * rate-limited call) but resolves the `IMAGE_PROVIDER` binding and calls the\n * AI-SDK `experimental_generateImage` against `client.imageModel(model)`.\n * Image-generation parameters come from the image config arm (`size` /\n * `quality` / `background` / `outputFormat` / `n`), NOT LLM sampling.\n *\n * Usage/transport metadata is intentionally not populated in this first\n * slice (the shared `executionContext` schema is LLM-shaped; image-modality\n * usage/transport enrichment is a follow-up). The best-effort agent-call\n * trace still records provider/model/input/output.\n */\n private async executeImageAgent(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n ): Promise<AgentExecutionResult> {\n const config = agent.config as FlowsActors_Agent_ImageConfiguration;\n const providerRef = config.providerRef;\n const protocolKind = ExternalProvider_ExchangeProtocol_Kind.IMAGE_PROVIDER;\n\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, protocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_ENABLED,\n context: { providerRef, protocolKind }, // diagnostic (log-only)\n });\n }\n\n const apiKey = this.externalProvidersRegistry.getProviderApiKey(providerRef, protocolKind);\n if (!apiKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { providerRef, protocolKind, message: 'API key not found for image provider. Configure the provider secret in application configuration.' },\n });\n }\n\n const binding = this.backendProviderRegistryService.getProtocolBinding(providerRef, protocolKind);\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.IMAGE) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { providerRef, message: 'Image runtime contract not available for provider' },\n });\n }\n\n const client: any = await binding.runtimeContract.sdkFactory(apiKey);\n if (typeof client?.imageModel !== 'function') {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_IMAGE_GENERATION_NOT_SUPPORTED,\n context: { providerRef }, // diagnostic (log-only)\n });\n }\n\n const input = request.input as { prompt?: unknown; referenceImages?: unknown } | undefined;\n const prompt = typeof input?.prompt === 'string' ? input.prompt : String(request.input ?? '');\n if (prompt.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_IMAGE_PROMPT_REQUIRED,\n context: { agentRef: agent.ref }, // diagnostic (log-only)\n });\n }\n\n const providerOptions: Record<string, any> = {};\n const openaiOptions: Record<string, any> = {};\n if (config.quality) openaiOptions.quality = config.quality;\n if (config.background) openaiOptions.background = config.background;\n if (config.outputFormat) openaiOptions.output_format = config.outputFormat;\n if (Object.keys(openaiOptions).length > 0) providerOptions.openai = openaiOptions;\n\n // `any` on the args object sidesteps the SDK's strict `${number}x${number}`\n // size template-literal type (our `size` is an enum incl. `auto`); the\n // rest of this service uses the same `any` pragmatism for model/options.\n const genArgs: any = {\n model: client.imageModel(config.model),\n prompt,\n ...(config.n !== undefined ? { n: config.n } : {}),\n ...(config.size !== undefined ? { size: config.size } : {}),\n ...(config.seed !== undefined ? { seed: config.seed } : {}),\n ...(Object.keys(providerOptions).length > 0 ? { providerOptions } : {}),\n };\n\n const limiter = this.getBottleneckForProvider(providerRef, protocolKind);\n const jobId = `${agent.ref}-image-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n const result: any = await limiter.schedule({ id: jobId }, () => generateImage(genArgs));\n\n const rawImages: any[] = Array.isArray(result?.images) && result.images.length > 0\n ? result.images\n : (result?.image ? [result.image] : []);\n const images = rawImages\n .filter((img) => img && typeof img.base64 === 'string')\n .map((img) => ({\n base64: img.base64 as string,\n mediaType: typeof img.mediaType === 'string' ? img.mediaType : 'image/png',\n }));\n\n const output: ImageProvider_GenerateImageOutput = { images };\n return { output };\n }\n\n private resolveAgentExecution(agent: FlowsActors_Agent): ResolvedAgentExecution {\n const providerRef = agent.config.providerRef;\n const operationKey = agent.config.operationKey as LLMProvider_OperationKey;\n const executionProfileRef = agent.config.executionProfileRef;\n\n // The CODING arm resolves first and by its own arm, not by the presence of\n // an `executionProfileRef`. Both transports use that field, so ordering by\n // it would route a coding agent into the CLI branch and fail obscurely.\n if (isCodingAgentConfiguration(agent.config)) {\n const codingConfig = agent.config;\n const acpExecutionProfileRef = codingConfig.executionProfileRef;\n const executionProtocolKind = ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL;\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, executionProtocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n protocolKind: executionProtocolKind,\n executionProfileRef: acpExecutionProfileRef,\n message: 'Agent Client Protocol is not enabled for the selected provider',\n },\n });\n }\n\n const acpProfile = this.externalProvidersRegistry.getAgentClientProtocolProfile(providerRef);\n const acpExecutionProfile = this.externalProvidersRegistry.getAgentClientProtocolExecutionProfile(\n providerRef,\n acpExecutionProfileRef,\n );\n if (!acpProfile || !acpExecutionProfile) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n executionProfileRef: acpExecutionProfileRef,\n message: 'ACP protocol metadata or execution profile not found in provider configuration',\n },\n });\n }\n\n return {\n transport: 'acp',\n providerRef,\n operationKey: codingConfig.operationKey,\n executionProfileRef: acpExecutionProfileRef,\n acpProfile,\n acpExecutionProfile,\n };\n }\n\n const semanticProtocolKind = ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER;\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, semanticProtocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_ENABLED,\n context: {\n providerRef,\n protocolKind: semanticProtocolKind,\n }\n });\n }\n\n const supportedLLMOperations = this.externalProvidersRegistry.getLLMSemanticOperationKeys(providerRef);\n if (supportedLLMOperations.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_FOUND,\n context: {\n providerRef,\n }\n });\n }\n\n if (!supportedLLMOperations.includes(operationKey)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_OPERATION_NOT_SUPPORTED,\n context: {\n providerRef,\n operationKey,\n }\n });\n }\n\n return {\n transport: 'api',\n providerRef,\n operationKey,\n llmProviderConfig: this.externalProvidersRegistry.getProviderConfiguration(\n providerRef,\n semanticProtocolKind,\n ) as LLMProvider_Configuration | undefined,\n };\n }\n\n private async buildExecutionPrompts(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>\n ): Promise<CompiledExecutionPrompts> {\n const rawInstructions = this.extractRawInstructions(request.input);\n\n if (agent.promptSpec) {\n const compiled = await this.buildCompiledPrompts(agent, request, rawInstructions);\n return {\n systemPrompt: compiled.systemPrompt,\n instructions: compiled.userPrompt,\n };\n }\n\n return {\n systemPrompt: this.buildSystemPrompt(agent, request),\n instructions: rawInstructions,\n };\n }\n\n private extractRawInstructions(input: unknown): string {\n if (typeof input === 'object' && input !== null) {\n if ('prompt' in input && typeof input.prompt === 'string') {\n return input.prompt;\n }\n\n if ('messages' in input && Array.isArray(input.messages)) {\n const userMessages = (input.messages as any[]).filter((message: any) => message.role === 'user');\n return userMessages\n .map((message: any) => typeof message.content === 'string' ? message.content : JSON.stringify(message.content))\n .join('\\n');\n }\n\n return JSON.stringify(input);\n }\n\n return String(input);\n }\n\n /**\n * Resolve the AI-SDK provider client for an API-transport LLM call (shared by\n * the buffered and streaming API paths): fetch the provider API key\n * (fail-closed if missing) and build the SDK client (fail-closed if the\n * provider is not available).\n */\n private async resolveApiProviderClient(providerRef: string): Promise<any> {\n const apiKey = this.externalProvidersRegistry.getProviderApiKey(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n );\n if (!apiKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n message: 'API key not found for provider. Please configure the provider secrets in application configuration.'\n }\n });\n }\n\n const aiProvider = await this.getAIProvider(providerRef, apiKey);\n if (!aiProvider) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n providerRef,\n message: 'AI SDK provider not available'\n }\n });\n }\n return aiProvider;\n }\n\n private async executeAgentViaApi(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n execution: Extract<ResolvedAgentExecution, { transport: 'api' }>,\n prompts: CompiledExecutionPrompts\n ): Promise<AgentExecutionResult> {\n const aiProvider = await this.resolveApiProviderClient(execution.providerRef);\n\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n );\n const jobId = `${agent.ref}-api-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling API call through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n operationKey: execution.operationKey,\n model: agent.config.model,\n jobId,\n currentQueueSize: limiter.queued(),\n currentRunning: limiter.running(),\n usesPromptCompiler: !!agent.promptSpec,\n });\n\n const result = await limiter.schedule(\n { id: jobId },\n () => this.executeOperation({\n providerClient: aiProvider,\n providerRef: execution.providerRef,\n config: agent.config,\n operationKey: execution.operationKey,\n systemPrompt: prompts.systemPrompt,\n instructions: prompts.instructions,\n input: request.input,\n llmProviderConfig: execution.llmProviderConfig,\n })\n );\n\n return {\n ...result,\n transport: {\n kind: LLMProvider_ExecutionTransportKind.API,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n providerRef: execution.providerRef,\n model: agent.config.model,\n },\n };\n }\n\n /**\n * Get AI SDK provider client configured with API key.\n *\n * Looks up the provider's `LLM_PROVIDER` runtime contract on the\n * backend provider registry, narrows by `kind: ProviderProtocolRuntimeKind.LLM`, and invokes the\n * `sdkFactory` declared on the contract. Per the framework principle\n * (provider behavior lives on the provider module), there is NO\n * `switch (providerRef)` here: adding a new LLM provider only requires\n * authoring its module with an `sdkFactory`.\n *\n * Returns the provider client (typically `{ languageModel(model): … }`)\n * or `null` when the provider has no LLM_PROVIDER binding (i.e. the\n * caller asked for an LLM client of a non-LLM provider).\n */\n private async getAIProvider(providerRef: string, apiKey: string): Promise<any> {\n try {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.LLM) {\n return null;\n }\n return await binding.runtimeContract.sdkFactory(apiKey);\n } catch (error) {\n this.logger.error('Failed to initialize AI provider', { providerRef, ...projectCaughtErrorLogFields(error) });\n throw error;\n }\n }\n\n /**\n * The autonomy a run actually gets: the LOWER of what the profile permits and\n * what the invocation asked for. An invocation can only narrow.\n */\n private resolveEffectivePermissionCeiling(\n profile: AgentClientProtocol_ExecutionProfile,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n ): AgentClientProtocol_PermissionCeiling {\n const requested = (request.input as { requestedPermissionCeiling?: AgentClientProtocol_PermissionCeiling } | undefined)\n ?.requestedPermissionCeiling;\n if (\n requested === undefined\n || !Object.values(AgentClientProtocol_PermissionCeiling).includes(requested)\n ) {\n return profile.permissionCeiling;\n }\n return agentClientProtocolPermissionCeilingRank(requested)\n < agentClientProtocolPermissionCeilingRank(profile.permissionCeiling)\n ? requested\n : profile.permissionCeiling;\n }\n\n /**\n * The environment gate for the ACP transport — the guard that keeps a\n * workspace-mutating agent out of production. Checked before the limiter and\n * before any spawn.\n */\n private validateAgentClientProtocolPolicy(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): void {\n const applicationEnv = (process.env.APPLICATION_ENV || APPLICATION_ENVIRONMENT.DEVELOPMENT) as APPLICATION_ENVIRONMENT;\n const platformEnvironmentId = process.env.PLATFORM_ENVIRONMENT_ID;\n const { acpExecutionProfile } = execution;\n\n if (!acpExecutionProfile.allowedApplicationEnvironments.includes(applicationEnv)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n applicationEnv,\n allowedApplicationEnvironments: acpExecutionProfile.allowedApplicationEnvironments,\n message: 'ACP execution profile is not allowed in the current application environment',\n },\n });\n }\n\n if (\n acpExecutionProfile.allowedPlatformEnvironmentIds?.length\n && (!platformEnvironmentId || !acpExecutionProfile.allowedPlatformEnvironmentIds.includes(platformEnvironmentId))\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n platformEnvironmentId,\n allowedPlatformEnvironmentIds: acpExecutionProfile.allowedPlatformEnvironmentIds,\n message: 'ACP execution profile is not allowed in the current platform environment',\n },\n });\n }\n }\n\n /**\n * Compose the prompt a subprocess-hosted agent receives on its single input\n * channel: the system prompt, then the instructions.\n */\n private buildSubprocessPromptInput(prompts: CompiledExecutionPrompts): string {\n if (!prompts.systemPrompt.trim()) {\n return prompts.instructions;\n }\n\n return [\n '[SYSTEM]',\n prompts.systemPrompt,\n '',\n '[TASK]',\n prompts.instructions,\n ].join('\\n');\n }\n\n /**\n * The child environment for a spawned agent: a minimal identity allowlist plus\n * exactly what the profile names.\n *\n * Never full `process.env` inheritance — the process that spawns the agent\n * holds platform secrets that must not reach it.\n */\n private buildSubprocessBaseEnvironment(\n inheritedEnvironmentVariables: readonly string[] | undefined,\n ): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = {};\n for (const envKey of new Set<string>([...SUBPROCESS_BASE_INHERITED_ENV_KEYS, ...(inheritedEnvironmentVariables ?? [])])) {\n const envValue = process.env[envKey];\n if (envValue !== undefined) {\n env[envKey] = envValue;\n }\n }\n return env;\n }\n\n private buildAgentClientProtocolEnvironment(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): NodeJS.ProcessEnv {\n // UNION of what the AGENT needs and what the APPLICATION asks for.\n //\n // The two lists answer different questions and only one of them is policy.\n // Which variable an agent reads to locate its own credentials is PROVIDER\n // knowledge — an application cannot be expected to know that Claude Code\n // resolves its login through `CLAUDE_CONFIG_DIR` — so a provider-declared\n // variable must reach every profile, including the ones applications author\n // themselves. Before this, the contract's list was projected ONLY into the\n // synthesized `default` profile, which the dogfood application deliberately\n // never selects; the declaration was therefore inert exactly where it\n // mattered, and the agent failed to authenticate with `OAuth session expired\n // and could not be refreshed` — a message that is false and sends every\n // diagnosis at the credential rather than at the environment.\n const env = this.buildSubprocessBaseEnvironment([\n ...(execution.acpProfile.inheritedEnvironmentVariables ?? []),\n ...(execution.acpExecutionProfile.inheritedEnvironmentVariables ?? []),\n ]);\n\n if (execution.acpExecutionProfile.authMode === AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION) {\n const secretEnvVarName = execution.acpExecutionProfile.secretEnvVarName;\n const secret = this.externalProvidersRegistry.getAgentClientProtocolExecutionProfileSecret(\n execution.providerRef,\n execution.executionProfileRef,\n );\n if (!secretEnvVarName || !secret) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n message: 'ACP execution profile declares secret injection but its secret could not be resolved',\n },\n });\n }\n env[secretEnvVarName] = secret;\n }\n\n return env;\n }\n\n /**\n * Whether the LLM provider's contract requests strict JSON Schema\n * enforcement on AI-SDK structured-output calls. Read from the runtime\n * contract (`structuredOutputs.strictJsonSchema`) — never branched on\n * `providerRef`. Today only OpenAI sets this; if more providers need\n * it, they declare the flag on their own module.\n */\n private llmProviderRequestsStrictJsonSchema(providerRef: string): boolean | null {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.LLM) {\n return null;\n }\n const declared = binding.runtimeContract.structuredOutputs?.strictJsonSchema;\n // `null` means the provider declares no opinion, so no option is sent and the SDK default applies.\n // `false` is an OPINION and must be sent: omitting it lets the SDK default back to strict, which is\n // how a contract that reads `strictJsonSchema: false` still produced strict-mode request rejections.\n return declared === undefined ? null : declared;\n }\n\n /**\n * Execute a CODING agent over an ACP session.\n *\n * Carries the SAME FOUR responsibilities as {@link executeAgentViaCLI}, and\n * they are listed here because the transport swap is exactly where one of\n * them would be quietly dropped:\n *\n * 1. rate limiting through the provider's Bottleneck limiter;\n * 2. the ENVIRONMENT GATE — the guard that keeps a workspace-mutating agent\n * out of production;\n * 3. prompt composition from the agent's compiled prompts and the request;\n * 4. result normalisation into the published coding-agent output contract.\n */\n /**\n * The agent-specific `_meta` for `session/new`, resolved from the AUTHORED\n * host-configuration posture.\n *\n * Fails CLOSED. If the profile asks for an isolation posture this provider\n * declares no translation for, the session is refused rather than opened with\n * whatever the agent defaults to — which, measured against Claude's adapter,\n * means the operator's entire personal configuration. The field used to be\n * authored, defaulted and documented as a safety posture while being read by\n * nothing at all; refusing is what makes it mean something.\n *\n * `HOST_INHERITED` needs no translation: inheriting everything is what an\n * agent does when told nothing.\n */\n private resolveAgentClientProtocolSessionMeta(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): Record<string, unknown> | undefined {\n const posture = execution.acpExecutionProfile.hostConfigurationInheritance;\n const byPosture = execution.acpProfile.sessionMetaExtensionsByHostConfigurationInheritance;\n const translated = byPosture?.[posture];\n\n if (translated) {\n // An application-authored `sessionMetaExtensions` layers ON TOP: the\n // posture decides isolation, the authored value carries anything else the\n // application wants to pass, and neither silently replaces the other.\n return { ...translated, ...(execution.acpExecutionProfile.sessionMetaExtensions ?? {}) };\n }\n\n if (posture !== AgentClientProtocol_HostConfigurationInheritance.HOST_INHERITED) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n hostConfigurationInheritance: posture,\n message:\n 'ACP provider declares no translation for the authored host-configuration posture, '\n + 'so the requested isolation cannot be honoured and the session is refused.',\n },\n });\n }\n\n return execution.acpExecutionProfile.sessionMetaExtensions ?? execution.acpProfile.sessionMetaExtensions;\n }\n\n /**\n * What THIS agent's provider declares about escalating before it mutates.\n *\n * Read from the ACP runtime contract on the provider binding — never branched\n * on `providerRef`, and deliberately not taken from the projected\n * `AgentClientProtocol_Profile`: this is a measured PROVIDER FACT about an\n * agent's behaviour, not application-authored policy, and it must not sit\n * anywhere an application configuration could merge over it.\n *\n * `undefined` means the provider has no ACP binding at all, which the caller\n * has already refused by the time this runs.\n */\n private resolveAgentClientProtocolPermissionEscalation(\n providerRef: string,\n ): AgentClientProtocolPermissionEscalationDeclaration | undefined {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.AGENT_CLIENT_PROTOCOL) {\n return undefined;\n }\n return binding.runtimeContract.permissionEscalation;\n }\n\n /**\n * Can Wildo's in-flight guards fire for the session this run is about to open?\n *\n * Answered from the provider's declaration AND from the environment actually\n * composed for the child, because for a conditionally-escalating agent those\n * are two different facts: the agent escalates only if the pointer to its\n * permission configuration really arrives, and a declaration that it \"must be\n * supplied\" is not evidence that anything supplied it.\n *\n * The environment is inspected rather than trusted for the same reason the\n * runner judges a permission request rather than the agent's session mode:\n * the thing that decides behaviour is what the child receives.\n */\n private resolveAgentClientProtocolInFlightGuardAvailability(\n escalation: AgentClientProtocolPermissionEscalationDeclaration | undefined,\n childEnvironment: NodeJS.ProcessEnv,\n ): { behaviour?: AgentClientProtocol_PermissionEscalationBehaviour; canFire: boolean; missingConfigurationEnvironmentVariable?: string } {\n if (!escalation) {\n // No declaration reachable. Assume the guards CANNOT fire: this field is\n // required on the contract, so its absence means a provider shape this\n // build does not understand, and reporting an unverified \"yes\" is the one\n // answer that could make an operator trust a ceiling that is not there.\n return { canFire: false };\n }\n const supplied =\n escalation.behaviour === AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION\n ? childEnvironment[escalation.configurationEnvironmentVariableName] !== undefined\n : false;\n const canFire = agentClientProtocolInFlightGuardsCanFire(escalation.behaviour, supplied);\n return {\n behaviour: escalation.behaviour,\n canFire,\n ...(!canFire\n && escalation.behaviour === AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION\n ? { missingConfigurationEnvironmentVariable: escalation.configurationEnvironmentVariableName }\n : {}),\n };\n }\n\n private async executeAgentViaACP(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n hostContext?: AgentInvocationHostContext,\n ): Promise<AgentExecutionResult> {\n const execution = this.resolveAgentExecution(agent);\n if (execution.transport !== 'acp') {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n agentRef: agent.ref,\n providerRef: agent.config.providerRef,\n message: 'Coding agent did not resolve to an ACP execution',\n },\n });\n }\n\n const { acpExecutionProfile, acpProfile } = execution;\n\n // (2) Environment gate — BEFORE the limiter, before any spawn.\n this.validateAgentClientProtocolPolicy(execution);\n\n // The requested model must be one the transport declares. Validated here\n // rather than at the session, so a mis-pinned model fails before an agent\n // is started rather than after it has begun editing.\n const requestedModel = agent.config.model;\n if (!acpProfile.supportedModels.includes(requestedModel)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n requestedModel,\n supportedModels: acpProfile.supportedModels,\n message: 'ACP profile does not declare support for the selected semantic model',\n },\n });\n }\n\n // The authored auth posture must be one the AGENT can actually use.\n //\n // `authModes` was consulted only when synthesizing the provider's `default`\n // execution profile, so an application authoring its own — which the dogfood\n // application does deliberately — could declare any mode and nothing\n // checked it. Both directions are silently wrong rather than loud: a profile\n // declaring HOST_MANAGED against a secret-injecting agent starts a run with\n // no credential, and one declaring SECRET_REF_ENV_INJECTION against a\n // host-managed agent injects a secret the agent ignores while the\n // application believes the run is credentialed by configuration.\n //\n // Normalised on both sides at projection time; comparing the contract's\n // hyphenated spelling against the enum's underscored one is a guard that\n // never fires.\n const supportedAuthModes = acpProfile.supportedAuthModes;\n if (supportedAuthModes && !supportedAuthModes.includes(acpExecutionProfile.authMode)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n authoredAuthMode: acpExecutionProfile.authMode,\n supportedAuthModes: [...supportedAuthModes],\n message:\n 'The authored ACP execution profile declares an authentication mode this provider\\'s agent '\n + 'does not support, so the session is refused rather than started with a credential posture '\n + 'the agent will not honour.',\n },\n });\n }\n\n const workingDirectory = resolveTrustedWorkingDirectory({\n workspaceRootPath: hostContext?.workspaceRootPath,\n usesRelativePath:\n acpExecutionProfile.workingDirectoryPolicy === AgentClientProtocol_WorkingDirectoryPolicy.WORKSPACE_RELATIVE_PATH,\n relativePath: acpExecutionProfile.workingDirectoryRelativePath,\n });\n\n // (3) Prompt composition — the same compiled prompts every transport gets.\n const prompts = await this.buildExecutionPrompts(agent, request);\n const prompt = this.buildSubprocessPromptInput(prompts);\n\n // (1) Rate limiting, keyed on the ACP protocol so a coding session and an\n // HTTP completion against the same provider do not share one bucket.\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL,\n );\n const jobId = `${agent.ref}-acp-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling ACP coding session through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: acpExecutionProfile.permissionCeiling,\n workingDirectory,\n jobId,\n });\n\n const sessionMetaExtensions = this.resolveAgentClientProtocolSessionMeta(execution);\n\n const effectivePermissionCeiling = this.resolveEffectivePermissionCeiling(acpExecutionProfile, request);\n const permissionEscalation = this.resolveAgentClientProtocolPermissionEscalation(execution.providerRef);\n\n return limiter.schedule({ id: jobId }, async () => {\n const env = this.buildAgentClientProtocolEnvironment(execution);\n /*\n * Does this run's authored ceiling mean anything for THIS agent?\n *\n * Both of Wildo's in-flight controls — the permission ceiling and the\n * task's mutation scope — are enforced in the client's ANSWER to\n * `session/request_permission`. An agent that does not ask is bound by\n * neither. Measured: Codex never asks before an in-workspace write (its\n * safety model is a sandbox), and OpenCode does not either unless the host\n * points it at a permission configuration file.\n *\n * The agents stay ADMISSIBLE. Refusing a tool because its architecture\n * differs is exactly the hard ceremony the application-creation directive\n * rejects, and the dogfood lane's `UNRESTRICTED` profile — which asks for\n * no gate and gets none — runs unchanged through this branch.\n *\n * What is refused is a CONTRADICTION: a profile that authored a ceiling\n * narrower than UNRESTRICTED, i.e. that asked for some autonomy to be\n * withheld, against an agent from which nothing can be withheld. Running\n * it anyway would not be permissive, it would be false — the ceiling would\n * be a label, the mutation scope would never be consulted, and the only\n * account of what the run touched would be a change set taken afterwards\n * while the configuration said a gate was in place.\n *\n * The same shape as this transport's two existing refusals, and for the\n * same reason: `resolveAgentClientProtocolSessionMeta` refuses an isolation\n * posture the provider cannot express, and `modelDelivery` refuses a model\n * that could not reach the agent. A declared safety field that cannot be\n * honoured must refuse rather than be silently ignored; that is what makes\n * it mean something. The door is one word wide and always open —\n * `permissionCeiling: UNRESTRICTED` states plainly that this run has no\n * in-flight gate, which is the truth either way.\n */\n const guardAvailability = this.resolveAgentClientProtocolInFlightGuardAvailability(permissionEscalation, env);\n if (!guardAvailability.canFire && effectivePermissionCeiling !== AgentClientProtocol_PermissionCeiling.UNRESTRICTED) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: effectivePermissionCeiling,\n permissionEscalation: guardAvailability.behaviour,\n ...(guardAvailability.missingConfigurationEnvironmentVariable\n ? { missingConfigurationEnvironmentVariable: guardAvailability.missingConfigurationEnvironmentVariable }\n : {}),\n message:\n 'This agent does not raise a permission request before mutating, so the authored permission '\n + 'ceiling and the task mutation scope cannot be enforced in flight and the session is refused '\n + 'rather than run under a ceiling that would be a label. '\n + (guardAvailability.missingConfigurationEnvironmentVariable\n ? `Supply ${guardAvailability.missingConfigurationEnvironmentVariable} in the child environment `\n + '(name it in the execution profile\\'s `inheritedEnvironmentVariables`, pointing at a permission '\n + 'configuration OUTSIDE the application workspace), or author `permissionCeiling: UNRESTRICTED`.'\n : 'Author `permissionCeiling: UNRESTRICTED` to state that this run has no in-flight gate, or '\n + 'select an agent whose provider declares that it escalates before mutating.'),\n },\n });\n }\n // Stated at session open, beside the ceiling, so an operator watching a run\n // start learns whether anything stands between the agent and the workspace\n // — rather than learning it afterwards from a warning about a change set.\n this.logDebug('Opening ACP coding session', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: effectivePermissionCeiling,\n permissionEscalation: guardAvailability.behaviour ?? null,\n inFlightPermissionGuardsCanFire: guardAvailability.canFire,\n });\n // DELIVER the model, through the channel THIS agent's provider declares.\n //\n // Until 2026-09-03 `requestedModel` was checked against the transport's\n // declared set and written into the transport metadata — and never reached\n // the spawned agent, so under HOST_MANAGED auth every session ran at the\n // OPERATOR's personal default model (measured: Opus, during a 529-overload\n // storm the agent definitions' declared model would have avoided).\n //\n // The first fix wrote `ANTHROPIC_MODEL` unconditionally from this\n // agent-NEUTRAL service, which is correct for exactly one adapter and a\n // silent no-op for every other: the same false result, one agent later.\n // So the channel is declared by the provider that knows its agent, and a\n // provider that declares none cannot have a model selected at all —\n // refused here rather than started with the choice quietly dropped.\n const modelDelivery = acpProfile.modelDelivery;\n // The model is VALIDATED as a semantic id and DELIVERED in the agent's own\n // spelling. Both halves matter: validation against `supportedModels` is\n // what refuses a mis-pinned model before an agent is spawned, and the\n // translation is what lets a multi-vendor agent — whose ids carry the\n // provider, `anthropic/claude-sonnet-5` — be addressed at all. Absent\n // means the two vocabularies coincide, which is the common case.\n const deliveredModel = acpProfile.modelTransportIds?.[requestedModel] ?? requestedModel;\n let modelSelection: { configId: string; model: string } | undefined;\n if (modelDelivery?.channel === 'environment-variable') {\n env[modelDelivery.environmentVariableName] = deliveredModel;\n } else if (modelDelivery?.channel === 'session-config-option') {\n // Set over ACP after the session opens; the runner fails the session if\n // the agent rejects it, before any prompt reaches the workspace.\n modelSelection = { configId: modelDelivery.configId, model: deliveredModel };\n } else {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n requestedModel,\n message:\n 'ACP provider declares no model-delivery channel, so the selected model cannot reach the '\n + 'agent and the session is refused rather than run at the agent\\'s own default.',\n },\n });\n }\n // A run that ANSWERS a parked session resumes it by id via `session/load`\n // instead of starting a fresh task; the input's prompt is then the answer.\n const continuationOfSessionId = (request.input as { continuationOfSessionId?: string } | undefined)\n ?.continuationOfSessionId;\n\n // (4) Open the live session, then drive it turn-by-turn.\n const agentSession = await startACPAgentSession({\n // The application may override how the agent is started, but normally\n // inherits it: the provider owns the package and its pinned version.\n command: acpExecutionProfile.command ?? acpProfile.agentCommand,\n args: acpExecutionProfile.command ? acpExecutionProfile.args : acpProfile.agentArgs,\n cwd: workingDirectory,\n env,\n supportedProtocolVersions: acpProfile.supportedProtocolVersions,\n // The invocation may request LESS autonomy than the profile allows; it\n // can never request more. Clamped by rank rather than by trusting the\n // request, so an input carrying a higher ceiling is lowered, not obeyed.\n //\n // Resolved ONCE, above, and reused here: the guard-availability refusal\n // just above decides on this exact value, and re-deriving it per use\n // would let the value that was CHECKED and the value the session RUNS\n // under drift apart — the whole class of defect this lane keeps meeting.\n permissionCeiling: effectivePermissionCeiling,\n // Agent-vocabulary mode ids from the provider contract. Absent is fine —\n // the ceiling is enforced by answering permission requests, never by the\n // agent's mode — but a map hardcoded in the runner silently matched\n // nothing for any agent but the one it was written for.\n ...(acpProfile.sessionModeIdsByPermissionCeiling?.[effectivePermissionCeiling]\n ? {\n preferredSessionModeIds:\n acpProfile.sessionModeIdsByPermissionCeiling[effectivePermissionCeiling],\n }\n : {}),\n ...(modelSelection ? { modelSelection } : {}),\n ...(hostContext?.isPermittedCodingLocation\n ? { isPermittedLocation: hostContext.isPermittedCodingLocation }\n : {}),\n ...(sessionMetaExtensions ? { sessionMetaExtensions } : {}),\n ...(acpExecutionProfile.maximumRecordedEventBytes !== undefined\n ? { maxRecordedEventBytes: acpExecutionProfile.maximumRecordedEventBytes }\n : {}),\n ...(hostContext?.onCodingSessionEvent ? { onEvent: hostContext.onCodingSessionEvent } : {}),\n ...(continuationOfSessionId ? { resumeSessionId: continuationOfSessionId } : {}),\n });\n\n try {\n const ladder = await this.driveCodingTurnLadder({\n session: agentSession,\n firstPrompt: prompt,\n maxAutoContinuations: acpExecutionProfile.maxAutoContinuations,\n awaitingInputTtlMs: acpExecutionProfile.awaitingInputTtlMs,\n ...(acpExecutionProfile.turnTimeoutMs !== undefined ? { turnTimeoutMs: acpExecutionProfile.turnTimeoutMs } : {}),\n ...(hostContext?.codingSessionAbortSignal ? { abortSignal: hostContext.codingSessionAbortSignal } : {}),\n ...(hostContext?.classifyCodingTurnEnd ? { classify: hostContext.classifyCodingTurnEnd } : {}),\n ...(hostContext?.onCodingSessionStateChange ? { onStateChange: hostContext.onCodingSessionStateChange } : {}),\n });\n\n // (5) Result normalisation into the published contract.\n const output: CodingAgent_RunTaskOutput = {\n finalMessage: ladder.finalMessage,\n stopReason: ladder.stopReason,\n ...(ladder.rawStopReason ? { rawStopReason: ladder.rawStopReason } : {}),\n // Always emitted, including zero: absence would be indistinguishable\n // from \"no denials\", and under the strictest ceiling that is exactly the\n // distinction an operator needs.\n deniedPermissionCount: ladder.deniedPermissionCount,\n permissionDecisions: ladder.permissionDecisions,\n ...(ladder.reportedFileLocations.length > 0\n ? { reportedFileLocations: ladder.reportedFileLocations }\n : {}),\n // Absent means one turn — the single-turn shape every pre-ladder\n // consumer already assumes.\n ...(ladder.turnCount > 1 ? { turnCount: ladder.turnCount } : {}),\n ...(ladder.continuations.length > 0 ? { continuations: ladder.continuations } : {}),\n // Present ONLY when the run parked on a question — the field that stops\n // a suspended turn being read as a completed result.\n ...(ladder.suspension ? { suspension: ladder.suspension } : {}),\n };\n\n return {\n output,\n transport: {\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL as const,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n model: requestedModel,\n negotiatedProtocolVersion: agentSession.negotiatedProtocolVersion,\n ...(agentSession.agentName ? { agentName: agentSession.agentName } : {}),\n ...(agentSession.agentVersion ? { agentVersion: agentSession.agentVersion } : {}),\n ...(agentSession.sessionModeId ? { sessionModeId: agentSession.sessionModeId } : {}),\n // Recorded on the run because the ceiling alone does not describe it.\n // A change set produced under a ceiling that could be enforced and one\n // produced under a ceiling that was inert look identical afterwards,\n // and this pair is the only thing that tells a later reader whether\n // anything stood between the agent and these files.\n ...(guardAvailability.behaviour ? { permissionEscalation: guardAvailability.behaviour } : {}),\n inFlightPermissionGuardsCanFire: guardAvailability.canFire,\n sessionId: agentSession.sessionId,\n },\n ...(ladder.usage ? { usage: ladder.usage } : {}),\n } satisfies AgentExecutionResult;\n } finally {\n // Closes on completion AND on park: a parked session is answered by a\n // fresh invocation that resumes it via `session/load`, never by holding\n // this child alive across the HTTP call that returned the question.\n agentSession.close();\n }\n });\n }\n\n private extractCLITextOutput(output: unknown): string {\n if (typeof output === 'string') {\n return output;\n }\n\n if (this.isRecord(output)) {\n if (typeof output.result === 'string') {\n return output.result;\n }\n if (typeof output.text === 'string') {\n return output.text;\n }\n if (typeof output.output === 'string') {\n return output.output;\n }\n if (typeof output.content === 'string') {\n return output.content;\n }\n }\n\n return JSON.stringify(output ?? '');\n }\n\n\n /**\n * Build system prompt from agent configuration\n *\n * If agent has promptSpec, uses the PromptCompiler for structured prompt building.\n * Otherwise, falls back to legacy skill-based prompt building.\n */\n private buildSystemPrompt(agent: FlowsActors_Agent, request: FlowsActors_Agent_Invocation<any, any, any>): string {\n const parts: string[] = [];\n\n if (agent.promptSpec.role) {\n parts.push(`Role: ${agent.promptSpec.role}`);\n }\n\n if (agent.promptSpec.persona) {\n parts.push(`Persona: ${agent.promptSpec.persona}`);\n }\n\n if (request.executionContext) {\n parts.push(`Context: ${JSON.stringify(request.executionContext)}`);\n }\n\n return parts.join('\\n\\n');\n }\n\n /**\n * Build prompts using the PromptCompiler when agent has promptSpec\n * Returns compiled system and user prompts\n */\n private async buildCompiledPrompts(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n instructions: string\n ): Promise<{ systemPrompt: string; userPrompt: string }> {\n if (!agent.promptSpec) {\n // Fall back to legacy mode\n return {\n systemPrompt: this.buildSystemPrompt(agent, request),\n userPrompt: instructions,\n };\n }\n\n this.logDebug('Building compiled prompts using PromptCompiler', {\n agentRef: agent.ref,\n hasInstructions: agent.promptSpec.instructions.length > 0,\n hasHints: !!agent.promptSpec.hints?.length,\n hasCuration: !!agent.promptSpec.curation,\n });\n\n // Build context items from execution context\n // Note: User input is NOT added here - it goes in the user prompt section, not context\n const contextItems: PromptIR_ContextItem[] = [];\n\n if (request.executionContext) {\n contextItems.push({\n id: 'exec_context',\n content: JSON.stringify(request.executionContext, null, 2),\n trust: PromptIR_TrustLevel.HIGH,\n sourceKind: PromptIR_ContextSourceKind.RELATIONSHIP,\n timestamp: new Date().toISOString(),\n });\n }\n\n // Compile using the prompt compiler - works directly with agent + invocation\n const compiled = await this.promptCompiler.compile(\n agent,\n request,\n contextItems,\n instructions\n );\n\n this.logDebug('Prompts compiled', {\n agentRef: agent.ref,\n format: compiled.format,\n systemPromptLength: compiled.systemPrompt.length,\n userPromptLength: compiled.userPrompt.length,\n tokenEstimates: compiled.tokenEstimates,\n });\n\n return {\n systemPrompt: compiled.systemPrompt,\n userPrompt: compiled.userPrompt,\n };\n }\n\n /**\n * Execute operation based on operation key\n * Dispatches to specific operation handlers\n */\n private async executeOperation({ providerClient, providerRef, config, operationKey, systemPrompt, instructions, input, llmProviderConfig }: executeOperationParams): Promise<AgentOperationExecutionResult> {\n const model = this.getModelFromProvider(providerClient, config.model);\n // executeOperation is only reached on the LLM/text path (image agents\n // branch to executeImageAgent in executeAgent), so the config is the LLM arm.\n const baseOptions = this.buildBaseOptions(config as FlowsActors_Agent_LLMConfiguration);\n\n try {\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT:\n return await this.executeGenerateText({ model, systemPrompt, instructions, baseOptions });\n\n case LLMProvider_OperationKey.CHAT_COMPLETION:\n return await this.executeChatCompletion({ model, systemPrompt, instructions, input, baseOptions });\n\n case LLMProvider_OperationKey.CHAT_MULTIMODAL:\n return await this.executeChatMultimodal({ model, systemPrompt, instructions, input, baseOptions });\n\n case LLMProvider_OperationKey.GENERATE_STRUCTURED:\n return await this.executeGenerateStructured({\n model,\n systemPrompt,\n instructions,\n input,\n baseOptions,\n llmProviderConfig,\n providerRef,\n structuredGenerationExecutionMode: (config as FlowsActors_Agent_LLMConfiguration).structuredGenerationExecutionMode,\n maximumStructuredOutputLeafFields: (config as FlowsActors_Agent_LLMConfiguration).maximumStructuredOutputLeafFields,\n });\n\n case LLMProvider_OperationKey.STREAM_TEXT:\n return await this.executeStreamText({ model, systemPrompt, instructions, baseOptions });\n\n case LLMProvider_OperationKey.STREAM_STRUCTURED:\n return await this.executeStreamStructured({ model, systemPrompt, instructions, baseOptions });\n\n default:\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_OPERATION_NOT_SUPPORTED,\n context: {\n // diagnostic (log-only)\n operationKey,\n supportedOperations: Object.values(LLMProvider_OperationKey),\n },\n }\n );\n }\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n // Extract detailed provider error information\n const errorDetails = this.extractProviderErrorDetails(error);\n\n // Log detailed error information\n this.logger.error('Operation execution failed - provider error details', {\n operationKey,\n model: config.model,\n providerRef: (providerClient as any)?.providerRef || 'unknown',\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operationKey,\n model: config.model,\n message: `Failed to execute operation ${operationKey}: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Get model instance from provider client\n */\n private getModelFromProvider(providerClient: any, modelName: string): any {\n if (providerClient && typeof providerClient.languageModel === 'function') {\n try {\n return providerClient.languageModel(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via languageModel()', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via languageModel() method`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n if (typeof providerClient === 'function') {\n try {\n return providerClient(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via function call', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via provider function`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n if (providerClient && typeof providerClient.model === 'function') {\n try {\n return providerClient.model(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via model()', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via model() method`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n this.logger.error('Failed to get model from provider client', {\n providerType: typeof providerClient,\n providerKeys: providerClient ? Object.keys(providerClient).slice(0, 10) : [],\n hasLanguageModel: typeof providerClient?.languageModel === 'function',\n hasModel: typeof providerClient?.model === 'function',\n isFunction: typeof providerClient === 'function',\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_MODEL_INITIALIZATION_FAILED,\n context: {\n // diagnostic (log-only)\n modelName,\n providerType: typeof providerClient,\n hasLanguageModel: typeof providerClient?.languageModel === 'function',\n hasModel: typeof providerClient?.model === 'function',\n isFunction: typeof providerClient === 'function',\n },\n }\n );\n }\n\n /**\n * Build base options for LLM operations\n */\n /**\n * Wall-clock deadline for ONE structured-generation provider call.\n *\n * Without it the call is unbounded: measured 2026-08-20, a `top_down.market-analysis` generation was\n * dispatched and had still not returned TWELVE HOURS later. Nothing timed it out, so the Driver never\n * received a result, the Task-terminalization queue behind it never drained, and the next boot's startup\n * drain inherited the stall. An unbounded provider call is therefore not just a slow call -- it is a\n * durable queue that cannot be reconciled.\n *\n * The value is generous because these payloads are large (market analysis emits ~47k characters), and the\n * point is to bound the pathological case, not to police normal latency. On expiry the SDK aborts the\n * HTTP request, so the provider connection is actually released rather than merely abandoned; the model\n * adapter translates the abort into the TIMEOUT failure kind the retry policy already understands.\n */\n private static readonly STRUCTURED_GENERATION_DEADLINE_MS = 900_000;\n\n /**\n * The one prompt sent to auto-continue a coding agent past a self-imposed\n * pause. Named here rather than improvised at the call site so a run's\n * continuations are all identical and auditable, and so the wording — which\n * tells the agent to keep working AND to stop only when genuinely done or\n * genuinely blocked — lives in exactly one place.\n */\n private static readonly CODING_AUTO_CONTINUE_PROMPT =\n 'Continue with the task. Do not stop to ask whether to proceed — keep going until the task is '\n + 'genuinely complete. Only stop if you have finished, or if you need a decision or input that '\n + 'only the operator can provide, in which case state the specific question plainly.';\n\n /** Characters of an end-of-turn message kept on a continuation record for audit. */\n private static readonly CONTINUATION_MESSAGE_TAIL_CHARS = 500;\n\n /**\n * Drive a coding session turn-by-turn: continue a self-imposed pause, park a\n * genuine question, settle on completion — bounded by the profile's\n * continuation budget.\n *\n * The MECHANISM lives here; the JUDGMENT (`classify`) is the host's. The whole\n * loop fails toward settlement: any terminal stop reason, an exhausted budget,\n * or a classifier that is absent or throws all end the run with what the agent\n * has produced rather than hanging. A `NEEDS_INPUT` classification is the only\n * path that returns a `suspension`, and the caller must not read that as a\n * completed result.\n */\n private async driveCodingTurnLadder(params: {\n session: ACPAgentSession;\n firstPrompt: string;\n maxAutoContinuations: number;\n awaitingInputTtlMs: number;\n turnTimeoutMs?: number;\n abortSignal?: AbortSignal;\n classify?: AgentInvocationHostContext['classifyCodingTurnEnd'];\n onStateChange?: AgentInvocationHostContext['onCodingSessionStateChange'];\n }): Promise<{\n finalMessage: string;\n stopReason: CodingAgent_StopReason;\n rawStopReason?: string;\n usage?: CodingAgent_Usage;\n reportedFileLocations: string[];\n deniedPermissionCount: number;\n permissionDecisions: NonNullable<CodingAgent_RunTaskOutput['permissionDecisions']>;\n turnCount: number;\n continuations: CodingAgent_ContinuationRecord[];\n suspension?: CodingAgent_SessionSuspension;\n }> {\n const { session } = params;\n const reportedFileLocations: string[] = [];\n // Copied into the OUTPUT's mutable element shape here: the runner hands out\n // readonly records, and the published contract's field is mutable.\n const permissionDecisions: NonNullable<CodingAgent_RunTaskOutput['permissionDecisions']> = [];\n const continuations: CodingAgent_ContinuationRecord[] = [];\n let usage: CodingAgent_Usage | undefined;\n let deniedPermissionCount = 0;\n let turnIndex = 0;\n let autoContinuesUsed = 0;\n let prompt = params.firstPrompt;\n\n const emitState = (state: CodingSessionLadderState): void => {\n try {\n params.onStateChange?.(state);\n } catch {\n // A live-relay sink must never fail the run it observes.\n }\n };\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n turnIndex += 1;\n emitState({ phase: CodingSessionLadderPhase.RUNNING, turnIndex });\n\n const turn = await session.promptTurn(prompt, {\n ...(params.turnTimeoutMs !== undefined ? { turnTimeoutMs: params.turnTimeoutMs } : {}),\n ...(params.abortSignal ? { abortSignal: params.abortSignal } : {}),\n });\n\n // Aggregate every turn's evidence, whatever the ladder decides next.\n for (const path of turn.reportedFileLocations) {\n if (!reportedFileLocations.includes(path)) reportedFileLocations.push(path);\n }\n for (const decision of turn.permissionDecisions) {\n permissionDecisions.push({\n ...decision,\n locations: [...decision.locations],\n offeredOptionKinds: [...decision.offeredOptionKinds],\n });\n }\n deniedPermissionCount += turn.deniedPermissionCount;\n usage = this.mergeCodingUsage(usage, turn.usage);\n\n const settle = (suspension?: CodingAgent_SessionSuspension) => ({\n finalMessage: turn.finalMessage,\n stopReason: turn.stopReason,\n ...(turn.rawStopReason ? { rawStopReason: turn.rawStopReason } : {}),\n usage,\n reportedFileLocations,\n deniedPermissionCount,\n permissionDecisions,\n turnCount: turnIndex,\n continuations,\n ...(suspension ? { suspension } : {}),\n });\n\n // A non-voluntary stop (cancelled, max_tokens, refusal, or a reason this\n // version does not recognise) is terminal: there is nothing to continue.\n if (turn.stopReason !== CodingAgent_StopReason.END_TURN) {\n return settle();\n }\n\n // END_TURN: decide what it meant. No classifier → treat as complete AND\n // record nothing (the pre-ladder behaviour, preserved for every caller\n // that supplies none — a plain single turn carries no continuations).\n if (!params.classify) {\n return settle();\n }\n const classification = await this.classifyCodingTurnEndSafely(params.classify, turn.finalMessage, turnIndex);\n\n // A boundary is recorded only when the classifier was actually consulted,\n // so `continuations` is the audit trail of judgments, never a per-run\n // artefact that pollutes the single-turn shape.\n continuations.push({\n turnIndex,\n classification,\n agentMessageTail: turn.finalMessage.slice(-AgentsBackendService.CONTINUATION_MESSAGE_TAIL_CHARS),\n });\n\n if (classification === CodingAgent_EndOfTurnClassification.NEEDS_INPUT) {\n const suspension: CodingAgent_SessionSuspension = {\n sessionId: session.sessionId,\n question: turn.finalMessage,\n turnIndex,\n // Answerable across the child's death only if the agent persists sessions.\n resumable: session.capabilities.loadSession,\n parkedUntil: new Date(Date.now() + params.awaitingInputTtlMs).toISOString(),\n };\n emitState({ phase: CodingSessionLadderPhase.AWAITING_INPUT, turnIndex, question: turn.finalMessage });\n return settle(suspension);\n }\n\n const isSelfPause = classification === CodingAgent_EndOfTurnClassification.SELF_PAUSE;\n if (!isSelfPause || autoContinuesUsed >= params.maxAutoContinuations) {\n // TASK_COMPLETE, CLASSIFIER_UNAVAILABLE, or a self-pause past the budget:\n // settle with what the agent last produced.\n return settle();\n }\n\n autoContinuesUsed += 1;\n prompt = AgentsBackendService.CODING_AUTO_CONTINUE_PROMPT;\n }\n }\n\n /**\n * Run the host's end-of-turn classifier, mapping every failure to\n * `CLASSIFIER_UNAVAILABLE` so the ladder can settle rather than hang.\n *\n * The whole point of a separate method: the fail-open contract is one place,\n * and an unexpected classifier value (a host returning a string outside the\n * enum) degrades the same way a throw does.\n */\n private async classifyCodingTurnEndSafely(\n classify: NonNullable<AgentInvocationHostContext['classifyCodingTurnEnd']>,\n finalMessage: string,\n turnIndex: number,\n ): Promise<CodingAgent_EndOfTurnClassification> {\n try {\n const result = await classify({ finalMessage, turnIndex });\n if (Object.values(CodingAgent_EndOfTurnClassification).includes(result)) {\n return result;\n }\n this.logger.warn('Coding turn-end classifier returned an unrecognised value; treating the turn as complete', {\n turnIndex,\n received: String(result),\n });\n return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;\n } catch (error) {\n // Fail OPEN. An auxiliary judgment must never make the autonomous lane hang\n // or discard a mutated workspace; the failure is recorded, not laundered.\n this.logger.warn('Coding turn-end classifier failed; treating the turn as complete', {\n turnIndex,\n // A WildoBackendError does not pass `instanceof Error`, and String() on it is\n // \"[object Object]\" — which is exactly what this warn printed while the classifier was\n // refusing every call over a missing config bound (2026-09-04). Bounded JSON names it.\n error: error instanceof Error\n ? error.message\n : (() => { try { return JSON.stringify(error)?.slice(0, 600) ?? String(error); } catch { return String(error); } })(),\n });\n return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;\n }\n }\n\n /**\n * Combine per-turn usage into a session total: token counts and cost SUM\n * across turns; the context-window pair is a snapshot, so the latest turn's\n * value wins. Absence stays absence — a field nobody reported must not read as\n * zero, per the usage contract.\n */\n private mergeCodingUsage(\n accumulated: CodingAgent_Usage | undefined,\n turn: CodingAgent_Usage | undefined,\n ): CodingAgent_Usage | undefined {\n if (!turn) return accumulated;\n if (!accumulated) return turn;\n const merged: CodingAgent_Usage = { ...accumulated };\n for (const key of ['inputTokens', 'outputTokens', 'cachedReadTokens', 'cachedWriteTokens', 'totalTokens'] as const) {\n const a = accumulated[key];\n const b = turn[key];\n if (a !== undefined || b !== undefined) merged[key] = (a ?? 0) + (b ?? 0);\n }\n // The context window is a level, not a flow: the newest reading is current.\n if (turn.contextUsed !== undefined) merged.contextUsed = turn.contextUsed;\n if (turn.contextWindowSize !== undefined) merged.contextWindowSize = turn.contextWindowSize;\n if (turn.cost || accumulated.cost) {\n merged.cost = {\n amount: (accumulated.cost?.amount ?? 0) + (turn.cost?.amount ?? 0),\n currency: turn.cost?.currency ?? accumulated.cost?.currency ?? 'USD',\n };\n }\n return merged;\n }\n\n private buildBaseOptions(config: FlowsActors_Agent_LLMConfiguration): any {\n const baseOptions: any = {\n temperature: config.temperature,\n topP: config.topP,\n };\n\n // Only set maxOutputTokens if explicitly configured\n if (config.maxTokens !== undefined) {\n baseOptions.maxOutputTokens = config.maxTokens;\n }\n\n if (config.seed !== undefined) {\n baseOptions.seed = config.seed;\n }\n\n // Reasoning-effort control (Phase 3): the config enum values mirror the AI\n // SDK 7 top-level `reasoning` option exactly, so this is a direct pass-through.\n // The SDK maps it to each provider's native reasoning setting; non-reasoning\n // models ignore it. Omitted → provider default (pre-Phase-3 behavior).\n if (config.reasoningEffort !== undefined) {\n baseOptions.reasoning = config.reasoningEffort;\n }\n\n // The agent's system prompt is passed via the top-level `instructions:` option of EVERY\n // generateText/streamText call (see `executeGenerateText` and the chat builders below) — AI-SDK v7\n // (`ai@7.0.29`) rejects a `role:'system'` entry inside `messages`/`prompt`, and `buildChatMessages`\n // keeps the messages array system-free. Do NOT re-introduce a \"system in messages\" opt-in flag here:\n // a prior `baseOptions.allowSystemInMessages = true` was a SILENT NO-OP (that is not the real option\n // name — the v7 flag is the terse `l` param), which is exactly why every chat turn kept failing with\n // `AI_InvalidPromptError` until the system prompt was hoisted to `instructions:`.\n\n return baseOptions;\n }\n\n /**\n * Execute GENERATE_TEXT operation\n */\n private async executeGenerateText({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await generateText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n text: result.text,\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Generate text operation failed - provider response', {\n operation: 'GENERATE_TEXT',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_TEXT',\n message: `Failed to generate text: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute CHAT_COMPLETION operation\n */\n private async executeChatCompletion({ model, systemPrompt, instructions, input, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const messages = this.buildChatMessages(instructions, input);\n\n const result = await generateText({\n model,\n messages,\n // System prompt via the top-level option (AI-SDK v7 forbids it inside `messages`).\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: result.text,\n },\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Chat completion operation failed - provider response', {\n operation: 'CHAT_COMPLETION',\n hasSystemPrompt: !!systemPrompt,\n hasInputMessages: input && typeof input === 'object' && 'messages' in input,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'CHAT_COMPLETION',\n message: `Failed to complete chat: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute CHAT_MULTIMODAL operation\n */\n private async executeChatMultimodal({ model, systemPrompt, instructions, input, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n let messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> = [];\n\n try {\n if (input && typeof input === 'object' && 'messages' in input && Array.isArray(input.messages)) {\n // System prompt travels via the top-level `instructions:` option; drop any\n // `role:'system'` entries (AI-SDK v7 rejects them inside `messages`).\n messages = input.messages.filter((m: any) => m.role !== 'system');\n } else {\n messages.push({ role: 'user', content: instructions });\n }\n\n if (messages.length === 0) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_MESSAGES_REQUIRED,\n context: {\n // diagnostic (log-only)\n operation: 'CHAT_MULTIMODAL',\n },\n }\n );\n }\n\n const result = await generateText({\n model,\n messages: this.normalizeSdkMessages(messages),\n // System prompt via the top-level option (AI-SDK v7 forbids it inside `messages`).\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: result.text,\n },\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Chat multimodal operation failed - provider response', {\n operation: 'CHAT_MULTIMODAL',\n hasSystemPrompt: !!systemPrompt,\n hasInputMessages: input && typeof input === 'object' && 'messages' in input,\n messagesCount: messages.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'CHAT_MULTIMODAL',\n message: `Failed to complete multimodal chat: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Read the OPTIONAL vision image parts off a GENERATE_STRUCTURED invocation\n * input (see `LLMProvider_GenerateStructuredInputSchema.images`). Returns `[]`\n * when none are present so the caller stays on the plain text-prompt path.\n * Defensive at the boundary: only well-formed `{ type: 'image', image }` parts\n * (non-empty string locator) survive; anything else is dropped rather than\n * handed to the SDK as a broken content part.\n */\n private extractStructuredInputImages(input: unknown): LLMProvider_ImageContent[] {\n if (!this.isRecord(input) || !Array.isArray(input.images)) {\n return [];\n }\n return (input.images as unknown[]).filter(\n (part): part is LLMProvider_ImageContent =>\n this.isRecord(part)\n && part.type === 'image'\n && typeof part.image === 'string'\n && part.image.length > 0,\n );\n }\n\n /**\n * Build the AI-SDK content argument for a structured-generation call.\n *\n * With no images this is a plain `{ prompt }` (text-only structured\n * generation — the historical behaviour, byte-identical). With images it\n * becomes a single multimodal user `{ messages: [...] }` whose content is the\n * instruction text followed by each image part, so the AI SDK feeds the pixels\n * to a vision-capable model (e.g. `gpt-4o`) and constrains the answer to the\n * requested schema. `system` is passed separately by the caller and is not\n * duplicated here.\n */\n private buildStructuredContentArgs(\n instructions: string,\n images: LLMProvider_ImageContent[],\n ): { prompt: string } | { messages: Array<{ role: 'user'; content: Array<Record<string, unknown>> }> } {\n if (images.length === 0) {\n return { prompt: instructions };\n }\n return {\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: instructions },\n ...images.map((part) => this.toSdkFilePart(part.image)),\n ],\n },\n ],\n };\n }\n\n /**\n * Translate our internal image locator (`LLMProvider_ImageContent.image` — a\n * data URI or URL) into an AI SDK v7 **file content part**.\n *\n * WHY: the SDK's `{ type: 'image', image }` content part was deprecated in v7\n * (it warns on every call and becomes a hard error in a future major). The v7\n * shape is `{ type: 'file', data, mediaType }`. This is the ONE translation\n * seam — our own `{ type: 'image', image }` domain vocabulary\n * ({@link LLMProvider_ImageContentSchema}) is intentionally kept; only the\n * SDK-facing emission changes.\n *\n * `mediaType` is required by the file part. We derive the concrete type from a\n * data URI when present (the case both internal producers actually emit —\n * they build `data:image/<fmt>;base64,…`); for a bare URL we sniff the\n * extension and fall back to the generic `image/*` the SDK itself suggests.\n */\n private toSdkFilePart(image: string): { type: 'file'; data: string; mediaType: string } {\n return { type: 'file', data: image, mediaType: this.deriveImageMediaType(image) };\n }\n\n /** Best-effort image media-type from a data URI or URL; generic `image/*` if unknown. */\n private deriveImageMediaType(image: string): string {\n const dataUri = /^data:(image\\/[^;]+)[;,]/i.exec(image);\n if (dataUri) return dataUri[1].toLowerCase();\n const ext = /\\.(png|jpe?g|gif|webp|bmp|svg|avif|tiff?)(?:[?#]|$)/i.exec(image);\n if (ext) {\n const e = ext[1].toLowerCase();\n if (e === 'jpg' || e === 'jpeg') return 'image/jpeg';\n if (e === 'svg') return 'image/svg+xml';\n if (e === 'tif' || e === 'tiff') return 'image/tiff';\n return `image/${e}`;\n }\n return 'image/*';\n }\n\n /**\n * Rewrite any legacy `{ type: 'image', image }` parts inside caller-supplied\n * CHAT_MULTIMODAL messages into v7 file parts, leaving every other part\n * untouched. Defensive: the internal producers route images through the\n * structured path above, but CHAT_MULTIMODAL forwards opaque caller `messages`\n * verbatim, so a caller passing the deprecated shape would otherwise leak it\n * to the SDK. Fail-open on unexpected shapes — never drop a caller's content.\n */\n private normalizeSdkMessages(\n messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }>,\n ): Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> {\n return messages.map((message) => {\n if (!Array.isArray(message.content)) return message;\n const content = message.content.map((part) =>\n this.isRecord(part) && part.type === 'image' && typeof part.image === 'string'\n ? this.toSdkFilePart(part.image)\n : part,\n );\n return { ...message, content };\n });\n }\n\n /**\n * Execute GENERATE_STRUCTURED operation\n */\n private async executeGenerateStructured({\n model,\n systemPrompt,\n instructions,\n input,\n baseOptions,\n llmProviderConfig,\n providerRef,\n structuredGenerationExecutionMode,\n maximumStructuredOutputLeafFields,\n }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n llmProviderConfig?: LLMProvider_Configuration;\n providerRef: string;\n structuredGenerationExecutionMode?: StructuredGenerationExecutionMode;\n maximumStructuredOutputLeafFields?: number;\n }): Promise<AgentOperationExecutionResult> {\n try {\n if (!input || typeof input !== 'object' || !('schema' in input) || !input.schema) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_STRUCTURED_SCHEMA_REQUIRED,\n context: {\n // diagnostic (log-only)\n operation: 'GENERATE_STRUCTURED',\n hasInput: !!input,\n inputType: typeof input,\n hasSchema: input && typeof input === 'object' && 'schema' in input,\n },\n }\n );\n }\n\n const schema = input.schema;\n const images = this.extractStructuredInputImages(input);\n if (\n structuredGenerationExecutionMode === StructuredGenerationExecutionMode.SINGLE_CALL_REQUIRED\n && (!Number.isSafeInteger(maximumStructuredOutputLeafFields) || (maximumStructuredOutputLeafFields ?? 0) <= 0)\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'A single-call structured agent requires one positive immutable maximumStructuredOutputLeafFields value.',\n },\n });\n }\n const maxFields = maximumStructuredOutputLeafFields\n ?? llmProviderConfig?.maxStructuredDataFieldAllowed\n ?? DEFAULT_MAX_STRUCTURED_DATA_FIELD_ALLOWED;\n const isOpenAI = this.llmProviderRequestsStrictJsonSchema(providerRef);\n\n const shapePlan = planStructuredGenerationShape(schema, maxFields);\n\n this.logDebug('Checking if schema needs chunking', {\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n needsChunking: shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.CHUNKED,\n unchunkableOverLimit: shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.UNCHUNKABLE_OVER_LIMIT,\n isOpenAI,\n imageCount: images.length,\n });\n\n if (\n structuredGenerationExecutionMode === StructuredGenerationExecutionMode.SINGLE_CALL_REQUIRED\n && shapePlan.planKind !== MetaWorkflowStructuredGenerationPlanKind.SINGLE_CALL\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'The registered agent requires one physical provider call, but the output schema requires chunking.',\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n },\n });\n }\n\n if (shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.UNCHUNKABLE_OVER_LIMIT) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'The output schema exceeds the provider field limit and its root semantics cannot be preserved across chunks.',\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n },\n });\n }\n\n if (shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.CHUNKED) {\n return await this.executeGenerateStructuredChunked({\n model,\n systemPrompt,\n instructions,\n images,\n schema,\n baseOptions,\n maxFields,\n leafFieldCount: shapePlan.leafFieldCount,\n schemaChunks: shapePlan.schemaChunks,\n isOpenAI,\n });\n } else {\n return await this.executeGenerateStructuredSingle({\n model,\n systemPrompt,\n instructions,\n images,\n schema,\n baseOptions,\n isOpenAI,\n });\n }\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Generate structured operation failed - provider response', {\n operation: 'GENERATE_STRUCTURED',\n hasSchema: input && typeof input === 'object' && 'schema' in input,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute structured generation with chunking - runs chunks in parallel\n */\n private async executeGenerateStructuredChunked({ model, systemPrompt, instructions, images, schema, baseOptions, maxFields, leafFieldCount, schemaChunks, isOpenAI }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n images: LLMProvider_ImageContent[];\n schema: z.ZodSchema<any>;\n baseOptions: any;\n maxFields: number;\n leafFieldCount: number;\n schemaChunks: readonly z.ZodSchema[];\n isOpenAI: boolean | null;\n }): Promise<AgentOperationExecutionResult> {\n try {\n this.logDebug('Chunking structured generation - parallel execution', {\n totalLeafFields: leafFieldCount,\n maxFields,\n chunks: schemaChunks.length,\n isOpenAI,\n });\n\n // Execute all chunks in parallel using Promise.all\n const chunkPromises = schemaChunks.map(async (chunkSchema, index) => {\n try {\n this.logDebug(`Starting structured chunk ${index + 1}/${schemaChunks.length}`);\n\n const chunkResult = await generateObject({\n model,\n mode: \"json\",\n instructions: systemPrompt,\n schema: chunkSchema,\n abortSignal: AbortSignal.timeout(AgentsBackendService.STRUCTURED_GENERATION_DEADLINE_MS),\n ...this.buildStructuredContentArgs(instructions, images),\n ...baseOptions,\n ...(isOpenAI === null ? {} : {\n providerOptions: {\n openai: {\n strictJsonSchema: isOpenAI,\n },\n },\n }),\n });\n\n this.logDebug(`Completed structured chunk ${index + 1}/${schemaChunks.length}`);\n\n return {\n index,\n object: chunkResult.object as Record<string, unknown>,\n usage: this.extractUsage(chunkResult.usage),\n failure: null as unknown,\n };\n } catch (error) {\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error(`Failed to generate structured chunk ${index + 1}/${schemaChunks.length} - provider response`, {\n operation: 'GENERATE_STRUCTURED',\n chunkIndex: index,\n totalChunks: schemaChunks.length,\n ...errorDetails,\n });\n\n // Same rule the single-call path states: a structured-generation failure carrying provider\n // usage IS a completed physical call, so throwing here discards billable truth. This site\n // used to throw, and it cost a live application its budget allocation PERMANENTLY -- the\n // discarded usage made the settlement ACCOUNTING_UNVERIFIABLE, which fail-closes every later\n // admission on that allocation, and a Work Cycle's allocation is bootstrapped once for the\n // application's life. The provider had reported exact usage on the very error we then called\n // unverifiable (6,680 input / 3,521 output tokens, with the cache-write split).\n //\n // Returning rather than throwing also keeps the SIBLING chunks' metering, which `Promise.all`\n // would otherwise drop on the floor along with this one.\n return {\n index,\n object: null,\n usage: this.extractUsage(\n typeof error === 'object' && error !== null && 'usage' in error\n ? (error as { usage: unknown }).usage\n : undefined,\n ),\n failure: error as unknown,\n };\n }\n });\n\n // Wait for all chunks to complete in parallel\n const chunkResultsWithMeta = await Promise.all(chunkPromises);\n\n // Sort by index to ensure consistent merge order, then extract objects\n const chunkResults = chunkResultsWithMeta\n .sort((a, b) => a.index - b.index)\n .flatMap(r => (r.object === null ? [] : [r.object]));\n\n // Aggregate usage from all chunks\n const totalUsage = chunkResultsWithMeta.reduce(\n (acc, r) => ({\n promptTokens: acc.promptTokens + r.usage.promptTokens,\n completionTokens: acc.completionTokens + r.usage.completionTokens,\n totalTokens: acc.totalTokens + r.usage.totalTokens,\n tokenUsageComplete: acc.tokenUsageComplete && r.usage.tokenUsageComplete,\n }),\n { promptTokens: 0, completionTokens: 0, totalTokens: 0, tokenUsageComplete: true }\n );\n const exactInputTokenDetails = chunkResultsWithMeta.every((result) =>\n result.usage.inputTokenDetails?.noCacheTokens !== undefined\n && result.usage.inputTokenDetails.cacheReadTokens !== undefined\n && result.usage.inputTokenDetails.cacheWriteTokens !== undefined,\n )\n ? {\n noCacheTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.noCacheTokens!, 0),\n cacheReadTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.cacheReadTokens!, 0),\n cacheWriteTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.cacheWriteTokens!, 0),\n }\n : undefined;\n\n // Aggregate metering FIRST (above), then decide the outcome: a partially-failed chunked call is\n // still a set of completed, billable physical calls, and the Driver must be able to account for\n // every one of them before it classifies the missing object.\n const failedChunk = chunkResultsWithMeta.find((result) => result.object === null);\n if (failedChunk !== undefined) {\n const failureError = failedChunk.failure as { cause?: unknown; finishReason?: unknown; text?: unknown };\n return {\n output: { object: undefined },\n usage: {\n ...totalUsage,\n ...(exactInputTokenDetails === undefined ? {} : { inputTokenDetails: exactInputTokenDetails }),\n },\n structuredGenerationFailure: this.buildStructuredGenerationFailure(\n typeof failedChunk.failure === 'object' && failedChunk.failure !== null && 'usage' in failedChunk.failure\n ? LLMProvider_StructuredGenerationFailureKind.INVALID_OBJECT_AFTER_COMPLETED_CALL\n : LLMProvider_StructuredGenerationFailureKind.NO_OBJECT_GENERATED,\n failedChunk.failure,\n failureError,\n ),\n };\n }\n\n const mergedResult = this.mergeChunkedObjects(chunkResults);\n\n this.logDebug('All structured chunks completed and merged', {\n chunks: schemaChunks.length,\n totalUsage,\n });\n\n return {\n output: {\n object: mergedResult,\n },\n usage: {\n ...totalUsage,\n ...(exactInputTokenDetails === undefined ? {} : { inputTokenDetails: exactInputTokenDetails }),\n },\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data with chunking: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Assemble the caller-facing reason a structured generation produced no object.\n *\n * Carries NO generated text — only `generatedTextLength`, which separates a truncated\n * completion from an empty one without disclosing content. `validationIssues` is\n * likewise `code` + `path` only, for the same reason (see\n * {@link projectStructuredValidationIssues}).\n *\n * The chunked path calls this too. It used to throw a typed backend error instead, on the\n * reasoning that the reason \"already reaches the caller intact\" -- true of the REASON and false\n * of the USAGE, which is what the budget settles against. See the failure branch in\n * {@link executeGenerateStructuredChunked} for what that cost.\n */\n private buildStructuredGenerationFailure(\n kind: LLMProvider_StructuredGenerationFailureKind,\n error: unknown,\n providerError: { cause?: unknown; finishReason?: unknown; text?: unknown },\n ): LLMProvider_StructuredGenerationFailure {\n const errorName = error instanceof Error\n ? error.name\n : (typeof error === 'object' && error !== null && 'name' in error && typeof error.name === 'string'\n ? error.name\n : typeof error);\n const cause = providerError.cause;\n const validationCauseName = cause instanceof Error\n ? cause.name\n : (typeof cause === 'object' && cause !== null && 'name' in cause && typeof cause.name === 'string'\n ? cause.name\n : typeof cause);\n const validationIssues = projectStructuredValidationIssues(cause);\n // ROOT KEY NAMES, and only when the failure is `unrecognized_keys`.\n //\n // Zod 4 builds that issue at two sites and only one carries `keys` (v4/core/schemas.js:748 vs :1352);\n // the path taken here is the one that omits them, so the issue reports \"some unknown key exists at the\n // root\" and nothing more. That is undiagnosable: a single stray key discards a 40,000-character result\n // and there is no way to learn which key it was.\n //\n // The boundary this function holds is about VALUES: the rejected content must never reach a log. Root\n // KEY NAMES of a schema-driven generation are schema shape, are compared against a schema the reader\n // already has, and are emitted only on this one failure code -- never for `invalid_type`,\n // `invalid_format` or any issue whose path could name user content.\n const rootKeys = validationIssues.some((issue) => issue.code === 'unrecognized_keys')\n ? projectStructuredRootKeyNames(providerError.text)\n : undefined;\n return {\n kind,\n message: describeCaughtError(error),\n errorName,\n validationCauseName,\n ...(validationIssues.length > 0\n ? {\n validationIssues: validationIssues.map((issue) => ({\n code: issue.code,\n path: [...issue.path],\n ...(issue.keys ? { keys: [...issue.keys] } : {}),\n })),\n }\n : {}),\n ...(rootKeys && rootKeys.length > 0 ? { rootKeys: [...rootKeys] } : {}),\n ...(typeof providerError.finishReason === 'string' ? { finishReason: providerError.finishReason } : {}),\n generatedTextLength: typeof providerError.text === 'string' ? providerError.text.length : null,\n };\n }\n\n /**\n * Execute structured generation without chunking\n */\n private async executeGenerateStructuredSingle({ model, systemPrompt, instructions, images, schema, baseOptions, isOpenAI }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n images: LLMProvider_ImageContent[];\n schema: z.ZodSchema<any>;\n baseOptions: any;\n isOpenAI: boolean | null;\n }): Promise<AgentOperationExecutionResult> {\n try {\n this.logDebug('Generating structured normally', {\n hasSchema: !!schema,\n instructionsLength: instructions.length,\n hasSystemPrompt: !!systemPrompt,\n isOpenAI,\n imageCount: images.length,\n });\n\n const result = await generateObject({\n model,\n mode: \"json\",\n instructions: systemPrompt,\n schema,\n abortSignal: AbortSignal.timeout(AgentsBackendService.STRUCTURED_GENERATION_DEADLINE_MS),\n ...this.buildStructuredContentArgs(instructions, images),\n ...baseOptions,\n ...(isOpenAI === null ? {} : {\n providerOptions: {\n openai: {\n strictJsonSchema: isOpenAI,\n },\n },\n }),\n });\n\n return {\n output: {\n object: result.object,\n },\n usage: this.extractUsage(result.usage),\n // The THIRD path that can hand a caller `{ object: undefined }`, and the one the\n // two catch arms below hide: `generateObject` RESOLVING with no object at all.\n // That is off-contract for the AI SDK — `object` is declared non-optional and\n // absence is signalled by throwing — but nothing here validates that, so leaving\n // it unattached would put a hole in the vocabulary's own invariant (every path\n // that returns no object says why), precisely where a caller has the least other\n // evidence: no error was raised, so `finishReason` and a validation cause do not\n // exist either. Attaching it costs one comparison on the success path and keeps\n // \"no `structuredGenerationFailure`\" meaning \"there IS an object\".\n ...(result.object === undefined\n ? {\n structuredGenerationFailure: {\n kind: LLMProvider_StructuredGenerationFailureKind.RESOLVED_WITHOUT_OBJECT,\n message: 'The structured-generation call resolved without raising, but carried no object.',\n generatedTextLength: null,\n } satisfies LLMProvider_StructuredGenerationFailure,\n }\n : {}),\n };\n } catch (error) {\n // Any structured-generation failure that carries provider usage represents a\n // completed physical call. Preserve its metering and let the Driver classify\n // the missing/invalid object; throwing here would discard billable truth.\n if (typeof error === 'object' && error !== null && 'usage' in error) {\n const providerError = error as { cause?: unknown; finishReason?: unknown; text?: unknown; usage: unknown };\n // Do not log the generated text: it can contain application-private\n // context. The error/cause and non-sensitive shape metadata are enough\n // to distinguish truncation, schema validation and provider refusal.\n // Previously this branch retained billing but erased the only reason a\n // real model result became `{ object: undefined }`, making live judge\n // failures impossible to diagnose.\n // The SAME facts go to the log line and to the caller. Logging them only was the\n // second half of the defect this branch already documents: the reason existed, but\n // exclusively inside the process's own log file, so a caller could report nothing\n // more specific than \"no object\" and an operator had to grep the companion log for\n // the line above to learn which schema paths the model had omitted.\n const structuredGenerationFailure = this.buildStructuredGenerationFailure(\n LLMProvider_StructuredGenerationFailureKind.INVALID_OBJECT_AFTER_COMPLETED_CALL,\n error,\n providerError,\n );\n this.logger.error('Structured generation completed without a valid object', {\n operation: 'GENERATE_STRUCTURED',\n errorName: structuredGenerationFailure.errorName,\n errorMessage: structuredGenerationFailure.message,\n validationCauseName: structuredGenerationFailure.validationCauseName,\n validationIssues: structuredGenerationFailure.validationIssues,\n finishReason: structuredGenerationFailure.finishReason,\n generatedTextLength: structuredGenerationFailure.generatedTextLength,\n });\n return {\n output: { object: undefined },\n usage: this.extractUsage(error.usage),\n structuredGenerationFailure,\n };\n }\n // semantic-literal-boundary: AI SDK cross-realm error identity fallback\n const noObjectError = (\n typeof error === 'object'\n && error !== null\n && (\n // The SDK error's stable payload shape is retained even when bundlers or\n // mocked module realms erase its prototype/name marker.\n ('response' in error && 'finishReason' in error && 'text' in error)\n ||\n ('name' in error && error.name === 'AI_NoObjectGeneratedError')\n || (error as Record<PropertyKey, unknown>)[Symbol.for('vercel.ai.error.AI_NoObjectGeneratedError')] === true\n )\n )\n || error instanceof NoObjectGeneratedError\n || NoObjectGeneratedError.isInstance(error);\n if (noObjectError) {\n // No usage-bearing payload was recognised on the branch above, so no shape metadata\n // was recovered. The reason is still attached — a caller must be able to tell this\n // apart from the validated-and-rejected case, and specifically must NOT read the\n // absent `validationIssues` here as evidence that the schema was satisfied.\n return {\n output: { object: undefined },\n usage: this.extractUsage((error as NoObjectGeneratedError).usage),\n structuredGenerationFailure: this.buildStructuredGenerationFailure(\n LLMProvider_StructuredGenerationFailureKind.NO_OBJECT_GENERATED,\n error,\n error as { cause?: unknown; finishReason?: unknown; text?: unknown },\n ),\n };\n }\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Failed to generate structured data - provider response', {\n operation: 'GENERATE_STRUCTURED',\n hasSchema: !!schema,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute STREAM_TEXT operation\n */\n private async executeStreamText({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await streamText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n let fullText = '';\n try {\n for await (const chunk of result.textStream) {\n fullText += chunk;\n }\n } catch (streamError) {\n this.logger.error('Failed to read text stream', {\n ...projectCaughtErrorLogFields(streamError),\n textLength: fullText.length,\n });\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_TEXT',\n message: `Failed to read text stream: ${describeCaughtError(streamError)}`,\n originalError: describeCaughtError(streamError),\n stack: streamError instanceof Error ? streamError.stack : undefined,\n },\n }\n );\n }\n\n const usage = await result.usage;\n\n return {\n output: {\n textDelta: fullText,\n },\n usage: this.extractUsage(usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Stream text operation failed - provider response', {\n operation: 'STREAM_TEXT',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_TEXT',\n message: `Failed to stream text: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute STREAM_STRUCTURED operation\n */\n private async executeStreamStructured({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await streamText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n let fullText = '';\n try {\n for await (const chunk of result.textStream) {\n fullText += chunk;\n }\n } catch (streamError) {\n const errorDetails = this.extractProviderErrorDetails(streamError);\n\n this.logger.error('Failed to read structured stream - provider response', {\n operation: 'STREAM_STRUCTURED',\n textLength: fullText.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_STRUCTURED',\n message: `Failed to read structured stream: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n\n const usage = await result.usage;\n\n let parsedOutput: unknown = fullText;\n try {\n parsedOutput = JSON.parse(fullText);\n } catch (parseError) {\n this.logDebug('Failed to parse structured stream as JSON, returning as text', {\n ...projectCaughtErrorLogFields(parseError),\n textLength: fullText.length,\n });\n }\n\n return {\n output: {\n object: parsedOutput,\n },\n usage: this.extractUsage(usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Stream structured operation failed - provider response', {\n operation: 'STREAM_STRUCTURED',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_STRUCTURED',\n message: `Failed to stream structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n // ==========================================================================\n // Honest token streaming (invokeAgentStreaming path)\n // --------------------------------------------------------------------------\n // NOTE: the `executeStreamText` / `executeStreamStructured` methods ABOVE are\n // the BUFFERED fallback for the `STREAM_*` operation keys when invoked through\n // the callback-less `invokeAgent` (there is no delta channel on that path, so\n // they assemble the full result). Real per-token delivery is the block below,\n // reached only via `invokeAgentStreaming`, which forwards each delta as it\n // arrives and never buffer-collapses.\n // ==========================================================================\n\n /**\n * Execute a streaming agent turn: resolve transport + prompts, then stream over\n * the API. Fails closed (typed {@link AgentStreamingUnsupportedError}) for the\n * CLI transport and for image agents — neither produces a token stream in v1.\n */\n private async executeAgentStreaming(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n handlers: AgentStreamHandlers,\n toolContext?: FunctionToolExecutionContext,\n ): Promise<AgentExecutionResult> {\n if (isImageAgentConfiguration(agent.config)) {\n throw new AgentStreamingUnsupportedError('operation', 'Image agents do not produce a token stream.');\n }\n const execution = this.resolveAgentExecution(agent);\n const prompts = await this.buildExecutionPrompts(agent, request);\n if (execution.transport === 'acp') {\n // A coding session DOES stream, but not tokens: it streams tool calls,\n // diffs and usage. Routing it through a token-delta handler would report\n // an agent's narration as if it were the model's output and drop\n // everything that matters. Coding progress is delivered through\n // `AgentInvocationHostContext.onCodingSessionEvent` instead.\n throw new AgentStreamingUnsupportedError('transport', 'Token streaming is not supported for the ACP coding transport; use invokeAgent and observe progress through onCodingSessionEvent.');\n }\n const approvalGatedToolNames = new Set<string>();\n const tools = this.resolveAgentTools(agent, toolContext, approvalGatedToolNames);\n const toolApproval = this.buildToolApprovalConfiguration(approvalGatedToolNames, toolContext?.auth?.executionType);\n const toolApprovalSecret = toolApproval ? this.resolveToolApprovalSecretOrThrow(agent, approvalGatedToolNames) : undefined;\n return this.executeAgentViaApiStreaming(agent, request, execution, prompts, handlers, tools, toolApproval, toolApprovalSecret);\n }\n\n /**\n * Resolve an agent's declarative `capabilities.tools.functionRefs` into AI-SDK\n * `tool(...)` definitions, closing each over the caller's `toolContext` so the\n * tool executes as the user. Returns `undefined` when the agent declares no\n * tools or no context was supplied (grounding disabled). Unknown refs are\n * skipped with a debug log rather than failing the whole invocation.\n */\n private resolveAgentTools(\n agent: FlowsActors_Agent,\n toolContext?: FunctionToolExecutionContext,\n /** Populated with the identifier-safe names of tools that require a human decision. */\n approvalGatedToolNames: Set<string> = new Set(),\n ): Record<string, any> | undefined {\n const functionRefs = agent.capabilities?.tools?.functionRefs;\n if (!functionRefs?.length || !toolContext) return undefined;\n\n const tools: Record<string, any> = {};\n for (const ref of functionRefs) {\n const functionTool: FunctionTool | undefined = this.flowsActorsRegistry.getFunctionTool(ref);\n if (!functionTool) {\n this.logDebug('Agent declares an unknown function tool; skipping', { agentRef: agent.ref, functionRef: ref });\n continue;\n }\n // Provider tool names must be identifier-safe; functionRefs use dots.\n const toolName = ref.replace(/[^a-zA-Z0-9_-]/g, '_');\n tools[toolName] = tool({\n description: functionTool.description,\n inputSchema: functionTool.inputSchema,\n /**\n * OBSERVE the failure, then re-throw it unchanged.\n *\n * The AI SDK catches whatever a tool throws and turns it into a tool-error RESULT that is fed\n * back to the model, which then narrates it to the user in prose. That is the right runtime\n * behaviour — the model can apologise, retry or ask a question — but it means a failing tool\n * produces NO server-side record of any kind: not an error, not a warning, not a debug line.\n * The only trace is whatever the model chose to say, and the model is guessing: an\n * `authorizations_access_denied` on the CREATE was narrated as \"I don't have permission to\n * write to that list\", which points an investigator at the list rather than at the ACL.\n *\n * That cost a full debugging session against a live stack — the failure could not be\n * attributed from the logs at all, because there were none. An app author hitting the same\n * thing has strictly less to work with, since the engine internals are not theirs to read.\n *\n * Re-throwing is what keeps this observation-only: the SDK still receives the same error, so\n * the model still sees the same tool result and the conversation is unchanged.\n */\n execute: async (args: any) => {\n try {\n return await functionTool.execute(args, toolContext);\n } catch (error) {\n this.logger.warn('Agent function tool execution failed; the model will be told, so nothing else records this', {\n agentRef: agent.ref,\n functionRef: ref,\n toolName,\n ...projectCaughtErrorLogFields(error),\n });\n throw error;\n }\n },\n });\n // ⚠️ The SDK's tool-level `needsApproval` is DELIBERATELY not set — it is deprecated\n // (\"tool approval is handled on a generateText / streamText level now\"), so the gate is\n // declared here and applied at the CALL site via `toolApproval`. Keeping the translation in\n // one place also means an app author never writes the SDK's vocabulary.\n if (functionTool.requiresHumanApproval) approvalGatedToolNames.add(toolName);\n }\n return Object.keys(tools).length > 0 ? tools : undefined;\n }\n\n /**\n * The SDK call-level approval configuration for a resolved tool set, or `undefined` when no\n * declared tool is approval-gated.\n *\n * `'user-approval'` is the status that SUSPENDS the tool loop and emits a\n * `tool-approval-request`; the other statuses (`approved` / `denied` / `not-applicable`) decide\n * without a human and are not what a `requiresHumanApproval` declaration means.\n */\n /**\n * The HMAC secret that signs approval requests — REQUIRED once any tool is approval-gated.\n *\n * Fails CLOSED, and the asymmetry is the reason. Without a secret the SDK still suspends and still\n * resumes, so everything looks like it works; what silently disappears is the binding between an\n * approval and the tool call it approved, which is what stops a client forging one. The tools an\n * author bothered to gate are precisely those where a forged approval is worst, so degrading to\n * unsigned approvals would remove the protection exactly where it was asked for.\n *\n * Refusing the TURN (rather than the tool) is deliberate: silently dropping the gated tool from an\n * agent's toolset would leave the agent quietly less capable with no signal, which is harder to\n * diagnose than a startup-shaped failure naming the missing configuration.\n *\n * ## Why this DERIVES rather than reading a dedicated variable\n *\n * The first implementation read a bespoke `WILDO_TOOL_APPROVAL_SECRET`. That variable is declared\n * nowhere — not in the backend env contracts, not in the env schema, not in CLI env generation —\n * so no application has ever had it set. Combined with the fail-closed rule above, the result was\n * a capability that refuses the turn in EVERY deployment: the gate could not be adopted at all,\n * and the first app author to gate a tool would have met an unexplained configuration error.\n *\n * The application's bootstrap primary secret is already provisioned everywhere, schema-validated\n * at 32+ characters, and present in `process.env` for every backend by construction. Deriving from\n * it removes the provisioning gap entirely rather than asking every deployment to close it.\n *\n * The derivation is domain-separated by a versioned label, so this key is not the primary secret\n * and cannot be interchanged with any other use of it — reusing a secret verbatim across purposes\n * is what makes one leak compromise several mechanisms. Rotating the primary secret rotates this\n * key with it, which invalidates approvals in flight; that is the correct outcome, since an\n * approval outliving a secret rotation is precisely what rotation is meant to end.\n *\n * Deliberately NOT offered as an override-if-set: a second source would mean an operator could set\n * the override in one process and not another, leaving two backends that disagree about whether an\n * approval is valid — and the failure would look like a forged approval rather than a config skew.\n */\n private resolveToolApprovalSecretOrThrow(agent: FlowsActors_Agent, approvalGatedToolNames: Set<string>): string {\n const applicationSecret = process.env[ApplicationBackendBootstrapEnvKeys.PLATFORM_APPLICATION_PRIMARY_SECRET];\n if (applicationSecret && applicationSecret.trim().length > 0) {\n return createHmac('sha256', applicationSecret).update(TOOL_APPROVAL_SIGNING_KEY_LABEL).digest('hex');\n }\n\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: `Agent \"${agent.ref}\" declares human-approval tools (${[...approvalGatedToolNames].join(', ')}) but the application's primary secret is not configured, so the approval-signing key cannot be derived. Approval decisions would be unsigned and therefore forgeable by a client, so the turn is refused rather than run with the gate weakened.`,\n agentRef: agent.ref,\n },\n });\n }\n\n private buildToolApprovalConfiguration(\n approvalGatedToolNames: Set<string>,\n /** The turn's principal. `undefined` is treated as unable to answer — fail closed. */\n executionType?: ExecutionContext_ExecutionType,\n ): Record<string, ToolApprovalDecision> | undefined {\n if (approvalGatedToolNames.size === 0) return undefined;\n\n // A principal that cannot answer must be DENIED, never suspended (D-HITL-3, widened to an\n // allow-list — see PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL). Suspending such a turn is not a\n // safe default: it parks the execution in AWAITING_APPROVAL waiting for a decision that can\n // never arrive, with no lease and no sweep to reclaim it.\n //\n // Denial is also the better OUTCOME, not merely the safe one: the SDK reports the refusal to\n // the model, which answers explaining that the action needs human approval. The caller gets a\n // usable reply instead of a turn that never returns.\n const decision: ToolApprovalDecision = executionType && PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL.has(executionType)\n ? 'user-approval'\n : { type: 'denied', reason: 'This action requires approval from a person, and this caller is not one. Ask a user to perform it, or run it through an interactive session.' };\n\n return Object.fromEntries([...approvalGatedToolNames].map((name) => [name, decision]));\n }\n\n /** API-transport streaming — mirrors executeAgentViaApi but forwards deltas + tool events. */\n private async executeAgentViaApiStreaming(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n execution: Extract<ResolvedAgentExecution, { transport: 'api' }>,\n prompts: CompiledExecutionPrompts,\n handlers: AgentStreamHandlers,\n tools?: Record<string, any>,\n toolApproval?: Record<string, ToolApprovalDecision>,\n toolApprovalSecret?: string,\n ): Promise<AgentExecutionResult> {\n const aiProvider = await this.resolveApiProviderClient(execution.providerRef);\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n const jobId = `${agent.ref}-api-stream-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling streaming API call through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n operationKey: execution.operationKey,\n model: agent.config.model,\n toolCount: tools ? Object.keys(tools).length : 0,\n jobId,\n });\n\n const result = await limiter.schedule(\n { id: jobId },\n () => this.streamOperation({\n providerClient: aiProvider,\n config: agent.config,\n operationKey: execution.operationKey,\n systemPrompt: prompts.systemPrompt,\n instructions: prompts.instructions,\n input: request.input,\n handlers,\n tools,\n toolApproval,\n toolApprovalSecret,\n }),\n );\n\n return {\n ...result,\n transport: {\n kind: LLMProvider_ExecutionTransportKind.API,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n providerRef: execution.providerRef,\n model: agent.config.model,\n },\n };\n }\n\n /**\n * Dispatch a streaming operation by key. Only text-producing operations\n * (GENERATE_TEXT / CHAT_COMPLETION and their THINKING variants) stream; other\n * keys throw {@link AgentStreamingUnsupportedError}. The output shape matches\n * the buffered executors so `normalizeOperationOutput` is identical.\n */\n private async streamOperation({ providerClient, config, operationKey, systemPrompt, instructions, input, handlers, tools, toolApproval, toolApprovalSecret }: streamOperationParams): Promise<{ output: unknown; usage?: any; approvalSuspension?: AgentApprovalSuspension }> {\n const model = this.getModelFromProvider(providerClient, config.model);\n const baseOptions = this.buildBaseOptions(config as FlowsActors_Agent_LLMConfiguration);\n\n try {\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT: {\n const { text, usage, approvalSuspension } = await this.streamTextToDeltas({ model, prompt: instructions, instructions: systemPrompt, baseOptions, tools, toolApproval, toolApprovalSecret }, handlers);\n return { output: { text }, usage, approvalSuspension };\n }\n\n case LLMProvider_OperationKey.CHAT_COMPLETION: {\n const messages = this.buildChatMessages(instructions, input);\n // System prompt goes via the top-level `instructions:` option (AI-SDK v7\n // forbids it inside `messages`), exactly like the GENERATE_TEXT branch above.\n const { text, usage, approvalSuspension } = await this.streamTextToDeltas({ model, messages, instructions: systemPrompt, baseOptions, tools, toolApproval, toolApprovalSecret }, handlers);\n return { output: { message: { role: LLMProvider_MessageRole.ASSISTANT, content: text } }, usage, approvalSuspension };\n }\n\n default:\n throw new AgentStreamingUnsupportedError('operation', `Operation ${operationKey} does not produce a token stream; use invokeAgent (buffered) instead.`);\n }\n } catch (error) {\n if (error instanceof AgentStreamingUnsupportedError) throw error;\n if (isWildoBackendError(error)) throw error;\n const errorDetails = this.extractProviderErrorDetails(error);\n this.logger.error('Streaming operation failed - provider response', { operationKey, ...errorDetails });\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { operationKey, message: `Failed to stream operation ${operationKey}: ${errorDetails.errorMessage}`, ...errorDetails },\n });\n }\n }\n\n /**\n * Run AI-SDK `streamText` and iterate its `fullStream`, forwarding text deltas\n * through `handlers.onDelta` and tool-call/result lifecycle events through\n * `handlers.onToolEvent` as they arrive (honest streaming — no buffering). When\n * `tools` are supplied a bounded multi-step loop is enabled\n * (`stopWhen: stepCountIs(MAX_TOOL_STEPS)`) so the model can call a tool and\n * continue. A throwing handler is swallowed (debug-logged) so a consumer error\n * never breaks the stream. Returns the assembled text + normalized usage.\n */\n private async streamTextToDeltas(\n args: {\n model: any; prompt?: string; instructions?: string; messages?: any[]; baseOptions: any;\n tools?: Record<string, any>; toolApproval?: Record<string, ToolApprovalDecision>; toolApprovalSecret?: string;\n },\n handlers: AgentStreamHandlers,\n ): Promise<{ text: string; usage?: any; approvalSuspension?: AgentApprovalSuspension }> {\n const { baseOptions, tools, toolApproval, toolApprovalSecret, ...streamArgs } = args;\n\n // ── Usage must be accumulated AS STEPS FINISH, not read only at the end ────────────────────\n //\n // On an ABORTED stream AI-SDK ends `fullStream` normally (an `abort` part) but **rejects**\n // `result.usage`. Reading only that terminal promise therefore threw here, which skipped\n // `reportUsage` upstream, left `turnTotalTokens` undefined, and meant `recordTurnTokens` was\n // NEVER called — so a cancelled turn moved the tenant's token budget by zero while the\n // provider had really generated (and charged for) output. That made cancellation an\n // unmetered-spend path a caller could drive on demand: start a turn, hang up, repeat.\n //\n // Per-step usage is known the moment each step completes, so it survives an abort. Only the\n // IN-FLIGHT step's partial output is unrecoverable — a small, bounded, honest gap rather than\n // losing the whole turn's consumption.\n const steppedUsage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };\n\n const result = await streamText({\n ...streamArgs,\n ...baseOptions,\n onStepFinish: (step: any) => {\n const stepUsage = this.extractUsage(step?.usage);\n steppedUsage.promptTokens += stepUsage.promptTokens;\n steppedUsage.completionTokens += stepUsage.completionTokens;\n steppedUsage.totalTokens += stepUsage.totalTokens;\n },\n // AFTER `baseOptions` on purpose: the signal is per-INVOCATION, whereas\n // `baseOptions` is derived from the agent's static config, so it must not be\n // overridable by configuration.\n ...(handlers.abortSignal ? { abortSignal: handlers.abortSignal } : {}),\n // Human-in-the-loop. `toolApproval` suspends the loop on a gated call; the secret HMAC-signs\n // the request so a replayed approval cannot be forged by a client. The caller guarantees they\n // travel together — see the fail-closed check where the configuration is built.\n ...(toolApproval ? { toolApproval, experimental_toolApprovalSecret: toolApprovalSecret } : {}),\n ...(tools\n ? {\n tools,\n stopWhen: stepCountIs(MAX_TOOL_STEPS),\n // Sanitize the CONTINUATION prompt of the multi-step tool loop: extended-thinking models\n // emit an empty-text assistant `reasoning` part that the provider's prompt validation\n // rejects when it is fed back for the next step, killing every step after the first.\n // `prepareStep`'s `messages` override is the SDK-supported seam for this and carries\n // forward to later steps. See `stripEmptyReasoningParts`.\n prepareStep: ({ messages }: { messages: any[] }) => ({ messages: stripEmptyReasoningParts(messages) }),\n }\n : {}),\n });\n\n let full = '';\n let approvalSuspension: AgentApprovalSuspension | undefined;\n for await (const part of result.fullStream) {\n try {\n if (part.type === 'text-delta') {\n full += part.text;\n handlers.onDelta(part.text);\n } else if (part.type === 'tool-call') {\n handlers.onToolEvent?.({ phase: 'call', toolName: part.toolName, input: part.input });\n } else if (part.type === 'tool-result') {\n handlers.onToolEvent?.({ phase: 'result', toolName: part.toolName });\n } else if (part.type === 'tool-error') {\n handlers.onToolEvent?.({ phase: 'error', toolName: part.toolName });\n } else if (part.type === 'tool-approval-request') {\n // The tool loop has STOPPED and is waiting for a human. This is a terminal outcome of the\n // turn, not an error: the model produced no further text and will not until the decision\n // is replayed. Captured here rather than inferred from `finishReason`, because the part\n // carries the `approvalId` the resume must echo — and the SDK binds that id to the tool\n // call with an HMAC signature, so it cannot be reconstructed after the fact.\n approvalSuspension = {\n approvalId: (part as any).approvalId,\n toolCallId: (part as any).toolCall?.toolCallId ?? (part as any).toolCallId,\n toolName: (part as any).toolCall?.toolName ?? (part as any).toolName,\n toolArgs: (part as any).toolCall?.input ?? (part as any).input,\n sdkModelMessages: [],\n };\n }\n } catch (cbError) {\n this.logDebug('Streaming handler threw (non-fatal)', {\n ...projectCaughtErrorLogFields(cbError),\n });\n }\n }\n\n // Guarded: `result.usage` rejects on an aborted stream (see the accumulator above). An\n // unguarded read here is what turned cancellation into an unmetered path, so a rejection\n // falls back to the per-step total rather than throwing away the whole turn's consumption.\n let terminalUsage: unknown;\n try {\n terminalUsage = await result.usage;\n } catch (usageError) {\n this.logDebug('Stream usage unavailable (aborted, or the provider omitted it) — metering the per-step total instead', {\n ...projectCaughtErrorLogFields(usageError),\n });\n }\n\n // Prefer the SDK's authoritative total when the stream ran to completion; otherwise report\n // what the finished steps consumed. With no completed steps this is all-zero, which is\n // exactly what the previous `extractUsage(undefined)` produced — so nothing regresses.\n // The resume payload is the SDK's own message array, read AFTER the stream drains so it\n // includes the assistant turn carrying the approval request. Reading it earlier would capture a\n // prompt the model has not answered yet, and resuming from that would re-ask rather than continue.\n if (approvalSuspension) {\n try {\n approvalSuspension.sdkModelMessages = (await result.response)?.messages ?? [];\n } catch (messagesError) {\n this.logDebug('Could not capture resume messages for a suspended turn', {\n ...projectCaughtErrorLogFields(messagesError),\n });\n }\n }\n\n return {\n text: full,\n usage: terminalUsage !== undefined ? this.extractUsage(terminalUsage) : steppedUsage,\n approvalSuspension,\n };\n }\n\n /**\n * Build the AI-SDK `messages` array for a chat turn: a caller-supplied\n * `input.messages` conversation, or a single user turn from `instructions`.\n *\n * The array is deliberately SYSTEM-FREE. AI-SDK v7 (`ai@7.x`) rejects a\n * `role:'system'` entry inside `messages` (\"System messages are not allowed in\n * the prompt or messages fields. Use the instructions option instead.\"). The\n * agent's system prompt must be passed by the CALLER via the top-level\n * `instructions:` option of `generateText` / `streamText` (as `executeGenerateText`\n * does), NEVER pushed in here. Any `role:'system'` entry a caller left in\n * `input.messages` is filtered out so the array stays v7-valid (and a new array is\n * returned — the caller's `input.messages` is never mutated). Shared by the\n * buffered chat executor and the streaming path. Throws VALIDATION when no\n * messages result.\n */\n private buildChatMessages(\n instructions: string,\n input: any,\n ): Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> {\n let messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> = [];\n\n if (input && typeof input === 'object' && 'messages' in input && Array.isArray(input.messages)) {\n // System prompt travels via the top-level `instructions:` option, so drop any\n // `role:'system'` entries here (they would be rejected by AI-SDK v7).\n messages = input.messages.filter((m: any) => m.role !== 'system');\n } else {\n messages.push({ role: 'user', content: instructions });\n }\n\n if (messages.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_MESSAGES_REQUIRED,\n context: { operation: 'CHAT_COMPLETION' }, // diagnostic (log-only)\n });\n }\n return messages;\n }\n\n /**\n * Extract usage information from AI SDK usage object\n * Handles different usage object structures across providers\n */\n private extractUsage(usage: any): {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n tokenUsageComplete: boolean;\n inputTokenDetails?: {\n noCacheTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n };\n } {\n // AI SDK usage object structure varies by provider\n // Common properties: promptTokens, completionTokens, totalTokens\n const observedPromptTokens = usage?.promptTokens ?? usage?.inputTokens;\n const observedCompletionTokens = usage?.completionTokens ?? usage?.outputTokens;\n const tokenUsageComplete = typeof observedPromptTokens === 'number' && typeof observedCompletionTokens === 'number';\n const promptTokens = observedPromptTokens ?? 0;\n const completionTokens = observedCompletionTokens ?? 0;\n const totalTokens = usage?.totalTokens ?? (promptTokens + completionTokens);\n\n const details = usage?.inputTokenDetails;\n return {\n promptTokens,\n completionTokens,\n totalTokens,\n tokenUsageComplete,\n ...(details && typeof details === 'object'\n ? {\n inputTokenDetails: {\n ...(details.noCacheTokens === undefined ? {} : { noCacheTokens: details.noCacheTokens }),\n ...(details.cacheReadTokens === undefined ? {} : { cacheReadTokens: details.cacheReadTokens }),\n ...(details.cacheWriteTokens === undefined ? {} : { cacheWriteTokens: details.cacheWriteTokens }),\n },\n }\n : {}),\n };\n }\n\n /**\n * Extract detailed error information from AI SDK errors\n * Captures provider response details, status codes, and error bodies\n */\n private extractProviderErrorDetails(error: unknown): Record<string, unknown> {\n const details: Record<string, unknown> = {\n errorMessage: describeCaughtError(error),\n errorName: error instanceof Error ? error.name : typeof error,\n stack: error instanceof Error ? error.stack : undefined,\n };\n\n // AI SDK errors often have response details\n if (error && typeof error === 'object') {\n const err = error as any;\n\n // Extract HTTP response details if available\n if (err.response) {\n details.response = {\n status: err.response.status,\n statusText: err.response.statusText,\n headers: err.response.headers,\n data: err.response.data,\n body: err.response.body,\n };\n }\n\n // Extract status code directly\n if (err.statusCode || err.status) {\n details.statusCode = err.statusCode || err.status;\n }\n\n // Extract error code\n if (err.code) {\n details.errorCode = err.code;\n }\n\n // Extract error type\n if (err.type) {\n details.errorType = err.type;\n }\n\n // Extract cause if available\n if (err.cause) {\n details.cause = this.extractProviderErrorDetails(err.cause);\n }\n\n // Extract any additional error properties\n if (err.data) {\n details.data = err.data;\n }\n\n if (err.body) {\n details.body = err.body;\n }\n\n // Extract provider-specific error details\n if (err.error) {\n details.providerError = err.error;\n }\n\n // Extract request details if available\n if (err.request) {\n details.request = {\n method: err.request.method,\n url: err.request.url,\n headers: err.request.headers,\n };\n }\n\n // Try to extract readable error message from various formats\n if (err.message) {\n details.message = err.message;\n }\n\n if (err.error?.message) {\n details.providerErrorMessage = err.error.message;\n }\n\n if (err.data?.error?.message) {\n details.dataErrorMessage = err.data.error.message;\n }\n }\n\n // The AI SDK (and most provider HTTP clients) frequently REJECT with a\n // PLAIN OBJECT rather than an `Error` instance — e.g.\n // `{ statusCode: 500, responseBody, error: { message } }`. For those, the\n // `errorMessage` computed at the top of this method fell back to\n // `String(error)` === \"[object Object]\" (with `errorName: \"object\"`), which\n // is exactly what masked every gpt-4o 5xx / rate-limit / invalid-schema\n // failure in the logs AND in the re-thrown WildoError message\n // (`Failed to execute operation …: [object Object]`). Promote the most\n // specific human-readable message we actually managed to extract above, so\n // the real provider failure is visible end-to-end. JSON-stringify (not\n // `String`) is the last resort — it surfaces `{statusCode, body, …}` instead\n // of an opaque marker. Errors (which already carry a real `.message`) are\n // left untouched.\n if (!(error instanceof Error) && error !== null && typeof error === 'object') {\n const candidates = [\n details.providerErrorMessage,\n details.dataErrorMessage,\n details.message,\n typeof details.providerError === 'string' ? details.providerError : undefined,\n typeof details.body === 'string' ? details.body : undefined,\n ];\n let best = candidates.find((c): c is string => typeof c === 'string' && c.trim().length > 0);\n if (!best) {\n try {\n best = JSON.stringify(error);\n } catch {\n /* circular / non-serializable — keep the original marker */\n }\n }\n if (best && best !== '{}') {\n details.errorMessage = best.length > 2000 ? `${best.slice(0, 2000)}…` : best;\n }\n }\n\n return details;\n }\n\n // ================================\n // Agent Validation\n // ================================\n\n private validateAgentStatus(agent: FlowsActors_Agent): void {\n if (agent.status !== FlowsActors_Agent_Status.ACTIVE) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, undefined,\n { customMessageReference: ErrorCustomMessageReference.AGENT_NOT_ACTIVE,\n context: { agentRef: agent.ref, status: agent.status }}); // diagnostic (log-only)\n }\n }\n\n /**\n * Validate that an agent's declared function tools are all registered (so a\n * streaming invocation can resolve them) and that any explicitly-required\n * function refs are declared by the agent. Returns false on any gap rather\n * than throwing, so callers can decide how to degrade.\n */\n public validateAgentCapabilities(agentRef: string, requiredCapabilities: string[]): boolean {\n const agent = this.flowsActorsRegistry.getAgentOrThrow(agentRef);\n const declaredFunctionRefs = agent.capabilities?.tools?.functionRefs ?? [];\n\n // Every tool the agent declares must resolve in the registry.\n const unresolved = declaredFunctionRefs.filter((ref) => !this.flowsActorsRegistry.hasFunctionTool(ref));\n // Every explicitly-required capability must be declared by the agent.\n const missingRequired = requiredCapabilities.filter((ref) => !declaredFunctionRefs.includes(ref));\n\n const isValid = unresolved.length === 0 && missingRequired.length === 0;\n this.logDebug('Agent capabilities validated', { agentRef, requiredCapabilities, unresolved, missingRequired, isValid });\n return isValid;\n }\n\n // ================================\n // Agent Discovery\n // ================================\n\n public getAvailableAgents(): FlowsActors_Agent[] {\n const registry = this.flowsActorsRegistry.getRegistry();\n return Object.values(registry.agents).filter((agent: FlowsActors_Agent) => agent.status === FlowsActors_Agent_Status.ACTIVE);\n }\n\n public getAgentsBySkillType(skillType: string): FlowsActors_Agent[] {\n return this.getAvailableAgents().filter(agent => agent.promptSpec.skillType === skillType);\n }\n\n public getAgent(agentRef: string): FlowsActors_Agent | undefined {\n return this.flowsActorsRegistry.getAgent(agentRef);\n }\n\n public getAgentOrThrow(agentRef: string): FlowsActors_Agent {\n return this.flowsActorsRegistry.getAgentOrThrow(agentRef);\n }\n\n // ================================\n // Debug Methods\n // ================================\n\n public getDebugInfo(): { totalAgents: number; activeAgents: number; agentsByProvider: Record<string, number>; agentsBySkillType: Record<string, number> } {\n const allAgents = Object.values(this.flowsActorsRegistry.getRegistry().agents) as FlowsActors_Agent[];\n\n const activeAgents = allAgents.filter(a => a.status === FlowsActors_Agent_Status.ACTIVE);\n\n const agentsByProvider: Record<string, number> = {};\n const agentsBySkillType: Record<string, number> = {};\n\n allAgents.forEach(agent => {\n const provider = agent.config.providerRef;\n agentsByProvider[provider] = (agentsByProvider[provider] || 0) + 1;\n\n const skillType = agent.promptSpec.skillType;\n agentsBySkillType[skillType] = (agentsBySkillType[skillType] || 0) + 1;\n });\n\n return { totalAgents: allAgents.length, activeAgents: activeAgents.length, agentsByProvider, agentsBySkillType, };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"agents.backend.service.js","sourceRoot":"","sources":["../../../../src/flows-actors/services/agents.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAmB,MAAM,uEAAuE,CAAC;AAExH,OAAO,EAAE,4BAA4B,EAAE,MAAM,2EAA2E,CAAC;AAEzH,OAAO,EAAE,wBAAwB,EAAE,MAAM,kFAAkF,CAAC;AAE5H,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAChJ,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,uCAAuC,EAAqC,MAAM,4FAA4F,CAAC;AACxL,OAAO,EAAE,qCAAqC,EAAE,MAAM,0FAA0F,CAAC;AACjJ,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAEL,wBAAwB,EAIxB,yBAAyB,EACzB,0BAA0B,EAE1B,mBAAmB,EACnB,0BAA0B,EAC1B,SAAS,EACT,2BAA2B,EAC3B,mBAAmB,EACnB,g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AAE,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,GAAG,CAAC;IACpH,CAAC;;AA99HU,oBAAoB;IADhC,UAAU,EAAE;IASR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAA;IACrD,WAAA,MAAM,CAAC,kBAAkB,CAAC,gCAAgC,CAAC,CAAA;IAC3D,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAChD,WAAA,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;IAM9D,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;IACvD,WAAA,MAAM,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;IAMnE,YAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAAE,YAAA,QAAQ,EAAE,CAAA;qCApBI,aAAa;QACM,0BAA0B;QACZ,0BAA0B;QACd,uCAAuC;QACpC,qCAAqC;QAC9D,4BAA4B;GAbtG,oBAAoB,CA+9HhC","sourcesContent":["import 'reflect-metadata';\nimport { injectable, inject, optional } from 'inversify';\nimport { z } from 'zod';\nimport { ApplicationBackendBootstrapEnvKeys } from '@wildo-ai/platform-config-lib';\nimport { ExecutionContext_ExecutionType } from '@wildo-ai/saas-models';\nimport Bottleneck from 'bottleneck';\nimport { mcpServerDestinationHost } from '@wildo-ai/saas-models';\nimport { McpOutcomeKind, type McpSession } from '~wildo-backend-lib/flows-actors/models/mcp-client.backend.definitions';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport { deriveToolApprovalSigningKey } from '~wildo-backend-lib/flows-actors/utils/tool-approval-signing.backend.utils';\nimport type { McpClientBackendService } from '~wildo-backend-lib/flows-actors/services/mcp-client.backend.service';\nimport { McpCredentialOutcomeKind } from '~wildo-backend-lib/flows-actors/services/mcp-credential-resolver.backend.service';\nimport type { McpCredentialResolverBackendService } from '~wildo-backend-lib/flows-actors/services/mcp-credential-resolver.backend.service';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { FlowsActorsRegistryService } from './flows-actors-registry.service';\nimport { ExternalProvidersRegistryBackendService, RuntimeAgentClientProtocolProfile } from '~wildo-backend-lib/external-providers/services/external-providers-registry.backend.service';\nimport { BackendProviderRegistryBackendService } from '~wildo-backend-lib/external-providers/services/backend-provider-registry.backend.service';\nimport { PromptCompilerBackendService } from './prompt-compiler.backend.service';\nimport {\n FlowsActors_Agent,\n FlowsActors_Agent_Status,\n FlowsActors_Agent_Invocation,\n type FlowsActors_Agent_LLMConfiguration,\n type FlowsActors_Agent_ImageConfiguration,\n isImageAgentConfiguration,\n isCodingAgentConfiguration,\n PromptIR_ContextItem,\n PromptIR_TrustLevel,\n PromptIR_ContextSourceKind,\n ErrorType,\n ErrorCustomMessageReference,\n isWildoBackendError,\n AgentCallOutcome,\n AgentTraceabilityLevel,\n type AgentCallTrace,\n type AgentCallTraceError,\n type AgentTraceabilityPolicy,\n type AgentTraceContext,\n type AgentCallTraceSink,\n StructuredGenerationExecutionMode,\n} from '@wildo-ai/saas-models';\nimport { MetaWorkflowStructuredGenerationPlanKind } from '@wildo-ai/saas-models/meta-workflows';\nimport {\n APPLICATION_ENVIRONMENT,\n LLMProvider_ExecutionArtifactMetadata,\n LLMProvider_ExecutionTransportMetadata,\n LLMProvider_ExecutionTransportKind,\n LLMProvider_ExecutionTransportMetadataSchema,\n LLMProvider_UsageSchema,\n LLMProvider_StructuredGenerationFailureKind,\n LLMProvider_StructuredGenerationFailureSchema,\n type LLMProvider_StructuredGenerationFailure,\n ExternalProvider_ExchangeProtocol_Kind,\n ExternalProvider_RateLimitConfigurationSchema,\n LLMProvider_Configuration,\n LLMProvider_OperationKey,\n LLMProvider_MessageRole,\n type LLMProvider_ImageContent,\n type ImageProvider_OperationKey,\n type CodingAgent_OperationKey,\n AgentClientProtocol_AuthMode,\n AgentClientProtocol_PermissionCeiling,\n AgentClientProtocol_WorkingDirectoryPolicy,\n agentClientProtocolPermissionCeilingRank,\n AgentClientProtocol_PermissionEscalationBehaviour,\n agentClientProtocolInFlightGuardsCanFire,\n type AgentClientProtocol_ExecutionProfile,\n type CodingAgent_RunTaskOutput,\n AgentClientProtocol_HostConfigurationInheritance,\n CodingAgent_UsageSchema,\n AgentClientProtocol_ExecutionTransportMetadataSchema,\n type AgentClientProtocol_ExecutionTransportMetadata,\n type ImageProvider_GenerateImageOutput,\n CodingAgent_EndOfTurnClassification,\n CodingAgent_StopReason,\n type CodingAgent_ContinuationRecord,\n type CodingAgent_SessionSuspension,\n type CodingAgent_Usage,\n ProviderProtocolRuntimeKind,\n} from '@wildo-ai/external-connectors-models';\nimport { generateText, streamText, generateObject, generateImage, NoObjectGeneratedError, tool, jsonSchema, stepCountIs } from 'ai';\nimport {\n startACPAgentSession,\n type ACPAgentSession,\n} from '~wildo-backend-lib/flows-actors/utils/acp-session-runner.backend.utils';\nimport { executeBoundedSubprocess, resolveTrustedWorkingDirectory } from '~wildo-backend-lib/flows-actors/utils/bounded-subprocess.backend.utils';\nimport type { FunctionTool, FunctionToolExecutionContext } from '~wildo-backend-lib/flows-actors/models/function-tools.backend.definitions';\nimport { modelToolNameForFunctionRef } from '~wildo-backend-lib/flows-actors/models/function-tools.backend.definitions';\nimport { userInputToContextItem } from '~wildo-backend-lib/flows-actors/utils/prompt-ir-adapters.backend.utils';\nimport {\n DEFAULT_MAX_STRUCTURED_DATA_FIELD_ALLOWED,\n planStructuredGenerationShape,\n} from '~wildo-backend-lib/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils';\n\n\n\ninterface executeOperationParams {\n providerClient: any;\n providerRef: string;\n config: FlowsActors_Agent['config'];\n operationKey: LLMProvider_OperationKey;\n systemPrompt: string;\n instructions: string;\n input: any;\n llmProviderConfig?: LLMProvider_Configuration;\n}\n\ninterface CompiledExecutionPrompts {\n systemPrompt: string;\n instructions: string;\n}\n\n/**\n * What a single operation helper (`executeGenerateText`, `executeGenerateStructured`, …)\n * hands back to {@link AgentsBackendService.executeOperation}.\n *\n * Named rather than written inline at each helper because it grew a THIRD member:\n * a structured generation can legitimately complete with no object, and the reason it\n * did has to survive the four hops between the helper that learns it and the caller\n * that reports it. An inline `{ output; usage? }` at every signature silently drops any\n * fourth field at the first hop that re-declares the shape — which is exactly how the\n * approval suspension was lost once already (see the warning in\n * {@link AgentsBackendService.finalizeInvocationSuccess}).\n */\ninterface AgentOperationExecutionResult {\n output: unknown;\n usage?: any;\n /**\n * Present ONLY when a structured generation returned `{ object: undefined }`. Every\n * other outcome — success, or a provider fault that throws — leaves it absent.\n */\n structuredGenerationFailure?: LLMProvider_StructuredGenerationFailure;\n}\n\ninterface AgentExecutionResult extends AgentOperationExecutionResult {\n output: unknown;\n usage?: unknown;\n /**\n * How the call was physically executed.\n *\n * A UNION, because a coding run is not an LLM call with a different wire\n * format and its metadata is owned by the coding-agent family. Before this was\n * widened, the ACP executor returned through a double cast and finalization\n * parsed the result with the LLM schemas — which would have thrown on the\n * first real dispatch, in a path no test and no live probe had exercised.\n */\n transport?: LLMProvider_ExecutionTransportMetadata | AgentClientProtocol_ExecutionTransportMetadata;\n /**\n * Present when the turn SUSPENDED at a human-in-the-loop approval boundary rather than\n * completing. A caller that ignores it treats a paused turn as a finished one — which would\n * record a terminal status for work that has not happened.\n */\n approvalSuspension?: AgentApprovalSuspension;\n}\n\n/**\n * Backend-only authority supplied by the installed host for an Agent call.\n *\n * A spawned agent operates in a real filesystem workspace, but that workspace is\n * neither provider configuration nor task data: profiles are portable and task\n * callers must never choose process working directories. The host that owns\n * the installed application resolves the physical root and passes it here only\n * for the invocation that needs it. API-backed Agents intentionally require no\n * host context.\n */\nexport interface AgentInvocationHostContext {\n workspaceRootPath?: string;\n /**\n * Narrows what a CODING agent may touch, beyond the profile's permission\n * ceiling. Supplied by the host that owns the task's mutation scope; returning\n * false denies, whatever the ceiling permits. Host authority, not authored\n * configuration — a portable profile cannot know a task's scope.\n */\n isPermittedCodingLocation?: (absolutePath: string) => boolean;\n /**\n * Live progress from a coding session. Best-effort by contract: the runner\n * swallows anything this throws, because a progress sink must never be able\n * to fail the run it observes.\n */\n onCodingSessionEvent?: (event: { readonly kind: string; readonly payload: unknown }) => void;\n /** Operator-initiated cancellation of a coding session. Cooperative first, kill second. */\n codingSessionAbortSignal?: AbortSignal;\n /**\n * Judge what a coding agent's END-OF-TURN message actually meant, so the turn\n * ladder can auto-continue a self-imposed pause and park a genuine question.\n *\n * The JUDGMENT is host authority, not engine mechanism: it is an auxiliary LLM\n * call, and the host (the companion) owns model resolution and the deliberation\n * infrastructure. The engine owns the LADDER — when to call this, how many\n * continuations to allow, how to record the result — and it FAILS OPEN: if this\n * is absent, throws, or times out, the turn is treated as complete. An\n * autonomous coding lane must never hang, or discard a mutated workspace, on an\n * auxiliary call. Absence therefore reproduces the pre-ladder single-turn\n * behaviour exactly, which is why every non-coding caller can ignore it.\n */\n classifyCodingTurnEnd?: (input: {\n readonly finalMessage: string;\n readonly turnIndex: number;\n }) => Promise<CodingAgent_EndOfTurnClassification>;\n /**\n * Live phase transitions for a coding session — distinct from\n * {@link onCodingSessionEvent}, which relays the agent's own frames. This fires\n * when the LADDER changes state: a new turn starting, or the session parking on\n * a question. Best-effort, like the event sink: never allowed to fail the run.\n */\n onCodingSessionStateChange?: (state: CodingSessionLadderState) => void;\n}\n\n/** The ladder phases a live coding session transitions through. */\nexport enum CodingSessionLadderPhase {\n /** A turn is executing. */\n RUNNING = 'running',\n /** The session parked on a question and is waiting for an operator answer. */\n AWAITING_INPUT = 'awaiting_input',\n}\n\n/** A phase transition in the turn ladder, surfaced to the host for live relay. */\nexport interface CodingSessionLadderState {\n readonly phase: CodingSessionLadderPhase;\n /** 1-based index of the turn this state refers to. */\n readonly turnIndex: number;\n /** The agent's question, present only when `phase` is `AWAITING_INPUT`. */\n readonly question?: string;\n}\n\n/** True when an execution result carries a CODING transport rather than an LLM one. */\nfunction isAgentClientProtocolTransport(\n transport: LLMProvider_ExecutionTransportMetadata | AgentClientProtocol_ExecutionTransportMetadata | undefined,\n): transport is AgentClientProtocol_ExecutionTransportMetadata {\n return transport?.protocolKind === ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL;\n}\n\ntype ResolvedAgentExecution =\n | {\n transport: 'api';\n providerRef: string;\n operationKey: LLMProvider_OperationKey;\n llmProviderConfig?: LLMProvider_Configuration;\n }\n | {\n transport: 'acp';\n providerRef: string;\n operationKey: CodingAgent_OperationKey;\n executionProfileRef: string;\n acpProfile: RuntimeAgentClientProtocolProfile;\n acpExecutionProfile: AgentClientProtocol_ExecutionProfile;\n };\n\n/**\n * The provider's declaration of whether its agent escalates before mutating.\n *\n * Structurally identical to the `permissionEscalation` member of the ACP runtime\n * contract, and declared locally rather than imported because that contract type\n * lives in the provider-module package, which this engine package does not\n * depend on. The narrowing below is by the enum member, so a contract that grew\n * a fourth behaviour would fail this file's exhaustiveness rather than fall into\n * a silent default.\n */\ntype AgentClientProtocolPermissionEscalationDeclaration =\n | { behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.RAISES_BEFORE_MUTATION }\n | {\n behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION;\n configurationEnvironmentVariableName: string;\n }\n | { behaviour: typeof AgentClientProtocol_PermissionEscalationBehaviour.NEVER_RAISES };\n\nconst SUBPROCESS_BASE_INHERITED_ENV_KEYS = [\n 'PATH',\n 'HOME',\n 'USER',\n 'LOGNAME',\n 'SHELL',\n 'TMPDIR',\n 'TMP',\n 'TEMP',\n 'LANG',\n 'LC_ALL',\n 'LC_CTYPE',\n 'TERM',\n 'COLORTERM',\n 'NO_COLOR',\n 'FORCE_COLOR',\n 'CI',\n 'XDG_CONFIG_HOME',\n 'XDG_CACHE_HOME',\n 'XDG_STATE_HOME',\n 'XDG_RUNTIME_DIR',\n 'SSL_CERT_FILE',\n 'SSL_CERT_DIR',\n 'HTTP_PROXY',\n 'HTTPS_PROXY',\n 'NO_PROXY',\n] as const;\n\n/**\n * Thrown by {@link AgentsBackendService.invokeAgentStreaming} when honest token\n * streaming is not available for the requested agent:\n * - `'transport'` — the agent uses the CLI transport (v1 streams over the API\n * transport only; the session-oriented CLI runtime is a future workstream);\n * - `'operation'` — the operation is non-text (structured / multimodal / image),\n * which has no token-delta stream.\n * Callers may catch this to fall back to the buffered {@link AgentsBackendService.invokeAgent}.\n */\nexport class AgentStreamingUnsupportedError extends Error {\n constructor(public readonly reason: 'transport' | 'operation', message: string) {\n super(message);\n this.name = 'AgentStreamingUnsupportedError';\n }\n}\n\n/** Max agent↔tool round-trips per streaming turn (bounds tool-call loops). */\nconst MAX_TOOL_STEPS = 6;\n\n/**\n * Strip assistant `reasoning` content parts that carry NO text, for the multi-step\n * tool-loop continuation.\n *\n * WHY: extended-thinking models (e.g. Sonnet-5) emit an assistant `reasoning` part whose `text` is\n * EMPTY — the thinking itself lives in the provider-encrypted `providerOptions.anthropic.signature`.\n * When the AI-SDK v7 tool loop re-feeds that assistant message to the model for the NEXT step, the\n * provider prompt validation rejects the empty-text part\n * (`AI_TypeValidationError: … expected 'reasoning' | 'reasoning-file' | 'tool-call'`) — so the second\n * step never runs: a read→create chain dies after the first tool and the reply comes back empty.\n *\n * WHAT: drop ONLY the text-less reasoning parts. Reasoning parts that DO carry text round-trip fine\n * and are preserved, as are text / tool-call / tool-result parts — so nothing user-visible and no\n * tool causality is lost. An assistant message left with no parts at all is dropped entirely (an\n * empty content array is itself invalid).\n *\n * Pure + total: returns a NEW array only when something changed, never mutates the caller's\n * messages, and passes through any non-array content untouched.\n */\nexport function stripEmptyReasoningParts(messages: readonly any[] | undefined): any[] {\n if (!Array.isArray(messages)) return [];\n const isTextlessReasoning = (part: any): boolean =>\n !!part && typeof part === 'object' && part.type === 'reasoning'\n && (typeof part.text !== 'string' || part.text.length === 0);\n\n const result: any[] = [];\n for (const message of messages) {\n if (!message || message.role !== 'assistant' || !Array.isArray(message.content)) {\n result.push(message);\n continue;\n }\n if (!message.content.some(isTextlessReasoning)) {\n result.push(message);\n continue;\n }\n const content = message.content.filter((part: any) => !isTextlessReasoning(part));\n // An assistant message whose parts were ALL text-less reasoning has nothing left to send.\n if (content.length === 0) continue;\n result.push({ ...message, content });\n }\n return result;\n}\n\n/** A tool-call lifecycle event surfaced to the streaming caller for progress UI. */\nexport interface FunctionToolStreamEvent {\n phase: 'call' | 'result' | 'error';\n toolName: string;\n input?: unknown;\n}\n\n/** Callbacks a streaming invocation forwards to the caller. */\nexport interface AgentStreamHandlers {\n onDelta: (delta: string) => void;\n onToolEvent?: (event: FunctionToolStreamEvent) => void;\n /**\n * Cooperative cancellation for the model call.\n *\n * Carried HERE rather than as a new parameter because `handlers` is already threaded\n * unchanged through every hop of the streaming path\n * (`invokeAgentStreaming` → `executeAgentViaApiStreaming` → `streamOperation` →\n * `streamTextToDeltas` → `streamText`). Adding a positional argument at four levels\n * is exactly the arity hazard that has already produced one silent `undefined` in this\n * codebase; riding the object that is passed anyway changes no call signature.\n *\n * Semantically it belongs: this interface is the stream's control surface, and\n * \"stop streaming\" is part of controlling a stream.\n *\n * When absent the model call is simply uncancellable — the previous behaviour.\n */\n abortSignal?: AbortSignal;\n}\n\ninterface streamOperationParams {\n providerClient: any;\n config: FlowsActors_Agent['config'];\n operationKey: LLMProvider_OperationKey;\n systemPrompt: string;\n instructions: string;\n input: any;\n handlers: AgentStreamHandlers;\n tools?: Record<string, any>;\n /**\n * Call-level tool-approval configuration (human-in-the-loop), keyed by identifier-safe tool name.\n *\n * Rides the params OBJECT rather than a positional argument, for the reason already recorded on\n * `abortSignal` above: this value crosses four levels, and adding a positional parameter at four\n * levels is the arity hazard that has already produced one silent `undefined` here.\n */\n toolApproval?: Record<string, ToolApprovalDecision>;\n /**\n * Secret used to HMAC-sign approval requests and verify them on replay.\n *\n * REQUIRED whenever `toolApproval` is present — without it a client can forge an approval for\n * exactly the tools someone marked dangerous enough to gate. The caller fails closed rather than\n * passing `toolApproval` with no secret.\n */\n toolApprovalSecret?: string;\n}\n\n/**\n * A turn that SUSPENDED at a human-in-the-loop approval boundary instead of completing.\n *\n * Not an error and not a terminal failure: the tool loop stopped, the model is waiting, and the run\n * state below is everything needed to resume once a human decides. `sdkModelMessages` is the SDK's\n * own resume payload — opaque to us by design.\n */\nexport interface AgentApprovalSuspension {\n approvalId: string;\n toolCallId: string;\n toolName: string;\n toolArgs?: Record<string, unknown>;\n sdkModelMessages: Record<string, unknown>[];\n}\n\n/**\n * The per-tool approval decision handed to the model SDK.\n *\n * semantic-literal-boundary: `'user-approval'` and `'denied'` are the model SDK's own\n * `ToolApprovalStatus` vocabulary, not Wildo's. This type is the thin adapter where they are\n * produced; they must not spread past {@link AgentsBackendService.buildToolApprovalConfiguration}.\n */\ntype ToolApprovalDecision = 'user-approval' | { type: 'denied'; reason: string };\n\n/**\n * The principals that can actually ANSWER an approval request.\n *\n * Deliberately an ALLOW-LIST of one, not a deny-list of machines. The decision that motivated this\n * (D-HITL-3) was written as \"machine turns auto-deny\", but the execution vocabulary has eight\n * members and only one of them denotes a present, accountable human with a session to answer on:\n *\n * - `ORGANIZATION_MACHINE` / `APPLICATION_MACHINE` — no human on the socket at all.\n * - `INTERNALLY_INITIATED_REQUEST`, `WEBHOOK_CALLBACK` — system-initiated; nobody is watching.\n * - `PUBLIC_EXECUTION`, `ANONYMOUS_SESSION` — a human may be present but carries no accountable\n * identity, and an approval whose approver cannot be named is not an audit record.\n * - `CONSUMABLE_TOKEN` — a one-off credential; whether it sustains the response channel is not\n * established, so it stays out until something proves it does.\n *\n * Written as an allow-list because the failure modes are not symmetric. A deny-list means the NEXT\n * execution type added to the enum silently inherits \"suspend\", and a principal that cannot answer\n * suspending is not a refusal — it is a turn that hangs in `AWAITING_APPROVAL` forever, holding no\n * lease and exempt from the abandoned-task sweep by design. An allow-list makes the same omission\n * fail closed and visible instead.\n */\nconst PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL: ReadonlySet<ExecutionContext_ExecutionType> = new Set([\n ExecutionContext_ExecutionType.USER_REQUEST,\n]);\n\n/**\n * Project only structural validation metadata from nested SDK/Zod errors.\n * Provider validation errors retain the rejected value in their message, so\n * logging `cause.message` would copy private model output into ordinary logs.\n */\n/**\n * The TOP-LEVEL key names of a structured generation, for `unrecognized_keys` diagnosis only.\n *\n * Returns names, never values, and never recurses: a nested key could be a map keyed by user content,\n * whereas the root of a schema-driven generation is schema shape. Any parse failure yields nothing rather\n * than leaking a fragment of the raw text through an error message.\n */\nfunction projectStructuredRootKeyNames(text: unknown): readonly string[] | undefined {\n if (typeof text !== 'string' || text.length === 0) return undefined;\n try {\n const parsed: unknown = JSON.parse(text);\n if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return undefined;\n return Object.keys(parsed).slice(0, 64);\n } catch {\n return undefined;\n }\n}\n\nfunction projectStructuredValidationIssues(\n error: unknown,\n): ReadonlyArray<{ readonly code: string; readonly path: readonly (string | number)[]; readonly keys?: readonly string[] }> {\n let current = error;\n for (let depth = 0; depth < 4 && typeof current === 'object' && current !== null; depth += 1) {\n const record = current as { cause?: unknown; issues?: unknown };\n if (Array.isArray(record.issues)) {\n return record.issues.flatMap((issue) => {\n if (typeof issue !== 'object' || issue === null) return [];\n const candidate = issue as { code?: unknown; path?: unknown };\n if (typeof candidate.code !== 'string' || !Array.isArray(candidate.path)) return [];\n const path = candidate.path.filter((segment): segment is string | number => typeof segment === 'string' || typeof segment === 'number');\n // `unrecognized_keys` additionally carries the offending KEY NAMES, and those are projected. A key\n // a model invented against a strict object is schema shape, not model content -- the boundary this\n // function exists to hold is about VALUES, which are never included. Without the names the issue is\n // undiagnosable: it reports only that some unknown key exists at the root, which cost several live\n // runs on 2026-08-21 before the key could be identified any other way.\n const rawKeys = (issue as { keys?: unknown }).keys;\n const keys = Array.isArray(rawKeys)\n ? rawKeys.filter((key): key is string => typeof key === 'string')\n : undefined;\n return [{ code: candidate.code, path, ...(keys && keys.length > 0 ? { keys } : {}) }];\n });\n }\n current = record.cause;\n }\n return [];\n}\n\n@injectable()\nexport class AgentsBackendService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n // Bottleneck instances per provider for rate limiting LLM calls\n private readonly bottleneckInstances: Map<string, Bottleneck> = new Map();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.FlowsActorsRegistryService) private readonly flowsActorsRegistry: FlowsActorsRegistryService,\n @inject(SAAS_SERVICE_TYPES.ExternalProvidersRegistryService) private readonly externalProvidersRegistry: ExternalProvidersRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.BackendProviderRegistryService) private readonly backendProviderRegistryService: BackendProviderRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.PromptCompilerService) private readonly promptCompiler: PromptCompilerBackendService,\n @inject(SAAS_SERVICE_TYPES.AgentCallTraceSink) @optional() private readonly agentTraceSink?: AgentCallTraceSink,\n @inject(SAAS_SERVICE_TYPES.AgentTraceabilityPolicy) @optional() private readonly agentTracePolicy?: AgentTraceabilityPolicy,\n /**\n * OPTIONAL, because an application that declares no MCP server needs neither bound — and an\n * agent with no `mcpRefs` never reaches them. Absence degrades to \"this agent gets its\n * `functionRefs` and nothing else\", which is exactly what it got before #491.\n */\n @inject(SAAS_SERVICE_TYPES.McpClientService) @optional() private readonly mcpClient?: McpClientBackendService,\n @inject(SAAS_SERVICE_TYPES.McpCredentialResolverService) @optional() private readonly mcpCredentialResolver?: McpCredentialResolverBackendService,\n /**\n * OPTIONAL, and feature-detected at every emission. An audit sink that is absent must never fail\n * the act it was going to observe — the same stance the file-scanning lane takes, and the reason\n * an observation is fire-and-forget rather than awaited into the turn's critical path.\n */\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) @optional() private readonly auditLogs?: AuditLogsBackendService,\n ) {\n this.logDebug = this.logger.debugByType('AgentsBackend');\n this.logger.setDebugTypeLogging('AgentsBackend', false);\n\n this.logDebug('Agents backend service created');\n }\n\n // ================================\n // Structured Data Chunking Utilities\n // ================================\n\n\n private mergeChunkedObjects<T extends Record<string, unknown>>(chunks: T[]): T {\n if (chunks.length === 0) {\n return {} as T;\n }\n if (chunks.length === 1) {\n return chunks[0];\n }\n\n // Deep merge nested objects instead of shallow merge\n const result = { ...chunks[0] } as any;\n\n for (let i = 1; i < chunks.length; i++) {\n const chunk = chunks[i];\n for (const key in chunk) {\n if (chunk.hasOwnProperty(key)) {\n const chunkValue = chunk[key];\n const resultValue = result[key];\n\n // If both values are plain objects, deep merge them\n if (\n chunkValue !== null &&\n typeof chunkValue === 'object' &&\n !Array.isArray(chunkValue) &&\n resultValue !== null &&\n typeof resultValue === 'object' &&\n !Array.isArray(resultValue) &&\n resultValue.constructor === Object &&\n chunkValue.constructor === Object\n ) {\n result[key] = this.mergeChunkedObjects([resultValue, chunkValue]);\n } else {\n // Otherwise, use the chunk value (last one wins for conflicts)\n result[key] = chunkValue;\n }\n }\n }\n }\n\n return result as T;\n }\n\n // ================================\n // Bottleneck Rate Limiting\n // ================================\n\n\n private getBottleneckForProvider(\n providerRef: string,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind = ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n ): Bottleneck {\n const limiterKey = `${providerRef}:${protocolKind}`;\n if (this.bottleneckInstances.has(limiterKey)) {\n const existingLimiter = this.bottleneckInstances.get(limiterKey)!;\n this.logDebug('Returning existing bottleneck instance for provider', { providerRef, protocolKind });\n return existingLimiter;\n }\n\n this.logDebug('Creating new bottleneck instance for provider', { providerRef, protocolKind });\n const config = this.externalProvidersRegistry.getProviderConfiguration(providerRef, protocolKind);\n\n const rateLimitConfig = config && 'rateLimitConfig' in config && config.rateLimitConfig\n ? ExternalProvider_RateLimitConfigurationSchema.parse(config.rateLimitConfig)\n : ExternalProvider_RateLimitConfigurationSchema.parse({});\n\n // Create bottleneck options\n const bottleneckOptions: Record<string, number | undefined> = {\n maxConcurrent: rateLimitConfig.maxConcurrent ?? 10,\n minTime: rateLimitConfig.minTime,\n reservoir: rateLimitConfig.reservoir,\n reservoirRefreshInterval: rateLimitConfig.reservoirRefreshInterval,\n reservoirRefreshAmount: rateLimitConfig.reservoirRefreshAmount,\n };\n\n // Remove undefined values\n Object.keys(bottleneckOptions).forEach(key => {\n if (bottleneckOptions[key] === undefined) {\n delete bottleneckOptions[key];\n }\n });\n\n // Create and store bottleneck instance\n const limiter = new Bottleneck(bottleneckOptions);\n\n // Add event listeners for rate limiting visibility\n this.setupBottleneckEventListeners(limiter, limiterKey);\n\n this.bottleneckInstances.set(limiterKey, limiter);\n\n this.logDebug('Bottleneck instance created for provider', {\n providerRef,\n protocolKind,\n maxConcurrent: bottleneckOptions.maxConcurrent,\n minTime: bottleneckOptions.minTime,\n reservoir: bottleneckOptions.reservoir\n });\n\n return limiter;\n }\n\n /**\n * Setup event listeners on bottleneck instance to track rate limiting behavior\n */\n private setupBottleneckEventListeners(limiter: Bottleneck, providerRef: string): void {\n // Track when jobs are queued (delayed due to rate limiting)\n limiter.on('queued', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call queued (rate limited - will be delayed)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs start running (immediate or after queuing)\n limiter.on('executing', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call executing (running now)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs complete\n limiter.on('done', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logDebug('API call completed through rate limiter', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n done: limiter.done(),\n });\n });\n\n // Track when jobs are dropped (queue full or other reasons)\n limiter.on('dropped', (info: any) => {\n const jobId = info?.options?.id || 'unknown';\n this.logger.warn('API call dropped by rate limiter (queue full or limit exceeded)', {\n providerRef,\n jobId,\n queued: limiter.queued(),\n running: limiter.running(),\n });\n });\n\n // Track when reservoir is depleted\n limiter.on('depleted', () => {\n this.logDebug('Rate limiter reservoir depleted (waiting for refresh)', {\n providerRef,\n queued: limiter.queued(),\n running: limiter.running(),\n });\n });\n\n // Track errors in the limiter\n limiter.on('error', (error: any) => {\n this.logger.error('Rate limiter error', {\n providerRef,\n ...projectCaughtErrorLogFields(error),\n stack: error instanceof Error ? error.stack : undefined,\n });\n });\n }\n\n // ================================\n // Agent Invocation\n // ================================\n\n /**\n * @wildo_source:part:start saas.backend.flows-actors.invoke-agent facet:layer:backend facet:family:flows-actors\n *\n * Run ONE agent, once, and await its complete answer. This is the seam an\n * application calls to use its `AI_LLM` capability from its own backend code\n * (a service, a custom resource operation, a batch job).\n *\n * Inject it by DI symbol:\n * `@inject(SAAS_SERVICE_TYPES.AgentsBackendService) private readonly agentsService: AgentsBackendService`\n * — import both from `@wildo-ai/saas-backend-lib`.\n *\n * The engine owns everything around the call: it resolves the agent by\n * `request.agentRef` (unknown ref → throws), refuses a non-`ACTIVE` agent,\n * compiles `promptSpec` into a provider-shaped system prompt, resolves the\n * provider client + API key (fail-closed if unconfigured), schedules the call\n * through that provider's rate limiter, normalizes the output to the\n * operation's wrapped shape, and emits the usage/latency trace. You supply an\n * invocation and read `result.output`.\n *\n * **Function tools do NOT run on this path.** An agent's declared\n * `capabilities.tools.functionRefs` are resolved and executed only by the\n * STREAMING/conversational path ({@link invokeAgentStreaming}). A one-shot\n * agent must therefore receive everything it needs in `request.input` — fetch\n * the data yourself first. Declaring tools here is silently inert, not an error.\n *\n * @param request the invocation envelope (`agentRef` + `input` + empty `output` seed).\n * @param traceContext optional correlation for the agent-call trace sink.\n * @param hostContext backend-owned physical execution context, required only\n * once the selected declared transport is CLI.\n * @returns the same envelope with `output` normalized and `executionContext` enriched.\n * @throws a typed backend error — unknown/inactive agent, missing provider key,\n * missing `input.schema` on a structured call, or a provider failure.\n */\n public async invokeAgent(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n traceContext?: AgentTraceContext,\n hostContext?: AgentInvocationHostContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n /** @wildo_source:part:end saas.backend.flows-actors.invoke-agent */\n const startTime = Date.now();\n const callTimestamp = new Date(startTime).toISOString();\n\n this.logDebug('Invoking agent', { agentRef: request.agentRef,hasInput: !!request.input,hasExecutionContext: !!request.executionContext });\n\n const agent = this.flowsActorsRegistry.getAgentOrThrow(request.agentRef);\n\n this.validateAgentStatus(agent);\n\n try {\n const result = await this.executeAgent(agent, request, hostContext);\n this.logDebug('Agent invocation completed', {agentRef: request.agentRef,executionTime: Date.now() - startTime,hasOutput: !!result.output });\n return await this.finalizeInvocationSuccess(request, agent, result, startTime, callTimestamp, traceContext);\n } catch (error) {\n await this.traceInvocationFailure(request, agent, error, startTime, callTimestamp, traceContext);\n throw error;\n }\n }\n\n /**\n * Streaming counterpart of {@link invokeAgent}: runs the agent over the API\n * transport and forwards each token delta through `streamHandlers.onDelta` as\n * it arrives (honest token streaming — no buffer-collapse). The returned\n * invocation carries the fully-assembled, normalized output + enriched\n * `executionContext`, identical in shape to `invokeAgent`, so persistence and\n * tracing are unchanged.\n *\n * Only text-producing operations over the API transport stream. CLI-transport\n * agents and non-text operations (structured / multimodal / image) throw\n * {@link AgentStreamingUnsupportedError}; callers may catch it to fall back to\n * the buffered `invokeAgent`.\n */\n public async invokeAgentStreaming(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n streamHandlers: AgentStreamHandlers,\n toolContext?: FunctionToolExecutionContext,\n traceContext?: AgentTraceContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n const startTime = Date.now();\n const callTimestamp = new Date(startTime).toISOString();\n\n this.logDebug('Invoking agent (streaming)', { agentRef: request.agentRef, hasToolContext: !!toolContext });\n\n const agent = this.flowsActorsRegistry.getAgentOrThrow(request.agentRef);\n this.validateAgentStatus(agent);\n\n try {\n const result = await this.executeAgentStreaming(agent, request, streamHandlers, toolContext);\n this.logDebug('Agent streaming invocation completed', { agentRef: request.agentRef, executionTime: Date.now() - startTime });\n return await this.finalizeInvocationSuccess(request, agent, result, startTime, callTimestamp, traceContext);\n } catch (error) {\n await this.traceInvocationFailure(request, agent, error, startTime, callTimestamp, traceContext);\n throw error;\n }\n }\n\n /**\n * Shared success finalizer for buffered + streaming invocations: enrich the\n * execution context (timing / usage / transport), normalize the output for the\n * agent's operation, and emit the best-effort policy-gated success trace. Every\n * caller of invokeAgent* — companion, backend flows, minions, workers — gets\n * the trace for free; the sink decides where it lands. See\n * `agent-call-trace-sink.backend.ts`.\n */\n private async finalizeInvocationSuccess(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n agent: FlowsActors_Agent,\n result: AgentExecutionResult,\n startTime: number,\n callTimestamp: string,\n traceContext?: AgentTraceContext,\n ): Promise<FlowsActors_Agent_Invocation<any, any, any>> {\n const executionTime = Date.now() - startTime;\n const finishedAt = new Date().toISOString();\n const executionContext = {\n ...request.executionContext,\n callDuration: executionTime,\n executionTime,\n finishedAt,\n // Parsed by the envelope actually received. A coding run reports context\n // and cost the LLM usage schema does not model, and an ACP transport\n // record is not a member of the LLM transport union — running either\n // through the LLM schemas throws, and it throws AFTER the workspace has\n // been mutated.\n ...(result.usage\n ? {\n usage: isAgentClientProtocolTransport(result.transport)\n ? CodingAgent_UsageSchema.parse(result.usage)\n : LLMProvider_UsageSchema.parse(result.usage),\n }\n : {}),\n ...(result.transport\n ? {\n transport: isAgentClientProtocolTransport(result.transport)\n ? AgentClientProtocol_ExecutionTransportMetadataSchema.parse(result.transport)\n : LLMProvider_ExecutionTransportMetadataSchema.parse(result.transport),\n }\n : {}),\n // A structured generation that produced no object carries the reason it did not.\n // It rides on `executionContext` beside `usage` because that is the envelope the\n // whole invocation contract already publishes for provider-learned facts — and\n // because the trace sink receives this same object as its `context`, so the reason\n // reaches traceability without a second wiring. Parsed rather than spread so a\n // malformed reason cannot silently enter the published contract.\n ...(result.structuredGenerationFailure\n ? { structuredGenerationFailure: LLMProvider_StructuredGenerationFailureSchema.parse(result.structuredGenerationFailure) }\n : {}),\n };\n const output = this.normalizeOperationOutput(agent.config.operationKey, result.output);\n await this.emitAgentCallTrace(\n {\n agentRef: request.agentRef,\n provider: agent.config.providerRef,\n model: agent.config.model,\n callTimestamp,\n outcome: AgentCallOutcome.SUCCESS,\n input: request.input,\n output,\n context: executionContext,\n },\n traceContext,\n );\n // Carry the approval suspension onto the returned invocation.\n //\n // ⚠️ This method REBUILDS the result rather than spreading it, so anything the execution layer\n // learned that is not `output`/`executionContext` is dropped here by construction. That is what\n // happened to the suspension: it was threaded correctly through the stream reader, the operation\n // and the transport, and then silently lost at this fifth hop — the turn reported COMPLETED with\n // empty text while the tool sat unapproved, which is exactly the outcome the whole feature\n // exists to prevent. The unit pins could not see it because they stub `invokeAgentStreaming` and\n // never reach this method; only the live lane did.\n //\n // Deliberately kept as an explicit field rather than switching to `...result`: this rebuild is\n // intentional (the invocation is the caller's request plus its answer, not the internal\n // execution record), and spreading would leak transport internals onto a public shape.\n return { ...request, output, executionContext, ...(result.approvalSuspension ? { approvalSuspension: result.approvalSuspension } : {}) };\n }\n\n /** Shared failure tracer for buffered + streaming invocations. */\n private async traceInvocationFailure(\n request: FlowsActors_Agent_Invocation<any, any, any>,\n agent: FlowsActors_Agent,\n error: unknown,\n startTime: number,\n callTimestamp: string,\n traceContext?: AgentTraceContext,\n ): Promise<void> {\n await this.emitAgentCallTrace(\n {\n agentRef: request.agentRef,\n provider: agent.config.providerRef,\n model: agent.config.model,\n callTimestamp,\n outcome: AgentCallOutcome.FAILURE,\n input: request.input,\n context: { ...request.executionContext, executionTime: Date.now() - startTime },\n error: this.buildAgentCallTraceError(error),\n },\n traceContext,\n );\n }\n\n /**\n * Emit one agent-call trace to the configured sink — best-effort and gated by\n * the resolved policy level (per-call `levelOverride` wins; default `NONE` →\n * skip, so output is byte-identical when traceability is off). A sink failure\n * is swallowed (debug-logged): tracing must never turn a successful agent call\n * into a failed one.\n */\n private async emitAgentCallTrace(\n trace: AgentCallTrace,\n traceContext?: AgentTraceContext,\n ): Promise<void> {\n const sink = this.agentTraceSink;\n if (!sink) {\n return;\n }\n const level = traceContext?.levelOverride ?? this.agentTracePolicy?.level ?? AgentTraceabilityLevel.NONE;\n if (level === AgentTraceabilityLevel.NONE) {\n return;\n }\n try {\n await sink.recordAgentCall({ trace, level, context: traceContext });\n } catch (err) {\n this.logDebug('Agent-call trace sink failed (non-fatal)', {\n agentRef: trace.agentRef,\n ...projectCaughtErrorLogFields(err),\n });\n }\n }\n\n /** Build the JSON-serializable trace error shape from a thrown value. */\n private buildAgentCallTraceError(error: unknown): AgentCallTraceError {\n if (error instanceof Error) {\n const code = (error as Error & { code?: string }).code;\n return {\n name: error.name,\n message: error.message,\n ...(code ? { code } : {}),\n };\n }\n // A non-Error, non-string throw still carries information — a JSON-RPC error object, a refusal\n // shape. Serialize it (bounded) rather than replacing it with a sentence that says nothing.\n if (typeof error === 'string') return { message: error };\n try {\n const serialized = JSON.stringify(error);\n if (serialized && serialized !== '{}') return { message: `Non-Error thrown: ${serialized.slice(0, 500)}` };\n } catch { /* circular or hostile — fall through to the sentinel */ }\n return { message: 'Unknown agent invocation error' };\n }\n\n /**\n * Normalize executor outputs to the shared transport-neutral LLM contract.\n *\n * The current execution helpers naturally produce provider/raw payloads such as\n * plain strings or plain objects. Downstream consumers, however, already rely on\n * the wrapped shared schemas (`{ text }`, `{ object }`, `{ message }`, etc.).\n * Centralizing the normalization here fixes the runtime boundary once instead of\n * forcing every caller to guess the provider-shaped payload.\n */\n private normalizeOperationOutput(\n operationKey: LLMProvider_OperationKey | ImageProvider_OperationKey | CodingAgent_OperationKey,\n output: unknown,\n ): unknown {\n // Image outputs (`{ images }`) are already shaped by executeImageAgent, and\n // coding outputs (`{ finalMessage, stopReason, … }`) by the ACP executor —\n // both are produced in their published shape rather than as a raw provider\n // payload, so both fall through the `default` arm unchanged. Only the LLM\n // arms need wrapping, because only they receive a bare string or object.\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT:\n if (this.isRecord(output) && typeof output.text === 'string') {\n return output;\n }\n return { text: typeof output === 'string' ? output : JSON.stringify(output ?? '') };\n\n case LLMProvider_OperationKey.CHAT_COMPLETION:\n case LLMProvider_OperationKey.CHAT_MULTIMODAL:\n if (this.isRecord(output) && this.isRecord(output.message)) {\n return output;\n }\n return {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: typeof output === 'string' ? output : JSON.stringify(output ?? ''),\n },\n };\n\n case LLMProvider_OperationKey.GENERATE_STRUCTURED:\n if (this.isRecord(output) && 'object' in output) {\n return output;\n }\n return { object: output };\n\n case LLMProvider_OperationKey.STREAM_TEXT:\n if (this.isRecord(output) && typeof output.textDelta === 'string') {\n return output;\n }\n return { textDelta: typeof output === 'string' ? output : JSON.stringify(output ?? '') };\n\n case LLMProvider_OperationKey.STREAM_STRUCTURED:\n if (this.isRecord(output) && ('object' in output || 'partialObject' in output)) {\n return output;\n }\n return { object: output };\n\n default:\n return output;\n }\n }\n\n private isRecord(value: unknown): value is Record<string, any> {\n return typeof value === 'object' && value !== null;\n }\n\n /**\n * Execute agent with LLM provider using @ai-sdk\n */\n private async executeAgent(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n hostContext?: AgentInvocationHostContext,\n ): Promise<AgentExecutionResult> {\n this.logDebug('Executing agent', {\n agentRef: agent.ref,\n operationKey: agent.config.operationKey,\n providerRef: agent.config.providerRef,\n model: agent.config.model,\n executionProfileRef: agent.config.executionProfileRef,\n });\n\n // Modality dispatch: an image agent routes to the IMAGE_PROVIDER path.\n // AUDIO/VIDEO modalities are reserved — their configs have no arm yet, so\n // they cannot reach here; if one ever does, `executeImageAgent`'s provider\n // resolution fail-closes. The LLM/text + CLI path below is unchanged.\n if (isImageAgentConfiguration(agent.config)) {\n return this.executeImageAgent(agent, request);\n }\n\n // A coding agent routes to the ACP session transport. It produces no\n // artifact modality — its product is a changed workspace — so it is\n // dispatched by its own arm rather than by an artifact-modality branch.\n if (isCodingAgentConfiguration(agent.config)) {\n return this.executeAgentViaACP(agent, request, hostContext);\n }\n\n const execution = this.resolveAgentExecution(agent);\n const prompts = await this.buildExecutionPrompts(agent, request);\n\n if (execution.transport === 'acp') {\n // Unreachable in practice: a coding agent is dispatched by its arm above,\n // before prompts are compiled. Kept so the transport union is handled\n // exhaustively here rather than falling into the API branch, which is\n // what an unhandled member would silently do.\n return this.executeAgentViaACP(agent, request, hostContext);\n }\n\n return this.executeAgentViaApi(agent, request, execution, prompts);\n }\n\n /**\n * Execute an IMAGE-modality agent via an `IMAGE_PROVIDER` transport.\n *\n * Mirrors the LLM API path (provider-enabled check → apiKey → SDK client →\n * rate-limited call) but resolves the `IMAGE_PROVIDER` binding and calls the\n * AI-SDK `experimental_generateImage` against `client.imageModel(model)`.\n * Image-generation parameters come from the image config arm (`size` /\n * `quality` / `background` / `outputFormat` / `n`), NOT LLM sampling.\n *\n * Usage/transport metadata is intentionally not populated in this first\n * slice (the shared `executionContext` schema is LLM-shaped; image-modality\n * usage/transport enrichment is a follow-up). The best-effort agent-call\n * trace still records provider/model/input/output.\n */\n private async executeImageAgent(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n ): Promise<AgentExecutionResult> {\n const config = agent.config as FlowsActors_Agent_ImageConfiguration;\n const providerRef = config.providerRef;\n const protocolKind = ExternalProvider_ExchangeProtocol_Kind.IMAGE_PROVIDER;\n\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, protocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_ENABLED,\n context: { providerRef, protocolKind }, // diagnostic (log-only)\n });\n }\n\n const apiKey = this.externalProvidersRegistry.getProviderApiKey(providerRef, protocolKind);\n if (!apiKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: { providerRef, protocolKind, message: 'API key not found for image provider. Configure the provider secret in application configuration.' },\n });\n }\n\n const binding = this.backendProviderRegistryService.getProtocolBinding(providerRef, protocolKind);\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.IMAGE) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: { providerRef, message: 'Image runtime contract not available for provider' },\n });\n }\n\n const client: any = await binding.runtimeContract.sdkFactory(apiKey);\n if (typeof client?.imageModel !== 'function') {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_IMAGE_GENERATION_NOT_SUPPORTED,\n context: { providerRef }, // diagnostic (log-only)\n });\n }\n\n const input = request.input as { prompt?: unknown; referenceImages?: unknown } | undefined;\n const prompt = typeof input?.prompt === 'string' ? input.prompt : String(request.input ?? '');\n if (prompt.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_IMAGE_PROMPT_REQUIRED,\n context: { agentRef: agent.ref }, // diagnostic (log-only)\n });\n }\n\n const providerOptions: Record<string, any> = {};\n const openaiOptions: Record<string, any> = {};\n if (config.quality) openaiOptions.quality = config.quality;\n if (config.background) openaiOptions.background = config.background;\n if (config.outputFormat) openaiOptions.output_format = config.outputFormat;\n if (Object.keys(openaiOptions).length > 0) providerOptions.openai = openaiOptions;\n\n // `any` on the args object sidesteps the SDK's strict `${number}x${number}`\n // size template-literal type (our `size` is an enum incl. `auto`); the\n // rest of this service uses the same `any` pragmatism for model/options.\n const genArgs: any = {\n model: client.imageModel(config.model),\n prompt,\n ...(config.n !== undefined ? { n: config.n } : {}),\n ...(config.size !== undefined ? { size: config.size } : {}),\n ...(config.seed !== undefined ? { seed: config.seed } : {}),\n ...(Object.keys(providerOptions).length > 0 ? { providerOptions } : {}),\n };\n\n const limiter = this.getBottleneckForProvider(providerRef, protocolKind);\n const jobId = `${agent.ref}-image-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n const result: any = await limiter.schedule({ id: jobId }, () => generateImage(genArgs));\n\n const rawImages: any[] = Array.isArray(result?.images) && result.images.length > 0\n ? result.images\n : (result?.image ? [result.image] : []);\n const images = rawImages\n .filter((img) => img && typeof img.base64 === 'string')\n .map((img) => ({\n base64: img.base64 as string,\n mediaType: typeof img.mediaType === 'string' ? img.mediaType : 'image/png',\n }));\n\n const output: ImageProvider_GenerateImageOutput = { images };\n return { output };\n }\n\n private resolveAgentExecution(agent: FlowsActors_Agent): ResolvedAgentExecution {\n const providerRef = agent.config.providerRef;\n const operationKey = agent.config.operationKey as LLMProvider_OperationKey;\n const executionProfileRef = agent.config.executionProfileRef;\n\n // The CODING arm resolves first and by its own arm, not by the presence of\n // an `executionProfileRef`. Both transports use that field, so ordering by\n // it would route a coding agent into the CLI branch and fail obscurely.\n if (isCodingAgentConfiguration(agent.config)) {\n const codingConfig = agent.config;\n const acpExecutionProfileRef = codingConfig.executionProfileRef;\n const executionProtocolKind = ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL;\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, executionProtocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n protocolKind: executionProtocolKind,\n executionProfileRef: acpExecutionProfileRef,\n message: 'Agent Client Protocol is not enabled for the selected provider',\n },\n });\n }\n\n const acpProfile = this.externalProvidersRegistry.getAgentClientProtocolProfile(providerRef);\n const acpExecutionProfile = this.externalProvidersRegistry.getAgentClientProtocolExecutionProfile(\n providerRef,\n acpExecutionProfileRef,\n );\n if (!acpProfile || !acpExecutionProfile) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n executionProfileRef: acpExecutionProfileRef,\n message: 'ACP protocol metadata or execution profile not found in provider configuration',\n },\n });\n }\n\n return {\n transport: 'acp',\n providerRef,\n operationKey: codingConfig.operationKey,\n executionProfileRef: acpExecutionProfileRef,\n acpProfile,\n acpExecutionProfile,\n };\n }\n\n const semanticProtocolKind = ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER;\n if (!this.externalProvidersRegistry.isProviderEnabled(providerRef, semanticProtocolKind)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_ENABLED,\n context: {\n providerRef,\n protocolKind: semanticProtocolKind,\n }\n });\n }\n\n const supportedLLMOperations = this.externalProvidersRegistry.getLLMSemanticOperationKeys(providerRef);\n if (supportedLLMOperations.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.NOT_FOUND, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_PROVIDER_NOT_FOUND,\n context: {\n providerRef,\n }\n });\n }\n\n if (!supportedLLMOperations.includes(operationKey)) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_OPERATION_NOT_SUPPORTED,\n context: {\n providerRef,\n operationKey,\n }\n });\n }\n\n return {\n transport: 'api',\n providerRef,\n operationKey,\n llmProviderConfig: this.externalProvidersRegistry.getProviderConfiguration(\n providerRef,\n semanticProtocolKind,\n ) as LLMProvider_Configuration | undefined,\n };\n }\n\n private async buildExecutionPrompts(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>\n ): Promise<CompiledExecutionPrompts> {\n const rawInstructions = this.extractRawInstructions(request.input);\n\n if (agent.promptSpec) {\n const compiled = await this.buildCompiledPrompts(agent, request, rawInstructions);\n return {\n systemPrompt: compiled.systemPrompt,\n instructions: compiled.userPrompt,\n };\n }\n\n return {\n systemPrompt: this.buildSystemPrompt(agent, request),\n instructions: rawInstructions,\n };\n }\n\n private extractRawInstructions(input: unknown): string {\n if (typeof input === 'object' && input !== null) {\n if ('prompt' in input && typeof input.prompt === 'string') {\n return input.prompt;\n }\n\n if ('messages' in input && Array.isArray(input.messages)) {\n const userMessages = (input.messages as any[]).filter((message: any) => message.role === 'user');\n return userMessages\n .map((message: any) => typeof message.content === 'string' ? message.content : JSON.stringify(message.content))\n .join('\\n');\n }\n\n return JSON.stringify(input);\n }\n\n return String(input);\n }\n\n /**\n * Resolve the AI-SDK provider client for an API-transport LLM call (shared by\n * the buffered and streaming API paths): fetch the provider API key\n * (fail-closed if missing) and build the SDK client (fail-closed if the\n * provider is not available).\n */\n private async resolveApiProviderClient(providerRef: string): Promise<any> {\n const apiKey = this.externalProvidersRegistry.getProviderApiKey(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n );\n if (!apiKey) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n message: 'API key not found for provider. Please configure the provider secrets in application configuration.'\n }\n });\n }\n\n const aiProvider = await this.getAIProvider(providerRef, apiKey);\n if (!aiProvider) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n providerRef,\n message: 'AI SDK provider not available'\n }\n });\n }\n return aiProvider;\n }\n\n private async executeAgentViaApi(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n execution: Extract<ResolvedAgentExecution, { transport: 'api' }>,\n prompts: CompiledExecutionPrompts\n ): Promise<AgentExecutionResult> {\n const aiProvider = await this.resolveApiProviderClient(execution.providerRef);\n\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER\n );\n const jobId = `${agent.ref}-api-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling API call through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n operationKey: execution.operationKey,\n model: agent.config.model,\n jobId,\n currentQueueSize: limiter.queued(),\n currentRunning: limiter.running(),\n usesPromptCompiler: !!agent.promptSpec,\n });\n\n const result = await limiter.schedule(\n { id: jobId },\n () => this.executeOperation({\n providerClient: aiProvider,\n providerRef: execution.providerRef,\n config: agent.config,\n operationKey: execution.operationKey,\n systemPrompt: prompts.systemPrompt,\n instructions: prompts.instructions,\n input: request.input,\n llmProviderConfig: execution.llmProviderConfig,\n })\n );\n\n return {\n ...result,\n transport: {\n kind: LLMProvider_ExecutionTransportKind.API,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n providerRef: execution.providerRef,\n model: agent.config.model,\n },\n };\n }\n\n /**\n * Get AI SDK provider client configured with API key.\n *\n * Looks up the provider's `LLM_PROVIDER` runtime contract on the\n * backend provider registry, narrows by `kind: ProviderProtocolRuntimeKind.LLM`, and invokes the\n * `sdkFactory` declared on the contract. Per the framework principle\n * (provider behavior lives on the provider module), there is NO\n * `switch (providerRef)` here: adding a new LLM provider only requires\n * authoring its module with an `sdkFactory`.\n *\n * Returns the provider client (typically `{ languageModel(model): … }`)\n * or `null` when the provider has no LLM_PROVIDER binding (i.e. the\n * caller asked for an LLM client of a non-LLM provider).\n */\n private async getAIProvider(providerRef: string, apiKey: string): Promise<any> {\n try {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.LLM) {\n return null;\n }\n return await binding.runtimeContract.sdkFactory(apiKey);\n } catch (error) {\n this.logger.error('Failed to initialize AI provider', { providerRef, ...projectCaughtErrorLogFields(error) });\n throw error;\n }\n }\n\n /**\n * The autonomy a run actually gets: the LOWER of what the profile permits and\n * what the invocation asked for. An invocation can only narrow.\n */\n private resolveEffectivePermissionCeiling(\n profile: AgentClientProtocol_ExecutionProfile,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n ): AgentClientProtocol_PermissionCeiling {\n const requested = (request.input as { requestedPermissionCeiling?: AgentClientProtocol_PermissionCeiling } | undefined)\n ?.requestedPermissionCeiling;\n if (\n requested === undefined\n || !Object.values(AgentClientProtocol_PermissionCeiling).includes(requested)\n ) {\n return profile.permissionCeiling;\n }\n return agentClientProtocolPermissionCeilingRank(requested)\n < agentClientProtocolPermissionCeilingRank(profile.permissionCeiling)\n ? requested\n : profile.permissionCeiling;\n }\n\n /**\n * The environment gate for the ACP transport — the guard that keeps a\n * workspace-mutating agent out of production. Checked before the limiter and\n * before any spawn.\n */\n private validateAgentClientProtocolPolicy(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): void {\n const applicationEnv = (process.env.APPLICATION_ENV || APPLICATION_ENVIRONMENT.DEVELOPMENT) as APPLICATION_ENVIRONMENT;\n const platformEnvironmentId = process.env.PLATFORM_ENVIRONMENT_ID;\n const { acpExecutionProfile } = execution;\n\n if (!acpExecutionProfile.allowedApplicationEnvironments.includes(applicationEnv)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n applicationEnv,\n allowedApplicationEnvironments: acpExecutionProfile.allowedApplicationEnvironments,\n message: 'ACP execution profile is not allowed in the current application environment',\n },\n });\n }\n\n if (\n acpExecutionProfile.allowedPlatformEnvironmentIds?.length\n && (!platformEnvironmentId || !acpExecutionProfile.allowedPlatformEnvironmentIds.includes(platformEnvironmentId))\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n platformEnvironmentId,\n allowedPlatformEnvironmentIds: acpExecutionProfile.allowedPlatformEnvironmentIds,\n message: 'ACP execution profile is not allowed in the current platform environment',\n },\n });\n }\n }\n\n /**\n * Compose the prompt a subprocess-hosted agent receives on its single input\n * channel: the system prompt, then the instructions.\n */\n private buildSubprocessPromptInput(prompts: CompiledExecutionPrompts): string {\n if (!prompts.systemPrompt.trim()) {\n return prompts.instructions;\n }\n\n return [\n '[SYSTEM]',\n prompts.systemPrompt,\n '',\n '[TASK]',\n prompts.instructions,\n ].join('\\n');\n }\n\n /**\n * The child environment for a spawned agent: a minimal identity allowlist plus\n * exactly what the profile names.\n *\n * Never full `process.env` inheritance — the process that spawns the agent\n * holds platform secrets that must not reach it.\n */\n private buildSubprocessBaseEnvironment(\n inheritedEnvironmentVariables: readonly string[] | undefined,\n ): NodeJS.ProcessEnv {\n const env: NodeJS.ProcessEnv = {};\n for (const envKey of new Set<string>([...SUBPROCESS_BASE_INHERITED_ENV_KEYS, ...(inheritedEnvironmentVariables ?? [])])) {\n const envValue = process.env[envKey];\n if (envValue !== undefined) {\n env[envKey] = envValue;\n }\n }\n return env;\n }\n\n private buildAgentClientProtocolEnvironment(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): NodeJS.ProcessEnv {\n // UNION of what the AGENT needs and what the APPLICATION asks for.\n //\n // The two lists answer different questions and only one of them is policy.\n // Which variable an agent reads to locate its own credentials is PROVIDER\n // knowledge — an application cannot be expected to know that Claude Code\n // resolves its login through `CLAUDE_CONFIG_DIR` — so a provider-declared\n // variable must reach every profile, including the ones applications author\n // themselves. Before this, the contract's list was projected ONLY into the\n // synthesized `default` profile, which the dogfood application deliberately\n // never selects; the declaration was therefore inert exactly where it\n // mattered, and the agent failed to authenticate with `OAuth session expired\n // and could not be refreshed` — a message that is false and sends every\n // diagnosis at the credential rather than at the environment.\n const env = this.buildSubprocessBaseEnvironment([\n ...(execution.acpProfile.inheritedEnvironmentVariables ?? []),\n ...(execution.acpExecutionProfile.inheritedEnvironmentVariables ?? []),\n ]);\n\n if (execution.acpExecutionProfile.authMode === AgentClientProtocol_AuthMode.SECRET_REF_ENV_INJECTION) {\n const secretEnvVarName = execution.acpExecutionProfile.secretEnvVarName;\n const secret = this.externalProvidersRegistry.getAgentClientProtocolExecutionProfileSecret(\n execution.providerRef,\n execution.executionProfileRef,\n );\n if (!secretEnvVarName || !secret) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n message: 'ACP execution profile declares secret injection but its secret could not be resolved',\n },\n });\n }\n env[secretEnvVarName] = secret;\n }\n\n return env;\n }\n\n /**\n * Whether the LLM provider's contract requests strict JSON Schema\n * enforcement on AI-SDK structured-output calls. Read from the runtime\n * contract (`structuredOutputs.strictJsonSchema`) — never branched on\n * `providerRef`. Today only OpenAI sets this; if more providers need\n * it, they declare the flag on their own module.\n */\n private llmProviderRequestsStrictJsonSchema(providerRef: string): boolean | null {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.LLM) {\n return null;\n }\n const declared = binding.runtimeContract.structuredOutputs?.strictJsonSchema;\n // `null` means the provider declares no opinion, so no option is sent and the SDK default applies.\n // `false` is an OPINION and must be sent: omitting it lets the SDK default back to strict, which is\n // how a contract that reads `strictJsonSchema: false` still produced strict-mode request rejections.\n return declared === undefined ? null : declared;\n }\n\n /**\n * Execute a CODING agent over an ACP session.\n *\n * Carries the SAME FOUR responsibilities as {@link executeAgentViaCLI}, and\n * they are listed here because the transport swap is exactly where one of\n * them would be quietly dropped:\n *\n * 1. rate limiting through the provider's Bottleneck limiter;\n * 2. the ENVIRONMENT GATE — the guard that keeps a workspace-mutating agent\n * out of production;\n * 3. prompt composition from the agent's compiled prompts and the request;\n * 4. result normalisation into the published coding-agent output contract.\n */\n /**\n * The agent-specific `_meta` for `session/new`, resolved from the AUTHORED\n * host-configuration posture.\n *\n * Fails CLOSED. If the profile asks for an isolation posture this provider\n * declares no translation for, the session is refused rather than opened with\n * whatever the agent defaults to — which, measured against Claude's adapter,\n * means the operator's entire personal configuration. The field used to be\n * authored, defaulted and documented as a safety posture while being read by\n * nothing at all; refusing is what makes it mean something.\n *\n * `HOST_INHERITED` needs no translation: inheriting everything is what an\n * agent does when told nothing.\n */\n private resolveAgentClientProtocolSessionMeta(\n execution: Extract<ResolvedAgentExecution, { transport: 'acp' }>,\n ): Record<string, unknown> | undefined {\n const posture = execution.acpExecutionProfile.hostConfigurationInheritance;\n const byPosture = execution.acpProfile.sessionMetaExtensionsByHostConfigurationInheritance;\n const translated = byPosture?.[posture];\n\n if (translated) {\n // An application-authored `sessionMetaExtensions` layers ON TOP: the\n // posture decides isolation, the authored value carries anything else the\n // application wants to pass, and neither silently replaces the other.\n return { ...translated, ...(execution.acpExecutionProfile.sessionMetaExtensions ?? {}) };\n }\n\n if (posture !== AgentClientProtocol_HostConfigurationInheritance.HOST_INHERITED) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n hostConfigurationInheritance: posture,\n message:\n 'ACP provider declares no translation for the authored host-configuration posture, '\n + 'so the requested isolation cannot be honoured and the session is refused.',\n },\n });\n }\n\n return execution.acpExecutionProfile.sessionMetaExtensions ?? execution.acpProfile.sessionMetaExtensions;\n }\n\n /**\n * What THIS agent's provider declares about escalating before it mutates.\n *\n * Read from the ACP runtime contract on the provider binding — never branched\n * on `providerRef`, and deliberately not taken from the projected\n * `AgentClientProtocol_Profile`: this is a measured PROVIDER FACT about an\n * agent's behaviour, not application-authored policy, and it must not sit\n * anywhere an application configuration could merge over it.\n *\n * `undefined` means the provider has no ACP binding at all, which the caller\n * has already refused by the time this runs.\n */\n private resolveAgentClientProtocolPermissionEscalation(\n providerRef: string,\n ): AgentClientProtocolPermissionEscalationDeclaration | undefined {\n const binding = this.backendProviderRegistryService.getProtocolBinding(\n providerRef,\n ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL,\n );\n if (!binding || binding.runtimeContract.kind !== ProviderProtocolRuntimeKind.AGENT_CLIENT_PROTOCOL) {\n return undefined;\n }\n return binding.runtimeContract.permissionEscalation;\n }\n\n /**\n * Can Wildo's in-flight guards fire for the session this run is about to open?\n *\n * Answered from the provider's declaration AND from the environment actually\n * composed for the child, because for a conditionally-escalating agent those\n * are two different facts: the agent escalates only if the pointer to its\n * permission configuration really arrives, and a declaration that it \"must be\n * supplied\" is not evidence that anything supplied it.\n *\n * The environment is inspected rather than trusted for the same reason the\n * runner judges a permission request rather than the agent's session mode:\n * the thing that decides behaviour is what the child receives.\n */\n private resolveAgentClientProtocolInFlightGuardAvailability(\n escalation: AgentClientProtocolPermissionEscalationDeclaration | undefined,\n childEnvironment: NodeJS.ProcessEnv,\n ): { behaviour?: AgentClientProtocol_PermissionEscalationBehaviour; canFire: boolean; missingConfigurationEnvironmentVariable?: string } {\n if (!escalation) {\n // No declaration reachable. Assume the guards CANNOT fire: this field is\n // required on the contract, so its absence means a provider shape this\n // build does not understand, and reporting an unverified \"yes\" is the one\n // answer that could make an operator trust a ceiling that is not there.\n return { canFire: false };\n }\n const supplied =\n escalation.behaviour === AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION\n ? childEnvironment[escalation.configurationEnvironmentVariableName] !== undefined\n : false;\n const canFire = agentClientProtocolInFlightGuardsCanFire(escalation.behaviour, supplied);\n return {\n behaviour: escalation.behaviour,\n canFire,\n ...(!canFire\n && escalation.behaviour === AgentClientProtocol_PermissionEscalationBehaviour.RAISES_ONLY_UNDER_HOST_CONFIGURATION\n ? { missingConfigurationEnvironmentVariable: escalation.configurationEnvironmentVariableName }\n : {}),\n };\n }\n\n private async executeAgentViaACP(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n hostContext?: AgentInvocationHostContext,\n ): Promise<AgentExecutionResult> {\n const execution = this.resolveAgentExecution(agent);\n if (execution.transport !== 'acp') {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n agentRef: agent.ref,\n providerRef: agent.config.providerRef,\n message: 'Coding agent did not resolve to an ACP execution',\n },\n });\n }\n\n const { acpExecutionProfile, acpProfile } = execution;\n\n // (2) Environment gate — BEFORE the limiter, before any spawn.\n this.validateAgentClientProtocolPolicy(execution);\n\n // The requested model must be one the transport declares. Validated here\n // rather than at the session, so a mis-pinned model fails before an agent\n // is started rather than after it has begun editing.\n const requestedModel = agent.config.model;\n if (!acpProfile.supportedModels.includes(requestedModel)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n requestedModel,\n supportedModels: acpProfile.supportedModels,\n message: 'ACP profile does not declare support for the selected semantic model',\n },\n });\n }\n\n // The authored auth posture must be one the AGENT can actually use.\n //\n // `authModes` was consulted only when synthesizing the provider's `default`\n // execution profile, so an application authoring its own — which the dogfood\n // application does deliberately — could declare any mode and nothing\n // checked it. Both directions are silently wrong rather than loud: a profile\n // declaring HOST_MANAGED against a secret-injecting agent starts a run with\n // no credential, and one declaring SECRET_REF_ENV_INJECTION against a\n // host-managed agent injects a secret the agent ignores while the\n // application believes the run is credentialed by configuration.\n //\n // Normalised on both sides at projection time; comparing the contract's\n // hyphenated spelling against the enum's underscored one is a guard that\n // never fires.\n const supportedAuthModes = acpProfile.supportedAuthModes;\n if (supportedAuthModes && !supportedAuthModes.includes(acpExecutionProfile.authMode)) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n authoredAuthMode: acpExecutionProfile.authMode,\n supportedAuthModes: [...supportedAuthModes],\n message:\n 'The authored ACP execution profile declares an authentication mode this provider\\'s agent '\n + 'does not support, so the session is refused rather than started with a credential posture '\n + 'the agent will not honour.',\n },\n });\n }\n\n const workingDirectory = resolveTrustedWorkingDirectory({\n workspaceRootPath: hostContext?.workspaceRootPath,\n usesRelativePath:\n acpExecutionProfile.workingDirectoryPolicy === AgentClientProtocol_WorkingDirectoryPolicy.WORKSPACE_RELATIVE_PATH,\n relativePath: acpExecutionProfile.workingDirectoryRelativePath,\n });\n\n // (3) Prompt composition — the same compiled prompts every transport gets.\n const prompts = await this.buildExecutionPrompts(agent, request);\n const prompt = this.buildSubprocessPromptInput(prompts);\n\n // (1) Rate limiting, keyed on the ACP protocol so a coding session and an\n // HTTP completion against the same provider do not share one bucket.\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL,\n );\n const jobId = `${agent.ref}-acp-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling ACP coding session through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: acpExecutionProfile.permissionCeiling,\n workingDirectory,\n jobId,\n });\n\n const sessionMetaExtensions = this.resolveAgentClientProtocolSessionMeta(execution);\n\n const effectivePermissionCeiling = this.resolveEffectivePermissionCeiling(acpExecutionProfile, request);\n const permissionEscalation = this.resolveAgentClientProtocolPermissionEscalation(execution.providerRef);\n\n return limiter.schedule({ id: jobId }, async () => {\n const env = this.buildAgentClientProtocolEnvironment(execution);\n /*\n * Does this run's authored ceiling mean anything for THIS agent?\n *\n * Both of Wildo's in-flight controls — the permission ceiling and the\n * task's mutation scope — are enforced in the client's ANSWER to\n * `session/request_permission`. An agent that does not ask is bound by\n * neither. Measured: Codex never asks before an in-workspace write (its\n * safety model is a sandbox), and OpenCode does not either unless the host\n * points it at a permission configuration file.\n *\n * The agents stay ADMISSIBLE. Refusing a tool because its architecture\n * differs is exactly the hard ceremony the application-creation directive\n * rejects, and the dogfood lane's `UNRESTRICTED` profile — which asks for\n * no gate and gets none — runs unchanged through this branch.\n *\n * What is refused is a CONTRADICTION: a profile that authored a ceiling\n * narrower than UNRESTRICTED, i.e. that asked for some autonomy to be\n * withheld, against an agent from which nothing can be withheld. Running\n * it anyway would not be permissive, it would be false — the ceiling would\n * be a label, the mutation scope would never be consulted, and the only\n * account of what the run touched would be a change set taken afterwards\n * while the configuration said a gate was in place.\n *\n * The same shape as this transport's two existing refusals, and for the\n * same reason: `resolveAgentClientProtocolSessionMeta` refuses an isolation\n * posture the provider cannot express, and `modelDelivery` refuses a model\n * that could not reach the agent. A declared safety field that cannot be\n * honoured must refuse rather than be silently ignored; that is what makes\n * it mean something. The door is one word wide and always open —\n * `permissionCeiling: UNRESTRICTED` states plainly that this run has no\n * in-flight gate, which is the truth either way.\n */\n const guardAvailability = this.resolveAgentClientProtocolInFlightGuardAvailability(permissionEscalation, env);\n if (!guardAvailability.canFire && effectivePermissionCeiling !== AgentClientProtocol_PermissionCeiling.UNRESTRICTED) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: effectivePermissionCeiling,\n permissionEscalation: guardAvailability.behaviour,\n ...(guardAvailability.missingConfigurationEnvironmentVariable\n ? { missingConfigurationEnvironmentVariable: guardAvailability.missingConfigurationEnvironmentVariable }\n : {}),\n message:\n 'This agent does not raise a permission request before mutating, so the authored permission '\n + 'ceiling and the task mutation scope cannot be enforced in flight and the session is refused '\n + 'rather than run under a ceiling that would be a label. '\n + (guardAvailability.missingConfigurationEnvironmentVariable\n ? `Supply ${guardAvailability.missingConfigurationEnvironmentVariable} in the child environment `\n + '(name it in the execution profile\\'s `inheritedEnvironmentVariables`, pointing at a permission '\n + 'configuration OUTSIDE the application workspace), or author `permissionCeiling: UNRESTRICTED`.'\n : 'Author `permissionCeiling: UNRESTRICTED` to state that this run has no in-flight gate, or '\n + 'select an agent whose provider declares that it escalates before mutating.'),\n },\n });\n }\n // Stated at session open, beside the ceiling, so an operator watching a run\n // start learns whether anything stands between the agent and the workspace\n // — rather than learning it afterwards from a warning about a change set.\n this.logDebug('Opening ACP coding session', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n permissionCeiling: effectivePermissionCeiling,\n permissionEscalation: guardAvailability.behaviour ?? null,\n inFlightPermissionGuardsCanFire: guardAvailability.canFire,\n });\n // DELIVER the model, through the channel THIS agent's provider declares.\n //\n // Until 2026-09-03 `requestedModel` was checked against the transport's\n // declared set and written into the transport metadata — and never reached\n // the spawned agent, so under HOST_MANAGED auth every session ran at the\n // OPERATOR's personal default model (measured: Opus, during a 529-overload\n // storm the agent definitions' declared model would have avoided).\n //\n // The first fix wrote `ANTHROPIC_MODEL` unconditionally from this\n // agent-NEUTRAL service, which is correct for exactly one adapter and a\n // silent no-op for every other: the same false result, one agent later.\n // So the channel is declared by the provider that knows its agent, and a\n // provider that declares none cannot have a model selected at all —\n // refused here rather than started with the choice quietly dropped.\n const modelDelivery = acpProfile.modelDelivery;\n // The model is VALIDATED as a semantic id and DELIVERED in the agent's own\n // spelling. Both halves matter: validation against `supportedModels` is\n // what refuses a mis-pinned model before an agent is spawned, and the\n // translation is what lets a multi-vendor agent — whose ids carry the\n // provider, `anthropic/claude-sonnet-5` — be addressed at all. Absent\n // means the two vocabularies coincide, which is the common case.\n const deliveredModel = acpProfile.modelTransportIds?.[requestedModel] ?? requestedModel;\n let modelSelection: { configId: string; model: string } | undefined;\n if (modelDelivery?.channel === 'environment-variable') {\n env[modelDelivery.environmentVariableName] = deliveredModel;\n } else if (modelDelivery?.channel === 'session-config-option') {\n // Set over ACP after the session opens; the runner fails the session if\n // the agent rejects it, before any prompt reaches the workspace.\n modelSelection = { configId: modelDelivery.configId, model: deliveredModel };\n } else {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n requestedModel,\n message:\n 'ACP provider declares no model-delivery channel, so the selected model cannot reach the '\n + 'agent and the session is refused rather than run at the agent\\'s own default.',\n },\n });\n }\n // A run that ANSWERS a parked session resumes it by id via `session/load`\n // instead of starting a fresh task; the input's prompt is then the answer.\n const continuationOfSessionId = (request.input as { continuationOfSessionId?: string } | undefined)\n ?.continuationOfSessionId;\n\n // (4) Open the live session, then drive it turn-by-turn.\n const agentSession = await startACPAgentSession({\n // The application may override how the agent is started, but normally\n // inherits it: the provider owns the package and its pinned version.\n command: acpExecutionProfile.command ?? acpProfile.agentCommand,\n args: acpExecutionProfile.command ? acpExecutionProfile.args : acpProfile.agentArgs,\n cwd: workingDirectory,\n env,\n supportedProtocolVersions: acpProfile.supportedProtocolVersions,\n // The invocation may request LESS autonomy than the profile allows; it\n // can never request more. Clamped by rank rather than by trusting the\n // request, so an input carrying a higher ceiling is lowered, not obeyed.\n //\n // Resolved ONCE, above, and reused here: the guard-availability refusal\n // just above decides on this exact value, and re-deriving it per use\n // would let the value that was CHECKED and the value the session RUNS\n // under drift apart — the whole class of defect this lane keeps meeting.\n permissionCeiling: effectivePermissionCeiling,\n // Agent-vocabulary mode ids from the provider contract. Absent is fine —\n // the ceiling is enforced by answering permission requests, never by the\n // agent's mode — but a map hardcoded in the runner silently matched\n // nothing for any agent but the one it was written for.\n ...(acpProfile.sessionModeIdsByPermissionCeiling?.[effectivePermissionCeiling]\n ? {\n preferredSessionModeIds:\n acpProfile.sessionModeIdsByPermissionCeiling[effectivePermissionCeiling],\n }\n : {}),\n ...(modelSelection ? { modelSelection } : {}),\n ...(hostContext?.isPermittedCodingLocation\n ? { isPermittedLocation: hostContext.isPermittedCodingLocation }\n : {}),\n ...(sessionMetaExtensions ? { sessionMetaExtensions } : {}),\n ...(acpExecutionProfile.maximumRecordedEventBytes !== undefined\n ? { maxRecordedEventBytes: acpExecutionProfile.maximumRecordedEventBytes }\n : {}),\n ...(hostContext?.onCodingSessionEvent ? { onEvent: hostContext.onCodingSessionEvent } : {}),\n ...(continuationOfSessionId ? { resumeSessionId: continuationOfSessionId } : {}),\n });\n\n try {\n const ladder = await this.driveCodingTurnLadder({\n session: agentSession,\n firstPrompt: prompt,\n maxAutoContinuations: acpExecutionProfile.maxAutoContinuations,\n awaitingInputTtlMs: acpExecutionProfile.awaitingInputTtlMs,\n ...(acpExecutionProfile.turnTimeoutMs !== undefined ? { turnTimeoutMs: acpExecutionProfile.turnTimeoutMs } : {}),\n ...(hostContext?.codingSessionAbortSignal ? { abortSignal: hostContext.codingSessionAbortSignal } : {}),\n ...(hostContext?.classifyCodingTurnEnd ? { classify: hostContext.classifyCodingTurnEnd } : {}),\n ...(hostContext?.onCodingSessionStateChange ? { onStateChange: hostContext.onCodingSessionStateChange } : {}),\n });\n\n // (5) Result normalisation into the published contract.\n const output: CodingAgent_RunTaskOutput = {\n finalMessage: ladder.finalMessage,\n stopReason: ladder.stopReason,\n ...(ladder.rawStopReason ? { rawStopReason: ladder.rawStopReason } : {}),\n // Always emitted, including zero: absence would be indistinguishable\n // from \"no denials\", and under the strictest ceiling that is exactly the\n // distinction an operator needs.\n deniedPermissionCount: ladder.deniedPermissionCount,\n permissionDecisions: ladder.permissionDecisions,\n ...(ladder.reportedFileLocations.length > 0\n ? { reportedFileLocations: ladder.reportedFileLocations }\n : {}),\n // Absent means one turn — the single-turn shape every pre-ladder\n // consumer already assumes.\n ...(ladder.turnCount > 1 ? { turnCount: ladder.turnCount } : {}),\n ...(ladder.continuations.length > 0 ? { continuations: ladder.continuations } : {}),\n // Present ONLY when the run parked on a question — the field that stops\n // a suspended turn being read as a completed result.\n ...(ladder.suspension ? { suspension: ladder.suspension } : {}),\n };\n\n return {\n output,\n transport: {\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL as const,\n providerRef: execution.providerRef,\n executionProfileRef: execution.executionProfileRef,\n model: requestedModel,\n negotiatedProtocolVersion: agentSession.negotiatedProtocolVersion,\n ...(agentSession.agentName ? { agentName: agentSession.agentName } : {}),\n ...(agentSession.agentVersion ? { agentVersion: agentSession.agentVersion } : {}),\n ...(agentSession.sessionModeId ? { sessionModeId: agentSession.sessionModeId } : {}),\n // Recorded on the run because the ceiling alone does not describe it.\n // A change set produced under a ceiling that could be enforced and one\n // produced under a ceiling that was inert look identical afterwards,\n // and this pair is the only thing that tells a later reader whether\n // anything stood between the agent and these files.\n ...(guardAvailability.behaviour ? { permissionEscalation: guardAvailability.behaviour } : {}),\n inFlightPermissionGuardsCanFire: guardAvailability.canFire,\n sessionId: agentSession.sessionId,\n },\n ...(ladder.usage ? { usage: ladder.usage } : {}),\n } satisfies AgentExecutionResult;\n } finally {\n // Closes on completion AND on park: a parked session is answered by a\n // fresh invocation that resumes it via `session/load`, never by holding\n // this child alive across the HTTP call that returned the question.\n agentSession.close();\n }\n });\n }\n\n private extractCLITextOutput(output: unknown): string {\n if (typeof output === 'string') {\n return output;\n }\n\n if (this.isRecord(output)) {\n if (typeof output.result === 'string') {\n return output.result;\n }\n if (typeof output.text === 'string') {\n return output.text;\n }\n if (typeof output.output === 'string') {\n return output.output;\n }\n if (typeof output.content === 'string') {\n return output.content;\n }\n }\n\n return JSON.stringify(output ?? '');\n }\n\n\n /**\n * Build system prompt from agent configuration\n *\n * If agent has promptSpec, uses the PromptCompiler for structured prompt building.\n * Otherwise, falls back to legacy skill-based prompt building.\n */\n private buildSystemPrompt(agent: FlowsActors_Agent, request: FlowsActors_Agent_Invocation<any, any, any>): string {\n const parts: string[] = [];\n\n if (agent.promptSpec.role) {\n parts.push(`Role: ${agent.promptSpec.role}`);\n }\n\n if (agent.promptSpec.persona) {\n parts.push(`Persona: ${agent.promptSpec.persona}`);\n }\n\n if (request.executionContext) {\n parts.push(`Context: ${JSON.stringify(request.executionContext)}`);\n }\n\n return parts.join('\\n\\n');\n }\n\n /**\n * Build prompts using the PromptCompiler when agent has promptSpec\n * Returns compiled system and user prompts\n */\n private async buildCompiledPrompts(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n instructions: string\n ): Promise<{ systemPrompt: string; userPrompt: string }> {\n if (!agent.promptSpec) {\n // Fall back to legacy mode\n return {\n systemPrompt: this.buildSystemPrompt(agent, request),\n userPrompt: instructions,\n };\n }\n\n this.logDebug('Building compiled prompts using PromptCompiler', {\n agentRef: agent.ref,\n hasInstructions: agent.promptSpec.instructions.length > 0,\n hasHints: !!agent.promptSpec.hints?.length,\n hasCuration: !!agent.promptSpec.curation,\n });\n\n // Build context items from execution context\n // Note: User input is NOT added here - it goes in the user prompt section, not context\n const contextItems: PromptIR_ContextItem[] = [];\n\n if (request.executionContext) {\n contextItems.push({\n id: 'exec_context',\n content: JSON.stringify(request.executionContext, null, 2),\n trust: PromptIR_TrustLevel.HIGH,\n sourceKind: PromptIR_ContextSourceKind.RELATIONSHIP,\n timestamp: new Date().toISOString(),\n });\n }\n\n // Compile using the prompt compiler - works directly with agent + invocation\n const compiled = await this.promptCompiler.compile(\n agent,\n request,\n contextItems,\n instructions\n );\n\n this.logDebug('Prompts compiled', {\n agentRef: agent.ref,\n format: compiled.format,\n systemPromptLength: compiled.systemPrompt.length,\n userPromptLength: compiled.userPrompt.length,\n tokenEstimates: compiled.tokenEstimates,\n });\n\n return {\n systemPrompt: compiled.systemPrompt,\n userPrompt: compiled.userPrompt,\n };\n }\n\n /**\n * Execute operation based on operation key\n * Dispatches to specific operation handlers\n */\n private async executeOperation({ providerClient, providerRef, config, operationKey, systemPrompt, instructions, input, llmProviderConfig }: executeOperationParams): Promise<AgentOperationExecutionResult> {\n const model = this.getModelFromProvider(providerClient, config.model);\n // executeOperation is only reached on the LLM/text path (image agents\n // branch to executeImageAgent in executeAgent), so the config is the LLM arm.\n const baseOptions = this.buildBaseOptions(config as FlowsActors_Agent_LLMConfiguration);\n\n try {\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT:\n return await this.executeGenerateText({ model, systemPrompt, instructions, baseOptions });\n\n case LLMProvider_OperationKey.CHAT_COMPLETION:\n return await this.executeChatCompletion({ model, systemPrompt, instructions, input, baseOptions });\n\n case LLMProvider_OperationKey.CHAT_MULTIMODAL:\n return await this.executeChatMultimodal({ model, systemPrompt, instructions, input, baseOptions });\n\n case LLMProvider_OperationKey.GENERATE_STRUCTURED:\n return await this.executeGenerateStructured({\n model,\n systemPrompt,\n instructions,\n input,\n baseOptions,\n llmProviderConfig,\n providerRef,\n structuredGenerationExecutionMode: (config as FlowsActors_Agent_LLMConfiguration).structuredGenerationExecutionMode,\n maximumStructuredOutputLeafFields: (config as FlowsActors_Agent_LLMConfiguration).maximumStructuredOutputLeafFields,\n });\n\n case LLMProvider_OperationKey.STREAM_TEXT:\n return await this.executeStreamText({ model, systemPrompt, instructions, baseOptions });\n\n case LLMProvider_OperationKey.STREAM_STRUCTURED:\n return await this.executeStreamStructured({ model, systemPrompt, instructions, baseOptions });\n\n default:\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_OPERATION_NOT_SUPPORTED,\n context: {\n // diagnostic (log-only)\n operationKey,\n supportedOperations: Object.values(LLMProvider_OperationKey),\n },\n }\n );\n }\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n // Extract detailed provider error information\n const errorDetails = this.extractProviderErrorDetails(error);\n\n // Log detailed error information\n this.logger.error('Operation execution failed - provider error details', {\n operationKey,\n model: config.model,\n providerRef: (providerClient as any)?.providerRef || 'unknown',\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operationKey,\n model: config.model,\n message: `Failed to execute operation ${operationKey}: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Get model instance from provider client\n */\n private getModelFromProvider(providerClient: any, modelName: string): any {\n if (providerClient && typeof providerClient.languageModel === 'function') {\n try {\n return providerClient.languageModel(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via languageModel()', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via languageModel() method`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n if (typeof providerClient === 'function') {\n try {\n return providerClient(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via function call', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via provider function`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n if (providerClient && typeof providerClient.model === 'function') {\n try {\n return providerClient.model(modelName);\n } catch (error) {\n this.logger.error('Failed to get model via model()', {\n modelName,\n ...projectCaughtErrorLogFields(error),\n });\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.VALIDATION,\n context: {\n modelName,\n message: `Failed to initialize model ${modelName} via model() method`,\n originalError: describeCaughtError(error),\n stack: error instanceof Error ? error.stack : undefined,\n },\n }\n );\n }\n }\n\n this.logger.error('Failed to get model from provider client', {\n providerType: typeof providerClient,\n providerKeys: providerClient ? Object.keys(providerClient).slice(0, 10) : [],\n hasLanguageModel: typeof providerClient?.languageModel === 'function',\n hasModel: typeof providerClient?.model === 'function',\n isFunction: typeof providerClient === 'function',\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_MODEL_INITIALIZATION_FAILED,\n context: {\n // diagnostic (log-only)\n modelName,\n providerType: typeof providerClient,\n hasLanguageModel: typeof providerClient?.languageModel === 'function',\n hasModel: typeof providerClient?.model === 'function',\n isFunction: typeof providerClient === 'function',\n },\n }\n );\n }\n\n /**\n * Build base options for LLM operations\n */\n /**\n * Wall-clock deadline for ONE structured-generation provider call.\n *\n * Without it the call is unbounded: measured 2026-08-20, a `top_down.market-analysis` generation was\n * dispatched and had still not returned TWELVE HOURS later. Nothing timed it out, so the Driver never\n * received a result, the Task-terminalization queue behind it never drained, and the next boot's startup\n * drain inherited the stall. An unbounded provider call is therefore not just a slow call -- it is a\n * durable queue that cannot be reconciled.\n *\n * The value is generous because these payloads are large (market analysis emits ~47k characters), and the\n * point is to bound the pathological case, not to police normal latency. On expiry the SDK aborts the\n * HTTP request, so the provider connection is actually released rather than merely abandoned; the model\n * adapter translates the abort into the TIMEOUT failure kind the retry policy already understands.\n */\n private static readonly STRUCTURED_GENERATION_DEADLINE_MS = 900_000;\n\n /**\n * The one prompt sent to auto-continue a coding agent past a self-imposed\n * pause. Named here rather than improvised at the call site so a run's\n * continuations are all identical and auditable, and so the wording — which\n * tells the agent to keep working AND to stop only when genuinely done or\n * genuinely blocked — lives in exactly one place.\n */\n private static readonly CODING_AUTO_CONTINUE_PROMPT =\n 'Continue with the task. Do not stop to ask whether to proceed — keep going until the task is '\n + 'genuinely complete. Only stop if you have finished, or if you need a decision or input that '\n + 'only the operator can provide, in which case state the specific question plainly.';\n\n /** Characters of an end-of-turn message kept on a continuation record for audit. */\n private static readonly CONTINUATION_MESSAGE_TAIL_CHARS = 500;\n\n /**\n * Drive a coding session turn-by-turn: continue a self-imposed pause, park a\n * genuine question, settle on completion — bounded by the profile's\n * continuation budget.\n *\n * The MECHANISM lives here; the JUDGMENT (`classify`) is the host's. The whole\n * loop fails toward settlement: any terminal stop reason, an exhausted budget,\n * or a classifier that is absent or throws all end the run with what the agent\n * has produced rather than hanging. A `NEEDS_INPUT` classification is the only\n * path that returns a `suspension`, and the caller must not read that as a\n * completed result.\n */\n private async driveCodingTurnLadder(params: {\n session: ACPAgentSession;\n firstPrompt: string;\n maxAutoContinuations: number;\n awaitingInputTtlMs: number;\n turnTimeoutMs?: number;\n abortSignal?: AbortSignal;\n classify?: AgentInvocationHostContext['classifyCodingTurnEnd'];\n onStateChange?: AgentInvocationHostContext['onCodingSessionStateChange'];\n }): Promise<{\n finalMessage: string;\n stopReason: CodingAgent_StopReason;\n rawStopReason?: string;\n usage?: CodingAgent_Usage;\n reportedFileLocations: string[];\n deniedPermissionCount: number;\n permissionDecisions: NonNullable<CodingAgent_RunTaskOutput['permissionDecisions']>;\n turnCount: number;\n continuations: CodingAgent_ContinuationRecord[];\n suspension?: CodingAgent_SessionSuspension;\n }> {\n const { session } = params;\n const reportedFileLocations: string[] = [];\n // Copied into the OUTPUT's mutable element shape here: the runner hands out\n // readonly records, and the published contract's field is mutable.\n const permissionDecisions: NonNullable<CodingAgent_RunTaskOutput['permissionDecisions']> = [];\n const continuations: CodingAgent_ContinuationRecord[] = [];\n let usage: CodingAgent_Usage | undefined;\n let deniedPermissionCount = 0;\n let turnIndex = 0;\n let autoContinuesUsed = 0;\n let prompt = params.firstPrompt;\n\n const emitState = (state: CodingSessionLadderState): void => {\n try {\n params.onStateChange?.(state);\n } catch {\n // A live-relay sink must never fail the run it observes.\n }\n };\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n turnIndex += 1;\n emitState({ phase: CodingSessionLadderPhase.RUNNING, turnIndex });\n\n const turn = await session.promptTurn(prompt, {\n ...(params.turnTimeoutMs !== undefined ? { turnTimeoutMs: params.turnTimeoutMs } : {}),\n ...(params.abortSignal ? { abortSignal: params.abortSignal } : {}),\n });\n\n // Aggregate every turn's evidence, whatever the ladder decides next.\n for (const path of turn.reportedFileLocations) {\n if (!reportedFileLocations.includes(path)) reportedFileLocations.push(path);\n }\n for (const decision of turn.permissionDecisions) {\n permissionDecisions.push({\n ...decision,\n locations: [...decision.locations],\n offeredOptionKinds: [...decision.offeredOptionKinds],\n });\n }\n deniedPermissionCount += turn.deniedPermissionCount;\n usage = this.mergeCodingUsage(usage, turn.usage);\n\n const settle = (suspension?: CodingAgent_SessionSuspension) => ({\n finalMessage: turn.finalMessage,\n stopReason: turn.stopReason,\n ...(turn.rawStopReason ? { rawStopReason: turn.rawStopReason } : {}),\n usage,\n reportedFileLocations,\n deniedPermissionCount,\n permissionDecisions,\n turnCount: turnIndex,\n continuations,\n ...(suspension ? { suspension } : {}),\n });\n\n // A non-voluntary stop (cancelled, max_tokens, refusal, or a reason this\n // version does not recognise) is terminal: there is nothing to continue.\n if (turn.stopReason !== CodingAgent_StopReason.END_TURN) {\n return settle();\n }\n\n // END_TURN: decide what it meant. No classifier → treat as complete AND\n // record nothing (the pre-ladder behaviour, preserved for every caller\n // that supplies none — a plain single turn carries no continuations).\n if (!params.classify) {\n return settle();\n }\n const classification = await this.classifyCodingTurnEndSafely(params.classify, turn.finalMessage, turnIndex);\n\n // A boundary is recorded only when the classifier was actually consulted,\n // so `continuations` is the audit trail of judgments, never a per-run\n // artefact that pollutes the single-turn shape.\n continuations.push({\n turnIndex,\n classification,\n agentMessageTail: turn.finalMessage.slice(-AgentsBackendService.CONTINUATION_MESSAGE_TAIL_CHARS),\n });\n\n if (classification === CodingAgent_EndOfTurnClassification.NEEDS_INPUT) {\n const suspension: CodingAgent_SessionSuspension = {\n sessionId: session.sessionId,\n question: turn.finalMessage,\n turnIndex,\n // Answerable across the child's death only if the agent persists sessions.\n resumable: session.capabilities.loadSession,\n parkedUntil: new Date(Date.now() + params.awaitingInputTtlMs).toISOString(),\n };\n emitState({ phase: CodingSessionLadderPhase.AWAITING_INPUT, turnIndex, question: turn.finalMessage });\n return settle(suspension);\n }\n\n const isSelfPause = classification === CodingAgent_EndOfTurnClassification.SELF_PAUSE;\n if (!isSelfPause || autoContinuesUsed >= params.maxAutoContinuations) {\n // TASK_COMPLETE, CLASSIFIER_UNAVAILABLE, or a self-pause past the budget:\n // settle with what the agent last produced.\n return settle();\n }\n\n autoContinuesUsed += 1;\n prompt = AgentsBackendService.CODING_AUTO_CONTINUE_PROMPT;\n }\n }\n\n /**\n * Run the host's end-of-turn classifier, mapping every failure to\n * `CLASSIFIER_UNAVAILABLE` so the ladder can settle rather than hang.\n *\n * The whole point of a separate method: the fail-open contract is one place,\n * and an unexpected classifier value (a host returning a string outside the\n * enum) degrades the same way a throw does.\n */\n private async classifyCodingTurnEndSafely(\n classify: NonNullable<AgentInvocationHostContext['classifyCodingTurnEnd']>,\n finalMessage: string,\n turnIndex: number,\n ): Promise<CodingAgent_EndOfTurnClassification> {\n try {\n const result = await classify({ finalMessage, turnIndex });\n if (Object.values(CodingAgent_EndOfTurnClassification).includes(result)) {\n return result;\n }\n this.logger.warn('Coding turn-end classifier returned an unrecognised value; treating the turn as complete', {\n turnIndex,\n received: String(result),\n });\n return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;\n } catch (error) {\n // Fail OPEN. An auxiliary judgment must never make the autonomous lane hang\n // or discard a mutated workspace; the failure is recorded, not laundered.\n this.logger.warn('Coding turn-end classifier failed; treating the turn as complete', {\n turnIndex,\n // A WildoBackendError does not pass `instanceof Error`, and String() on it is\n // \"[object Object]\" — which is exactly what this warn printed while the classifier was\n // refusing every call over a missing config bound (2026-09-04). Bounded JSON names it.\n error: error instanceof Error\n ? error.message\n : (() => { try { return JSON.stringify(error)?.slice(0, 600) ?? String(error); } catch { return String(error); } })(),\n });\n return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;\n }\n }\n\n /**\n * Combine per-turn usage into a session total: token counts and cost SUM\n * across turns; the context-window pair is a snapshot, so the latest turn's\n * value wins. Absence stays absence — a field nobody reported must not read as\n * zero, per the usage contract.\n */\n private mergeCodingUsage(\n accumulated: CodingAgent_Usage | undefined,\n turn: CodingAgent_Usage | undefined,\n ): CodingAgent_Usage | undefined {\n if (!turn) return accumulated;\n if (!accumulated) return turn;\n const merged: CodingAgent_Usage = { ...accumulated };\n for (const key of ['inputTokens', 'outputTokens', 'cachedReadTokens', 'cachedWriteTokens', 'totalTokens'] as const) {\n const a = accumulated[key];\n const b = turn[key];\n if (a !== undefined || b !== undefined) merged[key] = (a ?? 0) + (b ?? 0);\n }\n // The context window is a level, not a flow: the newest reading is current.\n if (turn.contextUsed !== undefined) merged.contextUsed = turn.contextUsed;\n if (turn.contextWindowSize !== undefined) merged.contextWindowSize = turn.contextWindowSize;\n if (turn.cost || accumulated.cost) {\n merged.cost = {\n amount: (accumulated.cost?.amount ?? 0) + (turn.cost?.amount ?? 0),\n currency: turn.cost?.currency ?? accumulated.cost?.currency ?? 'USD',\n };\n }\n return merged;\n }\n\n private buildBaseOptions(config: FlowsActors_Agent_LLMConfiguration): any {\n const baseOptions: any = {\n temperature: config.temperature,\n topP: config.topP,\n };\n\n // Only set maxOutputTokens if explicitly configured\n if (config.maxTokens !== undefined) {\n baseOptions.maxOutputTokens = config.maxTokens;\n }\n\n if (config.seed !== undefined) {\n baseOptions.seed = config.seed;\n }\n\n // Reasoning-effort control (Phase 3): the config enum values mirror the AI\n // SDK 7 top-level `reasoning` option exactly, so this is a direct pass-through.\n // The SDK maps it to each provider's native reasoning setting; non-reasoning\n // models ignore it. Omitted → provider default (pre-Phase-3 behavior).\n if (config.reasoningEffort !== undefined) {\n baseOptions.reasoning = config.reasoningEffort;\n }\n\n // The agent's system prompt is passed via the top-level `instructions:` option of EVERY\n // generateText/streamText call (see `executeGenerateText` and the chat builders below) — AI-SDK v7\n // (`ai@7.0.29`) rejects a `role:'system'` entry inside `messages`/`prompt`, and `buildChatMessages`\n // keeps the messages array system-free. Do NOT re-introduce a \"system in messages\" opt-in flag here:\n // a prior `baseOptions.allowSystemInMessages = true` was a SILENT NO-OP (that is not the real option\n // name — the v7 flag is the terse `l` param), which is exactly why every chat turn kept failing with\n // `AI_InvalidPromptError` until the system prompt was hoisted to `instructions:`.\n\n return baseOptions;\n }\n\n /**\n * Execute GENERATE_TEXT operation\n */\n private async executeGenerateText({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await generateText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n text: result.text,\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Generate text operation failed - provider response', {\n operation: 'GENERATE_TEXT',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_TEXT',\n message: `Failed to generate text: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute CHAT_COMPLETION operation\n */\n private async executeChatCompletion({ model, systemPrompt, instructions, input, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const messages = this.buildChatMessages(instructions, input);\n\n const result = await generateText({\n model,\n messages,\n // System prompt via the top-level option (AI-SDK v7 forbids it inside `messages`).\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: result.text,\n },\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Chat completion operation failed - provider response', {\n operation: 'CHAT_COMPLETION',\n hasSystemPrompt: !!systemPrompt,\n hasInputMessages: input && typeof input === 'object' && 'messages' in input,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'CHAT_COMPLETION',\n message: `Failed to complete chat: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute CHAT_MULTIMODAL operation\n */\n private async executeChatMultimodal({ model, systemPrompt, instructions, input, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n let messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> = [];\n\n try {\n if (input && typeof input === 'object' && 'messages' in input && Array.isArray(input.messages)) {\n // System prompt travels via the top-level `instructions:` option; drop any\n // `role:'system'` entries (AI-SDK v7 rejects them inside `messages`).\n messages = input.messages.filter((m: any) => m.role !== 'system');\n } else {\n messages.push({ role: 'user', content: instructions });\n }\n\n if (messages.length === 0) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_MESSAGES_REQUIRED,\n context: {\n // diagnostic (log-only)\n operation: 'CHAT_MULTIMODAL',\n },\n }\n );\n }\n\n const result = await generateText({\n model,\n messages: this.normalizeSdkMessages(messages),\n // System prompt via the top-level option (AI-SDK v7 forbids it inside `messages`).\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n return {\n output: {\n message: {\n role: LLMProvider_MessageRole.ASSISTANT,\n content: result.text,\n },\n },\n usage: this.extractUsage(result.usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Chat multimodal operation failed - provider response', {\n operation: 'CHAT_MULTIMODAL',\n hasSystemPrompt: !!systemPrompt,\n hasInputMessages: input && typeof input === 'object' && 'messages' in input,\n messagesCount: messages.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'CHAT_MULTIMODAL',\n message: `Failed to complete multimodal chat: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Read the OPTIONAL vision image parts off a GENERATE_STRUCTURED invocation\n * input (see `LLMProvider_GenerateStructuredInputSchema.images`). Returns `[]`\n * when none are present so the caller stays on the plain text-prompt path.\n * Defensive at the boundary: only well-formed `{ type: 'image', image }` parts\n * (non-empty string locator) survive; anything else is dropped rather than\n * handed to the SDK as a broken content part.\n */\n private extractStructuredInputImages(input: unknown): LLMProvider_ImageContent[] {\n if (!this.isRecord(input) || !Array.isArray(input.images)) {\n return [];\n }\n return (input.images as unknown[]).filter(\n (part): part is LLMProvider_ImageContent =>\n this.isRecord(part)\n && part.type === 'image'\n && typeof part.image === 'string'\n && part.image.length > 0,\n );\n }\n\n /**\n * Build the AI-SDK content argument for a structured-generation call.\n *\n * With no images this is a plain `{ prompt }` (text-only structured\n * generation — the historical behaviour, byte-identical). With images it\n * becomes a single multimodal user `{ messages: [...] }` whose content is the\n * instruction text followed by each image part, so the AI SDK feeds the pixels\n * to a vision-capable model (e.g. `gpt-4o`) and constrains the answer to the\n * requested schema. `system` is passed separately by the caller and is not\n * duplicated here.\n */\n private buildStructuredContentArgs(\n instructions: string,\n images: LLMProvider_ImageContent[],\n ): { prompt: string } | { messages: Array<{ role: 'user'; content: Array<Record<string, unknown>> }> } {\n if (images.length === 0) {\n return { prompt: instructions };\n }\n return {\n messages: [\n {\n role: 'user',\n content: [\n { type: 'text', text: instructions },\n ...images.map((part) => this.toSdkFilePart(part.image)),\n ],\n },\n ],\n };\n }\n\n /**\n * Translate our internal image locator (`LLMProvider_ImageContent.image` — a\n * data URI or URL) into an AI SDK v7 **file content part**.\n *\n * WHY: the SDK's `{ type: 'image', image }` content part was deprecated in v7\n * (it warns on every call and becomes a hard error in a future major). The v7\n * shape is `{ type: 'file', data, mediaType }`. This is the ONE translation\n * seam — our own `{ type: 'image', image }` domain vocabulary\n * ({@link LLMProvider_ImageContentSchema}) is intentionally kept; only the\n * SDK-facing emission changes.\n *\n * `mediaType` is required by the file part. We derive the concrete type from a\n * data URI when present (the case both internal producers actually emit —\n * they build `data:image/<fmt>;base64,…`); for a bare URL we sniff the\n * extension and fall back to the generic `image/*` the SDK itself suggests.\n */\n private toSdkFilePart(image: string): { type: 'file'; data: string; mediaType: string } {\n return { type: 'file', data: image, mediaType: this.deriveImageMediaType(image) };\n }\n\n /** Best-effort image media-type from a data URI or URL; generic `image/*` if unknown. */\n private deriveImageMediaType(image: string): string {\n const dataUri = /^data:(image\\/[^;]+)[;,]/i.exec(image);\n if (dataUri) return dataUri[1].toLowerCase();\n const ext = /\\.(png|jpe?g|gif|webp|bmp|svg|avif|tiff?)(?:[?#]|$)/i.exec(image);\n if (ext) {\n const e = ext[1].toLowerCase();\n if (e === 'jpg' || e === 'jpeg') return 'image/jpeg';\n if (e === 'svg') return 'image/svg+xml';\n if (e === 'tif' || e === 'tiff') return 'image/tiff';\n return `image/${e}`;\n }\n return 'image/*';\n }\n\n /**\n * Rewrite any legacy `{ type: 'image', image }` parts inside caller-supplied\n * CHAT_MULTIMODAL messages into v7 file parts, leaving every other part\n * untouched. Defensive: the internal producers route images through the\n * structured path above, but CHAT_MULTIMODAL forwards opaque caller `messages`\n * verbatim, so a caller passing the deprecated shape would otherwise leak it\n * to the SDK. Fail-open on unexpected shapes — never drop a caller's content.\n */\n private normalizeSdkMessages(\n messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }>,\n ): Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> {\n return messages.map((message) => {\n if (!Array.isArray(message.content)) return message;\n const content = message.content.map((part) =>\n this.isRecord(part) && part.type === 'image' && typeof part.image === 'string'\n ? this.toSdkFilePart(part.image)\n : part,\n );\n return { ...message, content };\n });\n }\n\n /**\n * Execute GENERATE_STRUCTURED operation\n */\n private async executeGenerateStructured({\n model,\n systemPrompt,\n instructions,\n input,\n baseOptions,\n llmProviderConfig,\n providerRef,\n structuredGenerationExecutionMode,\n maximumStructuredOutputLeafFields,\n }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n input: any;\n baseOptions: any;\n llmProviderConfig?: LLMProvider_Configuration;\n providerRef: string;\n structuredGenerationExecutionMode?: StructuredGenerationExecutionMode;\n maximumStructuredOutputLeafFields?: number;\n }): Promise<AgentOperationExecutionResult> {\n try {\n if (!input || typeof input !== 'object' || !('schema' in input) || !input.schema) {\n throw this.errorBuilder.buildError(\n ErrorType.VALIDATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.AGENT_STRUCTURED_SCHEMA_REQUIRED,\n context: {\n // diagnostic (log-only)\n operation: 'GENERATE_STRUCTURED',\n hasInput: !!input,\n inputType: typeof input,\n hasSchema: input && typeof input === 'object' && 'schema' in input,\n },\n }\n );\n }\n\n const schema = input.schema;\n const images = this.extractStructuredInputImages(input);\n if (\n structuredGenerationExecutionMode === StructuredGenerationExecutionMode.SINGLE_CALL_REQUIRED\n && (!Number.isSafeInteger(maximumStructuredOutputLeafFields) || (maximumStructuredOutputLeafFields ?? 0) <= 0)\n ) {\n throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'A single-call structured agent requires one positive immutable maximumStructuredOutputLeafFields value.',\n },\n });\n }\n const maxFields = maximumStructuredOutputLeafFields\n ?? llmProviderConfig?.maxStructuredDataFieldAllowed\n ?? DEFAULT_MAX_STRUCTURED_DATA_FIELD_ALLOWED;\n const isOpenAI = this.llmProviderRequestsStrictJsonSchema(providerRef);\n\n const shapePlan = planStructuredGenerationShape(schema, maxFields);\n\n this.logDebug('Checking if schema needs chunking', {\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n needsChunking: shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.CHUNKED,\n unchunkableOverLimit: shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.UNCHUNKABLE_OVER_LIMIT,\n isOpenAI,\n imageCount: images.length,\n });\n\n if (\n structuredGenerationExecutionMode === StructuredGenerationExecutionMode.SINGLE_CALL_REQUIRED\n && shapePlan.planKind !== MetaWorkflowStructuredGenerationPlanKind.SINGLE_CALL\n ) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'The registered agent requires one physical provider call, but the output schema requires chunking.',\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n },\n });\n }\n\n if (shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.UNCHUNKABLE_OVER_LIMIT) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: 'The output schema exceeds the provider field limit and its root semantics cannot be preserved across chunks.',\n leafFieldCount: shapePlan.leafFieldCount,\n maxFields,\n },\n });\n }\n\n if (shapePlan.planKind === MetaWorkflowStructuredGenerationPlanKind.CHUNKED) {\n return await this.executeGenerateStructuredChunked({\n model,\n systemPrompt,\n instructions,\n images,\n schema,\n baseOptions,\n maxFields,\n leafFieldCount: shapePlan.leafFieldCount,\n schemaChunks: shapePlan.schemaChunks,\n isOpenAI,\n });\n } else {\n return await this.executeGenerateStructuredSingle({\n model,\n systemPrompt,\n instructions,\n images,\n schema,\n baseOptions,\n isOpenAI,\n });\n }\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Generate structured operation failed - provider response', {\n operation: 'GENERATE_STRUCTURED',\n hasSchema: input && typeof input === 'object' && 'schema' in input,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute structured generation with chunking - runs chunks in parallel\n */\n private async executeGenerateStructuredChunked({ model, systemPrompt, instructions, images, schema, baseOptions, maxFields, leafFieldCount, schemaChunks, isOpenAI }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n images: LLMProvider_ImageContent[];\n schema: z.ZodSchema<any>;\n baseOptions: any;\n maxFields: number;\n leafFieldCount: number;\n schemaChunks: readonly z.ZodSchema[];\n isOpenAI: boolean | null;\n }): Promise<AgentOperationExecutionResult> {\n try {\n this.logDebug('Chunking structured generation - parallel execution', {\n totalLeafFields: leafFieldCount,\n maxFields,\n chunks: schemaChunks.length,\n isOpenAI,\n });\n\n // Execute all chunks in parallel using Promise.all\n const chunkPromises = schemaChunks.map(async (chunkSchema, index) => {\n try {\n this.logDebug(`Starting structured chunk ${index + 1}/${schemaChunks.length}`);\n\n const chunkResult = await generateObject({\n model,\n mode: \"json\",\n instructions: systemPrompt,\n schema: chunkSchema,\n abortSignal: AbortSignal.timeout(AgentsBackendService.STRUCTURED_GENERATION_DEADLINE_MS),\n ...this.buildStructuredContentArgs(instructions, images),\n ...baseOptions,\n ...(isOpenAI === null ? {} : {\n providerOptions: {\n openai: {\n strictJsonSchema: isOpenAI,\n },\n },\n }),\n });\n\n this.logDebug(`Completed structured chunk ${index + 1}/${schemaChunks.length}`);\n\n return {\n index,\n object: chunkResult.object as Record<string, unknown>,\n usage: this.extractUsage(chunkResult.usage),\n failure: null as unknown,\n };\n } catch (error) {\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error(`Failed to generate structured chunk ${index + 1}/${schemaChunks.length} - provider response`, {\n operation: 'GENERATE_STRUCTURED',\n chunkIndex: index,\n totalChunks: schemaChunks.length,\n ...errorDetails,\n });\n\n // Same rule the single-call path states: a structured-generation failure carrying provider\n // usage IS a completed physical call, so throwing here discards billable truth. This site\n // used to throw, and it cost a live application its budget allocation PERMANENTLY -- the\n // discarded usage made the settlement ACCOUNTING_UNVERIFIABLE, which fail-closes every later\n // admission on that allocation, and a Work Cycle's allocation is bootstrapped once for the\n // application's life. The provider had reported exact usage on the very error we then called\n // unverifiable (6,680 input / 3,521 output tokens, with the cache-write split).\n //\n // Returning rather than throwing also keeps the SIBLING chunks' metering, which `Promise.all`\n // would otherwise drop on the floor along with this one.\n return {\n index,\n object: null,\n usage: this.extractUsage(\n typeof error === 'object' && error !== null && 'usage' in error\n ? (error as { usage: unknown }).usage\n : undefined,\n ),\n failure: error as unknown,\n };\n }\n });\n\n // Wait for all chunks to complete in parallel\n const chunkResultsWithMeta = await Promise.all(chunkPromises);\n\n // Sort by index to ensure consistent merge order, then extract objects\n const chunkResults = chunkResultsWithMeta\n .sort((a, b) => a.index - b.index)\n .flatMap(r => (r.object === null ? [] : [r.object]));\n\n // Aggregate usage from all chunks\n const totalUsage = chunkResultsWithMeta.reduce(\n (acc, r) => ({\n promptTokens: acc.promptTokens + r.usage.promptTokens,\n completionTokens: acc.completionTokens + r.usage.completionTokens,\n totalTokens: acc.totalTokens + r.usage.totalTokens,\n tokenUsageComplete: acc.tokenUsageComplete && r.usage.tokenUsageComplete,\n }),\n { promptTokens: 0, completionTokens: 0, totalTokens: 0, tokenUsageComplete: true }\n );\n const exactInputTokenDetails = chunkResultsWithMeta.every((result) =>\n result.usage.inputTokenDetails?.noCacheTokens !== undefined\n && result.usage.inputTokenDetails.cacheReadTokens !== undefined\n && result.usage.inputTokenDetails.cacheWriteTokens !== undefined,\n )\n ? {\n noCacheTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.noCacheTokens!, 0),\n cacheReadTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.cacheReadTokens!, 0),\n cacheWriteTokens: chunkResultsWithMeta.reduce((total, result) => total + result.usage.inputTokenDetails!.cacheWriteTokens!, 0),\n }\n : undefined;\n\n // Aggregate metering FIRST (above), then decide the outcome: a partially-failed chunked call is\n // still a set of completed, billable physical calls, and the Driver must be able to account for\n // every one of them before it classifies the missing object.\n const failedChunk = chunkResultsWithMeta.find((result) => result.object === null);\n if (failedChunk !== undefined) {\n const failureError = failedChunk.failure as { cause?: unknown; finishReason?: unknown; text?: unknown };\n return {\n output: { object: undefined },\n usage: {\n ...totalUsage,\n ...(exactInputTokenDetails === undefined ? {} : { inputTokenDetails: exactInputTokenDetails }),\n },\n structuredGenerationFailure: this.buildStructuredGenerationFailure(\n typeof failedChunk.failure === 'object' && failedChunk.failure !== null && 'usage' in failedChunk.failure\n ? LLMProvider_StructuredGenerationFailureKind.INVALID_OBJECT_AFTER_COMPLETED_CALL\n : LLMProvider_StructuredGenerationFailureKind.NO_OBJECT_GENERATED,\n failedChunk.failure,\n failureError,\n ),\n };\n }\n\n const mergedResult = this.mergeChunkedObjects(chunkResults);\n\n this.logDebug('All structured chunks completed and merged', {\n chunks: schemaChunks.length,\n totalUsage,\n });\n\n return {\n output: {\n object: mergedResult,\n },\n usage: {\n ...totalUsage,\n ...(exactInputTokenDetails === undefined ? {} : { inputTokenDetails: exactInputTokenDetails }),\n },\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data with chunking: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Assemble the caller-facing reason a structured generation produced no object.\n *\n * Carries NO generated text — only `generatedTextLength`, which separates a truncated\n * completion from an empty one without disclosing content. `validationIssues` is\n * likewise `code` + `path` only, for the same reason (see\n * {@link projectStructuredValidationIssues}).\n *\n * The chunked path calls this too. It used to throw a typed backend error instead, on the\n * reasoning that the reason \"already reaches the caller intact\" -- true of the REASON and false\n * of the USAGE, which is what the budget settles against. See the failure branch in\n * {@link executeGenerateStructuredChunked} for what that cost.\n */\n private buildStructuredGenerationFailure(\n kind: LLMProvider_StructuredGenerationFailureKind,\n error: unknown,\n providerError: { cause?: unknown; finishReason?: unknown; text?: unknown },\n ): LLMProvider_StructuredGenerationFailure {\n const errorName = error instanceof Error\n ? error.name\n : (typeof error === 'object' && error !== null && 'name' in error && typeof error.name === 'string'\n ? error.name\n : typeof error);\n const cause = providerError.cause;\n const validationCauseName = cause instanceof Error\n ? cause.name\n : (typeof cause === 'object' && cause !== null && 'name' in cause && typeof cause.name === 'string'\n ? cause.name\n : typeof cause);\n const validationIssues = projectStructuredValidationIssues(cause);\n // ROOT KEY NAMES, and only when the failure is `unrecognized_keys`.\n //\n // Zod 4 builds that issue at two sites and only one carries `keys` (v4/core/schemas.js:748 vs :1352);\n // the path taken here is the one that omits them, so the issue reports \"some unknown key exists at the\n // root\" and nothing more. That is undiagnosable: a single stray key discards a 40,000-character result\n // and there is no way to learn which key it was.\n //\n // The boundary this function holds is about VALUES: the rejected content must never reach a log. Root\n // KEY NAMES of a schema-driven generation are schema shape, are compared against a schema the reader\n // already has, and are emitted only on this one failure code -- never for `invalid_type`,\n // `invalid_format` or any issue whose path could name user content.\n const rootKeys = validationIssues.some((issue) => issue.code === 'unrecognized_keys')\n ? projectStructuredRootKeyNames(providerError.text)\n : undefined;\n return {\n kind,\n message: describeCaughtError(error),\n errorName,\n validationCauseName,\n ...(validationIssues.length > 0\n ? {\n validationIssues: validationIssues.map((issue) => ({\n code: issue.code,\n path: [...issue.path],\n ...(issue.keys ? { keys: [...issue.keys] } : {}),\n })),\n }\n : {}),\n ...(rootKeys && rootKeys.length > 0 ? { rootKeys: [...rootKeys] } : {}),\n ...(typeof providerError.finishReason === 'string' ? { finishReason: providerError.finishReason } : {}),\n generatedTextLength: typeof providerError.text === 'string' ? providerError.text.length : null,\n };\n }\n\n /**\n * Execute structured generation without chunking\n */\n private async executeGenerateStructuredSingle({ model, systemPrompt, instructions, images, schema, baseOptions, isOpenAI }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n images: LLMProvider_ImageContent[];\n schema: z.ZodSchema<any>;\n baseOptions: any;\n isOpenAI: boolean | null;\n }): Promise<AgentOperationExecutionResult> {\n try {\n this.logDebug('Generating structured normally', {\n hasSchema: !!schema,\n instructionsLength: instructions.length,\n hasSystemPrompt: !!systemPrompt,\n isOpenAI,\n imageCount: images.length,\n });\n\n const result = await generateObject({\n model,\n mode: \"json\",\n instructions: systemPrompt,\n schema,\n abortSignal: AbortSignal.timeout(AgentsBackendService.STRUCTURED_GENERATION_DEADLINE_MS),\n ...this.buildStructuredContentArgs(instructions, images),\n ...baseOptions,\n ...(isOpenAI === null ? {} : {\n providerOptions: {\n openai: {\n strictJsonSchema: isOpenAI,\n },\n },\n }),\n });\n\n return {\n output: {\n object: result.object,\n },\n usage: this.extractUsage(result.usage),\n // The THIRD path that can hand a caller `{ object: undefined }`, and the one the\n // two catch arms below hide: `generateObject` RESOLVING with no object at all.\n // That is off-contract for the AI SDK — `object` is declared non-optional and\n // absence is signalled by throwing — but nothing here validates that, so leaving\n // it unattached would put a hole in the vocabulary's own invariant (every path\n // that returns no object says why), precisely where a caller has the least other\n // evidence: no error was raised, so `finishReason` and a validation cause do not\n // exist either. Attaching it costs one comparison on the success path and keeps\n // \"no `structuredGenerationFailure`\" meaning \"there IS an object\".\n ...(result.object === undefined\n ? {\n structuredGenerationFailure: {\n kind: LLMProvider_StructuredGenerationFailureKind.RESOLVED_WITHOUT_OBJECT,\n message: 'The structured-generation call resolved without raising, but carried no object.',\n generatedTextLength: null,\n } satisfies LLMProvider_StructuredGenerationFailure,\n }\n : {}),\n };\n } catch (error) {\n // Any structured-generation failure that carries provider usage represents a\n // completed physical call. Preserve its metering and let the Driver classify\n // the missing/invalid object; throwing here would discard billable truth.\n if (typeof error === 'object' && error !== null && 'usage' in error) {\n const providerError = error as { cause?: unknown; finishReason?: unknown; text?: unknown; usage: unknown };\n // Do not log the generated text: it can contain application-private\n // context. The error/cause and non-sensitive shape metadata are enough\n // to distinguish truncation, schema validation and provider refusal.\n // Previously this branch retained billing but erased the only reason a\n // real model result became `{ object: undefined }`, making live judge\n // failures impossible to diagnose.\n // The SAME facts go to the log line and to the caller. Logging them only was the\n // second half of the defect this branch already documents: the reason existed, but\n // exclusively inside the process's own log file, so a caller could report nothing\n // more specific than \"no object\" and an operator had to grep the companion log for\n // the line above to learn which schema paths the model had omitted.\n const structuredGenerationFailure = this.buildStructuredGenerationFailure(\n LLMProvider_StructuredGenerationFailureKind.INVALID_OBJECT_AFTER_COMPLETED_CALL,\n error,\n providerError,\n );\n this.logger.error('Structured generation completed without a valid object', {\n operation: 'GENERATE_STRUCTURED',\n errorName: structuredGenerationFailure.errorName,\n errorMessage: structuredGenerationFailure.message,\n validationCauseName: structuredGenerationFailure.validationCauseName,\n validationIssues: structuredGenerationFailure.validationIssues,\n finishReason: structuredGenerationFailure.finishReason,\n generatedTextLength: structuredGenerationFailure.generatedTextLength,\n });\n return {\n output: { object: undefined },\n usage: this.extractUsage(error.usage),\n structuredGenerationFailure,\n };\n }\n // semantic-literal-boundary: AI SDK cross-realm error identity fallback\n const noObjectError = (\n typeof error === 'object'\n && error !== null\n && (\n // The SDK error's stable payload shape is retained even when bundlers or\n // mocked module realms erase its prototype/name marker.\n ('response' in error && 'finishReason' in error && 'text' in error)\n ||\n ('name' in error && error.name === 'AI_NoObjectGeneratedError')\n || (error as Record<PropertyKey, unknown>)[Symbol.for('vercel.ai.error.AI_NoObjectGeneratedError')] === true\n )\n )\n || error instanceof NoObjectGeneratedError\n || NoObjectGeneratedError.isInstance(error);\n if (noObjectError) {\n // No usage-bearing payload was recognised on the branch above, so no shape metadata\n // was recovered. The reason is still attached — a caller must be able to tell this\n // apart from the validated-and-rejected case, and specifically must NOT read the\n // absent `validationIssues` here as evidence that the schema was satisfied.\n return {\n output: { object: undefined },\n usage: this.extractUsage((error as NoObjectGeneratedError).usage),\n structuredGenerationFailure: this.buildStructuredGenerationFailure(\n LLMProvider_StructuredGenerationFailureKind.NO_OBJECT_GENERATED,\n error,\n error as { cause?: unknown; finishReason?: unknown; text?: unknown },\n ),\n };\n }\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Failed to generate structured data - provider response', {\n operation: 'GENERATE_STRUCTURED',\n hasSchema: !!schema,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'GENERATE_STRUCTURED',\n message: `Failed to generate structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute STREAM_TEXT operation\n */\n private async executeStreamText({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await streamText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n let fullText = '';\n try {\n for await (const chunk of result.textStream) {\n fullText += chunk;\n }\n } catch (streamError) {\n this.logger.error('Failed to read text stream', {\n ...projectCaughtErrorLogFields(streamError),\n textLength: fullText.length,\n });\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_TEXT',\n message: `Failed to read text stream: ${describeCaughtError(streamError)}`,\n originalError: describeCaughtError(streamError),\n stack: streamError instanceof Error ? streamError.stack : undefined,\n },\n }\n );\n }\n\n const usage = await result.usage;\n\n return {\n output: {\n textDelta: fullText,\n },\n usage: this.extractUsage(usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Stream text operation failed - provider response', {\n operation: 'STREAM_TEXT',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_TEXT',\n message: `Failed to stream text: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n /**\n * Execute STREAM_STRUCTURED operation\n */\n private async executeStreamStructured({ model, systemPrompt, instructions, baseOptions }: {\n model: any;\n systemPrompt: string;\n instructions: string;\n baseOptions: any;\n }): Promise<AgentOperationExecutionResult> {\n try {\n const result = await streamText({\n model,\n prompt: instructions,\n instructions: systemPrompt,\n ...baseOptions,\n });\n\n let fullText = '';\n try {\n for await (const chunk of result.textStream) {\n fullText += chunk;\n }\n } catch (streamError) {\n const errorDetails = this.extractProviderErrorDetails(streamError);\n\n this.logger.error('Failed to read structured stream - provider response', {\n operation: 'STREAM_STRUCTURED',\n textLength: fullText.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_STRUCTURED',\n message: `Failed to read structured stream: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n\n const usage = await result.usage;\n\n let parsedOutput: unknown = fullText;\n try {\n parsedOutput = JSON.parse(fullText);\n } catch (parseError) {\n this.logDebug('Failed to parse structured stream as JSON, returning as text', {\n ...projectCaughtErrorLogFields(parseError),\n textLength: fullText.length,\n });\n }\n\n return {\n output: {\n object: parsedOutput,\n },\n usage: this.extractUsage(usage),\n };\n } catch (error) {\n // Re-throw if it's already a built error\n if (isWildoBackendError(error)) {\n throw error;\n }\n\n const errorDetails = this.extractProviderErrorDetails(error);\n\n this.logger.error('Stream structured operation failed - provider response', {\n operation: 'STREAM_STRUCTURED',\n hasSystemPrompt: !!systemPrompt,\n instructionsLength: instructions.length,\n ...errorDetails,\n });\n\n throw this.errorBuilder.buildError(\n ErrorType.INTERNAL,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: {\n operation: 'STREAM_STRUCTURED',\n message: `Failed to stream structured data: ${errorDetails.errorMessage}`,\n ...errorDetails,\n },\n }\n );\n }\n }\n\n // ==========================================================================\n // Honest token streaming (invokeAgentStreaming path)\n // --------------------------------------------------------------------------\n // NOTE: the `executeStreamText` / `executeStreamStructured` methods ABOVE are\n // the BUFFERED fallback for the `STREAM_*` operation keys when invoked through\n // the callback-less `invokeAgent` (there is no delta channel on that path, so\n // they assemble the full result). Real per-token delivery is the block below,\n // reached only via `invokeAgentStreaming`, which forwards each delta as it\n // arrives and never buffer-collapses.\n // ==========================================================================\n\n /**\n * Execute a streaming agent turn: resolve transport + prompts, then stream over\n * the API. Fails closed (typed {@link AgentStreamingUnsupportedError}) for the\n * CLI transport and for image agents — neither produces a token stream in v1.\n */\n private async executeAgentStreaming(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n handlers: AgentStreamHandlers,\n toolContext?: FunctionToolExecutionContext,\n ): Promise<AgentExecutionResult> {\n if (isImageAgentConfiguration(agent.config)) {\n throw new AgentStreamingUnsupportedError('operation', 'Image agents do not produce a token stream.');\n }\n const execution = this.resolveAgentExecution(agent);\n const prompts = await this.buildExecutionPrompts(agent, request);\n if (execution.transport === 'acp') {\n // A coding session DOES stream, but not tokens: it streams tool calls,\n // diffs and usage. Routing it through a token-delta handler would report\n // an agent's narration as if it were the model's output and drop\n // everything that matters. Coding progress is delivered through\n // `AgentInvocationHostContext.onCodingSessionEvent` instead.\n throw new AgentStreamingUnsupportedError('transport', 'Token streaming is not supported for the ACP coding transport; use invokeAgent and observe progress through onCodingSessionEvent.');\n }\n const approvalGatedToolNames = new Set<string>();\n const functionTools = this.resolveAgentTools(agent, toolContext, approvalGatedToolNames);\n /*\n * MCP tools are DISCOVERED, which means a network call per declared server, bounded by that\n * server's discovery budget. A server that does not answer contributes nothing and the turn\n * proceeds — so this cannot fail the invocation, only shorten the tool list.\n */\n const { tools: mcpTools, sessions: mcpSessions } = await this.resolveAgentMcpTools(agent, toolContext);\n const tools = functionTools || Object.keys(mcpTools).length > 0\n ? { ...(functionTools ?? {}), ...mcpTools }\n : undefined;\n const toolApproval = this.buildToolApprovalConfiguration(approvalGatedToolNames, toolContext?.auth?.executionType);\n const toolApprovalSecret = toolApproval ? this.resolveToolApprovalSecretOrThrow(agent, approvalGatedToolNames) : undefined;\n try {\n return await this.executeAgentViaApiStreaming(agent, request, execution, prompts, handlers, tools, toolApproval, toolApprovalSecret);\n } finally {\n /*\n * Released in a `finally` so a thrown turn does not leak a session on somebody else's server.\n * `closeSession` swallows its own failures by contract — a server MAY refuse to let a client\n * end a session — so this can never turn a successful turn into a failed one, nor mask the\n * error of a failing one.\n */\n await Promise.all(mcpSessions.map((session) => this.mcpClient?.closeSession(session, null)));\n }\n }\n\n /**\n * Record one outbound MCP attempt on the audit trail.\n *\n * Fire-and-forget and feature-detected: an absent or failing audit sink must never fail the act it\n * was going to observe. A turn that produced its answer must not be turned into a failure because\n * the trail could not be written — the observation is evidence, not a gate.\n *\n * Emitted for the CALL path always, and for DISCOVERY only when the outbound guard refused the\n * target. That asymmetry is deliberate: a refused target is an attempted egress a reviewer wants\n * beside the calls that succeeded, whereas a server being unreachable or slow is availability, and\n * putting every timeout on the security trail would bury the rows that mean something. Those still\n * reach the log, at WARN, with the same server ref and host.\n */\n private recordMcpAttempt(input: {\n agentRef: string;\n mcpServerRef: string;\n destinationHost: string;\n outcome: McpOutcomeKind;\n toolName?: string;\n connectionOwnerScope?: string;\n credentialId?: string;\n actingIdentity: { userId?: string; organizationId?: string };\n }): void {\n if (!this.auditLogs) return;\n void this.auditLogs.logMcpToolCall({\n mcpServerRef: input.mcpServerRef,\n destinationHost: input.destinationHost,\n toolName: input.toolName,\n outcome: input.outcome,\n connectionOwnerScope: input.connectionOwnerScope,\n credentialId: input.credentialId,\n initiatorUserId: input.actingIdentity.userId,\n organizationId: input.actingIdentity.organizationId,\n agentRef: input.agentRef,\n }).catch((error) => {\n this.logger.warn('Could not record an MCP tool attempt on the audit trail; the turn is unaffected', {\n agentRef: input.agentRef,\n mcpServerRef: input.mcpServerRef,\n ...projectCaughtErrorLogFields(error),\n });\n });\n }\n\n /**\n * Resolve an agent's `capabilities.tools.mcpRefs` into callable tools by DISCOVERING what each\n * declared server offers (#491).\n *\n * ## A server that cannot be reached contributes NOTHING, and the turn continues\n *\n * Fail-closed on the CLAIM, fail-open on the turn. Discovery happens here, at turn start, so a\n * server that is unreachable, whose credential is unavailable, or whose target is refused simply\n * adds no tools — and the model is never offered a capability it cannot use. That is the whole\n * correction #491 exists for, one level down: the agent card advertised MCP servers that resolved\n * to nothing, and the fix is not to advertise more carefully but to make what is offered be what\n * can actually be called.\n *\n * Every one of those is logged at WARN with the server ref and destination HOST. A server quietly\n * unreachable for a week must be visible as that, rather than as an agent that became less capable\n * for no stated reason.\n *\n * ## The tools are NOT the same kind of thing as a functionRef, and are named so\n *\n * A `functionRef` dispatches a LOCAL resource operation and owes that operation's declared roles\n * ACL and rate limit (#556). An MCP tool dispatches nothing locally — it leaves the trust boundary\n * — so those gates have no operation to apply to. What it owes instead is enforced where a caller\n * cannot skip it: the outbound target guard and the timeouts live inside the client, the credential\n * comes from a resolver service, and the endpoint was refused at registration if it was plaintext.\n *\n * The `mcp_<serverRef>_<toolName>` prefix keeps the two planes distinguishable in a trace and\n * prevents a third-party tool name from colliding with a declared `functionRef`.\n *\n * Returns the open sessions so the caller can release them; see `executeAgentStreaming`.\n */\n private async resolveAgentMcpTools(\n agent: FlowsActors_Agent,\n toolContext?: FunctionToolExecutionContext,\n ): Promise<{ tools: Record<string, any>; sessions: McpSession[] }> {\n const mcpRefs = agent.capabilities?.tools?.mcpRefs;\n const empty = { tools: {} as Record<string, any>, sessions: [] as McpSession[] };\n if (!mcpRefs?.length || !toolContext) return empty;\n if (!this.mcpClient || !this.mcpCredentialResolver) {\n // Declared, and this deployment bound no MCP services. Reported rather than silently empty:\n // the agent is about to be less capable than its declaration says, and nothing else would say so.\n this.logger.warn('Agent declares MCP servers but this deployment binds no MCP client; the agent will run without those tools', {\n agentRef: agent.ref,\n mcpRefs,\n });\n return empty;\n }\n\n const actingIdentity = {\n userId: toolContext.auth?.initiatorIds?.userId,\n organizationId: toolContext.organizationId,\n };\n\n const tools: Record<string, any> = {};\n const sessions: McpSession[] = [];\n\n for (const ref of mcpRefs) {\n const server = this.flowsActorsRegistry.getMcpServer(ref);\n if (!server) {\n // The registry refuses this at initialization, so reaching it means the agent was registered\n // afterwards through the public `registerAgent`. Skipped rather than thrown: a turn is the\n // wrong place to fail an application's configuration.\n this.logger.warn('Agent declares an MCP server the application never declared; skipping', { agentRef: agent.ref, mcpRef: ref });\n continue;\n }\n\n const credential = await this.mcpCredentialResolver.resolve(server, actingIdentity);\n if (credential.kind !== McpCredentialOutcomeKind.RESOLVED) {\n this.logger.warn('No credential for a declared MCP server; the agent will run without its tools', {\n agentRef: agent.ref,\n mcpServerRef: ref,\n outcome: credential.kind,\n });\n continue;\n }\n\n const discovery = await this.mcpClient.openSession(server, credential.token);\n if (discovery.kind !== McpOutcomeKind.OK) {\n this.logger.warn('An MCP server contributed no tools to this turn', {\n agentRef: agent.ref,\n mcpServerRef: discovery.mcpServerRef,\n destinationHost: discovery.destinationHost,\n outcome: discovery.kind,\n detail: discovery.detail,\n });\n // A refused TARGET is an attempted egress a guard blocked — a security event, and the row a\n // reviewer wants beside the calls that succeeded. Everything else here is availability.\n if (discovery.kind === McpOutcomeKind.REFUSED_TARGET) {\n this.recordMcpAttempt({\n agentRef: agent.ref,\n mcpServerRef: discovery.mcpServerRef,\n destinationHost: discovery.destinationHost,\n outcome: discovery.kind,\n connectionOwnerScope: credential.source,\n credentialId: credential.credentialId,\n actingIdentity,\n });\n }\n continue;\n }\n\n sessions.push(discovery.session);\n for (const descriptor of discovery.session.tools) {\n const toolName = `mcp_${ref}_${descriptor.name}`.replace(/[^a-zA-Z0-9_-]/g, '_');\n tools[toolName] = tool({\n description: descriptor.description ?? descriptor.title ?? `${server.displayName}: ${descriptor.name}`,\n // The server's own JSON Schema, passed to the model unchanged. Re-deriving it as Zod would\n // be a second description of somebody else's contract, and the two would drift.\n inputSchema: jsonSchema(descriptor.inputSchema as never),\n execute: async (args: any) => {\n const outcome = await this.mcpClient!.callTool(discovery.session, descriptor.name, args ?? {}, credential.token);\n /*\n * Every ATTEMPT is recorded, not only what worked. Recording successes alone would hide\n * exactly what a reviewer looks for first — the refusals, the timeouts, and the tools\n * that answered with their own error.\n */\n this.recordMcpAttempt({\n agentRef: agent.ref,\n mcpServerRef: server.ref,\n destinationHost: mcpServerDestinationHost(server.url),\n outcome: outcome.kind,\n toolName: descriptor.name,\n connectionOwnerScope: credential.source,\n credentialId: credential.credentialId,\n actingIdentity,\n });\n if (outcome.kind === McpOutcomeKind.OK) return outcome.content;\n /*\n * Returned to the MODEL as a result rather than thrown, and the difference is deliberate.\n * A thrown tool error becomes an SDK tool-error result the model narrates as prose, which\n * is how an ACL denial once got narrated as \"I don't have permission to write to that\n * list\" and sent an investigator at the list. A typed value the model can read lets it\n * retry or route around — which is the whole reason these five kinds are kept apart.\n */\n this.logger.warn('An MCP tool call did not succeed; the model is told and may route around it', {\n agentRef: agent.ref,\n mcpServerRef: outcome.mcpServerRef,\n destinationHost: outcome.destinationHost,\n toolName: descriptor.name,\n outcome: outcome.kind,\n detail: outcome.detail,\n });\n return { error: outcome.kind, detail: outcome.detail };\n },\n });\n }\n }\n\n return { tools, sessions };\n }\n\n /**\n * Resolve an agent's declarative `capabilities.tools.functionRefs` into AI-SDK\n * `tool(...)` definitions, closing each over the caller's `toolContext` so the\n * tool executes as the user. Returns `undefined` when the agent declares no\n * tools or no context was supplied (grounding disabled). Unknown refs are\n * skipped with a debug log rather than failing the whole invocation.\n */\n private resolveAgentTools(\n agent: FlowsActors_Agent,\n toolContext?: FunctionToolExecutionContext,\n /** Populated with the identifier-safe names of tools that require a human decision. */\n approvalGatedToolNames: Set<string> = new Set(),\n ): Record<string, any> | undefined {\n const functionRefs = agent.capabilities?.tools?.functionRefs;\n if (!functionRefs?.length || !toolContext) return undefined;\n\n const tools: Record<string, any> = {};\n for (const ref of functionRefs) {\n const functionTool: FunctionTool | undefined = this.flowsActorsRegistry.getFunctionTool(ref);\n if (!functionTool) {\n this.logDebug('Agent declares an unknown function tool; skipping', { agentRef: agent.ref, functionRef: ref });\n continue;\n }\n // Provider tool names must be identifier-safe; functionRefs use dots. Shared with the\n // approval-modification path, which must reverse it — see `modelToolNameForFunctionRef`.\n const toolName = modelToolNameForFunctionRef(ref);\n tools[toolName] = tool({\n description: functionTool.description,\n inputSchema: functionTool.inputSchema,\n /**\n * OBSERVE the failure, then re-throw it unchanged.\n *\n * The AI SDK catches whatever a tool throws and turns it into a tool-error RESULT that is fed\n * back to the model, which then narrates it to the user in prose. That is the right runtime\n * behaviour — the model can apologise, retry or ask a question — but it means a failing tool\n * produces NO server-side record of any kind: not an error, not a warning, not a debug line.\n * The only trace is whatever the model chose to say, and the model is guessing: an\n * `authorizations_access_denied` on the CREATE was narrated as \"I don't have permission to\n * write to that list\", which points an investigator at the list rather than at the ACL.\n *\n * That cost a full debugging session against a live stack — the failure could not be\n * attributed from the logs at all, because there were none. An app author hitting the same\n * thing has strictly less to work with, since the engine internals are not theirs to read.\n *\n * Re-throwing is what keeps this observation-only: the SDK still receives the same error, so\n * the model still sees the same tool result and the conversation is unchanged.\n */\n execute: async (args: any) => {\n try {\n return await functionTool.execute(args, toolContext);\n } catch (error) {\n this.logger.warn('Agent function tool execution failed; the model will be told, so nothing else records this', {\n agentRef: agent.ref,\n functionRef: ref,\n toolName,\n ...projectCaughtErrorLogFields(error),\n });\n throw error;\n }\n },\n });\n // ⚠️ The SDK's tool-level `needsApproval` is DELIBERATELY not set — it is deprecated\n // (\"tool approval is handled on a generateText / streamText level now\"), so the gate is\n // declared here and applied at the CALL site via `toolApproval`. Keeping the translation in\n // one place also means an app author never writes the SDK's vocabulary.\n if (functionTool.requiresHumanApproval) approvalGatedToolNames.add(toolName);\n }\n return Object.keys(tools).length > 0 ? tools : undefined;\n }\n\n /**\n * The SDK call-level approval configuration for a resolved tool set, or `undefined` when no\n * declared tool is approval-gated.\n *\n * `'user-approval'` is the status that SUSPENDS the tool loop and emits a\n * `tool-approval-request`; the other statuses (`approved` / `denied` / `not-applicable`) decide\n * without a human and are not what a `requiresHumanApproval` declaration means.\n */\n /**\n * The approval-signing key, or `undefined` when the application's primary secret is not set.\n *\n * PUBLIC because there are two moments that need this exact key and only one of them is a turn:\n * the tool loop SIGNS an approval request when it suspends, and — since approve-with-modifications\n * (#566) — a resume RE-SIGNS it after an approver authored different arguments. A second\n * derivation in the resume path would be a second key the day either expression moved, and the\n * failure would present as a forged approval rather than as the configuration skew it is.\n *\n * Returns rather than throws, because the two callers owe different answers: a TURN that cannot\n * sign must be refused outright (see below), while a MODIFICATION that cannot be re-signed must\n * leave the pause standing so the approver can still approve the call as proposed.\n */\n public resolveToolApprovalSigningKey(): string | undefined {\n const applicationSecret = process.env[ApplicationBackendBootstrapEnvKeys.PLATFORM_APPLICATION_PRIMARY_SECRET];\n if (!applicationSecret || applicationSecret.trim().length === 0) return undefined;\n return deriveToolApprovalSigningKey(applicationSecret);\n }\n\n /**\n * The HMAC secret that signs approval requests — REQUIRED once any tool is approval-gated.\n *\n * Fails CLOSED, and the asymmetry is the reason. Without a secret the SDK still suspends and still\n * resumes, so everything looks like it works; what silently disappears is the binding between an\n * approval and the tool call it approved, which is what stops a client forging one. The tools an\n * author bothered to gate are precisely those where a forged approval is worst, so degrading to\n * unsigned approvals would remove the protection exactly where it was asked for.\n *\n * Refusing the TURN (rather than the tool) is deliberate: silently dropping the gated tool from an\n * agent's toolset would leave the agent quietly less capable with no signal, which is harder to\n * diagnose than a startup-shaped failure naming the missing configuration.\n *\n * ## Why this DERIVES rather than reading a dedicated variable\n *\n * The first implementation read a bespoke `WILDO_TOOL_APPROVAL_SECRET`. That variable is declared\n * nowhere — not in the backend env contracts, not in the env schema, not in CLI env generation —\n * so no application has ever had it set. Combined with the fail-closed rule above, the result was\n * a capability that refuses the turn in EVERY deployment: the gate could not be adopted at all,\n * and the first app author to gate a tool would have met an unexplained configuration error.\n *\n * The application's bootstrap primary secret is already provisioned everywhere, schema-validated\n * at 32+ characters, and present in `process.env` for every backend by construction. Deriving from\n * it removes the provisioning gap entirely rather than asking every deployment to close it.\n *\n * The derivation is domain-separated by a versioned label, so this key is not the primary secret\n * and cannot be interchanged with any other use of it — reusing a secret verbatim across purposes\n * is what makes one leak compromise several mechanisms. Rotating the primary secret rotates this\n * key with it, which invalidates approvals in flight; that is the correct outcome, since an\n * approval outliving a secret rotation is precisely what rotation is meant to end.\n *\n * Deliberately NOT offered as an override-if-set: a second source would mean an operator could set\n * the override in one process and not another, leaving two backends that disagree about whether an\n * approval is valid — and the failure would look like a forged approval rather than a config skew.\n */\n private resolveToolApprovalSecretOrThrow(agent: FlowsActors_Agent, approvalGatedToolNames: Set<string>): string {\n const signingKey = this.resolveToolApprovalSigningKey();\n if (signingKey) return signingKey;\n\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message: `Agent \"${agent.ref}\" declares human-approval tools (${[...approvalGatedToolNames].join(', ')}) but the application's primary secret is not configured, so the approval-signing key cannot be derived. Approval decisions would be unsigned and therefore forgeable by a client, so the turn is refused rather than run with the gate weakened.`,\n agentRef: agent.ref,\n },\n });\n }\n\n private buildToolApprovalConfiguration(\n approvalGatedToolNames: Set<string>,\n /** The turn's principal. `undefined` is treated as unable to answer — fail closed. */\n executionType?: ExecutionContext_ExecutionType,\n ): Record<string, ToolApprovalDecision> | undefined {\n if (approvalGatedToolNames.size === 0) return undefined;\n\n // A principal that cannot answer must be DENIED, never suspended (D-HITL-3, widened to an\n // allow-list — see PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL). Suspending such a turn is not a\n // safe default: it parks the execution in AWAITING_APPROVAL waiting for a decision that can\n // never arrive, with no lease and no sweep to reclaim it.\n //\n // Denial is also the better OUTCOME, not merely the safe one: the SDK reports the refusal to\n // the model, which answers explaining that the action needs human approval. The caller gets a\n // usable reply instead of a turn that never returns.\n const decision: ToolApprovalDecision = executionType && PRINCIPALS_THAT_CAN_ANSWER_TOOL_APPROVAL.has(executionType)\n ? 'user-approval'\n : { type: 'denied', reason: 'This action requires approval from a person, and this caller is not one. Ask a user to perform it, or run it through an interactive session.' };\n\n return Object.fromEntries([...approvalGatedToolNames].map((name) => [name, decision]));\n }\n\n /** API-transport streaming — mirrors executeAgentViaApi but forwards deltas + tool events. */\n private async executeAgentViaApiStreaming(\n agent: FlowsActors_Agent,\n request: FlowsActors_Agent_Invocation<any, any, any>,\n execution: Extract<ResolvedAgentExecution, { transport: 'api' }>,\n prompts: CompiledExecutionPrompts,\n handlers: AgentStreamHandlers,\n tools?: Record<string, any>,\n toolApproval?: Record<string, ToolApprovalDecision>,\n toolApprovalSecret?: string,\n ): Promise<AgentExecutionResult> {\n const aiProvider = await this.resolveApiProviderClient(execution.providerRef);\n const limiter = this.getBottleneckForProvider(\n execution.providerRef,\n ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n );\n const jobId = `${agent.ref}-api-stream-${Date.now()}-${Math.random().toString(36).substring(7)}`;\n\n this.logDebug('Scheduling streaming API call through rate limiter', {\n agentRef: agent.ref,\n providerRef: execution.providerRef,\n operationKey: execution.operationKey,\n model: agent.config.model,\n toolCount: tools ? Object.keys(tools).length : 0,\n jobId,\n });\n\n const result = await limiter.schedule(\n { id: jobId },\n () => this.streamOperation({\n providerClient: aiProvider,\n config: agent.config,\n operationKey: execution.operationKey,\n systemPrompt: prompts.systemPrompt,\n instructions: prompts.instructions,\n input: request.input,\n handlers,\n tools,\n toolApproval,\n toolApprovalSecret,\n }),\n );\n\n return {\n ...result,\n transport: {\n kind: LLMProvider_ExecutionTransportKind.API,\n protocolKind: ExternalProvider_ExchangeProtocol_Kind.LLM_PROVIDER,\n providerRef: execution.providerRef,\n model: agent.config.model,\n },\n };\n }\n\n /**\n * Dispatch a streaming operation by key. Only text-producing operations\n * (GENERATE_TEXT / CHAT_COMPLETION and their THINKING variants) stream; other\n * keys throw {@link AgentStreamingUnsupportedError}. The output shape matches\n * the buffered executors so `normalizeOperationOutput` is identical.\n */\n private async streamOperation({ providerClient, config, operationKey, systemPrompt, instructions, input, handlers, tools, toolApproval, toolApprovalSecret }: streamOperationParams): Promise<{ output: unknown; usage?: any; approvalSuspension?: AgentApprovalSuspension }> {\n const model = this.getModelFromProvider(providerClient, config.model);\n const baseOptions = this.buildBaseOptions(config as FlowsActors_Agent_LLMConfiguration);\n\n try {\n switch (operationKey) {\n case LLMProvider_OperationKey.GENERATE_TEXT: {\n const { text, usage, approvalSuspension } = await this.streamTextToDeltas({ model, prompt: instructions, instructions: systemPrompt, baseOptions, tools, toolApproval, toolApprovalSecret }, handlers);\n return { output: { text }, usage, approvalSuspension };\n }\n\n case LLMProvider_OperationKey.CHAT_COMPLETION: {\n const messages = this.buildChatMessages(instructions, input);\n // System prompt goes via the top-level `instructions:` option (AI-SDK v7\n // forbids it inside `messages`), exactly like the GENERATE_TEXT branch above.\n const { text, usage, approvalSuspension } = await this.streamTextToDeltas({ model, messages, instructions: systemPrompt, baseOptions, tools, toolApproval, toolApprovalSecret }, handlers);\n return { output: { message: { role: LLMProvider_MessageRole.ASSISTANT, content: text } }, usage, approvalSuspension };\n }\n\n default:\n throw new AgentStreamingUnsupportedError('operation', `Operation ${operationKey} does not produce a token stream; use invokeAgent (buffered) instead.`);\n }\n } catch (error) {\n if (error instanceof AgentStreamingUnsupportedError) throw error;\n if (isWildoBackendError(error)) throw error;\n const errorDetails = this.extractProviderErrorDetails(error);\n this.logger.error('Streaming operation failed - provider response', { operationKey, ...errorDetails });\n throw this.errorBuilder.buildError(ErrorType.INTERNAL, undefined, {\n customMessageReference: ErrorCustomMessageReference.INTERNAL,\n context: { operationKey, message: `Failed to stream operation ${operationKey}: ${errorDetails.errorMessage}`, ...errorDetails },\n });\n }\n }\n\n /**\n * Run AI-SDK `streamText` and iterate its `fullStream`, forwarding text deltas\n * through `handlers.onDelta` and tool-call/result lifecycle events through\n * `handlers.onToolEvent` as they arrive (honest streaming — no buffering). When\n * `tools` are supplied a bounded multi-step loop is enabled\n * (`stopWhen: stepCountIs(MAX_TOOL_STEPS)`) so the model can call a tool and\n * continue. A throwing handler is swallowed (debug-logged) so a consumer error\n * never breaks the stream. Returns the assembled text + normalized usage.\n */\n private async streamTextToDeltas(\n args: {\n model: any; prompt?: string; instructions?: string; messages?: any[]; baseOptions: any;\n tools?: Record<string, any>; toolApproval?: Record<string, ToolApprovalDecision>; toolApprovalSecret?: string;\n },\n handlers: AgentStreamHandlers,\n ): Promise<{ text: string; usage?: any; approvalSuspension?: AgentApprovalSuspension }> {\n const { baseOptions, tools, toolApproval, toolApprovalSecret, ...streamArgs } = args;\n\n // ── Usage must be accumulated AS STEPS FINISH, not read only at the end ────────────────────\n //\n // On an ABORTED stream AI-SDK ends `fullStream` normally (an `abort` part) but **rejects**\n // `result.usage`. Reading only that terminal promise therefore threw here, which skipped\n // `reportUsage` upstream, left `turnTotalTokens` undefined, and meant `recordTurnTokens` was\n // NEVER called — so a cancelled turn moved the tenant's token budget by zero while the\n // provider had really generated (and charged for) output. That made cancellation an\n // unmetered-spend path a caller could drive on demand: start a turn, hang up, repeat.\n //\n // Per-step usage is known the moment each step completes, so it survives an abort. Only the\n // IN-FLIGHT step's partial output is unrecoverable — a small, bounded, honest gap rather than\n // losing the whole turn's consumption.\n const steppedUsage = { promptTokens: 0, completionTokens: 0, totalTokens: 0 };\n\n const result = await streamText({\n ...streamArgs,\n ...baseOptions,\n onStepFinish: (step: any) => {\n const stepUsage = this.extractUsage(step?.usage);\n steppedUsage.promptTokens += stepUsage.promptTokens;\n steppedUsage.completionTokens += stepUsage.completionTokens;\n steppedUsage.totalTokens += stepUsage.totalTokens;\n },\n // AFTER `baseOptions` on purpose: the signal is per-INVOCATION, whereas\n // `baseOptions` is derived from the agent's static config, so it must not be\n // overridable by configuration.\n ...(handlers.abortSignal ? { abortSignal: handlers.abortSignal } : {}),\n // Human-in-the-loop. `toolApproval` suspends the loop on a gated call; the secret HMAC-signs\n // the request so a replayed approval cannot be forged by a client. The caller guarantees they\n // travel together — see the fail-closed check where the configuration is built.\n ...(toolApproval ? { toolApproval, experimental_toolApprovalSecret: toolApprovalSecret } : {}),\n ...(tools\n ? {\n tools,\n stopWhen: stepCountIs(MAX_TOOL_STEPS),\n // Sanitize the CONTINUATION prompt of the multi-step tool loop: extended-thinking models\n // emit an empty-text assistant `reasoning` part that the provider's prompt validation\n // rejects when it is fed back for the next step, killing every step after the first.\n // `prepareStep`'s `messages` override is the SDK-supported seam for this and carries\n // forward to later steps. See `stripEmptyReasoningParts`.\n prepareStep: ({ messages }: { messages: any[] }) => ({ messages: stripEmptyReasoningParts(messages) }),\n }\n : {}),\n });\n\n let full = '';\n let approvalSuspension: AgentApprovalSuspension | undefined;\n for await (const part of result.fullStream) {\n try {\n if (part.type === 'text-delta') {\n full += part.text;\n handlers.onDelta(part.text);\n } else if (part.type === 'tool-call') {\n handlers.onToolEvent?.({ phase: 'call', toolName: part.toolName, input: part.input });\n } else if (part.type === 'tool-result') {\n handlers.onToolEvent?.({ phase: 'result', toolName: part.toolName });\n } else if (part.type === 'tool-error') {\n handlers.onToolEvent?.({ phase: 'error', toolName: part.toolName });\n } else if (part.type === 'tool-approval-request') {\n // The tool loop has STOPPED and is waiting for a human. This is a terminal outcome of the\n // turn, not an error: the model produced no further text and will not until the decision\n // is replayed. Captured here rather than inferred from `finishReason`, because the part\n // carries the `approvalId` the resume must echo — and the SDK binds that id to the tool\n // call with an HMAC signature, so it cannot be reconstructed after the fact.\n approvalSuspension = {\n approvalId: (part as any).approvalId,\n toolCallId: (part as any).toolCall?.toolCallId ?? (part as any).toolCallId,\n toolName: (part as any).toolCall?.toolName ?? (part as any).toolName,\n toolArgs: (part as any).toolCall?.input ?? (part as any).input,\n sdkModelMessages: [],\n };\n }\n } catch (cbError) {\n this.logDebug('Streaming handler threw (non-fatal)', {\n ...projectCaughtErrorLogFields(cbError),\n });\n }\n }\n\n // Guarded: `result.usage` rejects on an aborted stream (see the accumulator above). An\n // unguarded read here is what turned cancellation into an unmetered path, so a rejection\n // falls back to the per-step total rather than throwing away the whole turn's consumption.\n let terminalUsage: unknown;\n try {\n terminalUsage = await result.usage;\n } catch (usageError) {\n this.logDebug('Stream usage unavailable (aborted, or the provider omitted it) — metering the per-step total instead', {\n ...projectCaughtErrorLogFields(usageError),\n });\n }\n\n // Prefer the SDK's authoritative total when the stream ran to completion; otherwise report\n // what the finished steps consumed. With no completed steps this is all-zero, which is\n // exactly what the previous `extractUsage(undefined)` produced — so nothing regresses.\n // The resume payload is the SDK's own message array, read AFTER the stream drains so it\n // includes the assistant turn carrying the approval request. Reading it earlier would capture a\n // prompt the model has not answered yet, and resuming from that would re-ask rather than continue.\n if (approvalSuspension) {\n try {\n approvalSuspension.sdkModelMessages = (await result.response)?.messages ?? [];\n } catch (messagesError) {\n this.logDebug('Could not capture resume messages for a suspended turn', {\n ...projectCaughtErrorLogFields(messagesError),\n });\n }\n }\n\n return {\n text: full,\n usage: terminalUsage !== undefined ? this.extractUsage(terminalUsage) : steppedUsage,\n approvalSuspension,\n };\n }\n\n /**\n * Build the AI-SDK `messages` array for a chat turn: a caller-supplied\n * `input.messages` conversation, or a single user turn from `instructions`.\n *\n * The array is deliberately SYSTEM-FREE. AI-SDK v7 (`ai@7.x`) rejects a\n * `role:'system'` entry inside `messages` (\"System messages are not allowed in\n * the prompt or messages fields. Use the instructions option instead.\"). The\n * agent's system prompt must be passed by the CALLER via the top-level\n * `instructions:` option of `generateText` / `streamText` (as `executeGenerateText`\n * does), NEVER pushed in here. Any `role:'system'` entry a caller left in\n * `input.messages` is filtered out so the array stays v7-valid (and a new array is\n * returned — the caller's `input.messages` is never mutated). Shared by the\n * buffered chat executor and the streaming path. Throws VALIDATION when no\n * messages result.\n */\n private buildChatMessages(\n instructions: string,\n input: any,\n ): Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> {\n let messages: Array<{ role: 'system' | 'user' | 'assistant'; content: string | Array<any> }> = [];\n\n if (input && typeof input === 'object' && 'messages' in input && Array.isArray(input.messages)) {\n // System prompt travels via the top-level `instructions:` option, so drop any\n // `role:'system'` entries here (they would be rejected by AI-SDK v7).\n messages = input.messages.filter((m: any) => m.role !== 'system');\n } else {\n messages.push({ role: 'user', content: instructions });\n }\n\n if (messages.length === 0) {\n throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AGENT_MESSAGES_REQUIRED,\n context: { operation: 'CHAT_COMPLETION' }, // diagnostic (log-only)\n });\n }\n return messages;\n }\n\n /**\n * Extract usage information from AI SDK usage object\n * Handles different usage object structures across providers\n */\n private extractUsage(usage: any): {\n promptTokens: number;\n completionTokens: number;\n totalTokens: number;\n tokenUsageComplete: boolean;\n inputTokenDetails?: {\n noCacheTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n };\n } {\n // AI SDK usage object structure varies by provider\n // Common properties: promptTokens, completionTokens, totalTokens\n const observedPromptTokens = usage?.promptTokens ?? usage?.inputTokens;\n const observedCompletionTokens = usage?.completionTokens ?? usage?.outputTokens;\n const tokenUsageComplete = typeof observedPromptTokens === 'number' && typeof observedCompletionTokens === 'number';\n const promptTokens = observedPromptTokens ?? 0;\n const completionTokens = observedCompletionTokens ?? 0;\n const totalTokens = usage?.totalTokens ?? (promptTokens + completionTokens);\n\n const details = usage?.inputTokenDetails;\n return {\n promptTokens,\n completionTokens,\n totalTokens,\n tokenUsageComplete,\n ...(details && typeof details === 'object'\n ? {\n inputTokenDetails: {\n ...(details.noCacheTokens === undefined ? {} : { noCacheTokens: details.noCacheTokens }),\n ...(details.cacheReadTokens === undefined ? {} : { cacheReadTokens: details.cacheReadTokens }),\n ...(details.cacheWriteTokens === undefined ? {} : { cacheWriteTokens: details.cacheWriteTokens }),\n },\n }\n : {}),\n };\n }\n\n /**\n * Extract detailed error information from AI SDK errors\n * Captures provider response details, status codes, and error bodies\n */\n private extractProviderErrorDetails(error: unknown): Record<string, unknown> {\n const details: Record<string, unknown> = {\n errorMessage: describeCaughtError(error),\n errorName: error instanceof Error ? error.name : typeof error,\n stack: error instanceof Error ? error.stack : undefined,\n };\n\n // AI SDK errors often have response details\n if (error && typeof error === 'object') {\n const err = error as any;\n\n // Extract HTTP response details if available\n if (err.response) {\n details.response = {\n status: err.response.status,\n statusText: err.response.statusText,\n headers: err.response.headers,\n data: err.response.data,\n body: err.response.body,\n };\n }\n\n // Extract status code directly\n if (err.statusCode || err.status) {\n details.statusCode = err.statusCode || err.status;\n }\n\n // Extract error code\n if (err.code) {\n details.errorCode = err.code;\n }\n\n // Extract error type\n if (err.type) {\n details.errorType = err.type;\n }\n\n // Extract cause if available\n if (err.cause) {\n details.cause = this.extractProviderErrorDetails(err.cause);\n }\n\n // Extract any additional error properties\n if (err.data) {\n details.data = err.data;\n }\n\n if (err.body) {\n details.body = err.body;\n }\n\n // Extract provider-specific error details\n if (err.error) {\n details.providerError = err.error;\n }\n\n // Extract request details if available\n if (err.request) {\n details.request = {\n method: err.request.method,\n url: err.request.url,\n headers: err.request.headers,\n };\n }\n\n // Try to extract readable error message from various formats\n if (err.message) {\n details.message = err.message;\n }\n\n if (err.error?.message) {\n details.providerErrorMessage = err.error.message;\n }\n\n if (err.data?.error?.message) {\n details.dataErrorMessage = err.data.error.message;\n }\n }\n\n // The AI SDK (and most provider HTTP clients) frequently REJECT with a\n // PLAIN OBJECT rather than an `Error` instance — e.g.\n // `{ statusCode: 500, responseBody, error: { message } }`. For those, the\n // `errorMessage` computed at the top of this method fell back to\n // `String(error)` === \"[object Object]\" (with `errorName: \"object\"`), which\n // is exactly what masked every gpt-4o 5xx / rate-limit / invalid-schema\n // failure in the logs AND in the re-thrown WildoError message\n // (`Failed to execute operation …: [object Object]`). Promote the most\n // specific human-readable message we actually managed to extract above, so\n // the real provider failure is visible end-to-end. JSON-stringify (not\n // `String`) is the last resort — it surfaces `{statusCode, body, …}` instead\n // of an opaque marker. Errors (which already carry a real `.message`) are\n // left untouched.\n if (!(error instanceof Error) && error !== null && typeof error === 'object') {\n const candidates = [\n details.providerErrorMessage,\n details.dataErrorMessage,\n details.message,\n typeof details.providerError === 'string' ? details.providerError : undefined,\n typeof details.body === 'string' ? details.body : undefined,\n ];\n let best = candidates.find((c): c is string => typeof c === 'string' && c.trim().length > 0);\n if (!best) {\n try {\n best = JSON.stringify(error);\n } catch {\n /* circular / non-serializable — keep the original marker */\n }\n }\n if (best && best !== '{}') {\n details.errorMessage = best.length > 2000 ? `${best.slice(0, 2000)}…` : best;\n }\n }\n\n return details;\n }\n\n // ================================\n // Agent Validation\n // ================================\n\n private validateAgentStatus(agent: FlowsActors_Agent): void {\n if (agent.status !== FlowsActors_Agent_Status.ACTIVE) {\n throw this.errorBuilder.buildError( ErrorType.VALIDATION, undefined,\n { customMessageReference: ErrorCustomMessageReference.AGENT_NOT_ACTIVE,\n context: { agentRef: agent.ref, status: agent.status }}); // diagnostic (log-only)\n }\n }\n\n /**\n * Validate that everything an agent DECLARES resolves — function tools in the registry and MCP\n * servers in the application's declaration — and that any explicitly-required function refs are\n * declared by the agent. Returns false on any gap rather than throwing, so callers can decide how\n * to degrade.\n *\n * ## Why `mcpRefs` are checked here as well (#491)\n *\n * `FlowsActorsRegistryService.initialize` already REFUSES an agent whose `mcpRefs` name no\n * declared server, so on the ordinary path this is redundant — and it is kept anyway, because\n * `registerAgent` is PUBLIC and the refusal is not on it. An agent registered after initialization\n * bypasses that gate entirely today, so this is the only site that would notice.\n *\n * The refusal is deliberately NOT moved onto `registerAgent`: addon load order is not guaranteed,\n * and a per-registration check would refuse a coherent application for the order its addons\n * happened to load in. Two sites answering the same question at two different moments is the\n * correct shape here — one fails the boot, one degrades an invocation.\n */\n public validateAgentCapabilities(agentRef: string, requiredCapabilities: string[]): boolean {\n const agent = this.flowsActorsRegistry.getAgentOrThrow(agentRef);\n const declaredFunctionRefs = agent.capabilities?.tools?.functionRefs ?? [];\n const declaredMcpRefs = agent.capabilities?.tools?.mcpRefs ?? [];\n\n // Every tool the agent declares must resolve in the registry.\n const unresolved = declaredFunctionRefs.filter((ref) => !this.flowsActorsRegistry.hasFunctionTool(ref));\n // And every MCP server it names must be one the application declared.\n const unresolvedMcpRefs = declaredMcpRefs.filter((ref) => !this.flowsActorsRegistry.hasMcpServer(ref));\n // Every explicitly-required capability must be declared by the agent.\n const missingRequired = requiredCapabilities.filter((ref) => !declaredFunctionRefs.includes(ref));\n\n const isValid = unresolved.length === 0 && unresolvedMcpRefs.length === 0 && missingRequired.length === 0;\n this.logDebug('Agent capabilities validated', { agentRef, requiredCapabilities, unresolved, unresolvedMcpRefs, missingRequired, isValid });\n return isValid;\n }\n\n // ================================\n // Agent Discovery\n // ================================\n\n public getAvailableAgents(): FlowsActors_Agent[] {\n const registry = this.flowsActorsRegistry.getRegistry();\n return Object.values(registry.agents).filter((agent: FlowsActors_Agent) => agent.status === FlowsActors_Agent_Status.ACTIVE);\n }\n\n public getAgentsBySkillType(skillType: string): FlowsActors_Agent[] {\n return this.getAvailableAgents().filter(agent => agent.promptSpec.skillType === skillType);\n }\n\n public getAgent(agentRef: string): FlowsActors_Agent | undefined {\n return this.flowsActorsRegistry.getAgent(agentRef);\n }\n\n public getAgentOrThrow(agentRef: string): FlowsActors_Agent {\n return this.flowsActorsRegistry.getAgentOrThrow(agentRef);\n }\n\n // ================================\n // Debug Methods\n // ================================\n\n public getDebugInfo(): { totalAgents: number; activeAgents: number; agentsByProvider: Record<string, number>; agentsBySkillType: Record<string, number> } {\n const allAgents = Object.values(this.flowsActorsRegistry.getRegistry().agents) as FlowsActors_Agent[];\n\n const activeAgents = allAgents.filter(a => a.status === FlowsActors_Agent_Status.ACTIVE);\n\n const agentsByProvider: Record<string, number> = {};\n const agentsBySkillType: Record<string, number> = {};\n\n allAgents.forEach(agent => {\n const provider = agent.config.providerRef;\n agentsByProvider[provider] = (agentsByProvider[provider] || 0) + 1;\n\n const skillType = agent.promptSpec.skillType;\n agentsBySkillType[skillType] = (agentsBySkillType[skillType] || 0) + 1;\n });\n\n return { totalAgents: allAgents.length, activeAgents: activeAgents.length, agentsByProvider, agentsBySkillType, };\n }\n}\n"]}
|