@wildo-ai/saas-backend-lib 1.1.0 → 1.1.2
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/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +115 -22
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +1 -0
- 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 +6 -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/odata-query-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +88 -32
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +31 -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 +127 -5
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +62 -2
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +126 -4
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4 -2
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +6 -6
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +38 -0
- 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 +40 -0
- 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 +20 -0
- 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 +28 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +12 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +118 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +8 -5
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.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 +14 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +10 -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 +13 -2
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts +27 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.js +29 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js +5 -0
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +13 -2
- 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 +8 -2
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.js +7 -1
- package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +14 -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 +6 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts +24 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +66 -2
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +42 -3
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +163 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js +442 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +19 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +78 -15
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.js +12 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +5 -5
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +79 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +319 -42
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +300 -139
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/index.d.ts +4 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +4 -0
- 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 +2 -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 +12 -4
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +29 -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 +131 -3
- package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +130 -6
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +9 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +11 -36
- package/dist/esm/notifications/services/notifications-dispatcher.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 +9 -7
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +2 -2
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +9 -7
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +56 -7
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +28 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.js +82 -0
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +9 -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-mfa.backend.service.js +5 -3
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +25 -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 +55 -4
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +101 -6
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +210 -30
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +20 -0
- 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 +58 -5
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +15 -9
- package/dist/esm/.builder.pid +0 -9
|
@@ -27,11 +27,19 @@ import { BackendProviderRegistryBackendService } from '../../external-providers/
|
|
|
27
27
|
import { PromptCompilerBackendService } from './prompt-compiler.backend.service.js';
|
|
28
28
|
import { FlowsActors_Agent_Status, isImageAgentConfiguration, isCodingAgentConfiguration, PromptIR_TrustLevel, PromptIR_ContextSourceKind, ErrorType, ErrorCustomMessageReference, isWildoBackendError, AgentCallOutcome, AgentTraceabilityLevel, StructuredGenerationExecutionMode, } from '@wildo-ai/saas-models';
|
|
29
29
|
import { MetaWorkflowStructuredGenerationPlanKind } from '@wildo-ai/saas-models/meta-workflows';
|
|
30
|
-
import { APPLICATION_ENVIRONMENT, LLMProvider_ExecutionTransportKind, LLMProvider_ExecutionTransportMetadataSchema, LLMProvider_UsageSchema, LLMProvider_StructuredGenerationFailureKind, LLMProvider_StructuredGenerationFailureSchema, ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_RateLimitConfigurationSchema, LLMProvider_OperationKey, LLMProvider_MessageRole, AgentClientProtocol_AuthMode, AgentClientProtocol_PermissionCeiling, AgentClientProtocol_WorkingDirectoryPolicy, agentClientProtocolPermissionCeilingRank, AgentClientProtocol_HostConfigurationInheritance, CodingAgent_UsageSchema, AgentClientProtocol_ExecutionTransportMetadataSchema, } from '@wildo-ai/external-connectors-models';
|
|
30
|
+
import { APPLICATION_ENVIRONMENT, LLMProvider_ExecutionTransportKind, LLMProvider_ExecutionTransportMetadataSchema, LLMProvider_UsageSchema, LLMProvider_StructuredGenerationFailureKind, LLMProvider_StructuredGenerationFailureSchema, ExternalProvider_ExchangeProtocol_Kind, ExternalProvider_RateLimitConfigurationSchema, LLMProvider_OperationKey, LLMProvider_MessageRole, AgentClientProtocol_AuthMode, AgentClientProtocol_PermissionCeiling, AgentClientProtocol_WorkingDirectoryPolicy, agentClientProtocolPermissionCeilingRank, AgentClientProtocol_HostConfigurationInheritance, CodingAgent_UsageSchema, AgentClientProtocol_ExecutionTransportMetadataSchema, CodingAgent_EndOfTurnClassification, CodingAgent_StopReason, } from '@wildo-ai/external-connectors-models';
|
|
31
31
|
import { generateText, streamText, generateObject, generateImage, NoObjectGeneratedError, tool, stepCountIs } from 'ai';
|
|
32
|
-
import {
|
|
32
|
+
import { startACPAgentSession, } from '../../flows-actors/utils/acp-session-runner.backend.utils.js';
|
|
33
33
|
import { resolveTrustedWorkingDirectory } from '../../flows-actors/utils/bounded-subprocess.backend.utils.js';
|
|
34
34
|
import { DEFAULT_MAX_STRUCTURED_DATA_FIELD_ALLOWED, planStructuredGenerationShape, } from '../../flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js';
|
|
35
|
+
/** The ladder phases a live coding session transitions through. */
|
|
36
|
+
export var CodingSessionLadderPhase;
|
|
37
|
+
(function (CodingSessionLadderPhase) {
|
|
38
|
+
/** A turn is executing. */
|
|
39
|
+
CodingSessionLadderPhase["RUNNING"] = "running";
|
|
40
|
+
/** The session parked on a question and is waiting for an operator answer. */
|
|
41
|
+
CodingSessionLadderPhase["AWAITING_INPUT"] = "awaiting_input";
|
|
42
|
+
})(CodingSessionLadderPhase || (CodingSessionLadderPhase = {}));
|
|
35
43
|
/** True when an execution result carries a CODING transport rather than an LLM one. */
|
|
36
44
|
function isAgentClientProtocolTransport(transport) {
|
|
37
45
|
return transport?.protocolKind === ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL;
|
|
@@ -586,7 +594,17 @@ let AgentsBackendService = class AgentsBackendService {
|
|
|
586
594
|
...(code ? { code } : {}),
|
|
587
595
|
};
|
|
588
596
|
}
|
|
589
|
-
|
|
597
|
+
// A non-Error, non-string throw still carries information — a JSON-RPC error object, a refusal
|
|
598
|
+
// shape. Serialize it (bounded) rather than replacing it with a sentence that says nothing.
|
|
599
|
+
if (typeof error === 'string')
|
|
600
|
+
return { message: error };
|
|
601
|
+
try {
|
|
602
|
+
const serialized = JSON.stringify(error);
|
|
603
|
+
if (serialized && serialized !== '{}')
|
|
604
|
+
return { message: `Non-Error thrown: ${serialized.slice(0, 500)}` };
|
|
605
|
+
}
|
|
606
|
+
catch { /* circular or hostile — fall through to the sentinel */ }
|
|
607
|
+
return { message: 'Unknown agent invocation error' };
|
|
590
608
|
}
|
|
591
609
|
/**
|
|
592
610
|
* Normalize executor outputs to the shared transport-neutral LLM contract.
|
|
@@ -1190,65 +1208,133 @@ let AgentsBackendService = class AgentsBackendService {
|
|
|
1190
1208
|
const sessionMetaExtensions = this.resolveAgentClientProtocolSessionMeta(execution);
|
|
1191
1209
|
return limiter.schedule({ id: jobId }, async () => {
|
|
1192
1210
|
const env = this.buildAgentClientProtocolEnvironment(execution);
|
|
1193
|
-
|
|
1211
|
+
// DELIVER the model, through the channel THIS agent's provider declares.
|
|
1212
|
+
//
|
|
1213
|
+
// Until 2026-09-03 `requestedModel` was checked against the transport's
|
|
1214
|
+
// declared set and written into the transport metadata — and never reached
|
|
1215
|
+
// the spawned agent, so under HOST_MANAGED auth every session ran at the
|
|
1216
|
+
// OPERATOR's personal default model (measured: Opus, during a 529-overload
|
|
1217
|
+
// storm the agent definitions' declared model would have avoided).
|
|
1218
|
+
//
|
|
1219
|
+
// The first fix wrote `ANTHROPIC_MODEL` unconditionally from this
|
|
1220
|
+
// agent-NEUTRAL service, which is correct for exactly one adapter and a
|
|
1221
|
+
// silent no-op for every other: the same false result, one agent later.
|
|
1222
|
+
// So the channel is declared by the provider that knows its agent, and a
|
|
1223
|
+
// provider that declares none cannot have a model selected at all —
|
|
1224
|
+
// refused here rather than started with the choice quietly dropped.
|
|
1225
|
+
const modelDelivery = acpProfile.modelDelivery;
|
|
1226
|
+
let modelSelection;
|
|
1227
|
+
if (modelDelivery?.channel === 'environment-variable') {
|
|
1228
|
+
env[modelDelivery.environmentVariableName] = requestedModel;
|
|
1229
|
+
}
|
|
1230
|
+
else if (modelDelivery?.channel === 'session-config-option') {
|
|
1231
|
+
// Set over ACP after the session opens; the runner fails the session if
|
|
1232
|
+
// the agent rejects it, before any prompt reaches the workspace.
|
|
1233
|
+
modelSelection = { configId: modelDelivery.configId, model: requestedModel };
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {
|
|
1237
|
+
customMessageReference: ErrorCustomMessageReference.CONFIGURATION,
|
|
1238
|
+
context: {
|
|
1239
|
+
providerRef: execution.providerRef,
|
|
1240
|
+
executionProfileRef: execution.executionProfileRef,
|
|
1241
|
+
requestedModel,
|
|
1242
|
+
message: 'ACP provider declares no model-delivery channel, so the selected model cannot reach the '
|
|
1243
|
+
+ 'agent and the session is refused rather than run at the agent\'s own default.',
|
|
1244
|
+
},
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
// A run that ANSWERS a parked session resumes it by id via `session/load`
|
|
1248
|
+
// instead of starting a fresh task; the input's prompt is then the answer.
|
|
1249
|
+
const continuationOfSessionId = request.input
|
|
1250
|
+
?.continuationOfSessionId;
|
|
1251
|
+
// (4) Open the live session, then drive it turn-by-turn.
|
|
1252
|
+
const agentSession = await startACPAgentSession({
|
|
1194
1253
|
// The application may override how the agent is started, but normally
|
|
1195
1254
|
// inherits it: the provider owns the package and its pinned version.
|
|
1196
1255
|
command: acpExecutionProfile.command ?? acpProfile.agentCommand,
|
|
1197
1256
|
args: acpExecutionProfile.command ? acpExecutionProfile.args : acpProfile.agentArgs,
|
|
1198
1257
|
cwd: workingDirectory,
|
|
1199
1258
|
env,
|
|
1200
|
-
prompt,
|
|
1201
1259
|
supportedProtocolVersions: acpProfile.supportedProtocolVersions,
|
|
1202
1260
|
// The invocation may request LESS autonomy than the profile allows; it
|
|
1203
1261
|
// can never request more. Clamped by rank rather than by trusting the
|
|
1204
1262
|
// request, so an input carrying a higher ceiling is lowered, not obeyed.
|
|
1205
1263
|
permissionCeiling: this.resolveEffectivePermissionCeiling(acpExecutionProfile, request),
|
|
1264
|
+
// Agent-vocabulary mode ids from the provider contract. Absent is fine —
|
|
1265
|
+
// the ceiling is enforced by answering permission requests, never by the
|
|
1266
|
+
// agent's mode — but a map hardcoded in the runner silently matched
|
|
1267
|
+
// nothing for any agent but the one it was written for.
|
|
1268
|
+
...(acpProfile.sessionModeIdsByPermissionCeiling?.[this.resolveEffectivePermissionCeiling(acpExecutionProfile, request)]
|
|
1269
|
+
? {
|
|
1270
|
+
preferredSessionModeIds: acpProfile.sessionModeIdsByPermissionCeiling[this.resolveEffectivePermissionCeiling(acpExecutionProfile, request)],
|
|
1271
|
+
}
|
|
1272
|
+
: {}),
|
|
1273
|
+
...(modelSelection ? { modelSelection } : {}),
|
|
1206
1274
|
...(hostContext?.isPermittedCodingLocation
|
|
1207
1275
|
? { isPermittedLocation: hostContext.isPermittedCodingLocation }
|
|
1208
1276
|
: {}),
|
|
1209
1277
|
...(sessionMetaExtensions ? { sessionMetaExtensions } : {}),
|
|
1210
|
-
...(acpExecutionProfile.turnTimeoutMs !== undefined ? { turnTimeoutMs: acpExecutionProfile.turnTimeoutMs } : {}),
|
|
1211
1278
|
...(acpExecutionProfile.maximumRecordedEventBytes !== undefined
|
|
1212
1279
|
? { maxRecordedEventBytes: acpExecutionProfile.maximumRecordedEventBytes }
|
|
1213
1280
|
: {}),
|
|
1214
1281
|
...(hostContext?.onCodingSessionEvent ? { onEvent: hostContext.onCodingSessionEvent } : {}),
|
|
1215
|
-
...(
|
|
1282
|
+
...(continuationOfSessionId ? { resumeSessionId: continuationOfSessionId } : {}),
|
|
1216
1283
|
});
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
...(
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1284
|
+
try {
|
|
1285
|
+
const ladder = await this.driveCodingTurnLadder({
|
|
1286
|
+
session: agentSession,
|
|
1287
|
+
firstPrompt: prompt,
|
|
1288
|
+
maxAutoContinuations: acpExecutionProfile.maxAutoContinuations,
|
|
1289
|
+
awaitingInputTtlMs: acpExecutionProfile.awaitingInputTtlMs,
|
|
1290
|
+
...(acpExecutionProfile.turnTimeoutMs !== undefined ? { turnTimeoutMs: acpExecutionProfile.turnTimeoutMs } : {}),
|
|
1291
|
+
...(hostContext?.codingSessionAbortSignal ? { abortSignal: hostContext.codingSessionAbortSignal } : {}),
|
|
1292
|
+
...(hostContext?.classifyCodingTurnEnd ? { classify: hostContext.classifyCodingTurnEnd } : {}),
|
|
1293
|
+
...(hostContext?.onCodingSessionStateChange ? { onStateChange: hostContext.onCodingSessionStateChange } : {}),
|
|
1294
|
+
});
|
|
1295
|
+
// (5) Result normalisation into the published contract.
|
|
1296
|
+
const output = {
|
|
1297
|
+
finalMessage: ladder.finalMessage,
|
|
1298
|
+
stopReason: ladder.stopReason,
|
|
1299
|
+
...(ladder.rawStopReason ? { rawStopReason: ladder.rawStopReason } : {}),
|
|
1300
|
+
// Always emitted, including zero: absence would be indistinguishable
|
|
1301
|
+
// from "no denials", and under the strictest ceiling that is exactly the
|
|
1302
|
+
// distinction an operator needs.
|
|
1303
|
+
deniedPermissionCount: ladder.deniedPermissionCount,
|
|
1304
|
+
permissionDecisions: ladder.permissionDecisions,
|
|
1305
|
+
...(ladder.reportedFileLocations.length > 0
|
|
1306
|
+
? { reportedFileLocations: ladder.reportedFileLocations }
|
|
1307
|
+
: {}),
|
|
1308
|
+
// Absent means one turn — the single-turn shape every pre-ladder
|
|
1309
|
+
// consumer already assumes.
|
|
1310
|
+
...(ladder.turnCount > 1 ? { turnCount: ladder.turnCount } : {}),
|
|
1311
|
+
...(ladder.continuations.length > 0 ? { continuations: ladder.continuations } : {}),
|
|
1312
|
+
// Present ONLY when the run parked on a question — the field that stops
|
|
1313
|
+
// a suspended turn being read as a completed result.
|
|
1314
|
+
...(ladder.suspension ? { suspension: ladder.suspension } : {}),
|
|
1315
|
+
};
|
|
1316
|
+
return {
|
|
1317
|
+
output,
|
|
1318
|
+
transport: {
|
|
1319
|
+
protocolKind: ExternalProvider_ExchangeProtocol_Kind.AGENT_CLIENT_PROTOCOL,
|
|
1320
|
+
providerRef: execution.providerRef,
|
|
1321
|
+
executionProfileRef: execution.executionProfileRef,
|
|
1322
|
+
model: requestedModel,
|
|
1323
|
+
negotiatedProtocolVersion: agentSession.negotiatedProtocolVersion,
|
|
1324
|
+
...(agentSession.agentName ? { agentName: agentSession.agentName } : {}),
|
|
1325
|
+
...(agentSession.agentVersion ? { agentVersion: agentSession.agentVersion } : {}),
|
|
1326
|
+
...(agentSession.sessionModeId ? { sessionModeId: agentSession.sessionModeId } : {}),
|
|
1327
|
+
sessionId: agentSession.sessionId,
|
|
1328
|
+
},
|
|
1329
|
+
...(ladder.usage ? { usage: ladder.usage } : {}),
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
finally {
|
|
1333
|
+
// Closes on completion AND on park: a parked session is answered by a
|
|
1334
|
+
// fresh invocation that resumes it via `session/load`, never by holding
|
|
1335
|
+
// this child alive across the HTTP call that returned the question.
|
|
1336
|
+
agentSession.close();
|
|
1337
|
+
}
|
|
1252
1338
|
});
|
|
1253
1339
|
}
|
|
1254
1340
|
extractCLITextOutput(output) {
|
|
@@ -1504,6 +1590,197 @@ let AgentsBackendService = class AgentsBackendService {
|
|
|
1504
1590
|
* adapter translates the abort into the TIMEOUT failure kind the retry policy already understands.
|
|
1505
1591
|
*/
|
|
1506
1592
|
static STRUCTURED_GENERATION_DEADLINE_MS = 900_000;
|
|
1593
|
+
/**
|
|
1594
|
+
* The one prompt sent to auto-continue a coding agent past a self-imposed
|
|
1595
|
+
* pause. Named here rather than improvised at the call site so a run's
|
|
1596
|
+
* continuations are all identical and auditable, and so the wording — which
|
|
1597
|
+
* tells the agent to keep working AND to stop only when genuinely done or
|
|
1598
|
+
* genuinely blocked — lives in exactly one place.
|
|
1599
|
+
*/
|
|
1600
|
+
static CODING_AUTO_CONTINUE_PROMPT = 'Continue with the task. Do not stop to ask whether to proceed — keep going until the task is '
|
|
1601
|
+
+ 'genuinely complete. Only stop if you have finished, or if you need a decision or input that '
|
|
1602
|
+
+ 'only the operator can provide, in which case state the specific question plainly.';
|
|
1603
|
+
/** Characters of an end-of-turn message kept on a continuation record for audit. */
|
|
1604
|
+
static CONTINUATION_MESSAGE_TAIL_CHARS = 500;
|
|
1605
|
+
/**
|
|
1606
|
+
* Drive a coding session turn-by-turn: continue a self-imposed pause, park a
|
|
1607
|
+
* genuine question, settle on completion — bounded by the profile's
|
|
1608
|
+
* continuation budget.
|
|
1609
|
+
*
|
|
1610
|
+
* The MECHANISM lives here; the JUDGMENT (`classify`) is the host's. The whole
|
|
1611
|
+
* loop fails toward settlement: any terminal stop reason, an exhausted budget,
|
|
1612
|
+
* or a classifier that is absent or throws all end the run with what the agent
|
|
1613
|
+
* has produced rather than hanging. A `NEEDS_INPUT` classification is the only
|
|
1614
|
+
* path that returns a `suspension`, and the caller must not read that as a
|
|
1615
|
+
* completed result.
|
|
1616
|
+
*/
|
|
1617
|
+
async driveCodingTurnLadder(params) {
|
|
1618
|
+
const { session } = params;
|
|
1619
|
+
const reportedFileLocations = [];
|
|
1620
|
+
// Copied into the OUTPUT's mutable element shape here: the runner hands out
|
|
1621
|
+
// readonly records, and the published contract's field is mutable.
|
|
1622
|
+
const permissionDecisions = [];
|
|
1623
|
+
const continuations = [];
|
|
1624
|
+
let usage;
|
|
1625
|
+
let deniedPermissionCount = 0;
|
|
1626
|
+
let turnIndex = 0;
|
|
1627
|
+
let autoContinuesUsed = 0;
|
|
1628
|
+
let prompt = params.firstPrompt;
|
|
1629
|
+
const emitState = (state) => {
|
|
1630
|
+
try {
|
|
1631
|
+
params.onStateChange?.(state);
|
|
1632
|
+
}
|
|
1633
|
+
catch {
|
|
1634
|
+
// A live-relay sink must never fail the run it observes.
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
// eslint-disable-next-line no-constant-condition
|
|
1638
|
+
while (true) {
|
|
1639
|
+
turnIndex += 1;
|
|
1640
|
+
emitState({ phase: CodingSessionLadderPhase.RUNNING, turnIndex });
|
|
1641
|
+
const turn = await session.promptTurn(prompt, {
|
|
1642
|
+
...(params.turnTimeoutMs !== undefined ? { turnTimeoutMs: params.turnTimeoutMs } : {}),
|
|
1643
|
+
...(params.abortSignal ? { abortSignal: params.abortSignal } : {}),
|
|
1644
|
+
});
|
|
1645
|
+
// Aggregate every turn's evidence, whatever the ladder decides next.
|
|
1646
|
+
for (const path of turn.reportedFileLocations) {
|
|
1647
|
+
if (!reportedFileLocations.includes(path))
|
|
1648
|
+
reportedFileLocations.push(path);
|
|
1649
|
+
}
|
|
1650
|
+
for (const decision of turn.permissionDecisions) {
|
|
1651
|
+
permissionDecisions.push({
|
|
1652
|
+
...decision,
|
|
1653
|
+
locations: [...decision.locations],
|
|
1654
|
+
offeredOptionKinds: [...decision.offeredOptionKinds],
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
deniedPermissionCount += turn.deniedPermissionCount;
|
|
1658
|
+
usage = this.mergeCodingUsage(usage, turn.usage);
|
|
1659
|
+
const settle = (suspension) => ({
|
|
1660
|
+
finalMessage: turn.finalMessage,
|
|
1661
|
+
stopReason: turn.stopReason,
|
|
1662
|
+
...(turn.rawStopReason ? { rawStopReason: turn.rawStopReason } : {}),
|
|
1663
|
+
usage,
|
|
1664
|
+
reportedFileLocations,
|
|
1665
|
+
deniedPermissionCount,
|
|
1666
|
+
permissionDecisions,
|
|
1667
|
+
turnCount: turnIndex,
|
|
1668
|
+
continuations,
|
|
1669
|
+
...(suspension ? { suspension } : {}),
|
|
1670
|
+
});
|
|
1671
|
+
// A non-voluntary stop (cancelled, max_tokens, refusal, or a reason this
|
|
1672
|
+
// version does not recognise) is terminal: there is nothing to continue.
|
|
1673
|
+
if (turn.stopReason !== CodingAgent_StopReason.END_TURN) {
|
|
1674
|
+
return settle();
|
|
1675
|
+
}
|
|
1676
|
+
// END_TURN: decide what it meant. No classifier → treat as complete AND
|
|
1677
|
+
// record nothing (the pre-ladder behaviour, preserved for every caller
|
|
1678
|
+
// that supplies none — a plain single turn carries no continuations).
|
|
1679
|
+
if (!params.classify) {
|
|
1680
|
+
return settle();
|
|
1681
|
+
}
|
|
1682
|
+
const classification = await this.classifyCodingTurnEndSafely(params.classify, turn.finalMessage, turnIndex);
|
|
1683
|
+
// A boundary is recorded only when the classifier was actually consulted,
|
|
1684
|
+
// so `continuations` is the audit trail of judgments, never a per-run
|
|
1685
|
+
// artefact that pollutes the single-turn shape.
|
|
1686
|
+
continuations.push({
|
|
1687
|
+
turnIndex,
|
|
1688
|
+
classification,
|
|
1689
|
+
agentMessageTail: turn.finalMessage.slice(-AgentsBackendService_1.CONTINUATION_MESSAGE_TAIL_CHARS),
|
|
1690
|
+
});
|
|
1691
|
+
if (classification === CodingAgent_EndOfTurnClassification.NEEDS_INPUT) {
|
|
1692
|
+
const suspension = {
|
|
1693
|
+
sessionId: session.sessionId,
|
|
1694
|
+
question: turn.finalMessage,
|
|
1695
|
+
turnIndex,
|
|
1696
|
+
// Answerable across the child's death only if the agent persists sessions.
|
|
1697
|
+
resumable: session.capabilities.loadSession,
|
|
1698
|
+
parkedUntil: new Date(Date.now() + params.awaitingInputTtlMs).toISOString(),
|
|
1699
|
+
};
|
|
1700
|
+
emitState({ phase: CodingSessionLadderPhase.AWAITING_INPUT, turnIndex, question: turn.finalMessage });
|
|
1701
|
+
return settle(suspension);
|
|
1702
|
+
}
|
|
1703
|
+
const isSelfPause = classification === CodingAgent_EndOfTurnClassification.SELF_PAUSE;
|
|
1704
|
+
if (!isSelfPause || autoContinuesUsed >= params.maxAutoContinuations) {
|
|
1705
|
+
// TASK_COMPLETE, CLASSIFIER_UNAVAILABLE, or a self-pause past the budget:
|
|
1706
|
+
// settle with what the agent last produced.
|
|
1707
|
+
return settle();
|
|
1708
|
+
}
|
|
1709
|
+
autoContinuesUsed += 1;
|
|
1710
|
+
prompt = AgentsBackendService_1.CODING_AUTO_CONTINUE_PROMPT;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
/**
|
|
1714
|
+
* Run the host's end-of-turn classifier, mapping every failure to
|
|
1715
|
+
* `CLASSIFIER_UNAVAILABLE` so the ladder can settle rather than hang.
|
|
1716
|
+
*
|
|
1717
|
+
* The whole point of a separate method: the fail-open contract is one place,
|
|
1718
|
+
* and an unexpected classifier value (a host returning a string outside the
|
|
1719
|
+
* enum) degrades the same way a throw does.
|
|
1720
|
+
*/
|
|
1721
|
+
async classifyCodingTurnEndSafely(classify, finalMessage, turnIndex) {
|
|
1722
|
+
try {
|
|
1723
|
+
const result = await classify({ finalMessage, turnIndex });
|
|
1724
|
+
if (Object.values(CodingAgent_EndOfTurnClassification).includes(result)) {
|
|
1725
|
+
return result;
|
|
1726
|
+
}
|
|
1727
|
+
this.logger.warn('Coding turn-end classifier returned an unrecognised value; treating the turn as complete', {
|
|
1728
|
+
turnIndex,
|
|
1729
|
+
received: String(result),
|
|
1730
|
+
});
|
|
1731
|
+
return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;
|
|
1732
|
+
}
|
|
1733
|
+
catch (error) {
|
|
1734
|
+
// Fail OPEN. An auxiliary judgment must never make the autonomous lane hang
|
|
1735
|
+
// or discard a mutated workspace; the failure is recorded, not laundered.
|
|
1736
|
+
this.logger.warn('Coding turn-end classifier failed; treating the turn as complete', {
|
|
1737
|
+
turnIndex,
|
|
1738
|
+
// A WildoBackendError does not pass `instanceof Error`, and String() on it is
|
|
1739
|
+
// "[object Object]" — which is exactly what this warn printed while the classifier was
|
|
1740
|
+
// refusing every call over a missing config bound (2026-09-04). Bounded JSON names it.
|
|
1741
|
+
error: error instanceof Error
|
|
1742
|
+
? error.message
|
|
1743
|
+
: (() => { try {
|
|
1744
|
+
return JSON.stringify(error)?.slice(0, 600) ?? String(error);
|
|
1745
|
+
}
|
|
1746
|
+
catch {
|
|
1747
|
+
return String(error);
|
|
1748
|
+
} })(),
|
|
1749
|
+
});
|
|
1750
|
+
return CodingAgent_EndOfTurnClassification.CLASSIFIER_UNAVAILABLE;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Combine per-turn usage into a session total: token counts and cost SUM
|
|
1755
|
+
* across turns; the context-window pair is a snapshot, so the latest turn's
|
|
1756
|
+
* value wins. Absence stays absence — a field nobody reported must not read as
|
|
1757
|
+
* zero, per the usage contract.
|
|
1758
|
+
*/
|
|
1759
|
+
mergeCodingUsage(accumulated, turn) {
|
|
1760
|
+
if (!turn)
|
|
1761
|
+
return accumulated;
|
|
1762
|
+
if (!accumulated)
|
|
1763
|
+
return turn;
|
|
1764
|
+
const merged = { ...accumulated };
|
|
1765
|
+
for (const key of ['inputTokens', 'outputTokens', 'cachedReadTokens', 'cachedWriteTokens', 'totalTokens']) {
|
|
1766
|
+
const a = accumulated[key];
|
|
1767
|
+
const b = turn[key];
|
|
1768
|
+
if (a !== undefined || b !== undefined)
|
|
1769
|
+
merged[key] = (a ?? 0) + (b ?? 0);
|
|
1770
|
+
}
|
|
1771
|
+
// The context window is a level, not a flow: the newest reading is current.
|
|
1772
|
+
if (turn.contextUsed !== undefined)
|
|
1773
|
+
merged.contextUsed = turn.contextUsed;
|
|
1774
|
+
if (turn.contextWindowSize !== undefined)
|
|
1775
|
+
merged.contextWindowSize = turn.contextWindowSize;
|
|
1776
|
+
if (turn.cost || accumulated.cost) {
|
|
1777
|
+
merged.cost = {
|
|
1778
|
+
amount: (accumulated.cost?.amount ?? 0) + (turn.cost?.amount ?? 0),
|
|
1779
|
+
currency: turn.cost?.currency ?? accumulated.cost?.currency ?? 'USD',
|
|
1780
|
+
};
|
|
1781
|
+
}
|
|
1782
|
+
return merged;
|
|
1783
|
+
}
|
|
1507
1784
|
buildBaseOptions(config) {
|
|
1508
1785
|
const baseOptions = {
|
|
1509
1786
|
temperature: config.temperature,
|