@wildo-ai/saas-specifications 1.1.14 → 1.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
- package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.js +21 -0
- package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +1 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +1 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +18 -8
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +9 -2
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +8 -4
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +29 -6
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +4 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js +4 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js +3 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js +98 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js +132 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts +8 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js +65 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +3 -1
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +3 -1
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -2
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-system-executions.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-system-executions.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,gCAAgC,EAChC,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,gEAAgE,IAAI,4BAA4B,GACjG,MAAM,uBAAuB,CAAC;AAC/B,O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ACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,wDAAwD;YACjE,OAAO,EAAE,+CAA+C;YACxD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;SAChG;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,wEAAwE;YACjF,OAAO,EAAE,kDAAkD;YAC3D,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;SACvF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,0EAA0E;YACnF,OAAO,EAAE,6CAA6C;YACtD,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,8IAA8I;QAC9I,4GAA4G;QAC5G,8DAA8D;QAC9D,mIAAmI;KACpI;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `actorSystemExecutions` — Wildo SaaS engine specification (organization-scoped storage, engine-written). #2539.\n *\n * Inputs:\n * - Schema: `ActorSystemExecutionRecordSchema` (`flows-actors/actor-plane-rows.shared.schemas.ts`)\n * - Factory: `actorSystemExecutionsResourceConfiguration_InitializationFactory`\n * - Writer: `ApplicationActorExecutionPersistence`, the application's binding of `ActorExecutionPersistencePort`.\n * - Readers: the actor runtime (`ActorsSystemBackendService`) and the decision inbox's actor-system host.\n *\n * Why the structured state is serialized beside filterable columns, and why the rows are organization-scoped rather\n * than polymorphic, is the schema file's header; it is not restated here.\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n ActorSystemExecutionRecordSchema,\n CoreResourceOperation as Op,\n FlowsActors_Status,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n ResourcePrimaryScope,\n actorSystemExecutionsResourceConfiguration_InitializationFactory as actorSystemExecutionsFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\n/** The run-status vocabulary, worded for an actor run (the conversational family words it for a turn). */\nexport const actorRunStatusValues = {\n [FlowsActors_Status.READY]: { meaning: 'Created and not yet started. Not written by the actor runtime today.' },\n [FlowsActors_Status.PENDING]: { meaning: 'Selected but not started: the host opened the run deferred and starts it once it can begin.' },\n [FlowsActors_Status.PROCESSING]: { meaning: 'Running: the host is executing the work, or continuing it after an answer.' },\n [FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Waiting on a person: the run asked a question and stands until it is answered or withdrawn. Non-terminal.' },\n [FlowsActors_Status.COMPLETED]: { meaning: 'Finished: the work reached its own conclusion.' },\n [FlowsActors_Status.FAILED]: { meaning: 'Finished unsuccessfully: the work threw, or its host concluded it failed.' },\n [FlowsActors_Status.CANCELLED]: { meaning: 'Withdrawn by a person while it waited on a question; nothing was continued.' },\n [FlowsActors_Status.ABORTED]: { meaning: 'Stopped by the system rather than by a person: its admission was refused, or the person it asked on behalf of lost their authority while the question waited (or was erased), so no answer could be carried out. A run whose process went away while it ran is ABORTED too, once its liveness lease lapses (or put back on the question it was continuing).' },\n};\n\nexport const actorSystemExecutionsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n actorSystemExecutionsFactory,\n ActorSystemExecutionRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record each run of an actor system an application performs for an organization: where it stands and, while it waits on a person, the question it asked and what its resume needs.',\n businessRole: 'What lets an application\\'s own actor run stop to ask a person — a review of the actor\\'s work, or a question it cannot answer alone — and continue under the same identity once that person answers from the decision inbox.',\n lifecycleRole: 'Opened by the actor runtime when a run starts, moved on every status change by the engine\\'s persistence, and deleted with its organization.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ActorSystemExecutionRecordSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'actorSystemExecutionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ACTOR_SYSTEM_EXECUTIONS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'Every operation is route-less: CREATE, READ, LIST and UPDATE are REPOSITORY_ONLY and DELETE is INTERNAL_CALL (the tenant purge\\'s composition cascade). The roles are never exercised by a request.',\n 'The move out of waiting is a guarded repository mutation matching status, suspension id and route version in one statement (#1586), never a read followed by a write.',\n 'The purge\\'s cascade ends a question a waiting run holds before it deletes the run (#2680): the same guarded move, inside the purge\\'s transaction, withdrawn by nobody, with the resolved record and the holders\\' notice after the commit and no agent-work record.',\n 'The platform keeps its own copy of this plane (`wildoApplicationActorSystemExecutions`) for the runs that build an application; these rows are the runs an application performs.',\n 'A person\\'s erasure reaches these rows through the engine\\'s subject-reference severer, not the erasure graph (no USERS edge): inside the erasure\\'s transaction it ends a question they raised (REQUESTER_AUTHORITY_LAPSED, nobody deciding), gives a question assigned to them back to its role, and removes their id from the history, from an owed review record and from `namedUserIds`. The run stays; a run under a legal hold is left as it is (#2630).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of the run. The actor runtime names the run by it everywhere: its tasks, its question, its resume.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization the run works for.',\n whyItMatters: 'Its questions are routed to reviewers in this organization, and the run is deleted with it. A run with no organization is refused rather than given a guessed one.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n systemRef: schemaShape.systemRef.stringSpec({ meaning: 'The registered actor system this is a run of.', whyItMatters: 'It selects the continuation that resumes the run once its question is answered.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the run stands.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('FlowsActors_Status'),\n values: actorRunStatusValues,\n }),\n statusChanges: schemaShape.statusChanges.arraySpec({\n meaning: 'The run\\'s history, oldest first.',\n elementMeaning: 'One move: the status the run entered and when; on a move out of waiting, also the decision it settled, how it ended, who decided and when, written in the same statement as the move.',\n }),\n exclusiveSubject: schemaShape.exclusiveSubject.stringSpec({\n meaning: 'What the run holds exclusively while it is running, when its host opened it that way.',\n whyItMatters: 'Another run of the same system on the same subject is refused while this one is pending or running. A waiting run does not hold it.',\n semanticRole: 'identifier',\n }),\n caseRef: schemaShape.caseRef.objectSpec({\n meaning: 'The case the run works on: a row of a resource declared `workUnit: true`.',\n whyItMatters: 'Every model call of the run, and of its continuation after an answer, is attributed to this case.',\n }),\n suspension: schemaShape.suspension.stringSpec({\n meaning: 'While the run waits: the question asked (its title, description, fields and options), who may answer it, who raised it, and when — serialized.',\n whyItMatters: 'Backend-only: listing it would tell a reader that a decision exists. Parsed against the engine\\'s suspension schema at every read.',\n }),\n suspensionId: schemaShape.suspensionId.stringSpec({\n meaning: 'The identity of the question the run waits on.',\n whyItMatters: 'The move out of waiting matches it in the same statement as the write, so of an answer and a withdrawal sent together only one moves the run.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRef: schemaShape.pendingDecisionRef.stringSpec({\n meaning: 'The id of the decision the run waits on, present only while it waits.',\n whyItMatters: 'The inbox\\'s act route addresses the decision by this id alone, and reads who may act from the row.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRouteKind: schemaShape.pendingDecisionRouteKind.enumSpec({\n meaning: 'Who may answer the waiting question.',\n whyItMatters: 'The inbox selects the rows a person may see on it; the one authorization predicate then decides.',\n enumDeclaration: enumDeclaration('HumanDecision_RouteKind'),\n values: {\n [HumanDecision_RouteKind.OWNER]: { meaning: 'Only the person on whose behalf the run asked.' },\n [HumanDecision_RouteKind.ASSIGNEE]: { meaning: 'One named person, who must hold the eligible role.' },\n [HumanDecision_RouteKind.ROLE]: { meaning: 'Anyone holding the eligible role in the organization, except the person who raised it. A role held through an organization relationship counts only when the requester acts through that same relationship or is one of the organization\\'s own, and in both cases only when the relationship may read the record the decision is about; a decision about no record the engine can name counts it only when the requester acts through that relationship (#2614, #2734).' },\n },\n }),\n pendingDecisionOrganizationId: schemaShape.pendingDecisionOrganizationId.stringSpec({ meaning: 'The organization the waiting question\\'s role is matched in.', semanticRole: 'identifier' }),\n pendingDecisionAssigneeUserId: schemaShape.pendingDecisionAssigneeUserId.stringSpec({ meaning: 'The one person an ASSIGNEE question is routed to.', semanticRole: 'identifier' }),\n pendingDecisionRequesterKind: schemaShape.pendingDecisionRequesterKind.enumSpec({\n meaning: 'What kind of principal the run raised its question under.',\n enumDeclaration: enumDeclaration('HumanDecision_RequesterKind'),\n values: {\n [HumanDecision_RequesterKind.USER]: { meaning: 'A signed-in person.' },\n [HumanDecision_RequesterKind.MACHINE]: { meaning: 'A machine credential; it can never answer its own question.' },\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: { meaning: 'An external client acting for a person.' },\n },\n }),\n pendingDecisionRequesterRef: schemaShape.pendingDecisionRequesterRef.stringSpec({\n meaning: 'Who raised the waiting question: a user id, or a machine credential id.',\n whyItMatters: 'Separation of duties: under a reviewer route the requester can never answer their own question.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRouteVersion: schemaShape.pendingDecisionRouteVersion.numberSpec({ meaning: 'Bumped by a move of the waiting question\\'s route; an answer read under an older route loses.' }),\n namedUserIds: schemaShape.namedUserIds.arraySpec({\n meaning: 'Every person the run has named, by user id: a question\\'s requester when that is a person, its assignee, and who decided each of its decisions.',\n elementMeaning: 'One person\\'s user id, added by the write that named them.',\n whyItMatters: 'The one place either store can find the runs a person is named on, since the question and the history are serialized or nested. A person\\'s erasure reads it to find the runs to remove them from, and removes them from it (#2630).',\n }),\n checkpoint: schemaShape.checkpoint.stringSpec({\n meaning: 'The host\\'s inputs for continuing the run, serialized. Opaque to the engine.',\n whyItMatters: 'Written when the run suspends, so a continuation in another process — after a restart — rebuilds what the run was doing.',\n }),\n pendingCorrectionRecord: schemaShape.pendingCorrectionRecord.stringSpec({\n meaning: 'The agent-work record a settled review of the actor\\'s work still owes, serialized: written by the move that settled it, cleared once the record exists.',\n whyItMatters: 'A process that dies between the settle and the record leaves the debt on the row, and the repair sweep writes it.',\n }),\n pendingCorrectionRecordRef: schemaShape.pendingCorrectionRecordRef.stringSpec({ meaning: 'The key of that owed record: what the repair sweep selects on, and what the clear compares.', semanticRole: 'identifier' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the run was opened.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the run last moved.', temporalRole: 'modified' }),\n finishedAt: schemaShape.finishedAt.dateSpec({ meaning: 'When the run ended. Absent while it runs or waits.', temporalRole: 'occurred' }),\n leaseExpiresAt: schemaShape.leaseExpiresAt.dateSpec({\n meaning: 'While the run is processing: the instant after which no process vouches for it. The process running it pushes it forward; every move out of processing clears it.',\n whyItMatters: 'An application may run as several processes. A run whose process died is found by this lapsing: the every-minute sweep puts it back on its question or ends it, and its single-flight subject is free again.',\n temporalRole: 'expiration',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open a run.',\n outcome: 'The run exists, and its task is opened next.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The run was opened. Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one run for the actor runtime or the decision inbox.',\n outcome: 'The run is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The run was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List runs for the actor runtime or the decision inbox.',\n outcome: 'The runs are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The runs were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a run, or write its question and checkpoint. Internal write path.',\n outcome: 'The run stands where the actor runtime moved it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The run moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Internal cleanup: the tenant purge\\'s cascade. No public deletion route.',\n outcome: 'A deleted organization\\'s runs are removed.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Written only by the engine\\'s persistence port; a person reaches a waiting question through the decision inbox, never through this resource.',\n 'A run is taken out of waiting by one guarded statement; of two decisions sent together, only one moves it.',\n 'Every run belongs to an organization and is deleted with it.',\n 'A person\\'s erasure removes their id from every run that names them and keeps the run; nobody is chosen to answer in their place.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"actor-system-executions.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-system-executions.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,gCAAgC,EAChC,qBAAqB,IAAI,EAAE,EAC3B,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,gEAAg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MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;SAC3F;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,wDAAwD;YACjE,OAAO,EAAE,+CAA+C;YACxD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;SAChG;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,wEAAwE;YACjF,OAAO,EAAE,kDAAkD;YAC3D,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;SACvF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,0EAA0E;YACnF,OAAO,EAAE,6CAA6C;YACtD,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,8IAA8I;QAC9I,sQAAsQ;QACtQ,4GAA4G;QAC5G,8DAA8D;QAC9D,mIAAmI;KACpI;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `actorSystemExecutions` — Wildo SaaS engine specification (organization-scoped storage, engine-written). #2539.\n *\n * Inputs:\n * - Schema: `ActorSystemExecutionRecordSchema` (`flows-actors/actor-plane-rows.shared.schemas.ts`)\n * - Factory: `actorSystemExecutionsResourceConfiguration_InitializationFactory`\n * - Writer: `ApplicationActorExecutionPersistence`, the application's binding of `ActorExecutionPersistencePort`.\n * - Readers: the actor runtime (`ActorsSystemBackendService`) and the decision inbox's actor-system host.\n * - And the Agent activity routes (#3990, `POST /flows-actors/agent-activity` and `/agent-activity/run`), on the\n * infrastructure tier, projected onto a published contract that leaves out every backend-only field.\n *\n * Why the structured state is serialized beside filterable columns, and why the rows are organization-scoped rather\n * than polymorphic, is the schema file's header; it is not restated here.\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n ActorSystemExecutionRecordSchema,\n CoreResourceOperation as Op,\n FlowsActors_Status,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n ResourcePrimaryScope,\n actorSystemExecutionsResourceConfiguration_InitializationFactory as actorSystemExecutionsFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\n/** The run-status vocabulary, worded for an actor run (the conversational family words it for a turn). */\nexport const actorRunStatusValues = {\n [FlowsActors_Status.READY]: { meaning: 'Created and not yet started. Not written by the actor runtime today.' },\n [FlowsActors_Status.PENDING]: { meaning: 'Selected but not started: the host opened the run deferred and starts it once it can begin.' },\n [FlowsActors_Status.PROCESSING]: { meaning: 'Running: the host is executing the work, or continuing it after an answer.' },\n [FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Waiting on a person: the run asked a question and stands until it is answered or withdrawn. Non-terminal.' },\n [FlowsActors_Status.COMPLETED]: { meaning: 'Finished: the work reached its own conclusion.' },\n [FlowsActors_Status.FAILED]: { meaning: 'Finished unsuccessfully: the work threw, or its host concluded it failed.' },\n [FlowsActors_Status.CANCELLED]: { meaning: 'Withdrawn by a person while it waited on a question; nothing was continued.' },\n [FlowsActors_Status.ABORTED]: { meaning: 'Stopped by the system rather than by a person: its admission was refused, or the person it asked on behalf of lost their authority while the question waited (or was erased), so no answer could be carried out. A run whose process went away while it ran is ABORTED too, once its liveness lease lapses (or put back on the question it was continuing).' },\n};\n\nexport const actorSystemExecutionsResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n actorSystemExecutionsFactory,\n ActorSystemExecutionRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record each run of an actor system an application performs for an organization: where it stands and, while it waits on a person, the question it asked and what its resume needs.',\n businessRole: 'What lets an application\\'s own actor run stop to ask a person — a review of the actor\\'s work, or a question it cannot answer alone — and continue under the same identity once that person answers from the decision inbox.',\n lifecycleRole: 'Opened by the actor runtime when a run starts, moved on every status change by the engine\\'s persistence, and deleted with its organization.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ActorSystemExecutionRecordSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'actorSystemExecutionsResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ACTOR_SYSTEM_EXECUTIONS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'Every operation is route-less: CREATE, READ, LIST and UPDATE are REPOSITORY_ONLY and DELETE is INTERNAL_CALL (the tenant purge\\'s composition cascade). The roles are never exercised by a request.',\n 'The move out of waiting is a guarded repository mutation matching status, suspension id and route version in one statement (#1586), never a read followed by a write.',\n 'The purge\\'s cascade ends a question a waiting run holds before it deletes the run (#2680): the same guarded move, inside the purge\\'s transaction, withdrawn by nobody, with the resolved record and the holders\\' notice after the commit and no agent-work record.',\n 'The platform keeps its own copy of this plane (`wildoApplicationActorSystemExecutions`) for the runs that build an application; these rows are the runs an application performs.',\n 'A person\\'s erasure reaches these rows through the engine\\'s subject-reference severer, not the erasure graph (no USERS edge): inside the erasure\\'s transaction it ends a question they raised (REQUESTER_AUTHORITY_LAPSED, nobody deciding), gives a question assigned to them back to its role, and removes their id from the history, from an owed review record and from `namedUserIds`. The run stays; a run under a legal hold is left as it is (#2630).',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of the run. The actor runtime names the run by it everywhere: its tasks, its question, its resume.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.foreignKeySpec({\n meaning: 'The organization the run works for.',\n whyItMatters: 'Its questions are routed to reviewers in this organization, and the run is deleted with it. A run with no organization is refused rather than given a guessed one.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n systemRef: schemaShape.systemRef.stringSpec({ meaning: 'The registered actor system this is a run of.', whyItMatters: 'It selects the continuation that resumes the run once its question is answered.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the run stands.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('FlowsActors_Status'),\n values: actorRunStatusValues,\n }),\n statusChanges: schemaShape.statusChanges.arraySpec({\n meaning: 'The run\\'s history, oldest first.',\n elementMeaning: 'One move: the status the run entered and when; on a move out of waiting, also the decision it settled, how it ended, who decided and when, written in the same statement as the move.',\n }),\n exclusiveSubject: schemaShape.exclusiveSubject.stringSpec({\n meaning: 'What the run holds exclusively while it is running, when its host opened it that way.',\n whyItMatters: 'Another run of the same system on the same subject is refused while this one is pending or running. A waiting run does not hold it.',\n semanticRole: 'identifier',\n }),\n caseRef: schemaShape.caseRef.objectSpec({\n meaning: 'The case the run works on: a row of a resource declared `workUnit: true`.',\n whyItMatters: 'Every model call of the run, and of its continuation after an answer, is attributed to this case.',\n }),\n suspension: schemaShape.suspension.stringSpec({\n meaning: 'While the run waits: the question asked (its title, description, fields and options), who may answer it, who raised it, and when — serialized.',\n whyItMatters: 'Backend-only: listing it would tell a reader that a decision exists. Parsed against the engine\\'s suspension schema at every read.',\n }),\n suspensionId: schemaShape.suspensionId.stringSpec({\n meaning: 'The identity of the question the run waits on.',\n whyItMatters: 'The move out of waiting matches it in the same statement as the write, so of an answer and a withdrawal sent together only one moves the run.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRef: schemaShape.pendingDecisionRef.stringSpec({\n meaning: 'The id of the decision the run waits on, present only while it waits.',\n whyItMatters: 'The inbox\\'s act route addresses the decision by this id alone, and reads who may act from the row.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRouteKind: schemaShape.pendingDecisionRouteKind.enumSpec({\n meaning: 'Who may answer the waiting question.',\n whyItMatters: 'The inbox selects the rows a person may see on it; the one authorization predicate then decides.',\n enumDeclaration: enumDeclaration('HumanDecision_RouteKind'),\n values: {\n [HumanDecision_RouteKind.OWNER]: { meaning: 'Only the person on whose behalf the run asked.' },\n [HumanDecision_RouteKind.ASSIGNEE]: { meaning: 'One named person, who must hold the eligible role.' },\n [HumanDecision_RouteKind.ROLE]: { meaning: 'Anyone holding the eligible role in the organization, except the person who raised it. A role held through an organization relationship counts only when the requester acts through that same relationship or is one of the organization\\'s own, and in both cases only when the relationship may read the record the decision is about; a decision about no record the engine can name counts it only when the requester acts through that relationship (#2614, #2734).' },\n },\n }),\n pendingDecisionOrganizationId: schemaShape.pendingDecisionOrganizationId.stringSpec({ meaning: 'The organization the waiting question\\'s role is matched in.', semanticRole: 'identifier' }),\n pendingDecisionAssigneeUserId: schemaShape.pendingDecisionAssigneeUserId.stringSpec({ meaning: 'The one person an ASSIGNEE question is routed to.', semanticRole: 'identifier' }),\n pendingDecisionRequesterKind: schemaShape.pendingDecisionRequesterKind.enumSpec({\n meaning: 'What kind of principal the run raised its question under.',\n enumDeclaration: enumDeclaration('HumanDecision_RequesterKind'),\n values: {\n [HumanDecision_RequesterKind.USER]: { meaning: 'A signed-in person.' },\n [HumanDecision_RequesterKind.MACHINE]: { meaning: 'A machine credential; it can never answer its own question.' },\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: { meaning: 'An external client acting for a person.' },\n },\n }),\n pendingDecisionRequesterRef: schemaShape.pendingDecisionRequesterRef.stringSpec({\n meaning: 'Who raised the waiting question: a user id, or a machine credential id.',\n whyItMatters: 'Separation of duties: under a reviewer route the requester can never answer their own question.',\n semanticRole: 'identifier',\n }),\n pendingDecisionRouteVersion: schemaShape.pendingDecisionRouteVersion.numberSpec({ meaning: 'Bumped by a move of the waiting question\\'s route; an answer read under an older route loses.' }),\n namedUserIds: schemaShape.namedUserIds.arraySpec({\n meaning: 'Every person the run has named, by user id: a question\\'s requester when that is a person, its assignee, and who decided each of its decisions.',\n elementMeaning: 'One person\\'s user id, added by the write that named them.',\n whyItMatters: 'The one place either store can find the runs a person is named on, since the question and the history are serialized or nested. A person\\'s erasure reads it to find the runs to remove them from, and removes them from it (#2630).',\n }),\n checkpoint: schemaShape.checkpoint.stringSpec({\n meaning: 'The host\\'s inputs for continuing the run, serialized. Opaque to the engine.',\n whyItMatters: 'Written when the run suspends, so a continuation in another process — after a restart — rebuilds what the run was doing.',\n }),\n pendingCorrectionRecord: schemaShape.pendingCorrectionRecord.stringSpec({\n meaning: 'The agent-work record a settled review of the actor\\'s work still owes, serialized: written by the move that settled it, cleared once the record exists.',\n whyItMatters: 'A process that dies between the settle and the record leaves the debt on the row, and the repair sweep writes it.',\n }),\n pendingCorrectionRecordRef: schemaShape.pendingCorrectionRecordRef.stringSpec({ meaning: 'The key of that owed record: what the repair sweep selects on, and what the clear compares.', semanticRole: 'identifier' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the run was opened.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the run last moved.', temporalRole: 'modified' }),\n finishedAt: schemaShape.finishedAt.dateSpec({ meaning: 'When the run ended. Absent while it runs or waits.', temporalRole: 'occurred' }),\n leaseExpiresAt: schemaShape.leaseExpiresAt.dateSpec({\n meaning: 'While the run is processing: the instant after which no process vouches for it. The process running it pushes it forward; every move out of processing clears it.',\n whyItMatters: 'An application may run as several processes. A run whose process died is found by this lapsing: the every-minute sweep puts it back on its question or ends it, and its single-flight subject is free again.',\n temporalRole: 'expiration',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open a run.',\n outcome: 'The run exists, and its task is opened next.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The run was opened. Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one run for the actor runtime or the decision inbox. (The Agent activity page reads runs through its own routes, on the infrastructure tier, never through this operation.)',\n outcome: 'The run is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The run was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List runs for the actor runtime or the decision inbox.',\n outcome: 'The runs are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The runs were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a run, or write its question and checkpoint. Internal write path.',\n outcome: 'The run stands where the actor runtime moved it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The run moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Internal cleanup: the tenant purge\\'s cascade. No public deletion route.',\n outcome: 'A deleted organization\\'s runs are removed.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Written only by the engine\\'s persistence port; a person reaches a waiting question through the decision inbox, never through this resource.',\n 'An organization\\'s administrators, and the application super-administrator under the audit read policy, read what a run did on the Agent activity page (#3990): its system, status, history and tasks, never its question, its resume inputs or the people it names.',\n 'A run is taken out of waiting by one guarded statement; of two decisions sent together, only one moves it.',\n 'Every run belongs to an organization and is deleted with it.',\n 'A person\\'s erasure removes their id from every run that names them and keeps the run; nobody is chosen to answer in their place.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-tasks.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-tasks.resource.specification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"actor-tasks.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAWjI,eAAO,MAAM,+BAA+B,EAAE,8BAgG7C,CAAC"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* - Factory: `actorTasksResourceConfiguration_InitializationFactory`
|
|
7
7
|
* - Writer: `ApplicationActorExecutionPersistence`, the application's binding of `ActorExecutionPersistencePort`.
|
|
8
8
|
* - Readers: the actor runtime (the tasks it moves with their execution).
|
|
9
|
+
* - And the Agent activity routes (#3990), on the infrastructure tier, which read a run's tasks within the run's own
|
|
10
|
+
* organization and send them without their correlation `context`.
|
|
9
11
|
*/
|
|
10
12
|
import { LabelAudience } from '@wildo-ai/presets-components-models';
|
|
11
13
|
import { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';
|
|
@@ -105,6 +107,7 @@ export const actorTasksResourceSpecification = resourceSpecification(actorTasksF
|
|
|
105
107
|
'Written only by the engine\'s persistence port.',
|
|
106
108
|
'A task moves before its run, so a reader never sees a finished run over work that still reads as running.',
|
|
107
109
|
'Every task belongs to an organization and is deleted with it.',
|
|
110
|
+
'An organization\'s administrators, and the application super-administrator under the audit read policy, read a run\'s tasks on the Agent activity page (#3990): what each actor was asked and produced, never the task\'s correlation context.',
|
|
108
111
|
],
|
|
109
112
|
}), { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS });
|
|
110
113
|
//# sourceMappingURL=actor-tasks.resource.specification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-tasks.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAAA;;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AC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,0EAA0E;YACnF,OAAO,EAAE,8CAA8C;YACvD,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,iDAAiD;QACjD,2GAA2G;QAC3G,+DAA+D;KAChE;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `actorTasks` — Wildo SaaS engine specification (organization-scoped storage, engine-written). #2539.\n *\n * Inputs:\n * - Schema: `ActorTaskRecordSchema` (`flows-actors/actor-plane-rows.shared.schemas.ts`)\n * - Factory: `actorTasksResourceConfiguration_InitializationFactory`\n * - Writer: `ApplicationActorExecutionPersistence`, the application's binding of `ActorExecutionPersistencePort`.\n * - Readers: the actor runtime (the tasks it moves with their execution).\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n ActorTaskRecordSchema,\n Actor_Task_Topics,\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n actorTasksResourceConfiguration_InitializationFactory as actorTasksFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\nimport { actorRunStatusValues } from './actor-system-executions.resource.specification';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nexport const actorTasksResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n actorTasksFactory,\n ActorTaskRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record the unit of work an actor does inside one run of an application\\'s actor system: what it was asked and what it produced.',\n businessRole: 'The work record a reviewer\\'s question is about, and what a run left behind once it ended.',\n lifecycleRole: 'Opened with its run, moved with it (before the run itself, so a reader never sees a finished run over unfinished work), and deleted with its organization.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ActorTaskRecordSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'actorTasksResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ACTOR_TASKS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'Every operation is route-less: CREATE, READ, LIST and UPDATE are REPOSITORY_ONLY and DELETE is INTERNAL_CALL (the tenant purge\\'s composition cascade).',\n 'The link to the run is a soft indexed id, as on the conversational task family; both rows die with their organization, which is the only cascade they need.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of the task.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the run works for; the task is deleted with it.', importance: FieldSemanticImportance.PRIMARY }),\n actorSystemExecutionId: schemaShape.actorSystemExecutionId.stringSpec({ meaning: 'The run this task belongs to.', semanticRole: 'identifier' }),\n actorRef: schemaShape.actorRef.stringSpec({ meaning: 'The actor doing the work: one the run\\'s system declares.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n title: schemaShape.title.stringSpec({ meaning: 'A short name for the work, as its host wrote it.', whyItMatters: 'Content an organization holds: it may name the client matter the work is about.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'What the work is, as its host wrote it.' }),\n topic: schemaShape.topic.enumSpec({\n meaning: 'What kind of work this is.',\n enumDeclaration: enumDeclaration('Actor_Task_Topics'),\n values: {\n [Actor_Task_Topics.WEB_SEARCH]: { meaning: 'Searching the web.' },\n [Actor_Task_Topics.RESEARCH]: { meaning: 'Gathering and reading material.' },\n [Actor_Task_Topics.PLANNING]: { meaning: 'Deciding what to do.' },\n [Actor_Task_Topics.IMPLEMENTATION]: { meaning: 'Doing the work itself.' },\n [Actor_Task_Topics.VERIFICATION]: { meaning: 'Checking work already done.' },\n [Actor_Task_Topics.METHOD_STEP]: { meaning: 'One step of an authored method.' },\n },\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the task stands; it moves with its run.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('FlowsActors_Status'),\n values: actorRunStatusValues,\n }),\n input: schemaShape.input.objectSpec({ meaning: 'What the task was asked, in its host\\'s own shape.' }),\n output: schemaShape.output.objectSpec({\n meaning: 'What the task produced, or why it failed, in its host\\'s own shape. While its run waits, what the host says the run is waiting on.',\n whyItMatters: 'A thrown run records `{ failure }` here, so the row itself says why it failed.',\n }),\n artifacts: schemaShape.artifacts.arraySpec({ meaning: 'What the task left behind, carried unchanged from its host.', elementMeaning: 'One artifact: its stable reference and the typed parts carrying its content.' }),\n context: schemaShape.context.stringSpec({ meaning: 'The dispatching host\\'s correlation envelope, serialized and carried unchanged.' }),\n startedAt: schemaShape.startedAt.dateSpec({ meaning: 'When the work began. Absent on a run opened deferred until it starts.', temporalRole: 'occurred' }),\n completedAt: schemaShape.completedAt.dateSpec({ meaning: 'When the work ended. Absent while it runs or waits.', temporalRole: 'occurred' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the task was opened.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the task last moved.', temporalRole: 'modified' }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the task of a run.',\n outcome: 'The task exists, linked to its run.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The task was opened. Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one task for the actor runtime.',\n outcome: 'The task is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The task was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List the tasks of a run for the actor runtime.',\n outcome: 'The tasks are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The tasks were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a task, and record what it produced. Internal write path.',\n outcome: 'The task stands where the actor runtime moved it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The task moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Internal cleanup: the tenant purge\\'s cascade. No public deletion route.',\n outcome: 'A deleted organization\\'s tasks are removed.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Written only by the engine\\'s persistence port.',\n 'A task moves before its run, so a reader never sees a finished run over work that still reads as running.',\n 'Every task belongs to an organization and is deleted with it.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"actor-tasks.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxG,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,IAAI,EAAE,EAC3B,oBAAoB,EACpB,qDAAqD,IAAI,iBAAiB,GAC3E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAuC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAA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ClC,OAAO,EAAE,qCAAqC;YAC9C,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,2CAA2C,EAAE,CAAC;SACvH;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,sCAAsC;YAC/C,OAAO,EAAE,8CAA8C;YACvD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,qBAAqB,EAAE,CAAC;SAC5F;QACD,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE;YACT,OAAO,EAAE,gDAAgD;YACzD,OAAO,EAAE,gDAAgD;YACzD,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;SACjG;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,gEAAgE;YACzE,OAAO,EAAE,mDAAmD;YAC5D,gBAAgB,EAAE,CAAC,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;SACxF;QACD,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACX,OAAO,EAAE,0EAA0E;YACnF,OAAO,EAAE,8CAA8C;YACvD,UAAU,EAAE,IAAI;SACjB;KACF;IAED,mBAAmB,EAAE;QACnB,iDAAiD;QACjD,2GAA2G;QAC3G,+DAA+D;QAC/D,gPAAgP;KACjP;CACF,CAAC,EACF,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,aAAa,EAAE,CAC7D,CAAC","sourcesContent":["/**\n * Resource: `actorTasks` — Wildo SaaS engine specification (organization-scoped storage, engine-written). #2539.\n *\n * Inputs:\n * - Schema: `ActorTaskRecordSchema` (`flows-actors/actor-plane-rows.shared.schemas.ts`)\n * - Factory: `actorTasksResourceConfiguration_InitializationFactory`\n * - Writer: `ApplicationActorExecutionPersistence`, the application's binding of `ActorExecutionPersistencePort`.\n * - Readers: the actor runtime (the tasks it moves with their execution).\n * - And the Agent activity routes (#3990), on the infrastructure tier, which read a run's tasks within the run's own\n * organization and send them without their correlation `context`.\n */\nimport { LabelAudience } from '@wildo-ai/presets-components-models';\nimport { CodeDeclarationKind, CodeSymbolKind, FieldSemanticImportance } from '@wildo-ai/zod-decorators';\nimport {\n ActorTaskRecordSchema,\n Actor_Task_Topics,\n CoreResourceOperation as Op,\n ResourcePrimaryScope,\n actorTasksResourceConfiguration_InitializationFactory as actorTasksFactory,\n} from '@wildo-ai/saas-models';\nimport { type AnyResourceSpecificationConfig, HttpResponseStatusCode, resourceSpecification } from '~wildo-specifications/_core';\nimport { EngineResourceSubDomain } from '../../engine-resource-sub-domain';\nimport { actorRunStatusValues } from './actor-system-executions.resource.specification';\n\nconst enumDeclaration = (exportName: string) => ({\n packageName: '@wildo-ai/saas-models',\n exportName,\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n});\n\nexport const actorTasksResourceSpecification: AnyResourceSpecificationConfig = resourceSpecification(\n actorTasksFactory,\n ActorTaskRecordSchema,\n ({ schemaShape }) => ({\n purpose: 'Record the unit of work an actor does inside one run of an application\\'s actor system: what it was asked and what it produced.',\n businessRole: 'The work record a reviewer\\'s question is about, and what a run left behind once it ended.',\n lifecycleRole: 'Opened with its run, moved with it (before the run itself, so a reader never sees a finished run over unfinished work), and deleted with its organization.',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: { packageName: '@wildo-ai/saas-models', exportName: 'ActorTaskRecordSchema', symbolKind: CodeSymbolKind.SCHEMA, declarationKind: CodeDeclarationKind.ZOD_SCHEMA },\n resourceFactory: { packageName: '@wildo-ai/saas-models', exportName: 'actorTasksResourceConfiguration_InitializationFactory', symbolKind: CodeSymbolKind.FACTORY, declarationKind: CodeDeclarationKind.FUNCTION },\n resourceType: { enumDeclaration: enumDeclaration('CoreResourceType'), memberName: 'ACTOR_TASKS' },\n operationVocabulary: { coreEnum: enumDeclaration('CoreResourceOperation') },\n notes: [\n 'Every operation is route-less: CREATE, READ, LIST and UPDATE are REPOSITORY_ONLY and DELETE is INTERNAL_CALL (the tenant purge\\'s composition cascade).',\n 'The link to the run is a soft indexed id, as on the conversational task family; both rows die with their organization, which is the only cascade they need.',\n ],\n },\n\n fields: {\n _id: schemaShape._id.stringSpec({ meaning: 'Identity of the task.', semanticRole: 'identifier' }),\n organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the run works for; the task is deleted with it.', importance: FieldSemanticImportance.PRIMARY }),\n actorSystemExecutionId: schemaShape.actorSystemExecutionId.stringSpec({ meaning: 'The run this task belongs to.', semanticRole: 'identifier' }),\n actorRef: schemaShape.actorRef.stringSpec({ meaning: 'The actor doing the work: one the run\\'s system declares.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),\n title: schemaShape.title.stringSpec({ meaning: 'A short name for the work, as its host wrote it.', whyItMatters: 'Content an organization holds: it may name the client matter the work is about.', importance: FieldSemanticImportance.PRIMARY }),\n description: schemaShape.description.stringSpec({ meaning: 'What the work is, as its host wrote it.' }),\n topic: schemaShape.topic.enumSpec({\n meaning: 'What kind of work this is.',\n enumDeclaration: enumDeclaration('Actor_Task_Topics'),\n values: {\n [Actor_Task_Topics.WEB_SEARCH]: { meaning: 'Searching the web.' },\n [Actor_Task_Topics.RESEARCH]: { meaning: 'Gathering and reading material.' },\n [Actor_Task_Topics.PLANNING]: { meaning: 'Deciding what to do.' },\n [Actor_Task_Topics.IMPLEMENTATION]: { meaning: 'Doing the work itself.' },\n [Actor_Task_Topics.VERIFICATION]: { meaning: 'Checking work already done.' },\n [Actor_Task_Topics.METHOD_STEP]: { meaning: 'One step of an authored method.' },\n },\n }),\n status: schemaShape.status.enumSpec({\n meaning: 'Where the task stands; it moves with its run.',\n importance: FieldSemanticImportance.PRIMARY,\n enumDeclaration: enumDeclaration('FlowsActors_Status'),\n values: actorRunStatusValues,\n }),\n input: schemaShape.input.objectSpec({ meaning: 'What the task was asked, in its host\\'s own shape.' }),\n output: schemaShape.output.objectSpec({\n meaning: 'What the task produced, or why it failed, in its host\\'s own shape. While its run waits, what the host says the run is waiting on.',\n whyItMatters: 'A thrown run records `{ failure }` here, so the row itself says why it failed.',\n }),\n artifacts: schemaShape.artifacts.arraySpec({ meaning: 'What the task left behind, carried unchanged from its host.', elementMeaning: 'One artifact: its stable reference and the typed parts carrying its content.' }),\n context: schemaShape.context.stringSpec({ meaning: 'The dispatching host\\'s correlation envelope, serialized and carried unchanged.' }),\n startedAt: schemaShape.startedAt.dateSpec({ meaning: 'When the work began. Absent on a run opened deferred until it starts.', temporalRole: 'occurred' }),\n completedAt: schemaShape.completedAt.dateSpec({ meaning: 'When the work ended. Absent while it runs or waits.', temporalRole: 'occurred' }),\n createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the task was opened.', temporalRole: 'creation' }),\n updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the task last moved.', temporalRole: 'modified' }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Open the task of a run.',\n outcome: 'The task exists, linked to its run.',\n responseStatuses: [{ code: HttpResponseStatusCode.CREATED_201, meaning: 'The task was opened. Internal write path.' }],\n },\n [Op.READ]: {\n purpose: 'Read one task for the actor runtime.',\n outcome: 'The task is returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The task was found.' }],\n },\n [Op.LIST]: {\n purpose: 'List the tasks of a run for the actor runtime.',\n outcome: 'The tasks are returned to the internal caller.',\n idempotent: true,\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The tasks were returned.' }],\n },\n [Op.UPDATE]: {\n purpose: 'Move a task, and record what it produced. Internal write path.',\n outcome: 'The task stands where the actor runtime moved it.',\n responseStatuses: [{ code: HttpResponseStatusCode.OK_200, meaning: 'The task moved.' }],\n },\n [Op.DELETE]: {\n purpose: 'Internal cleanup: the tenant purge\\'s cascade. No public deletion route.',\n outcome: 'A deleted organization\\'s tasks are removed.',\n idempotent: true,\n },\n },\n\n businessConstraints: [\n 'Written only by the engine\\'s persistence port.',\n 'A task moves before its run, so a reader never sees a finished run over work that still reads as running.',\n 'Every task belongs to an organization and is deleted with it.',\n 'An organization\\'s administrators, and the application super-administrator under the audit read policy, read a run\\'s tasks on the Agent activity page (#3990): what each actor was asked and produced, never the task\\'s correlation context.',\n ],\n }),\n { resourcePrimaryScope: ResourcePrimaryScope.ORGANIZATIONS },\n);\n"]}
|
|
@@ -79,7 +79,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
79
79
|
return resourceSpecification(flowActorTasksPolymorphicFactories[resourceType], FlowActorTaskBaseSchema, ({ schemaShape }) => ({
|
|
80
80
|
purpose: 'Track one addressable unit of agent work, including its lifecycle status, outputs, artifacts, and terminal outcome.',
|
|
81
81
|
businessRole: 'The work record an authorized integration polls, collects results from, or cancels independently of the conversation that started it.',
|
|
82
|
-
lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `
|
|
82
|
+
lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `auth-required`. Advances through working, and closes on completion, failure, or cancellation. Kept for the application\'s declared RESOURCE_DATA period counted from its last update (`retentionBinding`, LAST_UPDATED), then deleted by the retention-class sweep (#2841).',
|
|
83
83
|
audience: LabelAudience.DEVELOPER,
|
|
84
84
|
subDomain: EngineResourceSubDomain.FLOWS_ACTORS,
|
|
85
85
|
codeHandling: {
|
|
@@ -126,7 +126,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
126
126
|
}),
|
|
127
127
|
status: schemaShape.status.enumSpec({
|
|
128
128
|
meaning: 'Current lifecycle state of the work.',
|
|
129
|
-
whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` →
|
|
129
|
+
whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` → auth-required, `completed` → completed, `failed` and `aborted` → failed, `cancelled` → canceled. A task whose worker stopped is reported as failed once the worker’s hold on the task has expired, so an abandoned task never reads as still working. A task waiting on a person’s decision is exempt: waiting is its correct state, however long it lasts.',
|
|
130
130
|
enumDeclaration: {
|
|
131
131
|
packageName: '@wildo-ai/saas-models',
|
|
132
132
|
exportName: 'FlowsActors_Status',
|
|
@@ -137,7 +137,7 @@ function buildFlowActorTaskResourceSpecification(resourceType, resourceTypeMembe
|
|
|
137
137
|
[FlowsActors_Status.READY]: { meaning: 'Materialised and acknowledged, not yet processing — A2A `submitted`.' },
|
|
138
138
|
[FlowsActors_Status.PENDING]: { meaning: 'Accepted but not yet actively processing — also projects to A2A `submitted`.' },
|
|
139
139
|
[FlowsActors_Status.PROCESSING]: { meaning: 'Actively running — the agent is working the task. A2A `working`.' },
|
|
140
|
-
[FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `
|
|
140
|
+
[FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `auth-required` — non-terminal: the person decides in the application, never through a message on the task. Written when a turn pauses for a decision, together with the decision it paused on (`pausedOnDecisionRef`). The stored value stays while the decision is answered elsewhere; what a reader is told is derived from that decision, so a released task reads as working, finished, or unknown.' },
|
|
141
141
|
[FlowsActors_Status.COMPLETED]: { meaning: 'Work finished successfully; outputs and artifacts are final. A2A `completed` (terminal).' },
|
|
142
142
|
[FlowsActors_Status.FAILED]: { meaning: 'Work ended in error. A2A `failed` (terminal). Also the state an abandoned task resolves to when its liveness lease has expired.' },
|
|
143
143
|
[FlowsActors_Status.CANCELLED]: { meaning: 'Cancelled before completion, via `tasks/cancel`. A2A `canceled` (terminal) — the record survives so the client can read its final state.' },
|
package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-actor-tasks.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/flow-actor-tasks.resource.specification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,gBAAgB,EAChB,kCAAkC,EAClC,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAmC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAqD3E,6EAA6E;AAC7E,SAAS,+BAA+B,CAAC,YAAkC;IACzE,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,gBAAgB,CAAC,qBAAqB;YACzC,OAAO;gBACL,aAAa,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE;gBAC5C,gBAAgB,EAAE,EAAE,mBAAmB,EAAE,2BAA2B,EAAE;gBACtE,UAAU,EAAE,MAAM;gBAClB,mBAAmB,EAAE,kCAAkC;aACxD,CAAC;QACJ,KAAK,gBAAgB,CAAC,6BAA6B;YACjD,OAAO;gBACL,aAAa,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE;gBACnD,gBAAgB,EAAE,E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AM,EAAE,OAAO,EAAE,uCAAuC,EAAE;iBAC1F;gBACD,cAAc,EAAE;oBACd,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,iEAAiE,EAAE;oBACvH,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mDAAmD,EAAE;iBAC1G;gBACD,QAAQ,EAAE,CAAC;wBACT,KAAK,EAAE,oBAAoB,YAAY,CAAC,UAAU,aAAa;wBAC/D,OAAO,EAAE,EAAE,GAAG,YAAY,CAAC,aAAa,EAAE,GAAG,YAAY,CAAC,gBAAgB,EAAE;wBAC5E,QAAQ,EAAE,EAAE,EAAE,EAAE,oBAAoB,CAAC,GAAG,EAAE;wBAC1C,SAAS,EAAE,sBAAsB,CAAC,MAAM;qBACzC,CAAC;aACH;SACF;QAED,mBAAmB,EAAE;YACnB,qMAAqM;YACrM,yKAAyK;YACzK,qIAAqI;YACrI,wJAAwJ;SACzJ;KACF,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,EAAmC,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAqD3E,6EAA6E;AAC7E,SAAS,+BAA+B,CAAC,YAAkC;IACzE,QAAQ,YAAY,EAAE,CAAC;QACrB,KAAK,gBAAgB,CAAC,qBAAqB;YACzC,OAAO;gBACL,aAAa,EAAE,EAAE,MAAM,EAAE,iBAAiB,EAAE;gBAC5C,gBAAgB,EAAE,EAAE,mBAAmB,EAAE,2BAA2B,EAAE;gBACtE,UAAU,EAAE,MAAM;gBAClB,mBAAmB,EAAE,kCAAkC;aACxD,CAAC;QACJ,KAAK,gBAAgB,CAAC,6BAA6B;YACjD,OAAO;gBACL,aAAa,EAAE,EAAE,cAAc,EAAE,gBAAgB,EAAE;gBACnD,gBAAgB,EAAE,EAAE,2BAA2B,EAAE,0BAA0B,EAAE;gBAC7E,UAAU,EAAE,cAAc;gBAC1B,mBAAmB,E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E,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,iEAAiE,EAAE;oBACvH,EAAE,IAAI,EAAE,sBAAsB,CAAC,aAAa,EAAE,IAAI,EAAE,mDAAmD,EAAE;iBAC1G;gBACD,QAAQ,EAAE,CAAC;wBACT,KAAK,EAAE,oBAAoB,YAAY,CAAC,UAAU,aAAa;wBAC/D,OAAO,EAAE,EAAE,GAAG,YAAY,CAAC,aAAa,EAAE,GAAG,YAAY,CAAC,gBAAgB,EAAE;wBAC5E,QAAQ,EAAE,EAAE,EAAE,EAAE,oBAAoB,CAAC,GAAG,EAAE;wBAC1C,SAAS,EAAE,sBAAsB,CAAC,MAAM;qBACzC,CAAC;aACH;SACF;QAED,mBAAmB,EAAE;YACnB,qMAAqM;YACrM,yKAAyK;YACzK,qIAAqI;YACrI,wJAAwJ;SACzJ;KACF,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 → `auth-required`, #3956). All three triggers are live: the pause is proven end to end by\n * `examples/wonder-todos/e2e/a2a-approval-pause.e2e.ts` (the task reaches `auth-required` and\n * persists the decision it waits on) and its release by `a2a-approval-resume.e2e.ts` (the task\n * LEAVES `auth-required` once its execution moves on). A blocking turn with no webhook that answers in one shot\n * returns a `Message` and writes no task row; the A2A spec permits both shapes.\n *\n * The default API READ/LIST are the per-owner HTTP surface. They do NOT govern the A2A\n * `tasks/get` path, which reads through the system-access primitive and isolates by an\n * owner filter derived from the authenticated principal — so a cross-tenant read fails\n * closed, but by that filter rather than by these roles. CREATE/UPDATE are internal\n * (INTERNAL_CALL, service-tier): only the runtime materialises a task and advances\n * its lifecycle via `*AsSystem`. `tasks/cancel` is an UPDATE, never a delete — the\n * spec requires cancel to return the task's updated state.\n */\n\ntype FlowTaskResourceType =\n | CoreResourceType.USER_FLOW_ACTOR_TASKS\n | CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS\n | CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS;\ntype FlowTaskResourceTypeMember = CoreResourceTypeMemberName<FlowTaskResourceType>;\n\ninterface FlowActorTaskScopeExample {\n readonly scopeIdentity: Readonly<Record<string, string>>;\n readonly resourceIdentity: Readonly<Record<string, string>>;\n readonly scopeLabel: string;\n readonly machineCredentialId: string;\n}\n\n/** Exhaustive owner/route projection for the three public task contracts. */\nfunction createFlowActorTaskScopeExample(resourceType: FlowTaskResourceType): FlowActorTaskScopeExample {\n switch (resourceType) {\n case CoreResourceType.USER_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { userId: 'user_01JEXAMPLE' },\n resourceIdentity: { userFlowActorTaskId: 'flow_task_user_01JEXAMPLE' },\n scopeLabel: 'user',\n machineCredentialId: FLOWS_ACTORS_NO_MACHINE_CREDENTIAL,\n };\n case CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { organizationId: 'org_01JEXAMPLE' },\n resourceIdentity: { organizationFlowActorTaskId: 'flow_task_org_01JEXAMPLE' },\n scopeLabel: 'organization',\n machineCredentialId: 'machine_credential_org_finance_agent',\n };\n case CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS:\n return {\n scopeIdentity: { applicationId: 'app_01JEXAMPLE' },\n resourceIdentity: { applicationFlowActorTaskId: 'flow_task_app_01JEXAMPLE' },\n scopeLabel: 'application',\n machineCredentialId: 'machine_credential_app_finance_agent',\n };\n default: {\n const exhaustiveResourceType: never = resourceType;\n throw new Error(`Unsupported Flow Actor task resource type: ${String(exhaustiveResourceType)}`);\n }\n }\n}\n\nfunction createFlowActorTaskPage(data: readonly unknown[]) {\n return {\n data,\n pagination: { page: 1, limit: 20, total: data.length, totalPages: 1 },\n };\n}\n\nconst flowTaskPrimaryScopeByResourceType: Record<FlowTaskResourceType, ResourcePrimaryScope> = {\n [CoreResourceType.USER_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.USER_SELF,\n [CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.ORGANIZATIONS,\n [CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS]: ResourcePrimaryScope.APPLICATION,\n};\n\ntype Cfg = ReturnType<(typeof flowActorTasksPolymorphicFactories)[CoreResourceType.USER_FLOW_ACTOR_TASKS]>;\ntype Core = Cfg['coreOperations'][number];\ntype Main = typeof FlowActorTaskBaseSchema;\n\nfunction buildFlowActorTaskResourceSpecification(\n resourceType: FlowTaskResourceType,\n resourceTypeMemberName: FlowTaskResourceTypeMember,\n) {\n const exampleScope = createFlowActorTaskScopeExample(resourceType);\n const completedTaskExample = {\n _id: Object.values(exampleScope.resourceIdentity)[0],\n title: 'Prepare the weekly purchase-approval brief',\n status: FlowsActors_Status.COMPLETED,\n taskId: '22222222-2222-4222-8222-222222222222',\n flowActorExecutionId: '11111111-1111-4111-8111-111111111111',\n resourceServerInstanceRef: 'finance-operations-agent',\n machineCredentialId: exampleScope.machineCredentialId,\n contextId: 'finance-weekly-review-2026-w34',\n artifacts: [],\n createdAt: '2026-08-20T08:30:00.000Z',\n updatedAt: '2026-08-20T08:30:14.000Z',\n finishedAt: '2026-08-20T08:30:14.000Z',\n ...exampleScope.scopeIdentity,\n };\n const processingTaskExample = {\n ...completedTaskExample,\n _id: `${completedTaskExample._id}_processing`,\n title: 'Reconcile supplier exceptions',\n status: FlowsActors_Status.PROCESSING,\n taskId: '22222222-2222-4222-8222-222222222223',\n updatedAt: '2026-08-20T09:05:02.000Z',\n finishedAt: undefined,\n };\n const summarizeTask = (task: typeof completedTaskExample) => ({\n _id: task._id,\n taskId: task.taskId,\n status: task.status,\n title: task.title,\n });\n\n return resourceSpecification<undefined, Core, Main>(\n flowActorTasksPolymorphicFactories[resourceType],\n FlowActorTaskBaseSchema,\n ({ schemaShape }) => ({\n purpose: 'Track one addressable unit of agent work, including its lifecycle status, outputs, artifacts, and terminal outcome.',\n businessRole: 'The work record an authorized integration polls, collects results from, or cancels independently of the conversation that started it.',\n lifecycleRole: 'Materialised when a turn cannot complete inline: the client asked for a non-blocking turn (`blocking: false` / `returnImmediately: true`), the send carries a webhook for its task (a blocking one then waits and answers with the task), or the turn hit an approval pause and reached `auth-required`. Advances through working, and closes on completion, failure, or cancellation. Kept for the application\\'s declared RESOURCE_DATA period counted from its last update (`retentionBinding`, LAST_UPDATED), then deleted by the retention-class sweep (#2841).',\n audience: LabelAudience.DEVELOPER,\n subDomain: EngineResourceSubDomain.FLOWS_ACTORS,\n codeHandling: {\n mainSchema: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowActorTaskBaseSchema',\n symbolKind: CodeSymbolKind.SCHEMA,\n declarationKind: CodeDeclarationKind.ZOD_SCHEMA,\n },\n resourceFactoryCollectionEntry: {\n collectionSymbol: { packageName: '@wildo-ai/saas-models', exportName: 'flowActorTasksPolymorphicFactories', symbolKind: CodeSymbolKind.FACTORY },\n identifierField: 'collectionKey',\n identifierValue: resourceType,\n },\n resourceType: {\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceType',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n memberName: resourceTypeMemberName,\n },\n operationVocabulary: {\n coreEnum: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'CoreResourceOperation',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n },\n notes: [\n 'Derived from the canonical `Actors_Task_Schema` — the same contract the platform persists as `wildoApplicationActorTasks`, except that a persisted row stores its instants (`createdAt`, `updatedAt`, `startedAt`, `completedAt`) as dates (`timestamptz`) where the canonical contract carries ISO strings (#2187). Not a bespoke A2A task model.',\n 'Three variants under `FLOW_ACTOR_TASK_SCOPE_VARIANTS` — user row is `user_self`; org/app rows are `ORGANIZATIONS`/`APPLICATION` (machine-owned).',\n '`input` and `output` carry no field specification because they are untyped passthrough (`any`) inherited from the canonical task contract, and the specification framework offers no builder for an untyped field. Their portability provenance IS declared at the schema — `input` is subject-provided, `output` is derived — so the classification a portability bundle needs is not lost by the omission. Neither is written by the A2A transport today.',\n ],\n },\n\n fields: {\n taskId: schemaShape.taskId.stringSpec({\n meaning: 'Stable business id of the task, and the identity the A2A protocol addresses.',\n whyItMatters: 'This is the value returned as `Task.id` and accepted by `tasks/get` / `tasks/cancel` — the only handle an A2A client holds. Uniqueness is enforced PER VARIANT despite the `scope: \\'global\\'` decorator — the three variants are separate stores and no index spans them. Nothing depends on family-wide uniqueness, and a v4 uuid collision is not a real risk. Note what that does NOT mean: the read is still OWNER-FIRST. `readTask` filters on the owner fields derived from the authenticated principal AND the id, so a task belonging to another tenant answers exactly as a non-existent one does. Uniqueness is not what authorizes the read under either reading, so do not reason from it to isolation. Two earlier revisions of this sentence were wrong in opposite directions: one claimed the id \"must resolve without the caller knowing which owner scope the task belongs to\" (a lookup this resource does not perform), and one claimed `scope: \\'global\\'` gives FAMILY-WIDE uniqueness — it does not, because `global` means \"unique across the entire COLLECTION\" and each polymorphic variant is its own collection.',\n semanticRole: 'identifier',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n status: schemaShape.status.enumSpec({\n meaning: 'Current lifecycle state of the work.',\n whyItMatters: 'An A2A client sees this status as the protocol’s task state: `ready` and `pending` → submitted, `processing` → working, `awaiting_approval` → auth-required, `completed` → completed, `failed` and `aborted` → failed, `cancelled` → canceled. A task whose worker stopped is reported as failed once the worker’s hold on the task has expired, so an abandoned task never reads as still working. A task waiting on a person’s decision is exempt: waiting is its correct state, however long it lasts.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_Status',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n values: {\n [FlowsActors_Status.READY]: { meaning: 'Materialised and acknowledged, not yet processing — A2A `submitted`.' },\n [FlowsActors_Status.PENDING]: { meaning: 'Accepted but not yet actively processing — also projects to A2A `submitted`.' },\n [FlowsActors_Status.PROCESSING]: { meaning: 'Actively running — the agent is working the task. A2A `working`.' },\n [FlowsActors_Status.AWAITING_APPROVAL]: { meaning: 'Interrupted at a human-in-the-loop approval boundary, waiting on a human decision. A2A `auth-required` — non-terminal: the person decides in the application, never through a message on the task. Written when a turn pauses for a decision, together with the decision it paused on (`pausedOnDecisionRef`). The stored value stays while the decision is answered elsewhere; what a reader is told is derived from that decision, so a released task reads as working, finished, or unknown.' },\n [FlowsActors_Status.COMPLETED]: { meaning: 'Work finished successfully; outputs and artifacts are final. A2A `completed` (terminal).' },\n [FlowsActors_Status.FAILED]: { meaning: 'Work ended in error. A2A `failed` (terminal). Also the state an abandoned task resolves to when its liveness lease has expired.' },\n [FlowsActors_Status.CANCELLED]: { meaning: 'Cancelled before completion, via `tasks/cancel`. A2A `canceled` (terminal) — the record survives so the client can read its final state.' },\n [FlowsActors_Status.ABORTED]: { meaning: 'Halted by the runtime rather than by a caller (e.g. a circuit breaker tripped). Projects to A2A `failed` (terminal).' },\n },\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n contextId: schemaShape.contextId.stringSpec({\n meaning: 'The A2A conversation thread this task belongs to.',\n whyItMatters: 'Indexed so a client can enumerate every task of one conversation without walking execution records — the two planes stay queryable independently.',\n semanticRole: 'identifier',\n }),\n\n pausedOnDecisionRef: schemaShape.pausedOnDecisionRef.stringSpec({\n meaning: 'The id of the human decision this task\\'s turn paused on, written in the same write that moves the task to awaiting approval. Absent on a task that never paused. Never sent to an A2A client.',\n whyItMatters: 'The task is addressed by its own decision, not by its conversation thread. A thread outlives one task: a later task in the same thread can pause, be approved and resume while this row still reads awaiting approval. Read by the thread, this task\\'s state was whichever turn ran last, and cancelling it withdrew the later task\\'s decision and stopped its resumed turn. Read by this decision, the task reads as waiting, working, or ended, and its cancel reaches only its own work.',\n semanticRole: 'identifier',\n }),\n\n failureCode: schemaShape.failureCode.enumSpec({\n meaning: 'Why the task\\'s turn failed, written in the same write that records `failed`, and cleared on every other status. One of the execution error codes.',\n whyItMatters: 'A client polling a task reads why it failed from its status message, so a suspension, a withheld reply or a restart reads apart from a fault that invites a retry, as the blocking answer\\'s error code would have told it.',\n enumDeclaration: {\n packageName: '@wildo-ai/saas-models',\n exportName: 'FlowsActors_ExecutionErrorCode',\n symbolKind: CodeSymbolKind.ENUM,\n declarationKind: CodeDeclarationKind.TYPESCRIPT_ENUM,\n },\n }),\n\n resourceServerInstanceRef: schemaShape.resourceServerInstanceRef.stringSpec({\n meaning: 'Which A2A agent (resource-server instance) this task was created through. The default, unnamed agent is stored under a reserved sentinel rather than left empty.',\n whyItMatters: 'Part of the read and cancel FILTER, not descriptive metadata. A2A agents are declared as separate resource servers with per-instance token audiences, so an agent must have no side-door into another agent\\'s work. Without this dimension a token bound to one agent could read and cancel tasks created through another whenever both resolved to the same owner scope — and since `title` carries the opening characters of the originating prompt, that also disclosed prompt text across the boundary.',\n semanticRole: 'identifier',\n }),\n\n title: schemaShape.title.stringSpec({\n meaning: 'Short human-readable name for the work, shown wherever a task is listed.',\n whyItMatters: 'CONTENT-BEARING, and part of the summary projection: the A2A transport fills it with the opening characters of the ORIGINATING PROMPT. That is why it is classified as subject-provided for portability rather than observed, and why the read filter carries the agent-instance and machine-credential axes — a cross-principal read of this field discloses prompt text.',\n importance: FieldSemanticImportance.PRIMARY,\n }),\n\n description: schemaShape.description.stringSpec({\n meaning: 'Longer free-text description of the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided content, like the title. Absent on an A2A-materialised task today — the transport sets only a title — but retained from the canonical task contract so an orchestration producer can populate it without a schema change.',\n }),\n\n topic: schemaShape.topic.stringSpec({\n meaning: 'Subject-matter grouping for the work, when the producer supplied one.',\n whyItMatters: 'Subject-provided, and unset by the A2A transport. Kept from the canonical contract for the same reason as the description.',\n }),\n\n input: schemaShape.input.objectSpec({\n meaning: 'What the task was asked to do, when its producer recorded it.',\n whyItMatters: 'Subject-provided content. The A2A transport does not set it; the opening characters of the originating prompt are in `title`.',\n }),\n\n output: schemaShape.output.objectSpec({\n meaning: 'The result of the work. On the A2A transport it is the reply text, written only when the task completes successfully; an empty reply is still a result.',\n whyItMatters: 'DERIVED: it is set in the same guarded write that completes the task, so a cancellation that wins also refuses the reply, and a failed or approval-held task never shows one.',\n }),\n\n artifacts: schemaShape.artifacts.arraySpec({\n meaning: 'Artifacts the work produced, projected onto the protocol object for the client to collect.',\n elementMeaning: 'One artifact the work produced — its stable reference plus the typed parts that carry the content.',\n whyItMatters: 'DERIVED, like the output, and the one field of this family that reaches the wire as structured content. No writer populates it yet: the projection exists and is correct, but is unreachable by construction until an orchestration producer sets it.',\n }),\n\n machineCredentialId: schemaShape.machineCredentialId.stringSpec({\n meaning: 'Which machine credential opened this task. A user-delegated turn stores a reserved sentinel, because there the human is the principal.',\n whyItMatters: 'Part of the read and cancel FILTER, alongside the owner scope and the agent instance. The scope foreign key does not identify the principal on the machine variants: the application scope is a deployment singleton, so every application-scope client resolves to the same owner, and the organization scope is shared by every machine client of one tenant. Without this axis a separately-credentialed client could read and cancel another client\\'s work — and the title carries the opening characters of the originating prompt.',\n semanticRole: 'identifier',\n }),\n\n flowActorExecutionId: schemaShape.flowActorExecutionId.stringSpec({\n meaning: 'The conversational execution this task was materialised from, when there was one.',\n whyItMatters: 'A SOFT link, not a foreign key, and optional on purpose: a task is owned by its scope, not by an execution, so it may outlive — or exist without — the conversation that produced it. Deleting a conversation must never delete its work records.',\n semanticRole: 'identifier',\n }),\n\n createdAt: schemaShape.createdAt.dateSpec({\n meaning: 'When the task was materialised.',\n temporalRole: 'creation',\n }),\n\n updatedAt: schemaShape.updatedAt.dateSpec({\n meaning: 'When the task last advanced — a status transition, an artifact append, or a recorded outcome.',\n temporalRole: 'modified',\n }),\n\n finishedAt: schemaShape.finishedAt.dateSpec({\n meaning: 'When the task reached a terminal state (completed, failed, or canceled).',\n whyItMatters: 'Set when the repair — or a normal completion — lands. The sweep selects candidates by `updatedAt` older than a grace window AND a non-terminal `status`, then lets the liveness lease decide.',\n temporalRole: 'occurred',\n }),\n },\n\n operations: {\n [Op.CREATE]: {\n purpose: 'Materialise a task when a send must be addressable after its response: the client asked for immediate return, the turn paused for a human decision and has no answer to send, or the send carried a push-notification webhook (which needs a task to notify about).',\n outcome: 'The client receives an addressable task it can poll, cancel, and be notified about. A non-blocking send gets it at once; a blocking send that carried a webhook waits for the turn and answers with the task in its latest state.',\n whenToUse: 'Never called directly by a client. A task comes into existence as a consequence of a send, and only for one of those three reasons; an ordinary blocking send with no webhook answers with a message and writes no task.',\n },\n [Op.READ]: {\n purpose: 'Read one addressable unit of agent work and its current lifecycle state.',\n outcome: 'The caller learns whether the work is queued, active, waiting, complete, failed, or canceled, and receives any available artifacts.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The task was found within the caller\\'s own scope and is returned in its current state.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to inspect agent work for this user, organization, or application scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n rateLimitNote: 'Deliberately NOT rate-limited or budget-gated on the A2A path: polling a task is not a turn and consumes no model tokens, so throttling it would penalise exactly the clients that correctly asked not to block.',\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `Inspect completed ${exampleScope.scopeLabel} agent work with context`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: completedTaskExample,\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `Inspect the compact ${exampleScope.scopeLabel} task state`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: summarizeTask(completedTaskExample),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.LIST]: {\n purpose: 'List agent work visible in the requested scope, optionally filtered by conversation context or lifecycle status.',\n outcome: 'The caller can reconcile the work for one conversation or monitor unfinished work without walking conversation records.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The caller\\'s own tasks, scoped to their owner.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller is not allowed to list agent work for this scope.' },\n ],\n examples: [{\n title: `List active ${exampleScope.scopeLabel} tasks for one conversation`,\n request: {\n ...exampleScope.scopeIdentity,\n contextId: completedTaskExample.contextId,\n status: FlowsActors_Status.PROCESSING,\n page: 1,\n limit: 20,\n sort: 'updatedAt:desc',\n },\n response: createFlowActorTaskPage([processingTaskExample, completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n variants: {\n context: {\n examples: [{\n title: `List ${exampleScope.scopeLabel} tasks with resource context`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([completedTaskExample]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n summary: {\n examples: [{\n title: `List compact ${exampleScope.scopeLabel} task states`,\n request: { ...exampleScope.scopeIdentity, contextId: completedTaskExample.contextId, page: 1, limit: 20 },\n response: createFlowActorTaskPage([\n summarizeTask(processingTaskExample as typeof completedTaskExample),\n summarizeTask(completedTaskExample),\n ]),\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n },\n [Op.UPDATE]: {\n purpose: 'Advance the task — status transitions, appended artifacts, terminal outcome — and record cancellation.',\n outcome: 'The stored record reflects what actually happened to the work, which is what every other reader depends on.',\n whenToUse: 'Backs `tasks/cancel`, which is a STATUS TRANSITION rather than a delete: the A2A spec requires cancel to return the task\\'s updated state, so the record must survive it.',\n },\n [Op.DELETE]: {\n purpose: 'Permanently remove one stored unit of agent work from the requested scope.',\n outcome: 'The selected task record and its stored results are no longer available.',\n whenToUse: 'Use for deliberate history cleanup after the task is no longer needed; use cancellation instead when active work must stop but its final state must remain observable.',\n responseStatuses: [\n { code: HttpResponseStatusCode.OK_200, meaning: 'The selected task record was removed.' },\n ],\n errorScenarios: [\n { code: HttpResponseStatusCode.FORBIDDEN_403, when: 'The caller lacks task-removal authority in the requested scope.' },\n { code: HttpResponseStatusCode.NOT_FOUND_404, when: 'No task exists for the id in the requested scope.' },\n ],\n examples: [{\n title: `Remove completed ${exampleScope.scopeLabel} agent work`,\n request: { ...exampleScope.scopeIdentity, ...exampleScope.resourceIdentity },\n response: { id: completedTaskExample._id },\n forStatus: HttpResponseStatusCode.OK_200,\n }],\n },\n },\n\n businessConstraints: [\n 'A task belongs to exactly ONE owner scope — the injected owner FK is the only authority over its lifetime. The link to a conversational execution is soft and optional, and never governs deletion.',\n 'Not every turn produces a task. Turns that complete inline return a Message and write no row; a task is materialised only when the work needs an addressable lifecycle.',\n 'Cancellation is a status transition, never a deletion — a canceled task remains readable so the client can observe its final state.',\n 'A non-terminal task whose liveness lease has expired is reported as failed: the executing process died, and a task must never read as working forever.',\n ],\n }),\n // The owner is the injected scope FK, anchored by the `<SCOPE> → *FlowActorTasks`\n // primary-scope composition edge in `resources-registry.shared.core.definitions.ts`\n // (generated by `createPolymorphicScopeRelationships`). Feeds the spec ↔ registry\n // alignment guard and must match per variant.\n { resourcePrimaryScope: flowTaskPrimaryScopeByResourceType[resourceType] },\n );\n}\n\nexport const userFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.USER_FLOW_ACTOR_TASKS,\n 'USER_FLOW_ACTOR_TASKS',\n);\n\nexport const organizationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.ORGANIZATION_FLOW_ACTOR_TASKS,\n 'ORGANIZATION_FLOW_ACTOR_TASKS',\n);\n\nexport const applicationFlowActorTasksResourceSpecification = buildFlowActorTaskResourceSpecification(\n CoreResourceType.APPLICATION_FLOW_ACTOR_TASKS,\n 'APPLICATION_FLOW_ACTOR_TASKS',\n);\n"]}
|
package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js
CHANGED
|
@@ -57,7 +57,7 @@ export const organizationChatSettingsResourceSpecification = resourceSpecificati
|
|
|
57
57
|
fields: {
|
|
58
58
|
_id: schemaShape._id.stringSpec({ meaning: 'Identifier of one chat setting.', semanticRole: 'identifier', importance: FieldSemanticImportance.PRIMARY }),
|
|
59
59
|
organizationId: schemaShape.organizationId.foreignKeySpec({ meaning: 'The organization the choice is for.', whyItMatters: 'The only organization it applies in: another organization on the same connection makes its own choice.', importance: FieldSemanticImportance.PRIMARY }),
|
|
60
|
-
connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
60
|
+
connectionRef: schemaShape.connectionRef.stringSpec({ meaning: 'The chat connection the choice applies to, as the application names it (`slack`, `microsoft-teams-bot`): the same ref a chat identity link records. Shown by the vendor\'s name (the PROVIDER vocabulary, `providers.<ref>.displayName`), the ref itself only while that name is missing.', whyItMatters: 'Fixed once chosen; one row per connection per organization.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
61
61
|
chatAgentRef: schemaShape.chatAgentRef.stringSpec({ meaning: 'The declared chat agent that answers the organization\'s people on this connection.', whyItMatters: 'Decides which agent acts, as the member who wrote, on every message the organization\'s people send the bot on this connection.', semanticRole: 'code', importance: FieldSemanticImportance.PRIMARY }),
|
|
62
62
|
createdAt: schemaShape.createdAt.dateSpec({ meaning: 'When the organization first chose an agent for this connection.', temporalRole: 'creation' }),
|
|
63
63
|
updatedAt: schemaShape.updatedAt.dateSpec({ meaning: 'When the choice last changed.', temporalRole: 'modified' }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-chat-settings.resource.specification.js","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/organization-chat-settings.resource.specification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,IAAI,EAAE,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,mEAAmE,GACpE,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AACjE,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAEtD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;IAC/C,WAAW,EAAE,uBAAuB;IACpC,UAAU;IACV,UAAU,EAAE,cAAc,CAAC,IAAI;IAC/B,eAAe,EAAE,mBAAmB,CAAC,eAAe;CACrD,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,CAAI,IAAkB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAElJ,MAAM,cAAc,GAAG;IACrB,GAAG,EAAE,kBAAkB;IACvB,cAAc,EAAE,uBAAuB;IACvC,aAAa,E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AAC,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,I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E,IAAI,EAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC;YACnG,cAAc,EAAE,CAAC,oBAAoB,EAAE,SAAS,EAAE,kBAAkB,CAAC;YACrE,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,+BAA+B,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,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. 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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-agent-task-updates.resource.specification.d.ts","sourceRoot":"","sources":["../../../../../src/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,KAAK,8BAA8B,EAAiD,MAAM,6BAA6B,CAAC;AAUjI,eAAO,MAAM,2CAA2C,EAAE,8BAiFzD,CAAC"}
|