@wildo-ai/saas-models 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/applications/applications-context.schemas.d.ts +2 -0
- package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +36 -0
- package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/billing-account.shared.schemas.js +8 -1
- package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
- package/dist/esm/billing/billing-types.shared.schemas.d.ts +2 -2
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts +6 -6
- package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/credit-pool.shared.schemas.js +8 -4
- package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +35 -0
- package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/invoice-ref.shared.schemas.js +8 -3
- package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.d.ts +4 -4
- package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/subscription.shared.schemas.js +6 -2
- package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js +39 -0
- package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.d.ts +4 -4
- package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
- package/dist/esm/billing/usage-record.shared.schemas.js +7 -3
- package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +35 -2
- package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +61 -0
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +58 -0
- package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +14 -0
- package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts +49 -0
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js +124 -1
- package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +11 -3
- package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +93 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +116 -0
- package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -0
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +67 -12
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +95 -8
- package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +21 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js +20 -0
- package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +2 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/app-configuration-shared.shared.schemas.js +29 -0
- package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +33 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
- package/dist/esm/config/frontend/navigation.shared.schemas.js +32 -0
- package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +12 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +12 -1
- package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +13 -0
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +6 -6
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +26 -6
- package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +0 -2
- package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +1 -0
- package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +4 -3
- package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/provider-capability.shared.schemas.js +4 -3
- package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/features/user-features.shared.resources-config.schemas.js +48 -0
- package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +144 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js +136 -0
- package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -0
- package/dist/esm/files/files.shared.schemas.d.ts +45 -4
- package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
- package/dist/esm/files/files.shared.schemas.js +48 -4
- package/dist/esm/files/files.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js +33 -0
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js +6 -2
- package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js +53 -0
- package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js +43 -0
- package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +8 -3
- package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js +41 -0
- package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +0 -7
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js +23 -13
- package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/guidance-state.shared.schemas.js +8 -2
- package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js +28 -3
- package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js +51 -0
- package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
- package/dist/esm/guidance/progression-state.shared.schemas.js +18 -4
- package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +37 -3
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +29 -3
- package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts +70 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js +71 -0
- package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -0
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +36 -0
- package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +44 -0
- package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organization-members.shared.schemas.js +15 -4
- package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +18 -10
- package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js +17 -0
- package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.d.ts +59 -0
- package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
- package/dist/esm/requests/websocket.shared.schemas.js +103 -0
- package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
- package/dist/esm/resources/collection-query-parameters.shared.d.ts +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -0
- package/dist/esm/resources/collection-query-parameters.shared.js +22 -0
- package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -0
- package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.factory.js +86 -13
- package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.d.ts +162 -41
- package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
- package/dist/esm/resources/resources-config.shared.schemas.js +109 -20
- package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +21 -6
- package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +57 -0
- package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/authentication.shared.schemas.js +64 -0
- package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +17 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js +16 -0
- package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js +28 -0
- package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js +21 -0
- package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +43 -0
- package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +0 -8
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +13 -4
- package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js +16 -1
- package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts +54 -0
- package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.shared.utils.js +59 -0
- package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +61 -0
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +13 -1
- package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js +35 -0
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js +7 -1
- package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +34 -0
- package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/inbound-contacts.shared.schemas.js +7 -4
- package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js +37 -0
- package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-credentials.shared.schemas.js +17 -2
- package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js +36 -0
- package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-identity-links.shared.schemas.js +15 -5
- package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +53 -0
- package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +62 -0
- package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +53 -0
- package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js +62 -0
- package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/users/users.shared.schemas.d.ts +19 -0
- package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
- package/dist/esm/users/users.shared.schemas.js +41 -16
- package/dist/esm/users/users.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -6
- package/dist/esm/.builder.pid +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-execution.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAA2E,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kDAAkD,CAAC;AAE1D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,iEAAiE;AACjE,8BAA8B;AAC9B,iEAAiE;AAEjE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,4BAKX;AALD,WAAY,4BAA4B;IACtC,6CAAa,CAAA;IACb,uDAAuB,CAAA;IACvB,iDAAiB,CAAA;IACjB,6CAAa,CAAA;AACf,CAAC,EALW,4BAA4B,KAA5B,4BAA4B,QAKvC;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,8BAKX;AALD,WAAY,8BAA8B;IACxC,+CAAa,CAAA;IACb,uDAAqB,CAAA;IACrB,uDAAqB,CAAA;IACrB,+CAAa,CAAA;AACf,CAAC,EALW,8BAA8B,KAA9B,8BAA8B,QAKzC;AAED,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,wEAAwE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AE;IAChE,UAAU,EAAE,4BAA4B,CAAC,KAAK,CAAC,UAAU;IACzD;;;;;;;;;;;;;;OAcG;IACH,cAAc,EAAE,4BAA4B,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE;CAC5E,CAAC,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Persisted Resource Schema (POLYMORPHIC)\n * ================================================================\n *\n * A persisted record of a single flow/actor **system execution** — in v1 the\n * durable source of truth for a conversational chat log (`messages[]`) plus the\n * execution's lifecycle status.\n *\n * POLYMORPHIC ACROSS OWNER SCOPE. The SAME base envelope is stamped out as THREE\n * genuine single-scope resources by `declarePolymorphicSchemas()`, one owner FK\n * injected per variant:\n * - `userFlowActorExecutions` (USER_SELF — `userId`) ← WS chat + user-delegated A2A\n * - `organizationFlowActorExecutions` (ORGANIZATIONS — `organizationId`) ← org-machine A2A\n * - `applicationFlowActorExecutions` (APPLICATION — `applicationId`) ← app-machine A2A\n *\n * A conversation is owned by EXACTLY ONE scope (its injected owner FK). There is\n * no cross-scope audit dimension on the base — ownership IS the scope. This is the\n * honest \"one concept, N owners\" model (mirrors billing accounts / subscriptions)\n * and needs ZERO core-authorizer change: each variant satisfies its own scope\n * authorizer, and `polymorphicRole` resolves the operation roles per scope. A\n * machine (API key / OIDC client) reaches its org/app variant exactly as it\n * reaches any other org/app resource — standard RBAC via its granted roles.\n *\n * KIND-AGNOSTIC BY DESIGN. A `FlowActorSystem_Kind` discriminant lets the SAME\n * resource persist both flow and actor executions. v1 implements the ACTOR\n * conversational path; the FLOW path drops in without reshaping the base envelope.\n *\n * @see flows-actors.system.shared.schemas.ts — the base execution envelope\n * @see billing-account.shared.schemas.ts — the polymorphic-scope precedent\n * @see requests/websocket.shared.schemas.ts — the streamed message payload this\n * log mirrors (`WS_FlowsActorsMessagePayloadSchema`)\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE, FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Conversational message log\n//===============================================================\n\n/**\n * Author of a persisted conversational message. `TOOL` records a tool-call /\n * tool-result turn (grounding retrieval); `SYSTEM` records a system/status note.\n * WS-streamed messages are always server→client, so the transport shape carries\n * no role — the persisted log adds it to reconstruct a full transcript.\n */\nexport enum FlowsActors_ConversationRole {\n USER = 'user',\n ASSISTANT = 'assistant',\n SYSTEM = 'system',\n TOOL = 'tool',\n}\n\n/**\n * Rendering hint for a message body. Mirrors the streamed\n * `WS_FlowsActorsMessagePayloadSchema.messageType` literal union exactly\n * (`text | markdown | progress | data`) as an enum so the persisted log and the\n * live stream share one vocabulary (framework rule: enums over literal unions).\n */\nexport enum FlowsActors_MessageContentType {\n TEXT = 'text',\n MARKDOWN = 'markdown',\n PROGRESS = 'progress',\n DATA = 'data',\n}\n\nexport const FlowActorExecution_MessageSchema = z.object({\n /** Stable per-message id (client-correlatable across stream deltas). */\n id: z.uuid(),\n role: z.enum(FlowsActors_ConversationRole),\n contentType: z.enum(FlowsActors_MessageContentType).default(FlowsActors_MessageContentType.TEXT),\n /** Rendered text content (may be assembled from streamed deltas). */\n content: z.string(),\n /** Structured payload for `DATA`/`PROGRESS` messages (tool results, progress). */\n data: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.date().default(() => new Date()),\n});\nexport type FlowActorExecution_Message = z.infer<typeof FlowActorExecution_MessageSchema>;\n\n/**\n * The SUSPENDED-TURN state persisted when an agent turn pauses at a human-in-the-loop\n * approval boundary (execution `status` = `AWAITING_APPROVAL`). It is stored SERIALIZED as a\n * JSON string in the `pausedApproval` scalar field — NOT as a nested Zod object — because heavy\n * nested sub-structures do not round-trip through the Zod→Mongoose embedded-subdocument\n * conversion (see the per-kind state note below). Parse/serialize ONLY via the helpers below at\n * the persistence boundary; the record column itself stays a plain string.\n */\nexport const FlowActorExecution_PausedApprovalSchema = z.object({\n /**\n * Correlates the emitted approval REQUEST with the inbound decision (idempotency key).\n *\n * An OPAQUE identifier minted by the model SDK — NOT a Wildo id and NOT a UUID. It was typed\n * `z.uuid()` on the reasonable-looking assumption that an id is a uuid, and the SDK produces\n * values like `aitxt-3Xfhq68r7GTRXEuV1YzU4eEc`.\n *\n * That single wrong assumption made EVERY paused turn unresumable, and hid completely: serializing\n * is `JSON.stringify` and does not validate, so the pause persisted perfectly; only the resume's\n * `parse` rejected it, as a CORRUPTED blob. The turn then stayed paused forever with a\n * \"state is unreadable\" error naming the wrong cause. Unit fixtures used a real uuid, so they were\n * more conformant than production and could never reproduce it — the live lane found it.\n *\n * Validate it as an opaque non-empty string. We do not own the format and must not assert one.\n */\n approvalId: z.string().min(1),\n /**\n * The AI-SDK model-message array to RESUME from — opaque to us (the SDK's own resume\n * contract). Captured when the approval-gated tool call suspended the stream; on the human\n * decision the runtime appends a tool-approval-response and re-invokes with these messages.\n */\n sdkModelMessages: z.array(z.record(z.string(), z.unknown())),\n /** The approval-gated tool the model wants to call (drives the human-facing prompt). */\n pendingToolName: z.string(),\n /** The pending tool call's arguments (drives the human-facing action description). */\n pendingToolArgs: z.record(z.string(), z.unknown()).optional(),\n /** ISO timestamp when the approval was requested. */\n requestedAt: z.string(),\n /** Optional ISO expiry after which the paused turn is auto-failed. */\n expiresAt: z.string().optional(),\n});\nexport type FlowActorExecution_PausedApproval = z.infer<typeof FlowActorExecution_PausedApprovalSchema>;\n\n/** Serialize paused-approval state for the scalar `pausedApproval` string column. */\nexport function serializeFlowActorPausedApproval(state: FlowActorExecution_PausedApproval): string {\n return JSON.stringify(state);\n}\n\n/**\n * Parse the scalar `pausedApproval` string column back to typed state. Throws (ZodError /\n * SyntaxError) on a malformed blob — a corrupted paused record must fail loudly at resume,\n * never silently resume from garbage.\n */\nexport function parseFlowActorPausedApproval(raw: string): FlowActorExecution_PausedApproval {\n return FlowActorExecution_PausedApprovalSchema.parse(JSON.parse(raw));\n}\n\n//===============================================================\n// Per-kind execution state (reused from the shared execution types)\n//===============================================================\n\n// NOTE (v1 scope): the persisted record is the CONVERSATIONAL envelope only —\n// `kind` + `status`/`statusChanges` + the `messages[]` chat log. The richer\n// per-kind graph-state slots (`flowState` node-states / `actorState` plan+tasks,\n// sliced from `FlowSystem_Execution` / `ActorSystem_Execution`) are intentionally\n// NOT persisted yet: the v1 conversational runtime never writes them, and those\n// heavy nested sub-structures (required `plan`/`walkthrough`/`standaloneTasks`\n// with embedded `_id`s) do not round-trip through the Zod→Mongoose embedded-\n// subdocument conversion as optional slots (empty subdocs get instantiated and\n// fail required-path validation). When the flow/actor orchestration runtime\n// actually produces graph state, add typed `flowState`/`actorState` back WITH the\n// embedded-subdocument treatment (see the zod↔mongoose nested-union / embedded-id\n// notes) rather than a raw `.pick()`. `kind` already preserves discrimination.\n\n//===============================================================\n// Base execution record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The conversation envelope shared by every scope variant. It carries NO owner\n * scope FK: `declarePolymorphicSchemas()` injects exactly ONE (`userId` /\n * `organizationId` / `applicationId`) per variant. Do NOT add an `initiator`\n * snapshot here — a nested `initiator.userId`/`.organizationId` collides with the\n * contextual scope filter (it matches the field identifier at every schema path\n * and injects an exact-subdocument clause that never equals the stored snapshot,\n * so every scoped read/update silently matches zero rows). Ownership lives ONLY on\n * the single injected top-level owner FK.\n */\nexport const FlowActorExecutionBaseSchema = z.object({\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey(),\n\n /**\n * Stable business id of the execution, generated by the conversational runtime\n * and echoed over the WebSocket channel (`WS_FlowsActors*.executionId`). Unique\n * per variant collection (a UUID — no cross-collection collision). Immutable\n * once created.\n */\n executionId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n // === System identity (set on create, immutable) ===\n /** Ref of the executed flow/actor system (`FlowActorSystem.ref`). */\n systemRef: z.string().isDBIndexed().excludeFromUpdate().isSummaryField(),\n /** Discriminant selecting which state slot is populated. */\n kind: z.enum(FlowActorSystem_Kind).isDBIndexed().excludeFromUpdate().isSummaryField(),\n\n // === Runtime status ===\n /**\n * WHICH agent this conversation was opened through — part of the read filter, not metadata.\n *\n * The task family carried this from gate #3; executions did not, so a caller holding a\n * `contextId` could continue that thread through a DIFFERENT declared agent and load the prior\n * transcript into the other agent's context. A2A agents are declared as separate resource servers\n * with per-instance token audiences, and the plane at risk here holds the full message log — not\n * a 120-character title (review finding G5-8).\n *\n * The WebSocket surface has no agent, and the default A2A agent is an identity of its own; both\n * store {@link FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE}.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this conversation — part of the read filter, not metadata.\n *\n * Identical axis and identical reasoning to the task family: the injected scope FK does not\n * identify the principal on the machine variants (`applicationId` is a deployment singleton;\n * `organizationId` is shared by every machine client of one tenant), so without it a\n * separately-credentialed client could read and continue another client's conversation — which\n * carries the full message log, not merely a title.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: the human is the\n * principal there and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n statusChanges: z.array(z.object({\n status: z.enum(FlowsActors_Status),\n timestamp: z.date(),\n })).default([]),\n\n // === Conversational log (chat history) ===\n /**\n * The conversation transcript.\n *\n * ## Provenance: SUBJECT_PROVIDED, and the asymmetry is the reason (review finding F5-6)\n *\n * This array MIXES subject-authored turns (`role: USER`) with model-generated ones\n * (`role: ASSISTANT`), and provenance is declared per FIELD — there is no per-element mechanism,\n * so one classification must cover both. The two ways of being wrong are not equally bad:\n *\n * • Classifying DERIVED would EXCLUDE the subject's own words from an Art. 20 bundle. That is a\n * failure of the right the article exists to serve.\n * • Classifying SUBJECT_PROVIDED includes the assistant's replies alongside them. That is\n * over-delivery — but of a transcript the subject was a party to and already saw, which is the\n * natural unit a person means by \"my conversation\".\n *\n * So the classification follows the ASYMMETRY, not a per-element truth we cannot express. Revisit\n * only if per-element provenance ever exists; splitting the array by role at export time was\n * considered and rejected as inventing a second mechanism for one field.\n *\n * ⚠️ **This is a LABELLING change, not a behaviour change**, and the first version of this note\n * failed to say so. `resolvePortabilityFieldScope` maps `SUBJECT_PROVIDED` *and* `OBSERVED` to\n * `INCLUDED`, and the resource default was already `OBSERVED` — so `messages` was in the Art. 20\n * bundle before and after. Nothing about an export changes.\n *\n * The rejected alternative the first version omitted is the one that was actually in force:\n * **`OBSERVED`** — \"data generated by the subject's USE of the service\", a defensible reading of a\n * mixed transcript. It is rejected for precision rather than effect: the USER turns are authored\n * BY the subject, not merely observed of them, and a classification should say the truest thing\n * available even when two values resolve alike today.\n *\n * The task family's `output`/`artifacts` are DERIVED by contrast, and that is not an\n * inconsistency: those are model output ABOUT the work, with no subject-authored content mixed in.\n */\n messages: FlowActorExecution_MessageSchema.array().default([])\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The conversation itself. Category as well as provenance, so a notice can enumerate it: the two\n // axes answer different questions and a provenance alone leaves the field an OUTSTANDING gap.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n\n // === HITL (human-in-the-loop) suspension ===\n /**\n * Serialized {@link FlowActorExecution_PausedApproval} — present ONLY while `status` is\n * `AWAITING_APPROVAL`. A scalar JSON string (see that schema's doc for why it is NOT a nested\n * object: the Zod→Mongoose round-trip). Set on pause, cleared on resume / terminal completion;\n * never authored on create.\n */\n /**\n * Serialized suspended-turn state; `null` once a decision releases the pause.\n *\n * `.nullish()`, not `.optional()`, and the difference is load-bearing at the READ. Clearing writes\n * an explicit `null`; the write then re-parses the row to project its response, and under\n * `.optional()` that projection throws `expected string, received null`. The clear PERSISTS (there\n * is no transaction to roll back) and the operation still fails — so the pause was released and\n * the resume aborted, leaving the turn `failed` with its work never done, reported as a resource\n * transformation error that names nothing about approvals.\n *\n * The input contract needing `.nullish()` (see `FlowActorExecutionUpdateInternalSchema`) is a\n * SEPARATE surface from this one. Fixing only that gets the value written and still throws on the\n * way out — both must admit null or neither does.\n */\n // This blob contains SDK resume messages and pending tool arguments. It is\n // runtime continuation state, not conversation content: generic client reads,\n // summaries and generated API schemas must never disclose it.\n pausedApproval: z.string().nullish().excludeFromCreate().isBackendOnly(),\n\n // === Timing (system-managed; defaults are load-bearing — the create pipeline\n // strips these then date-coerces, so a missing default → Invalid Date) ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isSummaryField(),\n /** Set on terminal completion (via UPDATE); never on create. */\n finishedAt: z.date().optional().excludeFromCreate().isSummaryField(),\n});\nexport type FlowActorExecutionBase = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a flows-actors execution is stamped out for.\n * Each is `isPrimaryScope: true` (the injected owner FK is the primary scope), and\n * each opts OUT of the singleton auto-business-key: a conversation is MULTI-ROW\n * per scope (many discussions per user/org/app), so the injected owner FK must NOT\n * be marked `.isUnique()` — otherwise the second conversation per scope would fail\n * with a duplicate-key error. Mirrors subscriptions / usage-records / SSO\n * connections (all multi-row polymorphic resources).\n */\nexport const FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors executions. Produces 3 variants:\n * - users → `userFlowActorExecutions` (`userId` injected)\n * - organizations→ `organizationFlowActorExecutions` (`organizationId` injected)\n * - applications → `applicationFlowActorExecutions` (`applicationId` injected)\n */\nexport const flowActorExecutionsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorExecutions',\n baseFieldIdentifier: 'flowActorExecutionId',\n baseEnumKey: 'FLOW_ACTOR_EXECUTIONS',\n baseSchema: FlowActorExecutionBaseSchema,\n variants: FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — status transitions, appended messages, completion\n * time. Shared across all variants because it references NO owner FK (owner is\n * immutable). `updatedAt` is system-managed; identity fields are `.excludeFromUpdate()`.\n */\nexport const FlowActorExecutionUpdateInternalSchema = z.object({\n status: FlowActorExecutionBaseSchema.shape.status.optional(),\n statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.optional(),\n messages: FlowActorExecutionBaseSchema.shape.messages.optional(),\n finishedAt: FlowActorExecutionBaseSchema.shape.finishedAt,\n /**\n * The suspended-turn state, written when a turn pauses for a human decision and cleared when one\n * arrives.\n *\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST, and omitting a field here does not fail — it makes the write\n * SUCCEED and persist nothing. `pausedApproval` was added to the base envelope when the column was\n * introduced but never here, so every approval pause wrote its status and its messages and\n * silently dropped the one field that makes the turn resumable. The row read back as\n * `AWAITING_APPROVAL` with no state to resume from: a turn stuck forever, with no error anywhere.\n * Adding a persisted field is therefore never done without adding it to this contract.\n *\n * `.nullish()` rather than `.optional()` because clearing is a real transition: the resume writes\n * an explicit `null` to release the pause, and under `.optional()` that null is rejected — which\n * would leave a resumed turn still advertising a decision nobody can answer.\n */\n pausedApproval: FlowActorExecutionBaseSchema.shape.pausedApproval.nullish(),\n});\n\n//===============================================================\n// Exported runtime type\n//===============================================================\n\n/**\n * Runtime shape of a persisted execution (the base envelope). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the conversational runtime supplies it explicitly on create.\n */\nexport type FlowActorExecution = z.infer<typeof FlowActorExecutionBaseSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"flows-actors-execution.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-execution.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAA2E,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kDAAkD,CAAC;AAE1D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,iEAAiE;AACjE,8BAA8B;AAC9B,iEAAiE;AAEjE;;;;;GAKG;AACH,MAAM,CAAN,IAAY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C;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,yBAAyB,CAAC;IACjF,gBAAgB,EAAE,qBAAqB;IACvC,mBAAmB,EAAE,sBAAsB;IAC3C,WAAW,EAAE,uBAAuB;IACpC,UAAU,EAAE,4BAA4B;IACxC,QAAQ,EAAE,mCAAmC;CAC9C,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,MAAM,EAAE,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC5D,aAAa,EAAE,4BAA4B,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE;IAC1E,QAAQ,EAAE,4BAA4B,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE;IAChE,UAAU,EAAE,4BAA4B,CAAC,KAAK,CAAC,UAAU;IACzD;;;;;;;;;;;;;;OAcG;IACH,cAAc,EAAE,4BAA4B,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE;CAC5E,CAAC,CAAC","sourcesContent":["/**\n * Flows-Actors Execution — Persisted Resource Schema (POLYMORPHIC)\n * ================================================================\n *\n * A persisted record of a single flow/actor **system execution** — in v1 the\n * durable source of truth for a conversational chat log (`messages[]`) plus the\n * execution's lifecycle status.\n *\n * POLYMORPHIC ACROSS OWNER SCOPE. The SAME base envelope is stamped out as THREE\n * genuine single-scope resources by `declarePolymorphicSchemas()`, one owner FK\n * injected per variant:\n * - `userFlowActorExecutions` (USER_SELF — `userId`) ← WS chat + user-delegated A2A\n * - `organizationFlowActorExecutions` (ORGANIZATIONS — `organizationId`) ← org-machine A2A\n * - `applicationFlowActorExecutions` (APPLICATION — `applicationId`) ← app-machine A2A\n *\n * A conversation is owned by EXACTLY ONE scope (its injected owner FK). There is\n * no cross-scope audit dimension on the base — ownership IS the scope. This is the\n * honest \"one concept, N owners\" model (mirrors billing accounts / subscriptions)\n * and needs ZERO core-authorizer change: each variant satisfies its own scope\n * authorizer, and `polymorphicRole` resolves the operation roles per scope. A\n * machine (API key / OIDC client) reaches its org/app variant exactly as it\n * reaches any other org/app resource — standard RBAC via its granted roles.\n *\n * KIND-AGNOSTIC BY DESIGN. A `FlowActorSystem_Kind` discriminant lets the SAME\n * resource persist both flow and actor executions. v1 implements the ACTOR\n * conversational path; the FLOW path drops in without reshaping the base envelope.\n *\n * @see flows-actors.system.shared.schemas.ts — the base execution envelope\n * @see billing-account.shared.schemas.ts — the polymorphic-scope precedent\n * @see requests/websocket.shared.schemas.ts — the streamed message payload this\n * log mirrors (`WS_FlowsActorsMessagePayloadSchema`)\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE, FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { FlowActorSystem_Kind } from './flows-actors.system.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Conversational message log\n//===============================================================\n\n/**\n * Author of a persisted conversational message. `TOOL` records a tool-call /\n * tool-result turn (grounding retrieval); `SYSTEM` records a system/status note.\n * WS-streamed messages are always server→client, so the transport shape carries\n * no role — the persisted log adds it to reconstruct a full transcript.\n */\nexport enum FlowsActors_ConversationRole {\n USER = 'user',\n ASSISTANT = 'assistant',\n SYSTEM = 'system',\n TOOL = 'tool',\n}\n\n/**\n * Rendering hint for a message body. Mirrors the streamed\n * `WS_FlowsActorsMessagePayloadSchema.messageType` literal union exactly\n * (`text | markdown | progress | data`) as an enum so the persisted log and the\n * live stream share one vocabulary (framework rule: enums over literal unions).\n */\nexport enum FlowsActors_MessageContentType {\n TEXT = 'text',\n MARKDOWN = 'markdown',\n PROGRESS = 'progress',\n DATA = 'data',\n}\n\nexport const FlowActorExecution_MessageSchema = z.object({\n /** Stable per-message id (client-correlatable across stream deltas). */\n id: z.uuid(),\n role: z.enum(FlowsActors_ConversationRole),\n contentType: z.enum(FlowsActors_MessageContentType).default(FlowsActors_MessageContentType.TEXT),\n /** Rendered text content (may be assembled from streamed deltas). */\n content: z.string(),\n /** Structured payload for `DATA`/`PROGRESS` messages (tool results, progress). */\n data: z.record(z.string(), z.unknown()).optional(),\n createdAt: z.date().default(() => new Date()),\n});\nexport type FlowActorExecution_Message = z.infer<typeof FlowActorExecution_MessageSchema>;\n\n/**\n * The SUSPENDED-TURN state persisted when an agent turn pauses at a human-in-the-loop\n * approval boundary (execution `status` = `AWAITING_APPROVAL`). It is stored SERIALIZED as a\n * JSON string in the `pausedApproval` scalar field — NOT as a nested Zod object — because heavy\n * nested sub-structures do not round-trip through the Zod→Mongoose embedded-subdocument\n * conversion (see the per-kind state note below). Parse/serialize ONLY via the helpers below at\n * the persistence boundary; the record column itself stays a plain string.\n */\nexport const FlowActorExecution_PausedApprovalSchema = z.object({\n /**\n * Correlates the emitted approval REQUEST with the inbound decision (idempotency key).\n *\n * An OPAQUE identifier minted by the model SDK — NOT a Wildo id and NOT a UUID. It was typed\n * `z.uuid()` on the reasonable-looking assumption that an id is a uuid, and the SDK produces\n * values like `aitxt-3Xfhq68r7GTRXEuV1YzU4eEc`.\n *\n * That single wrong assumption made EVERY paused turn unresumable, and hid completely: serializing\n * is `JSON.stringify` and does not validate, so the pause persisted perfectly; only the resume's\n * `parse` rejected it, as a CORRUPTED blob. The turn then stayed paused forever with a\n * \"state is unreadable\" error naming the wrong cause. Unit fixtures used a real uuid, so they were\n * more conformant than production and could never reproduce it — the live lane found it.\n *\n * Validate it as an opaque non-empty string. We do not own the format and must not assert one.\n */\n approvalId: z.string().min(1),\n /**\n * The AI-SDK model-message array to RESUME from — opaque to us (the SDK's own resume\n * contract). Captured when the approval-gated tool call suspended the stream; on the human\n * decision the runtime appends a tool-approval-response and re-invokes with these messages.\n */\n sdkModelMessages: z.array(z.record(z.string(), z.unknown())),\n /** The approval-gated tool the model wants to call (drives the human-facing prompt). */\n pendingToolName: z.string(),\n /** The pending tool call's arguments (drives the human-facing action description). */\n pendingToolArgs: z.record(z.string(), z.unknown()).optional(),\n /** ISO timestamp when the approval was requested. */\n requestedAt: z.string(),\n /** Optional ISO expiry after which the paused turn is auto-failed. */\n expiresAt: z.string().optional(),\n});\nexport type FlowActorExecution_PausedApproval = z.infer<typeof FlowActorExecution_PausedApprovalSchema>;\n\n/** Serialize paused-approval state for the scalar `pausedApproval` string column. */\nexport function serializeFlowActorPausedApproval(state: FlowActorExecution_PausedApproval): string {\n return JSON.stringify(state);\n}\n\n/**\n * Parse the scalar `pausedApproval` string column back to typed state. Throws (ZodError /\n * SyntaxError) on a malformed blob — a corrupted paused record must fail loudly at resume,\n * never silently resume from garbage.\n */\nexport function parseFlowActorPausedApproval(raw: string): FlowActorExecution_PausedApproval {\n return FlowActorExecution_PausedApprovalSchema.parse(JSON.parse(raw));\n}\n\n//===============================================================\n// Per-kind execution state (reused from the shared execution types)\n//===============================================================\n\n// NOTE (v1 scope): the persisted record is the CONVERSATIONAL envelope only —\n// `kind` + `status`/`statusChanges` + the `messages[]` chat log. The richer\n// per-kind graph-state slots (`flowState` node-states / `actorState` plan+tasks,\n// sliced from `FlowSystem_Execution` / `ActorSystem_Execution`) are intentionally\n// NOT persisted yet: the v1 conversational runtime never writes them, and those\n// heavy nested sub-structures (required `plan`/`walkthrough`/`standaloneTasks`\n// with embedded `_id`s) do not round-trip through the Zod→Mongoose embedded-\n// subdocument conversion as optional slots (empty subdocs get instantiated and\n// fail required-path validation). When the flow/actor orchestration runtime\n// actually produces graph state, add typed `flowState`/`actorState` back WITH the\n// embedded-subdocument treatment (see the zod↔mongoose nested-union / embedded-id\n// notes) rather than a raw `.pick()`. `kind` already preserves discrimination.\n\n//===============================================================\n// Base execution record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The conversation envelope shared by every scope variant. It carries NO owner\n * scope FK: `declarePolymorphicSchemas()` injects exactly ONE (`userId` /\n * `organizationId` / `applicationId`) per variant. Do NOT add an `initiator`\n * snapshot here — a nested `initiator.userId`/`.organizationId` collides with the\n * contextual scope filter (it matches the field identifier at every schema path\n * and injects an exact-subdocument clause that never equals the stored snapshot,\n * so every scoped read/update silently matches zero rows). Ownership lives ONLY on\n * the single injected top-level owner FK.\n */\nexport const FlowActorExecutionBaseSchema = z.object({\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey(),\n\n /**\n * Stable business id of the execution, generated by the conversational runtime\n * and echoed over the WebSocket channel (`WS_FlowsActors*.executionId`). Unique\n * per variant collection (a UUID — no cross-collection collision). Immutable\n * once created.\n */\n executionId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n // === System identity (set on create, immutable) ===\n /** Ref of the executed flow/actor system (`FlowActorSystem.ref`). */\n systemRef: z.string().isDBIndexed().excludeFromUpdate().isSummaryField(),\n /** Discriminant selecting which state slot is populated. */\n kind: z.enum(FlowActorSystem_Kind).isDBIndexed().excludeFromUpdate().isSummaryField(),\n\n // === Runtime status ===\n /**\n * WHICH agent this conversation was opened through — part of the read filter, not metadata.\n *\n * The task family carried this from gate #3; executions did not, so a caller holding a\n * `contextId` could continue that thread through a DIFFERENT declared agent and load the prior\n * transcript into the other agent's context. A2A agents are declared as separate resource servers\n * with per-instance token audiences, and the plane at risk here holds the full message log — not\n * a 120-character title (review finding G5-8).\n *\n * The WebSocket surface has no agent, and the default A2A agent is an identity of its own; both\n * store {@link FLOWS_ACTORS_DEFAULT_AGENT_INSTANCE}.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this conversation — part of the read filter, not metadata.\n *\n * Identical axis and identical reasoning to the task family: the injected scope FK does not\n * identify the principal on the machine variants (`applicationId` is a deployment singleton;\n * `organizationId` is shared by every machine client of one tenant), so without it a\n * separately-credentialed client could read and continue another client's conversation — which\n * carries the full message log, not merely a title.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: the human is the\n * principal there and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n statusChanges: z.array(z.object({\n status: z.enum(FlowsActors_Status),\n timestamp: z.date(),\n })).default([]),\n\n // === Conversational log (chat history) ===\n /**\n * The conversation transcript.\n *\n * ## Provenance: SUBJECT_PROVIDED, and the asymmetry is the reason (review finding F5-6)\n *\n * This array MIXES subject-authored turns (`role: USER`) with model-generated ones\n * (`role: ASSISTANT`), and provenance is declared per FIELD — there is no per-element mechanism,\n * so one classification must cover both. The two ways of being wrong are not equally bad:\n *\n * • Classifying DERIVED would EXCLUDE the subject's own words from an Art. 20 bundle. That is a\n * failure of the right the article exists to serve.\n * • Classifying SUBJECT_PROVIDED includes the assistant's replies alongside them. That is\n * over-delivery — but of a transcript the subject was a party to and already saw, which is the\n * natural unit a person means by \"my conversation\".\n *\n * So the classification follows the ASYMMETRY, not a per-element truth we cannot express. Revisit\n * only if per-element provenance ever exists; splitting the array by role at export time was\n * considered and rejected as inventing a second mechanism for one field.\n *\n * ⚠️ **This is a LABELLING change, not a behaviour change**, and the first version of this note\n * failed to say so. `resolvePortabilityFieldScope` maps `SUBJECT_PROVIDED` *and* `OBSERVED` to\n * `INCLUDED`, and the resource default was already `OBSERVED` — so `messages` was in the Art. 20\n * bundle before and after. Nothing about an export changes.\n *\n * The rejected alternative the first version omitted is the one that was actually in force:\n * **`OBSERVED`** — \"data generated by the subject's USE of the service\", a defensible reading of a\n * mixed transcript. It is rejected for precision rather than effect: the USER turns are authored\n * BY the subject, not merely observed of them, and a classification should say the truest thing\n * available even when two values resolve alike today.\n *\n * The task family's `output`/`artifacts` are DERIVED by contrast, and that is not an\n * inconsistency: those are model output ABOUT the work, with no subject-authored content mixed in.\n */\n // RESET on erasure — returns this field to its schema default. It holds the conversation itself,\n // which the category above correctly declares as personal data. RESET rather than REMOVE or MASK\n // because the field is non-nullable WITH a `.default()`: REMOVE needs a clearable field and MASK\n // needs a string. The value comes from the schema, so there is no second copy to drift.\n messages: addImpersonalizeWith(\n FlowActorExecution_MessageSchema.array().default([])\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The conversation itself. Category as well as provenance, so a notice can enumerate it: the two\n // axes answer different questions and a provenance alone leaves the field an OUTSTANDING gap.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.RESET,\n ),\n\n // === HITL (human-in-the-loop) suspension ===\n /**\n * Serialized {@link FlowActorExecution_PausedApproval} — present ONLY while `status` is\n * `AWAITING_APPROVAL`. A scalar JSON string (see that schema's doc for why it is NOT a nested\n * object: the Zod→Mongoose round-trip). Set on pause, cleared on resume / terminal completion;\n * never authored on create.\n */\n /**\n * Serialized suspended-turn state; `null` once a decision releases the pause.\n *\n * `.nullish()`, not `.optional()`, and the difference is load-bearing at the READ. Clearing writes\n * an explicit `null`; the write then re-parses the row to project its response, and under\n * `.optional()` that projection throws `expected string, received null`. The clear PERSISTS (there\n * is no transaction to roll back) and the operation still fails — so the pause was released and\n * the resume aborted, leaving the turn `failed` with its work never done, reported as a resource\n * transformation error that names nothing about approvals.\n *\n * The input contract needing `.nullish()` (see `FlowActorExecutionUpdateInternalSchema`) is a\n * SEPARATE surface from this one. Fixing only that gets the value written and still throws on the\n * way out — both must admit null or neither does.\n */\n // This blob contains SDK resume messages and pending tool arguments. It is\n // runtime continuation state, not conversation content: generic client reads,\n // summaries and generated API schemas must never disclose it.\n pausedApproval: z.string().nullish().excludeFromCreate().isBackendOnly(),\n\n // === Timing (system-managed; defaults are load-bearing — the create pipeline\n // strips these then date-coerces, so a missing default → Invalid Date) ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isSummaryField(),\n /** Set on terminal completion (via UPDATE); never on create. */\n finishedAt: z.date().optional().excludeFromCreate().isSummaryField(),\n});\nexport type FlowActorExecutionBase = z.infer<typeof FlowActorExecutionBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a flows-actors execution is stamped out for.\n * Each is `isPrimaryScope: true` (the injected owner FK is the primary scope), and\n * each opts OUT of the singleton auto-business-key: a conversation is MULTI-ROW\n * per scope (many discussions per user/org/app), so the injected owner FK must NOT\n * be marked `.isUnique()` — otherwise the second conversation per scope would fail\n * with a duplicate-key error. Mirrors subscriptions / usage-records / SSO\n * connections (all multi-row polymorphic resources).\n */\nexport const FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors executions. Produces 3 variants:\n * - users → `userFlowActorExecutions` (`userId` injected)\n * - organizations→ `organizationFlowActorExecutions` (`organizationId` injected)\n * - applications → `applicationFlowActorExecutions` (`applicationId` injected)\n */\nexport const flowActorExecutionsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorExecutions',\n baseFieldIdentifier: 'flowActorExecutionId',\n baseEnumKey: 'FLOW_ACTOR_EXECUTIONS',\n baseSchema: FlowActorExecutionBaseSchema,\n variants: FLOW_ACTOR_EXECUTION_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — status transitions, appended messages, completion\n * time. Shared across all variants because it references NO owner FK (owner is\n * immutable). `updatedAt` is system-managed; identity fields are `.excludeFromUpdate()`.\n */\nexport const FlowActorExecutionUpdateInternalSchema = z.object({\n status: FlowActorExecutionBaseSchema.shape.status.optional(),\n statusChanges: FlowActorExecutionBaseSchema.shape.statusChanges.optional(),\n messages: FlowActorExecutionBaseSchema.shape.messages.optional(),\n finishedAt: FlowActorExecutionBaseSchema.shape.finishedAt,\n /**\n * The suspended-turn state, written when a turn pauses for a human decision and cleared when one\n * arrives.\n *\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST, and omitting a field here does not fail — it makes the write\n * SUCCEED and persist nothing. `pausedApproval` was added to the base envelope when the column was\n * introduced but never here, so every approval pause wrote its status and its messages and\n * silently dropped the one field that makes the turn resumable. The row read back as\n * `AWAITING_APPROVAL` with no state to resume from: a turn stuck forever, with no error anywhere.\n * Adding a persisted field is therefore never done without adding it to this contract.\n *\n * `.nullish()` rather than `.optional()` because clearing is a real transition: the resume writes\n * an explicit `null` to release the pause, and under `.optional()` that null is rejected — which\n * would leave a resumed turn still advertising a decision nobody can answer.\n */\n pausedApproval: FlowActorExecutionBaseSchema.shape.pausedApproval.nullish(),\n});\n\n//===============================================================\n// Exported runtime type\n//===============================================================\n\n/**\n * Runtime shape of a persisted execution (the base envelope). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the conversational runtime supplies it explicitly on create.\n */\nexport type FlowActorExecution = z.infer<typeof FlowActorExecutionBaseSchema>;\n"]}
|
|
@@ -55,5 +55,5 @@ import { CoreResourceOperation } from '../resources/resources.shared.core.defini
|
|
|
55
55
|
* - organizationFlowActorTasks
|
|
56
56
|
* - applicationFlowActorTasks
|
|
57
57
|
*/
|
|
58
|
-
export declare const flowActorTasksPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
|
|
58
|
+
export declare const flowActorTasksPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<undefined, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
|
|
59
59
|
//# sourceMappingURL=flows-actors-task.shared.resources-config.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-task.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"flows-actors-task.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAGH,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AA4DzG;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,oRAgL9C,CAAC"}
|
|
@@ -52,6 +52,7 @@ import { ResourceSystemAccessMode } from '../resources/resources-config.shared.s
|
|
|
52
52
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
53
53
|
import { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory.js';
|
|
54
54
|
import { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas.js';
|
|
55
|
+
import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
|
|
55
56
|
import { flowActorTasksPolymorphicDeclaration, FlowActorTaskUpdateInternalSchema, } from './flows-actors-task.shared.schemas.js';
|
|
56
57
|
/**
|
|
57
58
|
* Per-variant owner-read role map. Identical shape to the execution family so a
|
|
@@ -120,14 +121,54 @@ export const flowActorTasksPolymorphicFactories = createPolymorphicResourceConfi
|
|
|
120
121
|
update: ResourceSystemAccessMode.ALLOWED,
|
|
121
122
|
},
|
|
122
123
|
portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
|
|
124
|
+
/**
|
|
125
|
+
* Subject erasure RETAINS this row and scrubs everything the person wrote or that was derived from it.
|
|
126
|
+
*
|
|
127
|
+
* A task carries `description`, `topic` and `input` — the person's own words — plus `output` and
|
|
128
|
+
* `artifacts` derived from them, and a `title` that is the opening 120 characters of the originating
|
|
129
|
+
* PROMPT. That is content this row HOLDS, so `RETAIN_ONLY` would be false and the factory refuses it.
|
|
130
|
+
* The row survives because the execution record is what an operator must be able to account for; its
|
|
131
|
+
* contents do not.
|
|
132
|
+
*/
|
|
133
|
+
retentionPolicy: {
|
|
134
|
+
mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,
|
|
135
|
+
},
|
|
136
|
+
/**
|
|
137
|
+
* Erasing one of these rows revokes NO session. The row is work performed for a person, not the person;
|
|
138
|
+
* its owner FK names the scope the work ran in. The subject's session ends through the `USERS` row.
|
|
139
|
+
*/
|
|
140
|
+
dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
|
|
123
141
|
coreOperations: [
|
|
124
142
|
CoreResourceOperation.CREATE,
|
|
125
143
|
CoreResourceOperation.READ,
|
|
126
144
|
CoreResourceOperation.UPDATE,
|
|
127
145
|
CoreResourceOperation.LIST,
|
|
128
146
|
CoreResourceOperation.DELETE,
|
|
147
|
+
// Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
|
|
148
|
+
CoreResourceOperation.UPDATE_MANY,
|
|
129
149
|
],
|
|
130
150
|
operationsConfiguration: {
|
|
151
|
+
/*
|
|
152
|
+
|
|
153
|
+
* Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
|
|
154
|
+
|
|
155
|
+
* must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
|
|
156
|
+
|
|
157
|
+
* which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
|
|
158
|
+
|
|
159
|
+
* HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
|
|
160
|
+
|
|
161
|
+
* verb the impersonalize writer uses to stamp the retention markers.
|
|
162
|
+
|
|
163
|
+
*/
|
|
164
|
+
[CoreResourceOperation.UPDATE_MANY]: {
|
|
165
|
+
variants: [{
|
|
166
|
+
variantType: ResourceOperationVariantType.INTERNAL_CALL,
|
|
167
|
+
isDefault: true,
|
|
168
|
+
roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
|
|
169
|
+
riskLevel: ResourceOperationRiskLevel.CRITICAL,
|
|
170
|
+
}],
|
|
171
|
+
},
|
|
131
172
|
// === READ === backs A2A `tasks/get`. Owner reads their own task.
|
|
132
173
|
[CoreResourceOperation.READ]: {
|
|
133
174
|
variants: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-task.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAA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7C,UAAU,EAAE,iCAAiC;iBAC9C,CAAC;SACH;QAED,0EAA0E;QAC1E,2DAA2D;QAC3D,yEAAyE;QACzE,2CAA2C;QAC3C,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Flows-Actors Task — Resource Configuration (POLYMORPHIC)\n * ========================================================\n *\n * The persisted WORK record behind the A2A `Task` object, stamped out as THREE\n * owner-scope variants from one polymorphic declaration (`userFlowActorTasks` /\n * `organizationFlowActorTasks` / `applicationFlowActorTasks`). Spread the produced\n * factories into the registry factory map:\n * ...flowActorTasksPolymorphicFactories\n *\n * This is a DIFFERENT PLANE from `flowActorExecutions`: executions own\n * conversational session history, tasks own an addressable/pollable/cancelable\n * work lifecycle. See the base schema for why merging them is wrong.\n *\n * Scope + access model (mirrors the execution family — same owner scopes, same\n * RBAC shape — so a task is always readable by exactly the principal that drove\n * the turn):\n * - Owner = the injected scope FK per variant. READ/LIST are `API_CALL`, roles\n * resolved PER VARIANT by `polymorphicRole`: a user reads its own (APP_USER +\n * USER_SELF filter), a machine reads its org/app variant with its granted\n * org/app role. NOTE these roles govern the HTTP surface only — the A2A\n * `tasks/get` path does NOT use them (it reads via the ACL-bypassing `readAsSystem`\n * and isolates by owner filter instead; see `A2ATaskBackendService`). Tightening\n * `polymorphicRole` therefore does not tighten `tasks/get`.\n * - CREATE/UPDATE are `INTERNAL_CALL` super-admin: only the runtime materialises\n * a task and advances its lifecycle, via `*AsSystem` (governed by\n * `systemAccessPolicy`, not the op RBAC). INTERNAL_CALL (not REPOSITORY_ONLY)\n * is mandatory — `*AsSystem` dispatches through the service tier and resolves\n * the op via `getServiceOperationPathDefault`, which only matches\n * INTERNAL_CALL / API_CALL variants.\n * - `tasks/cancel` is an UPDATE (status → `CANCELLED`), NOT a delete: the A2A\n * spec requires cancel to return the task's UPDATED STATE rather than remove it, so the record must\n * spec-cite: A2A v0.2.5 §7.4 (tasks/cancel returns a Task)\n * survive cancellation.\n * - DELETE exists as a single owner-facing `API_CALL` default. It is REQUIRED,\n * not optional: the polymorphic owner relationship is a COMPOSITION, and a\n * composition child with no core DELETE op makes the parent's cascade throw\n * `ErrorType.CONFIGURATION` inside the delete transaction and roll the parent\n * delete back (the exact latent bug the platform hit on\n * `wildoApplication*` children — see `resources-relationships.custom.shared.definitions.ts`).\n * Its role floor is DISTINCT from read: a user deletes only their own task;\n * org/app tasks are shared scope data and require org/app admin.\n *\n * @see flows-actors-task.shared.schemas.ts — the polymorphic declaration + base schema\n * @see flows-actors-execution.shared.resources-config.schemas.ts — the sibling plane\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport {\n flowActorTasksPolymorphicDeclaration,\n FlowActorTaskUpdateInternalSchema,\n} from './flows-actors-task.shared.schemas';\n\n/**\n * Per-variant owner-read role map. Identical shape to the execution family so a\n * caller that can read its conversation can read the tasks that conversation\n * produced — no new role, no authorizer change. The scope authorizer + contextual\n * filter isolate rows to the owner; the role is the operation floor.\n */\nconst OWNER_READ_ROLES = {\n // USER variant: the scope FK IS the principal, so `APP_USER` plus the contextual filter yields\n // exactly \"my own rows\". Correct, and unchanged.\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n // ── MACHINE variants: ADMIN-only, and this is a CORRECTION (review finding F5-1) ──\n //\n // These previously granted `ORG_MEMBER` / `APP_USER`, inherited from the USER variant where that\n // is right. On the machine variants it is not: the scope FK does not identify the principal.\n // `applicationId` is a DEPLOYMENT SINGLETON, so every application-scope principal resolves to the\n // same contextual filter, and `organizationId` is shared by every machine client of one tenant.\n // The generic REST plane therefore let a PEER principal read another client's rows — the whole\n // `messages[]` log on an execution, and `title` (the opening 120 chars of the originating prompt)\n // on a task. That is exactly the cross-client disclosure the credential axis closed on the A2A\n // plane; the axis was applied there and not here, and both planes read the same rows.\n //\n // The resolution follows the reasoning the DELETE map below ALREADY documents: an org/app record\n // is SHARED SCOPE DATA, not owner data. Whoever administers the scope may inspect it; a peer\n // principal inside that scope may not. Roles are the framework's single authorization axis, so\n // this is expressed there rather than by inventing a second one.\n //\n // The A2A path is unaffected — it reads through `readAsSystem` and isolates by its own\n // owner + agent + credential filter, which is stricter than either role set.\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Per-variant DELETE role map. Delete authority is DELIBERATELY DISTINCT from read\n * (destroying a work record ≠ reading it): a user deletes only their OWN task, but\n * an org/app task is SHARED scope data, so removing it requires ORG_ADMIN /\n * APP_ADMIN_SUPER_ADMIN — not any org member / app user who can merely read it.\n */\nconst OWNER_DELETE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Polymorphic factory map for flows-actors tasks. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...flowActorTasksPolymorphicFactories\n *\n * Produces entries for:\n * - userFlowActorTasks\n * - organizationFlowActorTasks\n * - applicationFlowActorTasks\n */\nexport const flowActorTasksPolymorphicFactories = createPolymorphicResourceConfigurations(\n flowActorTasksPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the runtime (system actor) into scoped writes/reads on the owner's\n // behalf. Absent this, every `*AsSystem` verb fails closed. No `delete` mode:\n // the runtime never system-deletes a task — cancellation is an UPDATE, and\n // removal is owner-driven or cascade-driven.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own flow tasks. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.LIST,\n CoreResourceOperation.DELETE,\n ],\n\n operationsConfiguration: {\n // === READ === backs A2A `tasks/get`. Owner reads their own task.\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === LIST === owner enumerates their tasks (e.g. every task of one contextId).\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n // DECLARED, because without it the promise is unservable (review finding M-2).\n //\n // The schema indexes `contextId` and both the schema and the spec say the index exists so\n // a client can \"enumerate every task of one conversation\". None of that was reachable: with\n // no `filterFields` the request schema falls back to the base filter (`searchRequest`,\n // `createdAt`, `updatedAt`), so the one query the index was built for could not be\n // expressed. An index serving no reachable query is cost without benefit, and a documented\n // capability nobody can call is worse than an absent one.\n //\n // `status` rides along for the obvious companion query (\"my unfinished work\"). The agent\n // and credential axes are deliberately NOT filterable — they are AUTHORIZATION inputs\n // derived from the caller's own principal, and accepting them from the query string would\n // invite the misreading that a caller may choose them.\n filterFields: {\n contextId: z.string(),\n status: z.enum(FlowsActors_Status),\n },\n }],\n },\n\n // === CREATE === runtime materialises a task when the turn becomes non-inline: either the\n // selected A2A dialect explicitly requests non-blocking work, or a blocking user-delegated\n // turn reaches an approval-gated tool and must return `input-required` with an addressable\n // task. No explicit request DTO: auto-derives per variant so the injected owner FK is\n // required on the correct variant.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — the write that first\n // persists requester-supplied content is recorded, so access to it is reconstructable.\n //\n // LOW is the honest risk of a runtime bookkeeping write, but the audit floor would then\n // drop it — and this is the write that FIRST PERSISTS the prompt excerpt in `title`\n // (review finding M-6). Recording the creation of a content-bearing row is exactly what\n // \"record access decisions\" asks for, so the event is emitted below the floor rather than\n // by inflating a risk level that would then misreport the operation's danger.\n auditableEvent: { auditBelowRiskFloor: true },\n }],\n },\n\n // === UPDATE === advances the lifecycle: status transitions, artifacts,\n // terminal outcome — and backs `tasks/cancel` (status → CANCELLED), which the\n // A2A spec requires to return the updated state rather than remove the record.\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — a destructive protocol\n // verb leaves persistence-tier evidence, not only a transport-tier record.\n //\n // Same reasoning as CREATE: this is the write `tasks/cancel` lands on, so its absence\n // from the trail would leave a destructive protocol verb unrecorded at the persistence\n // tier even though the transport audits the call.\n auditableEvent: { auditBelowRiskFloor: true },\n requestDto: FlowActorTaskUpdateInternalSchema,\n }],\n },\n\n // === DELETE === owner-facing removal, and the op the composition cascade\n // selects on owner deletion (the repository tier picks the\n // `isOperationDefault === true` DELETE). Declaring it is MANDATORY for a\n // composition child — see the header note.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_DELETE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n },\n ],\n },\n },\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"flows-actors-task.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACvH,OAAO,EACL,oCAAoC,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AAc,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE;oBAC7C,UAAU,EAAE,iCAAiC;iBAC9C,CAAC;SACH;QAED,0EAA0E;QAC1E,2DAA2D;QAC3D,yEAAyE;QACzE,2CAA2C;QAC3C,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE,kBAAkB;oBACnC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C;aACF;SACF;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Flows-Actors Task — Resource Configuration (POLYMORPHIC)\n * ========================================================\n *\n * The persisted WORK record behind the A2A `Task` object, stamped out as THREE\n * owner-scope variants from one polymorphic declaration (`userFlowActorTasks` /\n * `organizationFlowActorTasks` / `applicationFlowActorTasks`). Spread the produced\n * factories into the registry factory map:\n * ...flowActorTasksPolymorphicFactories\n *\n * This is a DIFFERENT PLANE from `flowActorExecutions`: executions own\n * conversational session history, tasks own an addressable/pollable/cancelable\n * work lifecycle. See the base schema for why merging them is wrong.\n *\n * Scope + access model (mirrors the execution family — same owner scopes, same\n * RBAC shape — so a task is always readable by exactly the principal that drove\n * the turn):\n * - Owner = the injected scope FK per variant. READ/LIST are `API_CALL`, roles\n * resolved PER VARIANT by `polymorphicRole`: a user reads its own (APP_USER +\n * USER_SELF filter), a machine reads its org/app variant with its granted\n * org/app role. NOTE these roles govern the HTTP surface only — the A2A\n * `tasks/get` path does NOT use them (it reads via the ACL-bypassing `readAsSystem`\n * and isolates by owner filter instead; see `A2ATaskBackendService`). Tightening\n * `polymorphicRole` therefore does not tighten `tasks/get`.\n * - CREATE/UPDATE are `INTERNAL_CALL` super-admin: only the runtime materialises\n * a task and advances its lifecycle, via `*AsSystem` (governed by\n * `systemAccessPolicy`, not the op RBAC). INTERNAL_CALL (not REPOSITORY_ONLY)\n * is mandatory — `*AsSystem` dispatches through the service tier and resolves\n * the op via `getServiceOperationPathDefault`, which only matches\n * INTERNAL_CALL / API_CALL variants.\n * - `tasks/cancel` is an UPDATE (status → `CANCELLED`), NOT a delete: the A2A\n * spec requires cancel to return the task's UPDATED STATE rather than remove it, so the record must\n * spec-cite: A2A v0.2.5 §7.4 (tasks/cancel returns a Task)\n * survive cancellation.\n * - DELETE exists as a single owner-facing `API_CALL` default. It is REQUIRED,\n * not optional: the polymorphic owner relationship is a COMPOSITION, and a\n * composition child with no core DELETE op makes the parent's cascade throw\n * `ErrorType.CONFIGURATION` inside the delete transaction and roll the parent\n * delete back (the exact latent bug the platform hit on\n * `wildoApplication*` children — see `resources-relationships.custom.shared.definitions.ts`).\n * Its role floor is DISTINCT from read: a user deletes only their own task;\n * org/app tasks are shared scope data and require org/app admin.\n *\n * @see flows-actors-task.shared.schemas.ts — the polymorphic declaration + base schema\n * @see flows-actors-execution.shared.resources-config.schemas.ts — the sibling plane\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\nimport {\n flowActorTasksPolymorphicDeclaration,\n FlowActorTaskUpdateInternalSchema,\n} from './flows-actors-task.shared.schemas';\n\n/**\n * Per-variant owner-read role map. Identical shape to the execution family so a\n * caller that can read its conversation can read the tasks that conversation\n * produced — no new role, no authorizer change. The scope authorizer + contextual\n * filter isolate rows to the owner; the role is the operation floor.\n */\nconst OWNER_READ_ROLES = {\n // USER variant: the scope FK IS the principal, so `APP_USER` plus the contextual filter yields\n // exactly \"my own rows\". Correct, and unchanged.\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n // ── MACHINE variants: ADMIN-only, and this is a CORRECTION (review finding F5-1) ──\n //\n // These previously granted `ORG_MEMBER` / `APP_USER`, inherited from the USER variant where that\n // is right. On the machine variants it is not: the scope FK does not identify the principal.\n // `applicationId` is a DEPLOYMENT SINGLETON, so every application-scope principal resolves to the\n // same contextual filter, and `organizationId` is shared by every machine client of one tenant.\n // The generic REST plane therefore let a PEER principal read another client's rows — the whole\n // `messages[]` log on an execution, and `title` (the opening 120 chars of the originating prompt)\n // on a task. That is exactly the cross-client disclosure the credential axis closed on the A2A\n // plane; the axis was applied there and not here, and both planes read the same rows.\n //\n // The resolution follows the reasoning the DELETE map below ALREADY documents: an org/app record\n // is SHARED SCOPE DATA, not owner data. Whoever administers the scope may inspect it; a peer\n // principal inside that scope may not. Roles are the framework's single authorization axis, so\n // this is expressed there rather than by inventing a second one.\n //\n // The A2A path is unaffected — it reads through `readAsSystem` and isolates by its own\n // owner + agent + credential filter, which is stricter than either role set.\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Per-variant DELETE role map. Delete authority is DELIBERATELY DISTINCT from read\n * (destroying a work record ≠ reading it): a user deletes only their OWN task, but\n * an org/app task is SHARED scope data, so removing it requires ORG_ADMIN /\n * APP_ADMIN_SUPER_ADMIN — not any org member / app user who can merely read it.\n */\nconst OWNER_DELETE_ROLES = {\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.APPLICATION]: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n};\n\n/**\n * Polymorphic factory map for flows-actors tasks. Spread into\n * `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...flowActorTasksPolymorphicFactories\n *\n * Produces entries for:\n * - userFlowActorTasks\n * - organizationFlowActorTasks\n * - applicationFlowActorTasks\n */\nexport const flowActorTasksPolymorphicFactories = createPolymorphicResourceConfigurations(\n flowActorTasksPolymorphicDeclaration,\n {\n isSystemResource: true,\n\n // Opt the runtime (system actor) into scoped writes/reads on the owner's\n // behalf. Absent this, every `*AsSystem` verb fails closed. No `delete` mode:\n // the runtime never system-deletes a task — cancellation is an UPDATE, and\n // removal is owner-driven or cascade-driven.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own flow tasks. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n read: ResourceSystemAccessMode.ALLOWED,\n list: ResourceSystemAccessMode.ALLOWED,\n update: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs everything the person wrote or that was derived from it.\n *\n * A task carries `description`, `topic` and `input` — the person's own words — plus `output` and\n * `artifacts` derived from them, and a `title` that is the opening 120 characters of the originating\n * PROMPT. That is content this row HOLDS, so `RETAIN_ONLY` would be false and the factory refuses it.\n * The row survives because the execution record is what an operator must be able to account for; its\n * contents do not.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is work performed for a person, not the person;\n * its owner FK names the scope the work ran in. The subject's session ends through the `USERS` row.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.LIST,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n\n operationsConfiguration: {\n\n /*\n\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n\n * verb the impersonalize writer uses to stamp the retention markers.\n\n */\n\n [CoreResourceOperation.UPDATE_MANY]: {\n\n variants: [{\n\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n\n isDefault: true,\n\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n\n }],\n\n },\n\n // === READ === backs A2A `tasks/get`. Owner reads their own task.\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n\n // === LIST === owner enumerates their tasks (e.g. every task of one contextId).\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_READ_ROLES,\n riskLevel: ResourceOperationRiskLevel.LOW,\n // DECLARED, because without it the promise is unservable (review finding M-2).\n //\n // The schema indexes `contextId` and both the schema and the spec say the index exists so\n // a client can \"enumerate every task of one conversation\". None of that was reachable: with\n // no `filterFields` the request schema falls back to the base filter (`searchRequest`,\n // `createdAt`, `updatedAt`), so the one query the index was built for could not be\n // expressed. An index serving no reachable query is cost without benefit, and a documented\n // capability nobody can call is worse than an absent one.\n //\n // `status` rides along for the obvious companion query (\"my unfinished work\"). The agent\n // and credential axes are deliberately NOT filterable — they are AUTHORIZATION inputs\n // derived from the caller's own principal, and accepting them from the query string would\n // invite the misreading that a caller may choose them.\n filterFields: {\n contextId: z.string(),\n status: z.enum(FlowsActors_Status),\n },\n }],\n },\n\n // === CREATE === runtime materialises a task when the turn becomes non-inline: either the\n // selected A2A dialect explicitly requests non-blocking work, or a blocking user-delegated\n // turn reaches an approval-gated tool and must return `input-required` with an addressable\n // task. No explicit request DTO: auto-derives per variant so the injected owner FK is\n // required on the correct variant.\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — the write that first\n // persists requester-supplied content is recorded, so access to it is reconstructable.\n //\n // LOW is the honest risk of a runtime bookkeeping write, but the audit floor would then\n // drop it — and this is the write that FIRST PERSISTS the prompt excerpt in `title`\n // (review finding M-6). Recording the creation of a content-bearing row is exactly what\n // \"record access decisions\" asks for, so the event is emitted below the floor rather than\n // by inflating a risk level that would then misreport the operation's danger.\n auditableEvent: { auditBelowRiskFloor: true },\n }],\n },\n\n // === UPDATE === advances the lifecycle: status transitions, artifacts,\n // terminal outcome — and backs `tasks/cancel` (status → CANCELLED), which the\n // A2A spec requires to return the updated state rather than remove the record.\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n // assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — a destructive protocol\n // verb leaves persistence-tier evidence, not only a transport-tier record.\n //\n // Same reasoning as CREATE: this is the write `tasks/cancel` lands on, so its absence\n // from the trail would leave a destructive protocol verb unrecorded at the persistence\n // tier even though the transport audits the call.\n auditableEvent: { auditBelowRiskFloor: true },\n requestDto: FlowActorTaskUpdateInternalSchema,\n }],\n },\n\n // === DELETE === owner-facing removal, and the op the composition cascade\n // selects on owner deletion (the repository tier picks the\n // `isOperationDefault === true` DELETE). Declaring it is MANDATORY for a\n // composition child — see the header note.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: OWNER_DELETE_ROLES,\n riskLevel: ResourceOperationRiskLevel.HIGH,\n },\n ],\n },\n },\n },\n);\n"]}
|
|
@@ -46,13 +46,6 @@
|
|
|
46
46
|
import { z } from 'zod';
|
|
47
47
|
import { FlowsActors_Status } from './flows-actors.commons.shared.schemas';
|
|
48
48
|
import { type PolymorphicVariantDefinition } from '../resources/utils/resource-polymorphism.schemas';
|
|
49
|
-
/**
|
|
50
|
-
* The work record shared by every scope variant.
|
|
51
|
-
*
|
|
52
|
-
* Derived from the canonical `Actors_Task_Schema` and narrowed with persistence
|
|
53
|
-
* concerns: a primary key, indexes on the fields the A2A surface queries, and the
|
|
54
|
-
* OPTIONAL link back to the conversational execution that produced it.
|
|
55
|
-
*/
|
|
56
49
|
export declare const FlowActorTaskBaseSchema: z.ZodObject<{
|
|
57
50
|
description: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>;
|
|
58
51
|
topic: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodEnum<typeof import("./tasks.actors.shared.schemas").Actor_Task_Topics>>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-task.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,O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uBAAuB,CAAC,CAAC"}
|
|
@@ -44,11 +44,12 @@
|
|
|
44
44
|
* see the same warning on the execution base schema).
|
|
45
45
|
*/
|
|
46
46
|
import { z } from 'zod';
|
|
47
|
-
import { initZodDecorators } from '@wildo-ai/zod-decorators';
|
|
47
|
+
import { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';
|
|
48
48
|
import { FlowsActors_Status } from './flows-actors.commons.shared.schemas.js';
|
|
49
49
|
import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
|
|
50
50
|
import { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas.js';
|
|
51
51
|
import { Actors_Task_Schema } from './tasks.actors.shared.schemas.js';
|
|
52
|
+
import { RedactionType } from '../compliance/privacy/redaction.shared.schemas.js';
|
|
52
53
|
import { CoreResourceType, coreResourceShared_FieldIdentifier, } from '../resources/resources.shared.core.definitions.js';
|
|
53
54
|
import { declarePolymorphicSchemas, optOutPolymorphicAutoBusinessKey, } from '../resources/utils/resource-polymorphism.schemas.js';
|
|
54
55
|
initZodDecorators(z);
|
|
@@ -62,6 +63,8 @@ initZodDecorators(z);
|
|
|
62
63
|
* concerns: a primary key, indexes on the fields the A2A surface queries, and the
|
|
63
64
|
* OPTIONAL link back to the conversational execution that produced it.
|
|
64
65
|
*/
|
|
66
|
+
/** Fixed replacement for task text that cannot be cleared (a `.min(1)` field). */
|
|
67
|
+
const ERASED_TASK_TEXT = '[erased]';
|
|
65
68
|
export const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({
|
|
66
69
|
// === HEAVY NESTED ORCHESTRATION STATE — OMITTED, NOT MADE OPTIONAL ===
|
|
67
70
|
//
|
|
@@ -119,15 +122,18 @@ export const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({
|
|
|
119
122
|
// still content held about a person, so a notice must name it. Declared rather than left blank
|
|
120
123
|
// because a field carrying a provenance and no category is reported as an OUTSTANDING gap, by
|
|
121
124
|
// name, in every generated application's notice — the engine owes its own inventory.
|
|
122
|
-
|
|
125
|
+
// REMOVE all five on erasure. `description`, `topic` and `input` are what the person WROTE; `output`
|
|
126
|
+
// and `artifacts` are derived from it and carry it forward. This is the content a task holds, not a
|
|
127
|
+
// link it carries, so erasure has to reach it. All five are `.optional()`, so REMOVE is clearable.
|
|
128
|
+
description: addImpersonalizeWith(Actors_Task_Schema.shape.description.optional()
|
|
123
129
|
.portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)
|
|
124
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
125
|
-
topic: Actors_Task_Schema.shape.topic.optional()
|
|
130
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
131
|
+
topic: addImpersonalizeWith(Actors_Task_Schema.shape.topic.optional()
|
|
126
132
|
.portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)
|
|
127
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
128
|
-
input: Actors_Task_Schema.shape.input.optional()
|
|
133
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
134
|
+
input: addImpersonalizeWith(Actors_Task_Schema.shape.input.optional()
|
|
129
135
|
.portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)
|
|
130
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
136
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
131
137
|
// ⚠️ RE-WRAP with `.optional()` FIRST — decorating these leaves in place mutates the CANONICAL
|
|
132
138
|
// schema (finding G7-3). Wrapper decorators mirror onto the inner type copy-on-write, but only
|
|
133
139
|
// ONE level: the three fields above are safe because `.optional()` mints a fresh wrapper before
|
|
@@ -145,12 +151,12 @@ export const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({
|
|
|
145
151
|
// place, the leak silently converted an open question into an answer for every consumer of the
|
|
146
152
|
// canonical schema — `standaloneTasks` and the platform's application-task resource — and did it
|
|
147
153
|
// import-order-dependently.
|
|
148
|
-
output: Actors_Task_Schema.shape.output.optional()
|
|
154
|
+
output: addImpersonalizeWith(Actors_Task_Schema.shape.output.optional()
|
|
149
155
|
.portabilityProvenance(DataPortabilityProvenance.DERIVED)
|
|
150
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
151
|
-
artifacts: Actors_Task_Schema.shape.artifacts.optional()
|
|
156
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
157
|
+
artifacts: addImpersonalizeWith(Actors_Task_Schema.shape.artifacts.optional()
|
|
152
158
|
.portabilityProvenance(DataPortabilityProvenance.DERIVED)
|
|
153
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
159
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.REMOVE),
|
|
154
160
|
/** MongoDB document id — auto-generated / auto-managed (excluded from create). */
|
|
155
161
|
_id: z.string().min(1).isPrimaryKey().isSummaryField(),
|
|
156
162
|
/**
|
|
@@ -228,10 +234,14 @@ export const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({
|
|
|
228
234
|
* and machine-credential axes, and why the portability policy classifies it separately from the
|
|
229
235
|
* observed lifecycle fields.
|
|
230
236
|
*/
|
|
231
|
-
|
|
237
|
+
// MASK on erasure, not REMOVE: `.min(1)` makes the field non-clearable, so a null would be rejected by
|
|
238
|
+
// the strict update-DTO parse the impersonalize writer runs. The mask is a fixed non-empty string,
|
|
239
|
+
// which the schema accepts. It matters that this one is scrubbed at all — the title is the opening
|
|
240
|
+
// 120 characters of the originating PROMPT.
|
|
241
|
+
title: addImpersonalizeWith(z.string().min(1).isSummaryField()
|
|
232
242
|
.portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)
|
|
233
243
|
// The opening 120 characters of the originating PROMPT, per the note above — content, not a label.
|
|
234
|
-
.dataCategories(PersonalDataCategory.USER_CONTENT),
|
|
244
|
+
.dataCategories(PersonalDataCategory.USER_CONTENT), RedactionType.MASK, { maskValue: ERASED_TASK_TEXT }),
|
|
235
245
|
/**
|
|
236
246
|
* A2A `contextId` — threads related turns. Indexed so a client can enumerate
|
|
237
247
|
* the tasks of one conversation without walking executions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flows-actors-task.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAsC,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GAEjC,MAAM,kDAAkD,CAAC;AAE1D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB,iEAAiE;AACjE,+DAA+D;AAC/D,iEAAiE;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAC7D,wEAAwE;IACxE,EAAE;IACF,2EAA2E;IAC3E,sFAAsF;IACtF,mFAAmF;IACnF,mFAAmF;IACnF,wFAAwF;IACxF,mFAAmF;IACnF,wFAAwF;IACxF,uFAAuF;IACvF,yFAAyF;IACzF,EAAE;IACF,mFAAmF;IACnF,sFAAsF;IACtF,wFAAwF;IACxF,2EAA2E;IAC3E,qFAAqF;IACrF,iBAAiB;IACjB,WAAW,EAA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,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE;IACvK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,WAAW,EAAI,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAI,cAAc,EAAE,IAAI,EAAE;CACxK,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB;IAClC,mBAAmB,EAAE,iBAAiB;IACtC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,uBAAuB;IACnC,QAAQ,EAAE,8BAA8B;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;IACvD,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM;IAC5C,SAAS,EAAE,uBAAuB,CAAC,KAAK,CAAC,SAAS;IAClD,oFAAoF;IACpF,uFAAuF;IACvF,kDAAkD;IAClD,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC,UAAU;IACpD;;;;;OAKG;IACH,uBAAuB,EAAE,uBAAuB,CAAC,KAAK,CAAC,uBAAuB;CAC/E,CAAC,CAAC","sourcesContent":["/**\n * Flows-actors TASK — the persisted, protocol-facing work record.\n *\n * ## Why this exists as its own family (and is NOT the conversation row)\n *\n * The engine keeps two DELIBERATELY SEPARATE physical planes:\n *\n * - `*FlowActorExecutions` owns **conversational** session history (the WS/A2A\n * message log, its status, its owner). Every turn has one.\n * - **This family** owns **work lifecycle** — an addressable, pollable,\n * cancelable handle with its own status, artifacts and terminal outcome.\n *\n * `.claude/context/flows-actors.md` states the rule the hard way: an A2A-backed\n * treatment \"links the continuum to both concrete records; it does not copy the\n * conversation into the task or recast the conversation row as a playbook run.\"\n * Merging them — e.g. treating `executionId` as the A2A task id — collapses two\n * planes the architecture keeps apart on purpose.\n *\n * ## Why it derives from `Actors_Task_Schema`\n *\n * `Actors_Task_Schema` is the CANONICAL task contract (status, artifacts,\n * relationships, memory, per-actor states, error states, journey/playbook\n * correlation). The platform already persists it the same way —\n * `Wildo_Application_Actor_Task_Schema = Actors_Task_Schema.extend({...})` with\n * scope FKs plus an OPTIONAL execution FK. This family mirrors that proven\n * pattern at engine level rather than inventing a third task model.\n *\n * ⚠️ NOTE on a constraint that DOES apply here — this paragraph previously claimed the\n * opposite and was wrong. The `FlowActorExecutionBaseSchema` warning about heavy nested\n * sub-structures not round-tripping Zod→Mongoose is NOT limited to embedding a task\n * inside an execution: Mongoose instantiates an empty subdocument for an optional nested\n * object and then fails its REQUIRED inner paths, whatever the nesting depth. A real-Mongo\n * service-tier test proved it — every create died on\n * `errorStates → customMessageReference is required`. That is why the heavy nested\n * orchestration state is OMITTED below rather than made optional.\n *\n * ## Ownership\n *\n * Polymorphic over the same three scopes as executions, so a user-delegated A2A\n * turn and an org/app MACHINE turn each own their tasks under the principal that\n * actually made the call. The owner FK is injected per variant by\n * `declarePolymorphicSchemas()`; do NOT add an `initiator` snapshot here (a\n * nested `initiator.organizationId` collides with the contextual scope filter —\n * see the same warning on the execution base schema).\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { Actors_Task_Schema } from './tasks.actors.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Base task record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The work record shared by every scope variant.\n *\n * Derived from the canonical `Actors_Task_Schema` and narrowed with persistence\n * concerns: a primary key, indexes on the fields the A2A surface queries, and the\n * OPTIONAL link back to the conversational execution that produced it.\n */\nexport const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({\n // === HEAVY NESTED ORCHESTRATION STATE — OMITTED, NOT MADE OPTIONAL ===\n //\n // ⚠️ CORRECTION to an earlier claim in this file's history. The warning on\n // `FlowActorExecutionBaseSchema` — that heavy nested sub-structures do NOT round-trip\n // through the Zod→Mongoose embedded-subdocument conversion as optional slots — was\n // dismissed here on the grounds that it applied only to EMBEDDING a task inside an\n // execution, not to persisting tasks as their own collection. **That was wrong**, and a\n // service-tier test against real MongoDB proved it: Mongoose instantiates an empty\n // subdocument for an optional nested object and then fails its REQUIRED inner paths, so\n // every create died on `errorStates → customMessageReference is required`. The trap is\n // about optional nested objects with required inner paths — nesting DEPTH is irrelevant.\n //\n // Making them `.optional()` does not help (that was the first attempted fix and it\n // failed identically). They are therefore OMITTED: an A2A-materialised task genuinely\n // has no actor decomposition, no per-actor state, no memory and no error graph. When an\n // orchestration runtime actually produces that state, add it back WITH the\n // embedded-subdocument treatment the execution schema prescribes — not by relaxing a\n // required path.\n errorStates: true,\n memory: true,\n actorStates: true,\n relationships: true,\n actors: true,\n initiator: true,\n context: true,\n // G2-6: `startedAt` / `completedAt` are ISO `z.string()` on the canonical schema and would\n // sit beside this family's `z.date()` timestamps — the exact mixed-representation trap this\n // file warns about below. Nothing reads or writes them here (`finishedAt` carries the\n // terminal moment), so they are omitted rather than left as an unread inconsistency.\n startedAt: true,\n completedAt: true,\n}).extend({\n // Scalar orchestration fields — safe to keep, merely absent on an A2A task.\n // ── Provenance, per field, because the resource default cannot be right for all of them ──\n //\n // The config's `defaultProvenance: OBSERVED` fits the LIFECYCLE fields (status, timestamps, ids —\n // things the platform recorded about the work). It is wrong in BOTH directions for the content:\n //\n // • `title` / `input` / `description` / `topic` are SUBJECT_PROVIDED — they carry what the\n // requester actually said. ⚠️ This is a PRECISION change, not a behaviour change: an earlier\n // revision claimed OBSERVED \"under-scopes an Art. 20 bundle\", which is false against this\n // framework — `resolvePortabilityFieldScope` maps OBSERVED *and* SUBJECT_PROVIDED to\n // INCLUDED, and the enum's own documentation says OBSERVED is \"in scope for Art. 20, which is\n // the whole reason this member exists\". The reclassification is still right (these fields\n // genuinely came from the subject), but only the DERIVED half below changes what a bundle\n // contains.\n // • `output` / `artifacts` are DERIVED — model output about the subject rather than from them.\n // Classifying THOSE as observed over-delivers generated content into a portability bundle,\n // which the enum's own documentation excludes.\n //\n // All five also declare `USER_CONTENT` as their data CATEGORY — a separate axis, and the reason\n // both are needed here: provenance decides Art. 20 SCOPE (is it in the portability bundle),\n // category decides what a privacy notice ENUMERATES. `output` is excluded from a bundle and is\n // still content held about a person, so a notice must name it. Declared rather than left blank\n // because a field carrying a provenance and no category is reported as an OUTSTANDING gap, by\n // name, in every generated application's notice — the engine owes its own inventory.\n description: Actors_Task_Schema.shape.description.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n topic: Actors_Task_Schema.shape.topic.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n input: Actors_Task_Schema.shape.input.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n // ⚠️ RE-WRAP with `.optional()` FIRST — decorating these leaves in place mutates the CANONICAL\n // schema (finding G7-3). Wrapper decorators mirror onto the inner type copy-on-write, but only\n // ONE level: the three fields above are safe because `.optional()` mints a fresh wrapper before\n // the decorator runs, whereas `output`/`artifacts` are ALREADY optional wrappers on the base\n // schema, so nothing fresh was minted and the decoration landed on `Actors_Task_Schema` itself.\n //\n // Runtime-proven, and the FIRST fix was wrong: `.clone()` is a shallow copy that still shares the\n // inner type, so it isolated nothing — measured `CANON leaked: derived`. `.optional()` (or\n // `.nullish()`) mints the fresh wrapper the copy-on-write needs; measured `CANON leaked:\n // undefined` with the decoration intact on the family. Double-optional is harmless — the outer\n // wrapper exists to carry the decoration.\n //\n // Why it matters: `undefined` means \"nobody decided\", a DESIGNED refusal that\n // `resolvePortabilityFieldScope` surfaces as UNDECLARED. `DERIVED` means \"decided to EXCLUDE\". In\n // place, the leak silently converted an open question into an answer for every consumer of the\n // canonical schema — `standaloneTasks` and the platform's application-task resource — and did it\n // import-order-dependently.\n output: Actors_Task_Schema.shape.output.optional()\n .portabilityProvenance(DataPortabilityProvenance.DERIVED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n artifacts: Actors_Task_Schema.shape.artifacts.optional()\n .portabilityProvenance(DataPortabilityProvenance.DERIVED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * Stable business id, and the identity the A2A protocol addresses: this is the\n * value returned as `Task.id` and accepted by `tasks/get` / `tasks/cancel`.\n *\n * ⚠️ `scope: 'global'` is enforced PER VARIANT, not across the family: the three\n * variants are three separate stores, so the index cannot span them. Nothing depends on\n * family-wide uniqueness — `readTask` resolves the variant from the authenticated\n * owner BEFORE matching the id, so two identical ids in different scopes would never be\n * confused (and a v4 uuid collision is not a real risk anyway). Recorded because the\n * decorator name reads stronger than what it can deliver here.\n */\n taskId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n /**\n * OPTIONAL link to the conversational execution this task was materialised from.\n *\n * A SOFT link, deliberately: it stores the execution's globally-unique\n * `executionId` business id and is NOT declared as a resource foreign key. Two\n * reasons, both load-bearing:\n *\n * 1. **Executions are polymorphic.** Their per-variant field identifiers are\n * `userFlowActorExecutionId` / `organizationFlowActorExecutionId` /\n * `applicationFlowActorExecutionId`, so one `flowActorExecutionId` FK matches\n * no variant. A real FK would mean declaring 3×3 (or 3 matched-pair)\n * relationships to express \"some execution\".\n * 2. **We do not want the graph semantics.** A declared relationship implies\n * population and a cascade path; a task must be able to OUTLIVE the execution\n * that produced it (that is the entire point of keeping the two planes\n * separate), so deleting a conversation must not delete its work records.\n *\n * Ownership and cascade already flow from the injected scope FK, which is the\n * only authority that should govern a task's lifetime. Indexed so \"the tasks of\n * this conversation\" stays a single-field query.\n */\n flowActorExecutionId: z.string().isDBIndexed().optional(),\n\n /**\n * WHICH A2A agent (resource-server instance) this task was created through.\n *\n * Part of the read/cancel filter, not merely descriptive metadata. A2A agents are declared as\n * SEPARATE resource servers — tokens are audience-bound per instance, and an agent must have\n * \"no side-door into another agent's actor system\". Without this field the task plane had no\n * per-agent dimension at all, so a token bound to agent B could read and cancel a task created\n * through agent A whenever both resolved to the same owner scope. Since `title` carries the\n * first 120 characters of the originating prompt, that also disclosed prompt text across the\n * boundary the audience binding exists to enforce.\n *\n * Always populated: the DEFAULT (unnamed) agent is a real identity too and is stored under a\n * sentinel that cannot collide with a declared ref (instance refs are constrained to\n * `^[a-z0-9][a-z0-9-]*$`). Storing a normalised value rather than leaving the default agent's\n * tasks null keeps the filter a plain equality on both persistence adapters, instead of\n * depending on how each one matches an absent field.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this record — part of the read filter, not metadata.\n *\n * The injected scope FK does not identify the principal on the machine variants:\n * `applicationId` is a deployment singleton and `organizationId` is shared by every machine\n * client of one tenant, so without this axis a separately-credentialed client could read and\n * cancel another's work — and `title` carries the opening characters of the originating prompt.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: there the human is the\n * principal and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n /** Indexed: `tasks/get` and the abandoned-task sweep both filter on status. */\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n\n /**\n * Short human-readable name for the work.\n *\n * ⚠️ CONTENT-BEARING, and `.isSummaryField()` puts it on the `/summary` projection: the A2A\n * transport fills it with the opening 120 characters of the ORIGINATING PROMPT. Treat it as\n * subject-provided content, not a label — it is why the read filter carries the agent-instance\n * and machine-credential axes, and why the portability policy classifies it separately from the\n * observed lifecycle fields.\n */\n title: z.string().min(1).isSummaryField()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The opening 120 characters of the originating PROMPT, per the note above — content, not a label.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n\n /**\n * A2A `contextId` — threads related turns. Indexed so a client can enumerate\n * the tasks of one conversation without walking executions.\n */\n contextId: z.string().isDBIndexed().optional(),\n\n // === Timestamps are `z.date()` with defaults, NOT the canonical schema's ISO\n // strings: the persistence layer date-coerces, and a missing default\n // yields `Invalid Date` on create (same rationale as the execution base). ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n /**\n * Indexed because the abandoned-task SWEEP filters on it (`updatedAt < cutoff` AND a status set),\n * once per variant per run. Without an index that query is a sequential scan over a collection\n * that only ever grows — terminal tasks are never deleted — so the sweep gets slower forever\n * while doing the same work. The sibling `status` index was declared for this query from the\n * start; this axis was left off, which made the pair half-served (review finding L-1).\n */\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isDBIndexed(),\n /** Set when the task reaches a terminal state; never on create. */\n finishedAt: z.date().optional().excludeFromCreate(),\n /**\n * The task's A2A push-notification configurations, SERIALIZED as a JSON string.\n *\n * A scalar string for the same reason `pausedApproval` is one: heavy nested sub-structures do not\n * round-trip through the Zod→Mongoose embedded-subdocument conversion, and this is a LIST of\n * objects that themselves nest (`authentication.schemes[]`). Parse and serialize ONLY through the\n * helpers below, at the persistence boundary.\n *\n * ⚠️ The stored blob contains CREDENTIALS the client gave us to present to its own webhook\n * (`token`, `authentication.credentials`). It is therefore backend-only by intent: nothing\n * projects this field to a client, and the read path redacts before answering. See\n * `redactPushNotificationSecrets`.\n */\n pushNotificationConfigs: z.string().nullish().excludeFromCreate().isBackendOnly(),\n});\nexport type FlowActorTaskBase = z.infer<typeof FlowActorTaskBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a task is stamped out for — the SAME set as\n * executions, so ownership of a task always matches the principal that drove the\n * turn. Each opts OUT of the singleton auto-business-key: tasks are MULTI-ROW per\n * scope, so the injected owner FK must NOT be marked `.isUnique()` (the second\n * task per scope would otherwise fail with a duplicate-key error).\n */\nexport const FLOW_ACTOR_TASK_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors tasks. Produces 3 variants:\n * - users → `userFlowActorTasks` (`userId` injected)\n * - organizations → `organizationFlowActorTasks` (`organizationId` injected)\n * - applications → `applicationFlowActorTasks` (`applicationId` injected)\n */\nexport const flowActorTasksPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorTasks',\n baseFieldIdentifier: 'flowActorTaskId',\n baseEnumKey: 'FLOW_ACTOR_TASKS',\n baseSchema: FlowActorTaskBaseSchema,\n variants: FLOW_ACTOR_TASK_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — the mutations the task lifecycle actually performs.\n * Shared across variants because it references NO owner FK (owner is immutable).\n */\nexport const FlowActorTaskUpdateInternalSchema = z.object({\n status: FlowActorTaskBaseSchema.shape.status.optional(),\n output: FlowActorTaskBaseSchema.shape.output,\n artifacts: FlowActorTaskBaseSchema.shape.artifacts,\n // `actorStates` / `errorStates` are deliberately ABSENT — they are omitted from the\n // persisted family (see the omit block above), so an update DTO referencing them would\n // be a contract for a column that does not exist.\n finishedAt: FlowActorTaskBaseSchema.shape.finishedAt,\n /**\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST. A field absent here does not fail on write — the write\n * SUCCEEDS and persists nothing, which is how `pausedApproval` shipped unwritable and left every\n * paused turn unresumable. `.nullish()` because clearing a task's configurations is a real\n * transition (`pushNotificationConfig/delete` removing the last one).\n */\n pushNotificationConfigs: FlowActorTaskBaseSchema.shape.pushNotificationConfigs,\n});\n\n/**\n * Runtime shape of a persisted task (the base record). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the runtime supplies it explicitly on create.\n */\nexport type FlowActorTask = z.infer<typeof FlowActorTaskBaseSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"flows-actors-task.shared.schemas.js","sourceRoot":"","sources":["../../../../src/flows-actors/flows-actors-task.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAsC,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa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AAW,CAAC,EAAI,cAAc,EAAE,IAAI,EAAE;CACxK,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAExC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC;IAC5E,gBAAgB,EAAE,gBAAgB;IAClC,mBAAmB,EAAE,iBAAiB;IACtC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,uBAAuB;IACnC,QAAQ,EAAE,8BAA8B;CACzC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;IACvD,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM;IAC5C,SAAS,EAAE,uBAAuB,CAAC,KAAK,CAAC,SAAS;IAClD,oFAAoF;IACpF,uFAAuF;IACvF,kDAAkD;IAClD,UAAU,EAAE,uBAAuB,CAAC,KAAK,CAAC,UAAU;IACpD;;;;;OAKG;IACH,uBAAuB,EAAE,uBAAuB,CAAC,KAAK,CAAC,uBAAuB;CAC/E,CAAC,CAAC","sourcesContent":["/**\n * Flows-actors TASK — the persisted, protocol-facing work record.\n *\n * ## Why this exists as its own family (and is NOT the conversation row)\n *\n * The engine keeps two DELIBERATELY SEPARATE physical planes:\n *\n * - `*FlowActorExecutions` owns **conversational** session history (the WS/A2A\n * message log, its status, its owner). Every turn has one.\n * - **This family** owns **work lifecycle** — an addressable, pollable,\n * cancelable handle with its own status, artifacts and terminal outcome.\n *\n * `.claude/context/flows-actors.md` states the rule the hard way: an A2A-backed\n * treatment \"links the continuum to both concrete records; it does not copy the\n * conversation into the task or recast the conversation row as a playbook run.\"\n * Merging them — e.g. treating `executionId` as the A2A task id — collapses two\n * planes the architecture keeps apart on purpose.\n *\n * ## Why it derives from `Actors_Task_Schema`\n *\n * `Actors_Task_Schema` is the CANONICAL task contract (status, artifacts,\n * relationships, memory, per-actor states, error states, journey/playbook\n * correlation). The platform already persists it the same way —\n * `Wildo_Application_Actor_Task_Schema = Actors_Task_Schema.extend({...})` with\n * scope FKs plus an OPTIONAL execution FK. This family mirrors that proven\n * pattern at engine level rather than inventing a third task model.\n *\n * ⚠️ NOTE on a constraint that DOES apply here — this paragraph previously claimed the\n * opposite and was wrong. The `FlowActorExecutionBaseSchema` warning about heavy nested\n * sub-structures not round-tripping Zod→Mongoose is NOT limited to embedding a task\n * inside an execution: Mongoose instantiates an empty subdocument for an optional nested\n * object and then fails its REQUIRED inner paths, whatever the nesting depth. A real-Mongo\n * service-tier test proved it — every create died on\n * `errorStates → customMessageReference is required`. That is why the heavy nested\n * orchestration state is OMITTED below rather than made optional.\n *\n * ## Ownership\n *\n * Polymorphic over the same three scopes as executions, so a user-delegated A2A\n * turn and an org/app MACHINE turn each own their tasks under the principal that\n * actually made the call. The owner FK is injected per variant by\n * `declarePolymorphicSchemas()`; do NOT add an `initiator` snapshot here (a\n * nested `initiator.organizationId` collides with the contextual scope filter —\n * see the same warning on the execution base schema).\n */\n\nimport { z } from 'zod';\nimport { initZodDecorators, addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\nimport { FLOWS_ACTORS_NO_MACHINE_CREDENTIAL, FlowsActors_Status } from './flows-actors.commons.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport { Actors_Task_Schema } from './tasks.actors.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport {\n CoreResourceType,\n coreResourceShared_FieldIdentifier,\n} from '../resources/resources.shared.core.definitions';\nimport {\n declarePolymorphicSchemas,\n optOutPolymorphicAutoBusinessKey,\n type PolymorphicVariantDefinition,\n} from '../resources/utils/resource-polymorphism.schemas';\n\ninitZodDecorators(z);\n\n//===============================================================\n// Base task record — NO owner scope FK (injected per variant)\n//===============================================================\n\n/**\n * The work record shared by every scope variant.\n *\n * Derived from the canonical `Actors_Task_Schema` and narrowed with persistence\n * concerns: a primary key, indexes on the fields the A2A surface queries, and the\n * OPTIONAL link back to the conversational execution that produced it.\n */\n/** Fixed replacement for task text that cannot be cleared (a `.min(1)` field). */\nconst ERASED_TASK_TEXT = '[erased]';\n\nexport const FlowActorTaskBaseSchema = Actors_Task_Schema.omit({\n // === HEAVY NESTED ORCHESTRATION STATE — OMITTED, NOT MADE OPTIONAL ===\n //\n // ⚠️ CORRECTION to an earlier claim in this file's history. The warning on\n // `FlowActorExecutionBaseSchema` — that heavy nested sub-structures do NOT round-trip\n // through the Zod→Mongoose embedded-subdocument conversion as optional slots — was\n // dismissed here on the grounds that it applied only to EMBEDDING a task inside an\n // execution, not to persisting tasks as their own collection. **That was wrong**, and a\n // service-tier test against real MongoDB proved it: Mongoose instantiates an empty\n // subdocument for an optional nested object and then fails its REQUIRED inner paths, so\n // every create died on `errorStates → customMessageReference is required`. The trap is\n // about optional nested objects with required inner paths — nesting DEPTH is irrelevant.\n //\n // Making them `.optional()` does not help (that was the first attempted fix and it\n // failed identically). They are therefore OMITTED: an A2A-materialised task genuinely\n // has no actor decomposition, no per-actor state, no memory and no error graph. When an\n // orchestration runtime actually produces that state, add it back WITH the\n // embedded-subdocument treatment the execution schema prescribes — not by relaxing a\n // required path.\n errorStates: true,\n memory: true,\n actorStates: true,\n relationships: true,\n actors: true,\n initiator: true,\n context: true,\n // G2-6: `startedAt` / `completedAt` are ISO `z.string()` on the canonical schema and would\n // sit beside this family's `z.date()` timestamps — the exact mixed-representation trap this\n // file warns about below. Nothing reads or writes them here (`finishedAt` carries the\n // terminal moment), so they are omitted rather than left as an unread inconsistency.\n startedAt: true,\n completedAt: true,\n}).extend({\n // Scalar orchestration fields — safe to keep, merely absent on an A2A task.\n // ── Provenance, per field, because the resource default cannot be right for all of them ──\n //\n // The config's `defaultProvenance: OBSERVED` fits the LIFECYCLE fields (status, timestamps, ids —\n // things the platform recorded about the work). It is wrong in BOTH directions for the content:\n //\n // • `title` / `input` / `description` / `topic` are SUBJECT_PROVIDED — they carry what the\n // requester actually said. ⚠️ This is a PRECISION change, not a behaviour change: an earlier\n // revision claimed OBSERVED \"under-scopes an Art. 20 bundle\", which is false against this\n // framework — `resolvePortabilityFieldScope` maps OBSERVED *and* SUBJECT_PROVIDED to\n // INCLUDED, and the enum's own documentation says OBSERVED is \"in scope for Art. 20, which is\n // the whole reason this member exists\". The reclassification is still right (these fields\n // genuinely came from the subject), but only the DERIVED half below changes what a bundle\n // contains.\n // • `output` / `artifacts` are DERIVED — model output about the subject rather than from them.\n // Classifying THOSE as observed over-delivers generated content into a portability bundle,\n // which the enum's own documentation excludes.\n //\n // All five also declare `USER_CONTENT` as their data CATEGORY — a separate axis, and the reason\n // both are needed here: provenance decides Art. 20 SCOPE (is it in the portability bundle),\n // category decides what a privacy notice ENUMERATES. `output` is excluded from a bundle and is\n // still content held about a person, so a notice must name it. Declared rather than left blank\n // because a field carrying a provenance and no category is reported as an OUTSTANDING gap, by\n // name, in every generated application's notice — the engine owes its own inventory.\n // REMOVE all five on erasure. `description`, `topic` and `input` are what the person WROTE; `output`\n // and `artifacts` are derived from it and carry it forward. This is the content a task holds, not a\n // link it carries, so erasure has to reach it. All five are `.optional()`, so REMOVE is clearable.\n description: addImpersonalizeWith(\n Actors_Task_Schema.shape.description.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n topic: addImpersonalizeWith(\n Actors_Task_Schema.shape.topic.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n input: addImpersonalizeWith(\n Actors_Task_Schema.shape.input.optional()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n // ⚠️ RE-WRAP with `.optional()` FIRST — decorating these leaves in place mutates the CANONICAL\n // schema (finding G7-3). Wrapper decorators mirror onto the inner type copy-on-write, but only\n // ONE level: the three fields above are safe because `.optional()` mints a fresh wrapper before\n // the decorator runs, whereas `output`/`artifacts` are ALREADY optional wrappers on the base\n // schema, so nothing fresh was minted and the decoration landed on `Actors_Task_Schema` itself.\n //\n // Runtime-proven, and the FIRST fix was wrong: `.clone()` is a shallow copy that still shares the\n // inner type, so it isolated nothing — measured `CANON leaked: derived`. `.optional()` (or\n // `.nullish()`) mints the fresh wrapper the copy-on-write needs; measured `CANON leaked:\n // undefined` with the decoration intact on the family. Double-optional is harmless — the outer\n // wrapper exists to carry the decoration.\n //\n // Why it matters: `undefined` means \"nobody decided\", a DESIGNED refusal that\n // `resolvePortabilityFieldScope` surfaces as UNDECLARED. `DERIVED` means \"decided to EXCLUDE\". In\n // place, the leak silently converted an open question into an answer for every consumer of the\n // canonical schema — `standaloneTasks` and the platform's application-task resource — and did it\n // import-order-dependently.\n output: addImpersonalizeWith(\n Actors_Task_Schema.shape.output.optional()\n .portabilityProvenance(DataPortabilityProvenance.DERIVED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n artifacts: addImpersonalizeWith(\n Actors_Task_Schema.shape.artifacts.optional()\n .portabilityProvenance(DataPortabilityProvenance.DERIVED)\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.REMOVE,\n ),\n\n /** MongoDB document id — auto-generated / auto-managed (excluded from create). */\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /**\n * Stable business id, and the identity the A2A protocol addresses: this is the\n * value returned as `Task.id` and accepted by `tasks/get` / `tasks/cancel`.\n *\n * ⚠️ `scope: 'global'` is enforced PER VARIANT, not across the family: the three\n * variants are three separate stores, so the index cannot span them. Nothing depends on\n * family-wide uniqueness — `readTask` resolves the variant from the authenticated\n * owner BEFORE matching the id, so two identical ids in different scopes would never be\n * confused (and a v4 uuid collision is not a real risk anyway). Recorded because the\n * decorator name reads stronger than what it can deliver here.\n */\n taskId: z.uuid().isUnique({ scope: 'global', sparse: false }).excludeFromUpdate().isSummaryField(),\n\n /**\n * OPTIONAL link to the conversational execution this task was materialised from.\n *\n * A SOFT link, deliberately: it stores the execution's globally-unique\n * `executionId` business id and is NOT declared as a resource foreign key. Two\n * reasons, both load-bearing:\n *\n * 1. **Executions are polymorphic.** Their per-variant field identifiers are\n * `userFlowActorExecutionId` / `organizationFlowActorExecutionId` /\n * `applicationFlowActorExecutionId`, so one `flowActorExecutionId` FK matches\n * no variant. A real FK would mean declaring 3×3 (or 3 matched-pair)\n * relationships to express \"some execution\".\n * 2. **We do not want the graph semantics.** A declared relationship implies\n * population and a cascade path; a task must be able to OUTLIVE the execution\n * that produced it (that is the entire point of keeping the two planes\n * separate), so deleting a conversation must not delete its work records.\n *\n * Ownership and cascade already flow from the injected scope FK, which is the\n * only authority that should govern a task's lifetime. Indexed so \"the tasks of\n * this conversation\" stays a single-field query.\n */\n flowActorExecutionId: z.string().isDBIndexed().optional(),\n\n /**\n * WHICH A2A agent (resource-server instance) this task was created through.\n *\n * Part of the read/cancel filter, not merely descriptive metadata. A2A agents are declared as\n * SEPARATE resource servers — tokens are audience-bound per instance, and an agent must have\n * \"no side-door into another agent's actor system\". Without this field the task plane had no\n * per-agent dimension at all, so a token bound to agent B could read and cancel a task created\n * through agent A whenever both resolved to the same owner scope. Since `title` carries the\n * first 120 characters of the originating prompt, that also disclosed prompt text across the\n * boundary the audience binding exists to enforce.\n *\n * Always populated: the DEFAULT (unnamed) agent is a real identity too and is stored under a\n * sentinel that cannot collide with a declared ref (instance refs are constrained to\n * `^[a-z0-9][a-z0-9-]*$`). Storing a normalised value rather than leaving the default agent's\n * tasks null keeps the filter a plain equality on both persistence adapters, instead of\n * depending on how each one matches an absent field.\n */\n resourceServerInstanceRef: z.string().min(1).isDBIndexed(),\n\n /**\n * WHICH machine credential opened this record — part of the read filter, not metadata.\n *\n * The injected scope FK does not identify the principal on the machine variants:\n * `applicationId` is a deployment singleton and `organizationId` is shared by every machine\n * client of one tenant, so without this axis a separately-credentialed client could read and\n * cancel another's work — and `title` carries the opening characters of the originating prompt.\n *\n * User-delegated turns store {@link FLOWS_ACTORS_NO_MACHINE_CREDENTIAL}: there the human is the\n * principal and the `userId` owner FK already discriminates.\n */\n machineCredentialId: z.string().min(1).isDBIndexed(),\n\n /** Indexed: `tasks/get` and the abandoned-task sweep both filter on status. */\n status: z.enum(FlowsActors_Status).isDBIndexed().isSummaryField(),\n\n /**\n * Short human-readable name for the work.\n *\n * ⚠️ CONTENT-BEARING, and `.isSummaryField()` puts it on the `/summary` projection: the A2A\n * transport fills it with the opening 120 characters of the ORIGINATING PROMPT. Treat it as\n * subject-provided content, not a label — it is why the read filter carries the agent-instance\n * and machine-credential axes, and why the portability policy classifies it separately from the\n * observed lifecycle fields.\n */\n // MASK on erasure, not REMOVE: `.min(1)` makes the field non-clearable, so a null would be rejected by\n // the strict update-DTO parse the impersonalize writer runs. The mask is a fixed non-empty string,\n // which the schema accepts. It matters that this one is scrubbed at all — the title is the opening\n // 120 characters of the originating PROMPT.\n title: addImpersonalizeWith(\n z.string().min(1).isSummaryField()\n .portabilityProvenance(DataPortabilityProvenance.SUBJECT_PROVIDED)\n // The opening 120 characters of the originating PROMPT, per the note above — content, not a label.\n .dataCategories(PersonalDataCategory.USER_CONTENT),\n RedactionType.MASK,\n { maskValue: ERASED_TASK_TEXT },\n ),\n\n /**\n * A2A `contextId` — threads related turns. Indexed so a client can enumerate\n * the tasks of one conversation without walking executions.\n */\n contextId: z.string().isDBIndexed().optional(),\n\n // === Timestamps are `z.date()` with defaults, NOT the canonical schema's ISO\n // strings: the persistence layer date-coerces, and a missing default\n // yields `Invalid Date` on create (same rationale as the execution base). ===\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n /**\n * Indexed because the abandoned-task SWEEP filters on it (`updatedAt < cutoff` AND a status set),\n * once per variant per run. Without an index that query is a sequential scan over a collection\n * that only ever grows — terminal tasks are never deleted — so the sweep gets slower forever\n * while doing the same work. The sibling `status` index was declared for this query from the\n * start; this axis was left off, which made the pair half-served (review finding L-1).\n */\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate().isDBIndexed(),\n /** Set when the task reaches a terminal state; never on create. */\n finishedAt: z.date().optional().excludeFromCreate(),\n /**\n * The task's A2A push-notification configurations, SERIALIZED as a JSON string.\n *\n * A scalar string for the same reason `pausedApproval` is one: heavy nested sub-structures do not\n * round-trip through the Zod→Mongoose embedded-subdocument conversion, and this is a LIST of\n * objects that themselves nest (`authentication.schemes[]`). Parse and serialize ONLY through the\n * helpers below, at the persistence boundary.\n *\n * ⚠️ The stored blob contains CREDENTIALS the client gave us to present to its own webhook\n * (`token`, `authentication.credentials`). It is therefore backend-only by intent: nothing\n * projects this field to a client, and the read path redacts before answering. See\n * `redactPushNotificationSecrets`.\n */\n pushNotificationConfigs: z.string().nullish().excludeFromCreate().isBackendOnly(),\n});\nexport type FlowActorTaskBase = z.infer<typeof FlowActorTaskBaseSchema>;\n\n//===============================================================\n// Polymorphic declaration — one owner-scope variant per scope\n//===============================================================\n\n/**\n * The three owner-scope variants a task is stamped out for — the SAME set as\n * executions, so ownership of a task always matches the principal that drove the\n * turn. Each opts OUT of the singleton auto-business-key: tasks are MULTI-ROW per\n * scope, so the injected owner FK must NOT be marked `.isUnique()` (the second\n * task per scope would otherwise fail with a duplicate-key error).\n */\nexport const FLOW_ACTOR_TASK_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.APPLICATION, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION], isPrimaryScope: true },\n].map(optOutPolymorphicAutoBusinessKey);\n\n/**\n * Polymorphic declaration for flows-actors tasks. Produces 3 variants:\n * - users → `userFlowActorTasks` (`userId` injected)\n * - organizations → `organizationFlowActorTasks` (`organizationId` injected)\n * - applications → `applicationFlowActorTasks` (`applicationId` injected)\n */\nexport const flowActorTasksPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'flowActorTasks',\n baseFieldIdentifier: 'flowActorTaskId',\n baseEnumKey: 'FLOW_ACTOR_TASKS',\n baseSchema: FlowActorTaskBaseSchema,\n variants: FLOW_ACTOR_TASK_SCOPE_VARIANTS,\n});\n\n/**\n * Owner-agnostic UPDATE DTO — the mutations the task lifecycle actually performs.\n * Shared across variants because it references NO owner FK (owner is immutable).\n */\nexport const FlowActorTaskUpdateInternalSchema = z.object({\n status: FlowActorTaskBaseSchema.shape.status.optional(),\n output: FlowActorTaskBaseSchema.shape.output,\n artifacts: FlowActorTaskBaseSchema.shape.artifacts,\n // `actorStates` / `errorStates` are deliberately ABSENT — they are omitted from the\n // persisted family (see the omit block above), so an update DTO referencing them would\n // be a contract for a column that does not exist.\n finishedAt: FlowActorTaskBaseSchema.shape.finishedAt,\n /**\n * ⚠️ THIS SCHEMA IS AN ALLOW-LIST. A field absent here does not fail on write — the write\n * SUCCEEDS and persists nothing, which is how `pausedApproval` shipped unwritable and left every\n * paused turn unresumable. `.nullish()` because clearing a task's configurations is a real\n * transition (`pushNotificationConfig/delete` removing the last one).\n */\n pushNotificationConfigs: FlowActorTaskBaseSchema.shape.pushNotificationConfigs,\n});\n\n/**\n * Runtime shape of a persisted task (the base record). The owner FK is\n * variant-specific (`userId` | `organizationId` | `applicationId`) and read from\n * the concrete variant; the runtime supplies it explicitly on create.\n */\nexport type FlowActorTask = z.infer<typeof FlowActorTaskBaseSchema>;\n"]}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { CoreResourceOperation } from '../resources/resources.shared.core.definitions';
|
|
10
10
|
import { ResourceRelationship } from '../resources/resources.shared.schemas';
|
|
11
|
-
type UserGuidanceStateCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.SEARCH | CoreResourceOperation.UPDATE | CoreResourceOperation.CREATE | CoreResourceOperation.DELETE;
|
|
11
|
+
type UserGuidanceStateCoreOperations = CoreResourceOperation.READ | CoreResourceOperation.SEARCH | CoreResourceOperation.UPDATE | CoreResourceOperation.CREATE | CoreResourceOperation.DELETE | CoreResourceOperation.LIST | CoreResourceOperation.UPDATE_MANY;
|
|
12
12
|
export declare const userGuidanceStateResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("..").ResourceConfiguration<Record<string, never>, UserGuidanceStateCoreOperations, import("zod").ZodObject<{
|
|
13
13
|
flows: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("zod").ZodDefault<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
14
14
|
status: import("zod").ZodEnum<typeof import("..").OnboardingStatus>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidance-state.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/guidance/guidance-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAA8B,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"guidance-state.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/guidance/guidance-state.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAA8B,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAWzG,KAAK,+BAA+B,GAChC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAE5B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,WAAW,CAAC;AAEtC,eAAO,MAAM,4DAA4D,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;iCAyKzH,CAAC;AAIH,KAAK,uCAAuC,GACxC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,oEAAoE,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;iCAiGjI,CAAC"}
|