@wildo-ai/saas-backend-lib 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +2 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/stored-field-omission.backend.d.ts +4 -0
- package/dist/esm/base-classes/services/repositories/stored-field-omission.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/stored-field-omission.backend.js +20 -5
- package/dist/esm/base-classes/services/repositories/stored-field-omission.backend.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts +3 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js +10 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts +22 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js +25 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts +38 -3
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.js +68 -5
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts +2 -2
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +6 -3
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +83 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +217 -14
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seal-currency.backend.d.ts +32 -0
- package/dist/esm/compliance/approval-seals/approval-seal-currency.backend.d.ts.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-currency.backend.js +36 -0
- package/dist/esm/compliance/approval-seals/approval-seal-currency.backend.js.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-on-record.backend.d.ts +38 -0
- package/dist/esm/compliance/approval-seals/approval-seal-on-record.backend.d.ts.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-on-record.backend.js +83 -0
- package/dist/esm/compliance/approval-seals/approval-seal-on-record.backend.js.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-presentation-read.backend.d.ts +36 -0
- package/dist/esm/compliance/approval-seals/approval-seal-presentation-read.backend.d.ts.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-presentation-read.backend.js +51 -0
- package/dist/esm/compliance/approval-seals/approval-seal-presentation-read.backend.js.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seal-relay-store.backend.d.ts +46 -0
- package/dist/esm/compliance/approval-seals/approval-seal-relay-store.backend.d.ts.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seal-relay-store.backend.js +68 -0
- package/dist/esm/compliance/approval-seals/approval-seal-relay-store.backend.js.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seal-store.backend.d.ts +27 -0
- package/dist/esm/compliance/approval-seals/approval-seal-store.backend.d.ts.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seal-store.backend.js +42 -3
- package/dist/esm/compliance/approval-seals/approval-seal-store.backend.js.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.contracts.d.ts +26 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.contracts.d.ts.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.contracts.js +10 -0
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.contracts.js.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.controller.d.ts +10 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.controller.d.ts.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.controller.js +60 -28
- package/dist/esm/compliance/approval-seals/approval-seals-admin.backend.controller.js.map +1 -1
- package/dist/esm/compliance/approval-seals/approval-seals-on-record.backend.controller.d.ts +90 -0
- package/dist/esm/compliance/approval-seals/approval-seals-on-record.backend.controller.d.ts.map +1 -0
- package/dist/esm/compliance/approval-seals/approval-seals-on-record.backend.controller.js +373 -0
- package/dist/esm/compliance/approval-seals/approval-seals-on-record.backend.controller.js.map +1 -0
- package/dist/esm/compliance/approval-seals/decision-presentation.backend.d.ts +29 -2
- package/dist/esm/compliance/approval-seals/decision-presentation.backend.d.ts.map +1 -1
- package/dist/esm/compliance/approval-seals/decision-presentation.backend.js +40 -3
- package/dist/esm/compliance/approval-seals/decision-presentation.backend.js.map +1 -1
- package/dist/esm/compliance/electronic-signatures/pdf-signature-structure.backend.d.ts.map +1 -1
- package/dist/esm/compliance/electronic-signatures/pdf-signature-structure.backend.js +34 -6
- package/dist/esm/compliance/electronic-signatures/pdf-signature-structure.backend.js.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-request-evidence-files.backend.d.ts +30 -6
- package/dist/esm/compliance/electronic-signatures/signature-request-evidence-files.backend.d.ts.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-request-evidence-files.backend.js +67 -22
- package/dist/esm/compliance/electronic-signatures/signature-request-evidence-files.backend.js.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-request-poll.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-request-poll.batch.backend.service.js +18 -1
- package/dist/esm/compliance/electronic-signatures/signature-request-poll.batch.backend.service.js.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-requests.backend.service.d.ts +66 -1
- package/dist/esm/compliance/electronic-signatures/signature-requests.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signature-requests.backend.service.js +161 -14
- package/dist/esm/compliance/electronic-signatures/signature-requests.backend.service.js.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signed-document-validation.backend.d.ts +47 -0
- package/dist/esm/compliance/electronic-signatures/signed-document-validation.backend.d.ts.map +1 -1
- package/dist/esm/compliance/electronic-signatures/signed-document-validation.backend.js.map +1 -1
- package/dist/esm/external-providers/services/content-safety.backend.service.d.ts +27 -2
- package/dist/esm/external-providers/services/content-safety.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/content-safety.backend.service.js +46 -1
- package/dist/esm/external-providers/services/content-safety.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.js +2 -0
- package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +11 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +23 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/provider-service-account-token.backend.d.ts +19 -1
- package/dist/esm/external-providers/services/provider-service-account-token.backend.d.ts.map +1 -1
- package/dist/esm/external-providers/services/provider-service-account-token.backend.js +41 -1
- package/dist/esm/external-providers/services/provider-service-account-token.backend.js.map +1 -1
- package/dist/esm/files/utils/file-parent-read-context.backend.d.ts +27 -2
- package/dist/esm/files/utils/file-parent-read-context.backend.d.ts.map +1 -1
- package/dist/esm/files/utils/file-parent-read-context.backend.js +23 -4
- package/dist/esm/files/utils/file-parent-read-context.backend.js.map +1 -1
- package/dist/esm/flows-actors/content-guardrails/classifier-availability.backend.utils.d.ts +26 -0
- package/dist/esm/flows-actors/content-guardrails/classifier-availability.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/content-guardrails/classifier-availability.backend.utils.js +100 -8
- package/dist/esm/flows-actors/content-guardrails/classifier-availability.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/content-guardrails/record-owner-policy.backend.d.ts +3 -1
- package/dist/esm/flows-actors/content-guardrails/record-owner-policy.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/content-guardrails/record-owner-policy.backend.js +8 -2
- package/dist/esm/flows-actors/content-guardrails/record-owner-policy.backend.js.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +43 -0
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +37 -0
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/services/agent-work-decisions.backend.service.d.ts +7 -0
- package/dist/esm/flows-actors/services/agent-work-decisions.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agent-work-decisions.backend.service.js +8 -3
- package/dist/esm/flows-actors/services/agent-work-decisions.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +31 -6
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +78 -30
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/autonomous-agent-turn.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/autonomous-agent-turn.backend.service.js +4 -0
- package/dist/esm/flows-actors/services/autonomous-agent-turn.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +28 -2
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +132 -22
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flow-actor-executions.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flow-actor-executions.custom-impl.backend.service.js +12 -8
- package/dist/esm/flows-actors/services/flow-actor-executions.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +5 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +18 -2
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +33 -0
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +58 -0
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-dispatch.backend.service.d.ts +12 -1
- package/dist/esm/inbound/services/inbound-delivery-dispatch.backend.service.d.ts.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-dispatch.backend.service.js +23 -4
- package/dist/esm/inbound/services/inbound-delivery-dispatch.backend.service.js.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-receiver.backend.service.d.ts +12 -1
- package/dist/esm/inbound/services/inbound-delivery-receiver.backend.service.d.ts.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-receiver.backend.service.js +55 -17
- package/dist/esm/inbound/services/inbound-delivery-receiver.backend.service.js.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-store.backend.service.d.ts +22 -1
- package/dist/esm/inbound/services/inbound-delivery-store.backend.service.d.ts.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-store.backend.service.js +52 -9
- package/dist/esm/inbound/services/inbound-delivery-store.backend.service.js.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-stored-body.backend.service.d.ts +79 -0
- package/dist/esm/inbound/services/inbound-delivery-stored-body.backend.service.d.ts.map +1 -0
- package/dist/esm/inbound/services/inbound-delivery-stored-body.backend.service.js +211 -0
- package/dist/esm/inbound/services/inbound-delivery-stored-body.backend.service.js.map +1 -0
- package/dist/esm/inbound/services/inbound-delivery-subject-erasure-severance.backend.d.ts +2 -2
- package/dist/esm/inbound/services/inbound-delivery-subject-erasure-severance.backend.d.ts.map +1 -1
- package/dist/esm/inbound/services/inbound-delivery-subject-erasure-severance.backend.js +9 -1
- package/dist/esm/inbound/services/inbound-delivery-subject-erasure-severance.backend.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +6 -0
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +5 -0
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +3 -0
- package/dist/esm/inject/models/service-types.js.map +1 -1
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +5 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +34 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.js +49 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +6 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +15 -4
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.js +3 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +3 -1
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.js +11 -3
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/utils/inbound-endpoint-raw-body.backend.utils.d.ts +22 -0
- package/dist/esm/runtime/services/utils/inbound-endpoint-raw-body.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/services/utils/inbound-endpoint-raw-body.backend.utils.js +54 -0
- package/dist/esm/runtime/services/utils/inbound-endpoint-raw-body.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts +51 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js +87 -15
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js +5 -2
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +65 -24
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +64 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +84 -2
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +14 -0
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +13 -5
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/users/services/anonymous-consent.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/anonymous-consent.custom-impl.backend.service.js +6 -2
- package/dist/esm/users/services/anonymous-consent.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts +7 -0
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.js +65 -20
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.js +11 -4
- package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/users/services/user-self-custom-implementations.backend.js +4 -2
- package/dist/esm/users/services/user-self-custom-implementations.backend.js.map +1 -1
- package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.js +16 -0
- package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +10 -10
|
@@ -74,7 +74,7 @@ import { runOutsideModelSpendFrame, runWithModelSpendFrame } from '../../runtime
|
|
|
74
74
|
import { humanDecisionDeciderEventFields, humanDecisionDeciderRecordOfActor, humanDecisionRequesterEventFields } from '../../flows-actors/utils/human-decision-decider.backend.utils.js';
|
|
75
75
|
import { humanDecisionReplyAnswerOf } from '../../flows-actors/utils/human-decision-reply-answer.backend.utils.js';
|
|
76
76
|
import { sealDecisionInTransaction } from '../../compliance/approval-seals/approval-seal-store.backend.js';
|
|
77
|
-
import { DecisionPresentationCheckKind, acknowledgeDecisionPresentation, decisionPresentationKeyOfRuntime, decisionStatementOf, resolveDecisionDeliverables, withDecisionPresentation, } from '../../compliance/approval-seals/decision-presentation.backend.js';
|
|
77
|
+
import { DecisionPresentationCheckKind, acknowledgeDecisionPresentation, decisionPresentationKeyOfRuntime, decisionStatementOf, resolveDecisionDeliverables, resolveDecisionSubjectRecord, withDecisionPresentation, } from '../../compliance/approval-seals/decision-presentation.backend.js';
|
|
78
78
|
import { ApprovalSealMeaning, ApprovalSource, isApprovalSealOutcome } from '@wildo-ai/saas-models';
|
|
79
79
|
import { agentWorkOwnerOfExecution, owedRecordIsRepairableFromRow, } from '../../flows-actors/services/agent-work-decisions.backend.service.js';
|
|
80
80
|
import { NO_HUMAN_DECISION_ROLE_FACTS, PENDING_DECISION_CLEARED, humanDecisionRequesterOfAuth, humanDecisionRequesterOfRow, humanDecisionRouteOfRow, announceHumanDecisionRouted, announceCapturedHumanDecision, announceHumanDecisionWithdrawn, admitHumanDecisionAnswerers, chatOfferableAnswerPredicate, collectHumanDecisionAnswerers, holdHumanDecisionActorToGrantingOrganization, HumanDecisionGrantorHoldKind, END_PENDING_DECISION_ROUTE_ATTEMPTS, isReviewerRoute, resolveHumanDecisionListingOrganizationIds, resolveHumanDecisionRoleFacts, humanDecisionSubjectOfToolCall, humanDecisionForeignKeyArgumentsEdited, answersAsOrganizationOwnStaff, HUMAN_DECISION_NAMES_NO_RECORD, HumanDecisionSubjectKind, toolApprovalDecisionRequest, toolApprovalVerdictOf, createHumanDecisionRoleFactsPorts, answeredThroughRefusalFields, lapsedActorRefusalReason, DECISION_REQUEST_REPAIR_GRACE_MS, DecisionRequestWriteOutcome, humanDecisionRequestedAuditEventId, readBackThrownDecisionRequestWrite, waitBeforeDecisionRequestRead, } from './pending-human-decision.backend.utils.js';
|
|
@@ -2473,7 +2473,8 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2473
2473
|
* expiry, and this block is the only path by which a client can learn it.
|
|
2474
2474
|
*/
|
|
2475
2475
|
// #2904: the call's file deliverable, bound by its hash as every card of this decision binds it.
|
|
2476
|
-
|
|
2476
|
+
// #2914: and the record it acts on, with the fields its approval covers.
|
|
2477
|
+
const { deliverables, subjectRecord } = await this.decisionPresentationBindingsOf(systemRef, {
|
|
2477
2478
|
decisionRef, toolName: suspension.toolName, toolArgs: suspension.toolArgs,
|
|
2478
2479
|
...(route.organizationId ? { organizationId: route.organizationId } : {}),
|
|
2479
2480
|
});
|
|
@@ -2487,6 +2488,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2487
2488
|
expiresAt: pausedApprovalExpiresAt,
|
|
2488
2489
|
...(questionForm ? { questionForm } : {}),
|
|
2489
2490
|
...(deliverables ? { deliverables } : {}),
|
|
2491
|
+
...(subjectRecord ? { subjectRecord } : {}),
|
|
2490
2492
|
});
|
|
2491
2493
|
emitter(CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE, {
|
|
2492
2494
|
systemRef,
|
|
@@ -2691,6 +2693,16 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2691
2693
|
return undefined;
|
|
2692
2694
|
}
|
|
2693
2695
|
}
|
|
2696
|
+
/** Whether a gated tool declares that its approval of a row replaces its earlier approval of that row (#2914). */
|
|
2697
|
+
approvalReplacesEarlierApprovalOfRow(systemRef, toolName) {
|
|
2698
|
+
try {
|
|
2699
|
+
const resolved = this.resolveApprovalGatedFunctionTool(systemRef, toolName);
|
|
2700
|
+
return resolved.kind === GatedFunctionToolResolutionKind.FOUND && resolved.functionTool.approvalReplacesEarlierApprovalOfRow === true;
|
|
2701
|
+
}
|
|
2702
|
+
catch {
|
|
2703
|
+
return false;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2694
2706
|
/** The argument a gated tool declares names its file deliverable (#2904), when it declares one. */
|
|
2695
2707
|
deliverableFileArgumentOf(systemRef, toolName) {
|
|
2696
2708
|
try {
|
|
@@ -2702,8 +2714,45 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2702
2714
|
}
|
|
2703
2715
|
}
|
|
2704
2716
|
/**
|
|
2705
|
-
*
|
|
2706
|
-
*
|
|
2717
|
+
* What a gated call's presentation binds beyond its arguments: its file deliverable, bound by its content hash (#2904),
|
|
2718
|
+
* and the record it acts on with the fields its approval covers (#2914). The ONE resolution the announcement, the
|
|
2719
|
+
* history, the inbox and the act read, so they agree on the presentation and its id. Nothing for a tool that declares
|
|
2720
|
+
* neither.
|
|
2721
|
+
*/
|
|
2722
|
+
async decisionPresentationBindingsOf(systemRef, call) {
|
|
2723
|
+
const [deliverables, subjectRecord] = await Promise.all([this.decisionDeliverablesOf(systemRef, call), this.decisionSubjectRecordOf(systemRef, call)]);
|
|
2724
|
+
return { ...deliverables, ...(subjectRecord ? { subjectRecord } : {}) };
|
|
2725
|
+
}
|
|
2726
|
+
/**
|
|
2727
|
+
* The record a gated call acts on, with the fields its tool declares the approval covers (#2914,
|
|
2728
|
+
* `FunctionTool.sealedRecordFields`), read as the system. Undefined for a tool that declares none.
|
|
2729
|
+
*/
|
|
2730
|
+
async decisionSubjectRecordOf(systemRef, call) {
|
|
2731
|
+
let tool;
|
|
2732
|
+
try {
|
|
2733
|
+
const resolved = this.resolveApprovalGatedFunctionTool(systemRef, call.toolName);
|
|
2734
|
+
tool = resolved.kind === GatedFunctionToolResolutionKind.FOUND ? resolved.functionTool : undefined;
|
|
2735
|
+
}
|
|
2736
|
+
catch {
|
|
2737
|
+
return undefined;
|
|
2738
|
+
}
|
|
2739
|
+
if (!tool?.sealedRecordFields)
|
|
2740
|
+
return undefined;
|
|
2741
|
+
return resolveDecisionSubjectRecord({
|
|
2742
|
+
sealedFields: tool.sealedRecordFields,
|
|
2743
|
+
resourceType: tool.argumentsResource?.resourceType,
|
|
2744
|
+
rowIdArgument: tool.argumentsResource?.rowIdArgument,
|
|
2745
|
+
toolArgs: call.toolArgs,
|
|
2746
|
+
...(call.organizationId ? { organizationId: call.organizationId } : {}),
|
|
2747
|
+
readRow: (resourceType, rowId) => this.systemAccess.readAsSystem(resourceType, { _id: rowId }, { suppressSystemAudit: true }),
|
|
2748
|
+
onReadFailure: (error) => this.logger.warn('[ConversationalExecution] The record a decision is about could not be read; it is shown and sealed with no record values', {
|
|
2749
|
+
systemRef, decisionRef: call.decisionRef, toolName: call.toolName, ...projectCaughtErrorLogFields(error),
|
|
2750
|
+
}),
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
/**
|
|
2754
|
+
* A gated call's file deliverable, bound by its content hash (#2904). Nothing for a tool that declares none. Read through
|
|
2755
|
+
* {@link decisionPresentationBindingsOf}, never alone.
|
|
2707
2756
|
*/
|
|
2708
2757
|
async decisionDeliverablesOf(systemRef, call) {
|
|
2709
2758
|
const deliverableArgument = this.deliverableFileArgumentOf(systemRef, call.toolName);
|
|
@@ -2801,7 +2850,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2801
2850
|
const presented = withDecisionPresentation({
|
|
2802
2851
|
decisionRef: pause.decisionRef, plane: HumanDecision_Plane.CONVERSATIONAL, toolName: pause.toolName,
|
|
2803
2852
|
toolArgs: pause.toolArgs ?? {}, ...(question ? { request: question } : {}),
|
|
2804
|
-
}, decisionPresentationKeyOfRuntime(this.appConfig), pause.deliverables);
|
|
2853
|
+
}, decisionPresentationKeyOfRuntime(this.appConfig), pause.deliverables, pause.subjectRecord);
|
|
2805
2854
|
return { presentation: presented.presentation, presentationId: presented.presentationId };
|
|
2806
2855
|
})() : {}),
|
|
2807
2856
|
};
|
|
@@ -2826,7 +2875,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2826
2875
|
if (!row || row.status !== FlowsActors_Status.AWAITING_APPROVAL || !row.pausedApproval)
|
|
2827
2876
|
return undefined;
|
|
2828
2877
|
const paused = parseFlowActorPausedApproval(row.pausedApproval);
|
|
2829
|
-
const { deliverables } = row.pendingDecisionRef ? await this.
|
|
2878
|
+
const { deliverables, subjectRecord } = row.pendingDecisionRef ? await this.decisionPresentationBindingsOf(execution.systemRef, {
|
|
2830
2879
|
decisionRef: row.pendingDecisionRef, toolName: paused.pendingToolName, toolArgs: paused.pendingToolArgs,
|
|
2831
2880
|
...(row.pendingDecisionOrganizationId ? { organizationId: row.pendingDecisionOrganizationId } : {}),
|
|
2832
2881
|
}) : {};
|
|
@@ -2840,6 +2889,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2840
2889
|
...(paused.expiresAt ? { expiresAt: paused.expiresAt } : {}),
|
|
2841
2890
|
...(paused.questionForm ? { questionForm: paused.questionForm } : {}),
|
|
2842
2891
|
...(deliverables ? { deliverables } : {}),
|
|
2892
|
+
...(subjectRecord ? { subjectRecord } : {}),
|
|
2843
2893
|
});
|
|
2844
2894
|
}
|
|
2845
2895
|
catch (error) {
|
|
@@ -2945,9 +2995,10 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2945
2995
|
// #2865: an erasure's ending CANCELS the work whatever its outcome (see DECISION_ENDED_BY_ERASURE); every other
|
|
2946
2996
|
// ending ends it as its outcome says.
|
|
2947
2997
|
const transition = params.erasure ? DECISION_ENDED_BY_ERASURE : DECISION_ENDING_TRANSITION[params.outcome];
|
|
2948
|
-
if (params.decisionRef && !params.teardown)
|
|
2949
|
-
await this.repayOwedCorrectionBeforeOverwrite(params.resourceType, params.row, params.decisionRef, params.erasure);
|
|
2950
|
-
|
|
2998
|
+
if (params.decisionRef && !params.teardown) {
|
|
2999
|
+
await this.repayOwedCorrectionBeforeOverwrite(params.resourceType, params.row, params.decisionRef, params.erasure, params.deletion?.transaction);
|
|
3000
|
+
}
|
|
3001
|
+
const transaction = params.teardown?.transaction ?? params.erasure?.transaction ?? params.deletion?.transaction;
|
|
2951
3002
|
const writeOptions = {
|
|
2952
3003
|
...(params.scopeContext ? { scopeContext: params.scopeContext } : {}),
|
|
2953
3004
|
...(transaction ? { transaction } : {}),
|
|
@@ -2991,7 +3042,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
2991
3042
|
if (ended !== null && ended !== undefined) {
|
|
2992
3043
|
// #2821: ending the decision ends its work, as the status this write set. Not for a teardown: the row is being
|
|
2993
3044
|
// deleted or scrubbed, and an erasure must not write new data about its subject.
|
|
2994
|
-
if (params.decisionRef && !params.teardown) {
|
|
3045
|
+
if (params.decisionRef && !params.teardown && !params.deletion) {
|
|
2995
3046
|
const workRef = row.pendingDecisionWorkRef ?? params.decisionRef;
|
|
2996
3047
|
if (params.erasure) {
|
|
2997
3048
|
// After the erasure commits: the log is a write of its own, and a rolled-back erasure ended nothing.
|
|
@@ -3044,7 +3095,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
3044
3095
|
// A teardown cannot read an unreadable row as "nothing waits": it is about to delete or scrub that row, so the
|
|
3045
3096
|
// decision would stay requested forever. It fails the teardown instead, as the settler contract asks (#2582
|
|
3046
3097
|
// review F6). Every other ending treats the row as gone, as before.
|
|
3047
|
-
if (params.teardown || params.erasure)
|
|
3098
|
+
if (params.teardown || params.erasure || params.deletion)
|
|
3048
3099
|
throw error;
|
|
3049
3100
|
return null;
|
|
3050
3101
|
});
|
|
@@ -3154,7 +3205,9 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
3154
3205
|
*/
|
|
3155
3206
|
async repayOwedCorrectionBeforeOverwrite(resourceType, row, decisionRef,
|
|
3156
3207
|
/** An erasure's repay: inside its transaction, without the erased person, and a failure fails the erasure. */
|
|
3157
|
-
erasure
|
|
3208
|
+
erasure,
|
|
3209
|
+
/** A deletion's transaction (#2297): the repay joins it, and a failure fails the deletion (it has aborted the transaction). */
|
|
3210
|
+
deletionTransaction) {
|
|
3158
3211
|
const owed = row.pendingCorrectionRecordRef;
|
|
3159
3212
|
if (!owed || owed === decisionRef || !this.agentWorkDecisions)
|
|
3160
3213
|
return;
|
|
@@ -3162,6 +3215,10 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
3162
3215
|
await this.agentWorkDecisions.repairOwedRecordOfExecution(resourceType, row, erasure);
|
|
3163
3216
|
return;
|
|
3164
3217
|
}
|
|
3218
|
+
if (deletionTransaction) {
|
|
3219
|
+
await this.agentWorkDecisions.repairOwedRecordOfExecution(resourceType, row, undefined, { transaction: deletionTransaction });
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3165
3222
|
const repaid = await this.agentWorkDecisions.repairOwedRecordOfExecution(resourceType, row).catch(() => undefined);
|
|
3166
3223
|
if (!repaid) {
|
|
3167
3224
|
this.logger.error('[ConversationalExecution] A previous decision\'s agent-work record is still owed and could not be written; this settle overwrites what it would be repaired from', {
|
|
@@ -3222,10 +3279,12 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
3222
3279
|
decidedAt: params.decidedAt,
|
|
3223
3280
|
recordSource: AgentWorkDecisionRecordSource.SETTLEMENT,
|
|
3224
3281
|
...(row.pendingDecisionOrganizationId ? { routeOrganizationId: row.pendingDecisionOrganizationId } : {}),
|
|
3225
|
-
}, { executionResourceType: params.resourceType, executionId: row.executionId });
|
|
3282
|
+
}, { executionResourceType: params.resourceType, executionId: row.executionId }, params.transaction ? { transaction: params.transaction } : undefined);
|
|
3226
3283
|
return true;
|
|
3227
3284
|
}
|
|
3228
3285
|
catch (error) {
|
|
3286
|
+
if (params.transaction)
|
|
3287
|
+
throw error;
|
|
3229
3288
|
this.logger.warn('[ConversationalExecution] A settled decision could not be recorded yet; the repair sweep will write it from the row', {
|
|
3230
3289
|
executionId: row.executionId, decisionRef: params.decisionRef, ...projectCaughtErrorLogFields(error),
|
|
3231
3290
|
});
|
|
@@ -4357,7 +4416,9 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
4357
4416
|
// Rebuilt from the row, as the card and the announcement build it, and compared with the presentation the door echoed.
|
|
4358
4417
|
// After the predicate admitted them, so saying it changed discloses nothing. A file deliverable is bound again here,
|
|
4359
4418
|
// from the file as it is now (#2904): a card shown before its recorded hash changed carries another id, and is stale.
|
|
4360
|
-
|
|
4419
|
+
// #2914: so is the record the call acts on, from the row as it is now: a card read before one of its sealed values
|
|
4420
|
+
// changed carries another id, and is stale.
|
|
4421
|
+
const deliverable = await this.decisionPresentationBindingsOf(systemRef, {
|
|
4361
4422
|
decisionRef, toolName: paused.pendingToolName, toolArgs: paused.pendingToolArgs,
|
|
4362
4423
|
...(route.organizationId ? { organizationId: route.organizationId } : {}),
|
|
4363
4424
|
});
|
|
@@ -4366,6 +4427,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
4366
4427
|
decisionRef, plane: HumanDecision_Plane.CONVERSATIONAL, toolName: paused.pendingToolName,
|
|
4367
4428
|
toolArgs: (paused.pendingToolArgs ?? {}), ...(question ? { request: question } : {}),
|
|
4368
4429
|
...(deliverable.deliverables ? { deliverables: deliverable.deliverables } : {}),
|
|
4430
|
+
...(deliverable.subjectRecord ? { subjectRecord: deliverable.subjectRecord } : {}),
|
|
4369
4431
|
},
|
|
4370
4432
|
...(params.presentationId !== undefined ? { echoedPresentationId: params.presentationId } : {}),
|
|
4371
4433
|
...(params.sentCardContent !== undefined ? { sentCardContent: params.sentCardContent } : {}),
|
|
@@ -4710,6 +4772,11 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
4710
4772
|
presentation: presentationCheck.presentation,
|
|
4711
4773
|
// #2904: the file the presentation binds; the seal attests it only when the presentation it seals binds it.
|
|
4712
4774
|
...(deliverable.bound ? { deliverableFile: deliverable.bound } : {}),
|
|
4775
|
+
// #2914: an approval of a tool that REPLACES its earlier approval of the record (a month signed off again after a
|
|
4776
|
+
// reopen) supersedes the latest seal of that tool on that record, when this answer supersedes none of its own.
|
|
4777
|
+
...(!question && sealedCallSubject.kind === HumanDecisionSubjectKind.RECORD && this.approvalReplacesEarlierApprovalOfRow(systemRef, paused.pendingToolName)
|
|
4778
|
+
? { replacesEarlierApprovalOfSubject: { toolName: paused.pendingToolName } }
|
|
4779
|
+
: {}),
|
|
4713
4780
|
statement: decisionStatementOf({
|
|
4714
4781
|
optionRef: question ? (params.answer?.optionRef ?? HumanDecision_ToolApprovalOption.DENY) : (approved ? HumanDecision_ToolApprovalOption.APPROVE : HumanDecision_ToolApprovalOption.DENY),
|
|
4715
4782
|
...(question && params.answer ? { values: params.answer.values } : {}),
|
|
@@ -4982,7 +5049,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
4982
5049
|
for (let attempt = 0;; attempt += 1) {
|
|
4983
5050
|
// A record still owed for a decision that ended EARLIER is written first: the withdrawal below overwrites the
|
|
4984
5051
|
// columns it is repaired from, and the deletion removes them.
|
|
4985
|
-
if (!(await this.repayOwedRecordBeforeDeletion(owner.resourceType, row)))
|
|
5052
|
+
if (!(await this.repayOwedRecordBeforeDeletion(owner.resourceType, row, params.transaction)))
|
|
4986
5053
|
return DeletedExecutionDecisionSettlement.RECORD_NOT_WRITTEN;
|
|
4987
5054
|
if (!holdsPendingDecision(row))
|
|
4988
5055
|
return DeletedExecutionDecisionSettlement.NOTHING_OWED;
|
|
@@ -4993,6 +5060,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
4993
5060
|
withdrawnByUserId: params.deletedBy.initiatorIds?.userId,
|
|
4994
5061
|
throughDelegatedClient: !!params.deletedBy.delegatingClientId,
|
|
4995
5062
|
requestContext: params.deletedBy,
|
|
5063
|
+
...(params.transaction ? { transaction: params.transaction } : {}),
|
|
4996
5064
|
});
|
|
4997
5065
|
if (withdrawal.ended) {
|
|
4998
5066
|
return withdrawal.recordWritten ? DeletedExecutionDecisionSettlement.SETTLED : DeletedExecutionDecisionSettlement.RECORD_NOT_WRITTEN;
|
|
@@ -5000,7 +5068,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
5000
5068
|
// Missed: the row moved under the write. Read what it holds now, under the same owner, and settle that.
|
|
5001
5069
|
const fresh = await this.systemAccess.readAsSystem(owner.resourceType, {
|
|
5002
5070
|
executionId: row.executionId, ...owner.ownerFields,
|
|
5003
|
-
}, { suppressSystemAudit: true });
|
|
5071
|
+
}, { suppressSystemAudit: true, ...(params.transaction ? { transaction: params.transaction } : {}) });
|
|
5004
5072
|
if (!fresh)
|
|
5005
5073
|
return DeletedExecutionDecisionSettlement.NOTHING_OWED;
|
|
5006
5074
|
row = fresh;
|
|
@@ -5205,13 +5273,14 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
5205
5273
|
* nothing is owed, or the record now exists, or the row cannot carry it (a marker without the resolution it names
|
|
5206
5274
|
* is a record already lost, which keeping the row would not recover — the repair logs it at ERROR).
|
|
5207
5275
|
*/
|
|
5208
|
-
async repayOwedRecordBeforeDeletion(resourceType, row) {
|
|
5276
|
+
async repayOwedRecordBeforeDeletion(resourceType, row, transaction) {
|
|
5209
5277
|
if (!row.pendingCorrectionRecordRef || !this.agentWorkDecisions)
|
|
5210
5278
|
return true;
|
|
5211
5279
|
const resolution = row;
|
|
5212
5280
|
if (!owedRecordIsRepairableFromRow(resourceType, resolution))
|
|
5213
5281
|
return true;
|
|
5214
|
-
|
|
5282
|
+
// Inside the deletion's transaction (#2297) a failure throws (it has aborted the transaction) and fails the deletion.
|
|
5283
|
+
return (await this.agentWorkDecisions.repairOwedRecordOfExecution(resourceType, resolution, undefined, transaction ? { transaction } : undefined)) !== undefined;
|
|
5215
5284
|
}
|
|
5216
5285
|
/**
|
|
5217
5286
|
* The part of a withdrawal that follows reading the row: end the pause WITHDRAWN and record it. Shared by the work
|
|
@@ -5222,7 +5291,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
5222
5291
|
* won the compare-and-swap; `recordWritten` says whether the agent-work record now exists.
|
|
5223
5292
|
*/
|
|
5224
5293
|
async withdrawHeldDecision(params) {
|
|
5225
|
-
const { owner, row } = params;
|
|
5294
|
+
const { owner, row, transaction } = params;
|
|
5226
5295
|
if (!holdsPendingDecision(row) || !row.pausedApproval || !row.pendingDecisionRef)
|
|
5227
5296
|
return { ended: false };
|
|
5228
5297
|
const toolName = this.pendingToolNameOf(row.pausedApproval);
|
|
@@ -5231,17 +5300,53 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
5231
5300
|
resourceType: owner.resourceType, executionId: row.executionId, rawPausedApproval: row.pausedApproval,
|
|
5232
5301
|
decisionRef: row.pendingDecisionRef, outcome: HumanDecision_Outcome.WITHDRAWN, decidedByUserId: params.withdrawnByUserId, toolName, scopeContext: owner.scopeContext, row, decidedAt: withdrawnAt,
|
|
5233
5302
|
...(params.throughDelegatedClient ? { announceExcept: null } : {}),
|
|
5303
|
+
...(transaction ? { deletion: { transaction } } : {}),
|
|
5234
5304
|
});
|
|
5235
5305
|
if (!endedOn)
|
|
5236
5306
|
return { ended: false };
|
|
5237
|
-
|
|
5307
|
+
if (transaction) {
|
|
5308
|
+
this.recordDecisionResolvedAfterCommit(transaction, owner.resourceType, endedOn, toolName, params.requestContext);
|
|
5309
|
+
}
|
|
5310
|
+
else {
|
|
5311
|
+
this.recordDecisionResolved({ row: endedOn, requester: humanDecisionRequesterOfRow(endedOn), outcome: HumanDecision_Outcome.WITHDRAWN, toolName, requestContext: params.requestContext });
|
|
5312
|
+
}
|
|
5238
5313
|
const recordWritten = await this.recordAgentWorkSettlement({
|
|
5239
5314
|
resourceType: owner.resourceType, row: endedOn, decisionRef: row.pendingDecisionRef, outcome: HumanDecision_Outcome.WITHDRAWN,
|
|
5240
5315
|
decidedAt: withdrawnAt, rawPausedApproval: row.pausedApproval, ...(toolName ? { toolName } : {}),
|
|
5241
5316
|
...(params.withdrawnByUserId ? { deciderUserId: params.withdrawnByUserId } : {}),
|
|
5317
|
+
...(transaction ? { transaction } : {}),
|
|
5242
5318
|
});
|
|
5243
5319
|
return { ended: true, recordWritten };
|
|
5244
5320
|
}
|
|
5321
|
+
/**
|
|
5322
|
+
* The RESOLVED row of a decision WITHDRAWN inside a transaction (#2297), recorded once it commits: capturable, so an
|
|
5323
|
+
* attempt the framework captures keeps it (and the chat cards' outcome note) with its commit, and the outbox relay
|
|
5324
|
+
* writes it once when this effect never runs. A transaction that rolls back recorded nothing. The holders'
|
|
5325
|
+
* announcement is the ending write's own (`endPendingDecision`), so this one tells nobody.
|
|
5326
|
+
*/
|
|
5327
|
+
recordDecisionResolvedAfterCommit(transaction, resourceType, endedOn, toolName, requestContext) {
|
|
5328
|
+
const record = (capture) => this.recordDecisionResolved({
|
|
5329
|
+
row: endedOn, requester: humanDecisionRequesterOfRow(endedOn), outcome: HumanDecision_Outcome.WITHDRAWN, toolName, requestContext, ...(capture ? { capture } : {}),
|
|
5330
|
+
});
|
|
5331
|
+
const noticeOutcome = this.decisionNoticeOutcomeOf(endedOn, HumanDecision_Outcome.WITHDRAWN);
|
|
5332
|
+
registerTransactionPostCommitEffect(transaction, capturablePostCommitEffect({
|
|
5333
|
+
key: ['human-decision-deletion-resolved', resourceType, String(endedOn.pendingDecisionRef)].join(':'),
|
|
5334
|
+
execute: async () => { void record(); },
|
|
5335
|
+
capture: decisionEndingCapture({
|
|
5336
|
+
effect: 'human-decision-deletion-resolved',
|
|
5337
|
+
auditLogs: () => this.auditLogs,
|
|
5338
|
+
record: (view) => record({ auditLogs: view }),
|
|
5339
|
+
tellAnnouncement: () => undefined,
|
|
5340
|
+
...(noticeOutcome && this.decisionNoticeStays
|
|
5341
|
+
? { noticeOutcome: { payload: noticeOutcome, record: (payload) => this.decisionNoticeStays.recordDecisionOutcome(payload) } }
|
|
5342
|
+
: {}),
|
|
5343
|
+
subjectId: endedOn.executionId,
|
|
5344
|
+
onFailure: (error) => this.logger.warn('[ConversationalExecution] A decision a deletion withdrew could not be recorded; the outbox relay writes it', {
|
|
5345
|
+
executionId: endedOn.executionId, decisionRef: endedOn.pendingDecisionRef, ...projectCaughtErrorLogFields(error),
|
|
5346
|
+
}),
|
|
5347
|
+
}),
|
|
5348
|
+
}));
|
|
5349
|
+
}
|
|
5245
5350
|
/**
|
|
5246
5351
|
* The one entry every REST verb reaches (#1594 D6): ANSWER goes to `answerPendingDecision`, every move to
|
|
5247
5352
|
* `movePendingDecision`. The act string comes from a URL, so an unknown one is refused like any refusal.
|
|
@@ -6207,6 +6312,7 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
6207
6312
|
}
|
|
6208
6313
|
const cards = [];
|
|
6209
6314
|
const deliverablesByDecision = new Map();
|
|
6315
|
+
const subjectRecordsByDecision = new Map();
|
|
6210
6316
|
for (const [executionId, resourceType] of candidates) {
|
|
6211
6317
|
const row = await this.systemAccess.readAsSystem(resourceType, { executionId }, { suppressSystemAudit: true }).catch(() => null);
|
|
6212
6318
|
const described = row ? this.decisionCardOfRow(row, new Date()) : undefined;
|
|
@@ -6239,12 +6345,14 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
6239
6345
|
continue;
|
|
6240
6346
|
cards.push({ ...card, permittedActs });
|
|
6241
6347
|
// #2904: the call's file deliverable, bound by its hash as the act that answers it binds it.
|
|
6242
|
-
const resolved = await this.
|
|
6348
|
+
const resolved = await this.decisionPresentationBindingsOf(card.systemRef, {
|
|
6243
6349
|
decisionRef: card.decisionRef, toolName: card.toolName, toolArgs: card.toolArgs,
|
|
6244
6350
|
...(route.organizationId ? { organizationId: route.organizationId } : {}),
|
|
6245
6351
|
});
|
|
6246
6352
|
if (resolved.deliverables)
|
|
6247
6353
|
deliverablesByDecision.set(card.decisionRef, resolved.deliverables);
|
|
6354
|
+
if (resolved.subjectRecord)
|
|
6355
|
+
subjectRecordsByDecision.set(card.decisionRef, resolved.subjectRecord);
|
|
6248
6356
|
}
|
|
6249
6357
|
// Decisions held by another plane's host (#1612, #2539), re-checked by that host with the same predicate.
|
|
6250
6358
|
for (const host of this.humanDecisionHosts ?? [])
|
|
@@ -6254,7 +6362,9 @@ let ConversationalExecutionBackendService = class ConversationalExecutionBackend
|
|
|
6254
6362
|
const presentationKey = decisionPresentationKeyOfRuntime(this.appConfig);
|
|
6255
6363
|
// Soonest deadline first: that is the one a person must not miss.
|
|
6256
6364
|
return cards
|
|
6257
|
-
.map((card) =>
|
|
6365
|
+
.map((card) => card.plane === HumanDecision_Plane.CONVERSATIONAL
|
|
6366
|
+
? withDecisionPresentation(card, presentationKey, deliverablesByDecision.get(card.decisionRef), subjectRecordsByDecision.get(card.decisionRef))
|
|
6367
|
+
: withDecisionPresentation(card, presentationKey))
|
|
6258
6368
|
.sort((a, b) => (a.expiresAt ?? '\uffff').localeCompare(b.expiresAt ?? '\uffff'));
|
|
6259
6369
|
}
|
|
6260
6370
|
/**
|