@wildo-ai/saas-specifications 1.1.13 → 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.
Files changed (117) hide show
  1. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
  2. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
  3. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
  4. package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
  5. package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
  6. package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
  7. package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
  8. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.d.ts.map +1 -1
  9. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js +28 -5
  10. package/dist/esm/_core/compliance-documents/computed-document-facts.schemas.js.map +1 -1
  11. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js +4 -1
  12. package/dist/esm/_core/compliance-documents/launch-blockers.schemas.js.map +1 -1
  13. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts +4 -0
  14. package/dist/esm/_core/compliance-documents/processor-register.schemas.d.ts.map +1 -1
  15. package/dist/esm/_core/compliance-documents/processor-register.schemas.js +10 -0
  16. package/dist/esm/_core/compliance-documents/processor-register.schemas.js.map +1 -1
  17. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
  18. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
  19. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
  20. package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
  21. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
  22. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
  23. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
  24. package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
  25. package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
  26. package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
  27. package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
  28. package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
  29. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
  30. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
  31. package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
  32. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
  33. package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
  34. package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
  35. package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
  36. package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
  37. package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
  38. package/dist/esm/_core/provider-specification.schemas.js +21 -0
  39. package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
  40. package/dist/esm/application-creation.exports.d.ts +1 -0
  41. package/dist/esm/application-creation.exports.d.ts.map +1 -1
  42. package/dist/esm/application-creation.exports.js +1 -0
  43. package/dist/esm/application-creation.exports.js.map +1 -1
  44. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
  45. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +5 -3
  46. package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
  47. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.d.ts.map +1 -1
  48. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js +2 -1
  49. package/dist/esm/engine/auth/resources/application-access-grants.resource.specification.js.map +1 -1
  50. package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.d.ts.map +1 -1
  51. package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js +6 -2
  52. package/dist/esm/engine/compliance/resources/data-subject-requests.resource.specification.js.map +1 -1
  53. package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.d.ts.map +1 -1
  54. package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js +6 -5
  55. package/dist/esm/engine/compliance/resources/siem-delivery-dlq.resource.specification.js.map +1 -1
  56. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
  57. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
  58. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +22 -2
  59. package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
  60. package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
  61. package/dist/esm/engine/engine-resource-specifications.registry.js +2 -0
  62. package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
  63. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
  64. package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
  65. package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
  66. package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
  67. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
  68. package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
  69. package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts +9 -0
  70. package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.d.ts.map +1 -0
  71. package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js +136 -0
  72. package/dist/esm/engine/infrastructure/resources/queue-messages.resource.specification.js.map +1 -0
  73. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.d.ts.map +1 -1
  74. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js +4 -2
  75. package/dist/esm/engine/notifications/resources/inbound-email.resource.specification.js.map +1 -1
  76. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.d.ts.map +1 -1
  77. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js +6 -5
  78. package/dist/esm/engine/notifications/resources/m2m-webhook-delivery-log.resource.specification.js.map +1 -1
  79. package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.d.ts.map +1 -1
  80. package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js +2 -1
  81. package/dist/esm/engine/organizations/resources/organization-custom-domains.resource.specification.js.map +1 -1
  82. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.d.ts.map +1 -1
  83. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js +10 -7
  84. package/dist/esm/engine/organizations/resources/organization-members.resource.specification.js.map +1 -1
  85. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
  86. package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
  87. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts +1 -0
  88. package/dist/esm/engine/organizations/resources/organizations.resource.specification.d.ts.map +1 -1
  89. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js +7 -7
  90. package/dist/esm/engine/organizations/resources/organizations.resource.specification.js.map +1 -1
  91. package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
  92. package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
  93. package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
  94. package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
  95. package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
  96. package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
  97. package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
  98. package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
  99. package/dist/esm/engine/providers/index.d.ts +3 -1
  100. package/dist/esm/engine/providers/index.d.ts.map +1 -1
  101. package/dist/esm/engine/providers/index.js +5 -2
  102. package/dist/esm/engine/providers/index.js.map +1 -1
  103. package/dist/esm/engine/users/resources/inbound-contacts.resource.specification.d.ts +2 -2
  104. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
  105. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
  106. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
  107. package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
  108. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
  109. package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
  110. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
  111. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
  112. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
  113. package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
  114. package/dist/esm/engine/users/resources/users.resource.specification.js +1 -1
  115. package/dist/esm/engine/users/resources/users.resource.specification.js.map +1 -1
  116. package/dist/tsconfig.build.tsbuildinfo +1 -1
  117. package/package.json +9 -9
@@ -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,uBAA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F,CAAC;IACF,kFAAkF;IAClF,oFAAoF;IACpF,kFAAkF;IAClF,8CAA8C;IAC9C,EAAE,oBAAoB,EAAE,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,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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,kCAAkC,CAAC,YAAY,CAAC,EAAE,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,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 → `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"]}
@@ -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;IAC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AE,EAAE,SAAS,EAAE,sBAAsB,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,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,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. 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
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"external-data-pipeline-states.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/infrastructure/resources/external-data-pipeline-states.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,+BAA+B,EAC/B,mCAAmC,EACnC,oEAAoE,IAAI,uBAAuB,GAChG,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,+CAA+C,GAAmC,qBAAqB,CAClH,uBAAuB,EACvB,+BAA+B,EAC/B,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,EAAE,oMAAoM;IAC7M,YAAY,EAAE,oMAAoM;IAClN,aAAa,EAAE,oKAAoK;IACnL,QAAQ,EAAE,aAAa,CAAC,SAAS;IACjC,SAAS,EAAE,uBAAuB,CAAC,cAAc;IACjD,YAAY,EAAE;QACZ,UAAU,EAAE;YACV,WAA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ChB,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,gDAAgD,EAAE;aACnG;YACD,cAAc,EAAE;gBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,uGAAuG,EAAE;aAC9J;YACD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE;gBACR,CAAC,mCAAmC,CAAC,QAAQ,CAAC,EAAE;oBAC9C,OAAO,EAAE,+EAA+E;iBACzF;aACF;SACF;KACF;IAED,mBAAmB,EAAE;QACnB,8IAA8I;QAC9I,sKAAsK;QACtK,gUAAgU;QAChU,+IAA+I;QAC/I,8NAA8N;KAC/N;CACF,CAAC;AACF,+FAA+F;AAC/F,0FAA0F;AAC1F,gEAAgE;AAChE,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,WAAW,EAAE,CAC3D,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 ExternalDataPipelineStateSchema,\n ExternalDataPipelineStateVariantKey,\n externalDataPipelineStateResourceConfiguration_InitializationFactory as etlPipelineStateFactory,\n} from '@wildo-ai/saas-backend-lib/external-data-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `etlPipelineStates` resource — one bookkeeping\n * row per declared ETL pipeline (a local resource's `externalDataPipeline`), holding the persisted\n * extraction cursor and the last run's summary.\n *\n * Like `dataSeedRuns`, this is infrastructure truth rather than an end-user surface: its\n * semantic layer is operational (where is the in-flight pass, what did the last run do), and its\n * only writer is the ETL run service. There is no human-facing surface yet — the operator read\n * surface is the recorded PR-28 follow-up.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` (a\n * `BackendResourceType` sourced from `@wildo-ai/saas-backend-lib`, outside the CORE-registry\n * alignment guard's population; the explicit `AnyResourceSpecificationConfig` annotation avoids\n * the non-portable-path TS2742) — see that spec's header for the full reasoning rather than a\n * re-derivation here.\n */\nexport const externalDataPipelineStatesResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n etlPipelineStateFactory,\n ExternalDataPipelineStateSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one declared ETL pipeline between runs: where the current full extraction pass stands, where its incremental track stands when it reads only what changed, and what the most recent run did.',\n businessRole: 'Operational control-plane row that lets a pipeline whose remote population exceeds one run\\'s budget continue across runs and process restarts instead of re-reading the same first pages forever.',\n lifecycleRole: 'Created on the pipeline\\'s first run and updated at the end of every run; the cursor fills while a pass is in flight across runs and clears when a pass completes.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.INFRASTRUCTURE,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'ExternalDataPipelineStateSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'externalDataPipelineStateResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'EXTERNAL_DATA_PIPELINE_STATE',\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 },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of this pipeline\\'s bookkeeping record.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n pipelineResourceType: schemaShape.pipelineResourceType.stringSpec({\n meaning: 'The destination resource whose declared pipeline this record tracks. One pipeline, one record.',\n whyItMatters: 'It is the row\\'s identity: every run of the same pipeline reads and updates this same row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n cursor: schemaShape.cursor.stringSpec({\n meaning: 'Last accepted source continuation. Empty at the beginning, including a retry of a failed first batch.',\n whyItMatters: 'It advances with the accepted source-membership head only after a successful load, allowing restart without losing earlier source identities.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n passCheckpoint: schemaShape.passCheckpoint.objectSpec({\n meaning: 'Unique active pass and accepted immutable source-membership head, checkpointed together with the extraction cursor, and the fingerprint of the declaration the pass started under.',\n whyItMatters: 'A run under a different declaration fingerprint abandons the pass and starts a new one, so one pass never mixes two declarations: a changed key would otherwise orphan every row read before it, and a narrower filter would leave the rows it now excludes in place.',\n }),\n\n passStartedAt: schemaShape.passStartedAt.dateSpec({\n meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',\n }),\n\n incrementalTrack: schemaShape.incrementalTrack.objectSpec({\n 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.',\n 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.',\n }),\n\n sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({\n meaning: 'The current streak of failures to reach the pipeline\\'s system of record: when the first failure happened, how many consecutive attempts failed, how many scheduled runs were skipped while backing off, why the last attempt failed (a timeout, a network failure, an unavailable status, an unreachable token endpoint) and when the next scheduled attempt is due. Empty while the system of record is reachable.',\n whyItMatters: 'It lets scheduled runs back off from a source that is down instead of failing identically on every tick, across restarts, and it is what an operator reads to tell an address pointed at nothing from an outage in progress. The first run that reaches the source clears it; a run started by an operator never waits for it.',\n }),\n\n suppressionIdentity: schemaShape.suppressionIdentity.stringSpec({\n meaning: 'The source identity — system of record, remote entity and key shape — the pipeline last matched erasure suppressions under. Written by the first run that passes the suppression check under a new identity, or by the reconcile door. Empty until the pipeline first runs.',\n whyItMatters: 'Erasure suppressions belong to the remote entity, and any pipeline reading it may have recorded them. When the declaration moves the pipeline to another identity, this is what finds the suppressions it still owes, including ones another pipeline recorded, so the run refuses instead of copying erased people back in.',\n }),\n\n suppressionIdentityDecisions: schemaShape.suppressionIdentityDecisions.arraySpec({\n meaning: 'This pipeline\\'s decisions about the source identities it no longer has: for each one, whether it keeps matching the suppressions filed under it (carry-over) or stopped matching them (release), and when. Made through the audited reconcile door.',\n elementMeaning: 'One decision: the stale identity it is about, carry-over or release, and when the operator made it.',\n whyItMatters: 'The decision belongs to this pipeline alone; nothing is moved or re-keyed, so another pipeline on the same entity keeps its own suppressions and must decide for itself. A carried-over identity is loaded beside the current one on every run. Matching an identity again voids the decision about it, so a later move asks again. A decision is final otherwise: a release cannot be undone, only the erasure run again.',\n }),\n\n lastRunAt: schemaShape.lastRunAt.dateSpec({\n meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',\n }),\n\n lastRunSummary: schemaShape.lastRunSummary.objectSpec({\n 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.',\n 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.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the bookkeeping row the first time a pipeline runs.',\n outcome: 'The pipeline has a durable place to persist its cursor and run summaries.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The record was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The row fails schema validation.' },\n ],\n idempotent: false,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the ETL run service open its own bookkeeping row. There is no externally reachable way to create one.',\n },\n },\n },\n\n [Op.READ]: {\n purpose: 'Read one pipeline\\'s bookkeeping row.',\n outcome: 'The run service learns whether a pass is in flight and where to resume it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was found and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the pipeline — it has never run.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service recover the cursor at the start of every run.',\n },\n },\n },\n\n [Op.UPDATE]: {\n purpose: 'Persist the run\\'s outcome: the advanced or cleared cursor and the fresh summary.',\n outcome: 'The next run continues exactly where this one stopped, or starts a fresh pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the supplied identifier.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patch fails schema validation.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service settle each run\\'s cursor and summary.',\n },\n },\n },\n\n [Op.LIST]: {\n purpose: 'Enumerate every pipeline\\'s bookkeeping row.',\n outcome: 'The scheduled batch and future operator surfaces see all pipelines\\' standing at once.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of bookkeeping records, possibly empty.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform administrator. This row set is never exposed to ordinary tenant callers.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let engine machinery enumerate pipeline standing without an external surface.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'This row is bookkeeping about a pipeline, never the pipeline\\'s data: deleting it costs a restarted extraction pass, not any synced content.',\n 'A non-empty cursor means an extraction pass is still in flight, and a run resuming from it must not treat rows absent from a partial extraction as deleted remotely.',\n 'Only a full pass may conclude a remote row was deleted. An incremental pass reads what changed, and a deletion is not a change, so it never reconciles absence; while a full pass is in flight, the keys an incremental pass reads join that full pass\\'s membership so they are not mistaken for deletions when it completes.',\n 'The per-entry load outcome lives on the seeding-pass ledger this summary points at; the two records deliberately do not duplicate each other.',\n 'Only a failure to reach the system of record starts or extends an unreachable streak; a refusal, a malformed answer or a run stopped at its deadline never does, and a failed attempt leaves the last-run summary untouched.',\n ],\n }),\n // Same posture as DATA_SEED_RUN: a STANDALONE infrastructure row reached only through internal\n // repository services; the APPLICATION relationship is routing-side only, so the scope is\n // declared here rather than derived from a scope-owning parent.\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
1
+ {"version":3,"file":"external-data-pipeline-states.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,G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cesContent":["import { LabelAudience } from '@wildo-ai/presets-components-models';\nimport {\n CodeDeclarationKind,\n CodeSymbolKind,\n FieldSemanticImportance,\n} from '@wildo-ai/zod-decorators';\nimport {\n ExternalDataPipelineStateSchema,\n ExternalDataPipelineStateVariantKey,\n externalDataPipelineStateResourceConfiguration_InitializationFactory as etlPipelineStateFactory,\n} from '@wildo-ai/saas-backend-lib/external-data-models';\nimport { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\n/**\n * Framework-owned specification for the internal `etlPipelineStates` resource — one bookkeeping\n * row per declared ETL pipeline (a local resource's `externalDataPipeline`), holding the persisted\n * extraction cursor and the last run's summary.\n *\n * Like `dataSeedRuns`, this is infrastructure truth rather than an end-user surface: its\n * semantic layer is operational (where is the in-flight pass, what did the last run do), and its\n * only writer is the ETL run service. There is no human-facing surface yet — the operator read\n * surface is the recorded PR-28 follow-up.\n *\n * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` (a\n * `BackendResourceType` sourced from `@wildo-ai/saas-backend-lib`, outside the CORE-registry\n * alignment guard's population; the explicit `AnyResourceSpecificationConfig` annotation avoids\n * the non-portable-path TS2742) — see that spec's header for the full reasoning rather than a\n * re-derivation here.\n */\nexport const externalDataPipelineStatesResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n etlPipelineStateFactory,\n ExternalDataPipelineStateSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one declared ETL pipeline between runs: where the current full extraction pass stands, where its incremental track stands when it reads only what changed, and what the most recent run did.',\n businessRole: 'Operational control-plane row that lets a pipeline whose remote population exceeds one run\\'s budget continue across runs and process restarts instead of re-reading the same first pages forever.',\n lifecycleRole: 'Created on the pipeline\\'s first run and updated at the end of every run; the cursor fills while a pass is in flight across runs and clears when a pass completes.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.INFRASTRUCTURE,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'ExternalDataPipelineStateSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactory: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'externalDataPipelineStateResourceConfiguration_InitializationFactory',\n symbolKind: CodeSymbolKind.FACTORY,\n declarationKind: CodeDeclarationKind.FUNCTION,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-backend-lib',\n exportName: 'BackendResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: 'EXTERNAL_DATA_PIPELINE_STATE',\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 },\n\n fields: {\n _id: schemaShape._id.stringSpec({\n meaning: 'Stable identifier of this pipeline\\'s bookkeeping record.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n pipelineResourceType: schemaShape.pipelineResourceType.stringSpec({\n meaning: 'The destination resource whose declared pipeline this record tracks. One pipeline, one record.',\n whyItMatters: 'It is the row\\'s identity: every run of the same pipeline reads and updates this same row.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n cursor: schemaShape.cursor.stringSpec({\n meaning: 'Last accepted source continuation. Empty at the beginning, including a retry of a failed first batch.',\n whyItMatters: 'It advances with the accepted source-membership head only after a successful load, allowing restart without losing earlier source identities.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n passCheckpoint: schemaShape.passCheckpoint.objectSpec({\n meaning: 'Unique active pass and accepted immutable source-membership head, checkpointed together with the extraction cursor, and the fingerprint of the declaration the pass started under.',\n whyItMatters: 'A run under a different declaration fingerprint abandons the pass and starts a new one, so one pass never mixes two declarations: a changed key would otherwise orphan every row read before it, and a narrower filter would leave the rows it now excludes in place.',\n }),\n\n passStartedAt: schemaShape.passStartedAt.dateSpec({\n meaning: 'When the in-flight extraction pass began. Empty when no pass is underway.',\n }),\n\n incrementalTrack: schemaShape.incrementalTrack.objectSpec({\n 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.',\n 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.',\n }),\n\n sourceUnreachable: schemaShape.sourceUnreachable.objectSpec({\n meaning: 'The current streak of failures to reach the pipeline\\'s system of record: when the first failure happened, how many consecutive attempts failed, how many scheduled runs were skipped while backing off, why the last attempt failed (a timeout, a network failure, an unavailable status, an unreachable token endpoint) and when the next scheduled attempt is due. Empty while the system of record is reachable.',\n whyItMatters: 'It lets scheduled runs back off from a source that is down instead of failing identically on every tick, across restarts, and it is what an operator reads to tell an address pointed at nothing from an outage in progress. The first run that reaches the source clears it; a run started by an operator never waits for it.',\n }),\n\n suppressionIdentity: schemaShape.suppressionIdentity.stringSpec({\n meaning: 'The source identity — system of record, remote entity and key shape — the pipeline last matched erasure suppressions under. Written by the first run that passes the suppression check under a new identity, or by the reconcile door. Empty until the pipeline first runs.',\n whyItMatters: 'Erasure suppressions belong to the remote entity, and any pipeline reading it may have recorded them. When the declaration moves the pipeline to another identity, this is what finds the suppressions it still owes, including ones another pipeline recorded, so the run refuses instead of copying erased people back in.',\n }),\n\n suppressionIdentityDecisions: schemaShape.suppressionIdentityDecisions.arraySpec({\n meaning: 'This pipeline\\'s decisions about the source identities it no longer has: for each one, whether it keeps matching the suppressions filed under it (carry-over) or stopped matching them (release), and when. Made through the audited reconcile door.',\n elementMeaning: 'One decision: the stale identity it is about, carry-over or release, and when the operator made it.',\n whyItMatters: 'The decision belongs to this pipeline alone; nothing is moved or re-keyed, so another pipeline on the same entity keeps its own suppressions and must decide for itself. A carried-over identity is loaded beside the current one on every run. Matching an identity again voids the decision about it, so a later move asks again. A decision is final otherwise: a release cannot be undone, only the erasure run again.',\n }),\n\n lastRunAt: schemaShape.lastRunAt.dateSpec({\n meaning: 'When the most recent run started, whatever its outcome. Empty until the pipeline first runs.',\n }),\n\n lastRunSummary: schemaShape.lastRunSummary.objectSpec({\n 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.',\n 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.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the bookkeeping row the first time a pipeline runs.',\n outcome: 'The pipeline has a durable place to persist its cursor and run summaries.',\n responseStatuses: [\n { code: HttpResponseStatusCode.CREATED_201, meaning: 'The record was created and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The row fails schema validation.' },\n ],\n idempotent: false,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the ETL run service open its own bookkeeping row. There is no externally reachable way to create one.',\n },\n },\n },\n\n [Op.READ]: {\n purpose: 'Read one pipeline\\'s bookkeeping row.',\n outcome: 'The run service learns whether a pass is in flight and where to resume it.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was found and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the pipeline — it has never run.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service recover the cursor at the start of every run.',\n },\n },\n },\n\n [Op.UPDATE]: {\n purpose: 'Persist the run\\'s outcome: the advanced or cleared cursor and the fresh summary.',\n outcome: 'The next run continues exactly where this one stopped, or starts a fresh pass.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The record was updated and is returned.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No row exists for the supplied identifier.' },\n { code: HttpResponseStatusCode.BAD_REQUEST_400, when: 'The patch fails schema validation.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let the run service settle each run\\'s cursor and summary.',\n },\n },\n },\n\n [Op.LIST]: {\n purpose: 'Enumerate every pipeline\\'s bookkeeping row.',\n outcome: 'The scheduled batch and future operator surfaces see all pipelines\\' standing at once.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'A page of bookkeeping records, possibly empty.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not a platform administrator. This row set is never exposed to ordinary tenant callers.' },\n ],\n idempotent: true,\n variants: {\n [ExternalDataPipelineStateVariantKey.INTERNAL]: {\n purpose: 'Let engine machinery enumerate pipeline standing without an external surface.',\n },\n },\n },\n },\n\n businessConstraints: [\n 'This row is bookkeeping about a pipeline, never the pipeline\\'s data: deleting it costs a restarted extraction pass, not any synced content.',\n 'A non-empty cursor means an extraction pass is still in flight, and a run resuming from it must not treat rows absent from a partial extraction as deleted remotely.',\n 'Only a full pass may conclude a remote row was deleted. An incremental pass reads what changed, and a deletion is not a change, so it never reconciles absence; while a full pass is in flight, the keys an incremental pass reads join that full pass\\'s membership so they are not mistaken for deletions when it completes.',\n 'The per-entry load outcome lives on the seeding-pass ledger this summary points at; the two records deliberately do not duplicate each other.',\n 'Only a failure to reach the system of record starts or extends an unreachable streak; a refusal, a malformed answer or a run stopped at its deadline never does, and a failed attempt leaves the last-run summary untouched.',\n ],\n }),\n // Same posture as DATA_SEED_RUN: a STANDALONE infrastructure row reached only through internal\n // repository services; the APPLICATION relationship is routing-side only, so the scope is\n // declared here rather than derived from a scope-owning parent.\n { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION },\n);\n"]}
@@ -0,0 +1,9 @@
1
+ import { type AnyResourceSpecificationConfig } from '../../../_core';
2
+ /**
3
+ * Framework-owned specification for the internal `queueMessages` resource: the messages the DATABASE queue adapter holds
4
+ * for a deployment that runs no broker (#2303).
5
+ *
6
+ * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` — see that spec's header.
7
+ */
8
+ export declare const queueMessagesResourceSpecification: AnyResourceSpecificationConfig;
9
+ //# sourceMappingURL=queue-messages.resource.specification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-messages.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/infrastructure/resources/queue-messages.resource.specification.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAGjI;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,EAAE,8BAkIhD,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { LabelAudience } from '@wildo-ai/presets-components-models';
2
+ import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
3
+ import { QueueMessageSchema, QueueMessagesVariantKey, queueMessagesResourceConfigurationFactory as queueMessagesFactory, } from '@wildo-ai/saas-backend-lib/backend-resource-registry';
4
+ import { CoreResourceOperation as Op, ResourcePrimaryScope } from '@wildo-ai/saas-models';
5
+ import { HttpResponseStatusCode, resourceSpecification } from '../../../_core/index.js';
6
+ import { EngineResourceSubDomain } from '../../engine-resource-sub-domain.js';
7
+ /**
8
+ * Framework-owned specification for the internal `queueMessages` resource: the messages the DATABASE queue adapter holds
9
+ * for a deployment that runs no broker (#2303).
10
+ *
11
+ * Registry-key and type-annotation notes: identical situation to `dataSeedRuns` — see that spec's header.
12
+ */
13
+ export const queueMessagesResourceSpecification = resourceSpecification(queueMessagesFactory, QueueMessageSchema, ({ schemaShape }) => ({
14
+ purpose: 'Hold the background work and job results an application\'s processes hand each other when the application runs without a message broker.',
15
+ businessRole: 'Lets a small deployment run its scheduled jobs, workers and minions on its own database alone, with the delivery the broker adapter gives: each message reaches one consumer, a message whose handler fails is dead-lettered when its queue declares a dead-letter queue, and a process that stops gives back what it held.',
16
+ lifecycleRole: 'Written when work is queued, leased by one consumer at a time, and deleted once that consumer settles it. A rejected message moves to its queue\'s dead-letter queue when one is declared, and is deleted otherwise.',
17
+ audience: LabelAudience.DEVELOPER,
18
+ subDomain: EngineResourceSubDomain.INFRASTRUCTURE,
19
+ codeHandling: {
20
+ mainSchema: {
21
+ packageName: '@wildo-ai/saas-backend-lib',
22
+ exportName: 'QueueMessageSchema',
23
+ symbolKind: CodeSymbolKind.SCHEMA,
24
+ declarationKind: CodeDeclarationKind.ZOD_SCHEMA,
25
+ },
26
+ resourceFactory: {
27
+ packageName: '@wildo-ai/saas-backend-lib',
28
+ exportName: 'queueMessagesResourceConfigurationFactory',
29
+ symbolKind: CodeSymbolKind.FACTORY,
30
+ declarationKind: CodeDeclarationKind.FUNCTION,
31
+ },
32
+ resourceType: {
33
+ enumDeclaration: {
34
+ packageName: '@wildo-ai/saas-backend-lib',
35
+ exportName: 'BackendResourceType',
36
+ symbolKind: CodeSymbolKind.ENUM,
37
+ declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
38
+ },
39
+ memberName: 'QUEUE_MESSAGES',
40
+ },
41
+ operationVocabulary: {
42
+ coreEnum: {
43
+ packageName: '@wildo-ai/saas-models',
44
+ exportName: 'CoreResourceOperation',
45
+ symbolKind: CodeSymbolKind.ENUM,
46
+ declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,
47
+ },
48
+ },
49
+ },
50
+ fields: {
51
+ _id: schemaShape._id.stringSpec({
52
+ meaning: 'The message\'s identifier, random at publication.',
53
+ whyItMatters: 'A consumer leases, settles and dead-letters the message by it.',
54
+ semanticRole: 'identifier',
55
+ importance: FieldSemanticImportance.PRIMARY,
56
+ }),
57
+ queueName: schemaShape.queueName.stringSpec({
58
+ meaning: 'The queue the message is on.',
59
+ whyItMatters: 'A consumer reads only its own queue; a dead-lettered message moves to its queue\'s dead-letter queue.',
60
+ }),
61
+ content: schemaShape.content.stringSpec({
62
+ meaning: 'The message body as its publisher serialized it: a job to run, or a job\'s result.',
63
+ whyItMatters: 'A job carries what the operation that queued it carries, so it is classified as that content would be, and it is deleted once the job is settled.',
64
+ }),
65
+ correlationId: schemaShape.correlationId.stringSpec({ meaning: 'The publisher\'s correlation id, carried to the consumer; a job result is matched to its job by it.' }),
66
+ replyTo: schemaShape.replyTo.stringSpec({ meaning: 'The queue a job\'s result is to be published to.' }),
67
+ visibleAt: schemaShape.visibleAt.dateSpec({
68
+ meaning: 'From when the message may be delivered: its publication, the end of its retry delay, or the end of the lease of the consumer holding it.',
69
+ whyItMatters: 'Leasing moves it past now in the same write that records the lease, so two consumers never hold one message, and a consumer that stops releases it when its lease ends.',
70
+ }),
71
+ leaseToken: schemaShape.leaseToken.stringSpec({
72
+ meaning: 'The lease of the consumer currently holding the message; absent while it waits.',
73
+ whyItMatters: 'Settling requires the lease that delivered the message, so a consumer whose lease ran out settles nothing another consumer now holds.',
74
+ }),
75
+ deliveryCount: schemaShape.deliveryCount.numberSpec({
76
+ meaning: 'How many times the message was delivered.',
77
+ whyItMatters: 'A delivery after the first is reported to the consumer as a redelivery.',
78
+ }),
79
+ writtenAt: schemaShape.writtenAt.dateSpec({
80
+ meaning: 'When the message was first published.',
81
+ whyItMatters: 'A message put back for retry keeps it, so it is delivered before messages published after it.',
82
+ }),
83
+ expiresAt: schemaShape.expiresAt.dateSpec({
84
+ meaning: 'When the message is deleted unread: 14 days after it was dead-lettered, or a day after a reply was published; absent on live work.',
85
+ whyItMatters: 'Bounds what a parked message keeps, as the broker bounds its dead-letter queues, so no copy of a job outlives the month an erasure is answered in.',
86
+ }),
87
+ },
88
+ operations: {
89
+ [Op.CREATE]: {
90
+ purpose: 'Queue one message.',
91
+ outcome: 'The message waits on its queue until a consumer leases it.',
92
+ responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The message was written.' }],
93
+ errorScenarios: [],
94
+ idempotent: false,
95
+ variants: {
96
+ [QueueMessagesVariantKey.INTERNAL]: { purpose: 'Let the database queue adapter publish a message.' },
97
+ },
98
+ },
99
+ [Op.READ]: {
100
+ purpose: 'Read one queued message.',
101
+ outcome: 'The message is returned as stored.',
102
+ responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The message is returned, or nothing when it was already settled.' }],
103
+ errorScenarios: [],
104
+ idempotent: true,
105
+ variants: {
106
+ [QueueMessagesVariantKey.INTERNAL]: { purpose: 'Let the framework read one queued message.' },
107
+ },
108
+ },
109
+ [Op.LIST]: {
110
+ purpose: 'List the messages of a queue a consumer may lease now, oldest first.',
111
+ outcome: 'The consumer leases the first of them no other consumer took.',
112
+ responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The visible messages are returned.' }],
113
+ errorScenarios: [],
114
+ idempotent: true,
115
+ variants: {
116
+ [QueueMessagesVariantKey.INTERNAL]: { purpose: 'Let a consumer find work to lease.' },
117
+ },
118
+ },
119
+ [Op.DELETE_MANY]: {
120
+ purpose: 'Delete a message its consumer settled, under the lease that delivered it.',
121
+ outcome: 'The message is gone; a consumer whose lease ran out deletes nothing.',
122
+ responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The message was deleted, or another consumer holds it now.' }],
123
+ idempotent: true,
124
+ variants: {
125
+ [QueueMessagesVariantKey.INTERNAL]: { purpose: 'Let a consumer settle what it handled.' },
126
+ },
127
+ },
128
+ },
129
+ businessConstraints: [
130
+ 'A message is held by one consumer at a time: its lease is taken by compare-and-swap, never by a read followed by a write.',
131
+ 'A consumer settles a message only under the lease that delivered it.',
132
+ 'Delivery is at least once, as on a broker: a consumer that stops, or whose settlement is lost, has its message delivered again when its lease ends.',
133
+ 'Every message names the application it belongs to, and the adapter reads and writes only its own application\'s messages.',
134
+ ],
135
+ }), { resourcePrimaryScope: ResourcePrimaryScope.APPLICATION });
136
+ //# sourceMappingURL=queue-messages.resource.specification.js.map