@wildo-ai/saas-specifications 1.1.14 → 1.1.15
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/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
- package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.js +21 -0
- package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +1 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +1 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +5 -3
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +22 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +3 -1
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -2
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElectronicSignature_Level } from '@wildo-ai/external-connectors-models';
|
|
2
|
-
import { CoreResourceOperation as Op, SignatureRequest_State } from '@wildo-ai/saas-models';
|
|
2
|
+
import { CoreResourceOperation as Op, SignatureRequest_State, SignatureRequestSigners_Operations } from '@wildo-ai/saas-models';
|
|
3
3
|
/**
|
|
4
4
|
* Framework-owned specification for `signatureRequests` (#2293): a deliverable sent to a trust-service vendor for its
|
|
5
5
|
* approver's own electronic signature. No frontend configuration and no route: the engine writes rows through the
|
|
@@ -29,7 +29,7 @@ export declare const signatureRequestsResourceSpecification: import("../../../_c
|
|
|
29
29
|
/**
|
|
30
30
|
* Framework-owned specification for `signatureRequestSigners` (#2293): each person asked to sign a request.
|
|
31
31
|
*/
|
|
32
|
-
export declare const signatureRequestSignersResourceSpecification: import("../../../_core").ResourceSpecificationConfig<
|
|
32
|
+
export declare const signatureRequestSignersResourceSpecification: import("../../../_core").ResourceSpecificationConfig<typeof SignatureRequestSigners_Operations, Op.READ | Op.UPDATE_MANY | Op.DELETE | Op.CREATE | Op.LIST, import("zod").ZodObject<{
|
|
33
33
|
_id: import("zod").ZodString;
|
|
34
34
|
applicationId: import("zod").ZodString;
|
|
35
35
|
organizationId: import("zod").ZodOptional<import("zod").ZodString>;
|
package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-requests.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/signature-requests.resource.specification.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"signature-requests.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/signature-requests.resource.specification.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,EAAE,EAI3B,sBAAsB,EACtB,kCAAkC,EAGnC,MAAM,uBAAuB,CAAC;AAyB/B;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;iCA+HlD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;iCA4FxD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
2
2
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
|
|
3
3
|
import { ElectronicSignature_Level } from '@wildo-ai/external-connectors-models';
|
|
4
|
-
import { CoreResourceOperation as Op, ResourcePrimaryScope, SignatureRequestSchema, SignatureRequestSignerSchema, SignatureRequest_State, signatureRequestSignersResourceConfiguration_InitializationFactory, signatureRequestsResourceConfiguration_InitializationFactory, } from '@wildo-ai/saas-models';
|
|
4
|
+
import { CoreResourceOperation as Op, ResourcePrimaryScope, SignatureRequestSchema, SignatureRequestSignerSchema, SignatureRequest_State, SignatureRequestSigners_Operations, signatureRequestSignersResourceConfiguration_InitializationFactory, signatureRequestsResourceConfiguration_InitializationFactory, } from '@wildo-ai/saas-models';
|
|
5
5
|
import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
|
|
6
6
|
import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
|
|
7
7
|
const enumDeclaration = (exportName) => ({
|
|
@@ -163,9 +163,10 @@ export const signatureRequestSignersResourceSpecification = resourceSpecificatio
|
|
|
163
163
|
mainSchema: schemaDeclaration('SignatureRequestSignerSchema'),
|
|
164
164
|
resourceFactory: factoryDeclaration('signatureRequestSignersResourceConfiguration_InitializationFactory'),
|
|
165
165
|
resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'SIGNATURE_REQUEST_SIGNERS' },
|
|
166
|
-
operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },
|
|
166
|
+
operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('SignatureRequestSigners_Operations') },
|
|
167
167
|
notes: [
|
|
168
168
|
'A row of its own rather than an array on the request: a signer is a data subject, found through a scalar foreign key.',
|
|
169
|
+
'The one route is the signer\'s own `openSigningSession` (embedded signing): it answers the vendor\'s signing page, reads the rows to find it and writes none. A vendor that answers no page is a 502.',
|
|
169
170
|
'Evidence of the same record as its request, because the evidence teardown deletes evidence rows directly.',
|
|
170
171
|
],
|
|
171
172
|
},
|
|
@@ -215,9 +216,28 @@ export const signatureRequestSignersResourceSpecification = resourceSpecificatio
|
|
|
215
216
|
outcome: 'The row is gone.',
|
|
216
217
|
responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signer was removed.' }],
|
|
217
218
|
},
|
|
219
|
+
[SignatureRequestSigners_Operations.OPEN_SIGNING_SESSION]: {
|
|
220
|
+
operationId: SignatureRequestSigners_Operations.OPEN_SIGNING_SESSION,
|
|
221
|
+
purpose: 'Open the signature vendor\'s signing page for the signed-in person, to sign a record\'s deliverable in a frame of the application (embedded signing).',
|
|
222
|
+
outcome: 'The person signs at the vendor without leaving the application. The request becomes SIGNED only once the engine has validated the signed document, at its next re-read.',
|
|
223
|
+
whenToUse: 'From the page where the person meets the record, through the `EmbeddedSigningFrame` component, when the request\'s provider declares embedded signing. The page URL is valid for minutes and is never stored, so ask for it when the person is there.',
|
|
224
|
+
importance: FieldSemanticImportance.PRIMARY,
|
|
225
|
+
responseStatuses: [
|
|
226
|
+
{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The vendor\'s signing page for the caller: its URL and, when the vendor says, its expiry.' },
|
|
227
|
+
],
|
|
228
|
+
errorScenarios: [
|
|
229
|
+
{ code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The return URL is not an absolute URL on one of the application\'s own frontends.' },
|
|
230
|
+
{ code: HttpResponseStatusCode.UNAUTHORIZED_401, when: 'Nobody is signed in.' },
|
|
231
|
+
{ code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a person on their own request (a machine credential, a one-off token): the page would apply the person\'s signature.' },
|
|
232
|
+
{ code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No open request on that record names the caller as a signer, or the vendor reports they have already signed: nothing left for them to sign there.' },
|
|
233
|
+
{ code: HttpResponseStatusCode.CONFLICT_409, when: 'The request\'s provider lets signers sign from its e-mail only.' },
|
|
234
|
+
],
|
|
235
|
+
idempotent: false,
|
|
236
|
+
},
|
|
218
237
|
},
|
|
219
238
|
businessConstraints: [
|
|
220
239
|
'A signer row names one person and one request.',
|
|
240
|
+
'A signing page is opened only for a signer an open request names, keyed on the caller\'s own user id.',
|
|
221
241
|
'A signer row\'s request and subject are never re-pointed.',
|
|
222
242
|
],
|
|
223
243
|
}), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
|
package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-requests.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/signature-requests.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,kEAAkE,EAClE,4DAA4D,GAC7D,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,uBAAuB;IACpC,U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udience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport { ElectronicSignature_Level } from '@wildo-ai/external-connectors-models';\nimport {\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n SignatureRequestSchema,\n SignatureRequestSignerSchema,\n SignatureRequest_State,\n signatureRequestSignersResourceConfiguration_InitializationFactory,\n signatureRequestsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst factoryDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n});\n\nconst schemaDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n});\n\n/**\n * Framework-owned specification for `signatureRequests` (#2293): a deliverable sent to a trust-service vendor for its\n * approver's own electronic signature. No frontend configuration and no route: the engine writes rows through the\n * repository. The runtime reasoning lives in the schema file's header and is not restated here.\n */\nexport const signatureRequestsResourceSpecification = resourceSpecification(\n signatureRequestsResourceConfiguration_InitializationFactory,\n SignatureRequestSchema,\n ({ schemaShape }) => ({\n purpose: 'Record a deliverable sent to a trust-service vendor so the people who must sign it apply their own electronic signature, and hold where that request stands.',\n businessRole: 'What lets a deliverable carry its approver\\'s advanced electronic signature (eIDAS Art. 26), relied on by a third party who must not depend on the operator. It names the deliverable\\'s record, the frozen original sent, the approval seal that released it, the level required and the vendor it went through.',\n lifecycleRole: 'Created by the engine once the deliverable\\'s approval is sealed, in SENT. Moved by its one transition function: PARTIALLY_SIGNED when the vendor reports a signer, SIGNED only when the signed document validated and proves every signer at the required level, DECLINED, EXPIRED or CANCELLED as reported, FAILED when the evidence proves another signer or level. A final state absorbs every later event. It goes with the deliverable\\'s record, and that record\\'s legal holds keep it.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.COMPLIANCE,\n codeHandling: {\n mainSchema: schemaDeclaration('SignatureRequestSchema'),\n resourceFactory: factoryDeclaration('signatureRequestsResourceConfiguration_InitializationFactory'),\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'SIGNATURE_REQUESTS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'CREATE, UPDATE and DELETE are REPOSITORY_ONLY: the engine creates a request after the approval is sealed, moves it through `advanceSignatureRequestState`, and only the teardown of its record removes it.',\n 'READ and LIST are INTERNAL_CALL: route-less, service-resolvable.',\n 'Evidence of its subject (#2940): `linkedResourceType`, `linkedResourceId` and the attested `originalFileId` are immutable for every writer.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of this signature request.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the request belongs to.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.stringSpec({ meaning: 'The organization the deliverable belongs to, when it belongs to one.', semanticRole: 'identifier' }),\n linkedResourceType: schemaShape.linkedResourceType.stringSpec({ meaning: 'The resource type of the record the deliverable belongs to.', semanticRole: 'code' }),\n linkedResourceId: schemaShape.linkedResourceId.stringSpec({\n meaning: 'The id of the record the deliverable belongs to.',\n whyItMatters: 'The request goes when that record goes, and that record\\'s legal holds keep it.',\n semanticRole: 'identifier',\n }),\n originalFileId: schemaShape.originalFileId.stringSpec({\n meaning: 'The frozen original sent for signature: the request\\'s attested file, kept unchanged while the request exists.',\n semanticRole: 'identifier',\n }),\n originalContentSha256: schemaShape.originalContentSha256.stringSpec({\n meaning: 'The SHA-256 the original recorded of its bytes when it was sent.',\n whyItMatters: 'The signed document\\'s signed revision must be exactly these bytes, or the evidence does not validate.',\n semanticRole: 'code',\n }),\n approvalSealId: schemaShape.approvalSealId.stringSpec({\n meaning: 'The approval seal of the decision that released the deliverable.',\n whyItMatters: 'A request is created only once that seal exists, so the trail links the agent, the reviewer and the signers.',\n semanticRole: 'identifier',\n }),\n requiredLevel: schemaShape.requiredLevel.enumSpec({\n meaning: 'The level of electronic signature the deliverable requires.',\n enumDeclaration: { ...enumDeclaration('ElectronicSignature_Level'), packageName: '@wildo-ai/external-connectors-models' },\n values: {\n [ElectronicSignature_Level.SIMPLE]: { meaning: 'A simple electronic signature.' },\n [ElectronicSignature_Level.ADVANCED]: { meaning: 'An advanced electronic signature, applied by a trust-service vendor.' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n providerRef: schemaShape.providerRef.stringSpec({ meaning: 'The provider the request was sent through, pinned for its life.', semanticRole: 'code' }),\n vendorReferences: schemaShape.vendorReferences.arraySpec({\n meaning: 'The vendor\\'s own references for this request; several when the vendor splits a request per document.',\n elementMeaning: 'One vendor reference.',\n }),\n primaryVendorReference: schemaShape.primaryVendorReference.stringSpec({\n meaning: 'The first vendor reference: the one a vendor\\'s notification names the request by.',\n whyItMatters: 'A notification only causes a re-read of the request it names; this is how it is found.',\n semanticRole: 'identifier',\n }),\n state: schemaShape.state.enumSpec({\n meaning: 'Where the request stands.',\n enumDeclaration: enumDeclaration('SignatureRequest_State'),\n values: {\n [SignatureRequest_State.SENT]: { meaning: 'Sent; nobody has signed yet, as far as the vendor reports.' },\n [SignatureRequest_State.PARTIALLY_SIGNED]: { meaning: 'The vendor reports that some signers signed. A claim of the vendor\\'s, never evidence.' },\n [SignatureRequest_State.SIGNED]: { meaning: 'The signed document validated and proves every signer at the required level. Final.' },\n [SignatureRequest_State.DECLINED]: { meaning: 'A signer refused. Final.' },\n [SignatureRequest_State.EXPIRED]: { meaning: 'The vendor\\'s deadline passed. Final.' },\n [SignatureRequest_State.CANCELLED]: { meaning: 'Withdrawn before it was signed. Final.' },\n [SignatureRequest_State.FAILED]: { meaning: 'The evidence proves another signer or a lower level than required. Final.' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n stateChangedAt: schemaShape.stateChangedAt.dateSpec({ meaning: 'When the request last moved.' }),\n signedDocument: schemaShape.signedDocument.fileSpec({\n meaning: 'The signed document the vendor returned, kept once it validated; derived from the original as a vendor-signed copy.',\n whyItMatters: 'It is the evidence of the signature: it carries the signers\\' certificates and goes only with the deliverable\\'s record.',\n }),\n validationEvidence: schemaShape.validationEvidence.fileSpec({\n meaning: 'What the validation checked, as JSON: the signatures, each chain, the check date and every CRL and OCSP response used.',\n whyItMatters: 'It says the document was validated at a given time with given revocation data, for as long as the request lives.',\n }),\n validatedAt: schemaShape.validatedAt.dateSpec({ meaning: 'When the signed document validated: the moment the evidence speaks for.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the request was created.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the row was last written.' }),\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Record a deliverable sent for signature, once its approval is sealed.',\n outcome: 'The request exists in SENT and attests the frozen original.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The request was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one request.',\n outcome: 'The engine has the request and its state.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List requests: the open ones to re-read, those of a record.',\n outcome: 'The engine finds what it must re-read or tear down.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The requests were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a request to the state its transition function gives.',\n outcome: 'An open request moves; a final one is never written again.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Remove a request with the record it attests.',\n outcome: 'The request and its signers are gone, and the destruction is recorded.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request was removed.' }],\n },\n },\n businessConstraints: [\n 'A request is created only once the deliverable\\'s approval is sealed.',\n 'A request becomes SIGNED only on a signed document validated at receipt, never on the vendor\\'s status.',\n 'A final state is never left, and a later event is ignored and recorded.',\n 'A request\\'s subject and original file are never re-pointed.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\n/**\n * Framework-owned specification for `signatureRequestSigners` (#2293): each person asked to sign a request.\n */\nexport const signatureRequestSignersResourceSpecification = resourceSpecification(\n signatureRequestSignersResourceConfiguration_InitializationFactory,\n SignatureRequestSignerSchema,\n ({ schemaShape }) => ({\n purpose: 'Name each person asked to sign a deliverable sent for signature, in the order the vendor asks them.',\n businessRole: 'The link between a signature request and the people it asks: what the validated evidence must prove signed, and what a signer\\'s export and erasure find.',\n lifecycleRole: 'Created with its request. Removed with its request, or with the record the request attests. A signer\\'s erasure keeps the row and removes the vendor\\'s reference to them.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.COMPLIANCE,\n codeHandling: {\n mainSchema: schemaDeclaration('SignatureRequestSignerSchema'),\n resourceFactory: factoryDeclaration('signatureRequestSignersResourceConfiguration_InitializationFactory'),\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'SIGNATURE_REQUEST_SIGNERS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'A row of its own rather than an array on the request: a signer is a data subject, found through a scalar foreign key.',\n 'Evidence of the same record as its request, because the evidence teardown deletes evidence rows directly.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of this signer row.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the row belongs to.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.stringSpec({ meaning: 'The organization the deliverable belongs to, when it belongs to one.', semanticRole: 'identifier' }),\n signatureRequestId: schemaShape.signatureRequestId.stringSpec({ meaning: 'The request this signer belongs to.', semanticRole: 'identifier' }),\n linkedResourceType: schemaShape.linkedResourceType.stringSpec({ meaning: 'The resource type of the record the request attests.', semanticRole: 'code' }),\n linkedResourceId: schemaShape.linkedResourceId.stringSpec({ meaning: 'The id of the record the request attests.', semanticRole: 'identifier' }),\n signerUserId: schemaShape.signerUserId.stringSpec({\n meaning: 'The person asked to sign.',\n whyItMatters: 'The validated evidence must prove this person signed; it is also the row\\'s link to them for their export and their erasure.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n signingOrder: schemaShape.signingOrder.numberSpec({ meaning: 'The order in which the vendor asks the signers, from 0. Equal orders sign in parallel.' }),\n vendorSignerReference: schemaShape.vendorSignerReference.stringSpec({ meaning: 'The vendor\\'s reference to this signer. Removed on the signer\\'s erasure.', semanticRole: 'identifier' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was created.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the row was last written.' }),\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Name a signer of a request, with the request.',\n outcome: 'The person is asked to sign.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The signer was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one signer row.',\n outcome: 'The engine has the signer.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signer was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List the signers of a request, or the rows naming a person.',\n outcome: 'The engine, an export or an erasure finds what it needs.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signers were returned.' }],\n },\n [Op.UPDATE_MANY]: {\n purpose: 'Remove the vendor\\'s reference to an erased signer.',\n outcome: 'The row stays as the record that a signature was asked for.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The reference was removed.' }],\n },\n [Op.DELETE]: {\n purpose: 'Remove a signer with its request.',\n outcome: 'The row is gone.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signer was removed.' }],\n },\n },\n businessConstraints: [\n 'A signer row names one person and one request.',\n 'A signer row\\'s request and subject are never re-pointed.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"signature-requests.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/compliance/resources/signature-requests.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,kCAAkC,EAClC,kEAAkE,EAClE,4DAA4D,GAC7D,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAClD,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,OAAO;IAClC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K;YAClL,SAAS,EAAE,uPAAuP;YAClQ,UAAU,EAAE,uBAAuB,CAAC,OAAO;YAC3C,gBAAgB,EAAE;gBAChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,2FAA2F,EAAE;aACnJ;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,eAAe,EAAE,IAAI,EAAE,mFAAmF,EAAE;gBAC3I,EAAE,IAAI,EAAE,sBAAsB,CAAC,gBAAgB,EAAE,IAAI,EAAE,sBAAsB,EAAE;gBAC/E,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,wIAAwI,EAAE;gBAC9L,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mJAAmJ,EAAE;gBACzM,EAAE,IAAI,EAAE,sBAAsB,CAAC,YAAY,EAAE,IAAI,EAAE,iEAAiE,EAAE;aACvH;YACD,UAAU,EAAE,KAAK;SAClB;KACF;IACD,mBAAmB,EAAE;QACnB,gDAAgD;QAChD,uGAAuG;QACvG,2DAA2D;KAC5D;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport { ElectronicSignature_Level } from '@wildo-ai/external-connectors-models';\nimport {\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n SignatureRequestSchema,\n SignatureRequestSignerSchema,\n SignatureRequest_State,\n SignatureRequestSigners_Operations,\n signatureRequestSignersResourceConfiguration_InitializationFactory,\n signatureRequestsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst factoryDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n});\n\nconst schemaDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n});\n\n/**\n * Framework-owned specification for `signatureRequests` (#2293): a deliverable sent to a trust-service vendor for its\n * approver's own electronic signature. No frontend configuration and no route: the engine writes rows through the\n * repository. The runtime reasoning lives in the schema file's header and is not restated here.\n */\nexport const signatureRequestsResourceSpecification = resourceSpecification(\n signatureRequestsResourceConfiguration_InitializationFactory,\n SignatureRequestSchema,\n ({ schemaShape }) => ({\n purpose: 'Record a deliverable sent to a trust-service vendor so the people who must sign it apply their own electronic signature, and hold where that request stands.',\n businessRole: 'What lets a deliverable carry its approver\\'s advanced electronic signature (eIDAS Art. 26), relied on by a third party who must not depend on the operator. It names the deliverable\\'s record, the frozen original sent, the approval seal that released it, the level required and the vendor it went through.',\n lifecycleRole: 'Created by the engine once the deliverable\\'s approval is sealed, in SENT. Moved by its one transition function: PARTIALLY_SIGNED when the vendor reports a signer, SIGNED only when the signed document validated and proves every signer at the required level, DECLINED, EXPIRED or CANCELLED as reported, FAILED when the evidence proves another signer or level. A final state absorbs every later event. It goes with the deliverable\\'s record, and that record\\'s legal holds keep it.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.COMPLIANCE,\n codeHandling: {\n mainSchema: schemaDeclaration('SignatureRequestSchema'),\n resourceFactory: factoryDeclaration('signatureRequestsResourceConfiguration_InitializationFactory'),\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'SIGNATURE_REQUESTS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'CREATE, UPDATE and DELETE are REPOSITORY_ONLY: the engine creates a request after the approval is sealed, moves it through `advanceSignatureRequestState`, and only the teardown of its record removes it.',\n 'READ and LIST are INTERNAL_CALL: route-less, service-resolvable.',\n 'Evidence of its subject (#2940): `linkedResourceType`, `linkedResourceId` and the attested `originalFileId` are immutable for every writer.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of this signature request.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the request belongs to.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.stringSpec({ meaning: 'The organization the deliverable belongs to, when it belongs to one.', semanticRole: 'identifier' }),\n linkedResourceType: schemaShape.linkedResourceType.stringSpec({ meaning: 'The resource type of the record the deliverable belongs to.', semanticRole: 'code' }),\n linkedResourceId: schemaShape.linkedResourceId.stringSpec({\n meaning: 'The id of the record the deliverable belongs to.',\n whyItMatters: 'The request goes when that record goes, and that record\\'s legal holds keep it.',\n semanticRole: 'identifier',\n }),\n originalFileId: schemaShape.originalFileId.stringSpec({\n meaning: 'The frozen original sent for signature: the request\\'s attested file, kept unchanged while the request exists.',\n semanticRole: 'identifier',\n }),\n originalContentSha256: schemaShape.originalContentSha256.stringSpec({\n meaning: 'The SHA-256 the original recorded of its bytes when it was sent.',\n whyItMatters: 'The signed document\\'s signed revision must be exactly these bytes, or the evidence does not validate.',\n semanticRole: 'code',\n }),\n approvalSealId: schemaShape.approvalSealId.stringSpec({\n meaning: 'The approval seal of the decision that released the deliverable.',\n whyItMatters: 'A request is created only once that seal exists, so the trail links the agent, the reviewer and the signers.',\n semanticRole: 'identifier',\n }),\n requiredLevel: schemaShape.requiredLevel.enumSpec({\n meaning: 'The level of electronic signature the deliverable requires.',\n enumDeclaration: { ...enumDeclaration('ElectronicSignature_Level'), packageName: '@wildo-ai/external-connectors-models' },\n values: {\n [ElectronicSignature_Level.SIMPLE]: { meaning: 'A simple electronic signature.' },\n [ElectronicSignature_Level.ADVANCED]: { meaning: 'An advanced electronic signature, applied by a trust-service vendor.' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n providerRef: schemaShape.providerRef.stringSpec({ meaning: 'The provider the request was sent through, pinned for its life.', semanticRole: 'code' }),\n vendorReferences: schemaShape.vendorReferences.arraySpec({\n meaning: 'The vendor\\'s own references for this request; several when the vendor splits a request per document.',\n elementMeaning: 'One vendor reference.',\n }),\n primaryVendorReference: schemaShape.primaryVendorReference.stringSpec({\n meaning: 'The first vendor reference: the one a vendor\\'s notification names the request by.',\n whyItMatters: 'A notification only causes a re-read of the request it names; this is how it is found.',\n semanticRole: 'identifier',\n }),\n state: schemaShape.state.enumSpec({\n meaning: 'Where the request stands.',\n enumDeclaration: enumDeclaration('SignatureRequest_State'),\n values: {\n [SignatureRequest_State.SENT]: { meaning: 'Sent; nobody has signed yet, as far as the vendor reports.' },\n [SignatureRequest_State.PARTIALLY_SIGNED]: { meaning: 'The vendor reports that some signers signed. A claim of the vendor\\'s, never evidence.' },\n [SignatureRequest_State.SIGNED]: { meaning: 'The signed document validated and proves every signer at the required level. Final.' },\n [SignatureRequest_State.DECLINED]: { meaning: 'A signer refused. Final.' },\n [SignatureRequest_State.EXPIRED]: { meaning: 'The vendor\\'s deadline passed. Final.' },\n [SignatureRequest_State.CANCELLED]: { meaning: 'Withdrawn before it was signed. Final.' },\n [SignatureRequest_State.FAILED]: { meaning: 'The evidence proves another signer or a lower level than required. Final.' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n stateChangedAt: schemaShape.stateChangedAt.dateSpec({ meaning: 'When the request last moved.' }),\n signedDocument: schemaShape.signedDocument.fileSpec({\n meaning: 'The signed document the vendor returned, kept once it validated; derived from the original as a vendor-signed copy.',\n whyItMatters: 'It is the evidence of the signature: it carries the signers\\' certificates and goes only with the deliverable\\'s record.',\n }),\n validationEvidence: schemaShape.validationEvidence.fileSpec({\n meaning: 'What the validation checked, as JSON: the signatures, each chain, the check date and every CRL and OCSP response used.',\n whyItMatters: 'It says the document was validated at a given time with given revocation data, for as long as the request lives.',\n }),\n validatedAt: schemaShape.validatedAt.dateSpec({ meaning: 'When the signed document validated: the moment the evidence speaks for.' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the request was created.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the row was last written.' }),\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Record a deliverable sent for signature, once its approval is sealed.',\n outcome: 'The request exists in SENT and attests the frozen original.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The request was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one request.',\n outcome: 'The engine has the request and its state.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List requests: the open ones to re-read, those of a record.',\n outcome: 'The engine finds what it must re-read or tear down.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The requests were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a request to the state its transition function gives.',\n outcome: 'An open request moves; a final one is never written again.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Remove a request with the record it attests.',\n outcome: 'The request and its signers are gone, and the destruction is recorded.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The request was removed.' }],\n },\n },\n businessConstraints: [\n 'A request is created only once the deliverable\\'s approval is sealed.',\n 'A request becomes SIGNED only on a signed document validated at receipt, never on the vendor\\'s status.',\n 'A final state is never left, and a later event is ignored and recorded.',\n 'A request\\'s subject and original file are never re-pointed.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n\n/**\n * Framework-owned specification for `signatureRequestSigners` (#2293): each person asked to sign a request.\n */\nexport const signatureRequestSignersResourceSpecification = resourceSpecification(\n signatureRequestSignersResourceConfiguration_InitializationFactory,\n SignatureRequestSignerSchema,\n ({ schemaShape }) => ({\n purpose: 'Name each person asked to sign a deliverable sent for signature, in the order the vendor asks them.',\n businessRole: 'The link between a signature request and the people it asks: what the validated evidence must prove signed, and what a signer\\'s export and erasure find.',\n lifecycleRole: 'Created with its request. Removed with its request, or with the record the request attests. A signer\\'s erasure keeps the row and removes the vendor\\'s reference to them.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.COMPLIANCE,\n codeHandling: {\n mainSchema: schemaDeclaration('SignatureRequestSignerSchema'),\n resourceFactory: factoryDeclaration('signatureRequestSignersResourceConfiguration_InitializationFactory'),\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'SIGNATURE_REQUEST_SIGNERS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation'), customEnum: enumDeclaration('SignatureRequestSigners_Operations') },\n notes: [\n 'A row of its own rather than an array on the request: a signer is a data subject, found through a scalar foreign key.',\n 'The one route is the signer\\'s own `openSigningSession` (embedded signing): it answers the vendor\\'s signing page, reads the rows to find it and writes none. A vendor that answers no page is a 502.',\n 'Evidence of the same record as its request, because the evidence teardown deletes evidence rows directly.',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of this signer row.', semanticRole: 'identifier' }),\n applicationId: schemaShape.applicationId.stringSpec({ meaning: 'The application record the row belongs to.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.stringSpec({ meaning: 'The organization the deliverable belongs to, when it belongs to one.', semanticRole: 'identifier' }),\n signatureRequestId: schemaShape.signatureRequestId.stringSpec({ meaning: 'The request this signer belongs to.', semanticRole: 'identifier' }),\n linkedResourceType: schemaShape.linkedResourceType.stringSpec({ meaning: 'The resource type of the record the request attests.', semanticRole: 'code' }),\n linkedResourceId: schemaShape.linkedResourceId.stringSpec({ meaning: 'The id of the record the request attests.', semanticRole: 'identifier' }),\n signerUserId: schemaShape.signerUserId.stringSpec({\n meaning: 'The person asked to sign.',\n whyItMatters: 'The validated evidence must prove this person signed; it is also the row\\'s link to them for their export and their erasure.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n signingOrder: schemaShape.signingOrder.numberSpec({ meaning: 'The order in which the vendor asks the signers, from 0. Equal orders sign in parallel.' }),\n vendorSignerReference: schemaShape.vendorSignerReference.stringSpec({ meaning: 'The vendor\\'s reference to this signer. Removed on the signer\\'s erasure.', semanticRole: 'identifier' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the row was created.' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the row was last written.' }),\n },\n operations: {\n [Op.CREATE]: {\n purpose: 'Name a signer of a request, with the request.',\n outcome: 'The person is asked to sign.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The signer was recorded.' }],\n },\n [Op.READ]: {\n purpose: 'Read one signer row.',\n outcome: 'The engine has the signer.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signer was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List the signers of a request, or the rows naming a person.',\n outcome: 'The engine, an export or an erasure finds what it needs.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signers were returned.' }],\n },\n [Op.UPDATE_MANY]: {\n purpose: 'Remove the vendor\\'s reference to an erased signer.',\n outcome: 'The row stays as the record that a signature was asked for.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The reference was removed.' }],\n },\n [Op.DELETE]: {\n purpose: 'Remove a signer with its request.',\n outcome: 'The row is gone.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The signer was removed.' }],\n },\n [SignatureRequestSigners_Operations.OPEN_SIGNING_SESSION]: {\n operationId: SignatureRequestSigners_Operations.OPEN_SIGNING_SESSION,\n purpose: 'Open the signature vendor\\'s signing page for the signed-in person, to sign a record\\'s deliverable in a frame of the application (embedded signing).',\n outcome: 'The person signs at the vendor without leaving the application. The request becomes SIGNED only once the engine has validated the signed document, at its next re-read.',\n whenToUse: 'From the page where the person meets the record, through the `EmbeddedSigningFrame` component, when the request\\'s provider declares embedded signing. The page URL is valid for minutes and is never stored, so ask for it when the person is there.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The vendor\\'s signing page for the caller: its URL and, when the vendor says, its expiry.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The return URL is not an absolute URL on one of the application\\'s own frontends.' },\n { code: HttpResponseStatusCode.UNAUTHORIZED_401, when: 'Nobody is signed in.' },\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a person on their own request (a machine credential, a one-off token): the page would apply the person\\'s signature.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No open request on that record names the caller as a signer, or the vendor reports they have already signed: nothing left for them to sign there.' },\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The request\\'s provider lets signers sign from its e-mail only.' },\n ],\n idempotent: false,\n },\n },\n businessConstraints: [\n 'A signer row names one person and one request.',\n 'A signing page is opened only for a signer an open request names, keyed on the caller\\'s own user id.',\n 'A signer row\\'s request and subject are never re-pointed.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
|
|
@@ -79,7 +79,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
79
79
|
return resourceSpecification(flowActorTasksPolymorphicFactories[resourceType], FlowActorTaskBaseSchema, ({ schemaShape }) => ({
|
|
80
80
|
purpose: 'Track one addressable unit of agent work, including its lifecycle status, outputs, artifacts, and terminal outcome.',
|
|
81
81
|
businessRole: 'The work record an authorized integration polls, collects results from, or cancels independently of the conversation that started it.',
|
|
82
|
-
lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `
|
|
82
|
+
lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `auth-required`. Advances through working, and closes on completion, failure, or cancellation. Kept for the application\'s declared RESOURCE_DATA period counted from its last update (`retentionBinding`, LAST_UPDATED), then deleted by the retention-class sweep (#2841).',
|
|
83
83
|
audience: LabelAudience.DEVELOPER,
|
|
84
84
|
subDomain: EngineResourceSubDomain.FLOWS_ACTORS,
|
|
85
85
|
codeHandling: {
|
|
@@ -126,7 +126,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
126
126
|
}),
|
|
127
127
|
status: schemaShape.status.enumSpec({
|
|
128
128
|
meaning: 'Current lifecycle state of the work.',
|
|
129
|
-
whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` →
|
|
129
|
+
whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` → auth-required, `completed` → completed, `failed` and `aborted` → failed, `cancelled` → canceled. A task whose worker stopped is reported as failed once the worker’s hold on the task has expired, so an abandoned task never reads as still working. A task waiting on a person’s decision is exempt: waiting is its correct state, however long it lasts.',
|
|
130
130
|
enumDeclaration: {
|
|
131
131
|
packageName: '@wildo-ai/saas-models',
|
|
132
132
|
exportName: 'FlowsActors_Status',
|
|
@@ -137,7 +137,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
137
137
|
[FlowsActors_Status.READY]: { meaning: 'Materialised and acknowledged, not yet processing — A2A `submitted`.' },
|
|
138
138
|
[FlowsActors_Status.PENDING]: { meaning: 'Accepted but not yet actively processing — also projects to A2A `submitted`.' },
|
|
139
139
|
[FlowsActors_Status.PROCESSING]: { meaning: 'Actively running — the agent is working the task. A2A `working`.' },
|
|
140
|
-
[FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `
|
|
140
|
+
[FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `auth-required` — non-terminal: the person decides in the application, never through a message on the task. Written when a turn pauses for a decision, together with the decision it paused on (`pausedOnDecisionRef`). The stored value stays while the decision is answered elsewhere; what a reader is told is derived from that decision, so a released task reads as working, finished, or unknown.' },
|
|
141
141
|
[FlowsActors_Status.COMPLETED]: { meaning: 'Work finished successfully; outputs and artifacts are final. A2A `completed` (terminal).' },
|
|
142
142
|
[FlowsActors_Status.FAILED]: { meaning: 'Work ended in error. A2A `failed` (terminal). Also the state an abandoned task resolves to when its liveness lease has expired.' },
|
|
143
143
|
[FlowsActors_Status.CANCELLED]: { meaning: 'Cancelled before completion, via `tasks/cancel`. A2A `canceled` (terminal) — the record survives so the client can read its final state.' },
|
package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-actor-tasks.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/flow-actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,kCAAkC,EAClC,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAmC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7H,OAAO,EAAE,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AAC,MAAM,uCAAuC,GAAG,uCAAuC,CAC5F,gBAAgB,CAAC,qBAAqB,EACtC,uBAAuB,CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,+CAA+C,GAAG,uCAAuC,CACpG,gBAAgB,CAAC,6BAA6B,EAC9C,+BAA+B,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAAG,uCAAuC,CACnG,gBAAgB,CAAC,4BAA4B,EAC7C,8BAA8B,CAC/B,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n FlowActorTaskBaseSchema,\n FlowsActors_Status,\n ResourcePrimaryScope,\n flowActorTasksPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { type CoreResourceTypeMemberName, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the `flowActorTasks` POLYMORPHIC family: the\n * persisted WORK record that backs the A2A `Task` object. One base record is\n * stamped out as three genuine single-scope variants, each owned by its injected\n * owner FK:\n * - `userFlowActorTasks` (USER_SELF — user-delegated A2A)\n * - `organizationFlowActorTasks` (ORGANIZATIONS — org-machine A2A)\n * - `applicationFlowActorTasks` (APPLICATION — app-machine A2A)\n *\n * ## This is a different plane from `flowActorExecutions`\n *\n * Executions own CONVERSATIONAL session history (the message log). Tasks own an\n * addressable, pollable, cancelable WORK lifecycle. The architecture keeps them\n * apart deliberately — an A2A treatment links both concrete records rather than\n * copying the conversation into the task. A task therefore carries only a SOFT\n * link (`flowActorExecutionId`), not a declared foreign key, so it can outlive the\n * conversation that produced it.\n *\n * ## Not every turn has one\n *\n * A task is materialised only when the turn cannot complete inline — the client\n * asked for it (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (#3381; a\n * blocking one then waits and answers with the task), or the turn reached an interrupted state\n * (approval pause → `input-required`). All three triggers are live: the pause is proven end to end by\n * `examples/wonder-todos/e2e/a2a-approval-pause.e2e.ts` (the task reaches `input-required` and\n * persists the decision it waits on) and its release by `a2a-approval-resume.e2e.ts` (the task\n * LEAVES `input-required` once its execution moves on). A blocking turn with no webhook that answers in one shot\n * returns a `Message` and writes no task row; the A2A spec permits both shapes.\n *\n * The default API READ/LIST are the per-owner HTTP surface. They do NOT govern the A2A\n * `tasks/get` path, which reads through the system-access primitive and isolates by an\n * owner filter derived from the authenticated principal — so a cross-tenant read fails\n * closed, but by that filter rather than by these roles. CREATE/UPDATE are internal\n * (INTERNAL_CALL, service-tier): only the runtime materialises a task and advances\n * its lifecycle via `*AsSystem`. `tasks/cancel` is an UPDATE, never a delete — the\n * spec requires cancel to return the task's updated state.\n */\n\ntype FlowTaskResourceType =\n | CoreResourceType.USER_FLOW_ACTOR_TASKS\n | CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS\n | CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS;\ntype FlowTaskResourceTypeMember = CoreResourceTypeMemberName<FlowTaskResourceType>;\n\ninterface FlowActorTaskScopeExample {\n readonly scopeIdentity: Readonly<Record<string, string>>;\n readonly resourceIdentity: Readonly<Record<string, string>>;\n readonly scopeLabel: string;\n readonly machineCredentialId: string;\n}\n\n/** Exhaustive owner/route projection for the three public task contracts. */\nfunction createFlowActorTaskScopeExample(resourceType: FlowTaskResourceType): FlowActorTaskScopeExample {\n switch (resourceType) {\n case CoreResourceType.USER_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { userId: 'user_01JEXAMPLE' },\n resourceIdentity: { userFlowActorTaskId: 'flow_task_user_01JEXAMPLE' },\n scopeLabel: 'user',\n machineCredentialId: FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n };\n case CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { organizationId: 'org_01JEXAMPLE' },\n resourceIdentity: { organizationFlowActorTaskId: 'flow_task_org_01JEXAMPLE' },\n scopeLabel: 'organization',\n machineCredentialId: 'machine_credential_org_finance_agent',\n };\n case CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { applicationId: 'app_01JEXAMPLE' },\n resourceIdentity: { applicationFlowActorTaskId: 'flow_task_app_01JEXAMPLE' },\n scopeLabel: 'application',\n machineCredentialId: 'machine_credential_app_finance_agent',\n };\n default: {\n const exhaustiveResourceType: never = resourceType;\n throw new Error(`Unsupported Flow Actor task resource type: ${String(exhaustiveResourceType)}`);\n }\n }\n}\n\nfunction createFlowActorTaskPage(data: readonly unknown[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: 1 },\n };\n}\n\nconst flowTaskPrimaryScopeByResourceType: Record<FlowTaskResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.USER_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.USER_SELF,\n [CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype Cfg = ReturnType<(typeof flowActorTasksPolymorphicFactories)[CoreResourceType.USER_FLOW_ACTOR_TASKS]>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof FlowActorTaskBaseSchema;\n\nfunction buildFlowActorTaskResourceSpecification(\n resourceType: FlowTaskResourceType,\n resourceTypeMemberName: FlowTaskResourceTypeMember,\n) {\n const exampleScope = createFlowActorTaskScopeExample(resourceType);\n const completedTaskExample = {\n _id: Object.values(exampleScope.resourceIdentity)[0],\n title: 'Prepare the weekly purchase-approval brief',\n status: FlowsActors_Status.COMPLETED,\n taskId: '22222222-2222-4222-8222-222222222222',\n flowActorExecutionId: '11111111-1111-4111-8111-111111111111',\n resourceServerInstanceRef: 'finance-operations-agent',\n machineCredentialId: exampleScope.machineCredentialId,\n contextId: 'finance-weekly-review-2026-w34',\n artifacts: [],\n createdAt: '2026-08-20T08:30:00.000Z',\n updatedAt: '2026-08-20T08:30:14.000Z',\n finishedAt: '2026-08-20T08:30:14.000Z',\n ...exampleScope.scopeIdentity,\n };\n const processingTaskExample = {\n ...completedTaskExample,\n _id: `${completedTaskExample._id}_processing`,\n title: 'Reconcile supplier exceptions',\n status: FlowsActors_Status.PROCESSING,\n taskId: '22222222-2222-4222-8222-222222222223',\n updatedAt: '2026-08-20T09:05:02.000Z',\n finishedAt: undefined,\n };\n const summarizeTask = (task: typeof completedTaskExample) => ({\n _id: task._id,\n taskId: task.taskId,\n status: task.status,\n title: task.title,\n });\n\n return resourceSpecification<undefined, Core, Main>(\n flowActorTasksPolymorphicFactories[resourceType],\n FlowActorTaskBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one addressable unit of agent work, including its lifecycle status, outputs, artifacts, and terminal outcome.',\n businessRole: 'The work record an authorized integration polls, collects results from, or cancels independently of the conversation that started it.',\n lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `input-required`. Advances through working, and closes on completion, failure, or cancellation. Kept for the application\\'s declared RESOURCE_DATA period counted from its last update (`retentionBinding`, LAST_UPDATED), then deleted by the retention-class sweep (#2841).',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowActorTaskBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'flowActorTasksPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: resourceTypeMemberName,\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Derived from the canonical `Actors_Task_Schema` — the same contract the platform persists as `wildoApplicationActorTasks`, except that a persisted row stores its instants (`createdAt`, `updatedAt`, `startedAt`, `completedAt`) as dates (`timestamptz`) where the canonical contract carries ISO strings (#2187). Not a bespoke A2A task model.',\n 'Three variants under `FLOW_ACTOR_TASK_SCOPE_VARIANTS` — user row is `user_self`; org/app rows are `ORGANIZATIONS`/`APPLICATION` (machine-owned).',\n '`input` and `output` carry no field specification because they are untyped passthrough (`any`) inherited from the canonical task contract, and the specification framework offers no builder for an untyped field. Their portability provenance IS declared at the schema — `input` is subject-provided, `output` is derived — so the classification a portability bundle needs is not lost by the omission. Neither is written by the A2A transport today.',\n ],\n },\n\n fields: {\n taskId: schemaShape.taskId.stringSpec({\n meaning: 'Stable business id of the task, and the identity the A2A protocol addresses.',\n whyItMatters: 'This is the value returned as `Task.id` and accepted by `tasks/get` / `tasks/cancel` — the only handle an A2A client holds. Uniqueness is enforced PER VARIANT despite the `scope: \\'global\\'` decorator — the three variants are separate stores and no index spans them. Nothing depends on family-wide uniqueness, and a v4 uuid collision is not a real risk. Note what that does NOT mean: the read is still OWNER-FIRST. `readTask` filters on the owner fields derived from the authenticated principal AND the id, so a task belonging to another tenant answers exactly as a non-existent one does. Uniqueness is not what authorizes the read under either reading, so do not reason from it to isolation. Two earlier revisions of this sentence were wrong in opposite directions: one claimed the id \"must resolve without the caller knowing which owner scope the task belongs to\" (a lookup this resource does not perform), and one claimed `scope: \\'global\\'` gives FAMILY-WIDE uniqueness — it does not, because `global` means \"unique across the entire COLLECTION\" and each polymorphic variant is its own collection.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n status: schemaShape.status.enumSpec({\n meaning: 'Current lifecycle state of the work.',\n whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` → input-required, `completed` → completed, `failed` and `aborted` → failed, `cancelled` → canceled. A task whose worker stopped is reported as failed once the worker’s hold on the task has expired, so an abandoned task never reads as still working. A task waiting on a person’s decision is exempt: waiting is its correct state, however long it lasts.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_Status',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [FlowsActors_Status.READY]: { meaning: 'Materialised and acknowledged, not yet processing — A2A `submitted`.' },\n [FlowsActors_Status.PENDING]: { meaning: 'Accepted but not yet actively processing — also projects to A2A `submitted`.' },\n [FlowsActors_Status.PROCESSING]: { meaning: 'Actively running — the agent is working the task. A2A `working`.' },\n [FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `input-required` — non-terminal. Written when a turn pauses for a decision, together with the decision it paused on (`pausedOnDecisionRef`). The stored value stays while the decision is answered elsewhere; what a reader is told is derived from that decision, so a released task reads as working, finished, or unknown.' },\n [FlowsActors_Status.COMPLETED]: { meaning: 'Work finished successfully; outputs and artifacts are final. A2A `completed` (terminal).' },\n [FlowsActors_Status.FAILED]: { meaning: 'Work ended in error. A2A `failed` (terminal). Also the state an abandoned task resolves to when its liveness lease has expired.' },\n [FlowsActors_Status.CANCELLED]: { meaning: 'Cancelled before completion, via `tasks/cancel`. A2A `canceled` (terminal) — the record survives so the client can read its final state.' },\n [FlowsActors_Status.ABORTED]: { meaning: 'Halted by the runtime rather than by a caller (e.g. a circuit breaker tripped). Projects to A2A `failed` (terminal).' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n contextId: schemaShape.contextId.stringSpec({\n meaning: 'The A2A conversation thread this task belongs to.',\n whyItMatters: 'Indexed so a client can enumerate every task of one conversation without walking execution records — the two planes stay queryable independently.',\n semanticRole: 'identifier',\n }),\n\n pausedOnDecisionRef: schemaShape.pausedOnDecisionRef.stringSpec({\n meaning: 'The id of the human decision this task\\'s turn paused on, written in the same write that moves the task to awaiting approval. Absent on a task that never paused. Never sent to an A2A client.',\n whyItMatters: 'The task is addressed by its own decision, not by its conversation thread. A thread outlives one task: a later task in the same thread can pause, be approved and resume while this row still reads awaiting approval. Read by the thread, this task\\'s state was whichever turn ran last, and cancelling it withdrew the later task\\'s decision and stopped its resumed turn. Read by this decision, the task reads as waiting, working, or ended, and its cancel reaches only its own work.',\n semanticRole: 'identifier',\n }),\n\n failureCode: schemaShape.failureCode.enumSpec({\n meaning: 'Why the task\\'s turn failed, written in the same write that records `failed`, and cleared on every other status. One of the execution error codes.',\n whyItMatters: 'A client polling a task reads why it failed from its status message, so a suspension, a withheld reply or a restart reads apart from a fault that invites a retry, as the blocking answer\\'s error code would have told it.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_ExecutionErrorCode',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n\n resourceServerInstanceRef: schemaShape.resourceServerInstanceRef.stringSpec({\n meaning: 'Which A2A agent (resource-server instance) this task was created through. The default, unnamed agent is stored under a reserved sentinel rather than left empty.',\n whyItMatters: 'Part of the read and cancel FILTER, not descriptive metadata. A2A agents are declared as separate resource servers with per-instance token audiences, so an agent must have no side-door into another agent\\'s work. Without this dimension a token bound to one agent could read and cancel tasks created through another whenever both resolved to the same owner scope — and since `title` carries the opening characters of the originating prompt, that also disclosed prompt text across the boundary.',\n semanticRole: 'identifier',\n }),\n\n title: schemaShape.title.stringSpec({\n meaning: 'Short human-readable name for the work, shown wherever a task is listed.',\n whyItMatters: 'CONTENT-BEARING, and part of the summary projection: the A2A transport fills it with the opening characters of the ORIGINATING PROMPT. That is why it is classified as subject-provided for portability rather than observed, and why the read filter carries the agent-instance and machine-credential axes — a cross-principal read of this field discloses prompt text.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n description: schemaShape.description.stringSpec({\n meaning: 'Longer free-text description of the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided content, like the title. Absent on an A2A-materialised task today — the transport sets only a title — but retained from the canonical task contract so an orchestration producer can populate it without a schema change.',\n }),\n\n topic: schemaShape.topic.stringSpec({\n meaning: 'Subject-matter grouping for the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided, and unset by the A2A transport. Kept from the canonical contract for the same reason as the description.',\n }),\n\n input: schemaShape.input.objectSpec({\n meaning: 'What the task was asked to do, when its producer recorded it.',\n whyItMatters: 'Subject-provided content. The A2A transport does not set it; the opening characters of the originating prompt are in `title`.',\n }),\n\n output: schemaShape.output.objectSpec({\n meaning: 'The result of the work. On the A2A transport it is the reply text, written only when the task completes successfully; an empty reply is still a result.',\n whyItMatters: 'DERIVED: it is set in the same guarded write that completes the task, so a cancellation that wins also refuses the reply, and a failed or approval-held task never shows one.',\n }),\n\n artifacts: schemaShape.artifacts.arraySpec({\n meaning: 'Artifacts the work produced, projected onto the protocol object for the client to collect.',\n elementMeaning: 'One artifact the work produced — its stable reference plus the typed parts that carry the content.',\n whyItMatters: 'DERIVED, like the output, and the one field of this family that reaches the wire as structured content. No writer populates it yet: the projection exists and is correct, but is unreachable by construction until an orchestration producer sets it.',\n }),\n\n machineCredentialId: schemaShape.machineCredentialId.stringSpec({\n meaning: 'Which machine credential opened this task. A user-delegated turn stores a reserved sentinel, because there the human is the principal.',\n whyItMatters: 'Part of the read and cancel FILTER, alongside the owner scope and the agent instance. The scope foreign key does not identify the principal on the machine variants: the application scope is a deployment singleton, so every application-scope client resolves to the same owner, and the organization scope is shared by every machine client of one tenant. Without this axis a separately-credentialed client could read and cancel another client\\'s work — and the title carries the opening characters of the originating prompt.',\n semanticRole: 'identifier',\n }),\n\n flowActorExecutionId: schemaShape.flowActorExecutionId.stringSpec({\n meaning: 'The conversational execution this task was materialised from, when there was one.',\n whyItMatters: 'A SOFT link, not a foreign key, and optional on purpose: a task is owned by its scope, not by an execution, so it may outlive — or exist without — the conversation that produced it. Deleting a conversation must never delete its work records.',\n semanticRole: 'identifier',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the task was materialised.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the task last advanced — a status transition, an artifact append, or a recorded outcome.',\n temporalRole: 'modified',\n }),\n\n finishedAt: schemaShape.finishedAt.dateSpec({\n meaning: 'When the task reached a terminal state (completed, failed, or canceled).',\n whyItMatters: 'Set when the repair — or a normal completion — lands. The sweep selects candidates by `updatedAt` older than a grace window AND a non-terminal `status`, then lets the liveness lease decide.',\n temporalRole: 'occurred',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Materialise a task when a send must be addressable after its response: the client asked for immediate return, the turn paused for a human decision and has no answer to send, or the send carried a push-notification webhook (which needs a task to notify about).',\n outcome: 'The client receives an addressable task it can poll, cancel, and be notified about. A non-blocking send gets it at once; a blocking send that carried a webhook waits for the turn and answers with the task in its latest state.',\n whenToUse: 'Never called directly by a client. A task comes into existence as a consequence of a send, and only for one of those three reasons; an ordinary blocking send with no webhook answers with a message and writes no task.',\n },\n [Op.READ]: {\n purpose: 'Read one addressable unit of agent work and its current lifecycle state.',\n outcome: 'The caller learns whether the work is queued, active, waiting, complete, failed, or canceled, and receives any available artifacts.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The task was found within the caller\\'s own scope and is returned in its current state.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to inspect agent work for this user, organization, or application scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n rateLimitNote: 'Deliberately NOT rate-limited or budget-gated on the A2A path: polling a task is not a turn and consumes no model tokens, so throttling it would penalise exactly the clients that correctly asked not to block.',\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work with context`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `Inspect the compact ${exampleScope.scopeLabel} task state`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: summarizeTask(completedTaskExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List agent work visible in the requested scope, optionally filtered by conversation context or lifecycle status.',\n outcome: 'The caller can reconcile the work for one conversation or monitor unfinished work without walking conversation records.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The caller\\'s own tasks, scoped to their owner.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to list agent work for this scope.' },\n ],\n examples: [{\n title: `List active ${exampleScope.scopeLabel} tasks for one conversation`,\n request: {\n ...exampleScope.scopeIdentity,\n contextId: completedTaskExample.contextId,\n status: FlowsActors_Status.PROCESSING,\n page: 1,\n limit: 20,\n sort: 'updatedAt:desc',\n },\n response: createFlowActorTaskPage([processingTaskExample, completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `List ${exampleScope.scopeLabel} tasks with resource context`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `List compact ${exampleScope.scopeLabel} task states`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([\n summarizeTask(processingTaskExample as typeof completedTaskExample),\n summarizeTask(completedTaskExample),\n ]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Advance the task — status transitions, appended artifacts, terminal outcome — and record cancellation.',\n outcome: 'The stored record reflects what actually happened to the work, which is what every other reader depends on.',\n whenToUse: 'Backs `tasks/cancel`, which is a STATUS TRANSITION rather than a delete: the A2A spec requires cancel to return the task\\'s updated state, so the record must survive it.',\n },\n [Op.DELETE]: {\n purpose: 'Permanently remove one stored unit of agent work from the requested scope.',\n outcome: 'The selected task record and its stored results are no longer available.',\n whenToUse: 'Use for deliberate history cleanup after the task is no longer needed; use cancellation instead when active work must stop but its final state must remain observable.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The selected task record was removed.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks task-removal authority in the requested scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n examples: [{\n title: `Remove completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: { id: completedTaskExample._id },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'A task belongs to exactly ONE owner scope — the injected owner FK is the only authority over its lifetime. The link to a conversational execution is soft and optional, and never governs deletion.',\n 'Not every turn produces a task. Turns that complete inline return a Message and write no row; a task is materialised only when the work needs an addressable lifecycle.',\n 'Cancellation is a status transition, never a deletion — a canceled task remains readable so the client can observe its final state.',\n 'A non-terminal task whose liveness lease has expired is reported as failed: the executing process died, and a task must never read as working forever.',\n ],\n }),\n // The owner is the injected scope FK, anchored by the `<SCOPE> → *FlowActorTasks`\n // primary-scope composition edge in `resources-registry.shared.core.definitions.ts`\n // (generated by `createPolymorphicScopeRelationships`). Feeds the spec ↔ registry\n // alignment guard and must match per variant.\n { resourcePrimaryScope: flowTaskPrimaryScopeByResourceType[resourceType] },\n );\n}\n\nexport const userFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.USER_FLOW_ACTOR_TASKS,\n 'USER_FLOW_ACTOR_TASKS',\n);\n\nexport const organizationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS,\n 'ORGANIZATION_FLOW_ACTOR_TASKS',\n);\n\nexport const applicationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS,\n 'APPLICATION_FLOW_ACTOR_TASKS',\n);\n"]}
|
|
1
|
+
{"version":3,"file":"flow-actor-tasks.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/flow-actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,kCAAkC,EAClC,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAmC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAqD3E,6EAA6E;AAC7E,SAAS,+BAA+B,CAAC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CAAC;AAEF,MAAM,CAAC,MAAM,+CAA+C,GAAG,uCAAuC,CACpG,gBAAgB,CAAC,6BAA6B,EAC9C,+BAA+B,CAChC,CAAC;AAEF,MAAM,CAAC,MAAM,8CAA8C,GAAG,uCAAuC,CACnG,gBAAgB,CAAC,4BAA4B,EAC7C,8BAA8B,CAC/B,CAAC","sourcesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n CoreResourceType,\n FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n FlowActorTaskBaseSchema,\n FlowsActors_Status,\n ResourcePrimaryScope,\n flowActorTasksPolymorphicFactories,\n} from '@wildo-ai/saas-models';\nimport { type CoreResourceTypeMemberName, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the `flowActorTasks` POLYMORPHIC family: the\n * persisted WORK record that backs the A2A `Task` object. One base record is\n * stamped out as three genuine single-scope variants, each owned by its injected\n * owner FK:\n * - `userFlowActorTasks` (USER_SELF — user-delegated A2A)\n * - `organizationFlowActorTasks` (ORGANIZATIONS — org-machine A2A)\n * - `applicationFlowActorTasks` (APPLICATION — app-machine A2A)\n *\n * ## This is a different plane from `flowActorExecutions`\n *\n * Executions own CONVERSATIONAL session history (the message log). Tasks own an\n * addressable, pollable, cancelable WORK lifecycle. The architecture keeps them\n * apart deliberately — an A2A treatment links both concrete records rather than\n * copying the conversation into the task. A task therefore carries only a SOFT\n * link (`flowActorExecutionId`), not a declared foreign key, so it can outlive the\n * conversation that produced it.\n *\n * ## Not every turn has one\n *\n * A task is materialised only when the turn cannot complete inline — the client\n * asked for it (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (#3381; a\n * blocking one then waits and answers with the task), or the turn reached an interrupted state\n * (approval pause → `auth-required`, #3956). All three triggers are live: the pause is proven end to end by\n * `examples/wonder-todos/e2e/a2a-approval-pause.e2e.ts` (the task reaches `auth-required` and\n * persists the decision it waits on) and its release by `a2a-approval-resume.e2e.ts` (the task\n * LEAVES `auth-required` once its execution moves on). A blocking turn with no webhook that answers in one shot\n * returns a `Message` and writes no task row; the A2A spec permits both shapes.\n *\n * The default API READ/LIST are the per-owner HTTP surface. They do NOT govern the A2A\n * `tasks/get` path, which reads through the system-access primitive and isolates by an\n * owner filter derived from the authenticated principal — so a cross-tenant read fails\n * closed, but by that filter rather than by these roles. CREATE/UPDATE are internal\n * (INTERNAL_CALL, service-tier): only the runtime materialises a task and advances\n * its lifecycle via `*AsSystem`. `tasks/cancel` is an UPDATE, never a delete — the\n * spec requires cancel to return the task's updated state.\n */\n\ntype FlowTaskResourceType =\n | CoreResourceType.USER_FLOW_ACTOR_TASKS\n | CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS\n | CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS;\ntype FlowTaskResourceTypeMember = CoreResourceTypeMemberName<FlowTaskResourceType>;\n\ninterface FlowActorTaskScopeExample {\n readonly scopeIdentity: Readonly<Record<string, string>>;\n readonly resourceIdentity: Readonly<Record<string, string>>;\n readonly scopeLabel: string;\n readonly machineCredentialId: string;\n}\n\n/** Exhaustive owner/route projection for the three public task contracts. */\nfunction createFlowActorTaskScopeExample(resourceType: FlowTaskResourceType): FlowActorTaskScopeExample {\n switch (resourceType) {\n case CoreResourceType.USER_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { userId: 'user_01JEXAMPLE' },\n resourceIdentity: { userFlowActorTaskId: 'flow_task_user_01JEXAMPLE' },\n scopeLabel: 'user',\n machineCredentialId: FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n };\n case CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { organizationId: 'org_01JEXAMPLE' },\n resourceIdentity: { organizationFlowActorTaskId: 'flow_task_org_01JEXAMPLE' },\n scopeLabel: 'organization',\n machineCredentialId: 'machine_credential_org_finance_agent',\n };\n case CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { applicationId: 'app_01JEXAMPLE' },\n resourceIdentity: { applicationFlowActorTaskId: 'flow_task_app_01JEXAMPLE' },\n scopeLabel: 'application',\n machineCredentialId: 'machine_credential_app_finance_agent',\n };\n default: {\n const exhaustiveResourceType: never = resourceType;\n throw new Error(`Unsupported Flow Actor task resource type: ${String(exhaustiveResourceType)}`);\n }\n }\n}\n\nfunction createFlowActorTaskPage(data: readonly unknown[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: 1 },\n };\n}\n\nconst flowTaskPrimaryScopeByResourceType: Record<FlowTaskResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.USER_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.USER_SELF,\n [CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype Cfg = ReturnType<(typeof flowActorTasksPolymorphicFactories)[CoreResourceType.USER_FLOW_ACTOR_TASKS]>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof FlowActorTaskBaseSchema;\n\nfunction buildFlowActorTaskResourceSpecification(\n resourceType: FlowTaskResourceType,\n resourceTypeMemberName: FlowTaskResourceTypeMember,\n) {\n const exampleScope = createFlowActorTaskScopeExample(resourceType);\n const completedTaskExample = {\n _id: Object.values(exampleScope.resourceIdentity)[0],\n title: 'Prepare the weekly purchase-approval brief',\n status: FlowsActors_Status.COMPLETED,\n taskId: '22222222-2222-4222-8222-222222222222',\n flowActorExecutionId: '11111111-1111-4111-8111-111111111111',\n resourceServerInstanceRef: 'finance-operations-agent',\n machineCredentialId: exampleScope.machineCredentialId,\n contextId: 'finance-weekly-review-2026-w34',\n artifacts: [],\n createdAt: '2026-08-20T08:30:00.000Z',\n updatedAt: '2026-08-20T08:30:14.000Z',\n finishedAt: '2026-08-20T08:30:14.000Z',\n ...exampleScope.scopeIdentity,\n };\n const processingTaskExample = {\n ...completedTaskExample,\n _id: `${completedTaskExample._id}_processing`,\n title: 'Reconcile supplier exceptions',\n status: FlowsActors_Status.PROCESSING,\n taskId: '22222222-2222-4222-8222-222222222223',\n updatedAt: '2026-08-20T09:05:02.000Z',\n finishedAt: undefined,\n };\n const summarizeTask = (task: typeof completedTaskExample) => ({\n _id: task._id,\n taskId: task.taskId,\n status: task.status,\n title: task.title,\n });\n\n return resourceSpecification<undefined, Core, Main>(\n flowActorTasksPolymorphicFactories[resourceType],\n FlowActorTaskBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one addressable unit of agent work, including its lifecycle status, outputs, artifacts, and terminal outcome.',\n businessRole: 'The work record an authorized integration polls, collects results from, or cancels independently of the conversation that started it.',\n lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `auth-required`. Advances through working, and closes on completion, failure, or cancellation. Kept for the application\\'s declared RESOURCE_DATA period counted from its last update (`retentionBinding`, LAST_UPDATED), then deleted by the retention-class sweep (#2841).',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowActorTaskBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'flowActorTasksPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: resourceTypeMemberName,\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Derived from the canonical `Actors_Task_Schema` — the same contract the platform persists as `wildoApplicationActorTasks`, except that a persisted row stores its instants (`createdAt`, `updatedAt`, `startedAt`, `completedAt`) as dates (`timestamptz`) where the canonical contract carries ISO strings (#2187). Not a bespoke A2A task model.',\n 'Three variants under `FLOW_ACTOR_TASK_SCOPE_VARIANTS` — user row is `user_self`; org/app rows are `ORGANIZATIONS`/`APPLICATION` (machine-owned).',\n '`input` and `output` carry no field specification because they are untyped passthrough (`any`) inherited from the canonical task contract, and the specification framework offers no builder for an untyped field. Their portability provenance IS declared at the schema — `input` is subject-provided, `output` is derived — so the classification a portability bundle needs is not lost by the omission. Neither is written by the A2A transport today.',\n ],\n },\n\n fields: {\n taskId: schemaShape.taskId.stringSpec({\n meaning: 'Stable business id of the task, and the identity the A2A protocol addresses.',\n whyItMatters: 'This is the value returned as `Task.id` and accepted by `tasks/get` / `tasks/cancel` — the only handle an A2A client holds. Uniqueness is enforced PER VARIANT despite the `scope: \\'global\\'` decorator — the three variants are separate stores and no index spans them. Nothing depends on family-wide uniqueness, and a v4 uuid collision is not a real risk. Note what that does NOT mean: the read is still OWNER-FIRST. `readTask` filters on the owner fields derived from the authenticated principal AND the id, so a task belonging to another tenant answers exactly as a non-existent one does. Uniqueness is not what authorizes the read under either reading, so do not reason from it to isolation. Two earlier revisions of this sentence were wrong in opposite directions: one claimed the id \"must resolve without the caller knowing which owner scope the task belongs to\" (a lookup this resource does not perform), and one claimed `scope: \\'global\\'` gives FAMILY-WIDE uniqueness — it does not, because `global` means \"unique across the entire COLLECTION\" and each polymorphic variant is its own collection.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n status: schemaShape.status.enumSpec({\n meaning: 'Current lifecycle state of the work.',\n whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` → auth-required, `completed` → completed, `failed` and `aborted` → failed, `cancelled` → canceled. A task whose worker stopped is reported as failed once the worker’s hold on the task has expired, so an abandoned task never reads as still working. A task waiting on a person’s decision is exempt: waiting is its correct state, however long it lasts.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_Status',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [FlowsActors_Status.READY]: { meaning: 'Materialised and acknowledged, not yet processing — A2A `submitted`.' },\n [FlowsActors_Status.PENDING]: { meaning: 'Accepted but not yet actively processing — also projects to A2A `submitted`.' },\n [FlowsActors_Status.PROCESSING]: { meaning: 'Actively running — the agent is working the task. A2A `working`.' },\n [FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `auth-required` — non-terminal: the person decides in the application, never through a message on the task. Written when a turn pauses for a decision, together with the decision it paused on (`pausedOnDecisionRef`). The stored value stays while the decision is answered elsewhere; what a reader is told is derived from that decision, so a released task reads as working, finished, or unknown.' },\n [FlowsActors_Status.COMPLETED]: { meaning: 'Work finished successfully; outputs and artifacts are final. A2A `completed` (terminal).' },\n [FlowsActors_Status.FAILED]: { meaning: 'Work ended in error. A2A `failed` (terminal). Also the state an abandoned task resolves to when its liveness lease has expired.' },\n [FlowsActors_Status.CANCELLED]: { meaning: 'Cancelled before completion, via `tasks/cancel`. A2A `canceled` (terminal) — the record survives so the client can read its final state.' },\n [FlowsActors_Status.ABORTED]: { meaning: 'Halted by the runtime rather than by a caller (e.g. a circuit breaker tripped). Projects to A2A `failed` (terminal).' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n contextId: schemaShape.contextId.stringSpec({\n meaning: 'The A2A conversation thread this task belongs to.',\n whyItMatters: 'Indexed so a client can enumerate every task of one conversation without walking execution records — the two planes stay queryable independently.',\n semanticRole: 'identifier',\n }),\n\n pausedOnDecisionRef: schemaShape.pausedOnDecisionRef.stringSpec({\n meaning: 'The id of the human decision this task\\'s turn paused on, written in the same write that moves the task to awaiting approval. Absent on a task that never paused. Never sent to an A2A client.',\n whyItMatters: 'The task is addressed by its own decision, not by its conversation thread. A thread outlives one task: a later task in the same thread can pause, be approved and resume while this row still reads awaiting approval. Read by the thread, this task\\'s state was whichever turn ran last, and cancelling it withdrew the later task\\'s decision and stopped its resumed turn. Read by this decision, the task reads as waiting, working, or ended, and its cancel reaches only its own work.',\n semanticRole: 'identifier',\n }),\n\n failureCode: schemaShape.failureCode.enumSpec({\n meaning: 'Why the task\\'s turn failed, written in the same write that records `failed`, and cleared on every other status. One of the execution error codes.',\n whyItMatters: 'A client polling a task reads why it failed from its status message, so a suspension, a withheld reply or a restart reads apart from a fault that invites a retry, as the blocking answer\\'s error code would have told it.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_ExecutionErrorCode',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n\n resourceServerInstanceRef: schemaShape.resourceServerInstanceRef.stringSpec({\n meaning: 'Which A2A agent (resource-server instance) this task was created through. The default, unnamed agent is stored under a reserved sentinel rather than left empty.',\n whyItMatters: 'Part of the read and cancel FILTER, not descriptive metadata. A2A agents are declared as separate resource servers with per-instance token audiences, so an agent must have no side-door into another agent\\'s work. Without this dimension a token bound to one agent could read and cancel tasks created through another whenever both resolved to the same owner scope — and since `title` carries the opening characters of the originating prompt, that also disclosed prompt text across the boundary.',\n semanticRole: 'identifier',\n }),\n\n title: schemaShape.title.stringSpec({\n meaning: 'Short human-readable name for the work, shown wherever a task is listed.',\n whyItMatters: 'CONTENT-BEARING, and part of the summary projection: the A2A transport fills it with the opening characters of the ORIGINATING PROMPT. That is why it is classified as subject-provided for portability rather than observed, and why the read filter carries the agent-instance and machine-credential axes — a cross-principal read of this field discloses prompt text.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n description: schemaShape.description.stringSpec({\n meaning: 'Longer free-text description of the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided content, like the title. Absent on an A2A-materialised task today — the transport sets only a title — but retained from the canonical task contract so an orchestration producer can populate it without a schema change.',\n }),\n\n topic: schemaShape.topic.stringSpec({\n meaning: 'Subject-matter grouping for the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided, and unset by the A2A transport. Kept from the canonical contract for the same reason as the description.',\n }),\n\n input: schemaShape.input.objectSpec({\n meaning: 'What the task was asked to do, when its producer recorded it.',\n whyItMatters: 'Subject-provided content. The A2A transport does not set it; the opening characters of the originating prompt are in `title`.',\n }),\n\n output: schemaShape.output.objectSpec({\n meaning: 'The result of the work. On the A2A transport it is the reply text, written only when the task completes successfully; an empty reply is still a result.',\n whyItMatters: 'DERIVED: it is set in the same guarded write that completes the task, so a cancellation that wins also refuses the reply, and a failed or approval-held task never shows one.',\n }),\n\n artifacts: schemaShape.artifacts.arraySpec({\n meaning: 'Artifacts the work produced, projected onto the protocol object for the client to collect.',\n elementMeaning: 'One artifact the work produced — its stable reference plus the typed parts that carry the content.',\n whyItMatters: 'DERIVED, like the output, and the one field of this family that reaches the wire as structured content. No writer populates it yet: the projection exists and is correct, but is unreachable by construction until an orchestration producer sets it.',\n }),\n\n machineCredentialId: schemaShape.machineCredentialId.stringSpec({\n meaning: 'Which machine credential opened this task. A user-delegated turn stores a reserved sentinel, because there the human is the principal.',\n whyItMatters: 'Part of the read and cancel FILTER, alongside the owner scope and the agent instance. The scope foreign key does not identify the principal on the machine variants: the application scope is a deployment singleton, so every application-scope client resolves to the same owner, and the organization scope is shared by every machine client of one tenant. Without this axis a separately-credentialed client could read and cancel another client\\'s work — and the title carries the opening characters of the originating prompt.',\n semanticRole: 'identifier',\n }),\n\n flowActorExecutionId: schemaShape.flowActorExecutionId.stringSpec({\n meaning: 'The conversational execution this task was materialised from, when there was one.',\n whyItMatters: 'A SOFT link, not a foreign key, and optional on purpose: a task is owned by its scope, not by an execution, so it may outlive — or exist without — the conversation that produced it. Deleting a conversation must never delete its work records.',\n semanticRole: 'identifier',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the task was materialised.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the task last advanced — a status transition, an artifact append, or a recorded outcome.',\n temporalRole: 'modified',\n }),\n\n finishedAt: schemaShape.finishedAt.dateSpec({\n meaning: 'When the task reached a terminal state (completed, failed, or canceled).',\n whyItMatters: 'Set when the repair — or a normal completion — lands. The sweep selects candidates by `updatedAt` older than a grace window AND a non-terminal `status`, then lets the liveness lease decide.',\n temporalRole: 'occurred',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Materialise a task when a send must be addressable after its response: the client asked for immediate return, the turn paused for a human decision and has no answer to send, or the send carried a push-notification webhook (which needs a task to notify about).',\n outcome: 'The client receives an addressable task it can poll, cancel, and be notified about. A non-blocking send gets it at once; a blocking send that carried a webhook waits for the turn and answers with the task in its latest state.',\n whenToUse: 'Never called directly by a client. A task comes into existence as a consequence of a send, and only for one of those three reasons; an ordinary blocking send with no webhook answers with a message and writes no task.',\n },\n [Op.READ]: {\n purpose: 'Read one addressable unit of agent work and its current lifecycle state.',\n outcome: 'The caller learns whether the work is queued, active, waiting, complete, failed, or canceled, and receives any available artifacts.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The task was found within the caller\\'s own scope and is returned in its current state.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to inspect agent work for this user, organization, or application scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n rateLimitNote: 'Deliberately NOT rate-limited or budget-gated on the A2A path: polling a task is not a turn and consumes no model tokens, so throttling it would penalise exactly the clients that correctly asked not to block.',\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work with context`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `Inspect the compact ${exampleScope.scopeLabel} task state`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: summarizeTask(completedTaskExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List agent work visible in the requested scope, optionally filtered by conversation context or lifecycle status.',\n outcome: 'The caller can reconcile the work for one conversation or monitor unfinished work without walking conversation records.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The caller\\'s own tasks, scoped to their owner.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to list agent work for this scope.' },\n ],\n examples: [{\n title: `List active ${exampleScope.scopeLabel} tasks for one conversation`,\n request: {\n ...exampleScope.scopeIdentity,\n contextId: completedTaskExample.contextId,\n status: FlowsActors_Status.PROCESSING,\n page: 1,\n limit: 20,\n sort: 'updatedAt:desc',\n },\n response: createFlowActorTaskPage([processingTaskExample, completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `List ${exampleScope.scopeLabel} tasks with resource context`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `List compact ${exampleScope.scopeLabel} task states`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([\n summarizeTask(processingTaskExample as typeof completedTaskExample),\n summarizeTask(completedTaskExample),\n ]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Advance the task — status transitions, appended artifacts, terminal outcome — and record cancellation.',\n outcome: 'The stored record reflects what actually happened to the work, which is what every other reader depends on.',\n whenToUse: 'Backs `tasks/cancel`, which is a STATUS TRANSITION rather than a delete: the A2A spec requires cancel to return the task\\'s updated state, so the record must survive it.',\n },\n [Op.DELETE]: {\n purpose: 'Permanently remove one stored unit of agent work from the requested scope.',\n outcome: 'The selected task record and its stored results are no longer available.',\n whenToUse: 'Use for deliberate history cleanup after the task is no longer needed; use cancellation instead when active work must stop but its final state must remain observable.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The selected task record was removed.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks task-removal authority in the requested scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n examples: [{\n title: `Remove completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: { id: completedTaskExample._id },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'A task belongs to exactly ONE owner scope — the injected owner FK is the only authority over its lifetime. The link to a conversational execution is soft and optional, and never governs deletion.',\n 'Not every turn produces a task. Turns that complete inline return a Message and write no row; a task is materialised only when the work needs an addressable lifecycle.',\n 'Cancellation is a status transition, never a deletion — a canceled task remains readable so the client can observe its final state.',\n 'A non-terminal task whose liveness lease has expired is reported as failed: the executing process died, and a task must never read as working forever.',\n ],\n }),\n // The owner is the injected scope FK, anchored by the `<SCOPE> → *FlowActorTasks`\n // primary-scope composition edge in `resources-registry.shared.core.definitions.ts`\n // (generated by `createPolymorphicScopeRelationships`). Feeds the spec ↔ registry\n // alignment guard and must match per variant.\n { resourcePrimaryScope: flowTaskPrimaryScopeByResourceType[resourceType] },\n );\n}\n\nexport const userFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.USER_FLOW_ACTOR_TASKS,\n 'USER_FLOW_ACTOR_TASKS',\n);\n\nexport const organizationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS,\n 'ORGANIZATION_FLOW_ACTOR_TASKS',\n);\n\nexport const applicationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS,\n 'APPLICATION_FLOW_ACTOR_TASKS',\n);\n"]}
|
package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js
CHANGED
|
@@ -57,7 +57,7 @@ export const organizationChatSettingsResourceSpecification = resourceSpecificati
|
|
|
57
57
|
fields: {
|
|
58
58
|
_id: schemaShape._id.stringSpec({ meaning: 'Identifier of one chat setting.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),
|
|
59
59
|
organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the choice is for.', whyItMatters: 'The only organization it applies in: another organization on the same connection makes its own choice.', importance: FieldSemanticImportance.PRIMARY }),
|
|
60
|
-
connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
60
|
+
connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records. Shown by the vendor\'s name (the PROVIDER vocabulary, `providers.<ref>.displayName`), the ref itself only while that name is missing.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
61
61
|
chatAgentRef: schemaShape.chatAgentRef.stringSpec({ meaning: 'The declared chat agent that answers the organization\'s people on this connection.', whyItMatters: 'Decides which agent acts, as the member who wrote, on every message the organization\'s people send the bot on this connection.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
62
62
|
createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the organization first chose an agent for this connection.', temporalRole: 'creation' }),
|
|
63
63
|
updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the choice last changed.', temporalRole: 'modified' }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-chat-settings.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/organization-chat-settings.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,mEAAmE,GACpE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACjE,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAEtD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cA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,CAAC,MAAM,EAAE,CAAC;SACnS;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,mDAAmD;YAC5D,OAAO,EAAE,iLAAiL;YAC1L,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;YAC/F,cAAc,EAAE,CAAC,oBAAoB,EAAE,SAAS,CAAC;YACjD,UAAU,EAAE,IAAI;SACjB;QACD,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE;YAChB,OAAO,EAAE,yFAAyF;YAClG,OAAO,EAAE,oDAAoD;YAC7D,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;YAClG,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,gEAAgE;QAChE,qGAAqG;QACrG,kLAAkL;KACnL;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationChatSettings` — Wildo SaaS engine specification (organization-scoped). #2665.\n *\n * Inputs:\n * - Schema: `OrganizationChatSettingSchema` (`inbound/organization-chat-settings.shared.schemas.ts`)\n * - Factory: `organizationChatSettingsResourceConfiguration_InitializationFactory`\n * (`inbound/organization-chat-settings.shared.resources-config.schemas.ts`)\n * - Write checks: `organization-chat-settings.custom-impl.backend.service.ts` (saas-backend-lib); the choice is resolved\n * by `ChatAgentsBackendService.resolve`.\n *\n * Why `ORGANIZATIONS` scope: the choice is the organization's, applies only to its own people, and is purged with it.\n * The registry relationship ORGANIZATIONS → organizationChatSettings carries `isPrimaryScope: true`.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationChatSettingSchema,\n ResourcePrimaryScope,\n organizationChatSettingsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst EXAMPLE_ORGANIZATION_ID = 'org_01J4P8F1M2N3Q4R5S6T7V8W9XY';\nconst EXAMPLE_SETTING_ID = '66f6a1c2e3d4b5a697887901';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst page = <T>(data: readonly T[]) => ({ data, pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 } });\n\nconst settingExample = {\n _id: EXAMPLE_SETTING_ID,\n organizationId: EXAMPLE_ORGANIZATION_ID,\n connectionRef: 'slack',\n chatAgentRef: 'todos.assistant',\n createdAt: '2026-10-08T09:30:00.000Z',\n updatedAt: '2026-10-08T09:30:00.000Z',\n};\n\nconst NOT_AN_ADMINISTRATOR = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization.' };\nconst NOT_FOUND = { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No chat setting with this id exists in the organization.' };\nconst AGENT_NOT_DECLARED = { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The agent is not one the application declares (`chat_agent_not_declared`); the refusal lists the agents it does declare.' };\n\nexport const organizationChatSettingsResourceSpecification = resourceSpecification(\n organizationChatSettingsResourceConfiguration_InitializationFactory,\n OrganizationChatSettingSchema,\n ({ schemaShape }) => ({\n purpose: 'Record which of the application\\'s chat agents answers the organization\\'s people on each chat connection (Slack, Microsoft Teams).',\n businessRole: 'The organization\\'s say over who answers its people in chat. An agent answers as the person who wrote, with that person\\'s authority, so choosing one decides which agent acts for the organization\\'s members from their chat tool.',\n lifecycleRole: 'Created when an administrator chooses an agent for a connection, changed when they choose another, removed when they drop the choice (the application\\'s default agent then answers on that connection, if it declares one). Purged with the organization.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'OrganizationChatSettingSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'organizationChatSettingsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ORGANIZATION_CHAT_SETTINGS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'The agents an organization can choose are the ones the application declares on a backend module (`flowsActors.chatAgents`); the connections are the application\\'s providers enabled here with a chat endpoint the engine verifies. `/flows-actors/frontend-info` lists both, and a write naming anything else is refused.',\n 'Resolution, in order: the organization\\'s row for the connection → the agent the application declares `isDefault` → nobody (the person is told so). A row naming an agent the application no longer declares answers NOBODY rather than the default: the organization chose that agent, not the default.',\n 'One row per connection rather than one row holding a list, so each choice is its own audited write and the uniqueness of a connection is an index (organizationId + connectionRef).',\n 'Every write is HIGH risk and so leaves the framework\\'s own audit row, carrying the connection and the agent (`.isAuditEvidence()`).',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identifier of one chat setting.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the choice is for.', whyItMatters: 'The only organization it applies in: another organization on the same connection makes its own choice.', importance: FieldSemanticImportance.PRIMARY }),\n connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n chatAgentRef: schemaShape.chatAgentRef.stringSpec({ meaning: 'The declared chat agent that answers the organization\\'s people on this connection.', whyItMatters: 'Decides which agent acts, as the member who wrote, on every message the organization\\'s people send the bot on this connection.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the organization first chose an agent for this connection.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the choice last changed.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one chat setting of the organization.',\n outcome: 'The connection and the agent chosen for it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The setting is returned.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND],\n idempotent: true,\n examples: [{ title: 'Read the Slack choice', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationChatSettingId: EXAMPLE_SETTING_ID }, response: settingExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.LIST]: {\n purpose: 'List the organization\\'s chat settings: which agent answers on each connection it chose for.',\n outcome: 'A page of settings, by connection. A connection with no row is answered by the application\\'s default agent, if it declares one.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'A possibly empty page of settings.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR],\n idempotent: true,\n examples: [{ title: 'List the organization\\'s chat settings', request: { organizationId: EXAMPLE_ORGANIZATION_ID, sort: 'connectionRef:asc' }, response: page([settingExample]), forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.CREATE]: {\n purpose: 'Choose the agent that answers the organization\\'s people on a chat connection.',\n outcome: 'The agent answers there from the next message on, as the person who wrote. The choice is written to the audit trail.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The choice is in force; it is returned.' }],\n errorScenarios: [\n NOT_AN_ADMINISTRATOR,\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The connection is not one the application offers here (`chat_connection_not_available`); the refusal lists the ones it does.' },\n AGENT_NOT_DECLARED,\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization already chose an agent for this connection: change that setting instead.' },\n ],\n idempotent: false,\n examples: [{ title: 'Choose the assistant for Slack', request: { organizationId: EXAMPLE_ORGANIZATION_ID, connectionRef: 'slack', chatAgentRef: 'todos.assistant' }, response: settingExample, forStatus: HttpResponseStatusCode.CREATED_201 }],\n },\n [Op.UPDATE]: {\n purpose: 'Choose another agent for a connection.',\n outcome: 'The new agent answers from the next message on; conversations with the previous agent are not continued by the new one. The change is written to the audit trail.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The new choice is in force.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND, AGENT_NOT_DECLARED],\n idempotent: true,\n examples: [{ title: 'Switch Slack to another agent', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationChatSettingId: EXAMPLE_SETTING_ID, chatAgentRef: 'todos.helper' }, response: { ...settingExample, chatAgentRef: 'todos.helper' }, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.DELETE]: {\n purpose: 'Drop the organization\\'s choice for a connection.',\n outcome: 'The application\\'s default agent answers there again, if it declares one; otherwise nobody does, and a person who writes is told so. The removal is written to the audit trail.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The choice was removed.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Removes the organization\\'s chat settings with the organization (internal, route-less).',\n outcome: 'Nothing of the organization\\'s choice outlives it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'An organization chooses at most one agent per chat connection.',\n 'Only an agent the application declares, on a connection the application offers here, can be chosen.',\n 'Whoever answers, every turn runs as the linked member who wrote, with that member\\'s current authority in the organization: choosing an agent never widens what a member can do.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"organization-chat-settings.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/organization-chat-settings.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,mEAAmE,GACpE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACjE,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAEtD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,CAAI,IAAkB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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AO,EAAE,yFAAyF;YAClG,OAAO,EAAE,oDAAoD;YAC7D,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;YAClG,UAAU,EAAE,IAAI;SACjB;KACF;IACD,mBAAmB,EAAE;QACnB,gEAAgE;QAChE,qGAAqG;QACrG,kLAAkL;KACnL;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `organizationChatSettings` — Wildo SaaS engine specification (organization-scoped). #2665.\n *\n * Inputs:\n * - Schema: `OrganizationChatSettingSchema` (`inbound/organization-chat-settings.shared.schemas.ts`)\n * - Factory: `organizationChatSettingsResourceConfiguration_InitializationFactory`\n * (`inbound/organization-chat-settings.shared.resources-config.schemas.ts`)\n * - Write checks: `organization-chat-settings.custom-impl.backend.service.ts` (saas-backend-lib); the choice is resolved\n * by `ChatAgentsBackendService.resolve`.\n *\n * Why `ORGANIZATIONS` scope: the choice is the organization's, applies only to its own people, and is purged with it.\n * The registry relationship ORGANIZATIONS → organizationChatSettings carries `isPrimaryScope: true`.\n */\n\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n CoreResourceOperation as Op,\n OrganizationChatSettingSchema,\n ResourcePrimaryScope,\n organizationChatSettingsResourceConfiguration_InitializationFactory,\n} from '@wildo-ai/saas-models';\nimport { HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst EXAMPLE_ORGANIZATION_ID = 'org_01J4P8F1M2N3Q4R5S6T7V8W9XY';\nconst EXAMPLE_SETTING_ID = '66f6a1c2e3d4b5a697887901';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nconst page = <T>(data: readonly T[]) => ({ data, pagination: { page: 1, limit: 20, total: data.length, totalPages: data.length === 0 ? 0 : 1 } });\n\nconst settingExample = {\n _id: EXAMPLE_SETTING_ID,\n organizationId: EXAMPLE_ORGANIZATION_ID,\n connectionRef: 'slack',\n chatAgentRef: 'todos.assistant',\n createdAt: '2026-10-08T09:30:00.000Z',\n updatedAt: '2026-10-08T09:30:00.000Z',\n};\n\nconst NOT_AN_ADMINISTRATOR = { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not an administrator of the organization.' };\nconst NOT_FOUND = { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No chat setting with this id exists in the organization.' };\nconst AGENT_NOT_DECLARED = { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The agent is not one the application declares (`chat_agent_not_declared`); the refusal lists the agents it does declare.' };\n\nexport const organizationChatSettingsResourceSpecification = resourceSpecification(\n organizationChatSettingsResourceConfiguration_InitializationFactory,\n OrganizationChatSettingSchema,\n ({ schemaShape }) => ({\n purpose: 'Record which of the application\\'s chat agents answers the organization\\'s people on each chat connection (Slack, Microsoft Teams).',\n businessRole: 'The organization\\'s say over who answers its people in chat. An agent answers as the person who wrote, with that person\\'s authority, so choosing one decides which agent acts for the organization\\'s members from their chat tool.',\n lifecycleRole: 'Created when an administrator chooses an agent for a connection, changed when they choose another, removed when they drop the choice (the application\\'s default agent then answers on that connection, if it declares one). Purged with the organization.',\n audience: LabelAudience.ADMIN,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'OrganizationChatSettingSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'organizationChatSettingsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ORGANIZATION_CHAT_SETTINGS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'The agents an organization can choose are the ones the application declares on a backend module (`flowsActors.chatAgents`); the connections are the application\\'s providers enabled here with a chat endpoint the engine verifies. `/flows-actors/frontend-info` lists both, and a write naming anything else is refused.',\n 'Resolution, in order: the organization\\'s row for the connection → the agent the application declares `isDefault` → nobody (the person is told so). A row naming an agent the application no longer declares answers NOBODY rather than the default: the organization chose that agent, not the default.',\n 'One row per connection rather than one row holding a list, so each choice is its own audited write and the uniqueness of a connection is an index (organizationId + connectionRef).',\n 'Every write is HIGH risk and so leaves the framework\\'s own audit row, carrying the connection and the agent (`.isAuditEvidence()`).',\n ],\n },\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identifier of one chat setting.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the choice is for.', whyItMatters: 'The only organization it applies in: another organization on the same connection makes its own choice.', importance: FieldSemanticImportance.PRIMARY }),\n connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records. Shown by the vendor\\'s name (the PROVIDER vocabulary, `providers.<ref>.displayName`), the ref itself only while that name is missing.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n chatAgentRef: schemaShape.chatAgentRef.stringSpec({ meaning: 'The declared chat agent that answers the organization\\'s people on this connection.', whyItMatters: 'Decides which agent acts, as the member who wrote, on every message the organization\\'s people send the bot on this connection.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the organization first chose an agent for this connection.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the choice last changed.', temporalRole: 'modified' }),\n },\n operations: {\n [Op.READ]: {\n purpose: 'Read one chat setting of the organization.',\n outcome: 'The connection and the agent chosen for it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The setting is returned.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND],\n idempotent: true,\n examples: [{ title: 'Read the Slack choice', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationChatSettingId: EXAMPLE_SETTING_ID }, response: settingExample, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.LIST]: {\n purpose: 'List the organization\\'s chat settings: which agent answers on each connection it chose for.',\n outcome: 'A page of settings, by connection. A connection with no row is answered by the application\\'s default agent, if it declares one.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'A possibly empty page of settings.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR],\n idempotent: true,\n examples: [{ title: 'List the organization\\'s chat settings', request: { organizationId: EXAMPLE_ORGANIZATION_ID, sort: 'connectionRef:asc' }, response: page([settingExample]), forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.CREATE]: {\n purpose: 'Choose the agent that answers the organization\\'s people on a chat connection.',\n outcome: 'The agent answers there from the next message on, as the person who wrote. The choice is written to the audit trail.',\n importance: FieldSemanticImportance.PRIMARY,\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The choice is in force; it is returned.' }],\n errorScenarios: [\n NOT_AN_ADMINISTRATOR,\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The connection is not one the application offers here (`chat_connection_not_available`); the refusal lists the ones it does.' },\n AGENT_NOT_DECLARED,\n { code: HttpResponseStatusCode.CONFLICT_409, when: 'The organization already chose an agent for this connection: change that setting instead.' },\n ],\n idempotent: false,\n examples: [{ title: 'Choose the assistant for Slack', request: { organizationId: EXAMPLE_ORGANIZATION_ID, connectionRef: 'slack', chatAgentRef: 'todos.assistant' }, response: settingExample, forStatus: HttpResponseStatusCode.CREATED_201 }],\n },\n [Op.UPDATE]: {\n purpose: 'Choose another agent for a connection.',\n outcome: 'The new agent answers from the next message on; conversations with the previous agent are not continued by the new one. The change is written to the audit trail.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The new choice is in force.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND, AGENT_NOT_DECLARED],\n idempotent: true,\n examples: [{ title: 'Switch Slack to another agent', request: { organizationId: EXAMPLE_ORGANIZATION_ID, organizationChatSettingId: EXAMPLE_SETTING_ID, chatAgentRef: 'todos.helper' }, response: { ...settingExample, chatAgentRef: 'todos.helper' }, forStatus: HttpResponseStatusCode.OK_200 }],\n },\n [Op.DELETE]: {\n purpose: 'Drop the organization\\'s choice for a connection.',\n outcome: 'The application\\'s default agent answers there again, if it declares one; otherwise nobody does, and a person who writes is told so. The removal is written to the audit trail.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The choice was removed.' }],\n errorScenarios: [NOT_AN_ADMINISTRATOR, NOT_FOUND],\n idempotent: true,\n },\n [Op.DELETE_MANY]: {\n purpose: 'Removes the organization\\'s chat settings with the organization (internal, route-less).',\n outcome: 'Nothing of the organization\\'s choice outlives it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'Internal delete completed.' }],\n idempotent: true,\n },\n },\n businessConstraints: [\n 'An organization chooses at most one agent per chat connection.',\n 'Only an agent the application declares, on a connection the application offers here, can be chosen.',\n 'Whoever answers, every turn runs as the linked member who wrote, with that member\\'s current authority in the organization: choosing an agent never widens what a member can do.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
@@ -81,7 +81,7 @@ export const externalDataPipelineStatesResourceSpecification = resourceSpecifica
|
|
|
81
81
|
meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',
|
|
82
82
|
}),
|
|
83
83
|
incrementalTrack: schemaShape.incrementalTrack.objectSpec({
|
|
84
|
-
meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts, the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',
|
|
84
|
+
meaning: 'The incremental track of a pipeline that reads only what changed: which change-tracking mode it uses, the fingerprint of what it extracts with one digest per named part of it (so a reset can say which part moved), the largest remote position it has loaded (its watermark), and where an in-flight incremental pass continues. Empty for a pipeline that runs full passes only.',
|
|
85
85
|
whyItMatters: 'It is independent of the full pass\'s cursor, so a long full pass and frequent incremental passes never block each other; a changed fingerprint drops the watermark, so a declaration change reaches rows that did not change remotely.',
|
|
86
86
|
}),
|
|
87
87
|
sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({
|
|
@@ -101,7 +101,7 @@ export const externalDataPipelineStatesResourceSpecification = resourceSpecifica
|
|
|
101
101
|
meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',
|
|
102
102
|
}),
|
|
103
103
|
lastRunSummary: schemaShape.lastRunSummary.objectSpec({
|
|
104
|
-
meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over, whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',
|
|
104
|
+
meaning: 'What the most recent run did on the extraction side: which track it advanced (a full pass or an incremental one), whether it started the incremental track over and, when the declaration\'s basis changed, which parts of it moved (a partition assignment, the mapping, the owner and so on), whether it abandoned an in-flight full pass because the declaration changed under it, whether it completed its pass and reconciled absence, how many remote records it read, how many records the transform rejected, the load verdict, how long it took, which seeding-pass ledger record carries the per-entry load outcome, the remote partitions it did not load because no operator has assigned them to an organization unit (per partition key, with a row count), how many archived source records it left out of the load, and what pacing against the source\'s rate budget cost it: the time spent waiting for budget or for a throttling source, how many waits, and whether it stopped at its run deadline.',
|
|
105
105
|
whyItMatters: 'The per-entry load detail deliberately lives on the seeding ledger; this summary carries the numbers only the extraction and transform stages can know. The unassigned partitions are persisted because the operator who must assign them is rarely the one who triggered the run, and a pipeline silently not loading a subsidiary\'s rows must not list as healthy. The pacing numbers tell an operator whether a pass is progressing slower than its cadence because its rate-budget ceiling is low or its source is throttling it, rather than because it failed.',
|
|
106
106
|
importance: FieldSemanticImportance.PRIMARY,
|
|
107
107
|
}),
|